|
@@ -32,9 +32,7 @@
|
|
|
@handleRemoveCover="handleRemoveCover"
|
|
@handleRemoveCover="handleRemoveCover"
|
|
|
></coverUpload>
|
|
></coverUpload>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="教室描述" name="courseDesc">
|
|
|
|
|
- <quill-editor v-model:content="formState.courseDesc" contentType="html" theme="snow" />
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
|
|
+
|
|
|
<a-form-item label="院系" name="collegeId">
|
|
<a-form-item label="院系" name="collegeId">
|
|
|
<a-cascader
|
|
<a-cascader
|
|
|
v-model:value="majorIdName"
|
|
v-model:value="majorIdName"
|
|
@@ -53,6 +51,18 @@
|
|
|
placeholder="请选择专业"
|
|
placeholder="请选择专业"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <a-form-item label="教室描述" name="courseDesc">
|
|
|
|
|
+ <quill-editor
|
|
|
|
|
+ ref="quillEditorRef"
|
|
|
|
|
+ placeholder="请输入教室描述"
|
|
|
|
|
+ v-model:content="formState.courseDesc"
|
|
|
|
|
+ style="height: 200px"
|
|
|
|
|
+ contentType="html"
|
|
|
|
|
+ theme="snow"
|
|
|
|
|
+ />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+
|
|
|
<a-form-item :wrapper-col="{ offset: 5, span: 12 }">
|
|
<a-form-item :wrapper-col="{ offset: 5, span: 12 }">
|
|
|
<a-button
|
|
<a-button
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -76,6 +86,8 @@
|
|
|
import resourceAuditApi from '@/api/resourceAudit.js'
|
|
import resourceAuditApi from '@/api/resourceAudit.js'
|
|
|
import courseCenterApi from '@/api/courseCenter/courseinfo.js'
|
|
import courseCenterApi from '@/api/courseCenter/courseinfo.js'
|
|
|
import coverUpload from '@/views/myResources/coverUpload/index.vue'
|
|
import coverUpload from '@/views/myResources/coverUpload/index.vue'
|
|
|
|
|
+ import sysConfig from '@/config/index'
|
|
|
|
|
+
|
|
|
const emit = defineEmits(['nextStep'])
|
|
const emit = defineEmits(['nextStep'])
|
|
|
import tool from '@/utils/tool'
|
|
import tool from '@/utils/tool'
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -94,7 +106,7 @@
|
|
|
collegeId: null, //院校一级id
|
|
collegeId: null, //院校一级id
|
|
|
collegeTwoId: null, //院校二级id
|
|
collegeTwoId: null, //院校二级id
|
|
|
collegeThreeId: null, //院校三级id
|
|
collegeThreeId: null, //院校三级id
|
|
|
- majorId: '1', //专业
|
|
|
|
|
|
|
+ majorId: null, //专业
|
|
|
coverImageId: null //封面id
|
|
coverImageId: null //封面id
|
|
|
})
|
|
})
|
|
|
const rules = {
|
|
const rules = {
|
|
@@ -115,6 +127,7 @@
|
|
|
const courseOptions = ref([]) //课程
|
|
const courseOptions = ref([]) //课程
|
|
|
const teacherOptions = ref([]) //教师
|
|
const teacherOptions = ref([]) //教师
|
|
|
const coverImagePath = ref() // 预览回显
|
|
const coverImagePath = ref() // 预览回显
|
|
|
|
|
+ const quillEditorRef = ref(null) // 预览回显
|
|
|
const courseClass = tool.dictList('COURSE_TYPE')
|
|
const courseClass = tool.dictList('COURSE_TYPE')
|
|
|
|
|
|
|
|
const handleSubmit = () => {
|
|
const handleSubmit = () => {
|
|
@@ -126,6 +139,9 @@
|
|
|
// verifyStatus: formState.verifyStatus,
|
|
// verifyStatus: formState.verifyStatus,
|
|
|
// fileName: formState.fileName
|
|
// fileName: formState.fileName
|
|
|
// }
|
|
// }
|
|
|
|
|
+
|
|
|
|
|
+ // courseDesc.ops
|
|
|
|
|
+ formState.courseDesc = toRaw(quillEditorRef.value).getHTML()
|
|
|
courseCenterApi
|
|
courseCenterApi
|
|
|
.add(formState)
|
|
.add(formState)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -140,6 +156,8 @@
|
|
|
}
|
|
}
|
|
|
const handleEdit = () => {
|
|
const handleEdit = () => {
|
|
|
console.log('表单编辑数据:', formState)
|
|
console.log('表单编辑数据:', formState)
|
|
|
|
|
+ // collegeId
|
|
|
|
|
+ formState.courseDesc = toRaw(quillEditorRef.value).getHTML()
|
|
|
courseCenterApi
|
|
courseCenterApi
|
|
|
.edit({ ...formState, courseId: courseInfoId.value })
|
|
.edit({ ...formState, courseId: courseInfoId.value })
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -229,20 +247,35 @@
|
|
|
}
|
|
}
|
|
|
// 获取课程信息
|
|
// 获取课程信息
|
|
|
const getDetail = () => {
|
|
const getDetail = () => {
|
|
|
- courseCenterApi.detail({ id: props.courseInfoId }).then((res) => {
|
|
|
|
|
|
|
+ courseInfoId.value = props.courseInfoId
|
|
|
|
|
+ courseCenterApi.detail({ courseId: props.courseInfoId }).then((res) => {
|
|
|
console.log(res.data, '课程信息详情')
|
|
console.log(res.data, '课程信息详情')
|
|
|
formState.courseName = res.data.courseName
|
|
formState.courseName = res.data.courseName
|
|
|
formState.teacherId = res.data.teacherId
|
|
formState.teacherId = res.data.teacherId
|
|
|
|
|
+ formState.collegeId = res.data.collegeId
|
|
|
majorIdName.value = res.data.collegeAllId?.split(',')
|
|
majorIdName.value = res.data.collegeAllId?.split(',')
|
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
getCollegeMajor(majorIdName.value[majorIdName.value.length - 1])
|
|
|
formState.courseType = res.data.courseType
|
|
formState.courseType = res.data.courseType
|
|
|
formState.courseDesc = res.data.courseDesc
|
|
formState.courseDesc = res.data.courseDesc
|
|
|
|
|
+ toRaw(quillEditorRef.value).setHTML(formState.courseDesc)
|
|
|
formState.coverImageId = res.data.coverImageId
|
|
formState.coverImageId = res.data.coverImageId
|
|
|
|
|
+ coverImagePath.value = res.data.coverImagePath
|
|
|
formState.majorId = res.data.majorId
|
|
formState.majorId = res.data.majorId
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ // const quill = toRaw(myQuillEditor.value).getQuill()
|
|
|
|
|
+ // if (myQuillEditor.value) {
|
|
|
|
|
+ // quill.getModule('toolbar').addHandler('image', imgHandler)
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // ————————————————
|
|
|
|
|
+
|
|
|
|
|
+ // 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
|
|
|
|
|
|
|
|
|
|
+ // 原文链接:https://blog.csdn.net/moanuan/article/details/128240291
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ // toRaw(quillEditorRef.value).setHTML(props.value)
|
|
|
|
|
+ // formState.courseDesc = '<p>默认内容</p>'
|
|
|
getOrgTreeSelector()
|
|
getOrgTreeSelector()
|
|
|
getCourseAllList()
|
|
getCourseAllList()
|
|
|
getlecturerListSelector()
|
|
getlecturerListSelector()
|