提交: 调整 设备详情下 信号类型 使用字典 ( 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/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 type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=4b483d227a9c7dd12e46faae5a8c8af8"></script>
|
||||||
<script src="<%= BASE_URL %>js/config.js"></script>
|
<script src="<%= BASE_URL %>js/config.js"></script>
|
||||||
|
|
|
@ -16,7 +16,7 @@ import './assets/icons' // icon
|
||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
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 { pluginsCope } from "@/utils/hciot";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
import VueClipboard from 'vue-clipboard2'
|
import VueClipboard from 'vue-clipboard2'
|
||||||
|
@ -40,6 +40,7 @@ Vue.prototype.selectDictLabels = selectDictLabels
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
Vue.prototype.copeFu = pluginsCope
|
Vue.prototype.copeFu = pluginsCope
|
||||||
|
Vue.prototype.selectDictDesc = selectDictDesc
|
||||||
|
|
||||||
Vue.prototype.msgSuccess = function (msg) {
|
Vue.prototype.msgSuccess = function (msg) {
|
||||||
this.$message({ showClose: true, message: msg, type: "success" });
|
this.$message({ showClose: true, message: msg, type: "success" });
|
||||||
|
|
|
@ -81,6 +81,19 @@ export function selectDictLabel(datas, value) {
|
||||||
return actions.join('');
|
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) {
|
export function selectDictLabels(datas, value, separator) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
|
|
|
@ -41,30 +41,29 @@
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<!-- <div
|
||||||
style="width: 60px; display: flex; justify-content: center"
|
style="width: 60px; display: flex; justify-content: center"
|
||||||
v-if="deviceInfo.stype === 'LAN'"
|
v-if="deviceInfo.stype === 'LAN' || deviceInfo.stype === 'lan'"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="iconfont iconkuandai"
|
:class="`iconfont ${statusFormat(deviceInfo.stype)}`"
|
||||||
style="color: black; font-size: 20px"
|
style="color: black; font-size: 20px"
|
||||||
></i>
|
></i>
|
||||||
</div>
|
</div> -->
|
||||||
<div
|
<div
|
||||||
style="width: 60px; display: flex; justify-content: center"
|
style="width: 60px; display: flex; justify-content: center"
|
||||||
v-else
|
|
||||||
>
|
>
|
||||||
<i
|
<!-- <i
|
||||||
class="iconfont iconwifi"
|
:class="`iconfont ${statusFormat(deviceInfo.stype)}`"
|
||||||
style="color: black; font-size: 20px"
|
style="color: black; font-size: 20px"
|
||||||
v-if="deviceInfo.stype === 'WIFI'"
|
v-if="deviceInfo.stype === 'WIFI' || deviceInfo.stype === 'wifi'"
|
||||||
></i>
|
></i> -->
|
||||||
<i
|
<i
|
||||||
:class="signalType(deviceInfo.stype)"
|
:class="signalType(deviceInfo.stype)"
|
||||||
style="color: black; font-size: 20px"
|
style="color: black; font-size: 20px"
|
||||||
v-else
|
|
||||||
></i>
|
></i>
|
||||||
<signal-intensity
|
<signal-intensity
|
||||||
|
v-if="deviceInfo.stype !== 'LAN' && deviceInfo.stype !== 'lan'"
|
||||||
:intensityNumber="deviceInfo.signal"
|
:intensityNumber="deviceInfo.signal"
|
||||||
></signal-intensity>
|
></signal-intensity>
|
||||||
</div>
|
</div>
|
||||||
|
@ -256,12 +255,16 @@ export default {
|
||||||
setTimeOut_flag: null,
|
setTimeOut_flag: null,
|
||||||
timingPingWs_flag: null,
|
timingPingWs_flag: null,
|
||||||
tSelectList: [],
|
tSelectList: [],
|
||||||
tSelectLabelList: []
|
tSelectLabelList: [],
|
||||||
|
iotSignalType: []
|
||||||
// wsDeviceInfo: null?
|
// wsDeviceInfo: null?
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.checkobxDeviceId = this.deviceInfo.deviceId || null;
|
this.checkobxDeviceId = this.deviceInfo.deviceId || null;
|
||||||
|
this.getDicts("iot_signal_type").then((response) => {
|
||||||
|
this.iotSignalType = response.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
wsDeviceInfo: {
|
wsDeviceInfo: {
|
||||||
|
@ -364,19 +367,29 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
signalType(val) {
|
signalType(val) {
|
||||||
switch (val) {
|
if (val) {
|
||||||
case "5G":
|
return "iconfont " + this.statusFormat(val);
|
||||||
return "iconfont icona-5G";
|
|
||||||
case "4G":
|
|
||||||
return "iconfont icon4g";
|
|
||||||
case "3G":
|
|
||||||
return "iconfont icon3g";
|
|
||||||
case "2G":
|
|
||||||
return "iconfont icong";
|
|
||||||
default:
|
|
||||||
return "iconfont icong";
|
|
||||||
}
|
}
|
||||||
|
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 获取子设备 状态
|
// ws 获取子设备 状态
|
||||||
connection() {
|
connection() {
|
||||||
if (this.stompClient) {
|
if (this.stompClient) {
|
||||||
|
|
Loading…
Reference in New Issue