From f798c64930a43298b8da32db8cb557bbbf4e3fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Wed, 2 Aug 2023 09:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/device.js | 44 ++- common/api/dictionary.js | 62 +++- components/Cn-page/Cn-page.vue | 2 +- pages.json | 6 + pages/device/APF/about.vue | 60 +++- pages/device/APF/comp/oscillogram.vue | 1 - pages/device/APF/detail.vue | 16 +- pages/device/edit.vue | 487 ++++++++++++++++++++++++++ pages/device/list.vue | 71 ++-- pages/index/comp/indexGongCheng.vue | 35 +- pages/index/comp/indexYouKe.vue | 27 +- pages/index/comp/indexYunWei.vue | 27 +- pages/index/comp/indexZhuYongHu.vue | 30 +- pages/index/comp/indexZhuanZhi.vue | 40 ++- pages/index/mine.vue | 4 +- 15 files changed, 817 insertions(+), 95 deletions(-) create mode 100644 pages/device/edit.vue diff --git a/common/api/device.js b/common/api/device.js index 47efd77..5b1e4a7 100644 --- a/common/api/device.js +++ b/common/api/device.js @@ -72,7 +72,7 @@ export const queryByTopoId = (id) => { url: '/cs-device-boot/lineTemplate/queryByTopoId', method: 'POST', data: { - topoId:id, + topoId: id, }, }) } @@ -94,7 +94,7 @@ export const transferDevice = (id) => { url: '/cs-device-boot/deviceUser/transfer', method: 'POST', data: { - eid:id, + eid: id, }, }) } @@ -106,7 +106,43 @@ export const deleteDevice = (id) => { url: '/cs-device-boot/deviceUser/delete', method: 'POST', data: { - eid:id, + eid: id, }, }) -} \ No newline at end of file +} + +// 设备查询通过id获取 +export const queryDeivceById = (id) => { + return request({ + url: '/cs-device-boot/EquipmentDelivery/queryEquipmentById', + method: 'POST', + data: { + ids: id, + }, + }) +} + +// 字典树接口通过id +export const queryByid = (id) => { + return request({ + url: '/system-boot/dictTree/queryByid', + method: 'post', + data: { + id, + }, + }) +} + +//设备修改监测点信息 +export const updateDevice = (params) => { + return request({ + url: '/cs-device-boot/lineTopologyDiagram/auditList', + method: 'POST', + header: { + 'Content-Type': 'application/json', + }, + data: { + pointList: params, + }, + }) +} diff --git a/common/api/dictionary.js b/common/api/dictionary.js index f0801e0..d5bb284 100644 --- a/common/api/dictionary.js +++ b/common/api/dictionary.js @@ -1,5 +1,5 @@ -import request from '../js/request'; -import config from '../js/config'; +import request from '../js/request' +import config from '../js/config' export function queryDictData(dictTypeName) { return request({ @@ -8,12 +8,64 @@ export function queryDictData(dictTypeName) { data: { dictTypeName, }, - }); + }) } export function queryDictDataCache(dictTypeName) { return request({ url: '/system-boot/dictType/dictDataCache', method: 'get', - }); -} \ No newline at end of file + }) +} + +// 字典树接口通过code +export const queryByCode = (code) => { + return request({ + url: '/system-boot/dictTree/queryByCode', + method: 'post', + data: { + code, + }, + }) +} + +// 字典树接口 +export const queryCsDictTree = (pid) => { + return request({ + url: '/system-boot/dictTree/query', + method: 'post', + data: { + pid, + }, + }) +} + +// 字典树接口通过id +export const queryByid = (id) => { + return request({ + url: '/system-boot/dictTree/queryByid', + method: 'post', + data: { + id, + }, + }) +} + +// 程序版本 +export const queryEdDataPage = () => { + return request({ + url: '/cs-device-boot/edData/queryEdDataPage', + method: 'post', + header: { + 'Content-Type': 'application/json;charset=UTF-8', + }, + data: { + pageNum: 1, + devName: '', + devType: '', + pageSize: 999, + versionStartDate: '', + versionendDate: '', + }, + }) +} diff --git a/components/Cn-page/Cn-page.vue b/components/Cn-page/Cn-page.vue index a76c835..cb34c77 100644 --- a/components/Cn-page/Cn-page.vue +++ b/components/Cn-page/Cn-page.vue @@ -7,7 +7,7 @@ - + diff --git a/pages.json b/pages.json index 531067a..1c5ba9d 100644 --- a/pages.json +++ b/pages.json @@ -393,6 +393,12 @@ "style": { "navigationBarTitleText": "操作成功" } + }, + { + "path": "pages/device/edit", + "style": { + "navigationBarTitleText": "编辑设备" + } } ], "tabBar": { diff --git a/pages/device/APF/about.vue b/pages/device/APF/about.vue index ac9f5c4..36274a8 100644 --- a/pages/device/APF/about.vue +++ b/pages/device/APF/about.vue @@ -1,33 +1,56 @@ - \ No newline at end of file + diff --git a/pages/device/APF/comp/oscillogram.vue b/pages/device/APF/comp/oscillogram.vue index 6aab07c..0f38c52 100644 --- a/pages/device/APF/comp/oscillogram.vue +++ b/pages/device/APF/comp/oscillogram.vue @@ -4,7 +4,6 @@ - diff --git a/pages/device/APF/detail.vue b/pages/device/APF/detail.vue index b46f85e..11341dd 100644 --- a/pages/device/APF/detail.vue +++ b/pages/device/APF/detail.vue @@ -68,7 +68,7 @@ - + @@ -95,8 +95,8 @@ @trigger="trigger" /> - - + + @@ -213,7 +213,7 @@ export default { } else if (e.item.text === '告警') { uni.navigateTo({ url: '/pages/device/APF/report' }) } else if (e.item.text === '关于') { - uni.navigateTo({ url: '/pages/device/APF/about' }) + uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId }) } else if (e.item.text === '移交') { uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId }) } else if (e.item.text === '反馈') { @@ -226,6 +226,10 @@ export default { this.$util.toast('功能暂未开放') } else if (e.item.text === '模版') { this.$util.toast('效果是功能暂未开放直接打开报表') + } else if (e.item.text === '编辑') { + uni.navigateTo({ + url: '/pages/device/edit?deviceInfo=' + encodeURIComponent(JSON.stringify(this.deviceInfo)), + }) } this.$refs.fab.close() }, @@ -388,6 +392,10 @@ export default { iconPath: '/static/delate.png', text: '删除', }) + this.content.splice(0, 0, { + iconPath: '/static/feedback.png', + text: '编辑', + }) this.content.splice(0, 0, { iconPath: '/static/transfer.png', text: '移交', diff --git a/pages/device/edit.vue b/pages/device/edit.vue new file mode 100644 index 0000000..526e923 --- /dev/null +++ b/pages/device/edit.vue @@ -0,0 +1,487 @@ + + + diff --git a/pages/device/list.vue b/pages/device/list.vue index 8794528..0dc18c6 100644 --- a/pages/device/list.vue +++ b/pages/device/list.vue @@ -1,51 +1,80 @@ - \ No newline at end of file + diff --git a/pages/index/comp/indexGongCheng.vue b/pages/index/comp/indexGongCheng.vue index 539a5ca..7cc4ecf 100644 --- a/pages/index/comp/indexGongCheng.vue +++ b/pages/index/comp/indexGongCheng.vue @@ -5,11 +5,11 @@
{{ devCount.onLineCount || 0 }}
正常设备
-
-
{{ devCount.alarmLineCount || 0 }}
+
+
{{ devCount.alarmLineCount || 0 }}
报警设备
-
+
{{ devCount.offLineCount || 0 }}
离线设备
@@ -17,7 +17,7 @@ - + @@ -66,14 +66,25 @@ export default { }) }, jump(type) { - switch (key) { - case value: - - break; - - default: - break; - } + switch (type) { + case 'alarmLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=alarmLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)), + }) + break + case 'offLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=offLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)), + }) + break + + default: + break + } }, }, } diff --git a/pages/index/comp/indexYouKe.vue b/pages/index/comp/indexYouKe.vue index b46f757..78eb15e 100644 --- a/pages/index/comp/indexYouKe.vue +++ b/pages/index/comp/indexYouKe.vue @@ -5,11 +5,11 @@
{{ devCount.onLineCount || 0 }}
正常设备
-
+
{{ devCount.alarmLineCount || 0 }}
报警设备
-
+
{{ devCount.offLineCount || 0 }}
离线设备
@@ -24,6 +24,29 @@ export default { default: {}, }, }, + methods:{ + jump(type) { + switch (type) { + case 'alarmLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=alarmLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)), + }) + break + case 'offLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=offLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)), + }) + break + + default: + break + } + }, + } } diff --git a/pages/index/comp/indexYunWei.vue b/pages/index/comp/indexYunWei.vue index b46f757..0f906d9 100644 --- a/pages/index/comp/indexYunWei.vue +++ b/pages/index/comp/indexYunWei.vue @@ -5,11 +5,11 @@
{{ devCount.onLineCount || 0 }}
正常设备
-
+
{{ devCount.alarmLineCount || 0 }}
报警设备
-
+
{{ devCount.offLineCount || 0 }}
离线设备
@@ -24,6 +24,29 @@ export default { default: {}, }, }, + methods: { + jump(type) { + switch (type) { + case 'alarmLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=alarmLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)), + }) + break + case 'offLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=offLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)), + }) + break + + default: + break + } + }, + }, } diff --git a/pages/index/comp/indexZhuYongHu.vue b/pages/index/comp/indexZhuYongHu.vue index ffee880..0368f18 100644 --- a/pages/index/comp/indexZhuYongHu.vue +++ b/pages/index/comp/indexZhuYongHu.vue @@ -5,11 +5,11 @@
{{ devCount.onLineCount || 0 }}
正常设备
-
+
{{ devCount.alarmLineCount || 0 }}
报警设备
-
+
{{ devCount.offLineCount || 0 }}
离线设备
@@ -17,7 +17,7 @@ - + @@ -65,10 +65,26 @@ export default { url: '/pages/gateway/new', }) }, - jump(item) { - uni.navigateTo({ - url: '/pages/device/APF/detail', - }) + jump(type) { + switch (type) { + case 'alarmLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=alarmLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)), + }) + break + case 'offLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=offLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)), + }) + break + + default: + break + } }, }, } diff --git a/pages/index/comp/indexZhuanZhi.vue b/pages/index/comp/indexZhuanZhi.vue index c08fd14..8020cf8 100644 --- a/pages/index/comp/indexZhuanZhi.vue +++ b/pages/index/comp/indexZhuanZhi.vue @@ -2,31 +2,31 @@
-
8
+
{{ devCount.allDevCount || 0 }}
设备总数
{{ devCount.onLineCount || 0 }}
正常设备
-
+
{{ devCount.alarmLineCount || 0 }}
报警设备
-
+
{{ devCount.offLineCount || 0 }}
离线设备
-
4
+
{{ devCount.alarmEventCount || 0 }}
告警数量
-
0
+
{{ devCount.eventCount || 0 }}
事件数量
-
3
+
{{ devCount.projectCount || 0 }}
项目个数
@@ -56,15 +56,25 @@ export default { url: '/pages/project/list', }) }, - jump(item) { - if (item.name.indexOf('APF') > -1) { - uni.navigateTo({ - url: '/pages/device/APF/detail', - }) - } else if (item.name.indexOf('DVR') > -1) { - uni.navigateTo({ - url: '/pages/device/DVR/detail', - }) + jump(type) { + switch (type) { + case 'alarmLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=alarmLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)), + }) + break + case 'offLineDevs': + uni.navigateTo({ + url: + '/pages/device/list?type=offLineDevs&projectList=' + + encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)), + }) + break + + default: + break } }, }, diff --git a/pages/index/mine.vue b/pages/index/mine.vue index ee9e59e..d28e834 100644 --- a/pages/index/mine.vue +++ b/pages/index/mine.vue @@ -46,7 +46,7 @@ 项目管理 - 网关列表 - + --> 消息配置