提交: 调整 设备详情下 信号类型 使用字典 ( iot_signal_type );
This commit is contained in:
parent
da45aed2d8
commit
44873df769
|
@ -11,7 +11,7 @@
|
|||
<link rel="stylesheet" href="//at.alicdn.com/t/font_2506643_9w119og75cs.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_2506643_5jmnx3lcnpu.css">
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_2506643_67w6wmrp9dc.css">
|
||||
|
||||
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=4b483d227a9c7dd12e46faae5a8c8af8"></script>
|
||||
<script src="<%= BASE_URL %>js/config.js"></script>
|
||||
|
|
|
@ -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" });
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -41,30 +41,29 @@
|
|||
padding-top: 5px;
|
||||
"
|
||||
>
|
||||
<div
|
||||
<!-- <div
|
||||
style="width: 60px; display: flex; justify-content: center"
|
||||
v-if="deviceInfo.stype === 'LAN'"
|
||||
v-if="deviceInfo.stype === 'LAN' || deviceInfo.stype === 'lan'"
|
||||
>
|
||||
<i
|
||||
class="iconfont iconkuandai"
|
||||
:class="`iconfont ${statusFormat(deviceInfo.stype)}`"
|
||||
style="color: black; font-size: 20px"
|
||||
></i>
|
||||
</div>
|
||||
</div> -->
|
||||
<div
|
||||
style="width: 60px; display: flex; justify-content: center"
|
||||
v-else
|
||||
>
|
||||
<i
|
||||
class="iconfont iconwifi"
|
||||
<!-- <i
|
||||
:class="`iconfont ${statusFormat(deviceInfo.stype)}`"
|
||||
style="color: black; font-size: 20px"
|
||||
v-if="deviceInfo.stype === 'WIFI'"
|
||||
></i>
|
||||
v-if="deviceInfo.stype === 'WIFI' || deviceInfo.stype === 'wifi'"
|
||||
></i> -->
|
||||
<i
|
||||
:class="signalType(deviceInfo.stype)"
|
||||
style="color: black; font-size: 20px"
|
||||
v-else
|
||||
></i>
|
||||
<signal-intensity
|
||||
v-if="deviceInfo.stype !== 'LAN' && deviceInfo.stype !== 'lan'"
|
||||
:intensityNumber="deviceInfo.signal"
|
||||
></signal-intensity>
|
||||
</div>
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue