{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Device\\RealtimeData.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Mobile\\Device\\RealtimeData.vue","mtime":1695626572392},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport equipmentManage from '@/api/device/equipmentManage.js';\nimport req from '@/request.js';\nimport navBar from \"../components/navBar.vue\";\nexport default {\n name: 'RealtimeData',\n components: {\n navBar: navBar\n },\n data: function data() {\n return {\n device: {},\n title: '实时数据',\n protal: window.context.portal,\n deviceId: '',\n deviceData: {},\n queryParam: {\n pageBean: {\n page: -1,\n pageSize: -1,\n showTotal: true\n },\n sorter: [{\n direction: 'DESC',\n property: 'createTime'\n }]\n },\n loading: false,\n type: '',\n realtimeData: [],\n hazard: [// 危险源监测\n {\n value: '',\n name: '采集时间'\n }, {\n value: '',\n name: '气体浓度'\n }],\n barricade: [// 升降路障\n {\n value: '',\n name: '操作人'\n }, {\n value: '',\n name: '动作标识'\n }, {\n value: '',\n name: '动作状态'\n }],\n water: [// 低洼积水监测\n {\n value: '',\n name: '采集时间'\n }, {\n value: '',\n name: '水位高度'\n }],\n signboaerd: [// 标志牌监测\n {\n value: '',\n name: '电池电量',\n unit: '%'\n }, {\n value: '',\n name: '数据类型'\n }, {\n value: '',\n name: 'X轴角度',\n unit: '°'\n }, {\n value: '',\n name: 'Y轴角度',\n unit: '°'\n }, {\n value: '',\n name: 'Z轴角度',\n unit: '°'\n }, {\n value: '',\n name: '设备电压',\n unit: 'v'\n }],\n dataTypeList: [],\n actionList: [],\n statusList: [],\n hasData: true\n };\n },\n mounted: function mounted() {\n this.dataTypeList = dictUtils.getDictItemsFromCache('sjlx');\n this.actionList = dictUtils.getDictItemsFromCache('dzbs');\n this.statusList = dictUtils.getDictItemsFromCache('cgzt');\n this.device = this.$route.query.item;\n this.deviceId = this.$route.query.item.id;\n this.getRealtimeData();\n this.getDevice(this.deviceId);\n },\n methods: {\n onClickLeft: function onClickLeft() {\n this.$router.go(-1);\n },\n getDevice: function getDevice(id) {\n var _this = this;\n\n console.log(id);\n equipmentManage.deviceDetailsInfo(id, function (res) {\n _this.deviceData = res; // 设备详情\n\n console.log(_this.deviceData, '设备详情');\n });\n },\n getRealtimeData: function getRealtimeData() {\n var _this2 = this;\n\n var params = {\n url: \"\".concat(this.protal, \"/device/data/query?id=\") + this.deviceId,\n data: this.queryParam,\n method: 'post'\n };\n req.request(params).then(function (res) {\n if (res.data.state && res.data.value) {\n _this2.realtimeData = res.data.value.data.rows;\n console.log(_this2.realtimeData);\n _this2.type = res.data.value.productType;\n\n _this2.formatData();\n } else {\n _this2.hasData = false;\n }\n });\n },\n formatData: function formatData() {\n var _this3 = this;\n\n if (this.type == 'hazard') {\n for (var key in this.realtimeData) {\n if (key == 'collTime') {\n this.hazard[0].value = this.realtimeData[key];\n } else if (key == 'sdata') {\n this.hazard[1].value = this.realtimeData[key];\n }\n }\n\n this.realtimeData = this.hazard;\n } else if (this.type == 'barricade') {\n var _loop = function _loop(_key) {\n if (_key == 'createBy') {\n _this3.barricade[0].value = _this3.realtimeData[_key];\n } else if (_key == 'action') {\n _this3.actionList.forEach(function (type) {\n if (_this3.realtimeData[_key] == type.value) {\n _this3.barricade[1].value = type.name;\n }\n });\n } else if (_key == 'status') {\n _this3.statusList.forEach(function (type) {\n if (_this3.realtimeData[_key] == type.value) {\n _this3.barricade[2].value = type.name;\n }\n });\n }\n };\n\n for (var _key in this.realtimeData) {\n _loop(_key);\n }\n\n this.realtimeData = this.barricade;\n } else if (this.type == 'water') {\n for (var _key2 in this.realtimeData) {\n if (_key2 == 'collTime') {\n this.water[0].value = this.realtimeData[_key2];\n } else if (_key2 == 'sdata') {\n this.water[1].value = this.realtimeData[_key2];\n }\n }\n\n this.realtimeData = this.water;\n } else if (this.type == 'signboaerd') {\n var _loop2 = function _loop2(_key3) {\n if (_key3 == 'batteryValue') {\n _this3.signboaerd[0].value = _this3.realtimeData[_key3];\n } else if (_key3 == 'dataType') {\n _this3.dataTypeList.forEach(function (type) {\n if (_this3.realtimeData[_key3] == type.value) {\n _this3.signboaerd[1].value = type.name;\n }\n });\n } else if (_key3 == 'angleX') {\n _this3.signboaerd[2].value = _this3.realtimeData[_key3];\n } else if (_key3 == 'angleY') {\n _this3.signboaerd[3].value = _this3.realtimeData[_key3];\n } else if (_key3 == 'angleZ') {\n _this3.signboaerd[4].value = _this3.realtimeData[_key3];\n } else if (_key3 == 'batteryVoltage') {\n _this3.signboaerd[5].value = _this3.realtimeData[_key3];\n }\n };\n\n for (var _key3 in this.realtimeData) {\n _loop2(_key3);\n }\n\n this.realtimeData = this.signboaerd;\n }\n }\n }\n};",null]}