diff --git a/public/index.html b/public/index.html index 4eb3816a..3b12a6c3 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ - + diff --git a/src/main.js b/src/main.js index 41431590..6441e178 100644 --- a/src/main.js +++ b/src/main.js @@ -16,7 +16,7 @@ import './assets/icons' // icon import './permission' // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/smartpower"; +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, selectDictDesc } from "@/utils/smartpower"; import { pluginsCope } from "@/utils/hciot"; import Pagination from "@/components/Pagination"; import VueClipboard from 'vue-clipboard2' @@ -40,6 +40,7 @@ Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree Vue.prototype.copeFu = pluginsCope +Vue.prototype.selectDictDesc = selectDictDesc Vue.prototype.msgSuccess = function (msg) { this.$message({ showClose: true, message: msg, type: "success" }); diff --git a/src/utils/smartpower.js b/src/utils/smartpower.js index c2c941a8..f8767fea 100644 --- a/src/utils/smartpower.js +++ b/src/utils/smartpower.js @@ -81,6 +81,19 @@ export function selectDictLabel(datas, value) { return actions.join(''); } +// 回显数据字典 描述 +export function selectDictDesc(datas, value) { + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].dictValue == ('' + value)) { + actions.push(datas[key].remark); + return true; + } + }) + return actions.join(''); +} + + // 回显数据字典(字符串数组) export function selectDictLabels(datas, value, separator) { var actions = []; diff --git a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue index dbc7862d..22a30d15 100644 --- a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue +++ b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue @@ -41,30 +41,29 @@ padding-top: 5px; " > -
-
+ -->
- + v-if="deviceInfo.stype === 'WIFI' || deviceInfo.stype === 'wifi'" + > -->
@@ -256,12 +255,16 @@ export default { setTimeOut_flag: null, timingPingWs_flag: null, tSelectList: [], - tSelectLabelList: [] + tSelectLabelList: [], + iotSignalType: [] // wsDeviceInfo: null? }; }, created() { this.checkobxDeviceId = this.deviceInfo.deviceId || null; + this.getDicts("iot_signal_type").then((response) => { + this.iotSignalType = response.data; + }); }, watch: { wsDeviceInfo: { @@ -364,19 +367,29 @@ export default { } }, signalType(val) { - switch (val) { - case "5G": - return "iconfont icona-5G"; - case "4G": - return "iconfont icon4g"; - case "3G": - return "iconfont icon3g"; - case "2G": - return "iconfont icong"; - default: - return "iconfont icong"; + if (val) { + return "iconfont " + this.statusFormat(val); } + return "iconfont " + this.statusFormat('0'); + // switch (val) { + // case "5G": + // return "iconfont " + this.statusFormat(val); + // case "4G": + // return "iconfont " + this.statusFormat(val); + // case "3G": + // return "iconfont " + this.statusFormat(val); + // case "2G": + // return "iconfont " + this.statusFormat(val); + // default: + // return "iconfont " + this.statusFormat(0); + // } }, + + // 字典状态字典翻译 描述 + statusFormat(value) { + return this.selectDictDesc(this.iotSignalType, value); + }, + // ws 获取子设备 状态 connection() { if (this.stompClient) {