{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\HealthManage\\OptimalSchedule.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\HealthManage\\OptimalSchedule.vue","mtime":1681441192473},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { Chart } from '@antv/g2';\nimport { Liquid } from '@antv/g2plot';\nimport moment from 'moment'; //日期格式化插件\n\nexport default {\n name: 'OptimalSchedule',\n //寿命调度\n data: function data() {\n return {\n dateTime: '',\n yesterday: '',\n tableData: [],\n chartBar: null,\n barData: [],\n liquid: null,\n totalPowerGeneration: 0,\n totalGenerEfficiency: 0\n };\n },\n created: function created() {\n this.getDateTime();\n this.getLifeSchedule();\n },\n mounted: function mounted() {},\n methods: {\n onClickRefresh: function onClickRefresh() {\n this.dateTime = this.yesterday;\n },\n // 获取前一天日期\n getDateTime: function getDateTime() {\n var yesterday = new Date().getTime() - 24 * 60 * 60 * 1000;\n var date = new Date(yesterday);\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n\n if (month >= 1 && month <= 9) {\n month = '0' + month;\n }\n\n if (day >= 0 && day <= 9) {\n day = '0' + day;\n }\n\n this.dateTime = year + '-' + month + '-' + day;\n this.yesterday = this.dateTime;\n },\n getLifeSchedule: function getLifeSchedule() {\n var _this = this;\n\n var data = this.qs.stringify({\n localDate: this.dateTime\n });\n console.log(data, 'this.qs.stringify({localDate: this.dateTime})');\n var query = {\n url: '${cssc}/biz/jkjc/health/v1/getJsonLifeSchedule',\n method: 'post',\n data: this.qs.stringify({\n localDate: this.dateTime\n }),\n headers: {\n 'Content-type': 'application/x-www-form-urlencoded'\n }\n };\n this.$http.request(query).then(function (res) {\n if (res && res.data && res.data.value) {\n console.log(res.data.value);\n var realData = res.data.value;\n _this.tableData = realData.dispatchLog ? realData.dispatchLog : [];\n\n _this.tableData.forEach(function (item, index) {\n item.statValue = item.statValue.toFixed(2);\n item.dataTimee = moment(parseInt(item.dataTime)).format('YYYY-MM-DD HH:mm:ss');\n item.key = index;\n item.powerGenerEfficiency = (item.powerGenerEfficiency * 100).toFixed(2);\n });\n\n realData.dispatchPowerList.forEach(function (item) {\n item.statValue = parseFloat(item.statValue.toFixed(2));\n });\n _this.barData = realData.dispatchPowerList ? realData.dispatchPowerList : [];\n\n if (_this.chartBar) {\n _this.chartBar.changeData(_this.barData);\n } else {\n _this.initChartbar();\n }\n\n _this.totalPowerGeneration = realData.totalPowerGeneration ? realData.totalPowerGeneration : 0;\n _this.totalGenerEfficiency = realData.totalGenerEfficiency ? realData.totalGenerEfficiency : 0;\n\n if (_this.liquid) {\n _this.liquid.changeData(_this.totalGenerEfficiency);\n } else {\n _this.initLiquid(_this.totalGenerEfficiency);\n }\n }\n });\n },\n initChartbar: function initChartbar() {\n this.chartBar = new Chart({\n container: 'chartbar',\n autoFit: true,\n height: 500,\n forceFit: true\n });\n this.chartBar.data(this.barData);\n this.chartBar.scale('statValue', {\n nice: true,\n alias: '调度功率 kW'\n });\n this.chartBar.axis('statValue', {\n label: {\n formatter: function formatter(val) {\n return val + 'kW';\n }\n },\n grid: {\n line: {\n style: {\n stroke: '#586377',\n lineWidth: 1,\n lineDash: [3, 3]\n }\n }\n }\n });\n this.chartBar.option('scrollbar', {\n type: 'horizontal',\n categorySize: 40,\n animate: false,\n style: {\n thumbColor: '#199FD7',\n //滚动条背景颜色\n thumbHighlightColor: '#199FD7'\n }\n });\n this.chartBar.axis('fanName', {\n line: {\n style: {\n lineWidth: 1,\n stroke: '#586377'\n }\n },\n label: {\n rotate: 45,\n offset: 20\n }\n });\n this.chartBar.tooltip({\n showTitle: true,\n showMarkers: false,\n domStyles: {\n 'g2-tooltip': {\n background: 'rgba(0,0,0, 0.8)',\n color: '#d6e0ec'\n }\n }\n });\n this.chartBar.interaction('element-active');\n this.chartBar.interaction('active-region');\n this.chartBar.interval().position('fanName*statValue').style({\n fill: 'l(90) 0:#22C3FE 0.5:#199FD7 1:#044879'\n });\n this.chartBar.render();\n },\n initLiquid: function initLiquid(percent) {\n this.liquid = new Liquid('liquid', {\n percent: percent,\n outline: {\n border: 4,\n distance: 0\n },\n wave: {\n count: 3,\n length: 40\n },\n pattern: {\n type: 'line'\n },\n statistic: {\n content: {\n style: {\n fill: '#fff'\n }\n }\n },\n theme: {\n styleSheet: {\n brandColor: '#10c4b5'\n }\n }\n });\n this.liquid.render();\n }\n }\n};",null]}