diff --git a/.env b/.env index d88b27f1..b8afca1f 100644 --- a/.env +++ b/.env @@ -2,7 +2,9 @@ VUE_APP_BASE=/manage # api项目基础url VUE_APP_BASE_API=/manageApi -# 导出url +#文件路径 +VUE_APP_FILE_PATH=/file/ +# 代理url 本地调试,不可以用在其他地方 VUE_APP_PROXY_URL=http://111.231.196.214/manageApi # 登录url VUE_APP_LOGIN_URL=https://u-pre.boe.com/web @@ -18,5 +20,6 @@ VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc/loading # 课程二维码 VUE_APP_COURSE_STUDY=https://u-pre.boe.com/pc/course/studyindex?id= -# 导入学员模板 -VUE_APP_TEMPLATE=https://u-pre.boe.com/upload/ +# 导入学员模板 +VUE_APP_UP_LOAD_HOMEWORK_TEMPLATE=导入作业成绩 模板-1673450632417.xlsx +VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673452888323.xlsx diff --git a/src/api/config.js b/src/api/config.js index 8db32374..74e67963 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -6,7 +6,7 @@ * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ -import { message } from "ant-design-vue"; +import {message} from "ant-design-vue"; import axios from "axios"; import router from "@/router"; // import { getCookie } from '../api/method' @@ -21,7 +21,7 @@ const http = axios.create({ baseURL: process.env.VUE_APP_BASE_API, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, - headers: { "Content-Type": "application/json" }, + headers: {"Content-Type": "application/json"}, }); http.interceptors.request.use( @@ -51,18 +51,19 @@ http.interceptors.response.use( (response) => { // console.log('response', response) const { - data: { code, msg }, + data: {code, msg, show}, } = response; - // console.log('code', code) + console.log('code', code) if (code === 0 || code === 200) { return response; - } else { - if (code === 1000) { - (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') ? router.push({ path: 'login' }) : (window.location.href = process.env.VUE_APP_LOGIN_URL) - } - console.log("api %o", msg); } - return response; + if (code === 1000) { + (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: 'login'}) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + return Promise.reject(response); + } + show && message.error(msg); + console.log("api %o", msg); + return Promise.reject(response); }, function (error) { if (error.message == "timeout of 1ms exceeded") { diff --git a/src/components/Modals/ExportHomeWork.vue b/src/components/Modals/ExportHomeWork.vue index 88db9ff3..fde670d9 100644 --- a/src/components/Modals/ExportHomeWork.vue +++ b/src/components/Modals/ExportHomeWork.vue @@ -66,7 +66,7 @@ export default { const downloadHomeWork = () => { // props.url if (props.downloadUrl) { - window.open(props.downloadUrl); + window.open(process.env.VUE_APP_FILE_PATH+props.downloadUrl); } }; console.log("props", props); diff --git a/src/components/drawers/AddLevelImportStu.vue b/src/components/drawers/AddLevelImportStu.vue index 73aa0434..68425c9e 100644 --- a/src/components/drawers/AddLevelImportStu.vue +++ b/src/components/drawers/AddLevelImportStu.vue @@ -18,7 +18,7 @@
请下载
- 模板 + 模板
,按要求填写数据并导入
@@ -221,10 +221,9 @@ export default { setup(props, ctx) { const store = useStore(); const state = reactive({ - template: - process.env.VUE_APP_TEMPLATE + "导入学员模版-1672998102528.xlsx", + template: process.env.VUE_APP_FILE_PATH + process.env.VUE_APP_UP_LOAD_STUDENT_TEMPLATE, importStudent: - process.env.VUE_APP_BASE_API + "admin/student/importStudent", + process.env.VUE_APP_BASE_API + "/admin/student/importStudent", timers: "", // 定时器,用于清空定时器使用 isAddStudent: false, // 用于判断用户是否关闭弹框需要重新获取学员列表 uploadpercent: -1, @@ -235,11 +234,6 @@ export default { errNum: 0, //失败数据数 downloadErrUrl: "", showBottomBar: false, // 显示底部成功条数和失败条数 - locationHref: - location.href.indexOf("http://") !== -1 - ? "http://111.231.196.214:12016/" - : location.href.slice(0, location.href.indexOf("/m")) + "/upload/", - userId: store.state.userInfo.id, userName: store.state.userInfo.realName, fileName: "", @@ -337,9 +331,8 @@ export default { // 下载失败数据 const downloadEeeorData = () => { - console.log(state.locationHref + state.downloadErrUrl); if (state.downloadErrUrl !== "") { - window.open(state.locationHref + state.downloadErrUrl); + window.open(process.env.VUE_APP_FILE_PATH + state.downloadErrUrl); } }; diff --git a/src/components/drawers/ExportScore.vue b/src/components/drawers/ExportScore.vue index 858a374f..4ee59150 100644 --- a/src/components/drawers/ExportScore.vue +++ b/src/components/drawers/ExportScore.vue @@ -20,7 +20,7 @@
请下载
-
模板
+
模板
,按要求填写数据并导入
@@ -352,15 +352,19 @@ export default { const downloadEeeorData = () => { console.log(state.locationHref + state.downloadErrUrl); if (state.downloadErrUrl !== "") { - window.open(state.locationHref + state.downloadErrUrl); + window.open(process.env.VUE_APP_FILE_PATH + state.downloadErrUrl); } }; + function downTemplate(){ + window.open(process.env.VUE_APP_FILE_PATH + process.env.VUE_APP_UP_LOAD_HOMEWORK_TEMPLATE) + } return { ...toRefs(state), afterVisibleChange, closeDrawer, handleChange, + downTemplate, BATCH_IMPORT_SCORE, beforeUpload, handleUpload, diff --git a/src/components/student/TableStudent.vue b/src/components/student/TableStudent.vue index a2d9fdfc..169389ea 100644 --- a/src/components/student/TableStudent.vue +++ b/src/components/student/TableStudent.vue @@ -682,19 +682,12 @@ const exportHomeWorkShow = () => { api .exportHomeWork(obj) .then((res) => { - console.log("导出作业", JSON.parse(res.data).data); - if (JSON.parse(res.data).code === 200) { - message.destroy(); - message.success("导出作业成功"); - exportHomeWorkV.value = true; - downloadUrl.value = JSON.parse(res.data).data; - } - }) - .catch((err) => { + console.log("导出作业", res.data.data); message.destroy(); - message.error("导出作业失败"); - console.log("导出作业失败", err); - }); + message.success("导出作业成功"); + exportHomeWorkV.value = true; + downloadUrl.value = res.data.data; + }) }; // //导出作业 // const exportHomeWork = () => { diff --git a/src/views/DownLoad.vue b/src/views/DownLoad.vue index 8b559f8c..b242b371 100644 --- a/src/views/DownLoad.vue +++ b/src/views/DownLoad.vue @@ -80,12 +80,12 @@
{{values.createTime?values.createTime:'-'}} {{values.createName?values.createName:'-'}}
-
来源:{{values.source?values.source:'-'}}
+
来源:{{{1:'项目',2:'路径图',3:'开课'}[values.type]+'-'+values.name}}
-
-
+
+
下载
删除
@@ -181,7 +181,7 @@ export default { function downLoadFile(data) { console.log(data) window.open(state.locationHref + data.url) - } + } // 删除文件 function removeFile(data) { console.log(data) @@ -204,14 +204,14 @@ export default { // 搜索 function searchDownloadList() { getData() - } + } // 重置 function reseatDownloadList() { state.name = ""; state.currentPage = 1; getData() - } + } // 分页 //分页 diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index aa9aeacc..35ef4dea 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -3067,14 +3067,7 @@ export default defineComponent({ dataIndex: "evastatus", key: "8", align: "center", - customRender: ({ record }) => { - switch (String(record.evalStatus)) { - case "0": - return "未评估"; - case "1": - return "已评估"; - } - }, + customRender: ({record}) => record.assessmentStatus ? '已评估' : '未评估' }, { title: "作业成绩", @@ -3085,8 +3078,8 @@ export default defineComponent({ customRender: ({ record }) => { return (
- {record.workScore ? ( - {record.workScore} + {record.score ? ( + {record.score} ) : (
{{1:'结业'}[record.completionStatus] || '-'}
, }, ], shipType: 1, @@ -4761,6 +4755,7 @@ export default defineComponent({ }; const handleJoin = async () => { + state.lrcj_inputV1 || message.error("请输入成绩") if (state.rg_hs) { if (state.piliang) { api1.updateStudent({