diff --git a/src/api/databaseLibary.js b/src/api/databaseLibary.js new file mode 100644 index 0000000..26fea8c --- /dev/null +++ b/src/api/databaseLibary.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 获取百科数据库分页列表 +export function getBusEncyclopediaDatabasePage(query) { + return request({ + url: '/admin/busEncyclopediaDatabase/getBusEncyclopediaDatabasePage', + method: 'post', + data: query + }) +} + +// 添加百科数据库 +export function addBusEncyclopediaDatabase(query) { + return request({ + url: '/admin/busEncyclopediaDatabase/addBusEncyclopediaDatabase', + method: 'post', + data: query + }) +} + +// 修改百科数据库 +export function updateBusEncyclopediaDatabase(query) { + return request({ + url: '/admin/busEncyclopediaDatabase/updateBusEncyclopediaDatabase', + method: 'post', + data: query + }) +} + + +// 获取百科数据库详情 +export function getBusEncyclopediaDatabase(Id) { + return request({ + url: '/admin/busEncyclopediaDatabase/getBusEncyclopediaDatabase/' + Id, + method: 'post' + }) +} +// 删除百科数据库 +export function deleteBusEncyclopediaDatabase(Id) { + return request({ + url: '/admin/busEncyclopediaDatabase/deleteBusEncyclopediaDatabase/' + Id, + method: 'post' + }) +} \ No newline at end of file diff --git a/src/components/TEditor/index.vue b/src/components/TEditor/index.vue index d2a8362..ecaf914 100644 --- a/src/components/TEditor/index.vue +++ b/src/components/TEditor/index.vue @@ -1,6 +1,6 @@ @@ -162,7 +162,7 @@ const init = reactive({ // 图片本地上传方法 点击上传后执行的事件 images_upload_handler: async (blobInfo, progress) => { return new Promise(async (resolve, reject) => { - try { + try { const formData = new FormData(); formData.append('file', blobInfo.blob(), blobInfo.filename()); @@ -171,15 +171,15 @@ const init = reactive({ if (res.code === 200) { const successUrl = baseUrl + res.fileName; - resolve(successUrl); + resolve(successUrl); } else { reject('上传失败: ' + (res.msg || '服务器错误')); } } catch (error) { console.error('上传错误:', error); reject('上传失败: ' + (error.message || '网络错误')); - - } + + } }); }, file_picker_callback: function (callback, value, meta) { @@ -233,23 +233,9 @@ const myValue = computed({ }, }); -const handleImgUpload = (blobInfo, progress) => { - // const base64 = "data:image/png;base64," + blobInfo.base64(); - // // 编辑器的上传图片内容被处理为 - // success(base64); - //调用接口上传 - var formData = new FormData(); - formData.append('file', blobInfo.blob()); - uploadFile(formData).then(res => { - if (res.code == 200) { - const successUrl = baseUrl + res.fileName - success(successUrl) - } - }) + -} - -//监听富文本中的数据变化 +// 监听富文本中的数据变化 watch( () => myValue.value, () => { @@ -286,7 +272,7 @@ window.onresize = function temp() { // editorId就是给editor传的id let editor = tinymce.get(tinymceId.value); // editor.getContainer()拿到的是编辑器整个大容器 - editor.getContainer().setAttribute("style", `height: ${props.height}px;`); + editor?.getContainer().setAttribute("style", `height: ${props.height}px;`); }; // 设置值 @@ -300,8 +286,34 @@ const handleGetContent = () => { }; const updateModelValue = (val) => { - emits('update:modelValue', myValue.value) + nextTick(() => { + const editor = tinymce.get(tinymceId.value) + if (!editor) return + + const content = editor.getContent() + const isEmpty = checkEmptyContent(editor) + + // 更新绑定值 + myValue.value = content + emits('update:modelValue', content) + + if (isEmpty) { + console.warn('编辑器内容为空') + // 执行空内容处理逻辑 + } + }) } +const checkEmptyContent = (editor) => { + const plainText = editor.getContent({ format: 'text' }).trim() + const htmlContent = editor.getContent() + + // 检测常见空内容情况 + return plainText === '' || + htmlContent === '' || + htmlContent === '


' || + htmlContent === '

 

' +} + defineExpose({ handleSetContent, diff --git a/src/router/index.js b/src/router/index.js index 4ef452b..91320c4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -427,7 +427,7 @@ export const dynamicRoutes = [ { path: ':Id(\\d+)?', component: () => import('@/views/ppeTool/toolForm'), - name: 'escTaskForm', + name: 'ppeToolForm', meta: { title: 'ppeTool表单', activeMenu: '/ppeTool' } } ] diff --git a/src/views/databaseLibary/components/card.vue b/src/views/databaseLibary/components/card.vue index 70c09ab..6b41ac7 100644 --- a/src/views/databaseLibary/components/card.vue +++ b/src/views/databaseLibary/components/card.vue @@ -9,10 +9,10 @@ -
-
+
+
- +
@@ -21,9 +21,8 @@
-
- -
XXXX组织架构图XXXX组织架构图
+
+
{{ item.title }}
@@ -36,15 +35,46 @@
\ No newline at end of file diff --git a/src/views/databaseLibary/index.vue b/src/views/databaseLibary/index.vue index 72ecd88..517f780 100644 --- a/src/views/databaseLibary/index.vue +++ b/src/views/databaseLibary/index.vue @@ -17,17 +17,50 @@ -
+
二级类目
- 全部 - - {{ item.lable }} + + {{ dict.label }} + + {{ dict.dependencyName }} + + {{ dict.label }} + + {{ dict.label }} + + {{ dict.label }} + + + {{ dict.label }} + + {{ dict.label }}
@@ -36,7 +69,7 @@
其他选项
-
@@ -48,58 +81,140 @@