From 1b45ae804b56ac3ca4dff93ac7533f0f779f970c Mon Sep 17 00:00:00 2001 From: Pengxiansen <2422914688@qq.com> Date: Tue, 25 Feb 2025 16:49:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configGrowth.js | 4 +- src/components/NavLeft.vue | 6 + .../growthpath/GrowthActiveAttendance.vue | 28 +- .../growthpath/GrowthExamManage.vue | 786 -------------- .../growthpath/GrowthExternalExamManage.vue | 791 -------------- .../growthpath/GrowthHomeworkManage.vue | 985 ------------------ .../growthpath/GrowthOnlineManage.vue | 87 +- .../{ExportScore.vue => GrowthScore.vue} | 247 ++--- src/views/growthpath/PathManage.vue | 34 +- vue.config.js | 16 +- 10 files changed, 211 insertions(+), 2773 deletions(-) delete mode 100644 src/components/growthpath/GrowthExamManage.vue delete mode 100644 src/components/growthpath/GrowthExternalExamManage.vue delete mode 100644 src/components/growthpath/GrowthHomeworkManage.vue rename src/components/growthpath/{ExportScore.vue => GrowthScore.vue} (74%) diff --git a/src/api/configGrowth.js b/src/api/configGrowth.js index 2f010b28..ab3fedbe 100644 --- a/src/api/configGrowth.js +++ b/src/api/configGrowth.js @@ -18,8 +18,8 @@ import { boeRequest } from "@/api/request"; // "application/x-www-form-urlencoded"; axios.defaults.withCredentials = true; const http = axios.create({ - baseURL: '/growth', - // baseURL: process.env.VUE_APP_BASE_API_GROWTH, + // baseURL: '/growth', + baseURL: process.env.VUE_APP_BASE_API_GROWTH, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, headers: { "Content-Type": "application/json" }, diff --git a/src/components/NavLeft.vue b/src/components/NavLeft.vue index aa567b2b..b50be88c 100644 --- a/src/components/NavLeft.vue +++ b/src/components/NavLeft.vue @@ -1003,6 +1003,12 @@ export default { selectedKeys: "sub25", pagename: "专业力必修", }, + { + href: "/growthaddpath", + openKeys: "sub25", + selectedKeys: "sub25", + pagename: "专业力必修", + }, { href: "/leveladd", openKeys: "sub1", diff --git a/src/components/growthpath/GrowthActiveAttendance.vue b/src/components/growthpath/GrowthActiveAttendance.vue index e7d17197..ebff6934 100644 --- a/src/components/growthpath/GrowthActiveAttendance.vue +++ b/src/components/growthpath/GrowthActiveAttendance.vue @@ -794,11 +794,20 @@ export default { state.tableDataTotalLoading = true; state.currentPage = 1; state.name = null; - state.signStatus = undefined; + state.signStatus = ""; state.username = null; state.tableDataTotal = 0; getTableData(); } + function buildUrl(url, params) { + const searchParams = new URLSearchParams(); + Object.keys(params).forEach((key) => { + if(params[key]){ + searchParams.append(key, params[key]); + } + }); + return `${url}?${searchParams.toString()}`; + } // 导出数据 function exportTaskStu() { @@ -811,8 +820,21 @@ export default { ); console.log("props.datasource", props.datasource); window.open( - `${process.env.VUE_APP_BASE_API}/admin/student/exportTaskStudent?currentStageId=0&type=2&pid=${props.datasource.growthId}&thirdType=1&taskId=${props.datasource.id}&taskType=${props.datasource.type}` - ); + buildUrl( + `${process.env.VUE_APP_BOE_API_URL}${ + process.env.VUE_APP_BASE_API_GROWTH || "" + }/professional/task/attendanceExport`, + { + username: state.username, + taskId: props.datasource.id, + taskType: props.datasource.taskType, + signStatus: state.signStatus, + } + ) + ); + // window.open( + // `${process.env.VUE_APP_BASE_API}/professional/task/attendanceExport?currentStageId=0&type=2&pid=${props.datasource.growthId}&thirdType=1&taskId=${props.datasource.id}&taskType=${props.datasource.type}` + // ); // if (props.types == 2) { // window.open( // `${process.env.VUE_APP_BASE_API}/admin/student/exportTaskStudent?currentStageId=0&type=2&pid=${props.datasource.growthId}&thirdType=1&taskId=${props.datasource.id}&taskType=${props.datasource.type}` diff --git a/src/components/growthpath/GrowthExamManage.vue b/src/components/growthpath/GrowthExamManage.vue deleted file mode 100644 index c61a522b..00000000 --- a/src/components/growthpath/GrowthExamManage.vue +++ /dev/null @@ -1,786 +0,0 @@ - - - - - - diff --git a/src/components/growthpath/GrowthExternalExamManage.vue b/src/components/growthpath/GrowthExternalExamManage.vue deleted file mode 100644 index 72ec7696..00000000 --- a/src/components/growthpath/GrowthExternalExamManage.vue +++ /dev/null @@ -1,791 +0,0 @@ - - - - - - diff --git a/src/components/growthpath/GrowthHomeworkManage.vue b/src/components/growthpath/GrowthHomeworkManage.vue deleted file mode 100644 index 59f58445..00000000 --- a/src/components/growthpath/GrowthHomeworkManage.vue +++ /dev/null @@ -1,985 +0,0 @@ - - - - - diff --git a/src/components/growthpath/GrowthOnlineManage.vue b/src/components/growthpath/GrowthOnlineManage.vue index fffdb292..25d3bc61 100644 --- a/src/components/growthpath/GrowthOnlineManage.vue +++ b/src/components/growthpath/GrowthOnlineManage.vue @@ -19,16 +19,13 @@ />
- - - - + -
+
催促学习
@@ -91,7 +85,7 @@
导出数据
- +
- +
+ + @@ -146,11 +144,15 @@ import { toRefs, reactive, onMounted, onUnmounted } from "vue"; import { message } from "ant-design-vue"; // import ViewAssess from "../ViewAssess"; import { checkGrowthPer } from "@/utils/utils"; +import EScore from "@/components/growthpath/GrowthScore.vue"; + import { getStudentTaskPage, batchSendMessage, exportStudentTaskPage, } from "@/api/growthpath"; + +import * as api from "@/api/index1"; import { TASK_TYPE } from "@/utils/constGrown"; import PostSelectNew from "@/components/growthpath/PostSelect"; import OfficeSelect from "@/components/growthpath/OfficeSelect"; @@ -160,6 +162,7 @@ export default { components: { OfficeSelect, PostSelectNew, + EScore, }, props: { createId: { @@ -199,6 +202,7 @@ export default { visible: props.Tvisible, name: "", pageNum: 1, + Evisible: false, //录入成绩抽屉 pageSize: 10, currentPage: 1, tableDataTotal: 0, @@ -447,9 +451,9 @@ export default { }; //催促 const godie = () => { - if(!state.tableData.length){ + if (!state.tableData.length) { message.warning("当前学习任务没有可催促的学员"); - return + return; } var obj = { courseId: props.datasource.taskId @@ -472,7 +476,10 @@ export default { const onChange = (pageNumber) => { console.log("Page: ", pageNumber); }; - + // 导入成绩 + const showEntryScore = () => { + state.Evisible = true; + }; // 获取数据 function getData() { getStudentTaskPage({ @@ -556,32 +563,15 @@ export default { //显示导出作业弹窗 const exportHomeWorkShow = () => { - // state.exportHomeWorkV = true; - // exportHomeWork(); - let obj = { - currentStageId: props.datasource.chapterId, - pid: props.datasource.routerId, + let params = { taskId: props.datasource.id, - taskType: props.datasource.type, - type: 2, }; - api - .exportHomeWork(obj) - .then((res) => { - console.log("导出作业", res.data.data); - if (res.data.code === 200) { - // debugger - // message.destroy(); - // message.success("导出作业成功"); - state.exportHomeWorkV = true; - state.downloadUrl = res.data.data; - } - }) - .catch((err) => { - message.destroy(); - message.error("导出作业失败"); - console.log("导出作业失败", err); - }); + window.open( + buildUrl( + `${process.env.VUE_APP_BOE_API_URL}${process.env.VUE_APP_BASE_API_GROWTH}/professional/task/workExport`, + params + ) + ); }; return { ...toRefs(state), @@ -595,6 +585,7 @@ export default { onMounted, onUnmounted, onChange, + showEntryScore, searchTaskList, resetTaskList, changePaginationStu, diff --git a/src/components/growthpath/ExportScore.vue b/src/components/growthpath/GrowthScore.vue similarity index 74% rename from src/components/growthpath/ExportScore.vue rename to src/components/growthpath/GrowthScore.vue index 5b368789..27c494e6 100644 --- a/src/components/growthpath/ExportScore.vue +++ b/src/components/growthpath/GrowthScore.vue @@ -1,12 +1,19 @@ - @@ -143,7 +148,6 @@ import { toRefs, reactive, onMounted, onUnmounted } from "vue"; import { message } from "ant-design-vue"; // import ViewAssess from "../ViewAssess"; -import { checkGrowthPer } from "@/utils/utils"; import EScore from "@/components/growthpath/GrowthScore.vue"; import { @@ -202,6 +206,7 @@ export default { visible: props.Tvisible, name: "", pageNum: 1, + step: 1, // 步骤数 Evisible: false, //录入成绩抽屉 pageSize: 10, currentPage: 1, @@ -232,6 +237,12 @@ export default { evalDataSource: "", Assessvisible: false, }); + // 关闭导入成绩 + const closeImport = () => { + state.step = 1; + state.tableDataTotalLoading = true; + getData(); + }; const tableDataFunc = () => { const columns = [ { @@ -431,13 +442,19 @@ export default { }; const closeDrawer = () => { - ctx.emit("update:Tvisible", false); - state.currentPage = 1; - state.name = ""; - state.completionStatus = undefined; - state.tableData = []; - state.stdPosition = null; - state.qualsLevelCode = null; + if (state.step == 1) { + ctx.emit("update:Tvisible", false); + state.currentPage = 1; + state.name = ""; + state.completionStatus = undefined; + state.tableData = []; + state.stdPosition = null; + state.qualsLevelCode = null; + } else { + state.step = 1; + state.tableDataTotalLoading = true; + getData(); + } }; const afterVisibleChange = (bol) => { if (bol == true) { @@ -478,7 +495,7 @@ export default { }; // 导入成绩 const showEntryScore = () => { - state.Evisible = true; + state.step = 2; }; // 获取数据 function getData() { @@ -582,6 +599,7 @@ export default { afterVisibleChange, tableDataFunc, godie, + closeImport, onMounted, onUnmounted, onChange, diff --git a/src/components/growthpath/GrowthRef.vue b/src/components/growthpath/GrowthRef.vue index 4d5d3ee3..bc6f6b4b 100644 --- a/src/components/growthpath/GrowthRef.vue +++ b/src/components/growthpath/GrowthRef.vue @@ -96,7 +96,7 @@ const props = defineProps({ growId: String, }); const visible = ref(false); -const formData = useResetRef({ +const formData = ref({ info: { linkName: "", linkAddress: "", @@ -121,13 +121,18 @@ const rulesRef = ref({ ], }); -let validate = Form.useForm(formData.value.info, rulesRef).validate; +let validate = null; const closeDrawer = () => { visible.value = false; dateTime.value = []; - formData.reset(); - formData.value.info = {}; + formData.value = { + info: { + linkName: "", + linkAddress: "", + linkDescription: "", + }, + }; }; async function confirm() { @@ -160,7 +165,7 @@ async function confirm() { function openDrawer(row) { row && (formData.value = row); - row && (validate = Form.useForm(formData.value.info, rulesRef).validate); + validate = Form.useForm(formData.value.info, rulesRef).validate; visible.value = true; } diff --git a/src/components/growthpath/GrowthScore.vue b/src/components/growthpath/GrowthScore.vue index 27c494e6..f0fe6f1e 100644 --- a/src/components/growthpath/GrowthScore.vue +++ b/src/components/growthpath/GrowthScore.vue @@ -1,193 +1,168 @@