杨磊
7 天以前 3eba8102f54dba44758865df0cccf4aae8aea2da
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() {
@@ -513,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>