diff --git a/src/components/common/CommonAlert.vue b/src/components/common/CommonAlert.vue new file mode 100644 index 00000000..46b81112 --- /dev/null +++ b/src/components/common/CommonAlert.vue @@ -0,0 +1,70 @@ + + diff --git a/src/utils/dialog.js b/src/utils/dialog.js new file mode 100644 index 00000000..f98e4ffd --- /dev/null +++ b/src/utils/dialog.js @@ -0,0 +1,14 @@ +import { createApp } from 'vue' +import CommonAlert from "@/components/common/CommonAlert"; +import Antd from "ant-design-vue"; + +function mountContent (option = {}) { + const dom = document.createElement('div') + document.body.appendChild(dom) + const app = createApp(CommonAlert, { + close: () => { app.unmount(dom); document.body.removeChild(dom) }, + ...option + }) + app.use(Antd).mount(dom) +} +export default mountContent \ No newline at end of file diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index 0ce365df..57395fe2 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -315,40 +315,40 @@ :pagination="false" :scroll="{x:'max-content'}" > -
@@ -1514,6 +1514,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, @@ -2136,7 +2137,7 @@ export default defineComponent({ dataIndex: "publishTime", key: "10", align: "center", - customRender: ({text,auditStatus}) => { + customRender: ({text, auditStatus}) => { return auditStatus == 3 ? (text || '-') : "-"; }, }, @@ -2146,14 +2147,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: "操作", @@ -2162,7 +2156,7 @@ export default defineComponent({ key: "id", fixed: "right", align: "right", - slots: { customRender: 'operation' } + slots: {customRender: 'operation'} }, ], //新加 @@ -2772,30 +2766,6 @@ export default defineComponent({ state.viewpowervisible = true; }; - - // console.log('12344', sysTypeOptions) - - // 处理数据字典 - // function formateDictT(data) { - // for(let i=0;i { - setTimeout(() => { - // valueHtml.value = "

模拟 Ajax 异步设置内容

"; - 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 = { @@ -3741,17 +3702,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.cstm_hs = true; state.kk_eidt = true; }; @@ -3836,13 +3787,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 () => { @@ -3952,7 +3904,8 @@ export default defineComponent({ } }); } else if (state.offcourseId) { - handle({offcourseId: state.offcourseId, type: -1, + handle({ + offcourseId: state.offcourseId, type: -1, }).then((res) => { if (res.data.code === 200) { message.destroy(); @@ -4245,41 +4198,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; @@ -4288,23 +4246,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); @@ -4781,18 +4739,15 @@ export default defineComponent({ handelChangePageTea2, submitReview, reviewClick, - showPrower, showOwnPrower, showViewPrower, showManagePrower, - closeOnlineCoursevisible, handlelookMs, handleLook, logW, logT, - qrcodeVisible, }; },