diff --git a/package.json b/package.json index 1e7903bbe44af23e7f8de79ec703e40656ebc72c..a94d3ff2a973a558263a0359ecc2aba6c35d8f5c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "github-markdown-css": "^5.1.0", "html2canvas": "^1.4.1", "markdown-it": "^13.0.1", + "mavon-editor": "^3.0.0", "sass": "^1.35.1", "uuid": "^8.3.2", "vue": "^3.2.31", diff --git a/src/main.js b/src/main.js index d9a7ff207eee8f5ae5fc18606f08545216d00a2b..087fedd16853d5ca1dc1877f68a4bf93cdb75e21 100644 --- a/src/main.js +++ b/src/main.js @@ -2,6 +2,9 @@ import { createApp } from "vue"; import ElementPlus from "element-plus"; import "element-plus/dist/index.css"; + +import mavonEditor from "mavon-editor"; +import "mavon-editor/dist/css/index.css"; import locale from "element-plus/lib/locale/lang/zh-cn"; import * as ElementPlusIconsVue from "@element-plus/icons-vue"; @@ -101,7 +104,13 @@ Promise.all([getUser(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]) console.error(e); }) .finally(() => { - createVue.use(ElementPlus, { locale }).use(store).use(router).use(i18n).use(bgui); + createVue + .use(ElementPlus, { locale }) + .use(store) + .use(router) + .use(i18n) + .use(bgui) + .use(mavonEditor); createVue.mount("#app"); }); diff --git a/src/page/main/support/document-type/index.vue b/src/page/main/support/document-type/index.vue index 4300a7b7949e22fd09dfe6219dc63af3bc9ae799..659e147cd89851931a0be165e6221e775370fae6 100644 --- a/src/page/main/support/document-type/index.vue +++ b/src/page/main/support/document-type/index.vue @@ -452,7 +452,12 @@ const deleteCurType = (row) => { content: "确定删除该文档类型吗?", }; }; -const beforeSwitchStatus = (row) => { +const beforeSwitchStatus = async (row) => { + const res = await axios.get(`/apaas/knowledge/v5/documentmgr/classify/quote/${row.id}`); + if (!res.data.data) { + ElMessage.warning("请将该文档类型下所挂载的文档删除或转移至其他文档类型下再停用!"); + return false; + } const text = row.is_active ? "停用" : "启用"; state.selectedRow = row; state.secondTipsDialogConfig = { diff --git a/src/page/main/support/document/add/index.vue b/src/page/main/support/document/add/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..c2ab0e17f1a05cdb940cd83b318a50463999ff7e --- /dev/null +++ b/src/page/main/support/document/add/index.vue @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + $imgAdd(arg, editorRef)" /> + + + + + 取消 + 发布 + + + + + + + + diff --git a/src/page/main/support/document/edit/index.vue b/src/page/main/support/document/edit/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..cf00c77bf2ec83bfe7908c03c19b417e1590b061 --- /dev/null +++ b/src/page/main/support/document/edit/index.vue @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + $imgAdd(arg, editorRef)" /> + + + + + 取消 + 发布 + + + + + + + + diff --git a/src/page/main/support/document/helper.js b/src/page/main/support/document/helper.js new file mode 100644 index 0000000000000000000000000000000000000000..fe785fb78873ef877774421d09a920613f73933c --- /dev/null +++ b/src/page/main/support/document/helper.js @@ -0,0 +1,15 @@ +import $axios from "@/request/http"; + +export const $imgAdd = function (args, editorRef) { + const [pos, $file] = args; + const formdata = new FormData(); + formdata.append("file", $file); + formdata.append("directory", "image"); + $axios + .post("/apaas/common/image/upload", formdata, { + headers: { "Content-Type": "multipart/form-data" }, + }) + .then(({ data }) => { + editorRef.$img2Url(pos, data.data); + }); +}; diff --git a/src/page/main/support/document/index.vue b/src/page/main/support/document/index.vue index ff6a2853045439e2a9405f219325cc95b015cc69..008f048eeeac8503cd4cc124cdfbb78d2e95eff8 100644 --- a/src/page/main/support/document/index.vue +++ b/src/page/main/support/document/index.vue @@ -1,5 +1,368 @@ - 文档管理 + + + + + 文档类型 + + + + + + + + + {{ node.label }} + + + + + + + + + + + + + + 新增 + + + + + + + 更新时间 + + + + + 查询 + 重置 + + + + + + + 编辑 + 删除 + + + + + + + + + + + + + + 删除后,该文档将不再{{ selectedRow.classify_name }}里展示且删除后无法撤销,确定要删除吗? + + + + 取消 + 确定 + + + + - - + + + + diff --git a/yarn.lock b/yarn.lock index d7b392d62f5e8335dbf2923a628721cd6fe5e514..fe67ec5f561eb7ad34b25f955d9f5a93d00dc523 100644 --- a/yarn.lock +++ b/yarn.lock @@ -438,6 +438,11 @@ clipboard@^2.0.11: select "^1.1.2" tiny-emitter "^2.0.0" +commander@^2.20.3: + version "2.20.3" + resolved "https://mirrors.cloud.tencent.com/npm/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + compute-scroll-into-view@^1.0.20: version "1.0.20" resolved "https://registry.npmmirror.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz" @@ -455,6 +460,11 @@ css-line-break@^2.1.0: dependencies: utrie "^1.0.2" +cssfilter@0.0.10: + version "0.0.10" + resolved "https://mirrors.cloud.tencent.com/npm/cssfilter/-/cssfilter-0.0.10.tgz#c6d2672632a2e5c83e013e6864a42ce8defd20ae" + integrity sha1-xtJnJjKi5cg+AT5oZKQs6N79IK4= + csstype@^2.6.8: version "2.6.20" resolved "https://registry.npmmirror.com/csstype/-/csstype-2.6.20.tgz" @@ -744,6 +754,16 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +highlight.js-async-webpack@^1.0.4: + version "1.0.4" + resolved "https://mirrors.cloud.tencent.com/npm/highlight.js-async-webpack/-/highlight.js-async-webpack-1.0.4.tgz#c06b67bf99f049045d62b756e5855b0912ec616c" + integrity sha1-wGtnv5nwSQRdYrdW5YVbCRLsYWw= + +highlight.js@^9.11.0: + version "9.18.5" + resolved "https://mirrors.cloud.tencent.com/npm/highlight.js/-/highlight.js-9.18.5.tgz#d18a359867f378c138d6819edfc2a8acd5f29825" + integrity sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA== + html-void-elements@^2.0.0: version "2.0.1" resolved "https://registry.npmmirror.com/html-void-elements/-/html-void-elements-2.0.1.tgz" @@ -895,6 +915,15 @@ markdown-it@^13.0.1: mdurl "^1.0.1" uc.micro "^1.0.5" +mavon-editor@^3.0.0: + version "3.0.0" + resolved "https://mirrors.cloud.tencent.com/npm/mavon-editor/-/mavon-editor-3.0.0.tgz#232a34a8ceb2d9d1dfc7822103d09d1ffcf779ba" + integrity sha512-7TrZz4Z8+UUbQmVyQ688m50A9XBs2gZrOw8QaeWCvuo2stifyKukb0rPpmrBIMEeA1FCLPkR5dMf7BEMAc04uw== + dependencies: + highlight.js "^9.11.0" + highlight.js-async-webpack "^1.0.4" + xss "^1.0.6" + mdurl@^1.0.1: version "1.0.1" resolved "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz" @@ -1193,6 +1222,14 @@ wildcard@^1.1.0: resolved "https://registry.npmmirror.com/wildcard/-/wildcard-1.1.2.tgz" integrity sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng== +xss@^1.0.6: + version "1.0.14" + resolved "https://mirrors.cloud.tencent.com/npm/xss/-/xss-1.0.14.tgz#4f3efbde75ad0d82e9921cc3c95e6590dd336694" + integrity sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw== + dependencies: + commander "^2.20.3" + cssfilter "0.0.10" + zrender@5.3.2: version "5.3.2" resolved "https://registry.npmmirror.com/zrender/-/zrender-5.3.2.tgz"