From 772c5e19e5c18cbb63d1023a817bed12a6be8f68 Mon Sep 17 00:00:00 2001 From: zhangyc Date: Tue, 3 Jan 2023 13:29:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FJUpload.vue | 8 +- src/components/drawers/AddFaceteach.vue | 5 +- src/components/drawers/AddHomework.vue | 2 +- src/views/courselibrary/CoursewareManage.vue | 308 +++++++------------ src/views/courselibrary/courseModal.vue | 29 +- 5 files changed, 138 insertions(+), 214 deletions(-) diff --git a/src/components/common/FJUpload.vue b/src/components/common/FJUpload.vue index 19c34c28..d5d3c265 100644 --- a/src/components/common/FJUpload.vue +++ b/src/components/common/FJUpload.vue @@ -3,13 +3,13 @@
- + 附件:
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
-
+
+ diff --git a/src/components/drawers/router/RouterCommonManage.vue b/src/components/drawers/router/RouterCommonManage.vue index 7a0a8e3c..e852c6c6 100644 --- a/src/components/drawers/router/RouterCommonManage.vue +++ b/src/components/drawers/router/RouterCommonManage.vue @@ -66,7 +66,7 @@
搜索
@@ -82,8 +82,8 @@
催促学习
-
-
+
+
导出数据
@@ -92,7 +92,7 @@ style="border: 1px solid #f2f6fe" :columns="tableDataFunc()" :data-source="tabledata" - :loading="tableDataTotal === -1 ? true : false" + :loading="tableDataTotalLoading" :scroll="{ x: 900 }" :pagination="false" /> @@ -106,7 +106,7 @@ :current="currentPage" :total="tableDataTotal" class="pagination" - @change="onChange" + @change="changePaginationStu" v-if="tableDataTotal > 10" />
@@ -114,8 +114,8 @@
- - + +
@@ -125,6 +125,7 @@ import { toRefs, reactive, onMounted, onUnmounted } from "vue"; import { message } from "ant-design-vue"; // import * as api from "../../../api/index"; +import * as api from '../../../api/indexTaskManage'; export default { name: "RouterCommonManage", @@ -137,6 +138,10 @@ export default { type: String, default: "", }, + levelName: { + type: String, + default: "", + }, projectTaskId: { type: Number, default: null, @@ -161,82 +166,80 @@ export default { pageSize: 10, currentPage: 1, tableDataTotal: 0, - projectName: null, + projectName: "", projectNameList: [ + // { + // id: 1, + // value: "-1", + // label: "未开始", + // }, { id: 1, - value: "-1", - label: "未开始", - }, - { - id: 2, value: "0", label: "未完成", }, { - id: 3, + id: 2, value: "1", label: "已完成", }, ], - tabledata: [ - { - workNum: "123", - userName: "li", - deptName: "开发", - jobName: "前端开发", - level:"关卡一", - time: "2022-07-22 14:00:30", - status: "已完成", - }, - ], + tabledata: [], + tableDataTotalLoading: true, // 表格loading加载配置 }); const tableDataFunc = () => { const columns = [ { title: "工号", - dataIndex: "workNum", - key: "workNum", + dataIndex: "studentUserNo", + key: "studentUserNo", width: 50, align: "center", className: "h head", }, { title: "姓名", - dataIndex: "userName", - key: "userName", + dataIndex: "studentName", + key: "studentName", width: 50, align: "center", className: "h head", }, { title: "所在部门", - dataIndex: "deptName", - key: "deptName", + dataIndex: "studentDepartName", + key: "studentDepartName", width: 60, align: "center", className: "h", }, { title: "所在岗位", - dataIndex: "jobName", - key: "jobName", + dataIndex: "studentJobName", + key: "studentJobName", width: 60, align: "center", className: "h", }, { title: "学员关卡", - dataIndex: "level", - key: "level", + dataIndex: "currentStageName", + key: "currentStageName", width: 60, align: "center", className: "h", + customRender: (text) => { + return ( +
+ {props.levelName} +
+ ); + } }, { title: "完成时间", - dataIndex: "time", - key: "time", + dataIndex: "endStudyTime", + key: "endStudyTime", width: 100, align: "center", className: "h", @@ -248,6 +251,13 @@ export default { width: 60, align: "center", className: "h", + customRender: (text) => { + return ( +
+ {text.record.status==0?"未完成":"已完成"} +
+ ); + } }, ]; return columns; @@ -262,6 +272,8 @@ export default { }; const afterVisibleChange = (bol) => { if (bol == true) { + console.log('当前是什么类型',props.datasource.type) + state.tableDataTotalLoading = true; getData(); } }; @@ -277,18 +289,80 @@ export default { console.log("Page: ", pageNumber); }; + // 获取数据 function getData() { - state.tabledata = [ - { - workNum: "123", - userName: "li", - deptName: "开发", - jobName: "前端开发", - level:"关卡一", - time: "2022-07-22 14:00:30", - status: "已完成", - }, - ] + if(props.datasource.type==11){ + // 此处为获取评估学员的接口 - 如后续还有用到此接口的公共任务可直接在if里面加||判断即可 + console.log('我是传递的查询参数',{ + pageNo:state.currentPage, + pageSize:state.pageSize, + currentStageId:props.datasource.chapterId, + type: 2, + pid: props.datasource.routerId, + status: state.projectName, + studentName: state.name + }) + api.AssessmentManagementMessage({ + pageNo:state.currentPage, + pageSize:state.pageSize, + currentStageId:props.datasource.chapterId, + type: 2, + pid: props.datasource.routerId, + status: state.projectName, + studentName: state.name + }).then(res=>{ + console.log(res) + if(res.status==200){ + state.tabledata = res.data.data.records; + state.tableDataTotal =res.data.data.total; + state.tableDataTotalLoading = false; + } + }).catch(err=>{ + console.log(err) + state.tableDataTotalLoading = false; + state.tabledata = []; + }) + }else{ + state.tableDataTotalLoading = false; + state.tabledata = []; + } + } + + // 搜索按钮 + function searchTaskList() { + state.currentPage = 1; + state.tableDataTotalLoading = true; + getData(); + } + // 重置按钮 + function resetTaskList() { + state.tableDataTotalLoading = true; + state.currentPage = 1; + state.name = ""; + state.projectName = ""; + getData(); + } + + //分页 + const changePaginationStu = (page) => { + state.tableDataTotalLoading = true; + state.currentPage = page; + getData(); + }; + + // 导出数据 + function exportTaskStu() { + api.ExportTaskStudent({ + pageNo:state.currentPage, + pageSize:state.pageSize, + currentStageId:props.datasource.chapterId, + type: 2, + pid: props.datasource.routerId + }).then(res=>{ + console.log(res) + }).catch(err=>{ + console.log(err) + }) } return { @@ -301,6 +375,10 @@ export default { onMounted, onUnmounted, onChange, + searchTaskList, + resetTaskList, + changePaginationStu, + exportTaskStu }; }, }; diff --git a/src/components/drawers/router/RouterExaminationManage.vue b/src/components/drawers/router/RouterExaminationManage.vue index cb469bd3..eb655985 100644 --- a/src/components/drawers/router/RouterExaminationManage.vue +++ b/src/components/drawers/router/RouterExaminationManage.vue @@ -347,6 +347,7 @@ } // 搜索 function searchTableData() { + state.currentPage = 1; state.loadingData = true; getData(); } diff --git a/src/views/learningpath/LevelAdd.vue b/src/views/learningpath/LevelAdd.vue index 3f985844..1cd6b32d 100644 --- a/src/views/learningpath/LevelAdd.vue +++ b/src/views/learningpath/LevelAdd.vue @@ -492,7 +492,7 @@ item.type === 11 || item.type === 12 || item.type === 9 - ? commonModel(item) + ? commonModel(item, value.name) : item.type === 2 ? faceTeachModel(item) : item.type === 4 @@ -1118,7 +1118,7 @@ - + @@ -1360,7 +1360,8 @@ export default { examinationData: '', evaluationData: '', homeworkData: '', - commonData: '' + commonData: '', + commonLevelName: '' }); @@ -1660,7 +1661,8 @@ export default { // 作业弹框名称 RouterHomeworkManage } // 在线、案例、外链、评估、直播、活动点击管理弹框 - const commonModel = (data) => { + const commonModel = (data, levelname) => { + state.commonLevelName = levelname; console.log(data) state.commonModelVisible = true; state.commonModelVisibleTitle = data.name; diff --git a/src/views/projectcenter/TaskPage.vue b/src/views/projectcenter/TaskPage.vue index e642111b..9b1599d2 100644 --- a/src/views/projectcenter/TaskPage.vue +++ b/src/views/projectcenter/TaskPage.vue @@ -613,14 +613,16 @@ item.type == '11' ? showOnline( item.name, - item.projectTaskId, - item.type + item.projectTaskId, + item.type, + item, + value.name ) : item.type == '2' ? showFace( item.name, item.projectTaskId, - item.type + item.type, ) : item.type == '4' ? showWork(item.name, item.projectTaskId) @@ -1095,6 +1097,8 @@ :projectTaskId="projectTaskId" :title="showTimeText" :itemsType="itemstype" + :datasource="commonData" + :levelName="commonLevelName" /> @@ -2447,6 +2451,8 @@ export default { codeInfo: null, //二维码标题 examData: "", + commonData: "", + commonLevelName: "" }); const levelList = reactive({ @@ -2693,8 +2699,11 @@ export default { state.TaskFaceImpStuvisible = true; }; //在线、案例、外链、讨论、评估、直播、活动管理页面 - const showOnline = (name, id, type) => { - console.log("点击管理并传了id"); + const showOnline = (name, id, type, datasource, levelname) => { + console.log("点击管理并传了id", datasource); + state.commonLevelName = levelname; + state.commonData = datasource; + state.onlineVisible = true; state.showTimeText = name; state.projectTaskId = id;