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="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">添加活动</div> <div class="headerTitle" >添加活动</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@@ -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

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

View File

@@ -291,6 +291,7 @@ import { message } from "ant-design-vue";
import * as api from "../../api/indexLiveBroadcast"; import * as api from "../../api/indexLiveBroadcast";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
import { toDate } from "@/api/method"; import { toDate } from "@/api/method";
import { RouterEditTask } from "@/api/indexTask";
// import { useRouter } from "vue-router"; // import { useRouter } from "vue-router";
function getBase64(img, callback) { function getBase64(img, callback) {
const reader = new FileReader(); const reader = new FileReader();
@@ -329,6 +330,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isStudy: {
type: Number,
default: null,
},
}, },
setup(props, ctx) { setup(props, ctx) {
// const router = useRouter(); // const router = useRouter();
@@ -441,6 +446,7 @@ export default {
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addliveVisible", false); ctx.emit("update:addliveVisible", false);
console.log(props, "props");
state.radioV1 = ""; state.radioV1 = "";
state.playback = false; state.playback = false;
state.inputV6 = ""; state.inputV6 = "";
@@ -565,7 +571,7 @@ export default {
updateTime: "", updateTime: "",
updateUser: 0, updateUser: 0,
}; };
let name = state.inputV1;
api api
.createLiveBroadcast(state.obj) .createLiveBroadcast(state.obj)
.then((res) => { .then((res) => {
@@ -573,6 +579,27 @@ export default {
// console.log(state, 2222); // console.log(state, 2222);
message.success("提交成功"); message.success("提交成功");
closeDrawer(); closeDrawer();
if (props.isStudy == 1) {
console.log("hhhhh", name);
let objj = {
chapterId: 36,
courseId: 0,
duration: state.obj.liveDuration,
flag: true,
name: name,
routerId: 92,
routerTaskId: 0,
type: 6,
};
RouterEditTask(objj)
.then((res) => {
console.log(res, 11111);
})
.catch((err) => {
console.log(err, 1111);
});
} else {
apiTask apiTask
.addTask({ .addTask({
courseId: 0, courseId: 0,
@@ -595,6 +622,7 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}
}) })
.catch((err) => { .catch((err) => {
console.log(err, 2222); console.log(err, 2222);

View File

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

View File

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

View File

@@ -72,41 +72,15 @@
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1">取消</button> <button class="btn1">取消</button>
<button <button class="btn2" @click="createQueTit">确定</button>
class="btn2"
onclick="{()=> {
createVoteText()
}}"
>
确定
</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs } from "vue";
import { useRouter } from "vue-router";
import * as api from "../../api/indexVote"; import * as api from "../../api/indexVote";
import { message } from "ant-design-vue"; 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 { export default {
name: "CreVote", name: "CreVote",
// components: { // components: {
@@ -119,12 +93,6 @@ export default {
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
inputV1: "",
inputV2: "",
inputV3: "",
time: undefined,
endTimes: "",
startTimes: "",
questions: [ questions: [
{ {
inputV: "", inputV: "",
@@ -171,60 +139,54 @@ export default {
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", 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"
);
}
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 = { let obj = {
baseVote: "",
createTime: "", createTime: "",
createUser: 0, createUser: 0,
stem: "", optionDto: [
{
optionId: 0,
optionName: "",
optionPictureAddress: "",
},
],
optionId: 0,
optionName: "",
optionPictureAddress: "",
stem: state.questions[0].inputV,
stemId: 0, stemId: 0,
updateTime: "", updateTime: "",
updateUser: 0, updateUser: 0,
voteEndTime: state.endTimes,
voteExplain: "",
voteFlag: "",
voteId: 0,
voteName: state.inputV1,
voteStartTime: state.startTimes,
voteTag: "",
}; };
api api
.createVote(obj) .createOptionMessage(obj)
.then((res) => { .then((res) => {
setTimeout(() => {
console.log("创建成功", res); console.log("创建成功", res);
message.success("创建成功"); message.success("创建成功");
// state.createLoading = false; // ctx.emit("setStemId",obj.stem);
router.push("/leveladd"); closeDrawer();
// getLearnPath();
}, 1000);
}) })
.catch((err) => { .catch((err) => {
console.log("创建失败", err); console.log(err);
// state.createLoading = false;
}); });
}; };
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
rowSelection,
createVoteText,
addQue, addQue,
addOpt, addOpt,
createQueTit,
}; };
}, },
}; };

View File

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