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; " > -