diff --git a/src/api/indexStudy.js b/src/api/indexStudy.js
new file mode 100644
index 00000000..d948affb
--- /dev/null
+++ b/src/api/indexStudy.js
@@ -0,0 +1,3 @@
+import http from "./config";
+//路径图删除任务
+export const deleteStudyTask = (obj) => http.delete('/admin/router/deleteTask', { params: obj })
\ No newline at end of file
diff --git a/src/components/drawers/AddRef.vue b/src/components/drawers/AddRef.vue
index 3b049523..5e24516f 100644
--- a/src/components/drawers/AddRef.vue
+++ b/src/components/drawers/AddRef.vue
@@ -382,4 +382,4 @@ export default {
}
}
}
-
+
\ No newline at end of file
diff --git a/src/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue
index 1223de1b..e491e9d3 100644
--- a/src/views/learningpath/LevelAddDetail.vue
+++ b/src/views/learningpath/LevelAddDetail.vue
@@ -501,12 +501,13 @@
margin-right: 25px;
cursor: pointer;
"
+ @click="decideType(element.lei, element.courseId)"
>
编辑
删除
@@ -516,22 +517,6 @@
-
-
@@ -780,9 +765,16 @@
-
+
{
state.AddImpStuvisible = true;
};
- const tableDataFunc = () => {
- const columns = [
- {
- title: "类型",
- dataIndex: "state",
- // width: "30%",
- key: "state",
- width: 60,
- align: "left",
- className: "classify",
- scopedSlots: { customRender: "action" }, //引入的插槽
- customRender: (text) => {
- // console.log(text.record.checked1);
- return (
-
-
{
- console.log("点击了");
- }}
- >
-
{text.record.lei}
-
- {/**
-
-
- {text.record.lei}
-
-*/}
-
- );
- },
- },
- {
- title: "任务名称",
- dataIndex: "creater",
- // width: "30%",
- key: "creater",
- width: 200,
- align: "center",
- className: "h",
- },
- {
- title: "必修/选修",
- dataIndex: "pubtime",
- key: "pubtime",
- // width: 100,
- align: "center",
- className: "h",
- scopedSlots: { customRender: "action" }, //引入的插槽
- customRender: (text) => {
- // console.log(text.record.checked1);
- return (
-
-
-
{
- console.log("点击了");
- text.record.checked1 = !text.record.checked1;
- }}
- />
-
-
-
- );
- },
- },
- {
- title: "时长",
- dataIndex: "cretime",
- key: "cretime",
- // width: 100,
- align: "center",
- className: "h",
- },
- {
- title: "操作",
- className: "h",
- dataIndex: "opacation",
- key: "opacation",
- // width: 100,
- align: "center",
- scopedSlots: { customRender: "action" }, //引入的插槽
- customRender: (e) => {
- return (
-
-
- {
- console.log("编辑id", e.record.routerTaskId);
- console.log("编辑类型", e.record.lei);
- state.editID = e.record.routerTaskId;
- //state.addhomeworkvisible = true;
- }}
- >
- 编辑
-
- {
- showDeleteModal(e.record.routerTaskId);
- }}
- >
- 删除
-
-
-
- );
- },
- },
- ];
- return columns;
- };
+ // const tableDataFunc = () => {
+ // const columns = [
+ // {
+ // title: "类型",
+ // dataIndex: "state",
+ // // width: "30%",
+ // key: "state",
+ // width: 60,
+ // align: "left",
+ // className: "classify",
+ // scopedSlots: { customRender: "action" }, //引入的插槽
+ // customRender: (text) => {
+ // // console.log(text.record.checked1);
+ // return (
+ //
+ //
{
+ // console.log("点击了");
+ // }}
+ // >
+ //
{text.record.lei}
+ //
+ // );
+ // },
+ // },
+ // {
+ // title: "任务名称",
+ // dataIndex: "creater",
+ // // width: "30%",
+ // key: "creater",
+ // width: 200,
+ // align: "center",
+ // className: "h",
+ // },
+ // {
+ // title: "必修/选修",
+ // dataIndex: "pubtime",
+ // key: "pubtime",
+ // // width: 100,
+ // align: "center",
+ // className: "h",
+ // scopedSlots: { customRender: "action" }, //引入的插槽
+ // customRender: (text) => {
+ // // console.log(text.record.checked1);
+ // return (
+ //
+ //
+ //
{
+ // console.log("点击了");
+ // text.record.checked1 = !text.record.checked1;
+ // }}
+ // />
+ //
+ //
+ // 必修
+ //
+ //
选修
+ //
+ //
+ //
+ // );
+ // },
+ // },
+ // {
+ // title: "时长",
+ // dataIndex: "cretime",
+ // key: "cretime",
+ // // width: 100,
+ // align: "center",
+ // className: "h",
+ // },
+ // {
+ // title: "操作",
+ // className: "h",
+ // dataIndex: "opacation",
+ // key: "opacation",
+ // // width: 100,
+ // align: "center",
+ // scopedSlots: { customRender: "action" }, //引入的插槽
+ // customRender: (e) => {
+ // return (
+ //
+ //
+ // {
+ // console.log("编辑id", e.record.routerTaskId);
+ // console.log("编辑类型", e.record.lei);
+ // state.editID = e.record.routerTaskId;
+ // //state.addhomeworkvisible = true;
+ // }}
+ // >
+ // 编辑
+ //
+ // {
+ // showDeleteModal(e.record.routerTaskId);
+ // }}
+ // >
+ // 删除
+ //
+ //
+ //
+ // );
+ // },
+ // },
+ // ];
+ // return columns;
+ // };
const checkType = (index) => {
let typeRules = [
"",
@@ -1383,13 +1374,6 @@ export default {
return (
{text.record.name}
-
- {/**
-
-
- {text.record.lei}
-
-*/}
);
},
@@ -1560,9 +1544,9 @@ export default {
});
const changebgc = (chapterId) => {
state.isactive = chapterId;
- state.selectRow = [] //选择行
- state.selectAll = 0 //0:未选择,1:全选,2:部分选择
- dataAssignment(chapterId);
+ state.selectRow = []; //选择行
+ state.selectAll = 0; //0:未选择,1:全选,2:部分选择
+ dataAssignment(chapterId);
};
const gqxy_hShow = () => {
state.gqxy_hs = !state.gqxy_hs;
@@ -1576,6 +1560,7 @@ export default {
};
const showDeleteModal = (id) => {
state.deleteID = id;
+ console.log(id);
state.deleteModal = true;
};
const closeConfirm = () => {
@@ -1584,14 +1569,17 @@ export default {
state.editID = "";
};
const deleteLevelTask = () => {
- RouterDeleteTask(state.listChoosedId)
- .then((res) => {
- console.log(`删除成功${res}`);
- message.success("删除成功");
- })
- .catch((err) => {
- console.log(`删除失败${err}`);
- });
+ deleteStudyTask({ routerTaskIds: state.deleteID }).then((res) =>
+ console.log("删除成功", res)
+ );
+ // RouterDeleteTask(state.listChoosedId)
+ // .then((res) => {
+ // console.log(`删除成功${res}`);
+ // message.success("删除成功");
+ // })
+ // .catch((err) => {
+ // console.log(`删除失败${err}`);
+ // });
};
const showDrawerAddLive = () => {
@@ -1665,44 +1653,65 @@ export default {
//批量删除任务
const deletecTaskAll = () => {
let arr = state.selectRow;
- console.log("选择的行信息",arr);
- arr.map( value => {
+ console.log("选择的行信息", arr);
+ arr.map((value) => {
let obj = {
routerTaskIds: value,
- }
- console.log("value",value);
+ };
+ console.log("value", value);
api
- .deleteTask(obj)
- .then((res) => {
- console.log(res);
- message.destroy();
- message.success("批量删除成功");
- })
- .catch((err) => {
- console.log(err);
- });
- })
- }
+ .deleteTask(obj)
+ .then((res) => {
+ console.log(res);
+ message.destroy();
+ message.success("批量删除成功");
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+ });
+ };
//移动任务到关卡
const moveTask = () => {
let obj = {
chapterId: state.isactive,
routerTaskIdList: state.selectRow,
- }
+ };
api
- .moveTask(obj)
- .then((res) => {
- console.log("移动成功",res);
- message.destroy();
- message.success("移动成功");
- })
- .catch((err) => {
- console.log("移动失败",err);
- })
- }
+ .moveTask(obj)
+ .then((res) => {
+ console.log("移动成功", res);
+ message.destroy();
+ message.success("移动成功");
+ })
+ .catch((err) => {
+ console.log("移动失败", err);
+ });
+ };
+ //打开编辑外链的弹窗
+ const showEditRefDrawer = (id) => {
+ state.addrefvisible = true;
+ state.isRefEdit = 2;
+ state.EditRefId = id;
+ };
+ //打开编辑直播的弹窗
+ const showEditLiveDrawer = (id) => {
+ state.addlivevisible = true;
+ state.isLiveEdit = 2;
+ state.EditLiveId = id;
+ };
+ //编辑的按钮
+ const decideType = (type, id) => {
+ console.log(type, id);
+ if (type == "外链") {
+ showEditRefDrawer(id);
+ } else if (type == "直播") {
+ showEditLiveDrawer(id);
+ }
+ };
return {
...toRefs(state),
- tableDataFunc,
+ // tableDataFunc,
tableDataFunc2,
showDrawer,
closeDrawer,
@@ -1737,6 +1746,10 @@ export default {
changeRow,
deletecTaskAll,
moveTask,
+ showDeleteModal,
+ showEditRefDrawer,
+ showEditLiveDrawer,
+ decideType,
};
},
};