huangbin 4 năm trước cách đây
mục cha
commit
f5f2ffc4b6

+ 9 - 5
src/views/information/account_info/compoments/add-child-traders/index.vue

@@ -69,10 +69,11 @@
                               v-model:value="formState.logintaaccounts">
               <a-row>
                 <a-col :span="12"
-                       v-for="(item, index) in accountList"
+                       v-for="(item, index) in filerAccount()"
                        :key="index"
                        :class="[index > 1 ? 'mt10' : '']">
-                  <a-checkbox :value="item.accountid" v-if="item.tradestatus === 1">{{item.accountname}}/{{item.accountid}}
+                  <a-checkbox :value="item.accountid"
+                              v-if="item.tradestatus === 1">{{item.accountname}}/{{item.accountid}}
                   </a-checkbox>
                 </a-col>
               </a-row>
@@ -104,12 +105,11 @@ export default defineComponent({
             type: Object as PropType<ErmcpLoginUserEx>,
         },
         accountList: {
-            default: {},
-            type: Object as PropType<ErmcpTaAccount>,
+            default: [],
+            type: Array as PropType<ErmcpTaAccount[]>,
         },
     },
     setup(props, context) {
-      console.log('asddsdddddddsdaasdasddasasdasdsdadsdasdassdasdasad',props.accountList)
         const loading = ref<boolean>(false);
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_trade_child_btn_add');
@@ -118,6 +118,9 @@ export default defineComponent({
             formRef.value.resetFields();
             cancel();
         }
+        function filerAccount() {
+            return props.accountList.filter((e) => e.relateduserid === props.selectedData.roleid);
+        }
         function submit() {
             validateAction<BusinessFormState>(formRef, formState).then((res) => {
                 const reqParam: LoginaccountOperateReq = {
@@ -149,6 +152,7 @@ export default defineComponent({
             close,
             submit,
             loading,
+            filerAccount,
         };
     },
 });

+ 13 - 8
src/views/information/account_info/compoments/modify-child-traders/index.vue

@@ -60,10 +60,11 @@
                               v-model:value="formState.logintaaccounts">
               <a-row>
                 <a-col :span="12"
-                       v-for="(item, index) in accountList"
+                       v-for="(item, index) in filerAccount()"
                        :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>
@@ -78,10 +79,10 @@
 import { closeModal } from '@/common/setup/modal/index';
 import { defineComponent, ref, PropType, watchEffect } from 'vue';
 import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
-import {LoginaccountOperateReq, LoginTaaccount} from '@/services/proto/accountinfo/interface';
+import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/accountinfo/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
-import { handleBusinessForm, } from '../setup';
+import { handleBusinessForm } from '../setup';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { validateAction } from '@/common/setup/form';
 import { BusinessFormState } from '../interface';
@@ -89,7 +90,7 @@ import { BusinessFormState } from '../interface';
 export default defineComponent({
     name: 'account_info_trade_btn_child_modify',
     props: {
-      firstBtnData: {
+        firstBtnData: {
             type: Object as PropType<ErmcpLoginUserEx>,
             default: {},
         },
@@ -111,6 +112,9 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_child_modify');
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleBusinessForm();
+        function filerAccount() {
+            return props.accountList.filter((e) => e.relateduserid === props.firstBtnData.roleid);
+        }
         watchEffect(() => {
             if (visible.value && props.selectedData) {
                 const { selectedData } = props;
@@ -130,11 +134,11 @@ export default defineComponent({
                     roleids: [24], // uint64 账号角色
                     userid: +props.selectedData.userid,
                     loginid: +props.selectedData.loginid,
-                    logintaaccounts: res.logintaaccounts.map(res => {
+                    logintaaccounts: res.logintaaccounts.map((res) => {
                         const taAccount: LoginTaaccount = {
-                            accountid: res
+                            accountid: res,
                         };
-                        return taAccount
+                        return taAccount;
                     }), // LoginTaaccount 期货账户(勾选交易员必填)
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改交易员成功', '修改交易员失败:']).then(() => {
@@ -151,6 +155,7 @@ export default defineComponent({
             cancel,
             submit,
             loading,
+            filerAccount,
         };
     },
 });

+ 0 - 2
src/views/information/account_info/list/setup.ts

@@ -146,8 +146,6 @@ export function handleBtnClickData() {
     const secondBtnData = ref<any>(null)
     const thirdBtnDat = ref<any>(null)
     function btnClick(...rest: any[]) {
-        console.log(rest);
-
         firstBtnData.value = rest[0];
         secondBtnData.value = rest[1];
         thirdBtnDat.value = rest[0];