diff --git a/src/page/main/support/document-type/index.vue b/src/page/main/support/document-type/index.vue index 659e147cd89851931a0be165e6221e775370fae6..3de31bf99c4fddf2dd9c7607896d9978c7080fb0 100644 --- a/src/page/main/support/document-type/index.vue +++ b/src/page/main/support/document-type/index.vue @@ -175,6 +175,7 @@ import { Search } from "@element-plus/icons-vue"; import { watch, nextTick, reactive, toRefs, ref, computed, onBeforeMount } from "vue"; import { useRoute, useRouter } from "vue-router"; import axios from "@/request/http.js"; +import { topId } from "../helper.js"; import { ElMessage } from "element-plus"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; @@ -399,7 +400,7 @@ const editCurType = async (row) => { if (res.data.code == 200) { const data = res.data.data || {}; state.formData = { - parent_id: data.parent_id, + parent_id: data.parent_id === topId ? "topLevel" : data.parent_id, classify_name: data.classify_name, sort: data.sort, describe: data.describe, @@ -454,7 +455,8 @@ const deleteCurType = (row) => { }; const beforeSwitchStatus = async (row) => { const res = await axios.get(`/apaas/knowledge/v5/documentmgr/classify/quote/${row.id}`); - if (!res.data.data) { + console.log(res); + if (res.data.code !== 200) { ElMessage.warning("请将该文档类型下所挂载的文档删除或转移至其他文档类型下再停用!"); return false; } diff --git a/src/page/main/support/document/add/index.vue b/src/page/main/support/document/add/index.vue index c2ab0e17f1a05cdb940cd83b318a50463999ff7e..9818c2929dd97b7661301d4839988f22e7a0da4b 100644 --- a/src/page/main/support/document/add/index.vue +++ b/src/page/main/support/document/add/index.vue @@ -36,7 +36,7 @@ import { reactive, toRefs, computed, ref, onBeforeMount, nextTick } from "vue"; import { useRoute, useRouter } from "vue-router"; import axios from "@/request/http.js"; import { ElMessage } from "element-plus"; -import { $imgAdd } from "../helper"; +import { $imgAdd } from "../../helper"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; const route = useRoute(); diff --git a/src/page/main/support/document/edit/index.vue b/src/page/main/support/document/edit/index.vue index cf00c77bf2ec83bfe7908c03c19b417e1590b061..8c728e8fa6c5b1476d6759edc8bc6f3eb6e3bea0 100644 --- a/src/page/main/support/document/edit/index.vue +++ b/src/page/main/support/document/edit/index.vue @@ -36,7 +36,7 @@ import { reactive, toRefs, computed, ref, onBeforeMount, nextTick } from "vue"; import { useRoute, useRouter } from "vue-router"; import axios from "@/request/http.js"; import { ElMessage } from "element-plus"; -import { $imgAdd } from "../helper"; +import { $imgAdd } from "../../helper"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; const route = useRoute(); diff --git a/src/page/main/support/document/helper.js b/src/page/main/support/helper.js similarity index 87% rename from src/page/main/support/document/helper.js rename to src/page/main/support/helper.js index fe785fb78873ef877774421d09a920613f73933c..d678d518d9f9dc34a6ccce0607e963dc90c8a737 100644 --- a/src/page/main/support/document/helper.js +++ b/src/page/main/support/helper.js @@ -1,5 +1,7 @@ import $axios from "@/request/http"; +export const topId = "00000000-0000-0000-0000-000000000000"; + export const $imgAdd = function (args, editorRef) { const [pos, $file] = args; const formdata = new FormData();