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 @@
- // 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 === '
' +} + 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 @@ -