瀏覽代碼

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

yusheng 9 月之前
父節點
當前提交
55d57f2cad
共有 1 個文件被更改,包括 12 次插入10 次删除
  1. 12 10
      src/views/doc/components/file-editAll.vue

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

@@ -219,10 +219,9 @@
 
         if (this.options.length > 0) {
           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) {
@@ -236,18 +235,21 @@
         });
       },
       async typeChange(val) {
-        let data = await listParentId({
+        let obj = {
           pageNum: 1,
           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.form.businessCodeId = '';
       },
       cascaderChange() {
-        this.getCode()
+        this.getCode();
       },
       // getCodeOpen() {
       //   this.$refs.getCode.open();