huangbin vor 4 Jahren
Ursprung
Commit
0085361141

+ 7 - 6
src/views/information/account_info/compoments/cancel-trader/index.vue

@@ -25,7 +25,7 @@
         <a-col :span="12">
           <a-form-item label="所属用户"
                        name="">
-            <span class="white">{{rolename}}</span>
+            <span class="white">{{firstBtnData.rolename}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -97,6 +97,10 @@ export default defineComponent({
     name: 'account_info_trade_btn_child_logout',
     components: {},
     props: {
+      firstBtnData: {
+            type: Object as PropType<ErmcpLoginUserEx>,
+            default: {},
+        },
         selectedData: {
             type: Object as PropType<ErmcpLoginUser>,
             default: {},
@@ -115,12 +119,10 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_child_logout');
         const loading = ref<boolean>(false);
         const { formState } = handleBusinessForm();
-        const { rolename, getRoleName } = handleRoleName();
         watchEffect(() => {
-            if (visible.value) {
-                const { selectedData, tableList } = props;
+            if (visible.value && props.selectedData) {
+                const { selectedData } = props;
                 mergeTwoObj(formState, selectedData);
-                getRoleName(tableList, selectedData);
                 formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
                 formState.accountname = props.selectedData.loginname;
             }
@@ -148,7 +150,6 @@ export default defineComponent({
 
         return {
             formState,
-            rolename,
             visible,
             cancel,
             submit,

+ 7 - 6
src/views/information/account_info/compoments/locked-trader/index.vue

@@ -19,7 +19,7 @@
         <a-col :span="12">
           <a-form-item label="所属用户"
                        name="">
-            <span class="white">{{rolename}}</span>
+            <span class="white">{{firstBtnData.rolename}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -91,6 +91,10 @@ export default defineComponent({
     name: 'account_info_trade_btn_locked',
     components: {},
     props: {
+        firstBtnData: {
+            type: Object as PropType<ErmcpLoginUserEx>,
+            default: {},
+        },
         selectedData: {
             type: Object as PropType<ErmcpLoginUser>,
             default: {},
@@ -109,12 +113,10 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_child_locked');
         const loading = ref<boolean>(false);
         const { formState } = handleBusinessForm();
-        const { rolename, getRoleName } = handleRoleName();
         watchEffect(() => {
-            if (visible.value) {
-                const { selectedData, tableList } = props;
+            if (visible.value && props.selectedData) {
+                const { selectedData } = props;
                 mergeTwoObj(formState, selectedData);
-                getRoleName(tableList, selectedData);
                 formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
                 formState.accountname = props.selectedData.loginname;
             }
@@ -145,7 +147,6 @@ export default defineComponent({
             cancel,
             submit,
             loading,
-            rolename,
         };
     },
 });

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

@@ -21,7 +21,7 @@
         <a-col :span="12">
           <a-form-item label="所属用户"
                        name="">
-            <span class="white">{{rolename}}</span>
+            <span class="white">{{firstBtnData.rolename}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -88,6 +88,10 @@ import { BusinessFormState } from '../interface';
 export default defineComponent({
     name: 'account_info_trade_btn_child_modify',
     props: {
+      firstBtnData: {
+            type: Object as PropType<ErmcpLoginUserEx>,
+            default: {},
+        },
         selectedData: {
             type: Object as PropType<ErmcpLoginUser>,
             default: {},
@@ -106,12 +110,10 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_child_modify');
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleBusinessForm();
-        const { rolename, getRoleName } = handleRoleName();
         watchEffect(() => {
-            if (visible.value) {
-                const { selectedData, tableList } = props;
+            if (visible.value && props.selectedData) {
+                const { selectedData } = props;
                 mergeTwoObj(formState, selectedData);
-                getRoleName(tableList, selectedData);
                 formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
                 formState.accountname = props.selectedData.loginname;
             }
@@ -144,9 +146,6 @@ export default defineComponent({
             formState,
             rules,
             formRef,
-            rolename,
-            // cardTypeList,
-            // isPersonal,
             visible,
             cancel,
             submit,

+ 7 - 6
src/views/information/account_info/compoments/unlocked-trader/index.vue

@@ -19,7 +19,7 @@
         <a-col :span="12">
           <a-form-item label="所属用户"
                        name="">
-            <span class="white">{{rolename}}</span>
+            <span class="white">{{firstBtnData.rolename}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -91,6 +91,10 @@ export default defineComponent({
     name: 'account_info_trade_btn_child_unlocked',
     components: {},
     props: {
+      firstBtnData: {
+            type: Object as PropType<ErmcpLoginUserEx>,
+            default: {},
+        },
         selectedData: {
             type: Object as PropType<ErmcpLoginUser>,
             default: {},
@@ -109,12 +113,10 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_child_unlocked');
         const loading = ref<boolean>(false);
         const { formState } = handleBusinessForm();
-        const { rolename, getRoleName } = handleRoleName();
         watchEffect(() => {
-            if (visible.value) {
-                const { selectedData, tableList } = props;
+            if (visible.value && props.selectedData) {
+                const { selectedData } = props;
                 mergeTwoObj(formState, selectedData);
-                getRoleName(tableList, selectedData);
                 formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
                 formState.accountname = props.selectedData.loginname;
             }
@@ -145,7 +147,6 @@ export default defineComponent({
             cancel,
             submit,
             loading,
-            rolename,
         };
     },
 });

+ 0 - 8
src/views/information/account_info/list/account_info_futures/index.vue

@@ -123,10 +123,6 @@ export default defineComponent({
     setup() {
         const { loading, tableList, queryTable } = queryTableList();
         const [firstBtn, secondBtn, thirdBtn] = _getBtnList('account_info_futures', true).value;
-        // 新增弹窗
-        const { selectedData: addModelData, openAction } = handleModalData<ErmcpTaAccountEx>();
-        // 修改 重置密码、详情等弹窗
-        const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpTaAccountEx>();
                 // 交易用户
         const { tableList: userList, queryTable: queryUserList } = handlerManagerList(loading, 2);
         // 交易模板
@@ -158,12 +154,8 @@ export default defineComponent({
         function search(value: any) {}
 
         return {
-            addModelData,
-            openAction,
-            moreModelData,
             firstData,
             secondeData,
-            moreOptenAction,
             secondeClick,
             thirdClick,
             loading,

+ 28 - 23
src/views/information/account_info/list/account_info_trade/index.vue

@@ -36,9 +36,8 @@
               {{item.rolename}}({{item.userlist.length}})
             </a-col>
             <a-col :span="12">
-              <BtnList :selectedData="item"
-                       :btnList="secondBtn"
-                       @onClick="openAction" />
+              <BtnList :btnList="secondBtn"
+                       @onClick="btnClick(item)" />
             </a-col>
           </a-row>
         </template>
@@ -54,49 +53,52 @@
               </a-row>
             </template>
             <BtnList :btnList="sub.btnList"
-                     :selectedData="sub"
-                     @onClick="moreOptenAction" />
+                     @onClick="btnClick(item, sub)" />
           </a-collapse-panel>
         </a-collapse>
       </a-collapse-panel>
     </a-collapse>
-    <Add @refresh="handleBtnAction"
-         :selectedData="addModelData" />
+    <Add @refresh="handleBtnAction" />
     <AddChild @refresh="handleBtnAction"
               :accountList="accountList"
-              :selectedData="addModelData" />
+              :secondBtnData="firstBtnData" />
     <Modify @refresh="handleBtnAction"
-            :selectedData="addModelData" />
+            :selectedData="firstBtnData" />
     <Locked @refresh="handleBtnAction"
+            :firstBtnData="firstBtnData"
             :accountList="accountList"
             :tableList="tableList"
-            :selectedData="moreModelData" />
+            :selectedData="secondBtnData" />
     <Unlocked @refresh="handleBtnAction"
+              :firstBtnData="firstBtnData"
               :accountList="accountList"
               :tableList="tableList"
-              :selectedData="moreModelData" />
+              :selectedData="secondBtnData" />
     <Cancel @refresh="handleBtnAction"
             :accountList="accountList"
+            :firstBtnData="firstBtnData"
             :tableList="tableList"
-            :selectedData="moreModelData" />
+            :selectedData="secondBtnData" />
     <Reset @refresh="handleBtnAction"
            :accountList="accountList"
            :tableList="tableList"
-           :selectedData="moreModelData" />
-    <Detail :selectedData="moreModelData"
+           :selectedData="secondBtnData" />
+    <Detail :selectedData="secondBtnData"
             :accountList="accountList"
+            :firstBtnData="firstBtnData"
             :tableList="tableList" />
     <ModifyChild @refresh="handleBtnAction"
                  :accountList="accountList"
+                 :firstBtnData="firstBtnData"
                  :tableList="tableList"
-                 :selectedData="moreModelData" />
+                 :selectedData="secondBtnData" />
   </div>
 </template>
 
 <script lang="ts">
 import { defineComponent, initData, getBtnList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
-import { getRoleTypeName } from '../setup';
+import { getRoleTypeName, handleBtnClickData } from '../setup';
 import { getUserName } from '@/services/bus/user';
 import Modify from '../../compoments/modify-traders/index.vue';
 import Add from '../../compoments/add-traders/index.vue'
@@ -143,7 +145,7 @@ export default defineComponent({
         function handleBtnAction() {
             handleTableList(queryTable, tableList, thirdBtn);
         }
-
+        const { firstBtnData, secondBtnData, btnClick }= handleBtnClickData()
         // 授权期货账户
         const accountList = ref<ErmcpTaAccount[]>([]);
 
@@ -162,7 +164,10 @@ export default defineComponent({
         function search(value: any) {}
 
         return {
+          firstBtnData,
+          btnClick,
             firstBtn,
+            secondBtnData,
             secondBtn,
             thirdBtn,
             loading,
@@ -204,12 +209,12 @@ export default defineComponent({
         }
     }
     .ant-collapse.busyCollapse {
-      .operBtn.ant-btn {
-        margin-top: 0;
-        margin-bottom: 0;
-        height: 26px;
-        line-height: 26px;
-      }
+        .operBtn.ant-btn {
+            margin-top: 0;
+            margin-bottom: 0;
+            height: 26px;
+            line-height: 26px;
+        }
     }
     .ant-row.headRow {
         .ant-col:nth-child(2) {

+ 15 - 1
src/views/information/account_info/list/setup.ts

@@ -1,6 +1,6 @@
 import { BtnList } from "@/common/setup/table/interface";
 import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
-import { reactive, Ref } from "vue";
+import { reactive, ref, Ref } from "vue";
 
 /**
  * 获取账户状态
@@ -83,4 +83,18 @@ export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>
             Object.assign(el, { userlist: arr });
         });
     });
+}
+
+export function handleBtnClickData() {
+    const firstBtnData = ref<any>(null)
+    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];
+    }
+    return { firstBtnData, secondBtnData, thirdBtnDat, btnClick }
 }

+ 2 - 2
src/views/search/inventory/list/inventory_current/index.vue

@@ -14,9 +14,9 @@
                :customRow="Rowclick"
                :data-source="tableList">
         <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
+        <!-- <template #expandedRowRender="{  }">
           <BtnList :btnList="secondBtn" />
-        </template>
+        </template> -->
       </a-table>
     </contextMenu>
     <Add :selectedRow="selectedRow"