Browse Source

fix: 优化按钮布局和代码格式,增强可读性

xieyong 4 days ago
parent
commit
eab0e65ba4
1 changed files with 23 additions and 16 deletions
  1. 23 16
      src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

+ 23 - 16
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -141,7 +141,12 @@
     </el-form>
 
     <div slot="footer">
-      <el-button v-click-once type="primary" size="small" @click="submit" :loading="loading"
+      <el-button
+        v-click-once
+        type="primary"
+        size="small"
+        @click="submit"
+        :loading="loading"
         >提交</el-button
       >
       <el-button
@@ -152,7 +157,12 @@
         v-click-once
         >提交并发布</el-button
       >
-      <el-button  v-click-once size="small" @click="isCloseRefresh ? cancel() : cancel1()">关闭</el-button>
+      <el-button
+        v-click-once
+        size="small"
+        @click="isCloseRefresh ? cancel() : cancel1()"
+        >关闭</el-button
+      >
     </div>
   </ele-modal>
 </template>
@@ -215,7 +225,7 @@
       isCloseRefresh: {
         type: Boolean,
         default: true
-      },
+      }
     },
     data() {
       return {
@@ -300,7 +310,7 @@
     methods: {
       init(row = {}) {
         this.form = { ...this.form, ...row };
-        console.log(row)
+        console.log(row);
         // this.form.businessId = row.id;
         // this.form.businessKey = row.businessKey;
         // this.form.formCreateUserId = row.createUserId;
@@ -399,11 +409,9 @@
         } else if (row.type === 70) {
           let data = JSON.parse(row.variableName);
           if (data.direction == 1) {
-            return topLevel2.find((item) => item.value == data.topLevel)
-              ?.label;
+            return topLevel2.find((item) => item.value == data.topLevel)?.label;
           } else {
-            return topLevel1.find((item) => item.value == data.topLevel)
-              ?.label;
+            return topLevel1.find((item) => item.value == data.topLevel)?.label;
           }
         }
         return '未知(' + option + ')';
@@ -467,18 +475,18 @@
         }
         this.loading = true;
         try {
-          console.log(this.form)
-          
+          console.log(this.form);
+
           let params = {
-          ...this.form,
+            ...this.form,
             variables: {
               // businessName: data.supplierName,
               ...this.form.variables
             }
           };
-          if(this.isSpecialeSubmit) {
-            console.log('特殊提交', params)
-            
+          if (this.isSpecialeSubmit) {
+            console.log('特殊提交', params);
+
             this.$emit('specialesubmit', params);
           } else {
             await processInstanceCreateAPI(params);
@@ -487,7 +495,6 @@
             // this.$emit('reload');
             this.cancel();
           }
-          
         } catch (error) {
           console.error('提交审批失败', error);
         }
@@ -511,7 +518,7 @@
       },
       cancel1() {
         this.$emit('update:processSubmitDialogFlag', false);
-      },
+      }
     }
   };
 </script>