From 08b5ddfa9a0a2ed52bd7d7b98ca16ef4dcc610a6 Mon Sep 17 00:00:00 2001 From: zhangxiaoxu123 <819527061@qq.com> Date: 星期二, 13 九月 2022 14:19:43 +0800 Subject: [PATCH] 页面修改 --- src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue | 60 +++++++++++++++++++++++++++++------------------------------- 1 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue b/src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue index 963d7d5..dc1d0ad 100644 --- a/src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue +++ b/src/pages/show/personnelTalents/personnelTalentsChild/PersonnelTalents_UnitPersonnel.vue @@ -55,7 +55,7 @@ <script> import nowSize from "../../../../libs/nowSize"; -import {getPersonTable} from '@/api/personnelTalents'; +import {getPersonTable, getUnitLine} from '@/api/personnelTalents'; export default { name: "PersonnelTalents_UnitPersonnel", @@ -144,17 +144,17 @@ checkedCategory: '浜嬩笟鍗曚綅', CARE_GORY: ['浜嬩笟鍗曚綅', '鍦ㄨ亴浜哄憳', '骞翠汉鍧囨敹鍏�'], tableHeight: window.innerHeight - nowSize(1000), - isShow:true, - echartSeries:{ - jumin:[120, 132, 101, 134, 90, 230], - chengzhen:[220, 182, 191, 234, 290, 330], - nongcun:[150, 232, 201, 154, 190, 330] + isShow: true, + echartSeries: {}, + selectIndex: { + type: 1 } } }, mounted() { this.Init_echarts() this.getPersonTable() + this.getUnitLine() }, methods: { mergeColumnTableCell({rowIndex, columnIndex}) { @@ -182,7 +182,7 @@ const option = { color: ['#FF5151', '#51FF5D', '#FFD151'], title: { - text: '鍘嗗勾鍏ㄥ競灞呮皯浜哄潎鍙敮閰嶆敹鍏ュ垎鏋愬浘', + text: '杩戜竴骞翠簨涓氭暟閲忓彉鍖栬秼鍔垮浘', left: 'center', top: '5%', textStyle: { @@ -220,7 +220,7 @@ containLabel: true }, xAxis: { - name: '鍗曚綅锛氬勾', + name: '鍗曚綅锛氬勾/鏈�', nameTextStyle: { color: '#FFFFFF', fontSize: nowSize(24) @@ -228,7 +228,7 @@ nameGap: nowSize(92),// 鍧愭爣杞村悕绉颁笌杞寸嚎涔嬮棿鐨勮窛绂汇�� type: 'category', boundaryGap: false,// 鍧愭爣杞翠袱绔暀鐧� - data: ['2017骞�', '2018骞�', '2019骞�', '2020骞�', '2021骞�'], + data: this.echartSeries.years, axisLabel: { show: true, textStyle: { @@ -248,7 +248,7 @@ } }, yAxis: { - name: '鍗曚綅锛氬勾', + name: '鍗曚綅锛氬', nameTextStyle: { color: '#FFFFFF', fontSize: nowSize(24) @@ -275,19 +275,19 @@ }, series: [ { - name: '灞呮皯浜哄潎鍙敮閰嶆敹鍏�', + name: '鍏ㄥ競', type: 'line', - data: this.echartSeries.jumin + data: this.echartSeries.quanshi }, { - name: '鍩庨晣灞呮皯', + name: '甯傜洿', type: 'line', - data: this.echartSeries.chengzhen + data: this.echartSeries.shizhi }, { - name: '鍐滄潙灞呮皯', + name: '鍘匡紙甯傘�佸尯锛�', type: 'line', - data: this.echartSeries.nongcun + data: this.echartSeries.xian } ] }; @@ -298,21 +298,9 @@ }, // 閫氳繃鐐瑰嚮鏇存崲echarts鍥捐〃淇℃伅 selectEcharts(index) { - console.log(index); - switch(index){ - case 0: - this.isShow = true; - this.echartSeries = { - jumin:[120, 132, 101, 134, 90, 230], - chengzhen:[220, 182, 191, 234, 290, 330], - nongcun:[150, 232, 201, 154, 190, 330] - } - this.Init_echarts() - break; - default: - this.isShow = false; - break; - } + this.selectIndex.type = index + 1 + this.getUnitLine() + this.Init_echarts() }, // 29. 鏌ヨ浜嬩笟鍗曚綅浜哄憳鎯呭喌琛ㄦ牸鏁版嵁鎺ュ彛 getPersonTable() { @@ -321,6 +309,16 @@ this.tableData = res.list } }) + }, + // 41.鏌ヨ浜嬩笟骞村害鍙樺寲鎯呭喌鎶樼嚎鍥炬暟鎹帴鍙� + getUnitLine() { + getUnitLine(this.selectIndex).then(res => { + if (res.code === 1000) { + this.echartSeries = res.obj + console.log(this.echartSeries); + this.Init_echarts() + } + }) } }, created() { -- Gitblit v1.9.1