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 | 20 | }, |
| 21 | 21 | }, |
| 22 | 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 | 52 | \ No newline at end of file | ... | ... |
src/views/resume/femalestaff.vue
| ... | ... | @@ -7,12 +7,17 @@ |
| 7 | 7 | <div class="user-info"> |
| 8 | 8 | <h2>{{ userDetail.fullName }}</h2> |
| 9 | 9 | <img |
| 10 | - style="height: 30px; margin: 0 20px" | |
| 10 | + style="height: 16rem; margin: 0 20px" | |
| 11 | 11 | src="/static/resume/female/resume13.png" |
| 12 | 12 | alt="" |
| 13 | 13 | /> |
| 14 | 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 | 21 | </div> |
| 17 | 22 | </div> |
| 18 | 23 | <ul class="user-items"> |
| ... | ... | @@ -54,10 +59,14 @@ |
| 54 | 59 | <div class="info-content"> |
| 55 | 60 | <ul |
| 56 | 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 | 70 | <h3 class="flex flex-between"> |
| 62 | 71 | <span>{{ item.school }}</span> |
| 63 | 72 | <span style="font-size: 16px">{{ item.date }}</span> |
| ... | ... | @@ -79,14 +88,10 @@ |
| 79 | 88 | <div class="info-content"> |
| 80 | 89 | <ul |
| 81 | 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 | 95 | <h3 class="flex flex-between"> |
| 91 | 96 | <span>{{ item.company }}</span> |
| 92 | 97 | <span>{{ item.position }}</span> |
| ... | ... | @@ -102,7 +107,14 @@ |
| 102 | 107 | </div> |
| 103 | 108 | </div> |
| 104 | 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 | 118 | <div class="panel" v-if="abilityEchart1VisibleComputed"> |
| 107 | 119 | <div class="panel-title"> |
| 108 | 120 | <span>能力统计图</span> |
| ... | ... | @@ -112,7 +124,7 @@ |
| 112 | 124 | <div id="echarts1"></div> |
| 113 | 125 | </div> |
| 114 | 126 | </div> |
| 115 | - <div class="panel" v-if="abilityEchart2VisibleComputed"> | |
| 127 | + <div class="panel" v-if="abilityEchart2VisibleComputed"> | |
| 116 | 128 | <div class="panel-title"> |
| 117 | 129 | <span>能力统计图</span> |
| 118 | 130 | <img src="/static/resume/female/resume11.png" alt="" /> |
| ... | ... | @@ -121,7 +133,7 @@ |
| 121 | 133 | <div id="echarts2"></div> |
| 122 | 134 | </div> |
| 123 | 135 | </div> |
| 124 | - <div class="panel" v-if="natureEchartVisibleComputed"> | |
| 136 | + <div class="panel" v-if="natureEchartVisibleComputed"> | |
| 125 | 137 | <div class="panel-title"> |
| 126 | 138 | <span>性格统计图</span> |
| 127 | 139 | <img src="/static/resume/female/resume12.png" alt="" /> |
| ... | ... | @@ -152,6 +164,9 @@ export default { |
| 152 | 164 | { title: "户籍所在地", value: "", icon: "resume9.png" }, |
| 153 | 165 | ], |
| 154 | 166 | echartOption1: { |
| 167 | + textStyle:{ | |
| 168 | + fontSize:'8rem' | |
| 169 | + }, | |
| 155 | 170 | grid: { |
| 156 | 171 | top: 30, |
| 157 | 172 | bottom: 20, |
| ... | ... | @@ -312,26 +327,35 @@ export default { |
| 312 | 327 | }; |
| 313 | 328 | }, |
| 314 | 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 | 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 | 359 | return user; |
| 336 | 360 | }, |
| 337 | 361 | infoListComputed() { |
| ... | ... | @@ -354,8 +378,10 @@ export default { |
| 354 | 378 | }, |
| 355 | 379 | mounted() { |
| 356 | 380 | this.init(); |
| 381 | + this.initRem(); | |
| 357 | 382 | }, |
| 358 | 383 | methods: { |
| 384 | + | |
| 359 | 385 | init() { |
| 360 | 386 | getOuterUserInfo(this.id).then((res) => { |
| 361 | 387 | let { nature, ability, user } = res.data; |
| ... | ... | @@ -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 | 430 | initEchart() { |
| 393 | 431 | this.initNengliEchart(); |
| 394 | 432 | }, |
| 395 | 433 | initXinggeEchart(list) { |
| 396 | 434 | let dom = document.getElementById("echarts3"); |
| 397 | - if(!dom){ | |
| 435 | + if (!dom) { | |
| 398 | 436 | return; |
| 399 | 437 | } |
| 400 | 438 | let myChart = echarts.init(dom); |
| ... | ... | @@ -407,7 +445,7 @@ export default { |
| 407 | 445 | }, |
| 408 | 446 | initNengliEchart(list) { |
| 409 | 447 | let dom = document.getElementById("echarts1"); |
| 410 | - if(!dom){ | |
| 448 | + if (!dom) { | |
| 411 | 449 | return; |
| 412 | 450 | } |
| 413 | 451 | //第一个echart图 |
| ... | ... | @@ -432,6 +470,7 @@ export default { |
| 432 | 470 | }; |
| 433 | 471 | </script> |
| 434 | 472 | <style lang="scss" scoped> |
| 473 | + | |
| 435 | 474 | @import "style/style.scss"; |
| 436 | 475 | @import "style/style_famale.scss"; |
| 437 | 476 | </style> |
| 438 | 477 | \ No newline at end of file | ... | ... |
src/views/resume/malestaff.vue
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | <div class="user-info"> |
| 8 | 8 | <h2>{{ userDetail.fullName }}</h2> |
| 9 | 9 | <img |
| 10 | - style="height: 30px; margin: 0 20px" | |
| 10 | + style="height: 16rem; margin: 0 20px" | |
| 11 | 11 | src="/static/resume/male/resume13.png" |
| 12 | 12 | alt="" |
| 13 | 13 | /> |
| ... | ... | @@ -337,6 +337,7 @@ export default { |
| 337 | 337 | }, |
| 338 | 338 | mounted() { |
| 339 | 339 | this.init(); |
| 340 | + this.initRem(); | |
| 340 | 341 | }, |
| 341 | 342 | methods: { |
| 342 | 343 | init() { | ... | ... |
src/views/resume/style/style.scss
| ... | ... | @@ -39,6 +39,7 @@ li { |
| 39 | 39 | color: #fff; |
| 40 | 40 | display: flex; |
| 41 | 41 | flex-direction: column; |
| 42 | + font-size: 10rem; | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | .flex { |
| ... | ... | @@ -46,16 +47,16 @@ li { |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | .star-progress { |
| 49 | - width: 140px; | |
| 50 | - height: 20px; | |
| 50 | + width: 70rem; | |
| 51 | + height: 10rem; | |
| 51 | 52 | background-image: url(/static/resume/male/resume7.png); |
| 52 | 53 | background-repeat: repeat-x; |
| 53 | - background-size: 20px 20px; | |
| 54 | + background-size: 10rem 10rem; | |
| 54 | 55 | .star-progress-bar { |
| 55 | 56 | background-image: url(/static/resume/male/resume10.png); |
| 56 | 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 | 70 | margin-bottom: 20px; |
| 70 | 71 | } |
| 71 | 72 | .user-head { |
| 72 | - width: 120px; | |
| 73 | - height: 120px; | |
| 73 | + width: 87rem; | |
| 74 | + height: 87rem; | |
| 74 | 75 | border-radius: 20px; |
| 75 | 76 | -webkit-border-radius: 20px; |
| 76 | 77 | -moz-border-radius: 20px; |
| ... | ... | @@ -88,7 +89,7 @@ li { |
| 88 | 89 | flex-wrap: wrap; |
| 89 | 90 | padding: 0; |
| 90 | 91 | margin: 0; |
| 91 | - max-width: 1000px; | |
| 92 | + max-width: 80%; | |
| 92 | 93 | li { |
| 93 | 94 | margin: 10px 20px 10px 0; |
| 94 | 95 | display: flex; |
| ... | ... | @@ -159,7 +160,7 @@ li { |
| 159 | 160 | .panel-title { |
| 160 | 161 | display: flex; |
| 161 | 162 | align-items: center; |
| 162 | - font-size: 18px; | |
| 163 | + font-size: 10rem; | |
| 163 | 164 | img { |
| 164 | 165 | height: 20px; |
| 165 | 166 | margin-left: 10px; | ... | ... |