diff --git a/src/utils/request.js b/src/utils/request.js index efd7178..7ce055b 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -30,9 +30,9 @@ axios.interceptors.response.use( if (error.response.status == 401) { ElMessage.error("请重新登录!"); // window.location.href = '/#/login?returnURL=' + window.location.href - // window.location.href = - // 'http://220.191.238.50:996/api/login?returnURL=' + - // window.location.href + window.location.href = + 'http://220.191.238.50:996/api/login?returnURL=' + + window.location.href } else if (error.response.status == 404) { ElMessage.error("Status:404,正在请求不存在的服务器记录!"); } else if (error.response.status == 500) { diff --git a/src/view/echarts_education/pieRose.vue b/src/view/echarts_education/pieRose.vue index 4e9a677..7dcb982 100644 --- a/src/view/echarts_education/pieRose.vue +++ b/src/view/echarts_education/pieRose.vue @@ -1,122 +1,126 @@ - \ No newline at end of file + diff --git a/src/view/education.vue b/src/view/education.vue index a343806..605757d 100644 --- a/src/view/education.vue +++ b/src/view/education.vue @@ -8,7 +8,7 @@ - +
@@ -48,7 +48,7 @@ v-model="selectData.value2" placeholder="请选择" size="large" - @change="selectChange1" + @change="selectChange2" >
- +
@@ -94,14 +94,14 @@
- 初中 + 初中 {{ data.xxgk.czxxsl }}
高中 {{ data.xxgk.gzxxsl }} @@ -110,14 +110,14 @@
小学 {{ data.xxgk.xxxxsl }}
中职 {{ data.xxgk.zzxxsl }} @@ -126,7 +126,7 @@
幼儿园 {{ data.xxgk.yeyxxsl }} @@ -134,7 +134,7 @@
特殊教育 {{ data.xxgk.tsjyxxsl }} @@ -226,7 +226,7 @@
- 绿色预警 + 绿色预警
@@ -236,7 +236,7 @@
- 黄色预警 + 黄色预警
@@ -246,7 +246,7 @@
- 红色预警 + 红色预警
@@ -341,20 +341,26 @@ import ePieRose from "./echarts_education/pieRose.vue"; import eP1 from "./echarts_education/eP1.vue"; import http from "@/utils/request.js"; import Dialog from "./dialog/dialog.vue"; +const showR = ref(true); //下拉 const selectData = reactive({ - value1: "111", - value2: "tes1", + value1: "0", + value2: "0", list: [], list1: [], active: "县镇", + evaluationAnalysis: {}, options1: [ { - value: "111", - label: "2023秋季检查", + value: "1", + label: "2023年秋季小学生心理健康普查", }, { - value: "222", - label: "2024春季检查", + value: "2", + label: "2023年秋季初中生心理健康普查", + }, + { + value: "3", + label: "2023年秋季高中生心理健康普查", }, ], options2: [ @@ -366,10 +372,10 @@ const selectData = reactive({ value: "tes2", label: "小学心理健康诊断测验", }, - { - value: "tes3", - label: "中学心理健康诊断", - }, + // { + // value: "tes3", + // label: "中学心理健康诊断", + // }, ], }); var roseData1 = ref([ @@ -468,7 +474,6 @@ const tableType = reactive({ label: "学生数", property: "xss", }, - { label: "性质", property: "xz", @@ -481,13 +486,15 @@ const pagination = reactive({ total: 100, pageSize: 10, currentPage: 1, + school: "", }); const handlePagination = (current) => { pagination.currentPage = current; getTable(tableType.url, pagination.currentPage); }; -const showDialog = (title, url) => { +const showDialog = (title, url, school) => { tableType.title = title; + pagination.school = school; tableType.url = url; pagination.currentPage = 1; dialogShow.value = true; @@ -497,7 +504,9 @@ const showDialog = (title, url) => { const getTable = (url, currentPage) => { dialogShow.value = true; http - .get(`${url}?page=${currentPage}&size=${pagination.pageSize}`) + .get( + `${url}?page=${currentPage}&size=${pagination.pageSize}&xd=${pagination.school}` + ) .then((res) => { if (res.code == 200) { tableType.data = res.data; @@ -510,18 +519,51 @@ const close = () => { dialogShow.value = false; }; -//---- +//----选择 const selectChange1 = () => { - if (selectData.value1 == "111") { - selectData.list = roseData1.value; - } else if (selectData.value2 == "tes1") { - selectData.list = roseData2.value; - } else if (selectData.value2 == "tes2") { - selectData.list = roseData3.value; - } else { - selectData.list = roseData1.value; + selectData.options1 = []; + selectData.options2 = []; + selectData.evaluationAnalysis.forEach((item, index) => { + const newOption = { + value: `${index}`, + label: item.planTitle, + }; + selectData.options1.push(newOption); + }); + if ( + selectData.evaluationAnalysis[selectData.value1] && + selectData.evaluationAnalysis[selectData.value1].child + ) { + selectData.evaluationAnalysis[selectData.value1].child.forEach( + (item, index) => { + const newOption = { + value: `${index}`, + label: item.title, + }; + selectData.options2.push(newOption); + } + ); } + selectData.value2 = "0"; + selectChange2(); }; +const selectChange2 = () => { + showR.value = false; + roseData1.value.forEach((item, index) => { + item.value = + selectData.evaluationAnalysis[selectData.value1].child[ + selectData.value2 + ].statistics[index + 1]; + }); + + selectData.list = roseData1.value; + console.log(selectData.list); + + setTimeout(() => { + showR.value = true; + }, 300); +}; + // const ratingBtn = (item) => { // selectData.active = item; // 设置当前选中的项目 // switch (selectData.active) { @@ -629,6 +671,8 @@ const getData = async () => { data.zdgz[2].value = res.data.zdgz.dqjt; data.zdgz[3].value = res.data.zdgz.xsdb; // 测评分析 + selectData.evaluationAnalysis = res.data.cpfx; + selectChange1(); // 学校概况 data.xxgk = res.data.xxgk; // 县镇农村学校数量 初始化数据 @@ -1558,7 +1602,7 @@ onMounted(() => { } .grade1 { - padding: 12px 110px 0 138px; + padding: 12px 110px 0 116px; box-sizing: border-box; } } @@ -1819,7 +1863,7 @@ onMounted(() => { } } } -.font{ +.font { font-size: 16px !important; } :deep(.el-table) { @@ -1854,9 +1898,11 @@ onMounted(() => { .selectBox { .el-select--large .el-select__wrapper { // font-size: 18px !important; - span, p, a { - font-size: 16px; -} + span, + p, + a { + font-size: 16px; + } } .el-select__wrapper { @@ -1872,5 +1918,4 @@ onMounted(() => { font-size: 18px !important; } } -