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] =?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 @@
-
-
-
-
-
-
起止时间:{{titleData.examinationStartTime}} ~ {{titleData.examinationEndTime}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
- 起止时间:{{ datasource.info.submitStartTime }}
- ~
- {{ datasource.info.submitEndTime }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
/>
-
-
-
-
+
+
+ 起止时间:{{ datasource.info.submitStartTime }}
+ ~
+ {{ datasource.info.submitEndTime }}
+
+
-
+
催促学习
@@ -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 @@
-
-
+
@@ -20,16 +27,21 @@
上传:
-
+ }"
+ >
@@ -37,13 +49,16 @@
支持扩展名:.xls/.xlsx
-
+
-
@@ -72,22 +87,27 @@
上传失败
-
+
-
-
+
- {{ succNum }}条数据解析成功,{{ errNum }}条数据解析失败
+ {{ succNum }}条数据导入成功,{{ errNum }}条数据导入失败
@@ -102,13 +122,17 @@
上传成功
-
+
-
-
![]()
-
- {{ succNum }}条数据解析成功,{{ errNum }}条数据解析失败
+
+
![]()
+
+ {{ succNum }}条数据导入成功,{{ errNum }}条数据导入失败
@@ -143,8 +179,8 @@
-
-
+
+
@@ -157,11 +193,10 @@
import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
-import { getImportStatus,saveGrowExamScoreToDatabase } from "@/api/growthpath"
-import {getCookieForName} from "@/api/method";
-import dialog from "@/utils/dialog";
+import { BATCH_IMPORT_SCORE } from "@/api/config";
+import { getCookieForName } from "@/api/method";
export default {
- name: "ESGrowthcore",
+ name: "EScore",
props: {
eScorevisible: {
type: Boolean,
@@ -190,61 +225,34 @@ export default {
type: Function,
default: null,
},
- examinationId:{
- type: Object,
- default: function () {
- return {};
- },
- }
},
setup(props, ctx) {
// debugger
const state = reactive({
fileType: ["xls", "xlsx"],
importHomeWork:
- process.env.VUE_APP_BASE_API + "/admin/grow/importExamScoreToCache",
+ process.env.VUE_APP_BASE_API + "/admin/student/importHomeWork",
uploadpercent: -1,
uploadErr: false, //上传失败
addLoading: false,
fileList: [],
succNum: 0, //成功数据数
- redisKey: '',
errNum: 0, //失败数据数
downloadErrUrl: null, //下载失败数据
fileName: "",
});
const headers = { token: getCookieForName("token") };
- const closeDrawer = (item) => {
+ const closeDrawer = () => {
ctx.emit("update:eScorevisible", false);
state.fileList = [];
state.uploadpercent = -1;
state.uploadErr = false; //上传失败
- if(state.redisKey&&state.succNum!=0&&item){
- saveGrowExamScoreToDatabase({
- redisKey: state.redisKey,
- growId: props.id,
- }).then(res=>{
- message.success("导入成功");
- ctx.emit("isTrue", true);
- console.log(res,'res')
- }).catch(err=>{
- message.error("导入失败");
- // message.error(err.data.msg)
- })
- // dialog({
- // content: "导入的学员会覆盖原数据,确认导入吗?",
- // ok:()=>{
- // }
- // })
- }
- state.redisKey = ''
- state.succNum = 0
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
- console.log(props.datesource)
+ console.log(props.datesource);
};
//上传文件
@@ -255,14 +263,7 @@ export default {
state.fileList = [];
state.uploadpercent = -1;
message.destroy();
- message.error("文件格式错误");
- return;
- }
- if(info.file.size > 50000000){
- state.fileList = [];
- state.uploadpercent = -1;
- message.destroy();
- message.error("文件大小超出50M,请重新上传")
+ message.error("请上传正确的文件格式");
return;
}
}
@@ -278,30 +279,33 @@ export default {
state.fileName = info.file.name;
let i = 0;
let timeouts = setTimeout(() => {
- clearInterval(timer)
+ clearInterval(timer);
state.addLoading = false;
- message.destroy();
+ message.destroy();
message.error(`文件导入超时`);
}, 30000);
- if(info.file.response.code == 1){
- state.fileList = [];
- state.addLoading = false;
- state.uploadpercent = -1;
- message.destroy();
- message.error(info.file.response.msg)
- return
- }
let timer = setInterval(() => {
- state.redisKey = info.file.response.data;
- getImportStatus({redisKey:state.redisKey})
+ let uid = info.file.response.data;
+ api
+ .getImportStatus(uid)
.then((res) => {
console.log("查询导入状态", res);
if (res.data.code === 200) {
if (res.data.data.status !== "START") {
+ if (res.data.data.status === "SUCCESS") {
+ state.addLoading = false;
+ state.fileList = [];
+ state.uploadpercent = -1;
+ message.destroy();
+ message.error(`当前开课暂无作业,无法导入成绩`);
+ clearInterval(timer);
+ clearTimeout(timeouts);
+ return;
+ }
i++;
if (i === 1) {
message.destroy();
- // message.success(`${info.file.name}解析成功`);
+ message.success(`${info.file.name}上传成功`);
state.addLoading = false;
props.searchTaskList && props.searchTaskList();
}
@@ -327,7 +331,7 @@ export default {
}, 500);
} else if (status === "error") {
state.uploadErr = true;
- message.error(`文件解析失败,请联系管理员`);
+ message.error(`${info.file.name}上传失败`);
}
};
const beforeUpload = (file) => {
@@ -342,7 +346,7 @@ export default {
// return reject(false);
// }
const formData = new FormData();
- formData.append("file", file);
+ formData.append("uploadFile", file);
// let progress = { percent: 1 };
// const intervalId = setInterval(() => {
@@ -372,7 +376,6 @@ export default {
state.uploadpercent = -1;
state.uploadErr = false; //上传失败
state.succNum = 0;
- state.redisKey = ''
state.errNum = 0;
state.downloadErrUrl = null;
state.addLoading = false;
@@ -380,11 +383,21 @@ export default {
// 下载失败数据
const downloadEeeorData = () => {
if (state.downloadErrUrl !== "") {
- window.open(process.env.VUE_APP_BOE_API_URL + '/upload/boe/file' + state.downloadErrUrl);
+ window.open(process.env.VUE_APP_FILE_PATH + state.downloadErrUrl);
}
};
+
+ function buildUrl(url, params) {
+ const searchParams = new URLSearchParams();
+ Object.keys(params).forEach((key) => {
+ searchParams.append(key, params[key]);
+ });
+ return `${url}?${searchParams.toString()}`;
+ }
function downTemplate() {
- window.open(`${process.env.VUE_APP_BOE_API_URL}/upload/files/2024/7/专业力必修-系统考试录入成绩模板.xlsx`);
+ window.open(
+ `${process.env.VUE_APP_BOE_API_URL}/growth/professional/task/downloadHomeWorkTemplate.do?taskId=${props.id}`
+ );
}
return {
@@ -394,6 +407,8 @@ export default {
handleChange,
downTemplate,
headers,
+ buildUrl,
+ BATCH_IMPORT_SCORE,
beforeUpload,
handleUpload,
removeUpload,
@@ -546,13 +561,9 @@ export default {
// margin-bottom: 8px;
.tit {
- width: 200px;
font-size: 14px;
font-weight: 400;
color: #333333;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
}
.stateloading {
diff --git a/src/views/growthpath/PathManage.vue b/src/views/growthpath/PathManage.vue
index dd5241b9..0e122a4f 100644
--- a/src/views/growthpath/PathManage.vue
+++ b/src/views/growthpath/PathManage.vue
@@ -615,22 +615,7 @@
v-model:studentId="studentId"
v-model:growId="growId"
/>
-
-
-
-
+
-
-
+
@@ -743,8 +723,6 @@ import StudentManage from "@/components/growthpath/StudentManage";
import { useRoute, useRouter } from "vue-router";
import { getCookieForName } from "@/api/method";
import seeStu from "@/components/growthpath/StudentSeeStu";
-import GrowthExternalExamManage from "@/components/growthpath/GrowthExternalExamManage";
-import GrowthExamManage from "@/components/growthpath/GrowthExamManage";
import GrowthOnlineManage from "@/components/growthpath/GrowthOnlineManage";
import CommonStudent from "@/components/student/CommonStudent";
import GrowthOpenCourse from "@/components/growthpath/GrowthOpenCourse.vue";
@@ -757,7 +735,6 @@ import TwoDimensionalCode from "@/components/TwoDimensionalCode.vue";
import GrowthFaceStu from "@/components/growthpath/GrowthFaceStu";
import { DownOutlined, CloseCircleOutlined } from "@ant-design/icons-vue";
import GrowthFaceTaskManage from "../../components/growthpath/GrowthFaceTaskManage";
-import GrowthHomeworkManage from "@/components/growthpath/GrowthHomeworkManage";
import { courseData } from "@/api/index1";
import { checkMenu } from "@/utils/utils";
import GrowthActiveAttendance from "@/components/growthpath/GrowthActiveAttendance";
@@ -782,12 +759,9 @@ export default {
components: {
StudentManage,
seeStu,
- GrowthExternalExamManage,
- GrowthExamManage,
GrowthOnlineManage,
CommonStudent,
TwoDimensionalCode,
- GrowthHomeworkManage,
Draggable,
GrowthFaceTaskManage,
GrowthOpenCourse,
@@ -919,7 +893,6 @@ export default {
type: 4,
offcourseId: item.taskId,
};
- state.spinning = true
await courseData(planParams).then((res) => {
qrCodeItems.value = res.data.data.map((dataItem) => ({
...dataItem,
@@ -944,7 +917,6 @@ export default {
if (qrCodeItems.value.length == 0) {
message.info("暂无签到二维码");
}
- state.spinning = false
});
};
function handleMenuClick({ key }) {
@@ -975,7 +947,6 @@ export default {
type: 4,
offcourseId: item.taskId,
};
- state.spinning = true
await courseData(planParams).then((res) => {
const qrCodeItemspgItem = res.data.data.map((dataItem) => ({
...dataItem,
@@ -1000,7 +971,6 @@ export default {
if (qrCodeItemspg.value.length == 0) {
message.info("暂无评估二维码");
}
- state.spinning = false
});
};
diff --git a/vue.config.js b/vue.config.js
index 5345eb26..4dc6c0d4 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -18,16 +18,16 @@ module.exports = defineConfig({
overlay: false,// 解决代码抛出异常
},
proxy: {
- // "/professional": {
- // target: 'http://192.168.38.211:32002',
- // // target: 'http://192.168.50.195:32002',
- // // target: 'http://192.168.86.195:32002',
- // changeOrigin: true,
- // },
- "/growth": {
- target: 'https:' + process.env.VUE_APP_BOE_API_URL,
+ "/professional": {
+ target: 'http://192.168.31.211:32002',
+ // target: 'http://192.168.50.195:32002',
+ // target: 'http://192.168.86.195:32002',
changeOrigin: true,
},
+ // "/growth": {
+ // target: 'https:' + process.env.VUE_APP_BOE_API_URL,
+ // changeOrigin: true,
+ // },
"/manageApi": {
target: 'https:' + process.env.VUE_APP_PROXY_URL,
changeOrigin: true, //表示是否改变原域名