diff --git a/src/api/alarm/tenantAlarm.js b/src/api/alarm/tenantAlarm.js index 1d169c06..75b5d2da 100644 --- a/src/api/alarm/tenantAlarm.js +++ b/src/api/alarm/tenantAlarm.js @@ -42,3 +42,12 @@ export function exportRecord(query) { params: query }) } + +// 新增报警记录 +export function addAlarmRecord(data) { + return request({ + url: '/iot/maintenance/', + method: 'post', + data: data + }) +} diff --git a/src/api/power/maintenance.js b/src/api/power/maintenance.js index 3996534a..40785fc5 100644 --- a/src/api/power/maintenance.js +++ b/src/api/power/maintenance.js @@ -60,3 +60,13 @@ export function exportMaintenance(query) { params: query }) } + + +// 获取租户下用户 +export function getTenantHandleUser(query) { + return request({ + url: '/system/user/list', + method: 'get', + params: query + }) +} diff --git a/src/utils/hciot.js b/src/utils/hciot.js index 3693c9f7..f24f355d 100644 --- a/src/utils/hciot.js +++ b/src/utils/hciot.js @@ -156,6 +156,9 @@ export function getIotFileUrl(importUrl) { if (!importUrl) { return '/assets/logo/logo.png'; } + if (importUrl.indexOf(':8899') > 0) { + importUrl = importUrl.replace(':8899', ':9988') + } if (importUrl.indexOf('http') === 0 || importUrl.indexOf('https') === 0) { return importUrl; } else if (importUrl.indexOf('/profile/upload/') === 0 || importUrl.indexOf('/profile/avatar/') === 0) { diff --git a/src/views/alarm/type/index.vue b/src/views/alarm/type/index.vue index b91de08a..d4310620 100644 --- a/src/views/alarm/type/index.vue +++ b/src/views/alarm/type/index.vue @@ -65,7 +65,7 @@ v-hasPermi="['iot:type:remove']" >删除 - + 发布时间:{{info.updateTime}} + >发布时间:{{info.createTime}} 更多新闻...
diff --git a/src/views/bashboardcom/newTD.vue b/src/views/bashboardcom/newTD.vue index 730b1349..b4a58d37 100644 --- a/src/views/bashboardcom/newTD.vue +++ b/src/views/bashboardcom/newTD.vue @@ -23,7 +23,7 @@ line-height: 1.5; font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro'; " - >发布时间:{{info.updateTime}} + >发布时间:{{info.createTime}}
diff --git a/src/views/iot/alarm/type/index.vue b/src/views/iot/alarm/type/index.vue index eeac970c..5adc8583 100644 --- a/src/views/iot/alarm/type/index.vue +++ b/src/views/iot/alarm/type/index.vue @@ -83,7 +83,7 @@ v-hasPermi="['iot:type:remove']" >删除
- + + + + + + + {{keys}} @@ -217,6 +233,7 @@ import { updateAlarmType } from "@/api/alarm/alarmType"; import { listDeviceTypeList } from "@/api/iot/device"; +import { listUser } from "@/api/system/user"; // import { selectedProdmodel } from "@/api/device/prodmodel"; const alarmDivideType = { ALARM: "报警", @@ -265,15 +282,22 @@ export default { tag: [{ required: true, message: "告警标签不能为空", trigger: "blur" }] }, tenantId: "", - deviceTypeList: [] + deviceTypeList: [], + userList: [] }; }, created() { this.tenantId = this.$store.getters.tenantId; this.getList(); + this.getUserList() this.getDeviceTypeList(); }, methods: { + getUserList() { + listUser().then(response => { + this.userList = response.rows; + }); + }, indexFormatter(val) { return ( val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize diff --git a/src/views/iot/circuitBreaker/index.vue b/src/views/iot/circuitBreaker/index.vue index ce7e8ed3..301d443b 100644 --- a/src/views/iot/circuitBreaker/index.vue +++ b/src/views/iot/circuitBreaker/index.vue @@ -891,7 +891,7 @@ export default { height: 30px; position: absolute; right: 30px; - top: 170px; + top: 220px; display: flex; justify-content: center; align-items: center; diff --git a/src/views/iot/library/index.vue b/src/views/iot/library/index.vue index fafa4ab1..37033eab 100644 --- a/src/views/iot/library/index.vue +++ b/src/views/iot/library/index.vue @@ -420,7 +420,7 @@ export default { this.upload.open = false; this.upload.isUploading = false; this.$refs.upload.clearFiles(); - this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); + this.$alert(response.msg || '导入失败,格式不正确!', "导入结果", { dangerouslyUseHTMLString: true }); this.getList(); }, // 提交上传文件 diff --git a/src/views/iot/model/index.vue b/src/views/iot/model/index.vue index 95f9a4c8..a1eb36bd 100644 --- a/src/views/iot/model/index.vue +++ b/src/views/iot/model/index.vue @@ -105,7 +105,13 @@ width="200px" prop="prodKey" /> - + + + -
工单 I D : - {{ workDetails.maintenanceId }} + {{ workDetails['maintenanceId'] }}
工单状态: - {{ workStateList[workDetails.maintenanceStatus] }} + {{ workStateList[workDetails['maintenanceStatus']] }}
@@ -21,13 +21,13 @@
设备名称: - {{ workDetails.deviceName }} + {{ workDetails['deviceName'] }}
故障类型: - {{ fanltTypeList[workDetails.faultType] }} + {{ fanltTypeList[workDetails['faultType']] }}
@@ -145,7 +145,7 @@ border-radius: 3px; " :src="getIotFileUrl(val)" - v-for="(val, index) in pictures" + v-for="(val) in pictures" :key="val" /> @@ -154,6 +154,35 @@ +
+ + +
+ 处理人员: + + + + +
+
+
+
+ + + + { + this.handleUserList = res.rows + }) + }, // 限制图片大小和类型 beforeAvatarUpload(file) { const isJPG = this.fileType.indexOf(file.type) >= 0; diff --git a/src/views/power/mywork/index.vue b/src/views/power/mywork/index.vue index b0d08b8b..b27214d8 100644 --- a/src/views/power/mywork/index.vue +++ b/src/views/power/mywork/index.vue @@ -391,7 +391,7 @@ export default { deviceName: "", modelId: "", parentId: 0, - deviceType: "GATEWAY_CONTROLLER" + deviceType: "" }, page: { pageSize: 10, diff --git a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue index 2182922a..5dd650ec 100644 --- a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue +++ b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue @@ -1,107 +1,141 @@ @@ -220,6 +255,8 @@ export default { socket_flag: true, setTimeOut_flag: null, timingPingWs_flag: null, + tSelectList: [], + tSelectLabelList: [] // wsDeviceInfo: null? }; }, @@ -260,6 +297,70 @@ export default { }, }, methods: { + handleAllStatus(type) { + if (this.childDeviceList.length > 0) { + this.childDeviceList.forEach(v => { + if (this.tSelectList.indexOf(v.deviceId) < 0) { + this.tSelectList.push(v.deviceId) + this.tSelectLabelList.push(v.deviceName) + } + }) + this.handleChildStatus(type); + } + }, + + // 点击子设备 线路开关 + handleChildStatus(type) { + this.$prompt("请输入登录密码", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + inputPattern: /^[a-z A-z 0-9 $.]+/, + inputType: "password", + inputErrorMessage: "登录密码不能为空", + }).then(({ value }) => { + let params = { + data: { + cmd: "set_switch", + params: { + switch: 1 + }, + }, + deviceId: '', + verifyKey: value, + }; + + switch(type) { + case 'true': + params.data.params.switch = 1; + params.deviceId = this.tSelectList.toString(); + + case 'false': + params.data.params.switch = 0; + params.deviceId = this.tSelectList.toString(); + } + + setSwitchControl(params).then((res) => { + this.msgSuccess("修改成功"); + }); + + + }); + }, + selectDevClose(e) { + console.log(e) + this.tSelectList.splice(this.tSelectLabelList.indexOf(e), 1); + this.tSelectLabelList.splice(this.tSelectLabelList.indexOf(e), 1) + }, + handleCheckbox(e) { + if(this.tSelectList.indexOf(e.deviceId) >= 0) { + // delete e + this.tSelectList.splice(this.tSelectList.indexOf(e.deviceId), 1); + this.tSelectLabelList.splice(this.tSelectLabelList.indexOf(e.deviceName), 1) + } else { + this.tSelectLabelList.push(e.deviceName) + this.tSelectList.push(e.deviceId) + } + }, signalType(val) { switch (val) { case "5G": @@ -307,18 +408,24 @@ export default { }, handlerWsMsgData(evt) { // console.log("msg:", evt); - this.$emit("wsRealTImeMsg", JSON.stringify(evt)) + this.$emit("wsRealTImeMsg", JSON.stringify(evt)); if (this.deviceInfo.deviceId !== this.wsDeviceInfo.deviceId) { for (let i = 0; i < this.childDeviceList.length; i++) { if (this.childDeviceList[i]["deviceKey"] === evt["devId"]) { - this.childDeviceList[i]["switch"] = evt["params"]["switch"] ? evt["params"]["switch"].toString() : '0'; + this.childDeviceList[i]["switch"] = evt["params"]["switch"] + ? evt["params"]["switch"].toString() + : "0"; this.$forceUpdate(); break; } } } else { - this.deviceInfo["stype"] = evt["params"]["stype"] ? evt["params"]["stype"].toString() : '0'; - this.deviceInfo["signal"] = evt["params"]["signal"] ? evt["params"]["signal"].toString() : '0'; + this.deviceInfo["stype"] = evt["params"]["stype"] + ? evt["params"]["stype"].toString() + : "0"; + this.deviceInfo["signal"] = evt["params"]["signal"] + ? evt["params"]["signal"].toString() + : "0"; } }, socket_onclose(e) { @@ -347,27 +454,27 @@ export default { }, // 定时 ping ws timingPingWs(row) { - this.extenSubmit(row) + this.extenSubmit(row); const _this = this; this.timingPingWs_flag = setInterval(function () { - _this.extenSubmit(row) + _this.extenSubmit(row); }, 110000); }, extenSubmit(row) { let params = { - data: { - cmd: "set_live_time", - params: { - ltime: 15, // 上报间隔(0.1秒) - dtime: 1200, //上报时长(0.1秒) - }, + data: { + cmd: "set_live_time", + params: { + ltime: 15, // 上报间隔(0.1秒) + dtime: 1200, //上报时长(0.1秒) }, - deviceId: row.deviceId, - }; - setSwitchControl(params).then((res) => { - console.log(res) - // this.msgSuccess("成功"); - }); + }, + deviceId: row.deviceId, + }; + setSwitchControl(params).then((res) => { + console.log(res); + // this.msgSuccess("成功"); + }); }, // 点击子设备 线路开关 submitChildStatus(type, row) { @@ -414,18 +521,42 @@ export default { }, }, destroyed() { - this.closeWebscoket() + this.closeWebscoket(); }, };