forked from zhurui/management
1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\home-cell-components\\dormitory-electricity.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\home-cell-components\\dormitory-electricity.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\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\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tdataList: [],\n\t\t\tyAxis: [],\n\t\t\tseries: [],\n\t\t}\n\t},\n\tmounted() {\n\t\tthis.electricityFun()\n\t},\n\tactivated() {\n\t\tconst timer = setInterval(() => {\n\t\t\tthis.electricityFun();\n\t\t}, 30*1000);\n\t\tthis.$once(\"hook:deactivated\", () => {\n\t\t\tclearInterval(timer)\n\t\t})\n\t\tthis.$once(\"hook:destroyed\", () => {\n\t\t\tclearInterval(timer)\n\t\t})\n\t},\n\tmethods: {\n\t\tdraw() {\n\t\t\t// 实例化echarts对象\n\t\t\tlet myChartDrawer = this.$echarts.init(this.$refs.myEchart);\n\t\t\tlet option = option = {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: '',\n\t\t\t\t\tsubtext: ''\n\t\t\t\t},\n\t\t\t\ttooltip: {\n\t\t\t\t\ttrigger: 'axis',\n\t\t\t\t\taxisPointer: {\n\t\t\t\t\t\ttype: 'shadow'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgrid: {\n\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\ttop: '10%',\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: '10%',\n\t\t\t\t\tbottom: '3%',\n\t\t\t\t\tcontainLabel: true\n\t\t\t\t},\n\t\t\t\txAxis: {\n\t\t\t\t\tname: 'kW·h',\n\t\t\t\t\ttype: 'value',\n\t\t\t\t\tboundaryGap: [0, 0.01],\n\t\t\t\t\tsplitLine: {\n\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\tcolor: '#FFF'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\taxisLine: {\n\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\tcolor: \"#FFF\"\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\taxisLabel: {\n\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\t\tcolor: '#fff'\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tyAxis: {\n\t\t\t\t\tname: \"房间号\",\n\t\t\t\t\ttype: 'category',\n\t\t\t\t\tsplitLine: {\n\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\tcolor: '#FFF'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\taxisLine: {\n\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\tcolor: \"#FFF\"\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\taxisLabel: {\n\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\t\tcolor: '#fff'\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdata: this.yAxis\n\t\t\t\t},\n\t\t\t\tseries: [{\n\t\t\t\t\tname: '',\n\t\t\t\t\ttype: 'bar',\n\t\t\t\t\tbarWidth: '10px',\n\t\t\t\t\tdata: this.series,\n\t\t\t\t\titemStyle: {\n\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\tcolor: '#C40',\n\t\t\t\t\t\t\tbarBorderRadius: 30,\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}]\n\t\t\t};\n\t\t\tmyChartDrawer.setOption(option);\n\t\t\tlet that = this\n\t\t\tmyChartDrawer.on('click', function(param) {\n\t\t\t\tlet room = param.name\n\t\t\t\tlet floorId = ''\n\t\t\t\tthat.dataList.forEach(item => {\n\t\t\t\t\tif (room === item.chNum) {\n\t\t\t\t\t\tfloorId = item.floorid\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t// that.$store.state.user.floorId=floorId\n\t\t\t\tsessionStorage.setItem(\"floorId\", floorId)\n\t\t\t\tthat.$router.push({\n\t\t\t\t\tname: \"dormitoryManage-room\"\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t\t//用电\n\t\telectricityFun() {\n\t\t\tthis.$http.get('/system/index/roomCurrentAlarm')\n\t\t\t\t.then(({\n\t\t\t\t\tdata: res\n\t\t\t\t}) => {\n\t\t\t\t\tif (res.code != 0) {\n\t\t\t\t\t\treturn this.$message.error(res.msg)\n\t\t\t\t\t}\n\t\t\t\t
|