From b652030ee59a5084a946df9e77a083c83ccc3713 Mon Sep 17 00:00:00 2001 From: lixg Date: Wed, 30 Nov 2022 21:48:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/drawers/AddDiscuss.vue | 15 +- src/components/drawers/AddHomework.vue | 138 ++++++------ src/components/drawers/AddLive.vue | 261 +++++++++++----------- src/components/drawers/AddTest.vue | 5 +- src/views/projectcenter/ClassAdd.vue | 5 +- src/views/projectcenter/ProjectAdd.vue | 5 +- src/views/projectcenter/ProjectManage.vue | 5 +- src/views/projectcenter/SonProject.vue | 5 +- src/views/projectcenter/TaskAdd.vue | 42 ++-- 9 files changed, 242 insertions(+), 239 deletions(-) diff --git a/src/components/drawers/AddDiscuss.vue b/src/components/drawers/AddDiscuss.vue index 090da93c..c9caa44e 100644 --- a/src/components/drawers/AddDiscuss.vue +++ b/src/components/drawers/AddDiscuss.vue @@ -128,7 +128,7 @@ export default { type: Number, default: null, }, - projectTemplateId:{ + projectTemplateId: { type: Number, default: null, }, @@ -165,7 +165,7 @@ export default { state.textV1 = ""; localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("chapterId", props.isactive); - } + }; const queryDiscuss = () => { if (props.edit) { //编辑讨 @@ -197,7 +197,6 @@ export default { type: 8, }) .then(() => { - //message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); }) .catch(() => { @@ -214,7 +213,6 @@ export default { type: 8, }) .then(() => { - //message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); }) .catch(() => { @@ -231,7 +229,6 @@ export default { type: 8, }) .then(() => { - //message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); }) .catch(() => { @@ -258,11 +255,11 @@ export default { updateTask(res); closeDrawer(); ctx.emit("changeData", false); - message.destroy() + message.destroy(); message.success("创建讨论成功"); }) .catch(() => { - message.destroy() + message.destroy(); message.error("创建讨论失败"); }); } else { @@ -272,11 +269,11 @@ export default { updateTask(res); closeDrawer(); ctx.emit("changeData", false); - message.destroy() + message.destroy(); message.success("创建讨论成功"); }) .catch(() => { - message.destroy() + message.destroy(); message.error("创建讨论失败"); }); } diff --git a/src/components/drawers/AddHomework.vue b/src/components/drawers/AddHomework.vue index f1411773..06762db8 100644 --- a/src/components/drawers/AddHomework.vue +++ b/src/components/drawers/AddHomework.vue @@ -169,7 +169,7 @@ export default { type: Boolean, default: false, }, - projectTemplateId:{ + projectTemplateId: { type: Number, default: null, }, @@ -263,21 +263,19 @@ export default { const fileList = ref([]); const closeDrawer = () => { - - formState.choosedTime = ""; ctx.emit("update:addhomeworkVisible", false); ctx.emit("update:edit", false); ctx.emit("update:EditWorkId", state.EditWorkId); - console.log("state.EditWorkId==============",state.EditWorkId); + console.log("state.EditWorkId==============", state.EditWorkId); localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("chapterId", props.isactive); fileList.value = []; resetForm(); }; const afterVisibleChange = () => { - if (props.EditWorkId >0) { - state.EditWorkId = props.EditWorkId; + if (props.EditWorkId > 0) { + state.EditWorkId = props.EditWorkId; queryWork(); } }; @@ -292,9 +290,10 @@ export default { workName: formState.workName, workRequirement: formState.workRequirement, }; - if (props.EditWorkId >0) { + if (props.EditWorkId > 0) { updateWorkTaskUsing(obj) .then((res) => { + // console.log("添加成功", res); updateTask(res); ctx.emit("changeData", false); closeDrawer(); @@ -306,6 +305,7 @@ export default { } else { createWorkTask(obj) .then((res) => { + console.log("添加成功", res); updateTask(res); ctx.emit("changeData", false); closeDrawer(); @@ -336,69 +336,73 @@ export default { }; // 新增编辑或新增项目任务 const updateTask = (res) => { - - if(props.faceLevel){ - state.EditWorkId = res.data.data.workId - - }else{ + if (props.faceLevel) { + state.EditWorkId = res.data.data.workId; + } else { if (props.isLevel == 1) { - let editObj1 = { - chapterId: props.isactive, - courseId: res.data.data.workId, - name: res.data.data.workName, - routerId: props.routerId, - routerTaskId: props.routerTaskId || 0, - type: 4, - }; + let editObj1 = { + chapterId: props.isactive, + courseId: res.data.data.workId, + name: res.data.data.workName, + routerId: props.routerId, + routerTaskId: props.routerTaskId || 0, + type: 4, + }; - RouterEditTask(editObj1) - .then(() => { - //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}关卡任务成功`); - - state.addLoading = false; - }) - .catch(() => { - //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}关卡任务失败`); - }); - } else if (props.isLevel == 2) { - let editObj = { - courseId: res.data.data.workId, - name: res.data.data.workName, - projectId: props.EditWorkId > 0 ? props.projectId : 0, - projectTaskId: props.projectTaskId || 0, - stageId: props.chooseStageId || 0 , - type: 4, - }; - ProjectEditTask(editObj) - .then(() => { - //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务成功`); - - state.addLoading = false; - }) - .catch(() => { - //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务失败`); - }); - } else if (props.isLevel == 3) { - console.log("projectTemplateId,===",props.projectTemplateId); - addTempTask({ - courseId: res.data.data.workId, - name: res.data.data.workName, - projectTemplateId:props.projectTemplateId, - projectTaskId: props.projectTaskId || 0, - stageId: props.chooseStageId || 0, - type: 4, - }) - .then(() => { - //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务成功`); - - state.addLoading = false; - }) - .catch(() => { - //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务失败`); - }); - } + RouterEditTask(editObj1) + .then(() => { + //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}关卡任务成功`); + + state.addLoading = false; + ctx.emit("changeData", false); + closeDrawer(); + }) + .catch(() => { + //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}关卡任务失败`); + }); + } else if (props.isLevel == 2) { + let editObj = { + courseId: res.data.data.workId, + name: res.data.data.workName, + projectId: props.projectId > 0 ? props.projectId : 0, + projectTaskId: props.projectTaskId || 0, + stageId: props.chooseStageId || 0, + type: 4, + }; + console.log("editObj", editObj); + ProjectEditTask(editObj) + .then((res) => { + //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务成功`); + console.log("chenggong", res); + state.addLoading = false; + ctx.emit("changeData", false); + closeDrawer(); + }) + .catch((err) => { + console.log("shibaii", err); + //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务失败`); + }); + } else if (props.isLevel == 3) { + console.log("projectTemplateId,===", props.projectTemplateId); + addTempTask({ + courseId: res.data.data.workId, + name: res.data.data.workName, + projectTemplateId: props.projectTemplateId, + projectTaskId: props.projectTaskId || 0, + stageId: props.chooseStageId || 0, + type: 4, + }) + .then(() => { + //message.success(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务成功`); + ctx.emit("changeData", false); + closeDrawer(); + state.addLoading = false; + }) + .catch(() => { + //message.error(`${props.EditWorkId > 0 ? "编辑" : "新增"}阶段任务失败`); + }); + } } - }; const cle = () => { diff --git a/src/components/drawers/AddLive.vue b/src/components/drawers/AddLive.vue index ae22dd14..851b7d88 100644 --- a/src/components/drawers/AddLive.vue +++ b/src/components/drawers/AddLive.vue @@ -33,7 +33,7 @@ @@ -45,7 +45,7 @@
@@ -122,42 +122,41 @@
-
-
- -
- 直播封面 +
+
+ +
+ 直播封面 +
+
+ + avatar +
+
+
+
-
- - - avatar -
-
-
-
-
-
-
-
-
支持图片格式为jpg/jpeg/png 图片最大为2MB
-
-
-
+
+ +
+
支持图片格式为jpg/jpeg/png 图片最大为2MB
+
+
+
@@ -179,7 +178,7 @@
-
+
回放链接: @@ -199,29 +198,32 @@ 评估:
- 需要评估 + 需要评估
-
-
+
-
- - 删除评估 -
- - +
+ + 删除评估 + +
+
-
考勤设置: @@ -346,8 +348,8 @@ function getBase64(img, callback) { export default { name: "AddLive", - components:{ - AssessmentList + components: { + AssessmentList, }, props: { addliveVisible: { @@ -394,7 +396,7 @@ export default { type: Number, default: null, }, - projectTemplateId:{ + projectTemplateId: { type: Number, default: null, }, @@ -409,8 +411,8 @@ export default { fetching: false, totalPages: 0, memberValue: { - value:"", - label:"" + value: "", + label: "", }, // 授课老师关键词 inputV1: "", //*直播名称 time: "", //*直播时间 @@ -434,9 +436,9 @@ export default { obj: {}, //要传的obj数据 assessment: [], //评估信息 assessmentvalue: null, - needEval:false, - otherSettings:false, - assessmentVisible:false, + needEval: false, + otherSettings: false, + assessmentVisible: false, }); const closeDrawer = () => { ctx.emit("update:addliveVisible", false); @@ -455,14 +457,14 @@ export default { state.textV1 = ""; state.switchC1 = ""; state.imageUrl = ""; - state.needEval=false; + state.needEval = false; state.otherSettings; ctx.emit("changeData", false); localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("chapterId", props.isactive); }; const afterVisibleChange = (bool) => { - if (props.edit&&bool) { + if (props.edit && bool) { queryLive(); } api @@ -512,7 +514,6 @@ export default { }); }; - const cloradio1 = (value) => { if (state.radioV1 === value.target._value) { state.radioV1 = ""; @@ -579,12 +580,12 @@ export default { //message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); }); } else if (props.isLevel == 3) { - console.log("props.projectTemplateId",props.projectTemplateId); + console.log("props.projectTemplateId", props.projectTemplateId); addTempTask({ courseId: res.data.data.liveId, duration: res.data.data.duration, name: res.data.data.liveName, - projectTemplateId:props.projectTemplateId, + projectTemplateId: props.projectTemplateId, projectTaskId: props.projectTaskId || 0, stageId: props.chooseStageId || 0, type: 6, @@ -599,9 +600,8 @@ export default { } }; const showAssessment = () => { - state.assessmentVisible = true; - console.log("hshs======",state.assessmentVisible); + console.log("hshs======", state.assessmentVisible); }; //创建直播 const updateLiveBroadcast = () => { @@ -651,7 +651,7 @@ export default { otherSettings: state.otherSettings, //1或0 signOutTime: state.inputV8, standardSettings: state.radioV1, //1或2 - isEvaluate:state.eedEval ? "1":"0", + isEvaluate: state.eedEval ? "1" : "0", }; if (props.edit) { api @@ -697,14 +697,14 @@ export default { image.src = reader.result; image.onload = () => { const formData = new FormData(); - formData.append("file", file); - console.log(file); - fileUp(formData).then((res) => { - if (res.data.code === 200) { - state.imageUrl = res.data.data; - } - }); - return resolve(true); + formData.append("file", file); + console.log(file); + fileUp(formData).then((res) => { + if (res.data.code === 200) { + state.imageUrl = res.data.data; + } + }); + return resolve(true); }; }; @@ -779,7 +779,7 @@ export default { state.discussSettings = "false"; } }; - + return { ...toRefs(state), afterVisibleChange, @@ -924,62 +924,61 @@ export default { } } .mbl_items2 { - display: flex; - align-items: start; - margin-top: 10px; - margin-bottom: 10px; - .i_bottom{ - margin-bottom: 30px; + display: flex; + align-items: start; + margin-top: 10px; + margin-bottom: 10px; + .i_bottom { + margin-bottom: 30px; + } + .item_nam { + width: 100px; + display: flex; + align-items: center; + justify-content: flex-end; + white-space: nowrap; + .asterisk_icon { + width: 10px; + height: 10px; + margin-right: 5px; + margin-top: -15px; + } + } + .item_inp { + flex: 1; + .i_upload_img { + width: 100px; + height: 100px; + border-radius: 8px; + } + .i_upload { + width: 100px; + height: 100px; + border: 1px solid #4ea6ff; + border-radius: 8px; + text-align: center; + align-items: center; + cursor: pointer; + .addimg { + position: relative; + .heng { + position: absolute; + top: 50px; + left: 25px; + width: 50px; + border: 1px solid #4ea6ff; } - .item_nam { - width: 100px; - display: flex; - align-items: center; - justify-content: flex-end; - white-space: nowrap; - .asterisk_icon { - width: 10px; - height: 10px; - margin-right: 5px; - margin-top: -15px; - } - } - .item_inp { - flex: 1; - .i_upload_img { - width: 100px; - height: 100px; - border-radius: 8px; - } - .i_upload { - width: 100px; - height: 100px; - border: 1px solid #4ea6ff; - border-radius: 8px; - text-align: center; - align-items: center; - cursor: pointer; - .addimg { - position: relative; - .heng { - position: absolute; - top: 50px; - left: 25px; - width: 50px; - border: 1px solid #4ea6ff; - } - .shu { - position: absolute; - top: 25px; - left: 50px; - height: 50px; - border: 1px solid #4ea6ff; - } - } - } + .shu { + position: absolute; + top: 25px; + left: 50px; + height: 50px; + border: 1px solid #4ea6ff; } } - + } + } + } } } .main_btns { diff --git a/src/components/drawers/AddTest.vue b/src/components/drawers/AddTest.vue index 6ca96e7b..6986478d 100644 --- a/src/components/drawers/AddTest.vue +++ b/src/components/drawers/AddTest.vue @@ -24,13 +24,14 @@ > 系统考试 -
-->
-
+ +
-->
-
+ +