forked from zhurui/management
1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nexport default {\n data: function data() {\n return {\n dataList: [],\n yAxis: [],\n series: []\n };\n },\n mounted: function mounted() {\n this.electricityFun();\n },\n activated: function activated() {\n var _this = this;\n\n var timer = setInterval(function () {\n _this.electricityFun();\n }, 30 * 1000);\n this.$once(\"hook:deactivated\", function () {\n clearInterval(timer);\n });\n this.$once(\"hook:destroyed\", function () {\n clearInterval(timer);\n });\n },\n methods: {\n draw: function draw() {\n // 实例化echarts对象\n var myChartDrawer = this.$echarts.init(this.$refs.myEchart);\n var option = option = {\n title: {\n text: '',\n subtext: ''\n },\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n },\n grid: {\n borderWidth: 0,\n top: '10%',\n left: 0,\n right: '10%',\n bottom: '3%',\n containLabel: true\n },\n xAxis: {\n name: 'kW·h',\n type: 'value',\n boundaryGap: [0, 0.01],\n splitLine: {\n lineStyle: {\n color: '#FFF'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: \"#FFF\"\n }\n },\n axisLabel: {\n show: true,\n textStyle: {\n color: '#fff'\n }\n }\n },\n yAxis: {\n name: \"房间号\",\n type: 'category',\n splitLine: {\n lineStyle: {\n color: '#FFF'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: \"#FFF\"\n }\n },\n axisLabel: {\n show: true,\n textStyle: {\n color: '#fff'\n }\n },\n data: this.yAxis\n },\n series: [{\n name: '',\n type: 'bar',\n barWidth: '10px',\n data: this.series,\n itemStyle: {\n normal: {\n color: '#C40',\n barBorderRadius: 30\n }\n }\n }]\n };\n myChartDrawer.setOption(option);\n var that = this;\n myChartDrawer.on('click', function (param) {\n var room = param.name;\n var floorId = '';\n that.dataList.forEach(function (item) {\n if (room === item.chNum) {\n floorId = item.floorid;\n }\n }); // that.$store.state.user.floorId=floorId\n\n sessionStorage.setItem(\"floorId\", floorId);\n that.$router.push({\n name: \"dormitoryManage-room\"\n });\n });\n },\n //用电\n electricityFun: function electricityFun() {\n var _this2 = this;\n\n this.$http.get('/system/index/roomCurrentAlarm').then(function (_ref) {\n var res = _ref.data;\n\n if (res.code != 0) {\n return _this2.$message.error(res.msg);\n }\n\n _this2.yAxis = [];\n _this2.series = [];\n _this2.dataList = res.data;\n res.data.forEach(function (item) {\n _this2.yAxis.unshift(item.chNum);\n\n if (item.chEcurrent) {\n // 电压*电流累加值/(每小时采样次数*千瓦)\n item.chEcurrent = 220 * item.chEcurrent / (120 * 1000);\n\n _this2.series.unshift(item.chEcurrent.toFixed(2));\n }\n });\n\n _this2.draw();\n });\n }\n }\n};",{"version":3,"sources":["dormitory-electricity.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAA;AACA,EAAA,IADA,kBACA;AACA,WAAA;AACA,MAAA,QAAA,EAAA,EADA;AAEA,MAAA,KAAA,EAAA,EAFA;AAGA,MAAA,MAAA,EAAA;AAHA,KAAA;AAKA,GAPA;AAQA,EAAA,OARA,qBAQA;AACA,SAAA,cAAA;AACA,GAVA;AAWA,EAAA,SAXA,uBAWA;AAAA;;AACA,QAAA,KAAA,GAAA,WAAA,CAAA,YAAA;AACA,MAAA,KAAA,CAAA,cAAA;AACA,KAFA,EAEA,KAAA,IAFA,CAAA;AAGA,SAAA,KAAA,CAAA,kBAAA,EAAA,YAAA;AACA,MAAA,aAAA,CAAA,KAAA,CAAA;AACA,KAFA;AAGA,SAAA,KAAA,CAAA,gBAAA,EAAA,YAAA;AACA,MAAA,aAAA,CAAA,KAAA,CAAA;AACA,KAFA;AAGA,GArBA;AAsBA,EAAA,OAAA,EAAA;AACA,IAAA,IADA,kBACA;AACA;AACA,UAAA,aAAA,GAAA,KAAA,QAAA,CAAA,IAAA,CAAA,KAAA,KAAA,CAAA,QAAA,CAAA;AACA,UAAA,MAAA,GAAA,MAAA,GAAA;AACA,QAAA,KAAA,EAAA;AACA,UAAA,IAAA,EAAA,EADA;AAEA,UAAA,OAAA,EAAA;AAFA,SADA;AAKA,QAAA,OAAA,EAAA;AACA,UAAA,OAAA,EAAA,MADA;AAEA,UAAA,WAAA,EAAA;AACA,YAAA,IAAA,EAAA;AADA;AAFA,SALA;AAWA,QAAA,IAAA,EAAA;AACA,UAAA,WAAA,EAAA,CADA;AAEA,UAAA,GAAA,EAAA,KAFA;AAGA,UAAA,IAAA,EAAA,CAHA;AAIA,UAAA,KAAA,EAAA,KAJA;AAKA,UAAA,MAAA,EAAA,IALA;AAMA,UAAA,YAAA,EAAA;AANA,SAXA;AAmBA,QAAA,K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;AACA;AACA,SARA;;AASA,QAAA,MAAA,CAAA,IAAA;AACA,OApBA;AAqBA;AAxHA;AAtBA,CAAA","sourcesContent":["<template>\n\t<div class=\"electric-current\">\n\t\t<div class=\"title\">\n\t\t\t宿舍今日用电量TOP10\n\t\t\t<div class=\"angle-border left-top-border\"></div>\n\t\t\t<div class=\"angle-border right-top-border\"></div>\n\t\t\t<div class=\"angle-border left-bottom-border\"></div>\n\t\t\t<div class=\"angle-border right-bottom-border\"></div>\n\t\t</div>\n\t\t<div class=\"chart-map\" ref=\"myEchart\">\n\t\t</div>\n\t</div>\n</template>\n\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdataList: [],\n\t\t\t\tyAxis: [],\n\t\t\t\tseries: [],\n\t\t\t}\n\t\t},\n\t\tmounted() {\n\t\t\tthis.electricityFun()\n\t\t},\n\t\tactivated() {\n\t\t\tconst timer = setInterval(() => {\n\t\t\t\tthis.electricityFun();\n\t\t\t}, 30*1000);\n\t\t\tthis.$once(\"hook:deactivated\", () => {\n\t\t\t\tclearInterval(timer)\n\t\t\t})\n\t\t\tthis.$once(\"hook:destroyed\", () => {\n\t\t\t\tclearInterval(timer)\n\t\t\t})\n\t\t},\n\t\tmethods: {\n\t\t\tdraw() {\n\t\t\t\t// 实例化echarts对象\n\t\t\t\tlet myChartDrawer = this.$echarts.init(this.$refs.myEchart);\n\t\t\t\tlet option = option = {\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\ttext: '',\n\t\t\t\t\t\tsubtext: ''\n\t\t\t\t\t},\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\ttrigger: 'axis',\n\t\t\t\t\t\taxisPointer: {\n\t\t\t\t\t\t\ttype: 'shadow'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tgrid: {\n\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\ttop: '10%',\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tright: '10%',\n\t\t\t\t\t\tbottom: '3%',\n\t\t\t\t\t\tcontainLabel: true\n\t\t\t\t\t},\n\t\t\t\t\txAxis: {\n\t\t\t\t\t\tname: 'kW·h',\n\t\t\t\t\t\ttype: 'value',\n\t\t\t\t\t\tboundaryGap: [0, 0.01],\n\t\t\t\t\t\tsplitLine: {\n\t\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\t\tcolor: '#FFF'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\taxisLine: {\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\t\tcolor: \"#FFF\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\taxisLabel: {\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\t\t\tcolor: '#fff'\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\tyAxis: {\n\t\t\t\t\t\tname: \"房间号\",\n\t\t\t\t\t\ttype: 'category',\n\t\t\t\t\t\tsplitLine: {\n\t\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\t\tcolor: '#FFF'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\taxisLine: {\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\tlineStyle: {\n\t\t\t\t\t\t\t\tcolor: \"#FFF\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\taxisLabel: {\n\t\t\t\t\t\t\tshow: true,\n\t\t\t\t\t\t\ttextStyle: {\n\t\t\t\t\t\t\t\tcolor: '#fff'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdata: this.yAxis\n\t\t\t\t\t},\n\t\t\t\t\tseries: [{\n\t\t\t\t\t\tname: '',\n\t\t\t\t\t\ttype: 'bar',\n\t\t\t\t\t\tbarWidth: '10px',\n\t\t\t\t\t\tdata: this.series,\n\t\t\t\t\t\titemStyle: {\n\t\t\t\t\t\t\tnormal: {\n\t\t\t\t\t\t\t\tcolor: '#C40',\n\t\t\t\t\t\t\t\tbarBorderRadius: 30,\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\tmyChartDrawer.setOption(option);\n\t\t\t\tlet that = this\n\t\t\t\tmyChartDrawer.on('click', function(param) {\n\t\t\t\t\tlet room = param.name\n\t\t\t\t\tlet floorId = ''\n\t\t\t\t\tthat.dataList.forEach(item => {\n\t\t\t\t\t\tif (room === item.chNum) {\n\t\t\t\t\t\t\tfloorId = item.floorid\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t// that.$store.state.user.floorId=floorId\n\t\t\t\t\tsessionStorage.setItem(\"floorId\", floorId)\n\t\t\t\t\tthat.$router.push({\n\t\t\t\t\t\tname: \"dormitoryManage-room\"\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t},\n\t\t\t//用电\n\t\t\telectricityFun() {\n\t\t\t\tthis.$http.get('/system/index/roomCurrentAlarm')\n\t\t\t\t\t.then(({\n\t\t\t\t\t\tdata: res\n\t\t\t\t\t}) => {\n\t\t\t\t\t\tif (res.code != 0) {\n\t\t\t\t\t\t\treturn this.$message.error(res.msg)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.yAxis = []\n\t\t\t\t\t\tthis.series = []\n\t\t\t\t\t\tthis.dataList = res.data\n\t\t\t\t\t\tres.data.forEach(item => {\n\t\t\t\t\t\t\tthis.yAxis.unshift(item.chNum)\n\t\t\t\t\t\t\tif (item.chEcurrent) {\n\n\t\t\t\t\t\t\t\t// 电压*电流累加值/(每小时采样次数*千瓦)\n\t\t\t\t\t\t\t\titem.chEcurrent = 220 * item.chEcurrent / (120 * 1000)\n\t\t\t\t\t\t\t\tthis.series.unshift(item.chEcurrent.toFixed(2))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.draw()\n\t\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style scoped lang=\"scss\">\n\t.electric-current {\n\t\tcolor: #FFF;\n\n\t\t.title {\n\t\t\tfont-size: 18px;\n\t\t\tline-height: 36px;\n\t\t\tbackground-color: #133C6F;\n\t\t\twidth: 220px;\n\t\t\ttext-align: center;\n\t\t\tposition: relative;\n\t\t\tcolor: #fff;\n\t\t\tmargin-bottom: 20px;\n\n\t\t\t.angle-border {\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 12px;\n\t\t\t\theight: 12px;\n\t\t\t}\n\n\t\t\t.left-top-border {\n\t\t\t\ttop: -6px;\n\t\t\t\tleft: -6px;\n\t\t\t\tborder-left: 1px solid #01FFFF;\n\t\t\t\tborder-top: 1px solid #01FFFF;\n\t\t\t}\n\n\t\t\t.right-top-border {\n\t\t\t\ttop: -6px;\n\t\t\t\tright: -6px;\n\t\t\t\tborder-right: 1px solid #01FFFF;\n\t\t\t\tborder-top: 1px solid #01FFFF;\n\t\t\t}\n\n\t\t\t.left-bottom-border {\n\t\t\t\tbottom: -6px;\n\t\t\t\tleft: -6px;\n\t\t\t\tborder-left: 1px solid #01FFFF;\n\t\t\t\tborder-bottom: 1px solid #01FFFF;\n\t\t\t}\n\n\t\t\t.right-bottom-border {\n\t\t\t\tbottom: -6px;\n\t\t\t\tright: -6px;\n\t\t\t\tborder-right: 1px solid #01FFFF;\n\t\t\t\tborder-bottom: 1px solid #01FFFF;\n\t\t\t}\n\t\t}\n\n\t\t.chart-map {\n\t\t\theight: 300px\n\t\t}\n\t}\n</style>\n"],"sourceRoot":"src/views/modules/home-cell-components"}]} |