diff --git a/src/views/resume/femalestaff.vue b/src/views/resume/femalestaff.vue index b6b8f9e..5e321d2 100644 --- a/src/views/resume/femalestaff.vue +++ b/src/views/resume/femalestaff.vue @@ -102,8 +102,8 @@ -
-
+
+
能力统计图 @@ -112,7 +112,7 @@
-
+
能力统计图 @@ -121,7 +121,7 @@
-
+
性格统计图 @@ -306,12 +306,27 @@ export default { }, ], }, - natureList: {}, + natureList: [], abilityList: [], user: {}, }; }, computed: { + abilityEchart1VisibleComputed(){ + return this.abilityList.reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, + abilityEchart2VisibleComputed(){ + return this.abilityList.length>6 && this.abilityList.slice(6).reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, + natureEchartVisibleComputed(){ + return this.natureList.reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, userDetail() { let user = {...this.user}; user.educationalExperience = JSON.parse(user.educationalExperience || '[]'); @@ -378,7 +393,11 @@ export default { this.initNengliEchart(); }, initXinggeEchart(list) { - let myChart = echarts.init(document.getElementById("echarts3")); + let dom = document.getElementById("echarts3"); + if(!dom){ + return; + } + let myChart = echarts.init(dom); this.echartOption3.radar.indicator = list.map((t) => { return { name: t.title, max: 100 }; }); @@ -387,8 +406,12 @@ export default { console.log("this.echartOption3", this.echartOption3); }, initNengliEchart(list) { + let dom = document.getElementById("echarts1"); + if(!dom){ + return; + } //第一个echart图 - let myChart = echarts.init(document.getElementById("echarts1")); + let myChart = echarts.init(dom); let list1 = list.slice(0, 6); this.echartOption1.xAxis[0].data = list1.map((t) => t.title); this.echartOption1.series[0].data = list1.map((t) => t.value); diff --git a/src/views/resume/malestaff.vue b/src/views/resume/malestaff.vue index 7c5fbd7..1d85735 100644 --- a/src/views/resume/malestaff.vue +++ b/src/views/resume/malestaff.vue @@ -82,8 +82,8 @@
-
-
+
+
能力统计图 @@ -92,7 +92,7 @@
-
+
能力统计图 @@ -101,7 +101,7 @@
-
+
性格统计图 @@ -286,12 +286,27 @@ export default { }, ], }, - natureList: {}, + natureList: [], abilityList: [], user: {}, }; }, computed: { + abilityEchart1VisibleComputed(){ + return this.abilityList.reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, + abilityEchart2VisibleComputed(){ + return this.abilityList.length>6 && this.abilityList.slice(6).reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, + natureEchartVisibleComputed(){ + return this.natureList.reduce((total,item)=>{ + return total + item.value; + },0)>0; + }, userDetail() { let user = {...this.user}; user.educationalExperience = JSON.parse(user.educationalExperience || '[]'); @@ -358,17 +373,25 @@ export default { this.initNengliEchart(); }, initXinggeEchart(list) { - let myChart = echarts.init(document.getElementById("echarts3")); + let dom = document.getElementById("echarts3"); + if(!dom){ + return; + } + let myChart = echarts.init(dom); + if(myChart) this.echartOption3.radar.indicator = list.map((t) => { return { name: t.title, max: 100 }; }); this.echartOption3.series[0].data[0].value = list.map((t) => t.value); myChart.setOption(this.echartOption3); - console.log("this.echartOption3", this.echartOption3); }, initNengliEchart(list) { + let dom = document.getElementById("echarts1"); + if(!dom){ + return; + } //第一个echart图 - let myChart = echarts.init(document.getElementById("echarts1")); + let myChart = echarts.init(dom); let list1 = list.slice(0, 6); this.echartOption1.xAxis[0].data = list1.map((t) => t.title); this.echartOption1.series[0].data = list1.map((t) => t.value);