{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\StatePrediction\\LifePrediction.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\views\\StatePrediction\\LifePrediction.vue","mtime":1667804639696},{"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\r\nimport req from '@/api/biz/statePrediction.js'\r\nimport prediction from '@/api/biz/healthData.js'\r\nimport {Chart} from '@antv/g2'\r\nexport default {\r\n name: 'life-prediction',\r\n data() {\r\n return {\r\n params: {\r\n collTime: '',\r\n fanCode: ''\r\n },\r\n dateTime: '',\r\n value1: '',\r\n options: [],\r\n partsForm: {\r\n name: '',\r\n model: ''\r\n },\r\n crewList: [], //剩余寿命列表\r\n pageBean: {\r\n page: 1,\r\n pageSize: -1\r\n },\r\n total: 0\r\n }\r\n },\r\n created() {\r\n this.getWindData()\r\n this.getDateTime()\r\n },\r\n mounted() {\r\n this.getCrewList()\r\n this.initChart3()\r\n this.initChart4()\r\n // 单机寿命\r\n this.initChart2()\r\n },\r\n methods: {\r\n // 获取当前日期\r\n getDateTime() {\r\n let yesterday = new Date().getTime() - 24 * 60 * 60 * 1000\r\n let date = new Date(yesterday)\r\n var year = date.getFullYear()\r\n var month = date.getMonth() + 1\r\n var day = date.getDate()\r\n if (month >= 1 && month <= 9) {\r\n month = '0' + month\r\n }\r\n if (day >= 0 && day <= 9) {\r\n day = '0' + day\r\n }\r\n this.dateTime = year + '-' + month + '-' + day\r\n this.params.collTime = this.dateTime\r\n },\r\n // 统计机组全场剩余寿命\r\n getCrewList() {\r\n // 选择日期则查询当天健康状态台数,否则不查询\r\n let dateTime = this.dateTime\r\n if (this.params.collTime) {\r\n dateTime = this.params.collTime\r\n }\r\n let data = {\r\n pageBean: this.pageBean,\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'collTime',\r\n relation: 'AND',\r\n value: this.params.collTime\r\n }\r\n ]\r\n }\r\n prediction.getCrewList(data).then(res => {\r\n this.total = res.total\r\n this.crewList = res.rows\r\n this.initChart1()\r\n })\r\n // 全场寿命\r\n },\r\n initChart1() {\r\n const data = this.crewList\r\n const chart = new Chart({\r\n container: 'container1',\r\n autoFit: true,\r\n height: 500,\r\n forceFit: true\r\n })\r\n chart.data(data)\r\n chart.scale('residualLife', {\r\n nice: true,\r\n alias: '剩余寿命 %',\r\n max: 100,\r\n min: 0\r\n })\r\n chart.axis('residualLife', {\r\n label: {\r\n formatter: val => {\r\n return val + '%'\r\n }\r\n },\r\n grid: {\r\n line: {\r\n style: {\r\n stroke: '#586377',\r\n lineWidth: 1,\r\n lineDash: [3, 3]\r\n }\r\n }\r\n }\r\n })\r\n chart.option('scrollbar', {\r\n type: 'horizontal',\r\n categorySize: 40,\r\n animate: false,\r\n style: {\r\n thumbColor: '#199FD7', //滚动条背景颜色\r\n thumbHighlightColor: '#199FD7'\r\n }\r\n })\r\n chart.axis('fanCode', {\r\n line: {\r\n style: {\r\n lineWidth: 1,\r\n stroke: '#586377'\r\n }\r\n },\r\n label:{\r\n rotate:45,\r\n offset:20,\r\n }\r\n })\r\n chart.legend('fanCode', {\r\n maxItemWidth: 50,\r\n maxWidthRatio: 50\r\n })\r\n chart.tooltip({\r\n showTitle: true,\r\n showMarkers: false,\r\n domStyles: {\r\n 'g2-tooltip': {\r\n background: 'rgba(0,0,0, 0.8)',\r\n color: '#d6e0ec'\r\n }\r\n }\r\n })\r\n chart.interaction('element-active')\r\n chart.interaction('active-region')\r\n\r\n chart\r\n .interval()\r\n .position('fanName*residualLife')\r\n .style({fill: 'l(90) 0:#22C3FE 0.5:#199FD7 1:#044879'})\r\n\r\n chart.render()\r\n },\r\n initChart2() {\r\n const data = [\r\n {month: '1', city: '寿命设计曲线', temperature: 1},\r\n {month: '1', city: '寿命预测曲线', temperature: 0.9},\r\n {month: '2', city: '寿命设计曲线', temperature: 0.8},\r\n {month: '2', city: '寿命预测曲线', temperature: 0.8},\r\n {month: '3', city: '寿命设计曲线', temperature: 0.7},\r\n {month: '3', city: '寿命预测曲线', temperature: 0.8},\r\n {month: '4', city: '寿命设计曲线', temperature: 0.8},\r\n {month: '4', city: '寿命预测曲线', temperature: 0.7},\r\n {month: '5', city: '寿命设计曲线', temperature: 0.7},\r\n {month: '5', city: '寿命预测曲线', temperature: 0.6},\r\n {month: '6', city: '寿命设计曲线', temperature: 0.5},\r\n {month: '6', city: '寿命预测曲线', temperature: 0.6},\r\n {month: '7', city: '寿命设计曲线', temperature: 0.5},\r\n {month: '7', city: '寿命预测曲线', temperature: 0.5},\r\n {month: '8', city: '寿命设计曲线', temperature: 0.4},\r\n {month: '8', city: '寿命预测曲线', temperature: 0.3},\r\n {month: '9', city: '寿命设计曲线', temperature: 0.3},\r\n {month: '9', city: '寿命预测曲线', temperature: 0.3},\r\n {month: '10', city: '寿命设计曲线', temperature: 0.2},\r\n {month: '10', city: '寿命预测曲线', temperature: 0.1},\r\n {month: '11', city: '寿命设计曲线', temperature: 0},\r\n {month: '11', city: '寿命预测曲线', temperature: 0}\r\n ]\r\n\r\n const chart = new Chart({\r\n container: 'container2',\r\n autoFit: true,\r\n height: 300\r\n })\r\n\r\n chart.data(data)\r\n chart.scale({\r\n month: {\r\n nice: true\r\n },\r\n\r\n temperature: {\r\n min: 0,\r\n tickCount: 5,\r\n tickInterval: 0.2,\r\n nice: true\r\n }\r\n })\r\n\r\n chart.tooltip({\r\n showCrosshairs: true,\r\n shared: true,\r\n domStyles: {\r\n 'g2-tooltip': {\r\n background: 'rgba(0,0,0, 0.8)',\r\n color: '#d6e0ec'\r\n }\r\n }\r\n })\r\n chart.axis('month', {\r\n line: {\r\n style: {\r\n lineWidth: 1,\r\n stroke: '#586377'\r\n }\r\n }\r\n })\r\n chart.axis('temperature', {\r\n grid: {\r\n line: {\r\n style: {\r\n stroke: '#586377',\r\n lineWidth: 1,\r\n lineDash: [3, 3]\r\n }\r\n },\r\n alignTick: true\r\n }\r\n })\r\n chart.legend('city', {\r\n itemName: {\r\n style: {\r\n fill: '#979ba4'\r\n }\r\n }\r\n })\r\n chart\r\n .line()\r\n .position('month*temperature')\r\n .color('city')\r\n\r\n chart.render()\r\n },\r\n initChart3() {\r\n const data = [\r\n {month: '0', key: 'series1', value: 0},\r\n {month: '0', key: 'series2', value: 0.002},\r\n {month: '500', key: 'series1', value: 0.005},\r\n {month: '500', key: 'series2', value: 0.006},\r\n {month: '1000', key: 'series1', value: 0.01},\r\n {month: '1000', key: 'series2', value: 0.013},\r\n {month: '1500', key: 'series1', value: 0.015},\r\n {month: '1500', key: 'series2', value: 0.015},\r\n {month: '2000', key: 'series1', value: 0.02},\r\n {month: '2000', key: 'series2', value: 0.022},\r\n {month: '2500', key: 'series1', value: 0.025},\r\n {month: '2500', key: 'series2', value: 0.026},\r\n // {month: '3000', key: 'series1', value: 0.03},\r\n {month: '3000', key: 'series2', value: 0.031}\r\n ]\r\n\r\n const chart = new Chart({\r\n container: 'container3',\r\n autoFit: true,\r\n height: 300\r\n })\r\n\r\n chart.data(data)\r\n\r\n chart.scale('month', {\r\n range: [0, 1]\r\n })\r\n chart.scale({\r\n value: {\r\n min: 0,\r\n tickInterval: 0.005,\r\n nice: true\r\n }\r\n })\r\n // chart.scale('value', {\r\n // nice: true\r\n // })\r\n chart.axis('value', {\r\n title: {\r\n text: '损伤',\r\n style: {\r\n fill: '#979ba4'\r\n }\r\n },\r\n line: {\r\n style: {\r\n lineWidth: 1,\r\n stroke: '#586377'\r\n }\r\n },\r\n grid: {\r\n line: {\r\n style: {\r\n stroke: '#586377',\r\n lineWidth: 1,\r\n lineDash: [3, 3]\r\n }\r\n },\r\n alignTick: true\r\n }\r\n })\r\n chart.axis('month', {\r\n // title: {\r\n // text: '时间 Hours',\r\n // style: {\r\n // fill: '#979ba4'\r\n // }\r\n // },\r\n line: {\r\n style: {\r\n lineWidth: 1,\r\n stroke: '#586377'\r\n }\r\n }\r\n })\r\n chart.legend('key', {\r\n itemName: {\r\n style: {\r\n fill: '#979ba4'\r\n }\r\n }\r\n })\r\n chart.tooltip({\r\n showCrosshairs: true,\r\n domStyles: {\r\n 'g2-tooltip': {\r\n background: 'rgba(0,0,0, 0.8)',\r\n color: '#d6e0ec'\r\n }\r\n }\r\n })\r\n chart\r\n .line()\r\n .position('month*value')\r\n // .shape('hv')\r\n .color('key')\r\n chart.render()\r\n },\r\n initChart4() {\r\n const data = [\r\n {month: '1', city: '瞬时载荷', temperature: 7},\r\n {month: '1', city: '累计载荷', temperature: 3.9},\r\n {month: '3', city: '瞬时载荷', temperature: 150},\r\n {month: '3', city: '累计载荷', temperature: 1500},\r\n {month: '5', city: '瞬时载荷', temperature: 200},\r\n {month: '5', city: '累计载荷', temperature: 2000},\r\n {month: '7', city: '瞬时载荷', temperature: 800},\r\n {month: '7', city: '累计载荷', temperature: 3300},\r\n {month: '9', city: '瞬时载荷', temperature: 500},\r\n {month: '9', city: '累计载荷', temperature: 4100},\r\n {month: '11', city: '瞬时载荷', temperature: 200},\r\n {month: '11', city: '累计载荷', temperature: 5800},\r\n {month: '13', city: '瞬时载荷', temperature: 600},\r\n {month: '13', city: '累计载荷', temperature: 8000},\r\n {month: '15', city: '瞬时载荷', temperature: 300},\r\n {month: '15', city: '累计载荷', temperature: 11000},\r\n {month: '17', city: '瞬时载荷', temperature: 700},\r\n {month: '17', city: '累计载荷', temperature: 15000},\r\n {month: '19', city: '瞬时载荷', temperature: 500},\r\n {month: '19', city: '累计载荷', temperature: 18900}\r\n ]\r\n const chart = new Chart({\r\n container: 'container4',\r\n autoFit: true,\r\n height: 300\r\n })\r\n chart.data(data)\r\n chart.scale({\r\n month: {\r\n range: [0, 1]\r\n },\r\n temperature: {\r\n min: 0,\r\n tickInterval: 2000,\r\n nice: true\r\n }\r\n })\r\n chart.axis('month', {\r\n line: {\r\n style: {\r\n lineWidth: 1,\r\n stroke: '#586377'\r\n }\r\n }\r\n })\r\n chart.axis('temperature', {\r\n grid: {\r\n line: {\r\n style: {\r\n stroke: '#586377',\r\n lineWidth: 1,\r\n lineDash: [3, 3]\r\n }\r\n },\r\n alignTick: true\r\n }\r\n })\r\n chart.tooltip({\r\n showCrosshairs: true,\r\n shared: true,\r\n domStyles: {\r\n 'g2-tooltip': {\r\n background: 'rgba(0,0,0, 0.8)',\r\n color: '#d6e0ec'\r\n }\r\n }\r\n })\r\n chart.legend('city', {\r\n itemName: {\r\n style: {\r\n fill: '#979ba4'\r\n }\r\n }\r\n })\r\n chart\r\n .line()\r\n .position('month*temperature')\r\n .color('city')\r\n chart.render()\r\n },\r\n getWindData() {\r\n let query = {\r\n sorter: [{direction: 'ASC', property: 'fanCode'}]\r\n }\r\n this.$http.post('${cssc}/biz/base/fanInfo/v1/list', query).then(resp => {\r\n let row = resp.data\r\n for (var i = 0; i < row.length; i++) {\r\n let obj = {}\r\n obj.label = row[i].fanName\r\n this.selecteCode = row[i].fanCode\r\n obj.value = row[i].fanCode\r\n this.options.push(obj)\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}