{"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//搜索\n\t\tclickSearchs(val) {\n\t\t\tlet startDate = this.dateTime[0].replace(/\\//g, '-')\n\t\t\tlet endDate = this.dateTime[1].replace(/\\//g, '-')\n\n\t\t\tthis.$http.get(`/system/sccurrenthistory/${val}/${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\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\n\t\t\t\t})\n\t\t},\n\t\t//echarts 图表\n\t\telectricFun() {\n\t\t\tlet mycharts = this.$echarts.init(document.getElementById('electric_echarts'));\n\t\t\twindow.onresize = mycharts.resize;\n\t\t\tlet options = {\n\t\t\t\tdataZoom: [{\n\t\t\t\t\ttype: 'inside',\n\t\t\t\t\tstart: this.xAxisData.length < 10 ? 0 : ((this.xAxisData.length - 10) / this.xAxisData.length) * 100,\n\t\t\t\t\tend: 100,\n\t\t\t\t\tfilterMode: 'empty',\n\t\t\t\t\t// zoomLock:true,\n\t\t\t\t}],\n\t\t\t\ttitle: {\n\t\t\t\t\t//text: '监控'\n\t\t\t\t},\n\t\t\t\ttooltip: {\n\t\t\t\t\ttrigger: 'axis',\n\t\t\t\t\titemStyle: {\n\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\tlabel: {\n\t\t\t\t\t\t\t\tshow: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t//工具图标\n\t\t\t\ttoolbox: {\n\t\t\t\t\tshow: false,\n\t\t\t\t\tfeature: {\n\t\t\t\t\t\tmagicType: {\n\t\t\t\t\t\t\ttype: ['line', 'bar']\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\txAxis: {\n\t\t\t\t\ttype: 'category',\n\t\t\t\t\taxisLine: {\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\tdata: this.xAxisData\n\t\t\t\t},\n\t\t\t\tyAxis: {\n\t\t\t\t\ttype: 'value',\n\t\t\t\t\tname: \"电流(A)\",\n\t\t\t\t\taxisLine: {\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\tsplitLine: { //网格线\n\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\ttype: 'dashed' //设置网格线类型 dotted:虚线 solid:实线\n\t\t\t\t\t\t},\n\t\t\t\t\t\tshow: true //隐藏或显示\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tseries: [{\n\t\t\t\t\tname: '电流',\n\t\t\t\t\ttype: 'line',\n\t\t\t\t\tdata: this.ydata,\n\t\t\t\t\tlabel: {\n\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\tposition: 'top',\n\t\t\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\t\t\tcolor: 'white'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t//对于超上限的数据用默认样式展示\n\t\t\t\t\tmarkPoint: {\n\t\t\t\t\t\titemStyle: {\n\t\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\t\tborderColor: '#fab60c',\n\t\t\t\t\t\t\t\tborderWidth: 5, // 标注边线线宽,单位px,默认为1\n\t\t\t\t\t\t\t\tlabel: {\n\t\t\t\t\t\t\t\t\tshow: true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\temphasis: {\n\t\t\t\t\t\t\t\tborderColor: '#fab60c',\n\t\t\t\t\t\t\t\tborderWidth: 5,\n\t\t\t\t\t\t\t\tlabel: {\n\t\t\t\t\t\t\t\t\tshow: true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdata: 20\n\t\t\t\t\t},\n\t\t\t\t\tmarkLine: {\n\t\t\t\t\t\tsymbol: \"none\", //去掉警戒线最后面的箭头\n\t\t\t\t\t\tlabel: {\n\t\t\t\t\t\t\tposition: \"end\", //将警示值放在哪个位置,三个值“start”,\"middle\",\"end\" 开始 中点 结束\n\t\t\t\t\t\t\tformatter: \"阈值线\" + this.$getDictLabel(\"electricValue\", 0)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdata: [{\n\t\t\t\t\t\t\tsilent: true, //鼠标悬停事件 true没有,false有\n\t\t\t\t\t\t\tlineStyle: { //警戒线的样式 ,虚实 颜色\n\t\t\t\t\t\t\t\ttype: \"dashes\",\n\t\t\t\t\t\t\t\tcolor: \"rgba(238, 99, 99)\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tname: '阈值线',\n\t\t\t\t\t\t\tyAxis: this.$getDictLabel(\"electricValue\", 0)\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\tsmooth: true,\n\t\t\t\t}]\n\t\t\t}\n\t\t\tmycharts.setOption(options)\n\t\t}\n\t}\n}\n",{"version":3,"sources":["electric.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"electric.vue","sourceRoot":"src/views/modules/dormitoryManage","sourcesContent":["\n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
查询\n\t\t\t\t\t
\n\t\t\t\t\t
301房间
\n\t\t\t\t\t
{{floorName}}房间
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n"]}]}