This commit is contained in:
dongwug
2022-11-07 18:32:24 +08:00
11 changed files with 496 additions and 481 deletions

56
package-lock.json generated
View File

@@ -1414,11 +1414,6 @@
"integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==",
"dev": true
},
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
},
"@sideway/address": {
"version": "4.1.4",
"resolved": "https://registry.npmmirror.com/@sideway/address/-/address-4.1.4.tgz",
@@ -2029,6 +2024,29 @@
"webpack-merge": "^5.7.3",
"webpack-virtual-modules": "^0.4.2",
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
}
}
},
"@vue/cli-shared-utils": {
@@ -2272,27 +2290,6 @@
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.39.tgz",
"integrity": "sha512-D3dl2ZB9qE6mTuWPk9RlhDeP1dgNRUKC3NJxji74A4yL8M2MwlhLKUC/49WHjrNzSPug58fWx/yFbaTzGAQSBw=="
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/web-component-wrapper": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
@@ -3958,6 +3955,13 @@
"lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.2.0"
},
"dependencies": {
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
}
}
},
"emoji-regex": {

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,3 +1,4 @@
function formatNumber(n) {
n = n.toString();
return n[1] ? n : "0" + n;
@@ -161,8 +162,12 @@ function autoComma(number) {
return 0;
}
}
const commonData={
timeout:50
}
export {
toDate,
getWeek,
autoComma,
commonData,
}

View File

@@ -438,3 +438,17 @@ textarea {
}
//弹窗--------------------------------------------------------
//loading--------------------------------------------------------
.aeLoading {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top:0,
}
//loading--------------------------------------------------------

View File

@@ -9,7 +9,8 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle" >添加活动</div>
<div v-if="edit" class="headerTitle">编辑活动</div>
<div v-else class="headerTitle">添加活动</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -272,6 +273,10 @@ export default {
chooseStageId: {
type: Number,
default: null,
},
edit: {
type: Boolean,
default: false,
}
},
setup(props, ctx) {
@@ -290,6 +295,7 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:addactiveVisible", false);
ctx.emit("update:edit", false);
state.radioV1 = "";
state.inputV1 = "";
state.inputV2 = "";

View File

@@ -66,6 +66,9 @@
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createDiscuss">确定</button>
</div>
</div>
<div class="aeLoading" :style="{display:addLoading?'flex':'none'}">
<a-spin :spinning="addLoading" tip="添加中..." />
</div>
</a-drawer>
</template>
@@ -123,6 +126,10 @@ export default {
chooseStageId: {
type: Number,
default: null,
},
editDiscussId: {
type: Number,
default: null,
}
},
setup(props, ctx) {
@@ -132,6 +139,7 @@ export default {
inputV2: "",
textV1: "",
checkedC1: "",
addLoading:false,
});
const closeDrawer = () => {
ctx.emit("update:adddiscussVisible", false);
@@ -149,6 +157,7 @@ export default {
message.destroy();
return message.warning("请输入讨论名称");
}
state.addLoading=true
let obj = {
discussName: state.inputV1, //讨论名称
discussExplain: state.textV1, //讨论说明
@@ -156,26 +165,36 @@ export default {
createTime: "", //创建时间
createUser: 0, //创建人
discussFlag: "", //活动逻辑删除标识
discussId: 0, //讨论Id
discussId: props.editDiscussId == null ? 0 : props.editDiscussId, //讨论Id
discussTag: "", //是否必修的标识
updateTime: "", //更新时间
updateUser: 0, //更新人
projectId: 0, //项目id
};
if(props.edit){
//console.log("编辑");
api
.updateDiscuss(obj)
.then((res) => {
console.log("编辑成功", res);
message.success("编辑成功");
closeDrawer();
})
.catch((err) => console.log(err));
}else{
api
.createDiscuss(obj)
.then((res) => {
console.log("创建成功", res);
state.inputV1 = "";
state.textV1 = "";
message.success("创建成功");
ctx.emit("update:adddiscussVisible", false);
//console.log("discussName",obj.discussName);
console.log("学习路径",props.isStudiscuss);
if(props.isStudiscuss){
let editObj1 = {
chapterId:props.isactive,
courseId: 0,
courseId: res.data.data.discussId,
duration: 0,
flag: true,
name: obj.discussName,
@@ -185,7 +204,12 @@ export default {
}
RouterEditTask(editObj1).then(res => {
console.log("新增关卡任务成功",res);
setTimeout(()=>{
message.success("创建成功");
ctx.emit("update:adddiscussVisible", false);
closeDrawer();
state.addLoading=false
},1000)
}).catch(err => {
console.log("新增关卡任务失败",err);
})
@@ -193,7 +217,7 @@ export default {
console.log("项目添加讨论");
apiTask
.addTask({
courseId: 0,
courseId: res.data.data.discussId,
duration: 0,
flag: true,
name: obj.discussName,
@@ -208,6 +232,7 @@ export default {
//重新获取任务列表
// apiTask.getTask({ projectId: 28 });
// router.push("/taskadd");
state.addLoading=false
})
.catch((err) => {
console.log(err);
@@ -217,6 +242,8 @@ export default {
.catch((err) => {
console.log("创建失败", err);
});
}
};
return {
...toRefs(state),
@@ -351,5 +378,6 @@ export default {
}
}
}
}
</style>

View File

@@ -226,23 +226,11 @@
<button class="samtn btn2" @click="createLearnPath">确定</button>
</div>
</div>
<div class="aeLoading" :style="{display:lpLoading?'flex':'none'}">
<a-spin :spinning="lpLoading" tip="添加中..." />
</div>
<!-- <div
style="
width: 300px;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
background:pink;
flex-shrink: 0;
position:absolute,
z-index: 100;
"
v-if="true"
>
<a-spin :spinning="true" />
</div> -->
</div>
</a-modal>
<!-- 编辑路径弹窗 -->
@@ -602,7 +590,7 @@ import QueryRight from "../../components/drawers/QueryRight";
import ManageRight from "../../components/drawers/ManageRight";
import * as api from "../../api/index1";
import { message } from "ant-design-vue";
import { toDate } from "../../api/method";
import { toDate,commonData } from "../../api/method";
import { storage } from "../../api/storage";
export default {
name: "learningPath",
@@ -732,6 +720,8 @@ export default {
routeStudentsNum: 0,
recallPathId: null, //撤回路径id
stopPathId: null, //停用路径id
lpLoading:false,
});
const selectProjectName = (value, index) => {
@@ -1298,7 +1288,7 @@ export default {
// message.destroy();
// return message.warning("请选择归属组织");
// }
// state.createLoading = true;
state.lpLoading = true;
let obj = {
name: state.pathName,
picUrl: "",
@@ -1308,19 +1298,19 @@ export default {
api
.createLearnPath(obj)
.then((res) => {
console.log("创建成功", res);
message.destroy();
message.success("创建成功");
router.push("/leveladd");
// setTimeout(() => {
// console.log("创建成功", res);
// message.destroy();
// message.success("创建成功");
// // state.createLoading = false;
// state.currentPage = 1;
// router.push("/leveladd");
// // getLearnPath();
// }, 1000);
setTimeout(() => {
console.log("创建成功", res);
message.destroy();
message.success("创建成功");
state.lpLoading = false;
state.currentPage = 1;
router.push("/leveladd");
// getLearnPath();
}, commonData.timeout);
})
.catch((err) => {
console.log("创建失败", err);

View File

@@ -501,12 +501,13 @@
margin-right: 25px;
cursor: pointer;
"
@click="decideType(element.lei, element.courseId)"
>
编辑
</span>
<span
style="color: #4ea6ff; cursor: pointer"
@click="showDelete(element.id)"
@click="showDeleteModal(element.id)"
>
删除
</span>
@@ -516,22 +517,6 @@
</div>
</template>
</draggable>
<!-- <a-table
style="border: 1px solid #f2f6fe"
:columns="tableDataFunc()"
:data-source="tableData"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:customRow="handleClickRow"
:pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
/> -->
</div>
<!-- 无数据样式 -->
<div class="notable" :style="{ display: stm_hs ? 'block' : 'none' }">
@@ -780,9 +765,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
@@ -831,9 +823,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",
@@ -863,6 +856,10 @@ export default {
name: "默认关卡",
},
],
isRefEdit: 1, //外链编辑
isLiveEdit: 1, //直播编辑
EditRefId: null, //要编辑的外链的id
EditLiveId: null, //要编辑的直播的id
tableData: [
{
key: 1,
@@ -1178,6 +1175,7 @@ export default {
cretime: element.duration,
checked1: element.flag,
routerTaskId: element.routerTaskId,
courseId: element.courseId,
};
array.push(obj);
});
@@ -1220,135 +1218,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 = [
"",
@@ -1383,13 +1374,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>
);
},
@@ -1560,8 +1544,8 @@ export default {
});
const changebgc = (chapterId) => {
state.isactive = chapterId;
state.selectRow = [] //选择行
state.selectAll = 0 //0未选择1全选2部分选择
state.selectRow = []; //选择行
state.selectAll = 0; //0未选择1全选2部分选择
dataAssignment(chapterId);
};
const gqxy_hShow = () => {
@@ -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,12 +1653,12 @@ 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) => {
@@ -1681,28 +1669,49 @@ export default {
.catch((err) => {
console.log(err);
});
})
}
});
};
//移动任务到关卡
const moveTask = () => {
let obj = {
chapterId: state.isactive,
routerTaskIdList: state.selectRow,
}
};
api
.moveTask(obj)
.then((res) => {
console.log("移动成功",res);
console.log("移动成功", res);
message.destroy();
message.success("移动成功");
})
.catch((err) => {
console.log("移动失败",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,
};
},
};

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>
<!-- 添加直播侧弹窗 -->
@@ -212,6 +214,7 @@
v-model:edit="edit"
v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId"
v-model:editDiscussId="editDiscussId"
@changeData="updateTableData"
/>
</div>
@@ -230,6 +233,7 @@
<add-active
v-model:addactiveVisible="addactivevisible"
v-model:projectId="projectId"
v-model:edit="edit"
v-model:chooseStageId="chooseStageId"
@changeData="updateTableData"
/>
@@ -843,7 +847,9 @@ export default {
? JSON.parse(storage.get("projectId"))
: null,
chooseStageId: null,
edit: false,
isRefEdit: 1, //外链编辑
isLiveEdit: 1, //直播编辑
EditRefId: null, //要编辑的外链的id
EditEvalId:null,
projectNameList: [
@@ -985,7 +991,6 @@ export default {
selectedRowKeys: [],
valuesname: "",
valuesnotice: "",
edit: false,
confirmModal: false, //确认添加阶段弹窗
cC: false,
cancelModal: false, //确认取消阶段弹窗
@@ -1026,10 +1031,10 @@ export default {
.editStage(obj)
.then((res) => {
console.log("添加阶段成功", res);
state.valuesname = "",
state.valuesnotice = "",
state.stage = false;
message.destroy();
(state.valuesname = ""),
(state.valuesnotice = ""),
(state.stage = false);
message.default();
message.success("添加阶段成功");
})
.catch((err) => {
@@ -1086,7 +1091,6 @@ export default {
const getStageData = (tableData) => {
let data = tableData;
let array = [];
console.log("tableData", data);
data.map((value) => {
let obj = {
id: value.stageId,
@@ -1099,128 +1103,135 @@ export default {
state.level = array;
};
// 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: (text) => {
// return (
// <div class="opa">
// <div class="opacation">
// <span
// onClick={() => {
// state.editonlinevisible = true;
// console.log(text, "编辑text");
// editInvistPath();
// }}
// style="color:#4EA6FF;margin-right:25px;cursor:pointer"
// >
// 编辑
// </span>
// <span
// style="color:#4EA6FF;cursor:pointer"
// onClick={() => {
// showDelete();
// state.deleteID = text.record.id;
// }}
// >
// 删除
// </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 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: (text) => {
return (
<div class="opa">
<div class="opacation">
<span
onClick={() => {
state.editonlinevisible = true;
console.log(text, "编辑text");
editInvistPath();
}}
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
>
编辑
</span>
<span
style="color:#4EA6FF;cursor:pointer"
onClick={() => {
showDelete();
state.deleteID = text.record.id;
}}
>
删除
</span>
</div>
</div>
);
},
},
];
return columns;
};
//获取任务列表
const getTask = () => {
@@ -1509,70 +1520,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 = {
@@ -1691,22 +1638,22 @@ export default {
};
//移动任务到阶段
const moveTask = () => {
let obj ={
let obj = {
stageId: state.chooseStageId,
projectTaskId: state.selectRow,
}
};
apimove
.moveTask(obj)
.then((res) => {
console.log("移动成功",res);
console.log("移动成功", res);
message.destroy();
message.success("移动成功");
getTask();
})
.catch((err) => {
console.log("移动失败", err);
})
}
});
};
//批量删除
const deleteTaskAll = () => {
let arr = state.selectRow;
@@ -1726,8 +1673,8 @@ export default {
.catch((err) => {
console.log(err);
});
})
}
});
};
const onSelectChange = (selectedRowKeys) => {
console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys;
@@ -1899,6 +1846,12 @@ export default {
state.isRefEdit = 2;
state.EditRefId = id;
};
//打开编辑直播的弹窗
const showEditLiveDrawer = (id) => {
state.addlivevisible = true;
state.isLiveEdit = 2;
state.EditLiveId = id;
};
//打开测评外链的弹窗
const showEditEvalDrawer = (id) => {
console.log('222222222222222222222',id);
@@ -1907,13 +1860,16 @@ export default {
};
//编辑的按钮
const decideType = (type, id) => {
state.edit = true,
state.edit = true;
console.log(type, id);
if (type == "外链") {
showEditRefDrawer(id);
}
else if (type == "直播") {
showEditLiveDrawer(id);
}
else if (type == "测评") {
showEditEvalDrawer(id)
showDrawerAddEval(id)
}
else if (type == "评估") {
showDrawerAddInvist(id)
@@ -1929,7 +1885,7 @@ export default {
...toRefs(state),
selectProjectName,
selectProjectName2,
// tableDataFunc,
tableDataFunc,
showModal,
closeModal,
// showDrawer,
@@ -1967,8 +1923,6 @@ export default {
deleteVoteText,
editActivity,
deleteInvistText,
editLiveBroadcast,
editExternal,
editInvistPath,
editVotePath,
getTableData,
@@ -1985,9 +1939,9 @@ export default {
updateWork,
deleteTest,
deleteWork,
// showDrawerEditRef,
decideType,
showEditRefDrawer,
showEditLiveDrawer,
};
},
};
@@ -2378,9 +2332,7 @@ export default {
display: flex;
flex-direction: column;
align-items: center; // background-color: #bfa;
.chosen {
// background-color: pink;
}
.ghost {
// background-color: red;
opacity: 0 !important;