{"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\\HealthManage.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\HealthManage\\HealthManage.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":["//\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//\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//\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 req from '@/api/biz/healthData.js';\nimport { Chart } from '@antv/g2';\nexport default {\n name: 'health-manage',\n data: function data() {\n return {\n crewList: [],\n //机组状态列表\n dialogVisible: false,\n //默认关闭生成报告弹窗\n pageBean: {\n page: 1,\n pageSize: -1\n },\n params: {\n fanCode: '',\n //机组号\n collTime: '' //查询时间\n\n },\n total: 0,\n sizeForm: {\n model: ''\n },\n //模式切换\n healthStatusCount: {},\n //健康状态数量信息\n start: '',\n //生成报告查询时间\n healthScore: '',\n //健康评分\n orderRate: '',\n //工单完成率\n warningAccuracy: '',\n //预警准确率\n reduceDowntime: '',\n //减少非计划停机\n dateTime: '',\n chart: null,\n //接收图表\n loading: null //加载状态\n\n };\n },\n created: function created() {\n this.getDateTime();\n },\n mounted: function mounted() {\n this.getCrewList(); // this.getHealthOverview()\n // this.getHealthStatus()\n },\n methods: {\n // 下载体检报告\n downloadReport: function downloadReport() {\n var _this = this;\n\n var startYear = '';\n var startMonth = '';\n var csscTest = window.context.csscTest;\n\n if (this.start == '' || this.start == null) {\n this.$message({\n showClose: true,\n message: '报表导出失败,请选择日期!',\n type: 'error',\n duration: 2500\n });\n } else {\n startYear = this.start.slice(0, 4);\n startMonth = this.start.slice(5, 7);\n this.loading = this.$loading({\n lock: true,\n text: '下载中,请等待',\n spinner: 'el-icon-loading',\n background: 'rgba(0, 0, 0, 0.7)'\n });\n var data = {\n farmCname: '华能江苏如东H3',\n areaCname: '海上运维中心',\n startYear: startYear,\n startMonth: startMonth\n };\n var query = {\n // url: `${csscTest}/remote/remoteReport/reportExportByCondition`,\n url: \"/remote/remoteReport/reportExportByCondition\",\n method: 'post',\n data: data,\n headers: {\n 'Content-type': 'application/json'\n },\n responseType: 'blob',\n //将文件流转成blob对象\n noErrorMsg: true\n };\n this.$http.request(query).then(function (res) {\n // console.log(res)\n if (res.status == 200) {\n var blob = new Blob([res.data], {\n type: \"application/msword\" //word文档为msword,pdf文档为pdf\n\n });\n var objectUrl = URL.createObjectURL(blob);\n var link = document.createElement('a');\n var fname = _this.start + '月度体检报告'; //下载文件的名字\n\n link.href = objectUrl;\n link.setAttribute('download', fname);\n document.body.appendChild(link);\n link.click(); // 下载完成消息提示\n\n _this.$message({\n showClose: true,\n message: '下载完成',\n type: 'success',\n duration: 2500\n });\n }\n }).catch(function (err) {\n _this.$message({\n showClose: true,\n message: '下载失败',\n type: 'error',\n duration: 2500\n });\n }).finally(function () {\n //关闭loading\n _this.loading.close();\n });\n }\n\n this.dialogVisible = false;\n },\n //重置查询\n onClickRefresh: function onClickRefresh() {\n this.params.collTime = this.dateTime;\n $('#pieContainer').empty(); //清除图表数据重新渲染\n\n this.getCrewList();\n },\n //查询\n onClickSearch: function onClickSearch() {\n this.pageBean.page = 1;\n $('#pieContainer').empty(); //清除图表数据重新渲染\n\n this.getCrewList();\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.params.collTime = this.dateTime;\n },\n // 健康状态统计\n getHealthStatus: function getHealthStatus() {\n var _this2 = this;\n\n var dateTime = this.dateTime;\n\n if (this.params.collTime) {\n dateTime = this.params.collTime;\n }\n\n req.getHealthStatus(dateTime).then(function (res) {\n // console.log(res);\n if (res && res.value) {\n _this2.healthStatusCount = res.value;\n\n _this2.innitChart();\n }\n });\n },\n // 获取健康监测总览\n getHealthOverview: function getHealthOverview() {\n var _this3 = this;\n\n this.heallthStatusList = [];\n this.healthStatusCount = {};\n req.getHealthOverview().then(function (res) {\n // console.log(res, '健康监测总览')\n if (res && res.value) {\n _this3.healthScore = res.value.healthScore;\n _this3.orderRate = res.value.workCompletionRate;\n _this3.warningAccuracy = res.value.warnPreciseRate;\n _this3.reduceDowntime = res.value.unplannedDowntime;\n }\n });\n },\n // 获取机组状态列表\n getCrewList: function getCrewList() {\n var _this4 = this;\n\n var dateTime = this.dateTime;\n var data = {\n pageBean: this.pageBean,\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'collTime',\n relation: 'AND',\n value: dateTime\n }]\n };\n\n if (this.params.collTime) {\n dateTime = this.params.collTime;\n data = {\n pageBean: this.pageBean,\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'collTime',\n relation: 'AND',\n value: this.params.collTime\n }]\n };\n }\n\n req.getCrewList(data).then(function (res) {\n _this4.total = res.total;\n _this4.crewList = res.rows;\n });\n this.getHealthStatus();\n this.getHealthOverview();\n },\n handleSizeChange: function handleSizeChange(val) {\n this.pageBean.pageSize = val;\n this.getCrewList();\n },\n handleCurrentChange: function handleCurrentChange(val) {\n this.pageBean.page = val;\n this.getCrewList();\n },\n // 环形饼图图例\n innitChart: function innitChart() {\n var circleData = [{\n item: '优秀',\n count: this.healthStatusCount.excellent,\n color: '#02c82d'\n }, {\n item: '健康',\n count: this.healthStatusCount.health,\n color: '#61DDAA'\n }, {\n item: '亚健康',\n count: this.healthStatusCount.subHealth,\n color: '#5e70a0'\n }, {\n item: '告警',\n count: this.healthStatusCount.alarm,\n color: '#ff9c00'\n }, {\n item: '故障',\n count: this.healthStatusCount.fault,\n color: '#ff6363'\n }];\n this.chart = new Chart({\n container: 'pieContainer',\n autoFit: true,\n height: 500\n });\n this.chart.coordinate('theta', {\n radius: 0.8,\n innerRadius: 0.6\n });\n this.chart.data(circleData);\n this.chart.scale('count', {\n formatter: function formatter(val) {\n val = val + '台';\n return val;\n }\n });\n this.chart.legend('item', {\n position: 'right',\n // 配置图例显示位置\n custom: true,\n // 关键字段,告诉 G2,要使用自定义的图例\n items: circleData.map(function (obj, index) {\n return {\n name: obj.item,\n // 对应 itemName\n value: obj.count,\n // 对应 itemValue\n marker: {\n symbol: 'circle',\n // marker 的形状\n style: {\n r: 5,\n // marker 图形半径\n fill: obj.color // marker 颜色,使用默认颜色,同图形对应\n\n }\n } // marker 配置\n\n };\n }),\n itemName: {\n style: {\n fill: '#ccf2ff'\n }\n },\n itemValue: {\n style: {\n fill: '#ccf2ff'\n },\n // 配置 itemValue 样式\n formatter: function formatter(val) {\n return \"\\uFF1A\".concat(val, \"\\u53F0\");\n } // 格式化 itemValue 内容\n\n }\n });\n this.chart.tooltip({\n showTitle: false,\n showMarkers: false,\n domStyles: {\n 'g2-tooltip': {\n background: 'rgba(0,0,0, 0.8)',\n color: '#d6e0ec'\n }\n }\n });\n this.chart.interval().position('count').color('item', ['#1CC25E', '#1AAF8B', '#5e70a0', '#ff9c00', '#ff6363']).adjust('stack');\n this.chart.interaction('element-active');\n this.chart.render();\n },\n // 关闭生成报告弹窗\n handleClose: function handleClose() {\n this.dialogVisible = false;\n },\n // 宫格模式\n changeGrid: function changeGrid() {\n this.sizeForm.model = 1;\n },\n // 列表模式\n changeList: function changeList() {\n this.sizeForm.model = 2;\n },\n // 指定一个key标识这一行的数据\n getRowKey: function getRowKey(row) {\n return row.id;\n }\n }\n};",null]}