huangbin há 4 anos atrás
pai
commit
087b12ff71

+ 16 - 11
src/views/information/account_info/compoments/add-child-traders/index.vue

@@ -3,7 +3,7 @@
   <a-modal class="commonModal add-traders"
            title="新增交易员"
            v-model:visible="visible"
-           @cancel="cancel"
+           @cancel="close"
            centered
            :loading="loading"
            :maskClosable="false"
@@ -72,7 +72,8 @@
                        v-for="(item, index) in accountList"
                        :key="index"
                        :class="[index > 1 ? 'mt10' : '']">
-                  <a-checkbox :value="item.accountid" >{{item.accountname}}/{{item.accountid}}</a-checkbox>
+                  <a-checkbox :value="item.accountid">{{item.accountname}}/{{item.accountid}}
+                  </a-checkbox>
                 </a-col>
               </a-row>
             </a-checkbox-group>
@@ -112,6 +113,10 @@ export default defineComponent({
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_trade_child_btn_add');
         const { rules, formState, formRef } = handleBusinessForm();
+        function close() {
+            formRef.value.resetFields();
+            cancel();
+        }
         function submit() {
             validateAction<BusinessFormState>(formRef, formState).then((res) => {
                 const reqParam: LoginaccountOperateReq = {
@@ -130,7 +135,7 @@ export default defineComponent({
                     }), // LoginTaaccount 期货账户(勾选交易员必填)
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增交易员成功', '新增交易员失败:']).then(() => {
-                    cancel();
+                    close();
                     context.emit('refresh');
                 });
             });
@@ -140,7 +145,7 @@ export default defineComponent({
             rules,
             formRef,
             visible,
-            cancel,
+            close,
             submit,
             loading,
         };
@@ -150,14 +155,14 @@ export default defineComponent({
 
 <style lang="less">
 .add-traders {
-  .checkboxGroupItem {
-    .ant-row {
-      .ant-col.ant-col-12 {
-        white-space: nowrap;
-        min-width: 356px;
-      }
+    .checkboxGroupItem {
+        .ant-row {
+            .ant-col.ant-col-12 {
+                white-space: nowrap;
+                min-width: 356px;
+            }
+        }
     }
-  }
 }
 </style
 >;