feat:合并

This commit is contained in:
李晓鸽
2022-11-04 15:52:10 +08:00
7 changed files with 197 additions and 143 deletions

View File

@@ -9,7 +9,7 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加活动</div>
<div class="headerTitle" >添加活动</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -225,6 +225,7 @@
import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexActivity";
import * as apiTask from "../../api/indexTaskadd";
import { RouterEditTask } from "@/api/indexTask"
import { message } from "ant-design-vue";
import { toDate } from "../../api/method.js";
const rowSelection = ref({
@@ -252,8 +253,13 @@ export default {
type: Boolean,
default: false,
},
isStudiscuss: {
type: Boolean,
default: false,
},
},
setup(props, ctx) {
//console.log("学习路径",props.isStudiscuss);
const state = reactive({
inputV1: "",
inputV2: "",
@@ -347,27 +353,48 @@ export default {
state.textV2 = "";
state.time = "";
ctx.emit("update:addactiveVisible", false);
apiTask
.addTask({
console.log("学习路径",props.isStudiscuss);
if(props.isStudiscuss){
let editObj1 = {
chapterId:36,
courseId: 0,
duration: obj.activityDuration,
flag: true,
name: obj.activityName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
routerId: 92,
routerTaskId: 0,
type: 9,
}
RouterEditTask(editObj1).then(res => {
console.log("新增关卡任务成功",res);
closeDrawer();
}).catch(err => {
console.log("新增关卡任务失败",err);
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err);
});
}else{
apiTask
.addTask({
courseId: 0,
duration: obj.activityDuration,
flag: true,
name: obj.activityName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 9,
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err);
});
}
})
.catch((err) => {
console.log("创建失败",err);

View File

@@ -276,7 +276,6 @@ export default {
RouterEditTask(editObj1)
.then((res) => {
console.log("调用学历路径添加接口后", res.data);
ctx.emit("changeData", false);
})
.catch((err) => {
console.log(err);

View File

@@ -291,6 +291,7 @@ import { message } from "ant-design-vue";
import * as api from "../../api/indexLiveBroadcast";
import * as apiTask from "../../api/indexTaskadd";
import { toDate } from "@/api/method";
import { RouterEditTask } from "@/api/indexTask";
// import { useRouter } from "vue-router";
function getBase64(img, callback) {
const reader = new FileReader();
@@ -329,6 +330,10 @@ export default {
type: Boolean,
default: false,
},
isStudy: {
type: Number,
default: null,
},
},
setup(props, ctx) {
// const router = useRouter();
@@ -441,6 +446,7 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:addliveVisible", false);
console.log(props, "props");
state.radioV1 = "";
state.playback = false;
state.inputV6 = "";
@@ -565,7 +571,7 @@ export default {
updateTime: "",
updateUser: 0,
};
let name = state.inputV1;
api
.createLiveBroadcast(state.obj)
.then((res) => {
@@ -573,28 +579,50 @@ export default {
// console.log(state, 2222);
message.success("提交成功");
closeDrawer();
apiTask
.addTask({
if (props.isStudy == 1) {
console.log("hhhhh", name);
let objj = {
chapterId: 36,
courseId: 0,
duration: state.obj.liveDuration,
flag: true,
name: state.obj.liveName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
name: name,
routerId: 92,
routerTaskId: 0,
type: 6,
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
//自定义事件给父组件传值
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err);
});
};
RouterEditTask(objj)
.then((res) => {
console.log(res, 11111);
})
.catch((err) => {
console.log(err, 1111);
});
} else {
apiTask
.addTask({
courseId: 0,
duration: state.obj.liveDuration,
flag: true,
name: state.obj.liveName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 6,
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
//自定义事件给父组件传值
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err);
});
}
})
.catch((err) => {
console.log(err, 2222);

View File

@@ -81,6 +81,7 @@ import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexExternalChain";
import * as apiTask from "../../api/indexTaskadd";
import { message } from "ant-design-vue";
import { RouterEditTask } from "@/api/indexTask";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -106,7 +107,7 @@ export default {
type: Boolean,
default: false,
},
routerId: {
isStudy: {
type: Number,
default: null,
},
@@ -118,6 +119,7 @@ export default {
textV1: "",
});
const closeDrawer = () => {
console.log(props, 1111);
ctx.emit("update:addrefVisible", false);
console.log("props", props.routerId);
state.inputV2 = "";
@@ -149,27 +151,47 @@ export default {
message.success("提交成功");
closeDrawer();
apiTask
.addTask({
if (props.isStudy == 1) {
let objj = {
chapterId: 36,
courseId: 0,
duration: 0,
flag: true,
name: obj.linkName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
routerId: 92,
routerTaskId: 0,
type: 7,
})
.then((res) => {
console.log("调用项目添加接口后111", res.data);
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err);
});
};
RouterEditTask(objj)
.then((res) => {
console.log(res, 11111);
})
.catch((err) => {
console.log(err, 1111);
});
} else {
apiTask
.addTask({
courseId: 0,
duration: 0,
flag: true,
name: obj.linkName,
projectId: 28,
projectTaskId: 0,
stageId: 3,
type: 7,
})
.then((res) => {
console.log("调用项目添加接口后111", res.data, 11111);
ctx.emit("changeData", false);
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
})
.catch((err) => {
console.log(err, 111111);
});
}
})
.catch((err) => {
console.log(err);

View File

@@ -52,7 +52,8 @@
</div>
<!-- 创建投票侧弹窗 -->
<div>
<cre-vote v-model:crevoteVisible="crevotevisible" />
<cre-vote v-model:crevoteVisible="crevotevisible"
@setStemId="changeStemId"/>
</div>
<!-- 创建投票侧弹窗 -->
</div>
@@ -132,6 +133,7 @@ const rowSelection = ref({
console.log(selected, selectedRows, changeRows);
},
});
export default {
name: "AddVote",
components: {
@@ -204,8 +206,9 @@ export default {
.createVote(obj)
.then((res) => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
message.success("创建成功");
// changeStemId();
closeDrawer();
apitaskadd
.addTask({
courseId: 0,
@@ -223,6 +226,9 @@ export default {
// state.createLoading = false;
});
};
const changeStemId = (stemId) => {
console.log(stemId);
}
return {
...toRefs(state),
showDrawerCreVote,
@@ -231,6 +237,7 @@ export default {
rowSelection,
options1,
createVoteText,
changeStemId,
};
},
};

View File

@@ -72,41 +72,15 @@
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button
class="btn2"
onclick="{()=> {
createVoteText()
}}"
>
确定
</button>
<button class="btn2" @click="createQueTit">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import { reactive, toRefs } from "vue";
import * as api from "../../api/indexVote";
import { message } from "ant-design-vue";
import { toDate } from "../../api/method";
const router = useRouter();
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
"selectedRows: ",
selectedRows
);
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
},
});
export default {
name: "CreVote",
// components: {
@@ -119,12 +93,6 @@ export default {
},
setup(props, ctx) {
const state = reactive({
inputV1: "",
inputV2: "",
inputV3: "",
time: undefined,
endTimes: "",
startTimes: "",
questions: [
{
inputV: "",
@@ -171,60 +139,54 @@ export default {
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
//创建投票信息
const createVoteText = () => {
if (!state.inputV1) return message.info("请输入投票名称");
if (state.time != undefined) {
state.endTimes = toDate(
new Date(state.time[0].$d).getTime() / 1000,
"Y-M-D"
);
state.startTimes = toDate(
new Date(state.time[1].$d).getTime() / 1000,
"Y-M-D"
);
}
let obj = {
baseVote: "",
createTime: "",
createUser: 0,
stem: "",
stemId: 0,
updateTime: "",
updateUser: 0,
voteEndTime: state.endTimes,
voteExplain: "",
voteFlag: "",
voteId: 0,
voteName: state.inputV1,
voteStartTime: state.startTimes,
voteTag: "",
};
api
.createVote(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
// state.createLoading = false;
router.push("/leveladd");
// getLearnPath();
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
// state.createLoading = false;
});
const createQueTit = () => {
if (!state.questions[0].inputV) {
message.destroy();
return message.info("请输入题干");
}
// if (!state.questions.optins.opvalue) {
// message.destroy();
// return message.info("请输入选项");
// }
console.log(state.questions[0].inputV);
let obj = {
createTime: "",
createUser: 0,
optionDto: [
{
optionId: 0,
optionName: "",
optionPictureAddress: "",
},
],
optionId: 0,
optionName: "",
optionPictureAddress: "",
stem: state.questions[0].inputV,
stemId: 0,
updateTime: "",
updateUser: 0,
};
api
.createOptionMessage(obj)
.then((res) => {
console.log("创建成功", res);
message.success("创建成功");
// ctx.emit("setStemId",obj.stem);
closeDrawer();
})
.catch((err) => {
console.log(err);
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
createVoteText,
addQue,
addOpt,
createQueTit,
};
},
};

View File

@@ -534,7 +534,10 @@
<!-- 添加讨论侧弹窗 -->
<!-- 添加活动侧弹窗 -->
<div>
<add-active v-model:addactiveVisible="addactivevisible" />
<add-active
v-model:addactiveVisible="addactivevisible"
v-model:isStudiscuss="isStudiscuss"
/>
</div>
<!-- 添加活动侧弹窗 -->
<!-- 批量删除学员弹窗 -->
@@ -568,11 +571,12 @@
</div>
</a-modal>
<!-- 添加直播抽屉 -->
<add-live v-model:addliveVisible="addlivevisible" />
<add-ref
v-model:addrefVisible="addrefvisible"
v-model:routerId="routerId"
<add-live
v-model:addliveVisible="addlivevisible"
v-model:isStudy="isStudy"
/>
<!-- 添加外链抽屉 -->
<add-ref v-model:addrefVisible="addrefvisible" v-model:isStudy="isStudy" />
<!-- 是否确认删除任务弹窗 -->
<!-- 确认删除阶段弹窗 -->
<a-modal
@@ -641,7 +645,7 @@ export default {
},
setup() {
const state = reactive({
routerId: storage.get("routerId")?storage.get("routerId"):null,
routerId: storage.get("routerId") ? storage.get("routerId") : null,
level: [
{
chapterId: "1",
@@ -847,6 +851,7 @@ export default {
deleteModal: false, // 删除弹窗
deleteID: "", // 要删除的任务的id
editID: "", // 要编辑的任务id
isStudy: 1,
cC: false,
value1: "",
value2: "",
@@ -874,6 +879,7 @@ export default {
};
const showDrawerAddActive = () => {
state.addactivevisible = true;
state.isStudiscuss = true;
};
//新建关卡
const editChapter = () => {
@@ -1097,8 +1103,10 @@ export default {
<span
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
onClick={() => {
console.log("编辑id", e.record.routerTaskId);
console.log("编辑类型", e.record.lei);
state.editID = e.record.routerTaskId;
state.addhomeworkvisible = true;
//state.addhomeworkvisible = true;
}}
>
编辑
@@ -1130,6 +1138,7 @@ export default {
"直播",
"外链",
"讨论",
"活动",
"测评",
"评估",
"投票",