{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\BugetManagement.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\BugetManagement.vue","mtime":1706175429256},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport _toConsumableArray from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.to-string\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 utils from '@/utils'; // thousandBit格式化千分位\nvar BigNumber = require('bignumber.js');\nimport * as echarts from 'echarts';\nexport default {\n name: 'BugetManagement',\n data: function data() {\n return {\n tableData: [],\n data: [],\n loading: false,\n year: '',\n total: {},\n utils: utils\n };\n },\n created: function created() {\n var _this = this;\n this.loadData();\n this.getClumnData2();\n this.$nextTick(function () {\n var date = new Date();\n _this.year = date.getFullYear().toString();\n });\n },\n watch: {\n tableData: function tableData(newVal) {\n this.total.budgetSumTotal = this.calculation('budgetSum', newVal);\n this.total.alreadyCountTotal = this.calculation('alreadyCount', newVal);\n // this.total.totalRateTotal = this.calculation('totalRate', newVal)\n this.total.totalRateMoneyTotal = this.calculation('totalRateMoney', newVal);\n console.log(parseFloat(this.total.totalRateMoneyTotal.replace(',', '')) / parseFloat(this.total.budgetSumTotal.replace(',', '')));\n this.total.totalRateTotal = parseFloat(this.total.totalRateMoneyTotal.replace(',', '')) / parseFloat(this.total.budgetSumTotal.replace(',', ''));\n this.total.distributionCountTotal = this.getDistributionCountTotal(this.total.alreadyCountTotal, this.total.budgetSumTotal);\n // this.total.alreadyCountTotal && this.total.budgetSumTotal\n // ? (this.total.alreadyCountTotal / this.total.budgetSumTotal) * 100 ==\n // 100\n // ? (this.total.alreadyCountTotal / this.total.budgetSumTotal) * 100 +\n // '%'\n // : (\n // (this.total.alreadyCountTotal / this.total.budgetSumTotal) *\n // 100\n // ).toFixed(2) + '%'\n // : '0.00%'\n this.total.ascriptionYear = newVal.length !== 0 && newVal[0].ascriptionYear;\n this.total.expectDeviationRate = this.calculation('expectDeviationRate', newVal) * 100 + '%';\n this.cloumnCharts(this.tableData);\n this.pieCharts(this.tableData);\n }\n },\n methods: {\n reset: function reset() {\n var date = new Date();\n this.year = date.getFullYear().toString();\n this.loadData();\n },\n getClumnData2: function getClumnData2() {\n var _this2 = this;\n this.$http.get('${yhxt}/yearBudget/v1/getBudgetYearList').then(function (res) {\n _this2.cloumnCharts2(res.data);\n });\n },\n calculation: function calculation(key, arr) {\n var total = new BigNumber(0);\n if (!key || arr.length === 0) return total.toFixed(2);\n arr.forEach(function (item) {\n total = total.plus(item[key]);\n });\n if (total === 0) return 0.0;\n return utils.thousandBit(total.toFixed(2));\n },\n getDistributionCountTotal: function getDistributionCountTotal(val1, val2) {\n var reg1 = new RegExp(',', 'g');\n val1 = val1.replace(reg1, '');\n val2 = val2.replace(reg1, '');\n val1 = Number(val1);\n val2 = Number(val2);\n console.log(val1);\n var val = new BigNumber(val1);\n if (val1 && val2) {\n return val.div(val2).times(100).toFixed(2) + '%';\n // return val.div(val2).times(100).toFixed(2) + '%'\n } else {\n return '0.00%';\n }\n },\n changeYear: function changeYear(val) {\n var _this3 = this;\n if (!val) {\n return this.loadData();\n }\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetCountVo?year=' + val).then(function (res) {\n _this3.tableData = res && res.status == 200 && res.data || [];\n _this3.data = [];\n _this3.data.push(_this3.tableData);\n _this3.loading = false;\n });\n },\n findinfo: function findinfo() {\n var _this4 = this;\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetCountVo?year=' + this.year).then(function (res) {\n _this4.tableData = res && res.status == 200 && res.data || [];\n _this4.data = [];\n _this4.data.push(_this4.tableData);\n _this4.loading = false;\n });\n },\n handleReset: function handleReset() {\n var length = this.data.length - 1;\n if (length === 0) return;\n this.tableData = this.data[this.data.length - 2];\n this.data.splice(length, 1);\n },\n hanldeRowClick: function hanldeRowClick(row) {\n if (row.chirldren.length == 0 && row.roadSegmentId) {\n return this.$router.push({\n name: 'costBudget',\n params: {\n value: row\n }\n });\n }\n this.tableData = row.chirldren;\n this.data.push(row.chirldren);\n },\n handleCellClick: function handleCellClick(row, column) {\n this.cstatus = column.label;\n },\n loadData: function loadData() {\n var _this5 = this;\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetCountVo?year=' + new Date().getFullYear()).then(function (res) {\n _this5.tableData = res && res.status == 200 && res.data || [];\n _this5.data = [];\n _this5.data.push(_this5.tableData);\n _this5.loading = false;\n }).catch(function () {\n _this5.loading = false;\n });\n },\n cloumnCharts: function cloumnCharts(data) {\n var _legend;\n var chartDom = document.getElementById('column');\n var myChart = echarts.init(chartDom);\n var source = [];\n source[0] = ['product', '预算总额', '已用总额'];\n data.forEach(function (item, index) {\n source[index + 1] = [];\n source[index + 1].push(item.name);\n source[index + 1].push(item.budgetSum);\n source[index + 1].push(item.alreadyCount);\n });\n var option;\n option = {\n title: {\n textStyle: {\n color: '#fff'\n }\n },\n grid: {\n top: '20%',\n left: '10%',\n right: '10%',\n bottom: '20%'\n },\n legend: (_legend = {\n bottom: 'bottom'\n }, _defineProperty(_legend, \"bottom\", '8%'), _defineProperty(_legend, \"textStyle\", {\n color: '#fff'\n }), _legend),\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'none'\n }\n },\n color: ['#16ffae', '#00e6f6', '#6255f8', '#0282b9', '#68c1e5', '#578bf1', '#56d0a3', '#596d90', '#6a5cf1'],\n dataset: {\n source: source\n },\n xAxis: {\n type: 'category',\n axisLabel: {\n fontSize: 14,\n color: '#B8C2CC'\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n },\n yAxis: {\n name: '单位:万元',\n nameTextStyle: {\n color: '#B8C2CC',\n nameLocation: 'start',\n fontSize: 18,\n fontWeight: 700\n },\n type: 'value',\n splitLine: {\n show: false\n },\n //去除网格线\n axisLabel: {\n textStyle: {\n color: '#B8C2CC'\n }\n },\n axisTick: {\n //y轴刻度线\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n //y轴\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n },\n series: [{\n type: 'bar',\n barGap: 0,\n label: {\n alignTo: 'edge',\n // formatter: '{name|{b}}{money|{}}\\n\\n{percent|{c} %}',\n formatter: function formatter(a) {\n return \"{name|\".concat(a.data.name, \"} {money|\").concat(a.data.money, \" \\u4E07\\u5143}\\n\\n{percent|\").concat(a.data.value, \" %}\");\n },\n minMargin: 5,\n edgeDistance: 10,\n lineHeight: 15\n },\n labelLine: {\n length: 15,\n length2: 0,\n maxSurfaceAngle: 80\n },\n labelLayout: function labelLayout(params) {\n var isLeft = params.labelRect.x < myChart.getWidth() / 2;\n var points = params.labelLinePoints;\n // Update the end point.\n points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width;\n return {\n labelLinePoints: points\n };\n },\n itemStyle: {\n color: '#578af0'\n },\n barWidth: '15%',\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }, {\n type: 'bar',\n barGap: 0,\n label: {\n show: false,\n position: 'top',\n textStyle: {\n fontSize: 12,\n color: '#fff'\n }\n },\n itemStyle: {\n color: '#56cfa2'\n },\n barWidth: '15%',\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n }]\n };\n option && myChart.setOption(option);\n },\n cloumnCharts2: function cloumnCharts2(data) {\n var _this6 = this;\n data = data || [];\n var chartDom = document.getElementById('column2');\n var myChart = echarts.init(chartDom);\n\n // let dataText = [\n // '养护预算(四川)',\n // '专项预算(四川)',\n // '总预算(四川)',\n // '养护预算(重庆)',\n // '专项预算(重庆)',\n // '总预算(重庆)',\n // '养护预算(云南)',\n // '专项预算(云南)',\n // '总预算(云南)',\n // ]\n // const dataText1 = [\n // '养护预算(一管理中心)',\n // '专项预算(一管理中心)',\n // '总预算(一管理中心)',\n // '养护预算(二管理中心)',\n // '专项预算(二管理中心)',\n // '总预算(二管理中心)',\n // '养护预算(三管理中心)',\n // '专项预算(三管理中心)',\n // '总预算(三管理中心)',\n // '养护预算(五管理中心)',\n // '专项预算(五管理中心)',\n // '总预算(五管理中心)',\n // '养护预算(四管理中心)',\n // '专项预算(四管理中心)',\n // '总预算(四管理中心)',\n // ]\n\n // 判断是否是渲染下纂数据\n // if(data[0].vos.length === 5) {\n // dataText = dataText1\n // }\n var xAxisData = []; // x轴\n var xAxisData2 = []; // x轴2\n var customData = []; // 记录滑动模块数据\n var legendData = [];\n var dataList = []; // 数据列表\n var dataText = [];\n legendData.push('平均值');\n var encodeY = [];\n data[0].vos.forEach(function (i) {\n dataText.push(i.name);\n });\n for (var _i = 0, _dataText = dataText; _i < _dataText.length; _i++) {\n var i = _dataText[_i];\n legendData.push(i);\n dataList.push([]);\n encodeY.push(1 + i);\n }\n data.forEach(function (i, index) {\n xAxisData.push(i.year);\n // xAxisData2.push('重庆', '四川', '云南')\n var customVal = [index];\n customData.push(customVal);\n // 获取数组的长度以便赋值数据\n // let num = i.vos.length\n i.vos.forEach(function (item, index1) {\n // let value = {\n // value: item.yhBudgetMoney,\n // ...item,\n // }\n // let value1 = {\n // value: item.zxBudgetMoney,\n // ...item,\n // }\n var value2 = _objectSpread({\n value: item.budgetMoney\n }, item);\n // if (index !== 0) {\n // index1 = index1 + index * num\n // }\n dataList[index1].push(value2);\n customVal.push(value2.value);\n });\n });\n // console.log(dataList)\n\n var option;\n option = {\n legend: {\n data: legendData,\n left: 'center',\n top: '10%',\n textStyle: {\n color: '#fff'\n }\n },\n dataZoom: [{\n type: 'slider',\n start: 0,\n end: 100,\n textStyle: {\n color: '#fff'\n },\n bottom: '8%'\n }, {\n type: 'inside',\n start: 0,\n end: 100,\n textStyle: {\n color: '#fff'\n },\n bottom: '8%'\n }],\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'none'\n }\n },\n toolbox: {\n show: true,\n feature: {\n restore: {\n show: true\n }\n },\n padding: [60, 60],\n iconStyle: {\n borderColor: '#fff'\n }\n },\n grid: {\n top: '20%',\n left: '8%',\n right: '8%',\n bottom: '30%'\n // containLabel: true\n },\n\n xAxis: [{\n data: xAxisData,\n name: '年份',\n nameTextStyle: {\n color: '#B8C2CC',\n nameLocation: 'start',\n fontSize: 14\n },\n offset: 30,\n axisLabel: {\n fontSize: 14,\n color: '#B8C2CC'\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n }, {\n position: 'bottom',\n data: xAxisData2,\n axisLabel: {\n fontSize: 14,\n color: '#B8C2CC'\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n }],\n yAxis: {\n name: '单位:万元',\n nameTextStyle: {\n color: '#B8C2CC',\n nameLocation: 'start',\n fontSize: 18,\n fontWeight: 700\n },\n // type: 'value',\n splitLine: {\n show: false\n },\n //去除网格线\n axisLabel: {\n textStyle: {\n color: '#B8C2CC'\n }\n },\n axisTick: {\n //y轴刻度线\n show: true,\n lineStyle: {\n color: '#B8C2CC'\n }\n },\n axisLine: {\n //y轴\n show: true,\n lineStyle: {\n color: '#274561'\n }\n }\n },\n series: [{\n type: 'custom',\n name: '平均值',\n renderItem: function renderItem(params, api) {\n var xValue = api.value(0);\n var currentSeriesIndices = api.currentSeriesIndices();\n var barLayout = api.barLayout({\n barGap: '30%',\n barCategoryGap: '20%',\n count: currentSeriesIndices.length - 1\n });\n var points = [];\n for (var i = 0; i < currentSeriesIndices.length; i++) {\n var seriesIndex = currentSeriesIndices[i];\n if (seriesIndex !== params.seriesIndex) {\n var point = api.coord([xValue, api.value(seriesIndex)]);\n point[0] += barLayout[i - 1].offsetCenter;\n point[1] -= 20;\n points.push(point);\n }\n }\n var style = api.style({\n stroke: api.visual('color'),\n fill: 'none'\n });\n return {\n type: 'polyline',\n shape: {\n points: points\n },\n style: style\n };\n },\n itemStyle: {\n borderWidth: 2\n },\n encode: {\n x: 0,\n y: encodeY\n },\n data: customData,\n z: 100\n }].concat(_toConsumableArray(dataList.map(function (data, index) {\n return {\n type: 'bar',\n animation: false,\n name: legendData[index + 1],\n itemStyle: {\n opacity: 0.9\n },\n data: data,\n showBackground: true,\n backgroundStyle: {\n color: 'rgba(34, 73, 107, 0.5)'\n }\n };\n })))\n };\n option && myChart.setOption(option);\n myChart.on('click', function (event) {\n // return\n var data = event.data;\n // echarts自带加载动画\n myChart.showLoading({\n color: '#2c5e8e',\n textColor: '#fff',\n maskColor: 'rgba(45, 96, 144, 0.6)'\n });\n _this6.$http.get('${yhxt}/yearBudget/v1/getBudgetYearList?companyId=' + data.id).then(function (res) {\n myChart.hideLoading(); // 关闭动画\n _this6.cloumnCharts2(res.data);\n });\n });\n },\n pieCharts: function pieCharts(data) {\n var chartDom = document.getElementById('pie');\n var myChart = echarts.init(chartDom);\n var option;\n var data_ = [];\n data.forEach(function (item) {\n data_.push({\n value: item.alreadyCount,\n name: item.name\n });\n });\n var budget = parseFloat(this.total.budgetSumTotal);\n var already = parseFloat(this.total.alreadyCountTotal);\n budget = new BigNumber(budget);\n data_.push({\n value: budget.minus(already).toFixed(2),\n name: '未用总额'\n });\n // let formatNumber = num =>\n // num.toString().replace(/(?=(\\B)(\\d{3})+$)/g, ',')\n option = {\n title: [{\n text: \"{name|\\u9884\\u7B97\\u603B\\u989D/\\u4E07\\u5143}\\n{val|\".concat(this.total.alreadyCountTotal, \"}\"),\n top: 'center',\n left: 'center',\n textStyle: {\n rich: {\n name: {\n fontSize: 14,\n color: '#fff',\n padding: [10, 0]\n },\n val: {\n fontSize: 32,\n fontWeight: 'bold',\n color: '#fff'\n }\n }\n }\n }],\n tooltip: {\n trigger: 'item',\n formatter: function formatter(a) {\n return \"\".concat(a.marker, \" \").concat(a.data.name, \" \").concat(a.data.value, \"\\u4E07\\u5143 \").concat(a.percent, \"%\");\n }\n },\n color: ['#68c1e5', '#578bf1', '#6a5cf1', '#56d0a3', '#596d90'],\n legend: {\n icon: 'circle',\n orient: 'vertical',\n right: 30,\n top: 'center',\n bottom: 20,\n textStyle: {\n color: '#ccc'\n }\n },\n series: [{\n type: 'pie',\n radius: ['40%', '55%'],\n // center: ['45%', '50%'],\n data: data_,\n label: {\n alignTo: 'edge',\n formatter: function formatter(a) {\n return \"{percent|\".concat(a.percent, \"%}\");\n },\n minMargin: 5,\n edgeDistance: '15%',\n rich: {\n percent: {\n fontSize: 15,\n color: '#fff'\n }\n }\n }\n }]\n };\n option && myChart.setOption(option);\n }\n }\n};",null]}