diff --git a/src/api/iot/deviceOta.js b/src/api/iot/deviceOta.js new file mode 100644 index 00000000..8e193a38 --- /dev/null +++ b/src/api/iot/deviceOta.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 查询固件版本列表 +export function listOta(query) { + return request({ + url: '/iot/ota/list', + method: 'get', + params: query + }) +} + +// 查询固件版本详细 +export function getOta(otaId) { + return request({ + url: '/iot/ota/' + otaId, + method: 'get' + }) +} + +// 新增固件版本 +export function addOta(data) { + return request({ + url: '/iot/ota', + method: 'post', + data: data + }) +} + +// 修改固件版本 +export function updateOta(data) { + return request({ + url: '/iot/ota', + method: 'put', + data: data + }) +} + +// 删除固件版本 +export function delOta(otaId) { + return request({ + url: '/iot/ota/' + otaId, + method: 'delete' + }) +} + +// 导出固件版本 +export function exportOta(query) { + return request({ + url: '/iot/ota/export', + method: 'get', + params: query + }) +} + +// 新增固件版本 +export function upgradeOta(data) { + return request({ + url: '/iot/ota/upgrade', + method: 'post', + data: data + }) +} diff --git a/src/api/iot/library.js b/src/api/iot/library.js index e872af3f..e985f804 100644 --- a/src/api/iot/library.js +++ b/src/api/iot/library.js @@ -52,6 +52,16 @@ export function exportLibrary(query) { }) } +// 导出硬件数据库 /csv +export function exportLibraryCsv(query) { + return request({ + url: '/iot/library/export/csv', + method: 'get', + params: query + }) +} + + // 下载用户导入模板 export function importTemplate() { return request({ diff --git a/src/api/power/maintenance.js b/src/api/power/maintenance.js index 4119a69b..3996534a 100644 --- a/src/api/power/maintenance.js +++ b/src/api/power/maintenance.js @@ -9,6 +9,15 @@ export function listMaintenance(query) { }) } +// 查询工单信息列表 +export function myListMaintenance(query) { + return request({ + url: '/iot/maintenance/my-list', + method: 'get', + params: query + }) +} + // 查询工单信息详细 export function getMaintenance(maintenanceId) { return request({ diff --git a/src/api/tenant/projectUser.js b/src/api/tenant/projectUser.js index e014f0aa..5acf3a79 100644 --- a/src/api/tenant/projectUser.js +++ b/src/api/tenant/projectUser.js @@ -21,7 +21,7 @@ export function listProjectNotUsed(query) { // 新增项目用户 export function addProjectUser(data) { return request({ - url: "/tenant/project_user", + url: "/iot/project_user", method: "post", data: data }); diff --git a/src/config/env.js b/src/config/env.js index 58e6bcb6..7dd81821 100644 --- a/src/config/env.js +++ b/src/config/env.js @@ -8,8 +8,10 @@ let iotWebSocketBaseUrl = '' let devLiveWebSocketBaseUrl = '' let sysWebSocket = 'ws://' let prodApi = '/prod-api'; +let wsProtocol = 'ws://'; var hrefHost = window.location.host; let iotWebSocketAlarmBaseUrl = ''; +let httpProtocol = window.location.protocol; if (env.NODE_ENV == 'development') { @@ -20,6 +22,9 @@ if (env.NODE_ENV == 'development') { // if (hrefHost.indexOf('.gkiiot.com') >= 0) { // iotHost = 'iot.gkiiot.com' // } + if(httpProtocol.indexOf("https") > -1){ + sysWebSocket = 'wss://'; + } } else if(env.NODE_ENV == 'test') { } iotWebSocketAlarmBaseUrl = sysWebSocket + hrefHost + ':8899/ws/alarm/live' diff --git a/src/utils/hciot.js b/src/utils/hciot.js index 865a2255..3693c9f7 100644 --- a/src/utils/hciot.js +++ b/src/utils/hciot.js @@ -159,6 +159,7 @@ export function getIotFileUrl(importUrl) { if (importUrl.indexOf('http') === 0 || importUrl.indexOf('https') === 0) { return importUrl; } else if (importUrl.indexOf('/profile/upload/') === 0 || importUrl.indexOf('/profile/avatar/') === 0) { + console.log('baseUrl:', baseURL + importUrl); return baseURL + importUrl; } else if (importUrl.indexOf('data:image/') === 0 || importUrl.indexOf('/static/') === 0) { return importUrl; @@ -202,7 +203,7 @@ export const preventRepeatFu = (res) => { if (res) { loading = Loading.service({ lock: true, - text: '请求中。。。', + text: '请求中...', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); @@ -231,3 +232,30 @@ export const pluginsCope = (value, _this) => { ); } +/** + ** 文件流下载 + ** data 文件流,fileName:文件名 + ** 文件名从请求头headers获取,文件名这里按实际情况获取 + */ +export const downloadFile = (data, fileName) => { + if (!data) { + return; + } + let blob = new Blob([data], { + type: + "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8" + }); + let url = window.URL.createObjectURL(blob); + if ("download" in document.createElement("a")) { + const a = document.createElement("a"); + a.href = url; + a.download = fileName; + a.style.display = "none"; + document.body.appendChild(a); + a.click(); + URL.revokeObjectURL(a.href); + document.body.removeChild(a); + } else { + navigator.msSaveBlob(blob, fileName); + } +} diff --git a/src/views/alarm/record/index.vue b/src/views/alarm/record/index.vue index 29feb354..b71545f9 100644 --- a/src/views/alarm/record/index.vue +++ b/src/views/alarm/record/index.vue @@ -57,7 +57,11 @@ {{ parseTime(scope.row.alarmTime, '{y}-{m}-{d}') }} - + + + - + - + 发布时间:{{info.updateTime}} - 更多新闻。。。 + 更多新闻...
diff --git a/src/views/bigScreen/v3/index.vue b/src/views/bigScreen/v3/index.vue index 416dfa02..1dcdd0b6 100644 --- a/src/views/bigScreen/v3/index.vue +++ b/src/views/bigScreen/v3/index.vue @@ -111,6 +111,7 @@ export default { userLoginType: "", stompClient: null, socket_flag: true, + setIntervalGetCountOpt: null }; }, mounted() { @@ -211,6 +212,14 @@ export default { }, // 查询警情信息 homeCount() { + if (this.setIntervalGetCountOpt) { + clearInterval(this.setIntervalGetCountOpt); + } + this.setIntervalGetCount(); + this.setIntervalGetCountOpt = setInterval(this.setIntervalGetCount, 1000 * 60 * 30) + }, + // 定时执行 请求 + setIntervalGetCount() { homeCount({ alarmDivide: "ALARM", projectId: this.projectId, @@ -232,6 +241,9 @@ export default { document.getElementById("con_lf_top_div").style.background = "#fff"; document.getElementById("con_lf_top_div").style.overflow = "auto"; document.getElementById("con_lf_top_div").scrollTop = this.thisScrollTopY; + if (this.setIntervalGetCountOpt) { + clearInterval(this.setIntervalGetCountOpt); + } }, }; diff --git a/src/views/iot/alarm/record/index.vue b/src/views/iot/alarm/record/index.vue index c24660b0..5840f4a9 100644 --- a/src/views/iot/alarm/record/index.vue +++ b/src/views/iot/alarm/record/index.vue @@ -31,8 +31,16 @@ /> - 搜索 - 重置 + 搜索 + 重置 @@ -45,23 +53,49 @@ size="mini" @click="handleExport" v-hasPermi="['iot:record:export']" - >导出 + >导出 - + - - - + + + - + - - + + - - + + { + listRecord(this.queryParams).then((response) => { this.recordList = response.rows; this.total = response.total; this.loading = false; @@ -180,7 +250,7 @@ export default { }, // 根据id获取记录详情 getRecordInfo(id) { - getRecord(id).then(res => { + getRecord(id).then((res) => { this.form = res.data; this.open = true; this.title = `告警记录详情`; @@ -205,15 +275,15 @@ export default { this.$confirm("是否确认导出所有报警记录数据项?", "警告", { confirmButtonText: "确定", cancelButtonText: "取消", - type: "warning" + type: "warning", }) - .then(function() { + .then(function () { return exportRecord(queryParams); }) - .then(response => { + .then((response) => { this.download(response.msg); }); - } - } + }, + }, }; diff --git a/src/views/iot/alarm/type/index.vue b/src/views/iot/alarm/type/index.vue index c991429a..eeac970c 100644 --- a/src/views/iot/alarm/type/index.vue +++ b/src/views/iot/alarm/type/index.vue @@ -186,7 +186,7 @@ - {{keys}} + {{keys}} @@ -195,8 +195,8 @@ v-model="form.status" active-color="#13ce66" inactive-color="#dad5d5" - active-value="1" - inactive-value="0" + active-value="0" + inactive-value="1" > diff --git a/src/views/iot/alarm/waringRecord/index.vue b/src/views/iot/alarm/waringRecord/index.vue index 6994cf4c..6be4b79f 100644 --- a/src/views/iot/alarm/waringRecord/index.vue +++ b/src/views/iot/alarm/waringRecord/index.vue @@ -50,7 +50,8 @@ - + - + - - + + - + - + - + /> --> - + 修改 --> - + 导出 + + 导出CSV + - + { + downloadFile(response, '硬件设备数据.csv'); + }); + }, + /** 导出按钮操作 */ handleExport() { const queryParams = this.queryParams; this.$confirm("是否确认导出所有硬件数据库数据项?", "警告", { diff --git a/src/views/iot/ota/index.vue b/src/views/iot/ota/index.vue new file mode 100644 index 00000000..a478df11 --- /dev/null +++ b/src/views/iot/ota/index.vue @@ -0,0 +1,736 @@ + + + diff --git a/src/views/iot/trigger/index.vue b/src/views/iot/trigger/index.vue index 1704839d..f8c1a928 100644 --- a/src/views/iot/trigger/index.vue +++ b/src/views/iot/trigger/index.vue @@ -32,7 +32,7 @@ diff --git a/src/views/personal/alarm/index.vue b/src/views/personal/alarm/index.vue index c3ccbe9a..74f798d5 100644 --- a/src/views/personal/alarm/index.vue +++ b/src/views/personal/alarm/index.vue @@ -50,7 +50,8 @@ - + - + - + - + - + - + - + - + + + + + + + + + + 搜索 重置 @@ -47,11 +68,13 @@ --> - + - + @@ -230,6 +253,14 @@ export default { this.getList(); }, methods: { + sortChange(column) { + const sort = { + isAsc: column.order === "descending" ? "desc" : "asc", + orderByColumn: column.prop, + }; + this.queryParams = Object.assign(this.queryParams, sort); + this.handleQuery(); + }, auditResultChange(val) { if (val === "通过") { this.form.maintenanceStatus = "5"; diff --git a/src/views/power/maintenance/index.vue b/src/views/power/maintenance/index.vue index b16be0d5..07b09fc4 100644 --- a/src/views/power/maintenance/index.vue +++ b/src/views/power/maintenance/index.vue @@ -32,6 +32,26 @@ + + + + + + + + - +