feat:学习路径删除 增加任务到列表

This commit is contained in:
songwc
2022-11-07 16:25:54 +08:00
parent 2dc91fc559
commit f1a2fb4673
7 changed files with 330 additions and 418 deletions

View File

@@ -15,7 +15,11 @@ export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj }
})
//获取外链详细信息接口
export const getLink = (obj) => http.post('/link/getOne', { params: obj })
export const getLink = (obj) => http.post('/link/getOne', obj, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
})
// 更新外链数据
export const updateLinks = (obj) => http.post('/link/updateLinks', obj, {

3
src/api/indexStudy.js Normal file
View File

@@ -0,0 +1,3 @@
import http from "./config";
//路径图删除任务
export const deleteStudyTask = (obj) => http.delete('/admin/router/deleteTask', { params: obj })

View File

@@ -1,18 +1,14 @@
import http from "./config";
// 创建作业信息接口
export const createWorkTask = (obj) => http.post('/work/createWorkTask',obj,{
headers: {
'token': '123'
}
export const createWorkTask = (obj) => http.post('/work/createWorkTask', obj, {
headers: {
'token': '123'
}
});
// 删除作业信息接口
export const deleteWorkTask = (obj) => http.post('/work/deleteWorkTask',obj);
export const deleteWorkTask = (obj) => http.post('/work/deleteWorkTask', obj);
// 根据ID获取作业信息详情
export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById',obj,{
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
});
export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById', { params: obj });
// 修改作业信息接口
export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask',obj);
export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask', obj);

View File

@@ -10,7 +10,8 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加直播</div>
<div v-if="isLiveEdit == 2" class="headerTitle">编辑直播</div>
<div v-else class="headerTitle">添加直播</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -342,93 +343,26 @@ export default {
type: Number,
default: null,
},
isLiveEdit: {
type: Number,
default: null,
},
EditLiveId: {
type: Number,
default: null,
},
isactive: {
type: Number,
default: null,
},
routerId: {
type: Number,
default: null,
},
},
setup(props, ctx) {
// const router = useRouter();
const state = reactive({
tableData1: [
{
key: "1",
num: "JDF2022071100001",
name: "时间管理课程",
content: "通用力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "2",
num: "JDF2022071100001",
name: "管理能力课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "3",
num: "JDF2022071100001",
name: "快速换模SMED",
content: "通用力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "4",
num: "JDF2022071100001",
name: "巧妙对话人见人夸",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "5",
num: "JDF2022071100001",
name: "管理能力课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "6",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "7",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "8",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "9",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
],
currentPage: 1,
tableDataTotal: 100,
pageSize: 10,
@@ -454,6 +388,7 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:addliveVisible", false);
ctx.emit("update:isLiveEdit", 1);
console.log(props, "props");
state.radioV1 = "";
state.playback = false;
@@ -567,7 +502,7 @@ export default {
liveStartTime: startTime,
liveExplain: state.textV1,
liveFlag: "",
liveId: 0,
liveId: props.EditLiveId == null ? 0 : props.EditLiveId,
liveLink: state.inputV4,
liveName: state.inputV1,
livePlayback: "",
@@ -581,61 +516,74 @@ export default {
updateUser: 0,
};
let name = state.inputV1;
api
.createLiveBroadcast(state.obj)
.then((res) => {
console.log("调用添加直播接口后", res.data.data);
// console.log(state, 2222);
message.success("提交成功");
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
.addTask({
courseId: 0,
if (props.isLiveEdit == 2) {
api
.updateLiveBroadcastMessage(state.obj)
.then((res) => {
console.log("编辑成功", res);
message.success("编辑成功");
closeDrawer();
ctx.emit("changeData", false);
})
.catch((err) => console.log(err));
} else {
api
.createLiveBroadcast(state.obj)
.then((res) => {
console.log("调用添加直播接口后", res.data.data);
// console.log(state, 2222);
message.success("提交成功");
closeDrawer();
//学习路径的创建
if (props.isStudy == 1) {
console.log("hhhhh", name);
let objj = {
chapterId: props.isactive,
courseId: res.data.data.liveId,
duration: state.obj.liveDuration,
flag: true,
name: state.obj.liveName,
projectId: props.projectId,
projectTaskId: 0,
stageId: props.chooseStageId,
name: name,
routerId: props.routerId,
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);
});
}
})
.catch((err) => {
console.log(err, 2222);
});
};
RouterEditTask(objj)
.then((res) => {
console.log(res, 11111);
})
.catch((err) => {
console.log(err, 1111);
});
} else {
//项目的创建
apiTask
.addTask({
courseId: res.data.data.liveId,
duration: state.obj.liveDuration,
flag: true,
name: state.obj.liveName,
projectId: props.projectId,
projectTaskId: 0,
stageId: props.chooseStageId,
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);
});
}
};
return {

View File

@@ -8,7 +8,8 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">{{ title }}外链</div>
<div v-if="isRefEdit == 2" class="headerTitle">编辑外链</div>
<div v-else class="headerTitle">添加外链</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -126,13 +127,20 @@ export default {
type: Number,
default: null,
},
isactive: {
type: Number,
default: null,
},
routerId: {
type: Number,
default: null,
},
},
setup(props, ctx) {
const state = reactive({
inputV1: "",
inputV2: "",
textV1: "",
title: null,
});
const closeDrawer = () => {
console.log(props, 1111);
@@ -156,10 +164,10 @@ export default {
createTime: "",
linkAddress: state.inputV2,
linkDescription: state.textV1,
linkFlag: "",
linkFlag: "0",
linkId: props.EditRefId == null ? 0 : props.EditRefId,
linkName: state.inputV1,
linkTag: "",
linkTag: "0",
updateTime: "",
updateUser: 0,
};
@@ -171,9 +179,11 @@ export default {
console.log("编辑成功", res);
message.success("编辑成功");
closeDrawer();
ctx.emit("changeData", false);
})
.catch((err) => console.log(err));
} else {
//创建外链
api
.createExternalChain(obj)
.then((res) => {
@@ -183,12 +193,12 @@ export default {
//学习路径的创建
if (props.isStudy == 1) {
let objj = {
chapterId: 36,
courseId: 0,
chapterId: props.isactive,
courseId: res.data.data.linkId,
duration: 0,
flag: true,
name: obj.linkName,
routerId: 92,
routerId: props.routerId,
routerTaskId: 0,
type: 7,
};
@@ -229,10 +239,13 @@ export default {
});
}
};
//不生效
onMounted(() => {
state.title = props.isRefEdit == 2 ? "编辑" : "添加";
console.log("few");
// api.getLink({ linkId: props.EditRefId }).then((res) => {
// console.log(res), "获取成功";
// });
});
return {
...toRefs(state),
afterVisibleChange,

View File

@@ -504,7 +504,7 @@
</span>
<span
style="color: #4ea6ff; cursor: pointer"
@click="showDelete(element.id)"
@click="showDeleteModal(element.id)"
>
删除
</span>
@@ -778,9 +778,16 @@
<add-live
v-model:addliveVisible="addlivevisible"
v-model:isStudy="isStudy"
v-model:isactive="isactive"
v-model:routerId="routerId"
/>
<!-- 添加外链抽屉 -->
<add-ref v-model:addrefVisible="addrefvisible" v-model:isStudy="isStudy" />
<add-ref
v-model:addrefVisible="addrefvisible"
v-model:isStudy="isStudy"
v-model:isactive="isactive"
v-model:routerId="routerId"
/>
<!-- 是否确认删除任务弹窗 -->
<!-- 确认删除阶段弹窗 -->
<a-modal
@@ -829,9 +836,10 @@ import AddVote from "../../components/drawers/AddVote.vue";
import AddLive from "../../components/drawers/AddLive.vue";
import AddRef from "../../components/drawers/AddRef.vue";
import * as api from "../../api/indexLevel";
import { GetRouterDetail, RouterDeleteTask } from "../../api/indexTask";
import { GetRouterDetail } from "../../api/indexTask";
import { message } from "ant-design-vue";
import { storage } from "../../api/storage";
import { deleteStudyTask } from "../../api/indexStudy";
import draggable from "vuedraggable";
export default {
name: "LevelAddDetail",
@@ -1176,6 +1184,7 @@ export default {
cretime: element.duration,
checked1: element.flag,
routerTaskId: element.routerTaskId,
courseId: element.courseId,
};
array.push(obj);
});
@@ -1218,135 +1227,128 @@ export default {
const showImpStu = () => {
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 (
<div class="racona">
<div
class="img"
style={{ cursor: "pointer" }}
onClick={() => {
console.log("点击了");
}}
></div>
<span> {text.record.lei}</span>
{/**
<div class="img"></div>
<a-checkbox class="ch" checked={text.record.checkedd}>
{text.record.lei}
</a-checkbox>
*/}
</div>
);
},
},
{
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 (
<div class="opat">
<div class="opacationt clearfix">
<a-switch
style="margin-left:-50px;margin-top:3px"
checked={text.record.checked1}
size="small"
active-color="red"
onClick={() => {
console.log("点击了");
text.record.checked1 = !text.record.checked1;
}}
/>
<div class="showt clearfix">
<div
class="bi"
style={
text.record.checked1 ? "z-index:999" : "z-index:998"
}
>
必修
</div>
<div class="xuan">选修</div>
</div>
</div>
</div>
);
},
},
{
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 (
<div class="opa">
<div class="opacation">
<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;
}}
>
编辑
</span>
<span
style="color:#4EA6FF;cursor:pointer"
onClick={() => {
showDeleteModal(e.record.routerTaskId);
}}
>
删除
</span>
</div>
</div>
);
},
},
];
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 (
// <div class="racona">
// <div
// class="img"
// style={{ cursor: "pointer" }}
// onClick={() => {
// console.log("点击了");
// }}
// ></div>
// <span> {text.record.lei}</span>
// </div>
// );
// },
// },
// {
// 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 (
// <div class="opat">
// <div class="opacationt clearfix">
// <a-switch
// style="margin-left:-50px;margin-top:3px"
// checked={text.record.checked1}
// size="small"
// active-color="red"
// onClick={() => {
// console.log("点击了");
// text.record.checked1 = !text.record.checked1;
// }}
// />
// <div class="showt clearfix">
// <div
// class="bi"
// style={
// text.record.checked1 ? "z-index:999" : "z-index:998"
// }
// >
// 必修
// </div>
// <div class="xuan">选修</div>
// </div>
// </div>
// </div>
// );
// },
// },
// {
// 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 (
// <div class="opa">
// <div class="opacation">
// <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;
// }}
// >
// 编辑
// </span>
// <span
// style="color:#4EA6FF;cursor:pointer"
// onClick={() => {
// showDeleteModal(e.record.routerTaskId);
// }}
// >
// 删除
// </span>
// </div>
// </div>
// );
// },
// },
// ];
// return columns;
// };
const checkType = (index) => {
let typeRules = [
"",
@@ -1381,13 +1383,6 @@ export default {
return (
<div class="racona">
<span> {text.record.name}</span>
{/**
<div class="img"></div>
<a-checkbox class="ch" checked={text.record.checkedd}>
{text.record.lei}
</a-checkbox>
*/}
</div>
);
},
@@ -1558,9 +1553,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;
@@ -1574,6 +1569,7 @@ export default {
};
const showDeleteModal = (id) => {
state.deleteID = id;
console.log(id);
state.deleteModal = true;
};
const closeConfirm = () => {
@@ -1582,14 +1578,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 = () => {
@@ -1663,50 +1662,50 @@ 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 arr = state.selectRow;
console.log("选择的行信息",arr);
console.log("选择的关卡id",state.isactive);
arr.map( value => {
console.log("value:",value);
console.log("选择的行信息", arr);
console.log("选择的关卡id", state.isactive);
arr.map((value) => {
console.log("value:", value);
let obj = {
chapterId: state.isactive,
routerTaskIdList: value,
}
routerTaskIdList: value,
};
api
.moveTask(obj)
.then((res) => {
console.log("移动成功",res);
console.log("移动成功", res);
message.destroy();
message.success("移动成功");
})
.catch((err) => {
console.log("移动失败",err);
})
})
console.log("移动失败", err);
});
});
};
return {
...toRefs(state),
tableDataFunc,
// tableDataFunc,
tableDataFunc2,
showDrawer,
closeDrawer,
@@ -1741,6 +1740,7 @@ export default {
changeRow,
deletecTaskAll,
moveTask,
showDeleteModal,
};
},
};

View File

@@ -172,6 +172,8 @@
@changeData="updateTableData"
v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId"
v-model:isLiveEdit="isLiveEdit"
v-model:EditLiveId="EditLiveId"
/>
</div>
<!-- 添加直播侧弹窗 -->
@@ -285,8 +287,8 @@
<add-vote
v-model:addvoteVisible="addvotevisible"
@changeData="updateTableData"
v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId"
v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId"
/>
</div>
<!-- 添加投票侧弹窗 -->
@@ -839,7 +841,9 @@ export default {
: null,
chooseStageId: null,
isRefEdit: 1, //外链编辑
isLiveEdit: 1, //直播编辑
EditRefId: null, //要编辑的外链的id
EditLiveId: null, //要编辑的直播的id
projectNameList: [
{
id: 1,
@@ -1019,9 +1023,9 @@ export default {
.editStage(obj)
.then((res) => {
console.log("添加阶段成功", res);
state.valuesname = "",
state.valuesnotice = "",
state.stage = false;
(state.valuesname = ""),
(state.valuesnotice = ""),
(state.stage = false);
message.destroy();
message.success("添加阶段成功");
})
@@ -1534,69 +1538,6 @@ export default {
});
};
//编辑直播信息
const editLiveBroadcast = () => {
let obj = {
afterSignIn: "",
beforeSignIn: "",
createTime: "",
createUser: 0,
liveCover: "",
liveDuration: 0,
liveEndTime: "",
liveExplain: "",
liveFlag: "",
liveId: 0,
liveLink: "",
liveName: "",
livePlayback: "",
livePlaybackLink: "",
liveStartTime: "",
liveTag: "",
liveTeacherId: 0,
otherSettings: "",
signOutTime: "",
standardSettings: "",
updateTime: "",
updateUser: 0,
};
apilive
.updateLiveBroadcastMessage(obj)
.then((res) => {
console.log(res);
message.success("修改成功");
})
.catch((err) => {
console.log(err);
message.warn("修改失败");
});
};
//编辑外链信息
const editExternal = () => {
let obj = {
createTime: "",
createUser: 0,
linkAddress: "",
linkDescription: "",
linkFlag: "",
linkId: 0,
linkName: "",
linkTag: "",
updateTime: "",
updateUser: 0,
};
apiExternal
.updateLinks(obj)
.then((res) => {
console.log(res);
message.success("修改成功");
})
.catch((err) => {
console.log(err);
message.warn("修改失败");
});
};
//删除评估测试
const deleteInvistText = () => {
let obj = {
@@ -1722,11 +1663,11 @@ export default {
let obj = {
chapterId: state.chooseStageId,
routerTaskIdList: value,
}
};
apimove
.moveTask(obj)
.then((res) => {
console.log("移动成功",res);
console.log("移动成功", res);
message.destroy();
message.success("移动成功");
})
@@ -1744,18 +1685,18 @@ export default {
projectTaskIds: value,
};
api
.deleteTask(obj)
.then((res) => {
console.log(res);
message.destroy();
message.success("批量删除成功");
getTask();
})
.catch((err) => {
console.log(err);
});
})
}
.deleteTask(obj)
.then((res) => {
console.log(res);
message.destroy();
message.success("批量删除成功");
getTask();
})
.catch((err) => {
console.log(err);
});
});
};
const onSelectChange = (selectedRowKeys) => {
console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys;
@@ -1927,11 +1868,19 @@ export default {
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 {
@@ -1976,8 +1925,6 @@ export default {
editActivity,
editEvalPath,
deleteInvistText,
editLiveBroadcast,
editExternal,
editInvistPath,
editVotePath,
getTableData,
@@ -1996,6 +1943,7 @@ export default {
deleteWork,
decideType,
showEditRefDrawer,
showEditLiveDrawer,
};
},
};