Blame view

src/views/dashboard/index.vue 13.5 KB
b89c8760   wangming   项目初始化
1
  <template>
de382ae8   yangzhi   首页修改
2
3
4
5
6
7
8
9
10
11
    <div class="dashboard-container">
      <div class="left-container">
        <div class="panel">
          <div class="panel-title">学历分布</div>
          <div class="panel-body">
            <div class="echart-box" style="height: 35vh" id="echart1"></div>
          </div>
        </div>
        <div class="panel">
          <div class="panel-body">
ed88fd8e   yangzhi   首页数据对接
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
            <el-calendar v-model="currentDate" style="height: 35vh">
              <template slot="dateCell" slot-scope="{ date, data }">
                <p :class="data.isSelected ? 'is-selected' : ''">
                  <el-popover
                    v-if="hasInvitationComputed(date, data).length"
                    placement="top-start"
                    title="今日面试"
                    width="350"
                    trigger="hover"
                  >
                    <ul class="popover-list">
                      <li
                        v-for="invitation in hasInvitationComputed(date, data)"
                        :key="invitation.id"
                      >
                        <span style="min-width: 3em">{{
                          invitation.qujian
                        }}</span>
                        <span style="min-width: 4em">{{
                          invitation.fullName
                        }}</span>
                        <span style="min-width: 7em">{{ invitation.phone }}</span>
4ebb3d66   yangzhi   简历界面
34
35
36
                        <span style="min-width: 4em">{{
                          invitation.processName
                        }}</span>
ed88fd8e   yangzhi   首页数据对接
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
                      </li>
                    </ul>
                    <el-badge
                      slot="reference"
                      :value="hasInvitationComputed(date, data).length"
                      class="item"
                      type="primary"
                    >
                      <span>{{ data.day.split("-")[2] }} </span>
                    </el-badge>
                  </el-popover>
  
                  <span v-else>{{ data.day.split("-")[2] }} </span>
                </p>
              </template>
            </el-calendar>
de382ae8   yangzhi   首页修改
53
54
55
56
57
58
59
60
61
62
63
          </div>
        </div>
        <div class="panel">
          <div class="panel-title">面试进度</div>
          <div class="panel-body">
            <div id="echart2" style="height: 35vh"></div>
          </div>
        </div>
        <div class="panel">
          <div class="panel-title">当日面试</div>
          <div class="panel-body">
ed88fd8e   yangzhi   首页数据对接
64
            <el-table :data="toDayInterviewUsers" :show-header="false">
4ebb3d66   yangzhi   简历界面
65
66
              <el-table-column>
                <template slot-scope="{ row }">
de382ae8   yangzhi   首页修改
67
                  <div class="table-td-list">
4ebb3d66   yangzhi   简历界面
68
                    <span>{{ row.fullName }}</span>
ed88fd8e   yangzhi   首页数据对接
69
                    <span>{{ row.sex }}</span>
de382ae8   yangzhi   首页修改
70
71
72
73
                    <span>32</span>
                  </div>
                </template>
              </el-table-column>
ed88fd8e   yangzhi   首页数据对接
74
              <el-table-column>
4ebb3d66   yangzhi   简历界面
75
                <template slot-scope="{ row }">
de382ae8   yangzhi   首页修改
76
                  <div class="table-td-list">
ed88fd8e   yangzhi   首页数据对接
77
78
79
                    <span>{{ row.byyx }}</span>
                    <span>{{ row.zhuanye }}</span>
                    <span>{{ row.xueli }}</span>
de382ae8   yangzhi   首页修改
80
81
82
83
                  </div>
                </template>
              </el-table-column>
              <el-table-column>
4ebb3d66   yangzhi   简历界面
84
85
86
87
88
                <template slot-scope="{ row }">
                  <span>{{
                    row.AnswerTime | dateTimeFilter("yyyy/MM/dd HH:mm")
                  }}</span>
                </template>
de382ae8   yangzhi   首页修改
89
              </el-table-column>
4ebb3d66   yangzhi   简历界面
90
              <el-table-column prop="testpaper"> </el-table-column>
de382ae8   yangzhi   首页修改
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
            </el-table>
          </div>
        </div>
      </div>
      <div class="right-container">
        <ul class="sta-list">
          <li v-for="item in staList" :key="item.title">
            <div style="justify-content: flex-start">
              <img
                style="height: 20px; margin-right: 10px"
                :src="item.icon"
                alt=""
              />
              <span class="sub-title">{{ item.title }}</span>
            </div>
            <div>
              <h3>{{ item.count }}</h3>
              <img
                src="/static/images/index/icon9.png"
                style="height: 30px"
                alt=""
              />
            </div>
          </li>
        </ul>
      </div>
    </div>
b89c8760   wangming   项目初始化
118
119
120
  </template>
  
  <script>
de382ae8   yangzhi   首页修改
121
122
123
  import { GetQuestionTotal, GetTestPaperTotal } from "@/api/index";
  import { OrderGetPriceNumber } from "@/api/order.js";
  import { mapGetters } from "vuex";
ed88fd8e   yangzhi   首页数据对接
124
125
126
127
128
129
130
  import { GetUserList, GetCompanyInvitation } from "@/api/user";
  
  import {
    GetEducationalBackgroundDistribution,
    GetInterviewProgress,
    GetSameDayInterview,
  } from "@/api/dashboard";
de382ae8   yangzhi   首页修改
131
132
133
134
135
136
137
138
139
  
  import { GetInfo } from "@/api/setting";
  
  import * as echarts from "echarts";
  
  export default {
    data() {
      return {
        currentDate: new Date(),
ed88fd8e   yangzhi   首页数据对接
140
141
142
  
        invitationList: [], //面试邀请
  
de382ae8   yangzhi   首页修改
143
144
145
        staList: [
          {
            title: "入库/人",
4ebb3d66   yangzhi   简历界面
146
            val: "入库",
ed88fd8e   yangzhi   首页数据对接
147
            count: 0,
de382ae8   yangzhi   首页修改
148
149
150
151
            icon: "/static/images/index/icon1.png",
          },
          {
            title: "面试邀请/人",
4ebb3d66   yangzhi   简历界面
152
            val: "面试邀请",
ed88fd8e   yangzhi   首页数据对接
153
            count: 0,
de382ae8   yangzhi   首页修改
154
155
156
157
            icon: "/static/images/index/icon2.png",
          },
          {
            title: "正在面试/人",
4ebb3d66   yangzhi   简历界面
158
            val: "未完成面试",
ed88fd8e   yangzhi   首页数据对接
159
            count: 0,
de382ae8   yangzhi   首页修改
160
161
162
163
            icon: "/static/images/index/icon3.png",
          },
          {
            title: "面试完成/人",
4ebb3d66   yangzhi   简历界面
164
            val: "面试完成",
ed88fd8e   yangzhi   首页数据对接
165
            count: 0,
de382ae8   yangzhi   首页修改
166
167
168
169
            icon: "/static/images/index/icon4.png",
          },
          {
            title: "线下面试/人",
4ebb3d66   yangzhi   简历界面
170
            val: "线下面试",
ed88fd8e   yangzhi   首页数据对接
171
            count: 0,
de382ae8   yangzhi   首页修改
172
173
174
175
            icon: "/static/images/index/icon5.png",
          },
          {
            title: "已录用/人",
4ebb3d66   yangzhi   简历界面
176
            val: "已录用",
ed88fd8e   yangzhi   首页数据对接
177
            count: 0,
de382ae8   yangzhi   首页修改
178
179
180
181
            icon: "/static/images/index/icon6.png",
          },
          {
            title: "未录用/人",
4ebb3d66   yangzhi   简历界面
182
            val: "未录用",
ed88fd8e   yangzhi   首页数据对接
183
            count: 0,
de382ae8   yangzhi   首页修改
184
185
            icon: "/static/images/index/icon7.png",
          },
4ebb3d66   yangzhi   简历界面
186
187
188
189
190
191
          {
            title: "禁用/人",
            val: "禁用",
            count: 0,
            icon: "/static/images/index/icon8.png",
          },
de382ae8   yangzhi   首页修改
192
        ],
de382ae8   yangzhi   首页修改
193
194
195
196
        echartOption1: {
          legend: {
            top: "bottom",
          },
ed88fd8e   yangzhi   首页数据对接
197
198
199
          tooltip: {
            trigger: "item",
          },
de382ae8   yangzhi   首页修改
200
201
202
203
204
205
          series: [
            {
              name: "学历分布",
              type: "pie",
              radius: [0, "80%"],
              center: ["50%", "50%"],
ed88fd8e   yangzhi   首页数据对接
206
207
              // roseType: "area",
              data: [],
de382ae8   yangzhi   首页修改
208
209
210
211
212
213
214
215
216
217
218
219
220
            },
          ],
        },
        echartOption2: {
          grid: {
            top: 20,
            bottom: 40,
          },
          tooltip: {},
          xAxis: {
            type: "category",
            axisLabel: {
              color: "#999999",
4ebb3d66   yangzhi   简历界面
221
              interval: 0,
de382ae8   yangzhi   首页修改
222
223
              fontSize: 16,
            },
4ebb3d66   yangzhi   简历界面
224
            data: [],
de382ae8   yangzhi   首页修改
225
226
227
228
229
230
          },
          yAxis: {
            type: "value",
          },
          series: [
            {
ed88fd8e   yangzhi   首页数据对接
231
              data: [],
de382ae8   yangzhi   首页修改
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
              type: "bar",
              label: {
                show: true,
                color: "#4e95ff",
                position: "top",
                formatter: "{c}人",
              },
              itemStyle: {
                normal: {
                  color: "#4e95ff",
                  barBorderRadius: [10, 10, 0, 0],
                },
              },
            },
          ],
        },
  
4ebb3d66   yangzhi   简历界面
249
250
        //当日面试
        toDayInterviewUsers: [],
ed88fd8e   yangzhi   首页数据对接
251
  
de382ae8   yangzhi   首页修改
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
        isAdmin: false,
        imageUrl: "",
        total: {
          questiontotal: 0,
          testpapertotal: 0,
          PriceNumber: 0,
          Count: 0,
        },
        query: {
          UserTypeEnum: 1, //0:管理员,1普通用户
          PageIndex: 1,
          PageSize: 10,
        },
      };
    },
    computed: {
      ...mapGetters(["name"]),
ed88fd8e   yangzhi   首页数据对接
269
270
271
272
273
274
275
276
277
278
279
      hasInvitationComputed() {
        return (date, data) => {
          if (!this.invitationList.length) {
            return [];
          }
          return this.invitationList.filter((t) => t.startTime == data.day);
        };
      },
    },
    created() {
      this.initInvitations();
4ebb3d66   yangzhi   简历界面
280
      this.initToDayInterviewUsers();
de382ae8   yangzhi   首页修改
281
    },
de382ae8   yangzhi   首页修改
282
283
284
285
286
287
288
289
    mounted() {
      try {
        if (this.$store.state.user.userInfo.UserType == 0) this.isAdmin = true;
      } catch {}
      this.init();
      this.GetTotalHeadler();
    },
    methods: {
4ebb3d66   yangzhi   简历界面
290
291
292
293
294
      initToDayInterviewUsers() {
        GetSameDayInterview().then((res) => {
          this.toDayInterviewUsers = res.data;
        });
      },
ed88fd8e   yangzhi   首页数据对接
295
296
297
298
299
300
301
302
303
      initInvitations() {
        GetCompanyInvitation({
          PageIndex: 1,
          PageSize: 10000,
        }).then((res) => {
          console.log("GetCompanyInvitation", res);
          this.invitationList = res.data.data.list;
        });
      },
de382ae8   yangzhi   首页修改
304
305
306
307
308
309
      initEchart() {
        this.initEchartXueli();
        this.initEchartJindu();
      },
      initEchartXueli() {
        let myChart = echarts.init(document.getElementById("echart1"));
ed88fd8e   yangzhi   首页数据对接
310
311
312
313
314
315
316
317
318
319
320
321
322
323
        GetEducationalBackgroundDistribution().then((res) => {
          console.log("GetEducationalBackgroundDistribution", res);
          let list = res.data.map((t) => {
            t.name = !t.name ? "未知" : t.name;
            return t;
          });
          this.echartOption1.series[0].data = list.map((t) => {
            return {
              name: t.name,
              value: t.count,
            };
          });
          myChart.setOption(this.echartOption1);
        });
de382ae8   yangzhi   首页修改
324
325
326
      },
      initEchartJindu() {
        let myChart = echarts.init(document.getElementById("echart2"));
ed88fd8e   yangzhi   首页数据对接
327
328
        GetInterviewProgress().then((res) => {
          console.log("GetInterviewProgress", res);
4ebb3d66   yangzhi   简历界面
329
          let list = res.data;
ed88fd8e   yangzhi   首页数据对接
330
331
332
333
334
335
          this.echartOption2.series[0].data = list.map((t) => {
            return {
              name: t.name,
              value: t.count,
            };
          });
4ebb3d66   yangzhi   简历界面
336
337
          this.echartOption2.xAxis.data = list.map((t) => t.name);
          myChart.setOption(this.echartOption2);
ed88fd8e   yangzhi   首页数据对接
338
  
4ebb3d66   yangzhi   简历界面
339
340
341
342
343
344
345
          //右边统计数据
          list.forEach((item) => {
            let index = this.staList.findIndex((t) => t.val == item.name);
            if (index) {
              this.staList[index].count = item.count;
            }
          });
ed88fd8e   yangzhi   首页数据对接
346
        });
de382ae8   yangzhi   首页修改
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
      },
      init() {
        var _this = this;
        GetInfo(1).then((res) => {
          var d = res.data;
          if (d && d.data) {
            if (d.data.home_images) {
              _this.imageUrl = _this.BASE_URL + d.data.home_images;
            }
          }
        });
        this.initEchart();
      },
      GetTotalHeadler() {
        GetQuestionTotal().then((res) => {
          this.total.questiontotal = res.data.data;
        });
        GetTestPaperTotal().then((res) => {
          this.total.testpapertotal = res.data.data;
        });
        OrderGetPriceNumber().then((res) => {
          this.total.PriceNumber = res.data.data;
        });
        GetUserList(this.query).then((res) => {
          this.total.Count = res.data.data.total;
        });
      },
    },
  };
b89c8760   wangming   项目初始化
376
377
  </script>
  
de382ae8   yangzhi   首页修改
378
  <style scoped>
ed88fd8e   yangzhi   首页数据对接
379
380
  >>> .el-calendar-table td.next {
    display: none;
de382ae8   yangzhi   首页修改
381
  }
ed88fd8e   yangzhi   首页数据对接
382
383
384
385
386
  >>> .el-calendar-day {
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
de382ae8   yangzhi   首页修改
387
  }
ed88fd8e   yangzhi   首页数据对接
388
389
390
391
392
393
  >>> .el-calendar-day p {
    margin: 0;
    text-align: center;
    height: 40px;
    width: 40px;
    line-height: 40px;
de382ae8   yangzhi   首页修改
394
  }
ed88fd8e   yangzhi   首页数据对接
395
396
  >>> .el-calendar-table .el-calendar-day:hover {
    background-color: transparent;
de382ae8   yangzhi   首页修改
397
  }
ed88fd8e   yangzhi   首页数据对接
398
399
400
  >>> .el-calendar-table .el-calendar-day:hover p {
    background-color: #f2f8fe;
    border-radius: 30%;
de382ae8   yangzhi   首页修改
401
  }
ed88fd8e   yangzhi   首页数据对接
402
403
  >>> .el-calendar-table td.is-selected {
    background-color: transparent;
de382ae8   yangzhi   首页修改
404
  }
ed88fd8e   yangzhi   首页数据对接
405
406
407
  >>> .el-calendar-table td.is-selected .el-calendar-day p {
    background-color: #f2f8fe;
    border-radius: 30%;
de382ae8   yangzhi   首页修改
408
  }
ed88fd8e   yangzhi   首页数据对接
409
410
411
412
  >>> .el-calendar-table td.is-today .el-calendar-day p {
    color: #fff;
    background-color: #409eff;
    border-radius: 30%;
de382ae8   yangzhi   首页修改
413
  }
ed88fd8e   yangzhi   首页数据对接
414
415
  >>> .el-calendar-table td {
    border: none;
de382ae8   yangzhi   首页修改
416
  }
ed88fd8e   yangzhi   首页数据对接
417
418
  >>> .el-calendar-table tr td:first-child {
    border-left: none;
de382ae8   yangzhi   首页修改
419
  }
ed88fd8e   yangzhi   首页数据对接
420
421
  >>> .el-calendar-table tr:first-child td {
    border: none;
de382ae8   yangzhi   首页修改
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
  }
  </style>
  <style lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }
  
    &-text {
      font-size: 30px;
      line-height: 46px;
    }
  }
  
  .el-row {
    margin-bottom: 20px;
    margin-top: 20px;
  
    &:last-child {
      margin-bottom: 0;
    }
  }
  
  .el-col {
    border-radius: 5px;
  }
  
  .bg-purple-dark {
    background: #99a9bf;
  }
  
  .bg-purple {
    background: #d3dce6;
    box-shadow: 0 0 10px #cdcdcd;
  }
  
  .bg-purple-light {
    background: #e5e9f2;
  }
  
  .grid-content {
    border-radius: 5px;
    min-height: 36px;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
  
    .grid-content-number {
      font-size: 40px;
      color: red;
    }
  
    div {
      font-size: 20px;
      margin-top: 10px;
    }
  }
  
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
  </style>
b89c8760   wangming   项目初始化
485
  <style lang="scss" scoped>
ed88fd8e   yangzhi   首页数据对接
486
487
488
489
490
491
492
493
494
495
496
497
498
499
  .popover-list {
    padding-left: 10px;
    li {
      list-style: none;
      height: 40px;
      line-height: 40px;
      display: flex;
      align-items: center;
      border-top: 1px dashed #eaeaea;
      span {
        margin-right: 10px;
      }
    }
  }
de382ae8   yangzhi   首页修改
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
  .table-td-list {
    display: flex;
    align-items: center;
    span {
      margin-right: 10px;
    }
  }
  .dashboard-container {
    display: flex;
    justify-content: space-between;
    background-color: #f9f9f9;
    margin: 0;
    padding: 20px;
  }
  .left-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    .panel {
      width: 49%;
      flex: none;
    }
  }
  .right-container {
  }
  .panel {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    margin-bottom: 20px;
    .panel-title {
      height: 3em;
      line-height: 3em;
      font-size: 18px;
      font-weight: bold;
    }
  }
  .sta-list {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    width: 200px;
    flex: none;
    margin: 0;
    li {
      list-style: none;
      background-color: #fff;
      border: 10px;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      padding: 15px 15px 5px;
      margin-bottom: 20px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 9vh;
      .sub-title {
        color: #999;
      }
      & > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      h3 {
        margin: 0;
      }
    }
  }
b32564ca   周超   11
571
  </style>