From 3da54bb59bfffa9db294c2bda75905650f795171 Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Wed, 7 Aug 2024 15:52:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E5=85=BC=E5=AE=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: bug#28509【设备】设备物模型属性类型为地理位置时,运行状态查看详情,选择图标展示筛选条件错误 * fix: bug#28513 【设备】设备详情界面,物联网卡和远程升级需做权限控制,当没有权限时,隐藏当前tab * fix: 视频中心仪表盘兼容数据处理 * chore: add dayjs * update: docker tag --- build.sh | 4 +- package.json | 3 +- src/components/Layout/BasicLayoutPage.vue | 2 +- src/components/Metadata/Table/body.vue | 7 ++- .../Detail/Running/Property/Detail/Charts.vue | 26 ++++++-- src/views/device/Instance/Detail/index.vue | 31 +++++----- src/views/device/Product/Detail/index.vue | 18 ++---- .../Cascade/Channel/BindChannel/index.vue | 35 +++-------- src/views/media/Cascade/Channel/index.vue | 10 +++- src/views/media/Cascade/Save/index.vue | 13 ++-- .../media/DashBoard/components/TopCard.vue | 4 +- .../media/Device/Channel/Live/index.less | 2 +- .../HandTrigger/components/Actions.vue | 6 +- .../rule-engine/Alarm/Configuration/index.vue | 13 +++- .../system/Apply/Save/components/EditForm.vue | 2 +- src/views/system/Menu/Detail/BasicInfo.vue | 4 ++ .../Platforms/Api/components/ApiDoes.vue | 59 ++++++++++--------- .../Platforms/Api/components/ApiTest.vue | 3 +- src/views/system/Platforms/Api/utils.ts | 34 ++++++++++- yarn.lock | 5 ++ 20 files changed, 171 insertions(+), 110 deletions(-) diff --git a/build.sh b/build.sh index fa023f7e..473d0d4d 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-TEST . -docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-TEST +docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.3.0-SNAPSHOT . +docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.3.0-SNAPSHOT diff --git a/package.json b/package.json index da0e34a9..c655e922 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jetlinks-vue", "private": true, - "version": "2.2.0", + "version": "2.2.1", "scripts": { "dev": "vite --mode develop", "dev:force": "vite --force --mode develop", @@ -29,6 +29,7 @@ "axios": "^1.2.1", "colorpicker-v3": "^2.10.2", "cronstrue": "^2.50.0", + "dayjs": "^1.11.12", "driver.js": "^0.9.8", "echarts": "^5.4.1", "event-source-polyfill": "^1.0.31", diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 1e974fe2..677bfcce 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -2,7 +2,7 @@ { const diffInSeconds = dayjs(val[1]).diff(dayjs(val[0]), 'minute'); if (diffInSeconds < 60) { - periodOptions.value = [ + periodOptions.value = _type.value ? [ { label: '实际值', value: '*', @@ -242,10 +242,15 @@ watch( label: '按分钟统计', value: '1m', }, - ]; - cycle.value = '*'; + ] : [ + { + label: '按分钟统计', + value: '1m', + }, + ] + cycle.value = _type.value ? '*' : '1m'; } else if (diffInSeconds < 1440) { - periodOptions.value = [ + periodOptions.value = _type.value ? [ { label: '实际值', value: '*', @@ -258,8 +263,17 @@ watch( label: '按小时统计', value: '1h', }, - ]; - cycle.value = '*'; + ] : [ + { + label: '按分钟统计', + value: '1m', + }, + { + label: '按小时统计', + value: '1h', + }, + ] + cycle.value = _type.value ? '*' : '1m'; } else if (diffInSeconds < 43200) { periodOptions.value = [ { diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index 07e0176f..e88a24bd 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -170,14 +170,6 @@ const initList = [ key: 'Log', tab: '日志管理', }, - { - key: 'CardManagement', - tab: '物联网卡', - }, - { - key: 'Firmware', - tab: '远程升级', - }, ]; const list = ref([...initList]); @@ -226,6 +218,18 @@ const getDetail = () => { tab: '预处理数据', }); } + if (permissionStore.hasPermission('iot-card/CardManagement:view')) { + list.value.push({ + key: 'CardManagement', + tab: '物联网卡', + }); + } + if (permissionStore.hasPermission('device/Firmware:view')) { + list.value.push({ + key: 'Firmware', + tab: '远程升级', + }); + } if ( instanceStore.current?.protocol && !['modbus-tcp', 'opc-ua'].includes(instanceStore.current?.protocol) && @@ -330,16 +334,11 @@ const getDetailFn = async () => { list.value = [...initList]; getDetail(); instanceStore.tabActiveKey = routerParams.params.value.tab || 'Info'; - }else{ + } else { instanceStore.tabActiveKey = routerParams.params.value.tab || 'Info'; } - }; -onMounted(() => { - getDetailFn(); -}); - const onTabChange = (e: string) => { if (instanceStore.tabActiveKey === 'Metadata') { EventEmitter.emit('MetadataTabs', () => { @@ -389,6 +388,10 @@ const jumpProduct = () => { }); }; +onMounted(() => { + getDetailFn(); +}); + onUnmounted(() => { instanceStore.current = {} as any; statusRef.value && statusRef.value.unsubscribe(); diff --git a/src/views/device/Product/Detail/index.vue b/src/views/device/Product/Detail/index.vue index 0c17eabc..0605bcea 100644 --- a/src/views/device/Product/Detail/index.vue +++ b/src/views/device/Product/Detail/index.vue @@ -193,10 +193,6 @@ const list = ref([ key: 'Device', tab: '设备接入', }, - { - key: 'Firmware', - tab: '远程升级', - }, ]); const tabs = { @@ -300,10 +296,6 @@ const getProtocol = async () => { key: 'DataAnalysis', tab: '数据解析', }, - { - key: 'Firmware', - tab: '远程升级', - }, ]; } else { list.value = [ @@ -320,10 +312,6 @@ const getProtocol = async () => { key: 'Device', tab: '设备接入', }, - { - key: 'Firmware', - tab: '远程升级', - }, ]; } } @@ -348,6 +336,12 @@ const getProtocol = async () => { tab: '预处理数据', }); } + if (permissionStore.hasPermission('device/Firmware:view')) { + list.value.push({ + key: 'Firmware', + tab: '远程升级', + }); + } } }; /** diff --git a/src/views/media/Cascade/Channel/BindChannel/index.vue b/src/views/media/Cascade/Channel/BindChannel/index.vue index 74223ccc..cc6003a8 100644 --- a/src/views/media/Cascade/Channel/BindChannel/index.vue +++ b/src/views/media/Cascade/Channel/BindChannel/index.vue @@ -1,19 +1,19 @@ @@ -420,6 +420,14 @@ const handleClose = (data: any) => { valid.value = undefined; gbID.value = ''; }; + +const cancel = () =>{ + bindVis.value = false +} +const submitData = () =>{ + bindVis.value = false + listRef.value?.reload() +}