Commit 97c13b13947807dda920991467dc34affd3e5824
1 parent
97bf7b2f
简历分析样式修改
Showing
4 changed files
with
108 additions
and
41 deletions
src/common/mixins.js
| @@ -20,6 +20,32 @@ export default { | @@ -20,6 +20,32 @@ export default { | ||
| 20 | }, | 20 | }, |
| 21 | }, | 21 | }, |
| 22 | methods: { | 22 | methods: { |
| 23 | + initRem() { | ||
| 24 | + var html = document.documentElement; | ||
| 25 | + var w = html.getBoundingClientRect().width; | ||
| 26 | + var fontSize = w / 1000; | ||
| 27 | + html.style.fontSize = fontSize + "px"; | ||
| 23 | 28 | ||
| 29 | + if (this.echartOption1) { | ||
| 30 | + this.echartOption1.textStyle = { | ||
| 31 | + fontSize: fontSize * 9 | ||
| 32 | + }; | ||
| 33 | + } | ||
| 34 | + if (this.echartOption2) { | ||
| 35 | + this.echartOption2.textStyle = { | ||
| 36 | + fontSize: fontSize * 9 | ||
| 37 | + }; | ||
| 38 | + } | ||
| 39 | + if (this.echartOption3) { | ||
| 40 | + this.echartOption3.textStyle = { | ||
| 41 | + fontSize: fontSize * 9 | ||
| 42 | + }; | ||
| 43 | + } | ||
| 44 | + if (this.resetChart) { | ||
| 45 | + setTimeout(() => { | ||
| 46 | + this.resetChart() | ||
| 47 | + }, 2000) | ||
| 48 | + } | ||
| 49 | + }, | ||
| 24 | } | 50 | } |
| 25 | } | 51 | } |
| 26 | \ No newline at end of file | 52 | \ No newline at end of file |
src/views/resume/femalestaff.vue
| @@ -7,12 +7,17 @@ | @@ -7,12 +7,17 @@ | ||
| 7 | <div class="user-info"> | 7 | <div class="user-info"> |
| 8 | <h2>{{ userDetail.fullName }}</h2> | 8 | <h2>{{ userDetail.fullName }}</h2> |
| 9 | <img | 9 | <img |
| 10 | - style="height: 30px; margin: 0 20px" | 10 | + style="height: 16rem; margin: 0 20px" |
| 11 | src="/static/resume/female/resume13.png" | 11 | src="/static/resume/female/resume13.png" |
| 12 | alt="" | 12 | alt="" |
| 13 | /> | 13 | /> |
| 14 | <div class="star-progress"> | 14 | <div class="star-progress"> |
| 15 | - <div :style="{'width':'calc(140px / 7 * '+(userDetail.stars||0)+')'}" class="star-progress-bar"></div> | 15 | + <div |
| 16 | + :style="{ | ||
| 17 | + width: 'calc(140px / 7 * ' + (userDetail.stars || 0) + ')', | ||
| 18 | + }" | ||
| 19 | + class="star-progress-bar" | ||
| 20 | + ></div> | ||
| 16 | </div> | 21 | </div> |
| 17 | </div> | 22 | </div> |
| 18 | <ul class="user-items"> | 23 | <ul class="user-items"> |
| @@ -54,10 +59,14 @@ | @@ -54,10 +59,14 @@ | ||
| 54 | <div class="info-content"> | 59 | <div class="info-content"> |
| 55 | <ul | 60 | <ul |
| 56 | v-if=" | 61 | v-if=" |
| 57 | - userDetail.educationalExperience && userDetail.educationalExperience.length | 62 | + userDetail.educationalExperience && |
| 63 | + userDetail.educationalExperience.length | ||
| 58 | " | 64 | " |
| 59 | > | 65 | > |
| 60 | - <li v-for="item in userDetail.educationalExperience" :key="item.date"> | 66 | + <li |
| 67 | + v-for="item in userDetail.educationalExperience" | ||
| 68 | + :key="item.date" | ||
| 69 | + > | ||
| 61 | <h3 class="flex flex-between"> | 70 | <h3 class="flex flex-between"> |
| 62 | <span>{{ item.school }}</span> | 71 | <span>{{ item.school }}</span> |
| 63 | <span style="font-size: 16px">{{ item.date }}</span> | 72 | <span style="font-size: 16px">{{ item.date }}</span> |
| @@ -79,14 +88,10 @@ | @@ -79,14 +88,10 @@ | ||
| 79 | <div class="info-content"> | 88 | <div class="info-content"> |
| 80 | <ul | 89 | <ul |
| 81 | v-if=" | 90 | v-if=" |
| 82 | - userDetail.workExperience && | ||
| 83 | - userDetail.workExperience.length | 91 | + userDetail.workExperience && userDetail.workExperience.length |
| 84 | " | 92 | " |
| 85 | > | 93 | > |
| 86 | - <li | ||
| 87 | - v-for="item in userDetail.workExperience" | ||
| 88 | - :key="item.date" | ||
| 89 | - > | 94 | + <li v-for="item in userDetail.workExperience" :key="item.date"> |
| 90 | <h3 class="flex flex-between"> | 95 | <h3 class="flex flex-between"> |
| 91 | <span>{{ item.company }}</span> | 96 | <span>{{ item.company }}</span> |
| 92 | <span>{{ item.position }}</span> | 97 | <span>{{ item.position }}</span> |
| @@ -102,7 +107,14 @@ | @@ -102,7 +107,14 @@ | ||
| 102 | </div> | 107 | </div> |
| 103 | </div> | 108 | </div> |
| 104 | </div> | 109 | </div> |
| 105 | - <div class="bottom-panel flex1" v-if="abilityEchart1VisibleComputed || abilityEchart2VisibleComputed || natureEchartVisibleComputed"> | 110 | + <div |
| 111 | + class="bottom-panel flex1" | ||
| 112 | + v-if=" | ||
| 113 | + abilityEchart1VisibleComputed || | ||
| 114 | + abilityEchart2VisibleComputed || | ||
| 115 | + natureEchartVisibleComputed | ||
| 116 | + " | ||
| 117 | + > | ||
| 106 | <div class="panel" v-if="abilityEchart1VisibleComputed"> | 118 | <div class="panel" v-if="abilityEchart1VisibleComputed"> |
| 107 | <div class="panel-title"> | 119 | <div class="panel-title"> |
| 108 | <span>能力统计图</span> | 120 | <span>能力统计图</span> |
| @@ -112,7 +124,7 @@ | @@ -112,7 +124,7 @@ | ||
| 112 | <div id="echarts1"></div> | 124 | <div id="echarts1"></div> |
| 113 | </div> | 125 | </div> |
| 114 | </div> | 126 | </div> |
| 115 | - <div class="panel" v-if="abilityEchart2VisibleComputed"> | 127 | + <div class="panel" v-if="abilityEchart2VisibleComputed"> |
| 116 | <div class="panel-title"> | 128 | <div class="panel-title"> |
| 117 | <span>能力统计图</span> | 129 | <span>能力统计图</span> |
| 118 | <img src="/static/resume/female/resume11.png" alt="" /> | 130 | <img src="/static/resume/female/resume11.png" alt="" /> |
| @@ -121,7 +133,7 @@ | @@ -121,7 +133,7 @@ | ||
| 121 | <div id="echarts2"></div> | 133 | <div id="echarts2"></div> |
| 122 | </div> | 134 | </div> |
| 123 | </div> | 135 | </div> |
| 124 | - <div class="panel" v-if="natureEchartVisibleComputed"> | 136 | + <div class="panel" v-if="natureEchartVisibleComputed"> |
| 125 | <div class="panel-title"> | 137 | <div class="panel-title"> |
| 126 | <span>性格统计图</span> | 138 | <span>性格统计图</span> |
| 127 | <img src="/static/resume/female/resume12.png" alt="" /> | 139 | <img src="/static/resume/female/resume12.png" alt="" /> |
| @@ -152,6 +164,9 @@ export default { | @@ -152,6 +164,9 @@ export default { | ||
| 152 | { title: "户籍所在地", value: "", icon: "resume9.png" }, | 164 | { title: "户籍所在地", value: "", icon: "resume9.png" }, |
| 153 | ], | 165 | ], |
| 154 | echartOption1: { | 166 | echartOption1: { |
| 167 | + textStyle:{ | ||
| 168 | + fontSize:'8rem' | ||
| 169 | + }, | ||
| 155 | grid: { | 170 | grid: { |
| 156 | top: 30, | 171 | top: 30, |
| 157 | bottom: 20, | 172 | bottom: 20, |
| @@ -312,26 +327,35 @@ export default { | @@ -312,26 +327,35 @@ export default { | ||
| 312 | }; | 327 | }; |
| 313 | }, | 328 | }, |
| 314 | computed: { | 329 | computed: { |
| 315 | - abilityEchart1VisibleComputed(){ | ||
| 316 | - return this.natureList.reduce((total,item)=>{ | ||
| 317 | - return total + item.value; | ||
| 318 | - },0)>0; | 330 | + abilityEchart1VisibleComputed() { |
| 331 | + return ( | ||
| 332 | + this.natureList.reduce((total, item) => { | ||
| 333 | + return total + item.value; | ||
| 334 | + }, 0) > 0 | ||
| 335 | + ); | ||
| 319 | }, | 336 | }, |
| 320 | - abilityEchart2VisibleComputed(){ | ||
| 321 | - return this.natureList.length>6 && this.natureList.slice(6).reduce((total,item)=>{ | ||
| 322 | - return total + item.value; | ||
| 323 | - },0)>0; | 337 | + abilityEchart2VisibleComputed() { |
| 338 | + return ( | ||
| 339 | + this.natureList.length > 6 && | ||
| 340 | + this.natureList.slice(6).reduce((total, item) => { | ||
| 341 | + return total + item.value; | ||
| 342 | + }, 0) > 0 | ||
| 343 | + ); | ||
| 324 | }, | 344 | }, |
| 325 | - natureEchartVisibleComputed(){ | ||
| 326 | - return this.abilityList.reduce((total,item)=>{ | ||
| 327 | - return total + item.value; | ||
| 328 | - },0)>0; | 345 | + natureEchartVisibleComputed() { |
| 346 | + return ( | ||
| 347 | + this.abilityList.reduce((total, item) => { | ||
| 348 | + return total + item.value; | ||
| 349 | + }, 0) > 0 | ||
| 350 | + ); | ||
| 329 | }, | 351 | }, |
| 330 | userDetail() { | 352 | userDetail() { |
| 331 | - let user = {...this.user}; | ||
| 332 | - user.educationalExperience = JSON.parse(user.educationalExperience || '[]'); | ||
| 333 | - user.skillAdvantages = JSON.parse(user.skillAdvantages || '[]') | ||
| 334 | - user.workExperience = JSON.parse(user.workExperience || '[]') | 353 | + let user = { ...this.user }; |
| 354 | + user.educationalExperience = JSON.parse( | ||
| 355 | + user.educationalExperience || "[]" | ||
| 356 | + ); | ||
| 357 | + user.skillAdvantages = JSON.parse(user.skillAdvantages || "[]"); | ||
| 358 | + user.workExperience = JSON.parse(user.workExperience || "[]"); | ||
| 335 | return user; | 359 | return user; |
| 336 | }, | 360 | }, |
| 337 | infoListComputed() { | 361 | infoListComputed() { |
| @@ -354,8 +378,10 @@ export default { | @@ -354,8 +378,10 @@ export default { | ||
| 354 | }, | 378 | }, |
| 355 | mounted() { | 379 | mounted() { |
| 356 | this.init(); | 380 | this.init(); |
| 381 | + this.initRem(); | ||
| 357 | }, | 382 | }, |
| 358 | methods: { | 383 | methods: { |
| 384 | + | ||
| 359 | init() { | 385 | init() { |
| 360 | getOuterUserInfo(this.id).then((res) => { | 386 | getOuterUserInfo(this.id).then((res) => { |
| 361 | let { nature, ability, user } = res.data; | 387 | let { nature, ability, user } = res.data; |
| @@ -389,12 +415,24 @@ export default { | @@ -389,12 +415,24 @@ export default { | ||
| 389 | }); | 415 | }); |
| 390 | }); | 416 | }); |
| 391 | }, | 417 | }, |
| 418 | + resetChart(){ | ||
| 419 | + console.log('resetChart'); | ||
| 420 | + console.log('this.echartOption1',this.echartOption1); | ||
| 421 | + console.log('this.echartOption2',this.echartOption2); | ||
| 422 | + console.log('this.echartOption3',this.echartOption3); | ||
| 423 | + this.$nextTick(()=>{ | ||
| 424 | + echarts.init(document.getElementById("echarts1")).setOption(this.echartOption1); | ||
| 425 | + echarts.init(document.getElementById("echarts2")).setOption(this.echartOption2); | ||
| 426 | + echarts.init(document.getElementById("echarts3")).setOption(this.echartOption3); | ||
| 427 | + }) | ||
| 428 | + | ||
| 429 | + }, | ||
| 392 | initEchart() { | 430 | initEchart() { |
| 393 | this.initNengliEchart(); | 431 | this.initNengliEchart(); |
| 394 | }, | 432 | }, |
| 395 | initXinggeEchart(list) { | 433 | initXinggeEchart(list) { |
| 396 | let dom = document.getElementById("echarts3"); | 434 | let dom = document.getElementById("echarts3"); |
| 397 | - if(!dom){ | 435 | + if (!dom) { |
| 398 | return; | 436 | return; |
| 399 | } | 437 | } |
| 400 | let myChart = echarts.init(dom); | 438 | let myChart = echarts.init(dom); |
| @@ -407,7 +445,7 @@ export default { | @@ -407,7 +445,7 @@ export default { | ||
| 407 | }, | 445 | }, |
| 408 | initNengliEchart(list) { | 446 | initNengliEchart(list) { |
| 409 | let dom = document.getElementById("echarts1"); | 447 | let dom = document.getElementById("echarts1"); |
| 410 | - if(!dom){ | 448 | + if (!dom) { |
| 411 | return; | 449 | return; |
| 412 | } | 450 | } |
| 413 | //第一个echart图 | 451 | //第一个echart图 |
| @@ -432,6 +470,7 @@ export default { | @@ -432,6 +470,7 @@ export default { | ||
| 432 | }; | 470 | }; |
| 433 | </script> | 471 | </script> |
| 434 | <style lang="scss" scoped> | 472 | <style lang="scss" scoped> |
| 473 | + | ||
| 435 | @import "style/style.scss"; | 474 | @import "style/style.scss"; |
| 436 | @import "style/style_famale.scss"; | 475 | @import "style/style_famale.scss"; |
| 437 | </style> | 476 | </style> |
| 438 | \ No newline at end of file | 477 | \ No newline at end of file |
src/views/resume/malestaff.vue
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | <div class="user-info"> | 7 | <div class="user-info"> |
| 8 | <h2>{{ userDetail.fullName }}</h2> | 8 | <h2>{{ userDetail.fullName }}</h2> |
| 9 | <img | 9 | <img |
| 10 | - style="height: 30px; margin: 0 20px" | 10 | + style="height: 16rem; margin: 0 20px" |
| 11 | src="/static/resume/male/resume13.png" | 11 | src="/static/resume/male/resume13.png" |
| 12 | alt="" | 12 | alt="" |
| 13 | /> | 13 | /> |
| @@ -337,6 +337,7 @@ export default { | @@ -337,6 +337,7 @@ export default { | ||
| 337 | }, | 337 | }, |
| 338 | mounted() { | 338 | mounted() { |
| 339 | this.init(); | 339 | this.init(); |
| 340 | + this.initRem(); | ||
| 340 | }, | 341 | }, |
| 341 | methods: { | 342 | methods: { |
| 342 | init() { | 343 | init() { |
src/views/resume/style/style.scss
| @@ -39,6 +39,7 @@ li { | @@ -39,6 +39,7 @@ li { | ||
| 39 | color: #fff; | 39 | color: #fff; |
| 40 | display: flex; | 40 | display: flex; |
| 41 | flex-direction: column; | 41 | flex-direction: column; |
| 42 | + font-size: 10rem; | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | .flex { | 45 | .flex { |
| @@ -46,16 +47,16 @@ li { | @@ -46,16 +47,16 @@ li { | ||
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | .star-progress { | 49 | .star-progress { |
| 49 | - width: 140px; | ||
| 50 | - height: 20px; | 50 | + width: 70rem; |
| 51 | + height: 10rem; | ||
| 51 | background-image: url(/static/resume/male/resume7.png); | 52 | background-image: url(/static/resume/male/resume7.png); |
| 52 | background-repeat: repeat-x; | 53 | background-repeat: repeat-x; |
| 53 | - background-size: 20px 20px; | 54 | + background-size: 10rem 10rem; |
| 54 | .star-progress-bar { | 55 | .star-progress-bar { |
| 55 | background-image: url(/static/resume/male/resume10.png); | 56 | background-image: url(/static/resume/male/resume10.png); |
| 56 | background-repeat: repeat-x; | 57 | background-repeat: repeat-x; |
| 57 | - background-size: 20px 20px; | ||
| 58 | - height: 20px; | 58 | + background-size: 10rem 10rem; |
| 59 | + height: 10rem; | ||
| 59 | } | 60 | } |
| 60 | } | 61 | } |
| 61 | 62 | ||
| @@ -69,8 +70,8 @@ li { | @@ -69,8 +70,8 @@ li { | ||
| 69 | margin-bottom: 20px; | 70 | margin-bottom: 20px; |
| 70 | } | 71 | } |
| 71 | .user-head { | 72 | .user-head { |
| 72 | - width: 120px; | ||
| 73 | - height: 120px; | 73 | + width: 87rem; |
| 74 | + height: 87rem; | ||
| 74 | border-radius: 20px; | 75 | border-radius: 20px; |
| 75 | -webkit-border-radius: 20px; | 76 | -webkit-border-radius: 20px; |
| 76 | -moz-border-radius: 20px; | 77 | -moz-border-radius: 20px; |
| @@ -88,7 +89,7 @@ li { | @@ -88,7 +89,7 @@ li { | ||
| 88 | flex-wrap: wrap; | 89 | flex-wrap: wrap; |
| 89 | padding: 0; | 90 | padding: 0; |
| 90 | margin: 0; | 91 | margin: 0; |
| 91 | - max-width: 1000px; | 92 | + max-width: 80%; |
| 92 | li { | 93 | li { |
| 93 | margin: 10px 20px 10px 0; | 94 | margin: 10px 20px 10px 0; |
| 94 | display: flex; | 95 | display: flex; |
| @@ -159,7 +160,7 @@ li { | @@ -159,7 +160,7 @@ li { | ||
| 159 | .panel-title { | 160 | .panel-title { |
| 160 | display: flex; | 161 | display: flex; |
| 161 | align-items: center; | 162 | align-items: center; |
| 162 | - font-size: 18px; | 163 | + font-size: 10rem; |
| 163 | img { | 164 | img { |
| 164 | height: 20px; | 165 | height: 20px; |
| 165 | margin-left: 10px; | 166 | margin-left: 10px; |