{"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":1680113636379},{"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":315532800000},{"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 _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.function.name\";\nimport \"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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格式化千分位\n\nvar BigNumber = require('bignumber.js');\n\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 this.loadData();\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.distributionCountTotal = this.getDistributionCountTotal(parseFloat(this.total.alreadyCountTotal), parseFloat(this.total.budgetSumTotal)); // 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\n this.total.ascriptionYear = newVal.length !== 0 && newVal[0].ascriptionYear;\n this.cloumnCharts(this.tableData);\n this.pieCharts(this.tableData);\n }\n },\n methods: {\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 val = new BigNumber(val1);\n\n if (val1 && val2) {\n return val.div(val2).times(100).toFixed(2) + '%';\n } else {\n return '0.00%';\n }\n },\n changeYear: function changeYear(val) {\n var _this = this;\n\n if (!val) {\n return this.loadData();\n }\n\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetCountVo?year=' + val).then(function (res) {\n _this.tableData = res && res.status == 200 && res.data || [];\n _this.data = [];\n\n _this.data.push(_this.tableData);\n\n _this.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\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 _this2 = this;\n\n this.loading = true;\n this.$http.post('${yhxt}/yearBudget/v1/getBudgetCountVo?year=' + new Date().getFullYear()).then(function (res) {\n _this2.tableData = res && res.status == 200 && res.data || [];\n _this2.data = [];\n\n _this2.data.push(_this2.tableData);\n\n _this2.loading = false;\n }).catch(function () {\n _this2.loading = false;\n });\n },\n cloumnCharts: function cloumnCharts(data) {\n var _legend;\n\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 legend: (_legend = {\n bottom: 'bottom'\n }, _defineProperty(_legend, \"bottom\", 10), _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: '#cefff2'\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: '#fff'\n }\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: '#fff'\n }\n }\n },\n yAxis: {\n type: 'value',\n splitLine: {\n show: true\n },\n //去除网格线\n axisLabel: {\n textStyle: {\n color: '#fff'\n }\n },\n axisTick: {\n //y轴刻度线\n show: true,\n lineStyle: {\n color: '#fff'\n }\n },\n axisLine: {\n //y轴\n show: false,\n lineStyle: {\n color: '#fff'\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; // Update the end point.\n\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 }, {\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 }]\n };\n option && myChart.setOption(option);\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 }); // let formatNumber = num =>\n // num.toString().replace(/(?=(\\B)(\\d{3})+$)/g, ',')\n\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: 70,\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 rich: {\n percent: {\n fontSize: 15,\n color: '#fff'\n }\n }\n }\n }]\n };\n option && myChart.setOption(option);\n }\n }\n};",null]}