From 7822393092a452e7f160b75ffee310e8749f0235 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 28 Feb 2023 21:32:47 +0800 Subject: [PATCH 01/18] =?UTF-8?q?feat:=20=E5=9C=BA=E6=99=AF=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rule-engine/scene.ts | 13 +- src/components/AIcon/index.tsx | 1 + src/components/Table/index.tsx | 2 +- .../Scene/Save/components/TriggerWay.vue | 2 +- src/views/rule-engine/Scene/Save/save.vue | 4 + src/views/rule-engine/Scene/SceneCard.vue | 370 ++++++++++++++++ src/views/rule-engine/Scene/index.vue | 399 +++++++++++++++--- src/views/system/Menu/Setting/baseMenu.ts | 4 +- 8 files changed, 730 insertions(+), 65 deletions(-) create mode 100644 src/views/rule-engine/Scene/SceneCard.vue diff --git a/src/api/rule-engine/scene.ts b/src/api/rule-engine/scene.ts index 0ae3e8dd..4c00c1ba 100644 --- a/src/api/rule-engine/scene.ts +++ b/src/api/rule-engine/scene.ts @@ -7,4 +7,15 @@ export const save = (data: any) => server.post(`/scene`, data) export const detail = (id: string) => server.get(`/scene/${id}`) -export const query = (data: any) => server.post('/scene/_query/',data); \ No newline at end of file +export const query = (data: any) => server.post('/scene/_query/',data); + +export const _delete = (id: string) => server.remove(`/scene/${id}/`); + +export const _action = (id: string, type: '_disable' | '_enable') => server.put(`/scene/${id}/${type}`); + +/** + * 手动触发 + * @param id + * @returns + */ +export const _execute = (id: string) => server.post(`/scene/${id}/_execute`); \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 6e1682a0..ca56c0c0 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -60,6 +60,7 @@ const iconKeys = [ 'RedoOutlined', 'VideoCameraOutlined', 'HistoryOutlined', + 'LikeOutlined' ] const Icon = (props: {type: string}) => { diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index ff88911e..5ed7fd38 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -158,7 +158,6 @@ const JTable = defineComponent({ const pageSize = ref(6) const total = ref(0) const loading = ref(true) - const loading1 = ref(true) const _columns = computed(() => props.columns.filter(i => !(i?.hideInTable))) @@ -240,6 +239,7 @@ const JTable = defineComponent({ ) onMounted(() => { + windowChange() // 初始化 window.onresize = () => { windowChange() } diff --git a/src/views/rule-engine/Scene/Save/components/TriggerWay.vue b/src/views/rule-engine/Scene/Save/components/TriggerWay.vue index 51d4aa5f..f0de0a66 100644 --- a/src/views/rule-engine/Scene/Save/components/TriggerWay.vue +++ b/src/views/rule-engine/Scene/Save/components/TriggerWay.vue @@ -28,7 +28,7 @@ type Emit = { const options = [ { value: 'device', label: '设备触发', tip: '适用于设备数据或行为满足触发条件时,执行指定的动作', image: getImage('/device-trigger.png') }, { value: 'manual', label: '手动触发', tip: '适用于第三方平台向物联网平台下发指令控制设备', image: getImage('/manual-trigger.png') }, - { value: 'timing', label: '定时触发', tip: '适用于定期执行固定任务', image: getImage('/timing-trigger.png') }, + { value: 'timer', label: '定时触发', tip: '适用于定期执行固定任务', image: getImage('/timing-trigger.png') }, ] const props = defineProps({ diff --git a/src/views/rule-engine/Scene/Save/save.vue b/src/views/rule-engine/Scene/Save/save.vue index ffb36c4f..59a041c8 100644 --- a/src/views/rule-engine/Scene/Save/save.vue +++ b/src/views/rule-engine/Scene/Save/save.vue @@ -66,6 +66,10 @@ const props = defineProps({ } }) +watchEffect(() => { + Object.assign(formModel, props.data) +}) + const emit = defineEmits() const title = computed(() => { diff --git a/src/views/rule-engine/Scene/SceneCard.vue b/src/views/rule-engine/Scene/SceneCard.vue new file mode 100644 index 00000000..a47d582c --- /dev/null +++ b/src/views/rule-engine/Scene/SceneCard.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/src/views/rule-engine/Scene/index.vue b/src/views/rule-engine/Scene/index.vue index e317f0ce..a274a89a 100644 --- a/src/views/rule-engine/Scene/index.vue +++ b/src/views/rule-engine/Scene/index.vue @@ -1,68 +1,340 @@ \ No newline at end of file diff --git a/src/views/system/Menu/Setting/baseMenu.ts b/src/views/system/Menu/Setting/baseMenu.ts index 6fb8cdbf..58de80c7 100644 --- a/src/views/system/Menu/Setting/baseMenu.ts +++ b/src/views/system/Menu/Setting/baseMenu.ts @@ -1906,7 +1906,7 @@ export default [ ], }, { - id: 'tigger', + id: 'trigger', name: '手动触发', permissions: [ { @@ -2323,7 +2323,7 @@ export default [ ], }, { - id: 'tigger', + id: 'trigger', name: '手动触发', permissions: [ { From 1634d01c2a7563fc674f8326282e00135bd0978a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 28 Feb 2023 21:37:56 +0800 Subject: [PATCH 02/18] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/rule-engine/Scene/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/rule-engine/Scene/index.vue b/src/views/rule-engine/Scene/index.vue index a274a89a..093f192c 100644 --- a/src/views/rule-engine/Scene/index.vue +++ b/src/views/rule-engine/Scene/index.vue @@ -110,7 +110,7 @@ @click="i.onClick" type="link" style="padding: 0px" - :hasPermission="'device/Instance:' + i.key" + :hasPermission="'rule-engine/Scene:' + i.key" > From 962fa72fdb415d439747f51be1d2dd85268e2f34 Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Tue, 28 Feb 2023 21:49:28 +0800 Subject: [PATCH 03/18] =?UTF-8?q?feat:=20=E5=91=8A=E8=AD=A6=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rule-engine/log.ts | 7 +- src/components/AIcon/index.tsx | 2 + .../rule-engine/Alarm/Configuration/index.vue | 144 +++++++----------- .../rule-engine/Alarm/Log/Detail/index.vue | 38 +++++ .../rule-engine/Alarm/Log/SolveLog/index.vue | 79 ++++++++++ .../Alarm/Log/TabComponent/indev.vue | 144 ++++++++++++++---- src/views/rule-engine/Instance/index.vue | 93 ++++------- 7 files changed, 325 insertions(+), 182 deletions(-) create mode 100644 src/views/rule-engine/Alarm/Log/Detail/index.vue create mode 100644 src/views/rule-engine/Alarm/Log/SolveLog/index.vue diff --git a/src/api/rule-engine/log.ts b/src/api/rule-engine/log.ts index 05eddf37..77cc3dbe 100644 --- a/src/api/rule-engine/log.ts +++ b/src/api/rule-engine/log.ts @@ -18,4 +18,9 @@ export const getOrgList = (parmas?:any) => server.get('/organization/_query/no-p /** * 搜索 */ -export const query = (data:any) => server.post('/alarm/record/_query/',data); \ No newline at end of file +export const query = (data:any) => server.post('/alarm/record/_query/',data); + +/** + * 告警处理 + */ +export const handleLog = (data:any) => server.post('/alarm/record/_handle',data) \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index e239a887..d80de076 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -60,6 +60,8 @@ const iconKeys = [ 'RedoOutlined', 'VideoCameraOutlined', 'HistoryOutlined', + 'ToolOutlined', + 'FileOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/rule-engine/Alarm/Configuration/index.vue b/src/views/rule-engine/Alarm/Configuration/index.vue index 29ba5a12..ef5424b2 100644 --- a/src/views/rule-engine/Alarm/Configuration/index.vue +++ b/src/views/rule-engine/Alarm/Configuration/index.vue @@ -9,6 +9,7 @@ {{ slotProps.name }} @@ -70,48 +71,25 @@ @@ -151,45 +129,29 @@ @@ -214,7 +176,6 @@ import { message } from 'ant-design-vue'; import { getImage } from '@/utils/comm'; import { useMenuStore } from '@/store/menu'; import encodeQuery from '@/utils/encodeQuery'; -import { useStorage } from '@vueuse/core'; const params = ref>({}); let isAdd = ref(0); let title = ref(''); @@ -290,8 +251,11 @@ const columns = [ sorts: { createTime: 'desc' }, }), ); - if(res.status === 200){ - return res.result.map((item:any) => ({label:item.name, value:item.id})) + if (res.status === 200) { + return res.result.map((item: any) => ({ + label: item.name, + value: item.id, + })); } return []; }, @@ -303,26 +267,26 @@ const columns = [ key: 'state', scopedSlots: true, search: { - type: 'select', - options: [ - { - label: '正常', - value: 'enabled', - }, - { - label: '禁用', - value: 'disabled', - }, - ], - }, + type: 'select', + options: [ + { + label: '正常', + value: 'enabled', + }, + { + label: '禁用', + value: 'disabled', + }, + ], + }, }, { title: '说明', dataIndex: 'description', key: 'description', - search:{ - type:'string', - } + search: { + type: 'string', + }, }, { title: '操作', @@ -396,7 +360,11 @@ const getActions = ( icon: 'EditOutlined', onClick: () => { - menuStory.jumpPage('rule-engine/Alarm/Configuration/Save',{},{id:data.id}); + menuStory.jumpPage( + 'rule-engine/Alarm/Configuration/Save', + {}, + { id: data.id }, + ); }, }, { @@ -456,8 +424,6 @@ const getActions = ( icon: 'DeleteOutlined', }, ]; - if (type === 'card') - return actions.filter((i: ActionsType) => i.key !== 'view'); return actions; }; const add = () => { diff --git a/src/views/rule-engine/Alarm/Log/Detail/index.vue b/src/views/rule-engine/Alarm/Log/Detail/index.vue new file mode 100644 index 00000000..4980305b --- /dev/null +++ b/src/views/rule-engine/Alarm/Log/Detail/index.vue @@ -0,0 +1,38 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Log/SolveLog/index.vue b/src/views/rule-engine/Alarm/Log/SolveLog/index.vue new file mode 100644 index 00000000..61b34dd0 --- /dev/null +++ b/src/views/rule-engine/Alarm/Log/SolveLog/index.vue @@ -0,0 +1,79 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Log/TabComponent/indev.vue b/src/views/rule-engine/Alarm/Log/TabComponent/indev.vue index fede21b6..b4eb3c9e 100644 --- a/src/views/rule-engine/Alarm/Log/TabComponent/indev.vue +++ b/src/views/rule-engine/Alarm/Log/TabComponent/indev.vue @@ -24,11 +24,18 @@ v-if="props.type === 'org'" @search="search" > - + + + @@ -111,6 +133,11 @@ import { useAlarmStore } from '@/store/alarm'; import { storeToRefs } from 'pinia'; import { Store } from 'jetlinks-store'; import moment from 'moment'; +import type { ActionsType } from '@/components/Table'; +import SolveLog from '../SolveLog/index.vue' +import { useMenuStore } from '@/store/menu'; +const menuStory = useMenuStore(); + const alarmStore = useAlarmStore(); const { data } = storeToRefs(alarmStore); const getDefaulitLevel = () => { @@ -156,11 +183,11 @@ const columns = [ }, }, { - title: '最近告警事件', + title: '最近告警时间', dataIndex: 'alarmTime', key: 'alarmTime', search: { - type: 'dateTime', + type: 'date', }, }, { @@ -254,12 +281,7 @@ let param = reactive({ pageSize: 10, terms: [], }); -// let dataSource = reactive({ -// data: [], -// pageSize: 10, -// pageIndex: 0, -// total: 0, -// }); + const handleSearch = async (params: any) => { const resp = await query(params); if (resp.status === 200) { @@ -284,33 +306,97 @@ const handleSearch = async (params: any) => { }; watchEffect(() => { if (props.type !== 'all' && !props.id) { - params.value.terms.push({ - termType: 'eq', - column: 'targetType', - value: props.type, - type: 'and', - }); + params.value.terms = [ + { + termType: 'eq', + column: 'targetType', + value: props.type, + type: 'and', + }, + ]; } if (props.id) { - params.value.terms.push({ - termType: 'eq', - column: 'alarmConfigId', - value: props.id, - type: 'and', - }); + params.value.terms = [ + { + termType: 'eq', + column: 'alarmConfigId', + value: props.id, + type: 'and', + }, + ]; + } + if(props.type === 'all'){ + params.value.terms = []; } }); const search = (data: any) => { - const dt = { - pageSize: 10, - terms: [...data?.terms], - }; + params.value.terms = [...data?.terms]; + if (props.type !== 'all' && !props.id) { + params.value.terms.push( + { + termType: 'eq', + column: 'targetType', + value: props.type, + type: 'and', + }, + ); + } + if (props.id) { + params.value.terms.push ( + { + termType: 'eq', + column: 'alarmConfigId', + value: props.id, + type: 'and', + }, + ); + } }; -const log = () => { - console.log(data.value.defaultLevel); + +const getActions = ( + currentData: Partial>, + type: 'card', +): ActionsType[] => { + if (!currentData) return []; + const actions = [ + { + key: 'solve', + text: '告警处理', + tooltip: { + title: '告警处理', + }, + icon: 'ToolOutlined', + onClick: () =>{ + data.value.current = currentData; + data.value.solveVisible = true; + } + }, + { + key: 'log', + text: '告警日志', + tooltip: { + title: '告警日志', + }, + icon: 'FileOutlined', + onClick: () =>{ + menuStory.jumpPage(`rule-engine/Alarm/Log/Detail`,{id:currentData.id}); + } + }, + { + key: 'detail', + text: '处理记录', + tooltip: { + title: '处理记录', + }, + icon: 'FileTextOutlined', + }, + ]; + return actions; }; -log(); +const closeSolve = () =>{ + data.value.solveVisible = false +} diff --git a/src/views/rule-engine/Instance/index.vue b/src/views/rule-engine/Instance/index.vue index 68fa99d0..f7440f1c 100644 --- a/src/views/rule-engine/Instance/index.vue +++ b/src/views/rule-engine/Instance/index.vue @@ -40,7 +40,7 @@ @@ -113,38 +92,26 @@ + + From 2456da950d2b683bbc6c845c27c6aa31d4363c14 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 28 Feb 2023 21:54:33 +0800 Subject: [PATCH 04/18] =?UTF-8?q?feat:=20=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/media/Cascade/Save/index.vue | 87 ++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/src/views/media/Cascade/Save/index.vue b/src/views/media/Cascade/Save/index.vue index 231d0b19..114a52bc 100644 --- a/src/views/media/Cascade/Save/index.vue +++ b/src/views/media/Cascade/Save/index.vue @@ -157,8 +157,7 @@ message: '请输入上级SIP 地址', }, { - max: 64, - message: '最多可输入64个字符', + validator: checkSIP, }, ]" > @@ -213,7 +212,10 @@ :rules="[ { required: true, - message: '请输入SIP本地地址', + message: '请选择SIP本地地址', + }, + { + validator: checkLocalSIP, }, ]" > @@ -242,11 +244,8 @@ - - 1 - - + :options="allListPorts" + /> @@ -261,8 +260,7 @@ message: '请输入SIP远程地址', }, { - max: 64, - message: '最多可输入64个字符', + validator: checkPublicSIP, }, ]" > @@ -303,6 +301,7 @@ UDP @@ -614,16 +613,27 @@ getClustersList(); /** * SIP本地地址 */ -const allList = ref([]); +const allList = ref([]); const getAllList = async () => { const { result } = await CascadeApi.all(); allList.value = result.map((m: any) => ({ label: m.host, value: m.host, })); + setPorts(); }; getAllList(); +/** + * 传输协议改变, 获取对应的端口 + */ +const allListPorts = ref([]); +const setPorts = () => { + allListPorts.value = allList.value.find( + (f: any) => f.host === formData.value.host, + )?.ports[formData.value.transport || '']; +}; + /** * 获取详情 */ @@ -667,6 +677,61 @@ onMounted(() => { getDetail(); }); +const regDomain = + /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/; +/** + * 上级SIP地址 字段验证 + * @param _ + * @param value 此处绑定的是 remoteAddress + */ +const checkSIP = (_: any, value: string) => { + return checkHost(value, formData.value.remotePort); +}; +/** + * SIP远程地址 字段验证 + * @param _ + * @param value 此处绑定的是 publicHost + */ +const checkPublicSIP = (_: any, value: string) => { + return checkHost(value, formData.value.publicPort); +}; + +/** + * 字段验证 + * @param host ip + * @param port 端口 + */ +const checkHost = (host: string, port: string | number | undefined) => { + if (!host) { + return Promise.resolve(); + } else if (!host) { + return Promise.reject(new Error('请输入IP 地址')); + } else if (host && !regDomain.test(host)) { + return Promise.reject(new Error('请输入正确的IP地址')); + } else if (!port) { + return Promise.reject(new Error('请输入端口')); + } else if ((host && Number(host) < 1) || Number(host) > 65535) { + return Promise.reject(new Error('端口请输入1~65535之间的正整数')); + } + return Promise.resolve(); +}; + +/** + * SIP本地地址 字段验证 + * @param _ + * @param value + */ +const checkLocalSIP = (_: any, value: string) => { + if (!value) { + return Promise.resolve(); + } else if (!value) { + return Promise.reject(new Error('请选择IP地址')); + } else if (!formData.value.port) { + return Promise.reject(new Error('请选择端口')); + } + return Promise.resolve(); +}; + /** * 表单提交 */ From c8ff870a8acde0cc17186463267ee372b11f27d0 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 28 Feb 2023 21:58:51 +0800 Subject: [PATCH 05/18] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/media/Cascade/Save/index.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/views/media/Cascade/Save/index.vue b/src/views/media/Cascade/Save/index.vue index 114a52bc..1b9155f4 100644 --- a/src/views/media/Cascade/Save/index.vue +++ b/src/views/media/Cascade/Save/index.vue @@ -557,14 +557,11 @@ + + diff --git a/src/views/home/components/InitHome/index.vue b/src/views/home/components/InitHome/index.vue index 888aae8a..6ecfbc39 100644 --- a/src/views/home/components/InitHome/index.vue +++ b/src/views/home/components/InitHome/index.vue @@ -10,7 +10,7 @@ :class="{ selected: selectValue === 'device' }" @click="selectValue = 'device'" > - + - + - + import { setView_api } from '@/api/home'; +import { getImage } from '@/utils/comm'; const emits = defineEmits(['refresh']); const selectValue = ref('device'); diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 04e6ac88..73a2948b 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -6,8 +6,26 @@ - - + + @@ -19,14 +37,16 @@ import DeviceHome from './components/DeviceHome/index.vue'; import DevOpsHome from './components/DevOpsHome/index.vue'; import ComprehensiveHome from './components/ComprehensiveHome/index.vue'; import Api from '@/views/system/Platforms/Api/index.vue'; +import { useUserInfo } from '@/store/userInfo'; import { isNoCommunity } from '@/utils/utils'; import { getMe_api, getView_api } from '@/api/home'; - -const router = useRouter(); +import { getAppInfo_api } from '@/api/system/apply'; const currentView = ref(''); const loading = ref(true); +const clientId = useUserInfo().$state.userInfos.id; +const secureKey = ref(''); // 获取选择的视图 const setCurrentView = () => { @@ -49,7 +69,12 @@ if (isNoCommunity) { item.type === 'api-client' || item.type.id === 'api-client', ); - isApiUser ? router.push('/system/api') : setCurrentView(); + if (isApiUser) { + currentView.value = 'api'; + getAppInfo_api(clientId).then((resp: any) => { + secureKey.value = resp.result.apiServer.secureKey; + }); + } else setCurrentView(); } }); } else setCurrentView(); @@ -57,7 +82,15 @@ if (isNoCommunity) { diff --git a/src/views/system/Apply/Api/index.vue b/src/views/system/Apply/Api/index.vue index f42c9b7c..80c31416 100644 --- a/src/views/system/Apply/Api/index.vue +++ b/src/views/system/Apply/Api/index.vue @@ -1,12 +1,13 @@ diff --git a/src/views/system/Apply/View/index.vue b/src/views/system/Apply/View/index.vue index 8e67c7ce..9a0aaef1 100644 --- a/src/views/system/Apply/View/index.vue +++ b/src/views/system/Apply/View/index.vue @@ -1,14 +1,45 @@ - + diff --git a/src/views/system/Platforms/Api/components/ChooseApi.vue b/src/views/system/Platforms/Api/components/ChooseApi.vue index 66103ba8..675968e9 100644 --- a/src/views/system/Platforms/Api/components/ChooseApi.vue +++ b/src/views/system/Platforms/Api/components/ChooseApi.vue @@ -3,7 +3,7 @@ @@ -16,7 +16,9 @@ - 保存 + 保存 diff --git a/src/views/system/Platforms/Api/components/LeftTree.vue b/src/views/system/Platforms/Api/components/LeftTree.vue index 7420a355..2f2dc316 100644 --- a/src/views/system/Platforms/Api/components/LeftTree.vue +++ b/src/views/system/Platforms/Api/components/LeftTree.vue @@ -132,11 +132,9 @@ const filterPath = (path: object, filterArr: string[]) => { delete value[prop]; } } - if(Object.keys(value).length === 0) delete path[key] + if (Object.keys(value).length === 0) delete path[key]; } } - console.log(path, filterArr); - return path; }; diff --git a/src/views/system/Platforms/Api/index.vue b/src/views/system/Platforms/Api/index.vue index be81a8e2..2597594f 100644 --- a/src/views/system/Platforms/Api/index.vue +++ b/src/views/system/Platforms/Api/index.vue @@ -3,7 +3,7 @@
- + @@ -71,7 +72,6 @@ import ChooseApi from './components/ChooseApi.vue'; import ApiDoes from './components/ApiDoes.vue'; import ApiTest from './components/ApiTest.vue'; -const route = useRoute(); const props = defineProps<{ mode: modeType; showTitle?: boolean; @@ -117,15 +117,17 @@ const initSelectedApi: apiDetailsType = { }; const selectedApi = ref(initSelectedApi); -const canSelectKeys = ref([]); // 左侧可展示的项 const selectedKeys = ref([]); // 右侧默认勾选的项 let selectSourceKeys = ref([]); init(); function init() { - const code = route.query.code; + // 右侧默认选中初始化 if (props.mode === 'appManger') { - } else if (props.mode === 'home') { + getApiGranted_api(props.code as string).then((resp) => { + selectedKeys.value = resp.result as string[]; + selectSourceKeys.value = [...(resp.result as string[])]; + }) } else if (props.mode === 'api') { apiOperations_api().then((resp) => { selectedKeys.value = resp.result as string[]; From 9c0f50661865dfd0c723df17dc114b3c79a67204 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Wed, 1 Mar 2023 10:26:27 +0800 Subject: [PATCH 09/18] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style/variable.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/style/variable.less b/src/style/variable.less index 12011264..667349d7 100644 --- a/src/style/variable.less +++ b/src/style/variable.less @@ -1,5 +1,5 @@ -//@import 'ant-design-vue/es/style/themes/default.less'; -@import 'jetlinks-ui-components/es/style/default.less'; +@import 'ant-design-vue/es/style/themes/default.less'; +//@import 'jetlinks-ui-components/es/style/default.less'; .ellipsisFn(@num: 1, @width: 100%) { display: -webkit-box; From fac1b5d1df1833afbc59ac319e90e5bfc730929a Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Wed, 1 Mar 2023 11:40:12 +0800 Subject: [PATCH 10/18] =?UTF-8?q?update:=20=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E8=A1=A8=E5=8D=95=E6=95=B0=E6=8D=AE=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/Instance/Detail/Function/index.vue | 26 ++++++++++---- src/views/media/Cascade/Save/index.vue | 35 +++++-------------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/views/device/Instance/Detail/Function/index.vue b/src/views/device/Instance/Detail/Function/index.vue index 9d438dd8..bc9cb53d 100644 --- a/src/views/device/Instance/Detail/Function/index.vue +++ b/src/views/device/Instance/Detail/Function/index.vue @@ -1,12 +1,13 @@