feat:活动添加到关卡任务列表

This commit is contained in:
岳佳鑫
2022-11-04 14:09:35 +08:00
parent 00dad1d5af
commit 1c4fb3930b
2 changed files with 49 additions and 18 deletions

View File

@@ -225,6 +225,7 @@
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexActivity"; import * as api from "../../api/indexActivity";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
import { RouterEditTask } from "@/api/indexTask"
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { toDate } from "../../api/method.js"; import { toDate } from "../../api/method.js";
const rowSelection = ref({ const rowSelection = ref({
@@ -252,8 +253,13 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isStudiscuss: {
type: Boolean,
default: false,
},
}, },
setup(props, ctx) { setup(props, ctx) {
//console.log("学习路径",props.isStudiscuss);
const state = reactive({ const state = reactive({
inputV1: "", inputV1: "",
inputV2: "", inputV2: "",
@@ -347,6 +353,25 @@ export default {
state.textV2 = ""; state.textV2 = "";
state.time = ""; state.time = "";
ctx.emit("update:addactiveVisible", false); ctx.emit("update:addactiveVisible", false);
console.log("学习路径",props.isStudiscuss);
if(props.isStudiscuss){
let editObj1 = {
chapterId:36,
courseId: 0,
duration: obj.activityDuration,
flag: true,
name: obj.activityName,
routerId: 92,
routerTaskId: 0,
type: 9,
}
RouterEditTask(editObj1).then(res => {
console.log("新增关卡任务成功",res);
closeDrawer();
}).catch(err => {
console.log("新增关卡任务失败",err);
})
}else{
apiTask apiTask
.addTask({ .addTask({
courseId: 0, courseId: 0,
@@ -368,6 +393,8 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}
}) })
.catch((err) => { .catch((err) => {
console.log("创建失败",err); console.log("创建失败",err);

View File

@@ -534,7 +534,7 @@
<!-- 添加活动侧弹窗 --> <!-- 添加活动侧弹窗 -->
<div> <div>
<add-active <add-active
v-model:addactiveVisible="addactivevisible" v-model:addactiveVisible="addactivevisible" v-model:isStudiscuss="isStudiscuss"
/> />
</div> </div>
<!-- 添加活动侧弹窗 --> <!-- 添加活动侧弹窗 -->
@@ -870,6 +870,7 @@ export default {
}; };
const showDrawerAddActive = () => { const showDrawerAddActive = () => {
state.addactivevisible = true; state.addactivevisible = true;
state.isStudiscuss = true;
}; };
//新建关卡 //新建关卡
const editChapter = () => { const editChapter = () => {
@@ -1093,8 +1094,10 @@ export default {
<span <span
style="color:#4EA6FF;margin-right:25px;cursor:pointer" style="color:#4EA6FF;margin-right:25px;cursor:pointer"
onClick={() => { onClick={() => {
console.log("编辑id",e.record.routerTaskId);
console.log("编辑类型",e.record.lei);
state.editID = e.record.routerTaskId; state.editID = e.record.routerTaskId;
state.addhomeworkvisible = true; //state.addhomeworkvisible = true;
}} }}
> >
编辑 编辑
@@ -1126,6 +1129,7 @@ export default {
"直播", "直播",
"外链", "外链",
"讨论", "讨论",
"活动",
"测评", "测评",
"评估", "评估",
"投票", "投票",