8
0
duy 2 veckor sedan
förälder
incheckning
ef43f26b4c
2 ändrade filer med 35 tillägg och 12 borttagningar
  1. 3 1
      src/views/desk/archive.vue
  2. 32 11
      src/views/project/tree/tree-form.vue

+ 3 - 1
src/views/desk/archive.vue

@@ -562,7 +562,9 @@ const getArchiveTreeDetail = async (param) => {
         formModel.value.nodeName = data.fullName; //节点名称
 
         if (data.expDataType) {
-            formModel.value.expDataType = data.expDataType.split(","); //文件类型
+            let arr = data.expDataType.split(",");
+            const numberArray = Array.from(arr, Number);
+            formModel.value.expDataType = numberArray; //文件类型
         } else {
             formModel.value.expDataType = [];
         }

+ 32 - 11
src/views/project/tree/tree-form.vue

@@ -223,7 +223,13 @@
 
 <script setup>
 import { ref, watch } from "vue";
-import { formValidate, getArrValue, getObjValue, isNullES } from "js-fast-way";
+import {
+    deepClone,
+    formValidate,
+    getArrValue,
+    getObjValue,
+    isNullES,
+} from "js-fast-way";
 import { getDictionaryData } from "~uti/tools";
 import mainApi from "~api/project/tree";
 import roleApi from "~api/system/role";
@@ -299,13 +305,30 @@ const getTreeDetail = async (id) => {
         ...res,
         id: id,
         nodeName: res.fullName,
-        expDataType: isNullES(res.expDataType)
-            ? []
-            : res.expDataType.split(","),
-        majorDataType: isNullES(res.majorDataType)
-            ? []
-            : res.majorDataType.split(","),
+        // expDataType: isNullES(res.expDataType)
+        //     ? []
+        //     : res.expDataType.split(","),
+        // majorDataType: isNullES(res.majorDataType)
+        //     ? []
+        //     : res.majorDataType.split(","),
     };
+    if (!isNullES(res.expDataType)) {
+        let arr = data.expDataType.split(",");
+        const numberArray = Array.from(arr, Number);
+        formModel.value.expDataType = numberArray; //文件类型
+    } else {
+        formModel.value.expDataType = [];
+    }
+    if (!isNullES(res.majorDataType)) {
+        let arr = data.majorDataType.split(",");
+        const numberArray = Array.from(arr, Number);
+        formModel.value.majorDataType = numberArray;
+    } else {
+        formModel.value.majorDataType = [];
+    }
+    if (!isNullES(res.displayHierarchy)) {
+        formModel.value.displayHierarchy = Number(res.displayHierarchy);
+    }
 };
 
 //岗位类型
@@ -387,7 +410,7 @@ const dialogSubmit = async () => {
     const isForm = await formValidate(formRef.value);
     if (!isForm) return;
     const data = getObjValue(dataInfo.value);
-    const form = formModel.value;
+    const form = deepClone(formModel.value);
     if (data.postType !== form.postType) {
         window.$message.warning("岗位类型必须和父级节点岗位类型一致");
         return;
@@ -395,13 +418,11 @@ const dialogSubmit = async () => {
     submitLoading.value = true;
     if (formModel.value.majorDataType) {
         form.majorDataType = form.majorDataType.join(",");
-        form.expDataType = form.expDataType.join(",");
     }
     if (formModel.value.expDataType) {
         form.expDataType = form.expDataType.join(",");
     }
-    // form.majorDataType = form.majorDataType.join(",");
-    // form.expDataType = form.expDataType.join(",");
+
     //发起请求
     let res = {};
     if (props.type === "新增") {