From 80faeb5f0f22f88db2634027f0755836c23d1d25 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 9 Mar 2023 15:05:05 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E8=87=AA?= =?UTF-8?q?=E6=B5=8B=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/BootCardSmall.vue | 27 +++++-------------- .../components/ComprehensiveHome/index.vue | 5 +--- .../home/components/DevOpsHome/index.vue | 6 ++--- src/views/home/components/DeviceCountCard.vue | 18 ++++++++----- src/views/home/index.vue | 7 ++--- 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/src/views/home/components/BootCardSmall.vue b/src/views/home/components/BootCardSmall.vue index 1b2c3080..bc811cdb 100644 --- a/src/views/home/components/BootCardSmall.vue +++ b/src/views/home/components/BootCardSmall.vue @@ -28,34 +28,19 @@ diff --git a/src/views/home/components/ComprehensiveHome/index.vue b/src/views/home/components/ComprehensiveHome/index.vue index bd103aa4..7fdf7ecf 100644 --- a/src/views/home/components/ComprehensiveHome/index.vue +++ b/src/views/home/components/ComprehensiveHome/index.vue @@ -182,10 +182,7 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP3', label: '实时监控', - link: 'link/Dashboard', - params: { - save: true, - }, + link: 'link/DashBoard', image: '/images/home/guide-home6.png', }, ]; diff --git a/src/views/home/components/DevOpsHome/index.vue b/src/views/home/components/DevOpsHome/index.vue index 7b28a992..2aca3796 100644 --- a/src/views/home/components/DevOpsHome/index.vue +++ b/src/views/home/components/DevOpsHome/index.vue @@ -32,12 +32,12 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP1', label: '设备接入配置', - link: 'link/accessConfig', + link: 'link/AccessConfig', }, { english: 'STEP2', label: '日志排查', - link: 'link/Log', + link: 'Log', params: { key: 'system', }, @@ -45,7 +45,7 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP3', label: '实时监控', - link: 'link/dashboard', + link: 'link/DashBoard', params: { type: 'add', }, diff --git a/src/views/home/components/DeviceCountCard.vue b/src/views/home/components/DeviceCountCard.vue index a22e3483..e2b6cfce 100644 --- a/src/views/home/components/DeviceCountCard.vue +++ b/src/views/home/components/DeviceCountCard.vue @@ -26,13 +26,19 @@ const { jumpPage } = useMenuStore(); const projectNum = ref(0); const deviceNum = ref(0); +const menuPermission = useMenuStore().hasPermission; const getData = () => { - getDeviceCount_api().then((resp: any) => { - deviceNum.value = resp.result; - }); - getProductCount_api({}).then((resp: any) => { - projectNum.value = resp.result; - }); + // 有产品菜单权限则获取数据 + menuPermission('device/Product') && + getDeviceCount_api().then((resp: any) => { + deviceNum.value = resp.result; + }); + + // 有设备菜单权限则获取数据 + menuPermission('device/Instance') && + getProductCount_api({}).then((resp: any) => { + projectNum.value = resp.result; + }); }; getData(); diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 73a2948b..9ace54d0 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -52,9 +52,10 @@ const secureKey = ref(''); const setCurrentView = () => { getView_api().then((resp: any) => { if (resp.status === 200) { - if (resp.result) currentView.value = resp.result?.content; - else if (resp.result.username === 'admin') { - currentView.value = 'comprehensive'; + if (resp.result) { + if (resp.result.username === 'admin') + currentView.value = 'comprehensive'; + else currentView.value = resp.result?.content; } else currentView.value = 'init'; } }); From 57a2aceaa9ee4ecda7e3535298310880d9ac3d7d Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Thu, 9 Mar 2023 16:02:39 +0800 Subject: [PATCH 02/11] =?UTF-8?q?update:=20=E8=A7=86=E9=A2=91=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E7=BB=84=E4=BB=B6=E6=9B=BF=E6=8D=A2=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/media/Device/Save/SaveProduct.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/media/Device/Save/SaveProduct.vue b/src/views/media/Device/Save/SaveProduct.vue index 09c5d573..298c1b49 100644 --- a/src/views/media/Device/Save/SaveProduct.vue +++ b/src/views/media/Device/Save/SaveProduct.vue @@ -84,14 +84,16 @@ ?.addresses" :key="`${i.address}_address${idx}`" > - + + +

@@ -263,6 +265,7 @@ const handleCancel = () => { text-align: center; .gateway-item { padding: 16px; + text-align: left; .card-item-content-title, .desc, .subtitle { From 16422906087fd34cf396b3b3f6d8d575cef7e669 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Thu, 9 Mar 2023 16:04:11 +0800 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=A7=84=E5=88=99=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FRuleEditor/Debug/index.vue | 10 +- src/components/FRuleEditor/index.vue | 1 - .../Metadata/VirtualRuleParam/index.vue | 2 +- .../Metadata/Base/Edit/ExpandsForm.vue | 2 +- .../device/components/Metadata/Base/index.vue | 110 +++++++++++------- 5 files changed, 73 insertions(+), 52 deletions(-) diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue index 14257edb..1d89dd9a 100644 --- a/src/components/FRuleEditor/Debug/index.vue +++ b/src/components/FRuleEditor/Debug/index.vue @@ -135,18 +135,18 @@ const runScript = () => { }); if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } if (!props.virtualRule?.script) { isBeginning.value = true; message.warning('请编辑规则'); return; } - ws.value = getWebSocket(`virtual-property-debug-${ruleEditorStore.state.property}-${new Date().getTime()}`, + ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`, '/virtual-property-debug', { virtualId: `${virtualIdRef.value}-virtual-id`, - property: ruleEditorStore.state.property, + property: props.id, virtualRule: { ...props.virtualRule, }, @@ -163,7 +163,7 @@ const beginAction = () => { const stopAction = () => { isBeginning.value = true; if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } } const clearAction = () => { @@ -172,7 +172,7 @@ const clearAction = () => { onUnmounted(() => { if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } }) diff --git a/src/components/FRuleEditor/index.vue b/src/components/FRuleEditor/index.vue index 70cb6fe4..bd12a913 100644 --- a/src/components/FRuleEditor/index.vue +++ b/src/components/FRuleEditor/index.vue @@ -1,6 +1,5 @@ diff --git a/src/components/Metadata/VirtualRuleParam/index.vue b/src/components/Metadata/VirtualRuleParam/index.vue index b8a712f9..5452a0e5 100644 --- a/src/components/Metadata/VirtualRuleParam/index.vue +++ b/src/components/Metadata/VirtualRuleParam/index.vue @@ -1,6 +1,6 @@