{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\WaterRealDataModel.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\WaterRealDataModel.vue","mtime":1669171690206},{"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":["//\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\r\nimport req from '@/request.js'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport equipmentManage from '@/api/device/equipmentManage.js'\r\nimport productManage from '@/api/device/productManage.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nexport default {\r\n name: 'RealTimeData',\r\n mixins: [TableMixin],\r\n props: {\r\n parameter: {\r\n type: Object,\r\n default: function() {\r\n return\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n productParams: {},\r\n productType: {},\r\n realData: [],\r\n productTypelx: '',\r\n dataTypeList: [], //数据类型字典\r\n actionList: [], //动作标识字典\r\n statusList: [], //成功状态字典\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'BETWEEN',\r\n parentGroup: '',\r\n property: 'b.coll_time_',\r\n relation: 'AND',\r\n value: ''\r\n }\r\n ],\r\n sorter: [\r\n {\r\n direction: 'DESC',\r\n property: 'collTime'\r\n }\r\n ]\r\n }\r\n },\r\n created() {\r\n console.log(this.parameter)\r\n this.dataTypeList = dictUtils.getDictItemsFromCache('sjlx')\r\n this.actionList = dictUtils.getDictItemsFromCache('dzbs')\r\n this.statusList = dictUtils.getDictItemsFromCache('cgzt')\r\n this.getProduct()\r\n },\r\n mounted() {},\r\n methods: {\r\n handleUpdate(row) {\r\n console.log(row);\r\n },\r\n // 重置\r\n clearQuerys() {\r\n this.querys[0].value = ''\r\n },\r\n getProduct() {\r\n productManage.productInfoDetail(this.parameter.productId).then(res => {\r\n this.productParams = res\r\n productManage.productTypeDetail(this.productParams.typeId).then(res => {\r\n this.productType = res\r\n // this.loadData()\r\n })\r\n })\r\n },\r\n loadData(page) {\r\n if (page) {\r\n this.queryParam.pageBean.page = page\r\n }\r\n this.loading = true\r\n this.tableData = []\r\n this.queryParam.querys = []\r\n this.queryParam = Object.assign(this.queryParam, {sorter: this.sorter})\r\n if (this.querys[0].value) {\r\n this.queryParam.querys.push(this.querys[0])\r\n }\r\n let protal = window.context.portal\r\n let requestData = {\r\n url: `${protal}/device/data/query?id=` + this.parameter.id,\r\n data: this.queryParam,\r\n method: 'post'\r\n }\r\n // 根据设备id获取实时数据\r\n req\r\n .request(requestData)\r\n .then(res => {\r\n console.log(res)\r\n if (res.status) {\r\n this.productTypelx = res.data.value.productType\r\n this.tableData = res.data.value.data.rows\r\n this.total = res.data.value.data.total\r\n this.$set(this.tableData)\r\n this.loading = false\r\n this.tableData.forEach(item => {\r\n this.dataTypeList.forEach(val => {\r\n if (item.dataType && item.dataType == val.value) {\r\n item['dataType'] = val.name\r\n }\r\n })\r\n this.actionList.forEach(val => {\r\n if (item.action && item.action == val.value) {\r\n item['action'] = val.name\r\n }\r\n })\r\n this.statusList.forEach(val => {\r\n if (item.status && item.status == val.value) {\r\n item['status'] = val.name\r\n }\r\n })\r\n })\r\n }\r\n })\r\n .catch(err => {\r\n console.log(err)\r\n })\r\n }\r\n }\r\n}\r\n",null]}