mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 19:06:45 +08:00
feat:外链添加到阶段
This commit is contained in:
@@ -338,6 +338,10 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
chooseStageId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
// const router = useRouter();
|
||||
@@ -612,7 +616,7 @@ export default {
|
||||
name: state.obj.liveName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
stageId: 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 6,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">添加外链</div>
|
||||
<div class="headerTitle">{{ title }}外链</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -111,12 +111,25 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
chooseStageId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
isRefEdit: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
inputV2: "",
|
||||
textV1: "",
|
||||
title: props.isRefEdit == 2 ? "编辑" : "添加",
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
console.log(props, 1111);
|
||||
@@ -129,6 +142,8 @@ export default {
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
//编辑外链
|
||||
//创建外链
|
||||
const createExternalChain = () => {
|
||||
if (!state.inputV1) return message.warning("请输入外链名称");
|
||||
if (!state.inputV2) return message.warning("请输入链接");
|
||||
@@ -150,7 +165,7 @@ export default {
|
||||
console.log(res.data.data);
|
||||
message.success("提交成功");
|
||||
closeDrawer();
|
||||
|
||||
//学习路径的创建
|
||||
if (props.isStudy == 1) {
|
||||
let objj = {
|
||||
chapterId: 36,
|
||||
@@ -170,15 +185,16 @@ export default {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
} else {
|
||||
//项目的创建
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.linkName,
|
||||
projectId: 28,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
stageId: 3,
|
||||
stageId: props.chooseStageId,
|
||||
type: 7,
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -28,9 +28,7 @@
|
||||
<template #item="{ element }">
|
||||
<div
|
||||
class="item"
|
||||
:class="
|
||||
chooseStageId == element.id ? 'bgcactive' : ''
|
||||
"
|
||||
:class="chooseStageId == element.id ? 'bgcactive' : ''"
|
||||
@click="changebgc(element.id)"
|
||||
>
|
||||
<div class="itemle">
|
||||
@@ -173,6 +171,7 @@
|
||||
v-model:addliveVisible="addlivevisible"
|
||||
@changeData="updateTableData"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加直播侧弹窗 -->
|
||||
@@ -190,6 +189,9 @@
|
||||
<add-ref
|
||||
v-model:addrefVisible="addrefvisible"
|
||||
@changeData="updateTableData"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:isRefEdit="isRefEdit"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加外链侧弹窗 -->
|
||||
@@ -759,8 +761,8 @@ import * as apistage from "../../api/indexStage";
|
||||
import * as apimove from "../../api/indexMovetask";
|
||||
import draggable from "vuedraggable";
|
||||
import { storage } from "../../api/storage";
|
||||
import {updateExamination,deleteExaminationById} from "@/api/indexExam"
|
||||
import { updateWorkTaskUsing, deleteWorkTask} from "@/api/indexWork";
|
||||
import { updateExamination, deleteExaminationById } from "@/api/indexExam";
|
||||
import { updateWorkTaskUsing, deleteWorkTask } from "@/api/indexWork";
|
||||
|
||||
const drawercolumns = [
|
||||
{
|
||||
@@ -820,8 +822,11 @@ export default {
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
projectId: storage.get("projectId") ?JSON.parse(storage.get("projectId")) : null,
|
||||
projectId: storage.get("projectId")
|
||||
? JSON.parse(storage.get("projectId"))
|
||||
: null,
|
||||
chooseStageId: null,
|
||||
isRefEdit: 1, //外链编辑
|
||||
projectNameList: [
|
||||
{
|
||||
id: 1,
|
||||
@@ -1001,9 +1006,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.default();
|
||||
message.success("添加阶段成功");
|
||||
})
|
||||
@@ -1015,7 +1020,7 @@ export default {
|
||||
const getTableData = (tableData) => {
|
||||
let data = tableData;
|
||||
let array = [];
|
||||
console.log('data',data)
|
||||
console.log("data", data);
|
||||
data.map((value) => {
|
||||
let obj = {
|
||||
id: value.projectTaskId,
|
||||
@@ -1060,13 +1065,13 @@ export default {
|
||||
const getStageData = (tableData) => {
|
||||
let data = tableData;
|
||||
let array = [];
|
||||
console.log('tableData',data)
|
||||
console.log("tableData", data);
|
||||
data.map((value) => {
|
||||
let obj = {
|
||||
id: value.stageId,
|
||||
tit: value.name,
|
||||
name: value.remark,
|
||||
taskList:value.taskList,
|
||||
taskList: value.taskList,
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
@@ -1216,12 +1221,12 @@ export default {
|
||||
console.log("22222", res.data.data.stageList);
|
||||
// console.log("22222", res.data.data.stageList);
|
||||
let leng = res.data.data.stageList.length;
|
||||
if( leng > 0){
|
||||
//获取任务列表
|
||||
let arr = res.data.data.stageList[0].taskList;
|
||||
getTableData(arr);
|
||||
if (leng > 0) {
|
||||
//获取任务列表
|
||||
let arr = res.data.data.stageList[0].taskList;
|
||||
getTableData(arr);
|
||||
}
|
||||
|
||||
|
||||
let stagearr = res.data.data.stageList;
|
||||
console.log(stagearr, 111111);
|
||||
if (stagearr.length > 0) {
|
||||
@@ -1253,40 +1258,43 @@ export default {
|
||||
// 编辑考试
|
||||
const updateTest = (id) => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
"examinationDuration": '',
|
||||
"examinationEndTime": '',
|
||||
"examinationExplain": '',
|
||||
"examinationFlag": "",
|
||||
"examinationId": id || 0,
|
||||
"examinationLimit": '',
|
||||
"examinationName": '',
|
||||
"examinationPaperId": 0,
|
||||
"examinationPaperName": '',
|
||||
"examinationStartTime": '',
|
||||
"examinationTag": "",
|
||||
"passLine": '',
|
||||
"questionArrangement": '',
|
||||
"scoringModel": '',
|
||||
"showAnalysis": '',
|
||||
"showAnswers": '',
|
||||
"updateTime": "",
|
||||
"updateUser": 0
|
||||
}
|
||||
updateExamination(obj).then((res)=>{
|
||||
console.log(res);
|
||||
message.error(`编辑成功`);
|
||||
}).catch(()=>{
|
||||
message.error(`编辑失败`)
|
||||
})
|
||||
}
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
examinationDuration: "",
|
||||
examinationEndTime: "",
|
||||
examinationExplain: "",
|
||||
examinationFlag: "",
|
||||
examinationId: id || 0,
|
||||
examinationLimit: "",
|
||||
examinationName: "",
|
||||
examinationPaperId: 0,
|
||||
examinationPaperName: "",
|
||||
examinationStartTime: "",
|
||||
examinationTag: "",
|
||||
passLine: "",
|
||||
questionArrangement: "",
|
||||
scoringModel: "",
|
||||
showAnalysis: "",
|
||||
showAnswers: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
};
|
||||
updateExamination(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
message.error(`编辑成功`);
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`编辑失败`);
|
||||
});
|
||||
};
|
||||
// 删除考试
|
||||
const deleteTest = () => {
|
||||
let obj = {
|
||||
examinationId:0,
|
||||
}
|
||||
deleteExaminationById(obj).then((res) => {
|
||||
examinationId: 0,
|
||||
};
|
||||
deleteExaminationById(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
@@ -1295,14 +1303,15 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 删除作业
|
||||
const deleteWork = () => {
|
||||
let obj = {
|
||||
workId:0,
|
||||
}
|
||||
deleteWorkTask(obj).then((res) => {
|
||||
workId: 0,
|
||||
};
|
||||
deleteWorkTask(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
@@ -1311,29 +1320,31 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
// 编辑作业
|
||||
const updateWork = () => {
|
||||
let obj = {
|
||||
"createTime": "",
|
||||
"createUser": 0,
|
||||
"submitEndTime": '',
|
||||
"submitStartTime": '',
|
||||
"updateTime": "",
|
||||
"updateUser": 0,
|
||||
"workEnclosureAddress": "",
|
||||
"workFlag": "",
|
||||
"workId": 0,
|
||||
"workName": '',
|
||||
"workRequirement": '',
|
||||
"workTag": ""
|
||||
}
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
submitEndTime: "",
|
||||
submitStartTime: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
workEnclosureAddress: "",
|
||||
workFlag: "",
|
||||
workId: 0,
|
||||
workName: "",
|
||||
workRequirement: "",
|
||||
workTag: "",
|
||||
};
|
||||
|
||||
updateWorkTaskUsing(obj).then((res) => {
|
||||
console.log(res);
|
||||
}).catch((err) => {
|
||||
message.error(`编辑失败${err}`)
|
||||
})
|
||||
updateWorkTaskUsing(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`编辑失败${err}`);
|
||||
});
|
||||
};
|
||||
|
||||
//删除直播
|
||||
@@ -1698,43 +1709,43 @@ export default {
|
||||
//移动任务到阶段
|
||||
const moveTask = () => {
|
||||
let arr = state.selectRow;
|
||||
console.log("选择的行信息",arr);
|
||||
arr.map( value => {
|
||||
console.log("value:",value);
|
||||
console.log("选择的行信息", arr);
|
||||
arr.map((value) => {
|
||||
console.log("value:", value);
|
||||
let obj = {
|
||||
chapterId: state.chooseStageId,
|
||||
routerTaskIdList: [],
|
||||
}
|
||||
};
|
||||
apimove
|
||||
.moveTask(obj)
|
||||
.then((res) => {
|
||||
console.log("移动成功",res);
|
||||
console.log("移动成功", res);
|
||||
message.default();
|
||||
message.success("移动成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("移动失败",err);
|
||||
})
|
||||
})
|
||||
console.log("移动失败", err);
|
||||
});
|
||||
});
|
||||
};
|
||||
//批量删除
|
||||
const deleteTaskAll = () => {
|
||||
let arr = state.selectRow;
|
||||
console.log("选择的行信息",arr);
|
||||
arr.map( value => {
|
||||
console.log("选择的行信息", arr);
|
||||
arr.map((value) => {
|
||||
let obj = {
|
||||
projectTaskIds: value,
|
||||
}
|
||||
};
|
||||
api
|
||||
.deleteTask(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
})
|
||||
}
|
||||
.deleteTask(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
const onSelectChange = (selectedRowKeys) => {
|
||||
console.log("selectedRowKeys changed: ", selectedRowKeys);
|
||||
state.selectedRowKeys = selectedRowKeys;
|
||||
@@ -1835,11 +1846,11 @@ export default {
|
||||
const closeDelete = () => {
|
||||
state.deleteModal = false;
|
||||
};
|
||||
const changebgc = ( id) => {
|
||||
const changebgc = (id) => {
|
||||
state.isActive = !state.isActive;
|
||||
state.selectRow = [] //选择行
|
||||
state.selectAll = 0 //0:未选择,1:全选,2:部分选择
|
||||
console.log('state.level',id,state.level);
|
||||
state.selectRow = []; //选择行
|
||||
state.selectAll = 0; //0:未选择,1:全选,2:部分选择
|
||||
console.log("state.level", id, state.level);
|
||||
state.chooseStageId = id;
|
||||
let final = state.level.find((item) => item.id === id);
|
||||
getTableData(final.taskList);
|
||||
@@ -1900,6 +1911,10 @@ export default {
|
||||
const changeCourseType = (id) => {
|
||||
console.log("任务id", id);
|
||||
};
|
||||
//展示编辑外链弹窗
|
||||
const showDrawerEditRef = () => {
|
||||
state.addrefvisible = true;
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
selectProjectName,
|
||||
@@ -1960,6 +1975,7 @@ export default {
|
||||
updateWork,
|
||||
deleteTest,
|
||||
deleteWork,
|
||||
showDrawerEditRef,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -2824,7 +2840,7 @@ export default {
|
||||
display: flex;
|
||||
margin-left: 10px;
|
||||
height: 23px;
|
||||
position: relative;
|
||||
position: relative;
|
||||
.bi {
|
||||
// margin-top: 10px;
|
||||
width: 63px;
|
||||
|
||||
Reference in New Issue
Block a user