forked from zhurui/management
1 line
18 KiB
JSON
1 line
18 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\\dormitoryManage\\electric.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\dormitoryManage\\electric.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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport dormitoryTree from '../../../components/public/dormitory-tree'\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tdateTime: [\n\t\t\t\tnew Date()\n\t\t\t\t.toLocaleString(\"zh\", {\n\t\t\t\t\tyear: \"numeric\",\n\t\t\t\t\tmonth: \"2-digit\",\n\t\t\t\t\tday: \"2-digit\"\n\t\t\t\t})\n\t\t\t\t.substr(0, 10) + \" 00:00:00\",\n\t\t\t\tnew Date()\n\t\t\t\t.toLocaleString(\"zh\", {\n\t\t\t\t\tyear: \"numeric\",\n\t\t\t\t\tmonth: \"2-digit\",\n\t\t\t\t\tday: \"2-digit\"\n\t\t\t\t})\n\t\t\t\t.substr(0, 10) + \" 23:59:59\"\n\t\t\t],\n\t\t\ttreeValue: {\n\t\t\t\tdf_floorid: '',\n\t\t\t\tdf_type: '',\n\t\t\t\tdf_floorname: ''\n\t\t\t},\n\t\t\tdataForm: {\n\t\t\t\tstartDate: \"\",\n\t\t\t\tendDate: \"\",\n\t\t\t},\n\t\t\txAxisData: [],\n\t\t\tydata: [],\n\t\t\tfloorName: \"\",\n\t\t}\n\t},\n\tcomponents: {\n\t\tdormitoryTree\n\t},\n\tactivated() {\n\t\tconst timer = setInterval(() => {\n\t\t\tthis.clickSearch();\n\t\t}, 30000);\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\twatch: {\n\t\t'$store.state.user.defaultCheckedKeys': {\n\t\t\thandler(val) {\n\t\t\t\tif (val) {\n\t\t\t\t\tthis.clickSearchs(val);\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeep: true,\n\t\t\timmediate: true\n\t\t},\n\t},\n\tmethods: {\n\t\t//树形控件 回调函数\n\t\ttreeFun(val) {\n\t\t\tthis.treeValue = val;\n\t\t\tif (val.df_type != '2') {\n\t\t\t\treturn this.$message.info('请选择房间查看宿舍电流')\n\t\t\t}\n\t\t\tthis.floorName = val.df_floorname\n\t\t\tthis.clickSearch()\n\t\t},\n\t\t//搜索\n\t\tclickSearch() {\n\t\t\tif (!this.dateTime || this.dateTime.length == '0') {\n\t\t\t\treturn this.$message.error('请选择时间范围')\n\t\t\t} else if (!this.$store.state.user.defaultCheckedKeys) {\n\t\t\t\treturn this.$message.error('暂无楼栋数据,无法查询')\n\t\t\t}\n\t\t\tlet startDate = this.dateTime[0].replace(/\\//g, '-')\n\t\t\tlet endDate = this.dateTime[1].replace(/\\//g, '-')\n\t\t\tlet id = ''\n\t\t\tif (this.treeValue.df_floorid == '') {\n\t\t\t\tid = this.$store.state.user.defaultCheckedKeys\n\t\t\t} else {\n\t\t\t\tid = this.treeValue.df_floorid\n\t\t\t}\n\n\t\t\tthis.$http.get(`/system/sccurrenthistory/${id}/${startDate}/${endDate}`)\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\t\n\t\t\t\t\t// chColltime: \"2020-10-31 17:53:08\",\n\t\t\t\t\t// chEcurrent: 0.0424328\n\n\n\t\t\t\t\tlet arrData = res.data; //所有数据\n\t\t\t\t\tlet xData = []; //x 数据\n\t\t\t\t\tlet data = []; //y 数据\n\n\t\t\t\t\tthis.xAxisData = []\n\n\t\t\t\t\txData = arrData.map(item => item.chColltime.slice(11, 19))\n\t\t\t\t\tdata = arrData.map(item => item.chEcurrent)\n\t\t\t\t\tthis.ydata = data.map(item => {\n\t\t\t\t\t\treturn item.toFixed(2)\n\t\t\t\t\t})\n\t\t\t\t\tthis.xAxisData = xData;\n\t\t\t\t\tthis.electricFun()\n\t\t\t\t})\n\t\t},\n\t\t//搜
|