diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index ff0b4b33..1372d7c4 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -191,7 +191,7 @@ alt="" /> - + 授课形式 @@ -221,7 +221,7 @@ -
审核意见: - {{auditDescription}} + {{ auditDescription }}
@@ -310,7 +310,7 @@ 附件
- +
@@ -360,7 +360,7 @@ import { defineComponent, ref, shallowRef, - onMounted, + // onMounted, onBeforeUnmount, } from "vue"; import { message } from "ant-design-vue"; @@ -372,7 +372,7 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue"; import ProjectManager from "@/components/project/ProjectManagerNew"; import FJUpload from "@/components/common/FJUpload"; import * as moment from "moment"; -import * as api2 from "../../api/indexAudit" +import * as api2 from "../../api/indexAudit"; export default defineComponent({ components: { Editor, @@ -383,6 +383,7 @@ export default defineComponent({ setup(props, { expose, emit }) { const state = reactive({ hideshow: true, + ft_eidt: false, attach: "", ft_hs: false, addLoading: false, @@ -401,17 +402,20 @@ export default defineComponent({ tags_val: [], qdms_inputV6: "", imgList: [], - auditDescription:"", + auditDescription: "", }); const visibleOpen = (offcourseId, name) => { state.offcourseId = offcourseId; if (state.offcourseId) { + state.ft_hs = true; + state.ft_eidt = true; handleEditInfo(state.offcourseId); } else { - state.qdms_inputV1 = name; state.ft_hs = true; + state.ft_eidt = false; + state.qdms_inputV1 = name; } }; const visibleClose = () => { @@ -455,18 +459,20 @@ export default defineComponent({ // 内容 HTML const valueHtml = ref(""); // // 模拟 ajax 异步获取内容 - onMounted(() => { - 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); - }); + // onMounted(() => { + // console.log("toolbar222222222222222111111"); + // console.log(editorRef.value); + // setTimeout(() => { + // // valueHtml.value = "

模拟 Ajax 异步设置内容

"; + // console.log("toolbar22222222222222222222222233"); + // 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 = { excludeKeys: ["insertVideo", "insertImage"], }; @@ -485,13 +491,19 @@ export default defineComponent({ }, }; const handleCreated = (editor) => { + console.log(4545454544); + console.log(editor); editorRef.value = editor; // 记录 editor 实例,重要! }; - // 组件销毁时,也及时销毁编辑器 - onBeforeUnmount(() => { + const handleDestory = () => { const editor = editorRef.value; if (editor == null) return; editor.destroy(); + }; + // 组件销毁时,也及时销毁编辑器 + onBeforeUnmount(() => { + console.log(78787866666666666666); + // handleDestory(); }); // 富文本 eeeeeeeeeeeeee @@ -620,7 +632,9 @@ export default defineComponent({ if (param === "review") { //新建时点击审核按钮 submitReview(res.data.data.offcourseId); - } else visibleClose(); + } else { + visibleClose(); + } } }); }; @@ -641,22 +655,21 @@ export default defineComponent({ if (Number(item.auditStatus) === 2 && Number(item.status) === 0) { state.statusTingQi = 0; } - if(Number(item.auditStatus) === -1){ - let obj ={ - offcourseId:offcourseId, - type:2, + if (Number(item.auditStatus) === -1) { + let obj = { + offcourseId: offcourseId, + type: 2, pageNo: 1, - pageSize: 1, - } - api2.auditList(obj).then((res)=>{ - - if(res.data.data.rows &&res.data.data.rows.length > 0){ - state.auditDescription = res.data.data.rows[0].description?res.data.data.rows[0].description :"-"; - console.log("state.auditDescription",state.auditDescription); + pageSize: 1, + }; + api2.auditList(obj).then((res) => { + if (res.data.data.rows && res.data.data.rows.length > 0) { + state.auditDescription = res.data.data.rows[0].description + ? res.data.data.rows[0].description + : "-"; + console.log("state.auditDescription", state.auditDescription); } - - }) - + }); } state.qdms_inputV1 = item.name; @@ -670,7 +683,6 @@ export default defineComponent({ state.member = { value: item.teacherId, name: item.teacher }; valueHtml.value = item.outline; state.attach = item.attach; - state.ft_hs = true; }; const handleTagChange = () => { @@ -720,15 +732,16 @@ export default defineComponent({ visibleClose, handleTagChange, handleTagClose, - handleCreated, handlePush, - submitReview, reviewClick, + editorRef, valueHtml, mode: "simple", // 或 'simple' toolbarConfig, editorConfig, + handleCreated, + handleDestory, }; }, });