Blame view

src/views/resume/malestaff.vue 12.7 KB
4ebb3d66   yangzhi   简历界面
1
2
3
4
5
6
7
  <template>
    <div class="page">
      <div class="top-panel flex1">
        <div class="top-panel-content">
          <img class="user-head" src="/static/resume/head.png" alt="" />
          <div>
            <div class="user-info">
ab9848ab   yangzhi   简历界面
8
9
              <h2>{{ userDetail.fullName }}</h2>
              <img
97c13b13   yangzhi   简历分析样式修改
10
                style="height: 16rem; margin: 0 20px"
ab9848ab   yangzhi   简历界面
11
12
13
                src="/static/resume/male/resume13.png"
                alt=""
              />
4ebb3d66   yangzhi   简历界面
14
              <div class="star-progress">
709bad86   yangzhi   兼容工作经历的数据
15
                <div :style="{'width':'calc(140px / 7 * '+(userDetail.stars||0)+')'}" class="star-progress-bar"></div>
4ebb3d66   yangzhi   简历界面
16
17
18
              </div>
            </div>
            <ul class="user-items">
cbff938b   yangzhi   超哥牛批
19
              <li v-for="item in infoListComputed" :key="item.title">
4ebb3d66   yangzhi   简历界面
20
                <img :src="'/static/resume/male/' + item.icon" alt="" />
cbff938b   yangzhi   超哥牛批
21
                <span>{{ item.title }}:{{ item.value || "" }}</span>
4ebb3d66   yangzhi   简历界面
22
23
24
25
              </li>
            </ul>
          </div>
        </div>
ab9848ab   yangzhi   简历界面
26
27
        <div style="display: flex">
          <div style="flex: 1; margin-right: 30px">
4ebb3d66   yangzhi   简历界面
28
29
30
31
32
            <div class="info-panel">
              <div class="info-title">
                <span>技能优势</span>
              </div>
              <div class="info-content">
cbff938b   yangzhi   超哥牛批
33
34
35
36
                <ul v-if="userDetail.skillAdvantages && userDetail.skillAdvantages.length">
                  <li v-for="item in userDetail.skillAdvantages" :key="item.title">
                    <h3>{{item.title}}</h3>
                    <p class="text-overflow2">{{item.desc}}</p>
4ebb3d66   yangzhi   简历界面
37
38
                  </li>
                </ul>
cbff938b   yangzhi   超哥牛批
39
                <div v-else>暂无信息</div>
4ebb3d66   yangzhi   简历界面
40
41
42
43
44
45
46
              </div>
            </div>
            <div class="info-panel">
              <div class="info-title">
                <span>教育经历</span>
              </div>
              <div class="info-content">
709bad86   yangzhi   兼容工作经历的数据
47
48
                <ul v-if="userDetail.educationalExperience && userDetail.educationalExperience.length">
                  <li v-for="item in userDetail.educationalExperience" :key="item.date">
4ebb3d66   yangzhi   简历界面
49
                    <h3 class="flex flex-between">
cbff938b   yangzhi   超哥牛批
50
                      <span>{{ item.school }}</span>
f0344737   yangzhi   简历分析修改
51
                      <span style="font-size: 10rem">{{item.date}}</span>
4ebb3d66   yangzhi   简历界面
52
                    </h3>
ab9848ab   yangzhi   简历界面
53
                    <p class="flex flex-between">
cbff938b   yangzhi   超哥牛批
54
55
                      <span>{{item.major}}</span>
                      <span>{{item.degree}}</span>
4ebb3d66   yangzhi   简历界面
56
57
58
                    </p>
                  </li>
                </ul>
cbff938b   yangzhi   超哥牛批
59
                <div v-else>暂无信息</div>
4ebb3d66   yangzhi   简历界面
60
61
62
              </div>
            </div>
          </div>
ab9848ab   yangzhi   简历界面
63
64
65
66
67
          <div class="info-panel" style="flex: 1">
            <div class="info-title">
              <span>工作经历</span>
            </div>
            <div class="info-content">
709bad86   yangzhi   兼容工作经历的数据
68
69
              <ul v-if="userDetail.workExperience && userDetail.workExperience.length">
                <li v-for="item in userDetail.workExperience" :key="item.date">
ab9848ab   yangzhi   简历界面
70
                  <h3 class="flex flex-between">
cbff938b   yangzhi   超哥牛批
71
72
                    <span>{{item.company}}</span>
                    <span>{{item.position}}</span>
f0344737   yangzhi   简历分析修改
73
                    <span style="font-size: 10rem">{{item.date}}</span>
ab9848ab   yangzhi   简历界面
74
75
                  </h3>
                  <p class="text-overflow2">
cbff938b   yangzhi   超哥牛批
76
                    {{item.desc}}
ab9848ab   yangzhi   简历界面
77
78
79
                  </p>
                </li>
              </ul>
cbff938b   yangzhi   超哥牛批
80
              <div v-else>暂无信息</div>
4ebb3d66   yangzhi   简历界面
81
            </div>
ab9848ab   yangzhi   简历界面
82
          </div>
4ebb3d66   yangzhi   简历界面
83
84
        </div>
      </div>
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
85
86
      <div class="bottom-panel flex1" v-if="abilityEchart1VisibleComputed || abilityEchart2VisibleComputed || natureEchartVisibleComputed">
        <div class="panel" v-if="abilityEchart1VisibleComputed">
4ebb3d66   yangzhi   简历界面
87
88
89
90
91
92
93
94
          <div class="panel-title">
            <span>能力统计图</span>
            <img src="/static/resume/male/resume11.png" alt="" />
          </div>
          <div class="panel-body">
            <div id="echarts1"></div>
          </div>
        </div>
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
95
        <div class="panel" v-if="abilityEchart2VisibleComputed">
4ebb3d66   yangzhi   简历界面
96
97
98
99
100
101
102
103
          <div class="panel-title">
            <span>能力统计图</span>
            <img src="/static/resume/male/resume11.png" alt="" />
          </div>
          <div class="panel-body">
            <div id="echarts2"></div>
          </div>
        </div>
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
104
        <div class="panel" v-if="natureEchartVisibleComputed">
4ebb3d66   yangzhi   简历界面
105
106
107
108
109
110
111
112
113
114
115
116
          <div class="panel-title">
            <span>性格统计图</span>
            <img src="/static/resume/male/resume12.png" alt="" />
          </div>
          <div class="panel-body">
            <div id="echarts3"></div>
          </div>
        </div>
      </div>
    </div>
  </template>
  <script>
ab9848ab   yangzhi   简历界面
117
118
  import * as echarts from "echarts";
  import { getOuterUserInfo } from "@/api/user";
4ebb3d66   yangzhi   简历界面
119
120
121
  export default {
    data() {
      return {
ab9848ab   yangzhi   简历界面
122
        id: "",
4ebb3d66   yangzhi   简历界面
123
124
        infoList: [
          { title: "性别", value: "男", icon: "resume17.png" },
cbff938b   yangzhi   超哥牛批
125
126
127
128
          { title: "体重", value: "", icon: "resume1.png" },
          { title: "身高", value: "", icon: "resume2.png" },
          { title: "血型", value: "", icon: "resume3.png" },
          { title: "年龄", value: "", icon: "resume8.png" },
4ebb3d66   yangzhi   简历界面
129
130
          { title: "婚否", value: "未婚", icon: "resume14.png" },
          { title: "民族", value: "汉族", icon: "resume4.png" },
cbff938b   yangzhi   超哥牛批
131
132
          { title: "政治面貌", value: "", icon: "resume5.png" },
          { title: "户籍所在地", value: "", icon: "resume9.png" },
4ebb3d66   yangzhi   简历界面
133
        ],
ab9848ab   yangzhi   简历界面
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
        echartOption1: {
          grid: {
            top: 30,
            bottom: 20,
            right: 20,
            left: 20,
          },
          yAxis: {
            type: "value",
            splitLine: {
              lineStyle: {
                type: "dashed",
              },
            },
            axisLabel: {
              show: false,
              color: "#EAEBEB",
            },
          },
          xAxis: [
            {
              type: "category",
              axisLabel: {
                color: "#9FA9BD",
                interval: 0,
                fontSize: 14,
              },
              data: [],
            },
          ],
          series: [
            {
              type: "bar",
              barWidth: 25,
              label: {
                show: true,
                color: "#65EFFDFF",
                position: "top",
              },
              itemStyle: {
                normal: {
                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                    { offset: 0, color: "#65EFFDFF" },
                    { offset: 1, color: "#65EFFD00" },
                  ]),
                  barBorderRadius: [10, 10, 0, 0],
                },
              },
              data: [],
            },
            {
              type: "line",
              color: "#65EFFD",
              data: [],
            },
          ],
        },
        echartOption2: {
          grid: {
            top: 30,
            bottom: 20,
            right: 20,
            left: 20,
          },
          yAxis: {
            type: "value",
            splitLine: {
              lineStyle: {
                type: "dashed",
              },
            },
            axisLabel: {
              show: false,
              color: "#EAEBEB",
            },
          },
          xAxis: [
            {
              type: "category",
              axisLabel: {
                color: "#9FA9BD",
                interval: 0,
                fontSize: 14,
              },
              data: [],
            },
          ],
          series: [
            {
              type: "bar",
              barWidth: 25,
              label: {
                show: true,
                color: "#65EFFDFF",
                position: "top",
              },
              itemStyle: {
                normal: {
                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                    { offset: 0, color: "#65EFFDFF" },
                    { offset: 1, color: "#65EFFD00" },
                  ]),
                  barBorderRadius: [10, 10, 0, 0],
                },
              },
              data: [],
            },
            {
              type: "line",
              color: "#65EFFD",
              data: [],
            },
          ],
        },
        echartOption3: {
          radar: {
            indicator: [
              { name: "Sales", max: 6500 },
              { name: "Administration", max: 16000 },
              { name: "Information Technology", max: 30000 },
              { name: "Customer Support", max: 38000 },
              { name: "Development", max: 52000 },
              { name: "Marketing", max: 25000 },
            ],
          },
          series: [
            {
              type: "radar",
              data: [
                {
                  name: "",
                  value: [],
                  label: {
                    show: true,
                    formatter: function (params) {
                      return params.value;
                    },
                  },
                  areaStyle: {
                    color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
                      {
                        color: "#6551FF52",
                        offset: 0,
                      },
                      {
                        color: "#6551FF00",
                        offset: 1,
                      },
                    ]),
                  },
                },
              ],
            },
          ],
        },
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
289
        natureList: [],
ab9848ab   yangzhi   简历界面
290
291
        abilityList: [],
        user: {},
4ebb3d66   yangzhi   简历界面
292
293
      };
    },
ab9848ab   yangzhi   简历界面
294
    computed: {
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
295
      abilityEchart1VisibleComputed(){
8f16b6df   yangzhi   超哥坑我千百遍 我待超哥如初恋
296
        return this.natureList.reduce((total,item)=>{
242501d3   yangzhi   刚才没改好 我是个憨批
297
          console.log(total,item);
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
298
299
300
301
          return total + item.value;
        },0)>0;
      },
      abilityEchart2VisibleComputed(){
8f16b6df   yangzhi   超哥坑我千百遍 我待超哥如初恋
302
        return this.natureList.length>6 && this.natureList.slice(6).reduce((total,item)=>{
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
303
304
305
306
          return total + item.value;
        },0)>0;
      },
      natureEchartVisibleComputed(){
242501d3   yangzhi   刚才没改好 我是个憨批
307
        console.log('natureEchartVisibleComputed this.natureList',this.natureList);
8f16b6df   yangzhi   超哥坑我千百遍 我待超哥如初恋
308
        let total = this.abilityList.reduce((total,item)=>{
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
309
          return total + item.value;
242501d3   yangzhi   刚才没改好 我是个憨批
310
        },0);
242501d3   yangzhi   刚才没改好 我是个憨批
311
        return total>0;
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
312
      },
cbff938b   yangzhi   超哥牛批
313
      userDetail() {
709bad86   yangzhi   兼容工作经历的数据
314
315
316
317
318
        let user = {...this.user};
        user.educationalExperience = JSON.parse(user.educationalExperience || '[]');
        user.skillAdvantages = JSON.parse(user.skillAdvantages || '[]')
        user.workExperience = JSON.parse(user.workExperience || '[]')
        return user;
ab9848ab   yangzhi   简历界面
319
      },
cbff938b   yangzhi   超哥牛批
320
321
      infoListComputed() {
        let user = { ...this.user };
ab9848ab   yangzhi   简历界面
322
        let infoList = [...this.infoList];
cbff938b   yangzhi   超哥牛批
323
324
325
326
327
328
329
330
331
332
333
        infoList.find((t) => t.title == "民族").value = user.minzu;
        infoList.find((t) => t.title == "体重").value = user.Weight;
        infoList.find((t) => t.title == "身高").value = user.Height;
        infoList.find((t) => t.title == "血型").value = user.BloodType;
        infoList.find((t) => t.title == "年龄").value = user.age;
        infoList.find((t) => t.title == "婚否").value = user.Marriage;
        infoList.find((t) => t.title == "政治面貌").value = user.PoliticalOutlook;
        infoList.find((t) => t.title == "户籍所在地").value =
          user.RegisteredResidence;
        return infoList;
      },
ab9848ab   yangzhi   简历界面
334
335
336
337
338
339
    },
    created() {
      this.id = this.$route.query.id;
    },
    mounted() {
      this.init();
97c13b13   yangzhi   简历分析样式修改
340
      this.initRem();
ab9848ab   yangzhi   简历界面
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
    },
    methods: {
      init() {
        getOuterUserInfo(this.id).then((res) => {
          let { nature, ability, user } = res.data;
          let natureList = [];
  
          nature = nature[0];
          ability = ability[0];
  
          for (const key in nature) {
            const val = nature[key];
            natureList.push({
              title: key,
              value: val,
            });
          }
          let abilityList = [];
          for (const key in ability) {
            const val = ability[key];
            abilityList.push({
              title: key,
              value: val,
            });
          }
  
          this.natureList = natureList;
242501d3   yangzhi   刚才没改好 我是个憨批
368
          this.abilityList = abilityList;
ab9848ab   yangzhi   简历界面
369
370
          this.user = user;
          this.$nextTick(() => {
8f16b6df   yangzhi   超哥坑我千百遍 我待超哥如初恋
371
372
            this.initNengliEchart(natureList);
            this.initXinggeEchart(abilityList);
ab9848ab   yangzhi   简历界面
373
374
375
          });
        });
      },
ab9848ab   yangzhi   简历界面
376
      initXinggeEchart(list) {
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
377
378
379
380
381
382
        let dom = document.getElementById("echarts3");
        if(!dom){
          return;
        }
        let myChart = echarts.init(dom);
        if(myChart)
ab9848ab   yangzhi   简历界面
383
384
385
386
387
        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);
ab9848ab   yangzhi   简历界面
388
389
      },
      initNengliEchart(list) {
242501d3   yangzhi   刚才没改好 我是个憨批
390
        console.log('initNengliEchart',list);
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
391
392
393
394
        let dom = document.getElementById("echarts1");
        if(!dom){
          return;
        }
ab9848ab   yangzhi   简历界面
395
        //第一个echart图
6fb7bd31   yangzhi   【优化】能力统计图如果没有数据就不显示
396
        let myChart = echarts.init(dom);
ab9848ab   yangzhi   简历界面
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
        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);
        this.echartOption1.series[1].data = list1.map((t) => t.value);
        myChart.setOption(this.echartOption1);
  
        //第二个图
        if (list.length > 6) {
          let myChart2 = echarts.init(document.getElementById("echarts2"));
          let list2 = list.slice(6);
          this.echartOption2.xAxis[0].data = list2.map((t) => t.title);
          this.echartOption2.series[0].data = list2.map((t) => t.value);
          this.echartOption2.series[1].data = list2.map((t) => t.value);
          myChart2.setOption(this.echartOption2);
        }
      },
    },
4ebb3d66   yangzhi   简历界面
414
415
416
  };
  </script>
  <style lang="scss" scoped>
ab9848ab   yangzhi   简历界面
417
  @import "style/style.scss";
4ebb3d66   yangzhi   简历界面
418
  </style>