diff --git a/src/components/TEditor/index.vue b/src/components/TEditor/index.vue index ecaf914..7bf39eb 100644 --- a/src/components/TEditor/index.vue +++ b/src/components/TEditor/index.vue @@ -216,6 +216,7 @@ const init = reactive({ }, // 设置初始化内容(初始化结束后执行) init_instance_callback: function (editor) { + console.log('初始化内容', props.value) editor.setContent(props.value); // 设置默认文本内容 emits('update:modelValue', editor.getContent()) //更新 // 设置高度 @@ -276,13 +277,13 @@ window.onresize = function temp() { }; // 设置值 -const handleSetContent = (content) => { +const handleSetContent = (content) => { tinymce.activeEditor.setContent(content); }; // 获取值 const handleGetContent = () => { - return tinymce.activeEditor.getContent(); + return tinymce.activeEditor.getContent(); }; const updateModelValue = (val) => { @@ -292,7 +293,7 @@ const updateModelValue = (val) => { const content = editor.getContent() const isEmpty = checkEmptyContent(editor) - + console.log('dsfsdaf', content, isEmpty) // 更新绑定值 myValue.value = content emits('update:modelValue', content) diff --git a/src/router/index.js b/src/router/index.js index 91320c4..053c423 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -446,6 +446,20 @@ export const dynamicRoutes = [ } ] }, + { + path: '/libaryDetail', + component: Layout, + hidden: true, + permissions: ['databaseLibary:view'], + children: [ + { + path: ':Id(\\d+)?', + component: () => import('@/views/databaseLibary/components/libaryDetail'), + name: 'libaryDetail', + meta: { title: '百科数据库预览', activeMenu: '/databaseLibary' } + } + ] + }, { path: '/system/userApprovalForm', component: Layout, diff --git a/src/views/databaseLibary/components/card.vue b/src/views/databaseLibary/components/card.vue index 6b41ac7..64f1b52 100644 --- a/src/views/databaseLibary/components/card.vue +++ b/src/views/databaseLibary/components/card.vue @@ -1,7 +1,7 @@ - + - + { getBusEncyclopediaDatabase(id).then(res => { if (res.code == 200) { ruleForm.value = res.data - ruleForm.value.year = res.data.year.toString() - escUserName.value = res.data.escUserName - escWorkNo.value = res.data.workNo - escUserId.value = res.data.escUserId - res.data.reviewProblemList.forEach(item => { - item.editFlag = false - showTableData.value.push(item) - cachShowTableData.value.push(item) - }); + categorySelectedValue.value = [res.data.category] + categoryTwoSelectedValue.value = [res.data.categoryTwo] + editorRef.value.handleSetContent(res.data.mainText) + docUploadList.value = JSON.parse(res.data.fileContent) + + + // ruleForm.value.year = res.data.year.toString() + // escUserName.value = res.data.escUserName + // escWorkNo.value = res.data.workNo + // escUserId.value = res.data.escUserId + // res.data.reviewProblemList.forEach(item => { + // item.editFlag = false + // showTableData.value.push(item) + // cachShowTableData.value.push(item) + // }); } }) } @@ -331,8 +338,9 @@ const handleCancel = () => { }) } const handleSubmit = () => { - proxy.$refs["ruleFormRef"].validate(valid => { + proxy.$refs["ruleFormRef"].validate(valid => { if (valid) { + ruleForm.value.fileContent = JSON.stringify(docUploadList.value) ruleForm.value.encyclopediaDatabaseLinkList = showTableData.value if (ruleForm.value.id != undefined) { updateBusEncyclopediaDatabase(ruleForm.value).then(response => { diff --git a/src/views/databaseLibary/components/list.vue b/src/views/databaseLibary/components/list.vue index b8cddf8..3a8332a 100644 --- a/src/views/databaseLibary/components/list.vue +++ b/src/views/databaseLibary/components/list.vue @@ -1,7 +1,7 @@