From 251c7b982bc6f5d29dcfd93ae0a3ce7c2156fa4a Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Thu, 30 May 2024 10:34:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug#24641=E3=80=8124804=E3=80=8125111?= =?UTF-8?q?=E3=80=8122958=E3=80=8124806=E3=80=8125377=E3=80=8125597?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 优化物联卡批量导入数量统计;优化物联卡状态查询列表 * fix: 24641、24804、25111、22958、24806、25377、25597 * feat: 修改区域管理删除逻辑 * fix: bug#24628、25704 * fix: bug#24545 * fix: bug#25414 * fix: bug#24479 * fix: bug#23410 * fix: bug#24404 * fix: bug#25374 * fix: bug#25062 * fix: bug#22409 * fix: bug#25525、26083 * fix: bug#26186 * fix: bug#26233 --- build.sh | 2 +- src/api/rule-engine/log.ts | 6 + src/api/system/region.ts | 4 +- src/api/system/role.ts | 1 + src/components/AMapComponent/index.vue | 6 +- src/components/AMapComponent/utils.ts | 2 +- src/store/scene.ts | 2 +- src/views/device/Firmware/Save/index.vue | 342 +++++++++-------- src/views/device/Firmware/Task/Save/index.vue | 2 +- .../device/Instance/Detail/Info/index.vue | 159 ++++---- .../Product/Detail/DeviceAccess/index.vue | 15 + .../Product/Detail/MetadataMap/index.vue | 6 +- .../components/Metadata/Import/index.vue | 11 + .../components/Metadata/Import/valideta.ts | 2 - .../iot-card/CardManagement/Detail/index.vue | 12 +- .../iot-card/CardManagement/UploadFile.vue | 4 +- src/views/iot-card/CardManagement/index.vue | 19 +- src/views/media/Device/Save/index.vue | 38 +- src/views/notice/Config/Debug/index.vue | 2 + src/views/notice/Template/Debug/index.vue | 2 + .../Detail/components/VariableDefinitions.vue | 2 + src/views/notice/Template/Detail/index.vue | 1 + .../Configuration/Save/Scene/Save/index.vue | 67 ++-- .../rule-engine/Alarm/Log/Detail/index.vue | 109 +++--- .../Alarm/Log/TabComponent/index.vue | 127 ++++--- src/views/rule-engine/DashBoard/index.vue | 4 +- .../Save/action/Device/actions/EditTable.vue | 15 +- .../Save/components/Terms/ParamsItem.vue | 16 +- .../Scene/Save/components/Terms/Terms.vue | 2 +- src/views/rule-engine/Scene/Save/index.vue | 1 - .../system/Apply/Save/components/EditForm.vue | 7 +- .../Apply/Save/components/InputGroup.vue | 69 ++++ src/views/system/Apply/index.vue | 33 +- .../NoticeRule/components/Auth/index.vue | 1 + .../NoticeRule/components/Detail/index.vue | 2 +- .../NoticeRule/components/Save/index.vue | 1 + src/views/system/Platforms/Api/utils.ts | 3 +- src/views/system/Region/LeftTree/index.vue | 240 ++++++++---- src/views/system/Region/MapTool/map.vue | 329 +++------------- src/views/system/Region/Save/BuildIn.vue | 190 +++++----- src/views/system/Region/Save/TracePoint.vue | 45 --- src/views/system/Region/Save/index.vue | 350 ++++++++++-------- src/views/system/Region/hooks.ts | 51 +++ src/views/system/Region/index.vue | 22 +- .../system/Role/Detail/Permiss/index.vue | 22 +- src/views/system/Role/RoleLeft/index.vue | 1 + src/views/system/User/index.vue | 89 +++-- vite.config.ts | 2 +- 48 files changed, 1295 insertions(+), 1143 deletions(-) create mode 100644 src/views/system/Apply/Save/components/InputGroup.vue delete mode 100644 src/views/system/Region/Save/TracePoint.vue create mode 100644 src/views/system/Region/hooks.ts diff --git a/build.sh b/build.sh index 5bbf1f2e..2be39c63 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-SNAPSHOT . +docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-SNAPSHOT. docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.2.0-SNAPSHOT diff --git a/src/api/rule-engine/log.ts b/src/api/rule-engine/log.ts index 35ee09ad..1f88a9d5 100644 --- a/src/api/rule-engine/log.ts +++ b/src/api/rule-engine/log.ts @@ -38,8 +38,14 @@ export const detail = (id:string) => server.get(`/alarm/record/${id}`); /** * 告警历史记录 */ +export const queryHistoryLogList = (alarmConfigId: string, data:any) => server.post(`/alarm/history/${alarmConfigId}/_query`,data); + +/** + * 告警日志 + */ export const queryHistoryList = (data:any) => server.post('/alarm/history/_query',data); + /** * 获取告警处理结果 */ diff --git a/src/api/system/region.ts b/src/api/system/region.ts index 80f5d217..4114ef50 100644 --- a/src/api/system/region.ts +++ b/src/api/system/region.ts @@ -1,7 +1,7 @@ import server from '@/utils/request'; // 获取全部地区(树结构) -export const getRegionTree = (): Promise => server.post(`/area/_all/tree`); +export const getRegionTree = (data?: any): Promise => server.post(`/area/_all/tree`, data); // 校验名称是否存在 export const validateName = (name: string, id?: string): Promise => server.get(`/area/name/_validate?name=${name}${id ? `&id=${id}` : ''}`); @@ -20,3 +20,5 @@ export const updateRegion = (data: any): Promise => server.patch(`/area`, d // 获取全部内置地区(树结构) export const getBuiltinRegionTree = (data: any): Promise => server.post(`/area/builtin/_all/tree`, data); + +export const queryAreaCount = (id: string) => server.get(`/ams/asset/area/${id}/_count`) diff --git a/src/api/system/role.ts b/src/api/system/role.ts index bb9a2670..12c551f8 100644 --- a/src/api/system/role.ts +++ b/src/api/system/role.ts @@ -20,6 +20,7 @@ export const getPrimissTree_api = (id: string): Promise => server.get(`/men // 更新角色对应的权限树 export const updatePrimissTree_api = (id: string, data:object): Promise => server.put(`/menu/role/${id}/_grant`,data); +export const clearPrimissTree_api = (id: string, data?:object): Promise => server.put(`/menu/role/${id}/iot/clear-grant`,data); // 获取用户列表 export const getUserByRole_api = (data: any): Promise => server.post(`/user/_query/`, data); diff --git a/src/components/AMapComponent/index.vue b/src/components/AMapComponent/index.vue index 8de55a2e..67f20164 100644 --- a/src/components/AMapComponent/index.vue +++ b/src/components/AMapComponent/index.vue @@ -22,7 +22,7 @@ import '@vuemap/vue-amap/dist/style.css'; import { getAMapUiPromise } from './utils'; import { useSystem } from '@/store/system'; -const emit = defineEmits('init') +const emit = defineEmits(['init']) const system = useSystem(); interface AMapProps { @@ -33,7 +33,9 @@ interface AMapProps { const amapKey = system.$state.configInfo.amap?.apiKey; initAMapApiLoader({ - key: amapKey || '', + key: amapKey || 'c86c1b22c6b223e3ed08815532676445', + securityJsCode: 'b0efcf1ce14cbf2d56d3cde630cd19cf', + plugins: ['AMap.DistrictSearch'], }); const props = defineProps({ diff --git a/src/components/AMapComponent/utils.ts b/src/components/AMapComponent/utils.ts index dd7f91ec..99ea22e9 100644 --- a/src/components/AMapComponent/utils.ts +++ b/src/components/AMapComponent/utils.ts @@ -23,4 +23,4 @@ export const getAMapUiPromise = (version: string = '1.0'): Promise => { document.body.append(script); return pro; -}; \ No newline at end of file +}; diff --git a/src/store/scene.ts b/src/store/scene.ts index 90a13dd6..f75aa4c4 100644 --- a/src/store/scene.ts +++ b/src/store/scene.ts @@ -56,7 +56,7 @@ export const defaultBranches = [ then: [], executeAnyway: true, branchId: Math.floor(Math.random() * 100000000), - branchName:'条件1' + branchName:'' }, ]; diff --git a/src/views/device/Firmware/Save/index.vue b/src/views/device/Firmware/Save/index.vue index 89176676..28994e58 100644 --- a/src/views/device/Firmware/Save/index.vue +++ b/src/views/device/Firmware/Save/index.vue @@ -1,4 +1,4 @@ - @@ -243,62 +75,17 @@ const cancel = () => { position: relative; height: 100%; - .map-tool{ + .region-map-loading { position: absolute; - top: 20%; - right: 20px; - - - .map-tool-content { - display: flex; - gap: 24px; - flex-direction: column; - - .tool-item-group { - display: flex; - flex-direction: column; - border: 1px solid #e3e3e3; - background-color: #fff; - border-radius: 4px; - box-shadow: 0 0 16px rgba(#000, .15); - - .tool-item { - padding: 4px 6px; - color: #333; - font-size: 16px; - - &:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - } - - &:last-child { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - } - - &:not(:first-child) { - border-top: 1px solid #e3e3e3; - } - - &.active { - background-color: var(--ant-primary-color); - color: #fff; - } - - &.disabled { - cursor: not-allowed !important; - background-color: #efefef; - - > span { - cursor: not-allowed !important; - color: #666; - } - } - } - } - } - + left: 0; + top: 0; + width: 100%; + background-color: yellow; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(#000, 0.35); } } diff --git a/src/views/system/Region/Save/BuildIn.vue b/src/views/system/Region/Save/BuildIn.vue index b822a9bd..a119bb10 100644 --- a/src/views/system/Region/Save/BuildIn.vue +++ b/src/views/system/Region/Save/BuildIn.vue @@ -1,124 +1,138 @@ \ No newline at end of file + diff --git a/src/views/system/Region/Save/TracePoint.vue b/src/views/system/Region/Save/TracePoint.vue deleted file mode 100644 index 7281fc21..00000000 --- a/src/views/system/Region/Save/TracePoint.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/system/Region/Save/index.vue b/src/views/system/Region/Save/index.vue index af122b86..64f8a721 100644 --- a/src/views/system/Region/Save/index.vue +++ b/src/views/system/Region/Save/index.vue @@ -1,56 +1,44 @@ - \ No newline at end of file +watch(() => JSON.stringify(props.treeData), () => { + const item = JSON.parse(JSON.stringify(props.treeData)) + areaList.value = item + if(props.mode === 'add'){ + modelRef.children = props.areaTree?.[0]?.children + } +}, {immediate: true}) + diff --git a/src/views/system/Region/hooks.ts b/src/views/system/Region/hooks.ts new file mode 100644 index 00000000..1755ae13 --- /dev/null +++ b/src/views/system/Region/hooks.ts @@ -0,0 +1,51 @@ +import { getBuiltinRegionTree } from '@/api/system/region'; +import {useRequest} from "@/hook"; + +export const useArea = () => { + const areaMap = ref(new Map()) + + + const handleAreaMap = (data: any[] = [], parentCode?: string) => { + for (let i = 0;i < data.length; i++) { + const _data = data[i] + areaMap.value.set(_data.code, { + parentId: parentCode, + name: _data.name + }) + if (_data.children?.length) { + handleAreaMap(_data.children, _data.code) + } + } + } + + const { data: areaTree } = useRequest(getBuiltinRegionTree, { + onSuccess(resp) { + handleAreaMap(resp?.result) + }, + defaultParams: [{ + paging: false, + sorts: [{ name: 'sortIndex', order: 'asc' }], + }] + }) + + const getParentNameById = (id?: string) => { + let _id = id + const name = [] + + while (!!_id) { + const item = areaMap.value.get(_id) + if (item) { // 不添加本身 + name.unshift(item.name) + } + _id = item?.parentId + } + + return name + } + + return { + areaTree, + areaMap, + getParentNameById + } +} diff --git a/src/views/system/Region/index.vue b/src/views/system/Region/index.vue index 80eeafdd..033644f8 100644 --- a/src/views/system/Region/index.vue +++ b/src/views/system/Region/index.vue @@ -1,13 +1,12 @@