From 6ca54a37fea4ae644d61531121cc0b1c87088836 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Wed, 23 Oct 2024 10:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=20fast(=E9=A1=B9=E7=9B=AE=E3=80=81=E6=96=87?= =?UTF-8?q?=E6=A1=A3):=20=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A0=87=E7=AD=BE=E7=B1=BB=E5=9E=8B=E3=80=81=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=BB=84=E7=AE=A1=E7=90=86=EF=BC=88=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=EF=BC=89=E3=80=81=E9=A1=B9=E7=9B=AE=E6=8C=89=E9=92=AE=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E8=A7=92=E8=89=B2=E6=98=BE=E9=9A=90=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=87=E6=A1=A3=E7=AE=A1=E7=90=86=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3icon=E6=A0=87=E7=AD=BE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/document/index.js | 38 ++ src/api/iot/tagGroup.js | 71 +++ src/api/iot/tagGroupDevice.js | 71 +++ src/api/iot/tagType.js | 70 +++ src/views/document/index.vue | 478 ++++++++++++++++++ .../project/profileV2/EObjectContainer.vue | 24 +- .../iot/project/profileV2/EObjectSpace.vue | 6 +- .../project/profileV2/EObjectSpaceDevice.vue | 4 +- .../iot/project/profileV2/ETenantUser.vue | 7 +- src/views/iot/project/profileV2/TagGroup.vue | 475 +++++++++++++++++ .../iot/project/profileV2/TagGroupDevice.vue | 406 +++++++++++++++ src/views/iot/project/profileV2/TagType.vue | 231 +++++++++ .../DeviceDetailsView/deviceSelectNav.vue | 24 +- src/views/profile/DeviceRunStarts/index.vue | 55 +- 14 files changed, 1916 insertions(+), 44 deletions(-) create mode 100644 src/api/document/index.js create mode 100644 src/api/iot/tagGroup.js create mode 100644 src/api/iot/tagGroupDevice.js create mode 100644 src/api/iot/tagType.js create mode 100644 src/views/document/index.vue create mode 100644 src/views/iot/project/profileV2/TagGroup.vue create mode 100644 src/views/iot/project/profileV2/TagGroupDevice.vue create mode 100644 src/views/iot/project/profileV2/TagType.vue diff --git a/src/api/document/index.js b/src/api/document/index.js new file mode 100644 index 00000000..5279117b --- /dev/null +++ b/src/api/document/index.js @@ -0,0 +1,38 @@ +import request from '@/utils/request' + +// 查询文档记录列表 +export function getDocumentList(query) { + return request({ + url: '/iot/document/list', + method: 'get', + params: query + }) +} + +// 新增文档记录 +export function addDocument(data) { + return request({ + url: '/iot/document', + method: 'post', + data: data + }) +} + + +// 修改文档记录 +export function editDocument(data) { + return request({ + url: '/iot/document', + method: 'put', + data: data + }) +} + +// 删除文档记录 +export function delDocument(id) { + return request({ + url: '/iot/document/' + id, + method: 'delete' + }) +} + diff --git a/src/api/iot/tagGroup.js b/src/api/iot/tagGroup.js new file mode 100644 index 00000000..6e86bebc --- /dev/null +++ b/src/api/iot/tagGroup.js @@ -0,0 +1,71 @@ +import request from "@/utils/request"; + +// 查询项目标签组列表 +export function listTagGroup(query) { + return request({ + url: "/iot/labelData/list", + method: "get", + params: query + }); +} + +// 查询项目标签组详细 +export function getTagGroup(spaceId) { + return request({ + url: "/iot/labelData/" + spaceId, + method: "get" + }); +} + +// 新增项目标签组 +export function addTagGroup(data) { + return request({ + url: "/iot/labelData", + method: "post", + data: data + }); +} + +// 修改项目标签组 +export function updateTagGroup(data) { + return request({ + url: "/iot/labelData", + method: "put", + data: data + }); +} + +// 删除项目标签组 +export function delTagGroup(spaceId) { + return request({ + url: "/iot/labelData/" + spaceId, + method: "delete" + }); +} + +// 导出项目标签组 +export function exportTagGroup(query) { + return request({ + url: "/iot/space/export", + method: "get", + params: query + }); +} + +// 查询项目标签组列表 +export function listTagGroupDevice(query) { + return request({ + url: "/iot/space_device/list", + method: "get", + params: query + }); +} + +// 获取项目标签组下拉树列表 +export function listTagGroupTree(query) { + return request({ + url: "/iot/space/tree-list", + method: "get", + params: query + }); +} diff --git a/src/api/iot/tagGroupDevice.js b/src/api/iot/tagGroupDevice.js new file mode 100644 index 00000000..2494337f --- /dev/null +++ b/src/api/iot/tagGroupDevice.js @@ -0,0 +1,71 @@ +import request from '@/utils/request' + +// 查询标签设备列表 +export function listTagGroupdevice(query) { + return request({ + url: '/iot/label/device-list', + method: 'get', + params: query + }) +} + +// 查询标签设备详细 +export function getTagGroupdevice(spaceId) { + return request({ + url: '/iot/spacedevice/' + spaceId, + method: 'get' + }) +} + +// 新增标签设备 +export function addTagGroupdevice(data) { + return request({ + url: '/iot/label/bind', + method: 'post', + data: data + }) +} + +// 修改标签设备 +export function updateTagGroupdevice(data) { + return request({ + url: '/iot/spacedevice', + method: 'put', + data: data + }) +} + +// 删除标签设备 +export function delTagGroupdevice(data) { + return request({ + url: '/iot/label/remove', + method: 'delete', + data: data + }) +} +// 项目中删除设备 +export function delTagdevice(data) { + return request({ + url: '/iot/label/remove', + method: 'delete', + data: data + }) +} + +// 导出标签设备 +export function exportTagGroupdevice(query) { + return request({ + url: '/iot/spacedevice/export', + method: 'get', + params: query + }) +} + +// 查询指定标签下的设备 +export function listRootTagDevice(data) { + return request({ + url: '/iot/label/unAssign-list', + method: 'get', + params: data + }) +} diff --git a/src/api/iot/tagType.js b/src/api/iot/tagType.js new file mode 100644 index 00000000..8e15c0fd --- /dev/null +++ b/src/api/iot/tagType.js @@ -0,0 +1,70 @@ +import request from "@/utils/request"; + +// 查询项目标签类型列表 +export function listTagType(projectId) { + return request({ + url: "/iot/labelType/list?projectId=" + projectId, + method: "get", + }); +} + +// 查询项目标签类型详细 +export function getTagType(spaceId) { + return request({ + url: "/iot/labelType/" + spaceId, + method: "get" + }); +} + +// 新增项目标签类型 +export function addTagType(data) { + return request({ + url: "/iot/labelType", + method: "post", + data: data + }); +} + +// 修改项目标签类型 +export function updateTagType(data) { + return request({ + url: "/iot/labelType", + method: "put", + data: data + }); +} + +// 删除项目标签类型 +export function delTagType(id) { + return request({ + url: "/iot/labelType/" + id, + method: "delete" + }); +} + +// 导出项目标签类型 +export function exportTagType(query) { + return request({ + url: "/iot/space/export", + method: "get", + params: query + }); +} + +// 查询项目标签类型列表 +export function listTagTypeDevice(query) { + return request({ + url: "/iot/space_device/list", + method: "get", + params: query + }); +} + +// 获取项目标签类型下拉树列表 +export function listTagTypeTree(query) { + return request({ + url: "/iot/space/tree-list", + method: "get", + params: query + }); +} diff --git a/src/views/document/index.vue b/src/views/document/index.vue new file mode 100644 index 00000000..7e0de1de --- /dev/null +++ b/src/views/document/index.vue @@ -0,0 +1,478 @@ + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + 新增 + + + + + + + + + + {{formatFileSize(scope.row.docSize)}} + + + + + + + 查看 + 下载 + 编辑 + 删除 + + + + + + + + + + + + + 将文件拖到此处,或 + 点击上传 + + + + + + + + + {{form.docType}} + + + {{formatFileSize(form.docSize)}} + + + + + + + + + + + + diff --git a/src/views/iot/project/profileV2/EObjectContainer.vue b/src/views/iot/project/profileV2/EObjectContainer.vue index fbdc980f..60e3d1a0 100644 --- a/src/views/iot/project/profileV2/EObjectContainer.vue +++ b/src/views/iot/project/profileV2/EObjectContainer.vue @@ -10,12 +10,20 @@ - + + + + + + + + + @@ -24,13 +32,17 @@ import EObjectInfo from './EObjectInfo' import ETenantUser from './ETenantUser' import EObjectSpace from './EObjectSpace' import EObjectTenant from './EObjectTenant' +import TagGroup from "@/views/iot/project/profileV2/TagGroup"; +import TagType from "@/views/iot/project/profileV2/TagType"; export default { name: 'EObjectContainer', components: { EObjectInfo, EObjectSpace, EObjectTenant, - ETenantUser + ETenantUser, + TagGroup, + TagType }, props: { projectInfo: { @@ -48,12 +60,16 @@ export default { }, data() { return { - activeName: 'info' + activeName: 'info', + activeLabelType: null } }, methods: { handleClick(tab, event) { - console.log(tab, event); + }, + changeTagType(e){ + this.activeName = 'tagGroup'; + this.activeLabelType = e; } } } diff --git a/src/views/iot/project/profileV2/EObjectSpace.vue b/src/views/iot/project/profileV2/EObjectSpace.vue index d163f19f..93bdf7b3 100644 --- a/src/views/iot/project/profileV2/EObjectSpace.vue +++ b/src/views/iot/project/profileV2/EObjectSpace.vue @@ -60,8 +60,9 @@ type="text" @click="handleDetails(scope.row)" >空间设备 - 修改 + 修改 diff --git a/src/views/iot/project/profileV2/EObjectSpaceDevice.vue b/src/views/iot/project/profileV2/EObjectSpaceDevice.vue index ff37eeaa..316d4f2a 100644 --- a/src/views/iot/project/profileV2/EObjectSpaceDevice.vue +++ b/src/views/iot/project/profileV2/EObjectSpaceDevice.vue @@ -22,7 +22,7 @@ 搜索 重置 - 新增 + 新增 @@ -52,7 +52,7 @@ label="操作" width="300px" > - + @@ -68,6 +68,7 @@ + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + 新增 + + + + + + + + + + + 标签设备 + 修改 + 删除 + + + + + + + + + 顶级节点 + + + + + + + + + + {{form.labelName}} + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/iot/project/profileV2/TagGroupDevice.vue b/src/views/iot/project/profileV2/TagGroupDevice.vue new file mode 100644 index 00000000..f94d276e --- /dev/null +++ b/src/views/iot/project/profileV2/TagGroupDevice.vue @@ -0,0 +1,406 @@ + + + + + 新增标签 + + + + + + + + + + + + + + 移出标签 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/iot/project/profileV2/TagType.vue b/src/views/iot/project/profileV2/TagType.vue new file mode 100644 index 00000000..ac1c9816 --- /dev/null +++ b/src/views/iot/project/profileV2/TagType.vue @@ -0,0 +1,231 @@ + + + + + 新增 + + + + + + + + + {{ scope.row.labelName }} + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + diff --git a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue index 41783080..7b949a01 100644 --- a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue +++ b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue @@ -55,7 +55,7 @@ align-items: center; " > - + 合闸 @@ -74,7 +74,7 @@ align-items: center; " > - + 分闸 @@ -87,7 +87,7 @@ align-items: center; " > - + 一键合闸 @@ -105,7 +105,7 @@ align-items: center; " > - + 一键分闸 @@ -124,7 +124,7 @@ align-items: center; " > - + 查找设备 @@ -137,7 +137,7 @@ align-items: center; " > - + {{ childDeviceList.length > tSelectList.length ? "全选" : "取消" }} @@ -225,11 +225,11 @@ : 'dev-info-state off-line' " > - - + {{ deviceInfo["deviceState"] == "ONLINE" ? "在线" : "离线" }} @@ -301,11 +301,11 @@ " style="width: 60px" > - - + {{ getDeviceState(item["deviceState"]) }} @@ -319,12 +319,12 @@ font-size: 14px; " > - - { - // row["children"] = res.data.filter(item => item.show === true) || []; - if(res.data.length > 0){ - let list = res.data.filter(item => item.show == true) || []; - row["children"] = list.map(item => { - if(item.dataFormat){ + try { + const res = await getDeviceFunList(param); + if (res.data.length > 0) { + let list = res.data.filter(item => item.show === true) || []; + row.children = list.map(item => { + if (item.dataFormat) { let dataFormat = JSON.parse(item.dataFormat); item.dataFormatType = dataFormat.type; - if(dataFormat.list && dataFormat.type == 'ENUM'){ - try{ + if (dataFormat.list && dataFormat.type === 'ENUM') { + try { item.dataFormatObj = JSON.parse(dataFormat.list.replace(/\\/g, '')); - }catch(e){ + } catch (e) { item.dataFormatObj = {}; } } } - return item; }); - }else{ - row["children"] = []; + } else { + row.children = []; } this.$forceUpdate(); - }); + } catch (error) { + console.error(`Error fetching data for row ${index}:`, error); + } }, lengthReSize(str) { if (str.toString().length < 18 && str.toString().length > 12) { @@ -261,7 +263,17 @@ export default { this.socket_flag = false; this.stompClient = null; clearTimeout(this.setTimeOut_flag); - } + }, + async processAllRequests(data) { + try { + await Promise.all(data.map(async (row, index) => { + await this.forGetParams(row, index); + })); + this.connection(); + } catch (error) { + console.error('Error processing all requests:', error); + } + }, }, destroyed() { this.closeWebscoket(); @@ -269,11 +281,12 @@ export default { watch: { cmdList(val) { if (val) { - val.forEach((v, index) => { - this.forGetParmas(v, index); - }); + // val.forEach((v, index) => { + // this.forGetParmas(v, index); + // }); // setTimeout(this.connection, 3000); - this.connection() + // this.connection() + this.processAllRequests(val); } }, realTimeData: {