feat:修改面授课封面图编辑

This commit is contained in:
lixg
2023-02-24 20:50:53 +08:00
parent 11ceb615b7
commit 910ab8eb69
2 changed files with 155 additions and 67 deletions

View File

@@ -315,36 +315,109 @@
:pagination="false" :pagination="false"
:scroll="{ x: 'max-content' }" :scroll="{ x: 'max-content' }"
> >
<template #operation="{ text,record,index }"> <template #operation="{ text, record, index }">
<a-space> <a-space>
<a-button v-if="record.auditStatus===2 && checkPer(record.permissions)" <a-button
@click="() => handlePush(text,index)" type="link">发布 v-if="record.auditStatus === 2 && checkPer(record.permissions)"
@click="() => handlePush(text, index)"
type="link"
>发布
</a-button> </a-button>
<a-button v-if="record.auditStatus===0 && checkPer(record.permissions)" <a-button
@click="() => handleSubmit(text,index)" type="link">提交审核 v-if="record.auditStatus === 0 && checkPer(record.permissions)"
@click="() => handleSubmit(text, index)"
type="link"
>提交审核
</a-button> </a-button>
<a-button v-if="(record.auditStatus===0 || record.auditStatus===-1) && checkPer(record.permissions)" <a-button
@click="() => handleEdit(record, String(record.courseform))" type="link">编辑 v-if="
(record.auditStatus === 0 || record.auditStatus === -1) &&
checkPer(record.permissions)
"
@click="() => handleEdit(record, String(record.courseform))"
type="link"
>编辑
</a-button> </a-button>
<a-button v-if="(record.auditStatus===2 || record.auditStatus===3) && checkPer(record.permissions)" <!-- <a-button
@click="() => handleStart(record, String(record.courseform))" type="link">开课 @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> </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>
<a-button v-if="(record.auditStatus===2 || record.auditStatus===3) && checkPer(record.permissions)" <a-button
@click="() => handleGuan22(record, String(record.courseform))" type="link">管理 v-if="
(record.auditStatus === 2 || record.auditStatus === 3) &&
checkPer(record.permissions)
"
@click="() => handleGuan22(record, String(record.courseform))"
type="link"
>管理
</a-button> </a-button>
<DropDown v-if="checkPer(record.permissions)" value="授权"> <DropDown v-if="checkPer(record.permissions)" value="授权">
<OwnerTableModelStudent :types="[10,11,12]" :id="record.offcourseId">权限名单</OwnerTableModelStudent> <OwnerTableModelStudent
<CommonStudent :type="10" :id="record.offcourseId" title="查看权">查看权</CommonStudent> :types="[10, 11, 12]"
<CommonStudent :type="11" :id="record.offcourseId" title="管理权">管理权</CommonStudent> :id="record.offcourseId"
>权限名单</OwnerTableModelStudent
>
<CommonStudent :type="10" :id="record.offcourseId" title="查看权"
>查看权</CommonStudent
>
<CommonStudent :type="11" :id="record.offcourseId" title="管理权"
>管理权</CommonStudent
>
</DropDown> </DropDown>
<DropDown v-if="checkPer(record.permissions)" value="更多"> <DropDown v-if="checkPer(record.permissions)" value="更多">
<a-button @click="() => handleCopy(text)" type="link">复制</a-button> <a-button @click="() => handleCopy(text)" type="link"
<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
<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
<a-button @click="() => handleDelete(text, index)" type="link" danger>删除 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> </a-button>
</DropDown> </DropDown>
</a-space> </a-space>
@@ -2231,8 +2304,8 @@ export default defineComponent({
dataIndex: "publishTime", dataIndex: "publishTime",
key: "10", key: "10",
align: "center", align: "center",
customRender: ({text, auditStatus}) => { customRender: ({ text, auditStatus }) => {
return auditStatus == 3 ? (text || '-') : "-"; return auditStatus == 3 ? text || "-" : "-";
}, },
}, },
{ {
@@ -2241,7 +2314,8 @@ export default defineComponent({
key: "status", key: "status",
dataIndex: "status", dataIndex: "status",
align: "center", align: "center",
customRender: ({record}) => (record.auditStatus === 3 ? (record.status?'启用':'停用'): '-') customRender: ({ record }) =>
record.auditStatus === 3 ? (record.status ? "启用" : "停用") : "-",
}, },
{ {
title: "操作", title: "操作",
@@ -2250,7 +2324,7 @@ export default defineComponent({
key: "id", key: "id",
fixed: "right", fixed: "right",
align: "right", align: "right",
slots: {customRender: 'operation'} slots: { customRender: "operation" },
}, },
], ],
//新加 //新加
@@ -2869,9 +2943,7 @@ export default defineComponent({
// 内容 HTML // 内容 HTML
const valueHtml = ref(""); const valueHtml = ref("");
// // 模拟 ajax 异步获取内容 // // 模拟 ajax 异步获取内容
onMounted(() => { onMounted(() => {});
});
const toolbarConfig = { const toolbarConfig = {
excludeKeys: ["insertVideo", "insertImage"], excludeKeys: ["insertVideo", "insertImage"],
@@ -3815,7 +3887,7 @@ export default defineComponent({
//是否允许未报名的签到:1是0否 //是否允许未报名的签到:1是0否
state.xjkkradioV1 = 0; state.xjkkradioV1 = 0;
} }
state.member = {value: item.teacherId, name: item.teacher}; state.member = { value: item.teacherId, name: item.teacher };
state.cstm_hs = true; state.cstm_hs = true;
state.kk_eidt = true; state.kk_eidt = true;
}; };
@@ -3900,14 +3972,17 @@ export default defineComponent({
state.graduate_hs = false; state.graduate_hs = false;
state.addLoading = false; state.addLoading = false;
}; };
const handleRejectExit = (id, index,record) => { const handleRejectExit = (id, index, record) => {
dialog({ dialog({
content: '确定撤回吗?' content: "确定撤回吗?",
, ok: () => { ok: () => {
message.success("撤回成功"); message.success("撤回成功");
record.auditStatus === 3 ? (state.tableData1[index].auditStatus = 2) : (state.tableData1[index].auditStatus = 0) record.auditStatus === 3
handle({offcourseId: id, type: 0}) ? (state.tableData1[index].auditStatus = 2)
}}) : (state.tableData1[index].auditStatus = 0);
handle({ offcourseId: id, type: 0 });
},
});
}; };
const handleJoin = async () => { const handleJoin = async () => {
@@ -4018,7 +4093,8 @@ export default defineComponent({
}); });
} else if (state.offcourseId) { } else if (state.offcourseId) {
handle({ handle({
offcourseId: state.offcourseId, type: -1, offcourseId: state.offcourseId,
type: -1,
}).then((res) => { }).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
message.destroy(); message.destroy();
@@ -4321,44 +4397,47 @@ export default defineComponent({
// }; // };
const handleDelete = (id) => { const handleDelete = (id) => {
dialog({ dialog({
content: '确定删除该课程吗?' content: "确定删除该课程吗?",
, ok: async () => { ok: async () => {
message.success("删除成功"); message.success("删除成功");
state.tableLoading = true state.tableLoading = true;
await handle({offcourseId: id,type:-1}) await handle({ offcourseId: id, type: -1 });
getTableDate(); getTableDate();
}}) },
});
}; };
const handleCopy = async (id) => { const handleCopy = async (id) => {
dialog({ dialog({
content: '确定复制该课程吗?' content: "确定复制该课程吗?",
, ok: async () => { ok: async () => {
message.success("复制成功"); message.success("复制成功");
state.tableLoading = true state.tableLoading = true;
await copyCourse({offcourseId: id}) await copyCourse({ offcourseId: id });
getTableDate(); getTableDate();
}}) },
});
}; };
const handleSubmit = (id, index) => { const handleSubmit = (id, index) => {
dialog({ dialog({
content: '确定提交审核吗?' content: "确定提交审核吗?",
, ok: () => { ok: () => {
message.success("提交成功"); message.success("提交成功");
state.tableData1[index].auditStatus = 1 state.tableData1[index].auditStatus = 1;
handle({offcourseId: id, type: 1}) handle({ offcourseId: id, type: 1 });
}}) },
});
}; };
const handlePush = (id,index) => { const handlePush = (id, index) => {
dialog({ dialog({
content: '确定发布该课程吗?' content: "确定发布该课程吗?",
, ok: () => { ok: () => {
message.success("发布成功"); message.success("发布成功");
state.tableData1[index].auditStatus = 3 state.tableData1[index].auditStatus = 3;
handle({offcourseId: id, type: 3}) handle({ offcourseId: id, type: 3 });
}}) },
});
}; };
const handleCopyP = async (itm) => { const handleCopyP = async (itm) => {
console.log(itm); console.log(itm);
state.offcourseId = itm.offcourseId; state.offcourseId = itm.offcourseId;
@@ -4369,21 +4448,23 @@ export default defineComponent({
}; };
const handleStop = (id, index) => { const handleStop = (id, index) => {
dialog({ dialog({
content: '确定停用该课程吗?' content: "确定停用该课程吗?",
, ok: () => { ok: () => {
message.success("停用成功"); message.success("停用成功");
state.tableData1[index].status = 0 state.tableData1[index].status = 0;
handle({offcourseId: id, type: -2}) handle({ offcourseId: id, type: -2 });
}}) },
});
}; };
const handleOpen = async (id, index) => { const handleOpen = async (id, index) => {
dialog({ dialog({
content: '确定起用该课程吗?' content: "确定起用该课程吗?",
, ok: () => { ok: () => {
message.success("起用成功"); message.success("起用成功");
state.tableData1[index].status = 1 state.tableData1[index].status = 1;
handle({offcourseId: id, type: 2}) handle({ offcourseId: id, type: 2 });
}}) },
});
}; };
const handleStart = (item, type) => { const handleStart = (item, type) => {
console.log(item); console.log(item);

View File

@@ -1024,6 +1024,13 @@ export default defineComponent({
console.log("arrObj-------------", arrObj); console.log("arrObj-------------", arrObj);
state.orgSelect = arrObj; state.orgSelect = arrObj;
} }
const imgDict = optionsUrl.value.find(
(img) => img.value.split(",")[0] === item.picUrl
);
console.log("imgDict", imgDict);
if (imgDict) {
state.pathBgId = imgDict.id;
}
}; };
const handleTagChange = () => { const handleTagChange = () => {