Merge branch 'zcwy_0712_bug' into master-0705

This commit is contained in:
nisen
2024-09-06 13:30:46 +08:00
6 changed files with 46 additions and 28 deletions

View File

@@ -374,7 +374,9 @@ export function usePage(_url, params, init = true,listing = false) {
state.totalPage = r.data.total/10 || 1; state.totalPage = r.data.total/10 || 1;
state.total = r.data.total; state.total = r.data.total;
state.loading = false; state.loading = false;
}); }).catch(err => {
state.loading = false;
})
} }
init && fetch(); init && fetch();
@@ -498,6 +500,9 @@ export async function request(_url, params) {
if (res.code === 0 || res.code === 200) { if (res.code === 0 || res.code === 200) {
return res; return res;
} }
if (res.code === 4 ){
return Promise.reject(res);
}
if (res.code === 1000 || res.code === 1002) { if (res.code === 1000 || res.code === 1002) {
window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath) window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath)
localStorage.removeItem('refreshPage') localStorage.removeItem('refreshPage')

View File

@@ -487,17 +487,19 @@ const columns = ref([
key: "teacher", key: "teacher",
width: "20%", width: "20%",
align: "center", align: "center",
ellipsis: true,
customRender: ({ record }) => { customRender: ({ record }) => {
const teachers = record.offteachers; // const teachers = record.offteachers;
return teachers.map((teacher, index) => { // return teachers.map((teacher, index) => {
// 如果需要显示为列表形式 // // 如果需要显示为列表形式
return ( // return (
<div key={index}> // <div key={index}>
{teacher.teacherName} // {teacher.teacherName}
{index !== teachers.length - 1 && ', '} // {index !== teachers.length - 1 && ', '}
</div> // </div>
); // );
}); // });
return record.offteachers.map(item=>item.teacherName).join(',')
}, },
}, },

View File

@@ -189,7 +189,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
tableDataTotal: 0, tableDataTotal: 0,
projectName: undefined, projectName: null,
projectNameListNot: [ projectNameListNot: [
{ {
id: 1, id: 1,
@@ -377,7 +377,7 @@ export default {
ctx.emit("update:Tvisible", false); ctx.emit("update:Tvisible", false);
state.currentPage = 1; state.currentPage = 1;
state.name = ""; state.name = "";
state.projectName = undefined; state.projectName = null;
state.tabledata = []; state.tabledata = [];
}; };
const afterVisibleChange = (bol) => { const afterVisibleChange = (bol) => {
@@ -389,6 +389,9 @@ export default {
}; };
const selectProjectName = (value) => { const selectProjectName = (value) => {
state.projectName = value; state.projectName = value;
if(value === undefined){
state.projectName = null;
}
}; };
//催促 //催促
const godie = () => { const godie = () => {
@@ -515,7 +518,7 @@ export default {
state.tableDataTotalLoading = true; state.tableDataTotalLoading = true;
state.currentPage = 1; state.currentPage = 1;
state.name = ""; state.name = "";
state.projectName = ""; state.projectName = null;
getData(); getData();
} }

View File

@@ -192,7 +192,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
tableDataTotal: 0, tableDataTotal: 0,
projectName: undefined, projectName: null,
projectNameListNot: [ projectNameListNot: [
{ {
id: 1, id: 1,
@@ -384,7 +384,7 @@ export default {
ctx.emit("update:CommonModelVisible", false); ctx.emit("update:CommonModelVisible", false);
state.currentPage = 1; state.currentPage = 1;
state.name = ""; state.name = "";
state.projectName = undefined; state.projectName = null;
state.tabledata = []; state.tabledata = [];
}; };
const afterVisibleChange = (bol) => { const afterVisibleChange = (bol) => {
@@ -396,6 +396,9 @@ export default {
}; };
const selectProjectName = (value) => { const selectProjectName = (value) => {
state.projectName = value; state.projectName = value;
if(value === undefined){
state.projectName = null;
}
}; };
//催促 //催促
const godie = () => { const godie = () => {
@@ -523,7 +526,7 @@ export default {
state.tableDataTotalLoading = true; state.tableDataTotalLoading = true;
state.currentPage = 1; state.currentPage = 1;
state.name = ""; state.name = "";
state.projectName = undefined; state.projectName = null;
getData(); getData();
} }

View File

@@ -442,6 +442,10 @@ export default {
{/* 导出数据 */ } {/* 导出数据 */ }
function exportData() { function exportData() {
if(state.tabledata.length==0){
message.error("没有数据可以导出");
return
}
// window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?chapterId=${props.datasource.chapterId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&type=${1}`) // window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?chapterId=${props.datasource.chapterId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&type=${1}`)
window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?currentStageId=${props.datasource.chapterId}&type=${1}&pid=${props.datasource.routerId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&taskType=${props.datasource.type}`) window.open(`${process.env.VUE_APP_BASE_API}/admin/exam/manage/exportExam?currentStageId=${props.datasource.chapterId}&type=${1}&pid=${props.datasource.routerId}&targetId=${props.datasource.routerId}&taskId=${props.datasource.courseId}&taskType=${props.datasource.type}`)

View File

@@ -1993,16 +1993,17 @@ const columns6 = [
align: "center", align: "center",
ellipsis: true, ellipsis: true,
customRender: ({ record }) => { customRender: ({ record }) => {
const teachers = record.offteachers; // const teachers = record.offteachers;
return teachers.map((teacher, index) => { // return teachers.map((teacher, index) => {
// 如果需要显示为列表形式 // // 如果需要显示为列表形式
return ( // return (
<div key={index}> // <div key={index}>
{teacher.teacherName} // {teacher.teacherName}
{index !== teachers.length - 1 && ', '} // {index !== teachers.length - 1 && ', '}
</div> // </div>
); // );
}); // });
return record.offteachers.map(item=>item.teacherName).join(',')
} }
}, },