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

@@ -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);