zhongshujie
8 天以前 6182cfa388f258c6e076aa46e3849ca909985d8d
src/views/directory/index.vue
@@ -182,6 +182,7 @@
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 {
@@ -393,6 +394,7 @@
  mounted() {
    this.initChart();
    this.getStudentList()
    window.addEventListener("resize", this.handleResize);
  },
  beforeDestroy() {
@@ -461,37 +463,38 @@
          {
            type: "tree",
            data: [this.chartData],
            // symbol: "emptyCircle",
            top: "10%",
            bottom: "10%",
            layout: "radial",
            symbol: "emptyCircle",
            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,
              },
            },
            // leaves: {
            //   symbol: "emptyCircle",
            //   label: {
            //     fontSize: 12,
            //   },
            // },
            expandAndCollapse: false,
            lineStyle: {
              color: "#bc1c00",
              width: 1,
            },
            itemStyle: {
              symbol: "emptyCircle",
              color: "#bc1c00",
              color: function (params) {
                return "green";
              },
            },
            roam: true,
            center: ["5%", "0%"], // 微调垂直居中
@@ -512,6 +515,55 @@
        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>
@@ -519,7 +571,7 @@
<style lang="less" scoped>
.page {
  width: 100%;
  height: 100%;
  height: 100vh;
  box-sizing: border-box;
  background-color: #e9e1d4;
  position: relative;
@@ -527,7 +579,7 @@
}
.page-header {
  height: 9.4%;
  height: 9.4vh;
  width: 100%;
  text-align: left;
  border-bottom: 2px solid #937950;