1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
| <template>
| <div class="page">
| <div class="page-header">
| <p>王永炎院士学生目录</p>
| </div>
| <div class="page-main-father">
| <div class="page-main-title">
| <p
| @click="changeTab('chart')"
| :class="[activeTabs == 'chart' ? 'active-tab' : '']"
| >
| <img
| :src="[activeTabs == 'chart' ? chartIcon : noChartIcon]"
| alt=""
| />
| <span>图表显示</span>
| </p>
| <p
| @click="changeTab('list')"
| :class="[activeTabs == 'list' ? 'active-tab' : '']"
| >
| <img :src="[activeTabs == 'list' ? listIcon : noListIcon]" alt="" />
| <span>列表显示</span>
| </p>
| </div>
| <!-- 图表显示 -->
| <div class="charts-main" v-if="activeTabs == 'chart'">
| <div class="radial-tree-container">
| <div ref="chart" style="width: 100%; height: 70vh"></div>
| </div>
|
| <div class="legend">
| <div class="tagItem" v-for="(item, index) in legendList" :key="index">
| <div class="tagColor" :style="{ background: item.color }"></div>
| <div class="tagText" :style="{ color: item.color }">
| {{ item.name }}
| </div>
| </div>
| </div>
| <transition name="el-fade-in-linear">
| <div class="tooltipBox" v-show="tooltipShow">
| <div
| style="
| padding: 10px;
| background: #fdf8f0;
| border-radius: 5px;
| width: 100%;
| max-height: 500px;
| text-align: center;
| "
| >
| <div class="closeBtn" @click="tooltipShow = false">
| <i class="el-icon-close"></i>
| </div>
| <div style="display: flex">
| <div
| style="
| width: 80px;
| height: 80px;
| position: relative;
| margin-bottom: 10px;
| background: #d8d8d8;
| "
| >
| <img
| class="autoImg"
| src="@/assets/images/directory/touxiang.png"
| alt=""
| />
| </div>
| <div
| style="padding-top: 20px; text-align: left; margin-left: 20px"
| >
| <div
| style="
| font-size: 16px;
| font-weight: bold;
| margin-bottom: 5px;
| "
| >
| {{ currentNodeInfo.name }}
| </div>
| <div style="margin-top: 20px">
| <span> 男 </span> <span> 硕士 </span>
| <span> 北京中医药大学 </span>
| </div>
| </div>
| </div>
|
| <div
| style="
| font-size: 16px;
| font-weight: bold;
| margin-bottom: 5px;
| text-align: left;
| margin-top: 10px;
| "
| >
| <p style="margin-bottom: 15px">学习时间:1985.09 -1988.07</p>
| <p style="margin-bottom: 15px">
| 现工作单位:北京中医药大学东方医院
| </p>
| <p style="margin-bottom: 15px">职务:原院长</p>
| <p style="margin-bottom: 15px">职称:主任医师、教授</p>
| </div>
| <div style="text-align: left; line-height: 22px">
| <p>
| 大弦嘈嘈如急雨,小弦切切如私语。嘈嘈切切错杂弹,大珠小珠落玉盘。间关莺语花底滑,幽咽泉流冰下难。冰泉冷涩弦凝绝,凝绝不通声暂歇。别有幽愁暗恨生,此时无声胜有声。银瓶乍破水浆迸,铁骑突出刀枪鸣。曲终收拨当心画,四弦一声如裂帛。东船西舫悄无言,唯见江心秋月白。
| </p>
| </div>
| <div
| style="
| display: flex;
| justify-content: space-between;
| margin-top: 20px;
| "
| >
| <div style="text-align: left; width: 48%; line-height: 22px">
| <p>
| 观夫明堂之宏壮也,则突兀瞳曨,乍明乍蒙,若大古元气之结空。巃嵸颓沓,若嵬若嶪,似天阃地门之开阖。尔乃划岝峉以岳立,郁穹崇而鸿纷。冠百王而垂勋,烛万象而腾文。窙惚恍以洞启,呼嵌岩而傍分。又比乎昆山之天柱,矗九霄而垂云。
| </p>
| </div>
| <div>
| <img src="@/assets/images/directory/test.png" alt="" />
| </div>
| </div>
| </div>
| </div>
| </transition>
| </div>
| <!-- 列表显示 -->
| <div class="page-main" v-if="activeTabs == 'list'">
| <div v-for="(item, index) in universityList" :key="index">
| <div
| class="table-title"
| v-if="item.studentList && item.studentList.length > 0"
| >
| <div class="table-title-left">
| <p class="table-title-name">{{ item.name }}</p>
| <p class="table-title-degree">{{ item.degree }}</p>
| <p class="table-title-number">{{ item.studentList.length }}人</p>
| </div>
| <div class="table-title-right" @click="item.isShow = !item.isShow">
| <img :src="[item.isShow ? topIcon : bottomIcon]" alt="" />
| </div>
| </div>
| <table
| cellpadding="100"
| v-if="
| item.studentList && item.studentList.length > 0 && item.isShow
| "
| >
| <tr class="table-heading">
| <th>姓名</th>
| <th>性别</th>
| <th>学习时间</th>
| <th>工作单位(到二级单位全称)</th>
| <th>职务</th>
| <th>职称</th>
| </tr>
| <tr v-for="(citem, cindex) in item.studentList" :key="cindex">
| <td>
| {{ citem.studentName }}
| </td>
| <td>
| {{ citem.gender }}
| </td>
| <td>{{ citem.studyTime }}</td>
| <td>{{ citem.workUnit }}</td>
| <td>{{ citem.position }}</td>
| <td>{{ citem.title }}</td>
| </tr>
| </table>
| </div>
| </div>
| </div>
| </div>
| </template>
|
| <script>
| import * as echarts from "echarts";
| import axios from "axios";
| import debounce from "lodash/debounce";
| import treeData from "./treeData.json";
| import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js'
| export default {
| data() {
| return {
| chartIcon: require("@/assets/images/directory/chartIcon.png"),
| noChartIcon: require("@/assets/images/directory/noChartIcon.png"),
| listIcon: require("@/assets/images/directory/listIcon.png"),
| noListIcon: require("@/assets/images/directory/noListIcon.png"),
| topIcon: require("@/assets/images/directory/topIcon.png"),
| bottomIcon: require("@/assets/images/directory/bottomIcon.png"),
| activeTabs: "chart",
|
| universityList: [
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| ],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| ],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| ],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| ],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [],
| },
| {
| name: "北京中医药大学",
| degree: "硕士",
| isShow: "true",
| studentList: [
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| {
| studentName: "王玉来",
| gender: "男",
| studyTime: "1985.09-1988.07",
| workUnit: "北京中医药大学东方学院",
| position: "原院长",
| title: "主任医师、教授",
| },
| ],
| },
| ],
| chart: null,
| chartData: treeData,
| currentNodeInfo: {},
| tooltipShow: false,
| legendList: [
| {
| color: "#87A7B9",
| name: "北京中医大学",
| },
| {
| color: "#C48787",
| name: "北京师范大学",
| },
| {
| color: "#6F8F5A",
| name: "中国中医科学院",
| },
| {
| color: "#937950",
| name: "广州中医药大学",
| },
| {
| color: "#8D77B3",
| name: "拜师弟子",
| },
| ],
| };
| },
|
| mounted() {
| this.initChart();
| this.getStudentList()
| window.addEventListener("resize", this.handleResize);
| },
| beforeDestroy() {
| window.removeEventListener("resize", this.handleResize);
| if (this.chart) {
| this.chart.dispose();
| }
| },
| methods: {
| changeTab(key) {
| this.activeTabs = key;
| console.log(this.activeTabs, "activeTabs");
| if (key == "chart") {
| this.$nextTick(() => {
| this.initChart();
| window.addEventListener("resize", this.handleResize);
| });
| }
| },
| initChart() {
| this.chart = echarts.init(this.$refs.chart);
| const option = {
| tooltip: {
| trigger: "item",
| triggerOn: "mousemove",
| backgroundColor: "#FDF8F0",
| formatter: (params) => {
| const data = params.data;
| this.currentNodeInfo = data;
| return `
| <div style="
| padding: 10px;
| background: #FDF8F0;
| border-radius: 5px;
| max-width: 300px;
| width: 360px;
| text-align: center;
| ">
| <div style="width: 80px;height: 80px;position: relative; margin: 0 auto; margin-bottom: 10px;background: #D8D8D8;">
| <img class="autoImg" src="${require("@/assets/images/directory/touxiang.png")}" alt="">
| </div>
| <div style="font-size: 16px; font-weight: bold; margin-bottom: 5px;">${
| data.name
| }</div>
| <div> <span> 男 </span> <span> 硕士 </span> <span> 北京中医药大学 </span></div>
| <div style="font-size: 16px; font-weight: bold; margin-bottom: 5px;text-align: left;margin-top: 10px;">
| <p style="margin-bottom: 5px;">学习时间:1985.09 -1988.07</p>
| <p style="margin-bottom: 5px;">现工作单位:北京中医药大学东方医院</p>
| <p style="margin-bottom: 5px;">职务:原院长</p>
| <p style="margin-bottom: 5px;">职称:主任医师、教授</p>
| </div>
|
| </div>
| `;
| },
| },
| textStyle: {
| color: "#bc1c00", // 设置整体字体颜色为红色
| },
| edgeLabel: {
| normal: {
| color: "#bc1c00", // 设置线条的颜色为红色
| },
| },
| series: [
| {
| type: "tree",
| data: [this.chartData],
| top: "10%",
| bottom: "10%",
| layout: "radial",
| symbol: "circle",
| symbolSize: 7,
| initialTreeDepth: 3, // 展开所有节点
| animationDurationUpdate: 750,
| emphasis: {
| focus: "descendant",
| },
|
| label: {
| position: "top", //标签的位置。
| verticalAlign: "middle", //文字垂直对齐方式,默认自动。
| fontSize: 12, //文字的字体大小
| color: "#bc1c00",
| },
| // leaves: {
| // symbol: "emptyCircle",
| // label: {
| // fontSize: 12,
| // },
| // },
| expandAndCollapse: false,
| lineStyle: {
| color: "#bc1c00",
| width: 1,
| },
| itemStyle: {
| color: function (params) {
| return "green";
| },
| },
| roam: true,
| center: ["5%", "0%"], // 微调垂直居中
| radius: "100%", // 增大半径占比
| nodePadding: 120,
| },
| ],
| };
|
| this.chart.setOption(option);
| this.chart.on("click", (params) => {
| console.log("点击时的回调", params);
| this.tooltipShow = true;
| });
| },
| handleResize() {
| if (this.chart) {
| this.chart.resize();
| }
| },
| // 获取列表显示
| getStudentList() {
| this.loading = true;
| MG.resource.getItem({
| path: "WYY_student",
| fields: {
| // 性别
| gender:"",
| //学习时间
| studyTime: [],
| // 单位
| unit:[],
| // 现工作单位(到二级单位全称)
| currentEmployer_secondary:"",
| //职务
| jobTitle:"",
| //学位
| academicDegree:"",
| // 学生简介
| studentProfile:"",
| },
| paging: {
| // start: (this.currentPage - 1) * 10,
| size: 99999,
| },
| // coverSize: {
| // height: 70
| // }
| }).then((res) => {
| console.log(res, "res");
| if (res.datas && res.datas.length) {
| this.honorList = res.datas.map(item => {
| // 将 year 字段格式化为 "2017年9月" 这种格式
| const date = new Date(item.year);
| const year = date.getFullYear();
| const month = date.getMonth() + 1; // 月份从0开始,需要加1
| return {
| ...item,
| year: `${year}年${month}月`
| };
| });
| this.total = res.total;
| this.loading = false;
| }
| }).catch((error) => {
| console.error('获取荣誉失败:', error);
| });
| },
|
| },
| };
| </script>
|
| <style lang="less" scoped>
| .page {
| width: 100%;
| height: 100vh;
| box-sizing: border-box;
| background-color: #e9e1d4;
| position: relative;
| overflow: hidden;
| }
|
| .page-header {
| height: 9.4vh;
| width: 100%;
| text-align: left;
| border-bottom: 2px solid #937950;
| background-color: #e9e1d4;
| position: sticky;
| top: 0;
| z-index: 10;
| p {
| padding: 1.6% 0 1.55% 0;
| font-family: Alimama DongFangDaKai;
| font-size: 30px;
| text-indent: 1em;
| border-bottom: 1px solid #937950;
| }
| }
|
| .page-main-father {
| height: calc(100% - 9.4%);
| width: 100%;
| overflow: auto;
| }
|
| .page-main-title {
| display: flex;
| align-items: center;
| justify-content: center;
| cursor: pointer;
| margin-bottom: 75px;
| color: #9e9e9e;
| margin-top: 1%;
|
| p {
| display: flex;
| align-items: center;
| padding: 15.5px 20px;
| border-bottom: 2px solid #9e9e9e;
| }
|
| img {
| width: 24px;
| height: auto;
| margin-right: 10px;
| }
|
| span {
| font-family: Source Han Sans;
| font-size: 24px;
| font-weight: bold;
| }
| }
|
| .active-tab {
| color: #937950 !important;
| border-bottom: 2px solid #937950 !important;
| }
|
| .page-main {
| width: 77.3%;
| margin: 0 auto;
| overflow: hidden;
| margin-bottom: 100px;
|
| table {
| width: 100%;
| border-collapse: collapse;
| }
|
| tr {
| background-color: #fff;
| background-clip: padding-box;
| border-bottom: 2px solid transparent;
| }
|
| th {
| font-family: Source Han Serif CN;
| font-size: 14px;
| font-weight: bold;
| padding: 4px 41px;
| }
|
| td {
| font-family: Source Han Serif CN;
| font-size: 14px;
| padding: 6px 41px;
| text-align: center;
| }
|
| tr:last-child td {
| border-bottom: none;
| /* 移除最后一行的下边框 */
| }
| }
|
| .charts-main {
| // background-color: #000;
| position: relative;
| }
|
| .table-title {
| display: flex;
| align-items: center;
| justify-content: space-between;
| padding: 10px 28px;
| background-color: #d8cbb6;
| margin-bottom: 4px;
| margin-top: 2px;
|
| .table-title-left {
| display: flex;
| align-items: center;
| }
|
| .table-title-name {
| width: 200px;
| overflow: hidden;
| font-family: Source Han Serif CN;
| font-size: 18px;
| font-weight: bold;
| }
|
| .table-title-degree {
| font-family: Source Han Serif CN;
| font-size: 14px;
| font-weight: bold;
| margin-right: 40px;
| }
|
| .table-title-number {
| font-family: Source Han Serif CN;
| font-size: 14px;
| font-weight: bold;
| }
|
| .table-title-right {
| cursor: pointer;
| }
|
| img {
| width: 20px;
| height: auto;
| }
| }
| .tooltipBox {
| max-height: 500px;
| max-width: 500px;
| background-color: #fdf8f0;
| position: absolute;
| right: 40px;
| top: 12vh;
| }
| .closeBtn {
| position: absolute;
| top: 10px;
| right: 0;
| cursor: pointer;
| }
| .legend {
| position: absolute;
| bottom: 300px;
| left: 100px;
| }
| .tagItem {
| display: flex;
| margin-top: 20px;
| }
| .tagColor {
| width: 20px;
| height: 20px;
| }
| .tagText {
| margin-left: 30px;
| }
| </style>
|
|