feat:合并

This commit is contained in:
lixg
2023-02-24 20:34:56 +08:00
3 changed files with 176 additions and 195 deletions

View File

@@ -315,96 +315,36 @@
:pagination="false"
:scroll="{ x: 'max-content' }"
>
<template #operation="{ record }">
<template #operation="{ text,record,index }">
<a-space>
<a-button
v-if="record.auditStatus === 2 && checkPer(record.permissions)"
@click="() => handlePush(record, String(record.courseform))"
type="link"
>发布
<a-button v-if="record.auditStatus===2 && checkPer(record.permissions)"
@click="() => handlePush(text,index)" type="link">发布
</a-button>
<a-button
v-if="record.auditStatus === 0 && checkPer(record.permissions)"
@click="() => handleSubmit(record, String(record.courseform))"
type="link"
>提交审核
<a-button v-if="record.auditStatus===0 && checkPer(record.permissions)"
@click="() => handleSubmit(text,index)" type="link">提交审核
</a-button>
<a-button
v-if="
(record.auditStatus === 0 || record.auditStatus === -1) &&
checkPer(record.permissions)
"
@click="() => handleEdit(record, String(record.courseform))"
type="link"
>编辑
<a-button v-if="(record.auditStatus===0 || record.auditStatus===-1) && checkPer(record.permissions)"
@click="() => handleEdit(record, String(record.courseform))" type="link">编辑
</a-button>
<a-button
v-if="
(record.auditStatus === 2 || record.auditStatus === 3) &&
checkPer(record.permissions)
"
@click="() => handleStart(record, String(record.courseform))"
type="link"
>开课
<a-button v-if="(record.auditStatus===2 || record.auditStatus===3) && checkPer(record.permissions)"
@click="() => handleStart(record, String(record.courseform))" type="link">开课
</a-button>
<a-button
@click="() => handleLook(record, String(record.courseform))"
type="link"
>查看
<a-button @click="() => handleLook(record, String(record.courseform))" type="link">查看
</a-button>
<a-button
v-if="
(record.auditStatus === 2 || record.auditStatus === 3) &&
checkPer(record.permissions)
"
@click="() => handleGuan22(record, String(record.courseform))"
type="link"
>管理
<a-button v-if="(record.auditStatus===2 || record.auditStatus===3) && checkPer(record.permissions)"
@click="() => handleGuan22(record, String(record.courseform))" type="link">管理
</a-button>
<DropDown v-if="checkPer(record.permissions)" value="授权">
<OwnerTableModelStudent
:types="[10, 11, 12]"
:id="record.offcourseId"
>权限名单</OwnerTableModelStudent
>
<CommonStudent :type="10" :id="record.offcourseId" title="查看权"
>查看权</CommonStudent
>
<CommonStudent :type="11" :id="record.offcourseId" title="管理权"
>管理权</CommonStudent
>
<OwnerTableModelStudent :types="[10,11,12]" :id="record.offcourseId">权限名单</OwnerTableModelStudent>
<CommonStudent :type="10" :id="record.offcourseId" title="查看权">查看权</CommonStudent>
<CommonStudent :type="11" :id="record.offcourseId" title="管理权">管理权</CommonStudent>
</DropDown>
<DropDown v-if="checkPer(record.permissions)" value="更多">
<a-button
@click="() => handleCopy(record, String(record.courseform))"
type="link"
>复制</a-button
>
<a-button
@click="
() => handleRejectExit(record, String(record.courseform))
"
type="link"
>撤回</a-button
>
<a-button
v-if="record.status"
@click="() => handleStop(record, String(record.courseform))"
type="link"
>停用</a-button
>
<a-button
v-else
@click="() => handleOpen(record, String(record.courseform))"
type="link"
>启用</a-button
>
<a-button
@click="() => handleDelete(record, String(record.courseform))"
type="link"
danger
>删除
<a-button @click="() => handleCopy(text)" type="link">复制</a-button>
<a-button v-if="(record.auditStatus===3 || record.auditStatus===2) && record.status && checkPer(record.permissions)" @click="() => handleRejectExit(text, index ,record)" type="link">撤回</a-button>
<a-button v-if="record.auditStatus===3 && record.status && checkPer(record.permissions)" @click="() => handleStop(text, index)" type="link">停用</a-button>
<a-button v-if="record.auditStatus===3 && !record.status && checkPer(record.permissions)" @click="() => handleOpen(text, index)" type="link">启用</a-button>
<a-button @click="() => handleDelete(text, index)" type="link" danger>删除
</a-button>
</DropDown>
</a-space>
@@ -1665,6 +1605,7 @@ import NameInput from "../../components/project/NameInput";
import ProjPowerList from "../../components/drawers/ProjPowerList";
import ProjCheckShip from "../../components/drawers/ProjCheckPower";
import AssessmentList from "../../components/drawers/AssessmentList.vue";
import dialog from "@/utils/dialog";
import {
list,
detail,
@@ -2290,8 +2231,8 @@ export default defineComponent({
dataIndex: "publishTime",
key: "10",
align: "center",
customRender: ({ text, auditStatus }) => {
return auditStatus == 3 ? text || "-" : "-";
customRender: ({text, auditStatus}) => {
return auditStatus == 3 ? (text || '-') : "-";
},
},
{
@@ -2300,14 +2241,7 @@ export default defineComponent({
key: "status",
dataIndex: "status",
align: "center",
customRender: ({ record }) => {
switch (String(record.status)) {
case "0":
return "停用";
case "1":
return "启用";
}
},
customRender: ({record}) => (record.auditStatus === 3 ? (record.status?'启用':'停用'): '-')
},
{
title: "操作",
@@ -2316,7 +2250,7 @@ export default defineComponent({
key: "id",
fixed: "right",
align: "right",
slots: { customRender: "operation" },
slots: {customRender: 'operation'}
},
],
//新加
@@ -2929,29 +2863,6 @@ export default defineComponent({
state.viewpowervisible = true;
};
// console.log('12344', sysTypeOptions)
// 处理数据字典
// function formateDictT(data) {
// for(let i=0;i<data.length;i++){
// data[i].title = data[i].dictName;
// data[i].value = data[i].dictCode;
// if(data[i].children.length!==0){
// for(let j=0;j<data[i].children.length;j++){
// data[i].children[j].title = data[i].children[j].dictName;
// data[i].children[j].value = data[i].children[j].dictCode;
// if(data[i].children[j].children.length!==0){
// for(let k=0; k<data[i].children[j].children.length; k++) {
// data[i].children[j].children[k].title = data[i].children[j].children[k].dictName;
// data[i].children[j].children[k].value = data[i].children[j].children[k].dictCode;
// }
// }
// }
// }
// }
// return data;
// }
// 富文本 sssssssssssssss
// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef();
@@ -2959,16 +2870,7 @@ export default defineComponent({
const valueHtml = ref("");
// // 模拟 ajax 异步获取内容
onMounted(() => {
setTimeout(() => {
// valueHtml.value = "<p>模拟 Ajax 异步设置内容</p>";
console.log("toolbar222222222222222");
console.log(editorRef.value);
// const toolbar = DomEditor.getToolbar(editorRef.value);
// const menu = editorRef.value.getAllMenuKeys();
// const bar = toolbar.getConfig().toolbarKeys;
// console.log(menu);
// console.log(bar);
}, 3500);
});
const toolbarConfig = {
@@ -3913,17 +3815,7 @@ export default defineComponent({
//是否允许未报名的签到:1是0否
state.xjkkradioV1 = 0;
}
/*
if (item.signWordFlag === 1) {
//签到是否需要口令:1是0否
state.xjkkradioV1 = 1;
}
if (item.signFlag === 0 && item.signWordFlag === 0) {
state.xjkkradioV1 = "";
}
*/
state.member = { value: item.teacherId, name: item.teacher };
state.member = {value: item.teacherId, name: item.teacher};
state.cstm_hs = true;
state.kk_eidt = true;
};
@@ -4008,13 +3900,14 @@ export default defineComponent({
state.graduate_hs = false;
state.addLoading = false;
};
const handleRejectExit = (itm, type) => {
if (type === "1") {
return;
}
state.offcourseId = itm.id;
state.delete_hs = true;
state.back_hs = true;
const handleRejectExit = (id, index,record) => {
dialog({
content: '确定撤回吗?'
, ok: () => {
message.success("撤回成功");
record.auditStatus === 3 ? (state.tableData1[index].auditStatus = 2) : (state.tableData1[index].auditStatus = 0)
handle({offcourseId: id, type: 0})
}})
};
const handleJoin = async () => {
@@ -4124,7 +4017,9 @@ export default defineComponent({
}
});
} else if (state.offcourseId) {
handle({ offcourseId: state.offcourseId, type: -1 }).then((res) => {
handle({
offcourseId: state.offcourseId, type: -1,
}).then((res) => {
if (res.data.code === 200) {
message.destroy();
message.success("删除成功");
@@ -4424,41 +4319,46 @@ export default defineComponent({
// // console.log(item);
// // });
// };
const handleDelete = (item, type) => {
console.log(item);
if (type === "1") {
return;
}
state.offcourseId = item.id;
const handleDelete = (id) => {
dialog({
content: '确定删除该课程吗?'
, ok: async () => {
message.success("删除成功");
state.tableLoading = true
await handle({offcourseId: id,type:-1})
getTableDate();
}})
};
const handleCopy = async (id) => {
dialog({
content: '确定复制该课程吗?'
, ok: async () => {
message.success("复制成功");
state.tableLoading = true
await copyCourse({offcourseId: id})
getTableDate();
}})
};
const handleSubmit = (id, index) => {
dialog({
content: '确定提交审核吗?'
, ok: () => {
message.success("提交成功");
state.tableData1[index].auditStatus = 1
handle({offcourseId: id, type: 1})
}})
};
const handlePush = (id,index) => {
dialog({
content: '确定发布该课程吗?'
, ok: () => {
message.success("发布成功");
state.tableData1[index].auditStatus = 3
handle({offcourseId: id, type: 3})
}})
};
state.delete_hs = true;
state.del_hs = true;
};
const handleCopy = async (itm, type) => {
if (type === "1") {
return;
}
state.offcourseId = itm.id;
state.delete_hs = true;
state.copy_hs = true;
};
const handleSubmit = async (itm, type) => {
if (type === "1") {
return;
}
state.offcourseId = itm.id;
state.submit_hs = true;
state.delete_hs = true;
};
const handlePush = async (itm, type) => {
if (type === "1") {
return;
}
state.offcourseId = itm.id;
state.push_hs = true;
state.delete_hs = true;
};
const handleCopyP = async (itm) => {
console.log(itm);
state.offcourseId = itm.offcourseId;
@@ -4467,23 +4367,23 @@ export default defineComponent({
state.delete_hs = true;
state.copy_hs = true;
};
const handleStop = (itm, type) => {
console.log(itm);
if (type === "1") {
return;
}
state.temp = itm;
state.offcourseId = itm.id;
state.delete_hs = true;
state.nouse_hs = true;
const handleStop = (id, index) => {
dialog({
content: '确定停用该课程吗?'
, ok: () => {
message.success("停用成功");
state.tableData1[index].status = 0
handle({offcourseId: id, type: -2})
}})
};
const handleOpen = async (itm, type) => {
if (type === "1") {
return;
}
state.offcourseId = itm.id;
state.useCourse = true;
state.delete_hs = true;
const handleOpen = async (id, index) => {
dialog({
content: '确定起用该课程吗?'
, ok: () => {
message.success("起用成功");
state.tableData1[index].status = 1
handle({offcourseId: id, type: 2})
}})
};
const handleStart = (item, type) => {
console.log(item);
@@ -4962,18 +4862,15 @@ export default defineComponent({
handelChangePageTea2,
submitReview,
reviewClick,
showPrower,
showOwnPrower,
showViewPrower,
showManagePrower,
closeOnlineCoursevisible,
handlelookMs,
handleLook,
logW,
logT,
qrcodeVisible,
};
},