This commit is contained in:
yuping
2023-01-12 01:37:28 +08:00
parent f8068bb712
commit c04574fc40
8 changed files with 46 additions and 57 deletions

9
.env
View File

@@ -2,7 +2,9 @@
VUE_APP_BASE=/manage VUE_APP_BASE=/manage
# api项目基础url # api项目基础url
VUE_APP_BASE_API=/manageApi VUE_APP_BASE_API=/manageApi
# 导出url #文件路径
VUE_APP_FILE_PATH=/file/
# 代理url 本地调试,不可以用在其他地方
VUE_APP_PROXY_URL=http://111.231.196.214/manageApi VUE_APP_PROXY_URL=http://111.231.196.214/manageApi
# 登录url # 登录url
VUE_APP_LOGIN_URL=https://u-pre.boe.com/web 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_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

View File

@@ -6,7 +6,7 @@
* @FilePath: /fe-manage/src/api/config.js * @FilePath: /fe-manage/src/api/config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @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 axios from "axios";
import router from "@/router"; import router from "@/router";
// import { getCookie } from '../api/method' // import { getCookie } from '../api/method'
@@ -21,7 +21,7 @@ const http = axios.create({
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
timeout: 1000 * 15, timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" }, // headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "application/json" }, headers: {"Content-Type": "application/json"},
}); });
http.interceptors.request.use( http.interceptors.request.use(
@@ -51,18 +51,19 @@ http.interceptors.response.use(
(response) => { (response) => {
// console.log('response', response) // console.log('response', response)
const { const {
data: { code, msg }, data: {code, msg, show},
} = response; } = response;
// console.log('code', code) console.log('code', code)
if (code === 0 || code === 200) { if (code === 0 || code === 200) {
return response; 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) { function (error) {
if (error.message == "timeout of 1ms exceeded") { if (error.message == "timeout of 1ms exceeded") {

View File

@@ -66,7 +66,7 @@ export default {
const downloadHomeWork = () => { const downloadHomeWork = () => {
// props.url // props.url
if (props.downloadUrl) { if (props.downloadUrl) {
window.open(props.downloadUrl); window.open(process.env.VUE_APP_FILE_PATH+props.downloadUrl);
} }
}; };
console.log("props", props); console.log("props", props);

View File

@@ -18,7 +18,7 @@
<div class="main"> <div class="main">
<div class="minatitl"> <div class="minatitl">
<div class="up1">请下载</div> <div class="up1">请下载</div>
<a class="up2" :href="template" style="course: pointer">模板</a> <a class="up2" :href="template" target="_blank" style="cursor: pointer">模板</a>
<div class="up1">按要求填写数据并导入</div> <div class="up1">按要求填写数据并导入</div>
</div> </div>
<div class="upload"> <div class="upload">
@@ -221,10 +221,9 @@ export default {
setup(props, ctx) { setup(props, ctx) {
const store = useStore(); const store = useStore();
const state = reactive({ const state = reactive({
template: template: process.env.VUE_APP_FILE_PATH + process.env.VUE_APP_UP_LOAD_STUDENT_TEMPLATE,
process.env.VUE_APP_TEMPLATE + "导入学员模版-1672998102528.xlsx",
importStudent: importStudent:
process.env.VUE_APP_BASE_API + "admin/student/importStudent", process.env.VUE_APP_BASE_API + "/admin/student/importStudent",
timers: "", // 定时器,用于清空定时器使用 timers: "", // 定时器,用于清空定时器使用
isAddStudent: false, // 用于判断用户是否关闭弹框需要重新获取学员列表 isAddStudent: false, // 用于判断用户是否关闭弹框需要重新获取学员列表
uploadpercent: -1, uploadpercent: -1,
@@ -235,11 +234,6 @@ export default {
errNum: 0, //失败数据数 errNum: 0, //失败数据数
downloadErrUrl: "", downloadErrUrl: "",
showBottomBar: false, // 显示底部成功条数和失败条数 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, userId: store.state.userInfo.id,
userName: store.state.userInfo.realName, userName: store.state.userInfo.realName,
fileName: "", fileName: "",
@@ -337,9 +331,8 @@ export default {
// 下载失败数据 // 下载失败数据
const downloadEeeorData = () => { const downloadEeeorData = () => {
console.log(state.locationHref + state.downloadErrUrl);
if (state.downloadErrUrl !== "") { if (state.downloadErrUrl !== "") {
window.open(state.locationHref + state.downloadErrUrl); window.open(process.env.VUE_APP_FILE_PATH + state.downloadErrUrl);
} }
}; };

View File

@@ -20,7 +20,7 @@
<div class="main"> <div class="main">
<div class="minatitl"> <div class="minatitl">
<div class="up1">请下载</div> <div class="up1">请下载</div>
<div class="up2">模板</div> <div class="up2" @click="downTemplate" style="cursor:pointer">模板</div>
<div class="up1">按要求填写数据并导入</div> <div class="up1">按要求填写数据并导入</div>
</div> </div>
<div class="upload"> <div class="upload">
@@ -352,15 +352,19 @@ export default {
const downloadEeeorData = () => { const downloadEeeorData = () => {
console.log(state.locationHref + state.downloadErrUrl); console.log(state.locationHref + state.downloadErrUrl);
if (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 { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
handleChange, handleChange,
downTemplate,
BATCH_IMPORT_SCORE, BATCH_IMPORT_SCORE,
beforeUpload, beforeUpload,
handleUpload, handleUpload,

View File

@@ -682,19 +682,12 @@ const exportHomeWorkShow = () => {
api api
.exportHomeWork(obj) .exportHomeWork(obj)
.then((res) => { .then((res) => {
console.log("导出作业", JSON.parse(res.data).data); console.log("导出作业", 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) => {
message.destroy(); message.destroy();
message.error("导出作业失败"); message.success("导出作业成功");
console.log("导出作业失败", err); exportHomeWorkV.value = true;
}); downloadUrl.value = res.data.data;
})
}; };
// //导出作业 // //导出作业
// const exportHomeWork = () => { // const exportHomeWork = () => {

View File

@@ -80,12 +80,12 @@
<div class="timemanag" style="margin-top: 12px"> <div class="timemanag" style="margin-top: 12px">
{{values.createTime?values.createTime:'-'}} {{values.createName?values.createName:'-'}} {{values.createTime?values.createTime:'-'}} {{values.createName?values.createName:'-'}}
</div> </div>
<div class="timemanag">来源:{{values.source?values.source:'-'}}</div> <div class="timemanag">来源:{{{1:'项目',2:'路径图',3:'开课'}[values.type]+'-'+values.name}}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="itemdown"> <div class="itemdown">
<div class="download" @click="downLoadFile(values)">下载</div> <div class="download" @click="downLoadFile(values)">下载</div>
<div class="delete" @click="removeFile(values)">删除</div> <div class="delete" @click="removeFile(values)">删除</div>
</div> </div>
@@ -181,7 +181,7 @@ export default {
function downLoadFile(data) { function downLoadFile(data) {
console.log(data) console.log(data)
window.open(state.locationHref + data.url) window.open(state.locationHref + data.url)
} }
// 删除文件 // 删除文件
function removeFile(data) { function removeFile(data) {
console.log(data) console.log(data)
@@ -204,14 +204,14 @@ export default {
// 搜索 // 搜索
function searchDownloadList() { function searchDownloadList() {
getData() getData()
} }
// 重置 // 重置
function reseatDownloadList() { function reseatDownloadList() {
state.name = ""; state.name = "";
state.currentPage = 1; state.currentPage = 1;
getData() getData()
} }
// 分页 // 分页
//分页 //分页

View File

@@ -3067,14 +3067,7 @@ export default defineComponent({
dataIndex: "evastatus", dataIndex: "evastatus",
key: "8", key: "8",
align: "center", align: "center",
customRender: ({ record }) => { customRender: ({record}) => record.assessmentStatus ? '已评估' : '未评估'
switch (String(record.evalStatus)) {
case "0":
return "未评估";
case "1":
return "已评估";
}
},
}, },
{ {
title: "作业成绩", title: "作业成绩",
@@ -3085,8 +3078,8 @@ export default defineComponent({
customRender: ({ record }) => { customRender: ({ record }) => {
return ( return (
<div class="racona"> <div class="racona">
{record.workScore ? ( {record.score ? (
<span>{record.workScore}</span> <span>{record.score}</span>
) : ( ) : (
<span <span
style={{ color: "#4EA6FF", cursor: "pointer" }} style={{ color: "#4EA6FF", cursor: "pointer" }}
@@ -3121,16 +3114,17 @@ export default defineComponent({
{ {
title: "考试成绩", title: "考试成绩",
width: "15%", width: "15%",
dataIndex: "evastatus", dataIndex: "examinationScore",
key: "8", key: "8",
align: "center", align: "center",
}, },
{ {
title: "结业状态", title: "结业状态",
width: "15%", width: "15%",
dataIndex: "evastatus", dataIndex: "completionStatus",
key: "8", key: "8",
align: "center", align: "center",
customRender: ({ record }) => <div>{{1:'结业'}[record.completionStatus] || '-'}</div>,
}, },
], ],
shipType: 1, shipType: 1,
@@ -4761,6 +4755,7 @@ export default defineComponent({
}; };
const handleJoin = async () => { const handleJoin = async () => {
state.lrcj_inputV1 || message.error("请输入成绩")
if (state.rg_hs) { if (state.rg_hs) {
if (state.piliang) { if (state.piliang) {
api1.updateStudent({ api1.updateStudent({