mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
-- fix bug
This commit is contained in:
70
src/components/common/CommonAlert.vue
Normal file
70
src/components/common/CommonAlert.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:visible="true"
|
||||
:footer="null"
|
||||
:closable="false"
|
||||
wrapClassName="DelModal"
|
||||
style="margin-top: 400px"
|
||||
:zIndex="9999"
|
||||
@cancel="close"
|
||||
>
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
<div class="header">
|
||||
<div class="del-icons">
|
||||
<img :src="types[type]" alt=""/>
|
||||
</div>
|
||||
<span>提示</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div><span>{{ content }}</span></div>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn1" @click="close">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="handleConfirm">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import notide from '@/assets/images/coursewareManage/notice.png'
|
||||
import infoPng from '@/assets/images/coursewareManage/QR.png'
|
||||
import {defineProps, ref} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
ok: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
content: String,
|
||||
title: {
|
||||
type: String,
|
||||
default: '提示'
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
const types = {
|
||||
1: infoPng,
|
||||
2: notide
|
||||
}
|
||||
const type = ref(1)
|
||||
|
||||
function handleConfirm() {
|
||||
props.ok()
|
||||
props.close()
|
||||
}
|
||||
|
||||
</script>
|
||||
14
src/utils/dialog.js
Normal file
14
src/utils/dialog.js
Normal file
@@ -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
|
||||
@@ -315,13 +315,13 @@
|
||||
: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">发布
|
||||
@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">提交审核
|
||||
@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">编辑
|
||||
@@ -340,11 +340,11 @@
|
||||
<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>
|
||||
@@ -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<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();
|
||||
@@ -2803,16 +2773,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 = {
|
||||
@@ -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,
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user