{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\charts\\projectStatisticsCharts\\ColumnBarLine.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\charts\\projectStatisticsCharts\\ColumnBarLine.vue","mtime":1675214576495},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n\r\nimport * as echarts from 'echarts'\r\nexport default {\r\n  props: {\r\n    params: {\r\n      type: Object,\r\n      default: () => {}\r\n    }\r\n  },\r\n  data() {\r\n    return {\r\n      myChart: '',\r\n      data: ''\r\n    }\r\n  },\r\n  watch: {\r\n    params: {\r\n      handler(newValue) {\r\n        this.getData(newValue)\r\n      },\r\n      deep: true\r\n    }\r\n  },\r\n  mounted() {\r\n    this.draw()\r\n    this.getData(this.params)\r\n  },\r\n  methods: {\r\n    getData(params) {\r\n      this.$http\r\n        .post('${cqxy}/biz/statistics/v1/investmentProgress', params)\r\n        .then(res => {\r\n          this.data = res.data.value\r\n          let investmentList = []\r\n          let outputList = []\r\n          let paymentList = []\r\n          let data = {}\r\n          this.data.investmentList.forEach((item, index) => {\r\n            let value = FormMath.tofixed(\r\n              FormMath.toNumber(item[index + 1]) / 10000,\r\n              0\r\n            )\r\n            investmentList.push(value)\r\n          })\r\n          this.data.outputList.forEach((item, index) => {\r\n            let value = FormMath.tofixed(\r\n              FormMath.toNumber(item[index + 1]) / 10000,\r\n              2\r\n            )\r\n            outputList.push(value)\r\n          })\r\n          this.data.paymentList.forEach((item, index) => {\r\n            let value = FormMath.tofixed(\r\n              FormMath.toNumber(item[index + 1]) / 10000,\r\n              2\r\n            )\r\n            paymentList.push(value)\r\n          })\r\n          data = {\r\n            investmentList,\r\n            outputList,\r\n            paymentList\r\n          }\r\n          this.refreshData(data)\r\n        })\r\n    },\r\n    refreshData(data) {\r\n      //刷新数据\r\n      var option = this.myChart.getOption()\r\n      option.series[0].data = data.investmentList //投资数据\r\n      option.series[1].data = data.outputList //产值数据\r\n      option.series[2].data = data.paymentList //支付数据\r\n      this.myChart.setOption(option)\r\n    },\r\n    draw() {\r\n      var chartDom = document.getElementById('mainColumnBarLine')\r\n      this.myChart = echarts.init(chartDom)\r\n      var option\r\n\r\n      option = {\r\n        legend: {\r\n          top: 'bottom',\r\n          padding: 30,\r\n          data: ['投资', '产值', '支付']\r\n        },\r\n        tooltip: {\r\n          trigger: 'axis',\r\n          axisPointer: {\r\n            type: 'cross',\r\n            crossStyle: {\r\n              color: '#999'\r\n            }\r\n          },\r\n          // 此处配置鼠标移动对应区域时的黑色弹框\r\n          trigger: 'axis'\r\n          // formatter: a => {\r\n          //   return (\r\n          //     a.seriesName +\r\n          //     '<br/>' +\r\n          //     a.marker +\r\n          //     a.name +\r\n          //     ' ' +\r\n          //     a.data[a.seriesIndex + 1] +\r\n          //     '万元'\r\n          //   )\r\n          // }\r\n        },\r\n        xAxis: {\r\n          type: 'category',\r\n          data: [\r\n            '一月',\r\n            '二月',\r\n            '三月',\r\n            '四月',\r\n            '五月',\r\n            '六月',\r\n            '七月',\r\n            '八月',\r\n            '九月',\r\n            '十月',\r\n            '十一月',\r\n            '十二月'\r\n          ],\r\n          axisPointer: {\r\n            type: 'shadow'\r\n          },\r\n          axisLabel: {\r\n            fontSize: 14\r\n          }\r\n        },\r\n        yAxis: {\r\n          type: 'value',\r\n          axisLabel: {\r\n            formatter: '{value}',\r\n            fontSize: 16\r\n          }\r\n        },\r\n        // yAxis: [\r\n        //   {\r\n        //     type: 'value',\r\n        //     min: 0,\r\n        //     // max: '10%',\r\n        //     axisLabel: {\r\n        //       formatter: '{value}',\r\n        //       fontSize: 16\r\n        //     }\r\n        //   },\r\n        //   {\r\n        //     type: 'value',\r\n        //     min: 0,\r\n        //     // max: '10%',\r\n        //     axisLabel: {\r\n        //       formatter: '{value}',\r\n        //       fontSize: 16\r\n        //     }\r\n        //   }\r\n        // ],\r\n        series: [\r\n          {\r\n            name: '投资',\r\n            type: 'bar',\r\n            tooltip: {\r\n              valueFormatter: function(value) {\r\n                return value + '万元'\r\n              }\r\n            },\r\n            emphasis: {\r\n              itemStyle: {\r\n                shadowBlur: 10,\r\n                shadowColor: 'rgba(0,0,0,0.3)'\r\n              }\r\n            },\r\n            itemStyle: {\r\n              normal: {\r\n                barBorderRadius: [10, 10, 0, 0],\r\n                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [\r\n                  {offset: 1, color: '#63b2ee'},\r\n                  {offset: 0.5, color: '#76da91'},\r\n                  {offset: 0, color: '#f8cb7f'}\r\n                ])\r\n              }\r\n            },\r\n            data: [\r\n              730.2984,\r\n              256.4447,\r\n              220,\r\n              340,\r\n              429,\r\n              791,\r\n              652,\r\n              452,\r\n              323,\r\n              255,\r\n              671,\r\n              303\r\n            ]\r\n          },\r\n          {\r\n            name: '产值',\r\n            type: 'line',\r\n            // yAxisIndex: 1,\r\n            // smooth: true,\r\n            tooltip: {\r\n              valueFormatter: function(value) {\r\n                return value + '万元'\r\n              }\r\n            },\r\n            itemStyle: {\r\n              normal: {\r\n                color: '#f89588'\r\n              }\r\n            },\r\n            data: [\r\n              830.2984,\r\n              286.4447,\r\n              320,\r\n              340,\r\n              429,\r\n              791,\r\n              652,\r\n              452,\r\n              623,\r\n              255,\r\n              771,\r\n              403\r\n            ]\r\n          },\r\n          {\r\n            name: '支付',\r\n            type: 'line',\r\n            // yAxisIndex: 1,\r\n            // smooth: true,\r\n            tooltip: {\r\n              valueFormatter: function(value) {\r\n                return value + '万元'\r\n              }\r\n            },\r\n            itemStyle: {\r\n              normal: {\r\n                color: '#76da91'\r\n              }\r\n            },\r\n            data: [\r\n              630.2984,\r\n              386.4447,\r\n              420,\r\n              380,\r\n              329,\r\n              711,\r\n              552,\r\n              422,\r\n              632,\r\n              205,\r\n              791,\r\n              433\r\n            ]\r\n          }\r\n        ]\r\n      }\r\n\r\n      option && this.myChart.setOption(option)\r\n    }\r\n  }\r\n}\r\n",null]}