feat:合并

This commit is contained in:
dongwug
2022-11-07 14:36:42 +08:00
8 changed files with 239 additions and 254 deletions

View File

@@ -1,28 +1,12 @@
import http from "./config"; import http from "./config";
//新建关卡 //新建关卡
export const editChapter = (obj) => http.post('/admin/router/editChapter', obj, { export const editChapter = (obj) => http.post('/admin/router/editChapter', obj);
headers: {
'token': '123'
}
});
//编辑关卡 //编辑关卡
export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj, { export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj);
headers: {
'token': '123'
}
});
//删除任务 //删除任务
export const deleteTask = (obj) => http.delete('/admin/router/deleteTask',{params: obj}, { export const deleteTask = (obj) => http.delete('/admin/router/deleteTask',{params: obj});
headers: {
'token': '123'
}
});
//移动任务到关卡 //移动任务到关卡
export const moveTask = (obj) => http.post('/admin/router/moveTask',obj,{ export const moveTask = (obj) => http.post('/admin/router/moveTask',obj);
headers: {
'token': '123'
}
});

View File

@@ -1,8 +1,4 @@
import http from "./config"; import http from "./config";
//移动任务到阶段 //移动任务到阶段
export const moveTask = (obj) => http.post('/admin/project/moveTask',obj,{ export const moveTask = (obj) => http.post('/admin/project/moveTask',obj)
headers: {
'token': '123'
}
})

View File

@@ -1,8 +1,4 @@
import http from "./config"; import http from "./config";
//添加阶段 //添加阶段
export const editStage = (obj) => http.post('/admin/project/editStage', obj, { export const editStage = (obj) => http.post('/admin/project/editStage', obj);
headers: {
'token': '123'
}
});

View File

@@ -7,11 +7,7 @@ export const getTask = (obj) => http.get('/admin/project/detail', { params: obj
}) })
//项目里的新建或编辑阶段任务 //项目里的新建或编辑阶段任务
export const addTask = (obj) => http.post('/admin/project/editTask', obj, { export const addTask = (obj) => http.post('/admin/project/editTask', obj)
headers: {
'token': '123'
}
})
//项目里的删除任务 //项目里的删除任务

View File

@@ -558,6 +558,7 @@ export default {
state.obj = { state.obj = {
afterSignIn: state.inputV6, afterSignIn: state.inputV6,
beforeSignIn: state.inputV7, beforeSignIn: state.inputV7,
assessmentId: 0,
createTime: "", createTime: "",
createUser: 0, createUser: 0,
// liveCover: state.fileList,//直播封面 // liveCover: state.fileList,//直播封面

View File

@@ -3,7 +3,6 @@
:visible="addrefVisible" :visible="addrefVisible"
class="drawerStyle addrefDrawer" class="drawerStyle addrefDrawer"
width="80%" width="80%"
title="添加外链"
placement="right" placement="right"
@after-visible-change="afterVisibleChange" @after-visible-change="afterVisibleChange"
> >
@@ -77,7 +76,7 @@
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref, onMounted } 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";
@@ -123,17 +122,22 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
EditRefId: {
type: Number,
default: null,
},
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
inputV1: "", inputV1: "",
inputV2: "", inputV2: "",
textV1: "", textV1: "",
title: props.isRefEdit == 2 ? "编辑" : "添加", title: null,
}); });
const closeDrawer = () => { const closeDrawer = () => {
console.log(props, 1111); console.log(props, 1111);
ctx.emit("update:addrefVisible", false); ctx.emit("update:addrefVisible", false);
ctx.emit("update:isRefEdit", 1);
console.log("props", props.routerId); console.log("props", props.routerId);
state.inputV2 = ""; state.inputV2 = "";
state.inputV1 = ""; state.inputV1 = "";
@@ -142,7 +146,7 @@ export default {
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
}; };
//编辑外链
//创建外链 //创建外链
const createExternalChain = () => { const createExternalChain = () => {
if (!state.inputV1) return message.warning("请输入外链名称"); if (!state.inputV1) return message.warning("请输入外链名称");
@@ -153,16 +157,27 @@ export default {
linkAddress: state.inputV2, linkAddress: state.inputV2,
linkDescription: state.textV1, linkDescription: state.textV1,
linkFlag: "", linkFlag: "",
linkId: 0, linkId: props.EditRefId == null ? 0 : props.EditRefId,
linkName: state.inputV1, linkName: state.inputV1,
linkTag: "", linkTag: "",
updateTime: "", updateTime: "",
updateUser: 0, updateUser: 0,
}; };
//编辑外链
if (props.isRefEdit == 2) {
api
.updateLinks(obj)
.then((res) => {
console.log("编辑成功", res);
message.success("编辑成功");
closeDrawer();
})
.catch((err) => console.log(err));
} else {
api api
.createExternalChain(obj) .createExternalChain(obj)
.then((res) => { .then((res) => {
console.log(res.data.data); console.log(res.data.data, "外链添加成功了");
message.success("提交成功"); message.success("提交成功");
closeDrawer(); closeDrawer();
//学习路径的创建 //学习路径的创建
@@ -188,7 +203,7 @@ export default {
//项目的创建 //项目的创建
apiTask apiTask
.addTask({ .addTask({
courseId: 0, courseId: res.data.data.linkId,
duration: 0, duration: 0,
flag: true, flag: true,
name: obj.linkName, name: obj.linkName,
@@ -212,7 +227,12 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}
}; };
//不生效
onMounted(() => {
state.title = props.isRefEdit == 2 ? "编辑" : "添加";
});
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,

View File

@@ -1683,14 +1683,9 @@ export default {
} }
//移动任务到关卡 //移动任务到关卡
const moveTask = () => { const moveTask = () => {
let arr = state.selectRow;
console.log("选择的行信息",arr);
console.log("选择的关卡id",state.isactive);
arr.map( value => {
console.log("value:",value);
let obj = { let obj = {
chapterId: state.isactive, chapterId: state.isactive,
routerTaskIdList: value, routerTaskIdList: state.selectRow,
} }
api api
.moveTask(obj) .moveTask(obj)
@@ -1702,8 +1697,7 @@ export default {
.catch((err) => { .catch((err) => {
console.log("移动失败",err); console.log("移动失败",err);
}) })
}) }
};
return { return {
...toRefs(state), ...toRefs(state),
tableDataFunc, tableDataFunc,

View File

@@ -192,6 +192,7 @@
v-model:projectId="projectId" v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId" v-model:chooseStageId="chooseStageId"
v-model:isRefEdit="isRefEdit" v-model:isRefEdit="isRefEdit"
v-model:EditRefId="EditRefId"
/> />
</div> </div>
<!-- 添加外链侧弹窗 --> <!-- 添加外链侧弹窗 -->
@@ -841,6 +842,7 @@ export default {
: null, : null,
chooseStageId: null, chooseStageId: null,
isRefEdit: 1, //外链编辑 isRefEdit: 1, //外链编辑
EditRefId: null, //要编辑的外链的id
projectNameList: [ projectNameList: [
{ {
id: 1, id: 1,
@@ -1070,6 +1072,7 @@ export default {
cretime: value.duration ? value.duration : "-", cretime: value.duration ? value.duration : "-",
checked1: value.flag ? true : false, checked1: value.flag ? true : false,
checked: false, //是否选中类型 checked: false, //是否选中类型
courseId: value.courseId,
}; };
array.push(obj); array.push(obj);
}); });
@@ -1093,135 +1096,128 @@ export default {
state.level = array; state.level = array;
}; };
const tableDataFunc = () => { // const tableDataFunc = () => {
const columns = [ // const columns = [
{ // {
title: "类型", // title: "类型",
dataIndex: "state", // dataIndex: "state",
// width: "30%", // // width: "30%",
key: "state", // key: "state",
width: 60, // width: 60,
align: "left", // align: "left",
className: "classify", // className: "classify",
scopedSlots: { customRender: "action" }, // scopedSlots: { customRender: "action" },
customRender: (text) => { // customRender: (text) => {
// console.log(text.record.checked1); // // console.log(text.record.checked1);
return ( // return (
<div class="racona"> // <div class="racona">
<div // <div
class="img" // class="img"
style={{ cursor: "pointer" }} // style={{ cursor: "pointer" }}
onClick={() => { // onClick={() => {
console.log("点击了"); // console.log("点击了");
}} // }}
></div> // ></div>
<span> {text.record.lei}</span> // <span> {text.record.lei}</span>
// </div>
{/** // );
<div class="img"></div> // },
<a-checkbox class="ch" checked={text.record.checkedd}> // },
{text.record.lei} // {
</a-checkbox> // title: "任务名称",
*/} // dataIndex: "creater",
</div> // // width: "30%",
); // key: "creater",
}, // width: 200,
}, // align: "center",
{ // className: "h",
title: "任务名称", // },
dataIndex: "creater", // {
// width: "30%", // title: "必修/选修",
key: "creater", // dataIndex: "pubtime",
width: 200, // key: "pubtime",
align: "center", // // width: 100,
className: "h", // align: "center",
}, // className: "h",
{ // scopedSlots: { customRender: "action" },
title: "必修/选修", // customRender: (text) => {
dataIndex: "pubtime", // // console.log(text.record.checked1);
key: "pubtime", // return (
// width: 100, // <div class="opat">
align: "center", // <div class="opacationt clearfix">
className: "h", // <a-switch
scopedSlots: { customRender: "action" }, // style="margin-left:-50px;margin-top:3px"
customRender: (text) => { // checked={text.record.checked1}
// console.log(text.record.checked1); // size="small"
return ( // active-color="red"
<div class="opat"> // onClick={() => {
<div class="opacationt clearfix"> // console.log("点击了");
<a-switch // text.record.checked1 = !text.record.checked1;
style="margin-left:-50px;margin-top:3px" // }}
checked={text.record.checked1} // />
size="small" // <div class="showt clearfix">
active-color="red" // <div
onClick={() => { // class="bi"
console.log("点击了"); // style={
text.record.checked1 = !text.record.checked1; // text.record.checked1 ? "z-index:999" : "z-index:998"
}} // }
/> // >
<div class="showt clearfix"> // 必修
<div // </div>
class="bi" // <div class="xuan">选修</div>
style={ // </div>
text.record.checked1 ? "z-index:999" : "z-index:998" // </div>
} // </div>
> // );
必修 // },
</div> // },
<div class="xuan">选修</div> // {
</div> // title: "时长",
</div> // dataIndex: "cretime",
</div> // key: "cretime",
); // // width: 100,
}, // align: "center",
}, // className: "h",
{ // },
title: "时长", // {
dataIndex: "cretime", // title: "操作",
key: "cretime", // className: "h",
// width: 100, // dataIndex: "opacation",
align: "center", // key: "opacation",
className: "h", // // width: 100,
}, // align: "center",
{ // scopedSlots: { customRender: "action" },
title: "操作", // customRender: (text) => {
className: "h", // return (
dataIndex: "opacation", // <div class="opa">
key: "opacation", // <div class="opacation">
// width: 100, // <span
align: "center", // onClick={() => {
scopedSlots: { customRender: "action" }, // state.editonlinevisible = true;
customRender: (text) => { // console.log(text, "编辑text");
return ( // editInvistPath();
<div class="opa"> // }}
<div class="opacation"> // style="color:#4EA6FF;margin-right:25px;cursor:pointer"
<span // >
onClick={() => { // 编辑
state.editonlinevisible = true; // </span>
console.log(text, "编辑text"); // <span
editInvistPath(); // style="color:#4EA6FF;cursor:pointer"
}} // onClick={() => {
style="color:#4EA6FF;margin-right:25px;cursor:pointer" // showDelete();
> // state.deleteID = text.record.id;
编辑 // }}
</span> // >
<span // 删除
style="color:#4EA6FF;cursor:pointer" // </span>
onClick={() => { // </div>
showDelete(); // </div>
state.deleteID = text.record.id; // );
}} // },
> // },
删除 // ];
</span> // return columns;
</div> // };
</div>
);
},
},
];
return columns;
};
//获取任务列表 //获取任务列表
const getTask = () => { const getTask = () => {
@@ -1734,13 +1730,9 @@ export default {
}; };
//移动任务到阶段 //移动任务到阶段
const moveTask = () => { const moveTask = () => {
let arr = state.selectRow;
console.log("选择的行信息", arr);
arr.map((value) => {
console.log("value:", value);
let obj ={ let obj ={
chapterId: state.chooseStageId, stageId: state.chooseStageId,
routerTaskIdList: value, projectTaskId: state.selectRow,
} }
apimove apimove
.moveTask(obj) .moveTask(obj)
@@ -1748,12 +1740,12 @@ export default {
console.log("移动成功",res); console.log("移动成功",res);
message.destroy(); message.destroy();
message.success("移动成功"); message.success("移动成功");
getTask();
}) })
.catch((err) => { .catch((err) => {
console.log("移动失败", err); console.log("移动失败", err);
}); })
}); }
};
//批量删除 //批量删除
const deleteTaskAll = () => { const deleteTaskAll = () => {
let arr = state.selectRow; let arr = state.selectRow;
@@ -1940,15 +1932,20 @@ export default {
const changeCourseType = (id) => { const changeCourseType = (id) => {
console.log("任务id", id); console.log("任务id", id);
}; };
//展示编辑外链弹窗 //打开编辑外链弹窗
const showDrawerEditRef = () => { const showEditRefDrawer = (id) => {
state.addrefvisible = true; state.addrefvisible = true;
state.isRefEdit = 2;
state.EditRefId = id;
}; };
//编辑的按钮
const decideType = (type, id) => { const decideType = (type, id) => {
state.edit = true, state.edit = true,
console.log(type, id); console.log(type, id);
if (type == "测评") { if (type == "外链") {
showEditRefDrawer(id);
}
else if (type == "测评") {
showDrawerAddEval(id) showDrawerAddEval(id)
} }
else if (type == "评估") { else if (type == "评估") {
@@ -1962,7 +1959,7 @@ export default {
...toRefs(state), ...toRefs(state),
selectProjectName, selectProjectName,
selectProjectName2, selectProjectName2,
tableDataFunc, // tableDataFunc,
showModal, showModal,
closeModal, closeModal,
// showDrawer, // showDrawer,
@@ -2018,8 +2015,9 @@ export default {
updateWork, updateWork,
deleteTest, deleteTest,
deleteWork, deleteWork,
showDrawerEditRef, // showDrawerEditRef,
decideType, decideType,
showEditRefDrawer,
}; };
}, },
}; };