{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\performanceAnalysis\\AlarmAnalysis.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\performanceAnalysis\\AlarmAnalysis.vue","mtime":1667545182504},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\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//\nimport * as echarts from 'echarts';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport alarmAnalysis from '@/api/device/alarmAnalysis.js';\nimport alarmAnalysisDialog from \"./components/alarmAnalysisDialog.vue\";\nexport default {\n components: {\n alarmAnalysisDialog: alarmAnalysisDialog\n },\n data: function data() {\n return {\n dialogVisible: false,\n dateTypes: [],\n //日期类型字典\n deviceStatusList: [],\n chartData: [],\n year: '',\n dateValue: '',\n monthList: [],\n yearList: [],\n dateList: [],\n clztList: []\n };\n },\n created: function created() {\n this.clztList = dictUtils.getDictItemsFromCache('clzt');\n },\n mounted: function mounted() {\n this.initialize();\n },\n methods: {\n sum: function sum(arr) {\n var s = 0;\n arr.forEach(function (val, idx, arr) {\n s += val;\n }, 0);\n return s;\n },\n initialize: function initialize() {\n var moment = require('moment'); //打开时默认时间为一天前至获取当前年月日时分秒\n\n\n var dateTime = moment().format('YYYY-MM'); //当前年月日\n\n var yearTime = moment(new Date()).format('YYYY'); //前一月\n\n this.year = yearTime;\n this.dateValue = dateTime;\n console.log(yearTime, dateTime);\n this.getYearStatisticsWarn(yearTime);\n this.getMonthStatisticsWarn(yearTime);\n this.getDateStatisticsWarn(dateTime);\n },\n //年统计\n getYearStatisticsWarn: function getYearStatisticsWarn(yearTime) {\n var _this = this;\n\n var parmas = {\n dateType: 1,\n time: yearTime,\n isYear: true\n };\n alarmAnalysis.statisticsWarn(parmas, function (res) {\n if (res.state) {\n _this.yearList = res.value;\n\n _this.$nextTick(function () {\n _this.yearStatus();\n });\n }\n });\n },\n yearChange: function yearChange() {\n this.getYearStatisticsWarn(this.year);\n },\n yearStatus: function yearStatus() {\n var untreateds = []; //未处理\n\n var processeds = []; ///已处理\n\n var xnames = [];\n this.yearList.forEach(function (e) {\n xnames.push(e.type);\n untreateds.push(e.data[0].count);\n processeds.push(e.data[1].count);\n });\n var chartDom = document.getElementById('yearStatus');\n var myChart = echarts.init(chartDom);\n var option = {\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n },\n legend: {\n data: ['未处理', '已处理']\n },\n xAxis: [{\n type: 'category',\n axisTick: {\n show: false\n },\n data: xnames\n }],\n yAxis: [{\n type: 'value'\n }],\n series: [{\n name: '未处理',\n type: 'bar',\n barGap: 0,\n label: {\n normal: {\n show: true,\n position: 'top',\n color: '#000',\n fontWeight: 'bold'\n }\n },\n emphasis: {\n focus: 'series'\n },\n data: untreateds\n }, {\n name: '已处理',\n type: 'bar',\n label: {\n normal: {\n show: true,\n position: 'top',\n color: '#000',\n fontWeight: 'bold'\n }\n },\n emphasis: {\n focus: 'series'\n },\n data: processeds\n }]\n };\n option && myChart.setOption(option);\n window.addEventListener('resize', function () {\n myChart.resize();\n });\n },\n getMonthStatisticsWarn: function getMonthStatisticsWarn(yearTime) {\n var _this2 = this;\n\n var parmas = {\n dateType: 1,\n time: yearTime,\n isYear: false\n };\n alarmAnalysis.statisticsWarn(parmas, function (res) {\n if (res.state) {\n _this2.monthList = res.value;\n\n _this2.$nextTick(function () {\n _this2.monthStatus();\n });\n }\n });\n },\n monthChange: function monthChange() {\n this.getMonthStatisticsWarn(this.year);\n },\n monthStatus: function monthStatus() {\n var _this3 = this;\n\n var untreateds = []; //未处理\n\n var processeds = []; ///已处理\n\n var times = [];\n this.monthList.forEach(function (e) {\n times.push(e.time);\n\n if (e.data.length > 0) {\n untreateds.push(e.data[0].count);\n processeds.push(e.data[1].count);\n } else {\n untreateds.push(0);\n processeds.push(0);\n }\n });\n var chartDom = document.getElementById('monthStatus');\n var myChart = echarts.init(chartDom);\n var option = {\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n },\n legend: {\n data: ['未处理', '已处理']\n },\n xAxis: [{\n type: 'category',\n axisTick: {\n show: false\n },\n data: times\n }],\n yAxis: [{\n type: 'value'\n }],\n series: [{\n name: '未处理',\n type: 'bar',\n barGap: 0,\n emphasis: {\n focus: 'series'\n },\n data: untreateds\n }, {\n name: '已处理',\n type: 'bar',\n emphasis: {\n focus: 'series'\n },\n data: processeds\n }]\n };\n option && myChart.setOption(option);\n window.addEventListener('resize', function () {\n myChart.resize();\n });\n myChart.on('click', function (parmas) {\n var deviceStatus;\n\n _this3.clztList.forEach(function (res) {\n if (res.name == parmas.seriesName) {\n deviceStatus = res.value;\n }\n });\n\n _this3.dialogVisible = true;\n\n _this3.$refs.alarmAnalysisDialog.getData(parmas.name, deviceStatus, 2);\n });\n },\n getDateStatisticsWarn: function getDateStatisticsWarn(dateTime) {\n var _this4 = this;\n\n var parmas = {\n dateType: 2,\n time: dateTime,\n isYear: false\n };\n alarmAnalysis.statisticsWarn(parmas, function (res) {\n if (res.state) {\n _this4.dataList = res.value;\n\n _this4.$nextTick(function () {\n _this4.dateStatus();\n });\n }\n });\n },\n dateChange: function dateChange() {\n this.getDateStatisticsWarn(this.dateValue);\n },\n dateStatus: function dateStatus() {\n var _this5 = this;\n\n var untreateds = []; //未处理\n\n var processeds = []; ///已处理\n\n var times = [];\n this.dataList.forEach(function (e) {\n times.push(e.time);\n\n if (e.data.length > 0) {\n untreateds.push(e.data[0].count);\n processeds.push(e.data[1].count);\n } else {\n untreateds.push(0);\n processeds.push(0);\n }\n });\n var chartDom = document.getElementById('dateStatus');\n var myChart = echarts.init(chartDom);\n var option = {\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n },\n legend: {\n data: ['未处理', '已处理']\n },\n xAxis: [{\n type: 'category',\n axisTick: {\n show: false\n },\n data: times\n }],\n yAxis: [{\n type: 'value'\n }],\n series: [{\n name: '未处理',\n type: 'bar',\n barGap: 0,\n emphasis: {\n focus: 'series'\n },\n data: untreateds\n }, {\n name: '已处理',\n type: 'bar',\n emphasis: {\n focus: 'series'\n },\n data: processeds\n }]\n };\n option && myChart.setOption(option);\n window.addEventListener('resize', function () {\n myChart.resize();\n });\n myChart.on('click', function (parmas) {\n var deviceStatus;\n\n _this5.clztList.forEach(function (res) {\n if (res.name == parmas.seriesName) {\n deviceStatus = res.value;\n }\n });\n\n _this5.dialogVisible = true;\n\n _this5.$refs.alarmAnalysisDialog.getData(parmas.name, deviceStatus, 3);\n });\n }\n }\n};",null]}