Эх сурвалжийг харах

优化文件编辑表单逻辑和代码格式

yusheng 9 сар өмнө
parent
commit
55d57f2cad

+ 12 - 10
src/views/doc/components/file-editAll.vue

@@ -219,10 +219,9 @@
 
 
         if (this.options.length > 0) {
         if (this.options.length > 0) {
           this.form.businessCodeId = this.options[0].id;
           this.form.businessCodeId = this.options[0].id;
-          this.form.codeType=this.options[0].parentId
-
-        }else{
-          this.form.businessCodeId=''
+          this.form.codeType = this.options[0].parentId;
+        } else {
+          this.form.businessCodeId = '';
         }
         }
       },
       },
       setTree(data) {
       setTree(data) {
@@ -236,18 +235,21 @@
         });
         });
       },
       },
       async typeChange(val) {
       async typeChange(val) {
-        let data = await listParentId({
+        let obj = {
           pageNum: 1,
           pageNum: 1,
           size: 100,
           size: 100,
-          parentId: val,
-          objId:this.nodeData?.id,
-          objParentId:this.nodeData?.parentId,
-        });
+          parentId: val
+        };
+        if (this.fileType == 0) {
+          obj['objId'] = this.nodeData?.id;
+          obj['objParentId'] = this.nodeData?.parentId;
+        }
+        let data = await listParentId(obj);
         this.options = data.list.filter((item) => item.type == 2);
         this.options = data.list.filter((item) => item.type == 2);
         this.form.businessCodeId = '';
         this.form.businessCodeId = '';
       },
       },
       cascaderChange() {
       cascaderChange() {
-        this.getCode()
+        this.getCode();
       },
       },
       // getCodeOpen() {
       // getCodeOpen() {
       //   this.$refs.getCode.open();
       //   this.$refs.getCode.open();