Parcourir la source

修改交易账号

huangbin il y a 4 ans
Parent
commit
3f142d6d17

+ 3 - 1
src/views/business/spotmarket/components/detail/index.vue

@@ -1,6 +1,8 @@
 <template>
-    <div></div>
+  <div></div>
 </template>
 
 <script lang="ts">
+import { defineComponent } from '@/common/export/commonTable';
+export default defineComponent({});
 </script>

+ 90 - 51
src/views/information/account_info/list/account_info_trade/index.vue

@@ -1,52 +1,75 @@
 <template>
-    <div style="background: red; color: #fff; padding: 5px 0">待修改</div>
-    <!-- 交易账户 -->
-    <div class="account_info_trade account_info_container" :loading="loading">
-        <filterCustomTable @search="search"></filterCustomTable>
-        <div class="tltLeft">
-            <span class="blue">
-                <svg class="icon svg-icon" aria-hidden="true">
-                    <use xlink:href="#icon-shuzhuangtu"></use>
-                </svg>
-                {{ getUserName() }}
-            </span>
-            <mtp-table-button :buttons="firstBtn" @click="openComponent" />
-        </div>
-        <div class="a-collapse-container">
-            <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
-                <template #expandIcon="props">
-                    <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                        <use xlink:href="#icon-shouqi1"></use>
-                    </svg>
-                    <svg class="icon svg-icon" aria-hidden="true" v-else>
-                        <use xlink:href="#icon-shouqi2"></use>
-                    </svg>
-                </template>
-                <a-collapse-panel>
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="12"> {{ item.rolename }}({{ item.userlist.length }}) </a-col>
-                            <a-col :span="12">
-                                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
-                            </a-col>
-                        </a-row>
-                    </template>
-                    <a-collapse class="busyCollapse" v-for="(sub, i) in item.userlist" :key="i + '11'" :bordered="false">
-                        <a-collapse-panel :show-arrow="false">
-                            <template #header>
-                                <a-row class="contRow">
-                                    <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
-                                    <a-col :span="12">{{ getRoleTypeName(sub.loginstatus) }}</a-col>
-                                </a-row>
-                            </template>
-                            <mtp-table-button :buttons="thirdBtn" :record="sub" @click="openComponent" />
-                        </a-collapse-panel>
-                    </a-collapse>
-                </a-collapse-panel>
-            </a-collapse>
-        </div>
-        <component :is="componentId" v-if="componentId" :accountList="accountList" :tableList="tableList" :selectedData="selectedData" @cancel="closeComponent"></component>
+  <div style="background: red; color: #fff; padding: 5px 0">待修改</div>
+  <!-- 交易账户 -->
+  <div class="account_info_trade account_info_container"
+       :loading="loading">
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon"
+             aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        {{ getUserName() }}
+      </span>
+      <mtp-table-button :buttons="firstBtn"
+                        @click="openComponent" />∏
     </div>
+    <div class="a-collapse-container">
+      <a-collapse class="spotCollapse"
+                  v-for="(item, i) in tableList"
+                  :key="i + '11'"
+                  :bordered="false">
+        <template #expandIcon="props">
+          <svg class="icon svg-icon"
+               aria-hidden="true"
+               v-if="props.isActive == 0">
+            <use xlink:href="#icon-shouqi1"></use>
+          </svg>
+          <svg class="icon svg-icon"
+               aria-hidden="true"
+               v-else>
+            <use xlink:href="#icon-shouqi2"></use>
+          </svg>
+        </template>
+        <a-collapse-panel>
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="12"> {{ item.rolename }}({{ item.userlist.length }}) </a-col>
+              <a-col :span="12">
+                <mtp-table-button :buttons="secondBtn"
+                                  :record="item"
+                                  @click="openComponent" />
+              </a-col>
+            </a-row>
+          </template>
+          <a-collapse class="busyCollapse"
+                      v-for="(sub, i) in item.userlist"
+                      :key="i + '11'"
+                      :bordered="false">
+            <a-collapse-panel :show-arrow="false">
+              <template #header>
+                <a-row class="contRow">
+                  <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
+                  <a-col :span="12">{{ getRoleTypeName(sub.loginstatus) }}</a-col>
+                </a-row>
+              </template>
+              <mtp-table-button :buttons="thirdBtn"
+                                :record="sub"
+                                @click="openSecondBtnAction" />
+            </a-collapse-panel>
+          </a-collapse>
+        </a-collapse-panel>
+      </a-collapse>
+    </div>
+    <component :is="componentId"
+               v-if="componentId"
+               :accountList="accountList"
+               :tableList="tableList"
+               :firstBtnData="firstSelectedData"
+               :selectedData="selectedData"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -56,13 +79,14 @@ import filterCustomTable from '@/views/information/goods/components/filterTable/
 import { getRoleTypeName } from '../setup';
 import { getUserName } from '@/services/bus/user';
 import { handleTableList } from '../setup';
-import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
-import { ref } from 'vue';
+import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryAccMgrTaaccount } from '@/services/go/ermcp/account';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { handlerManagerList } from '@/common/setup/user';
 import { getTableButton } from '@/common/setup/table/button';
+import { BtnListType } from '@/common/components/btnList/interface';
+import { Ref, ref } from 'vue';
 
 export default defineComponent({
     name: 'account_info_trade',
@@ -97,9 +121,22 @@ export default defineComponent({
         // 授权期货账户
         const accountList = ref<ErmcpTaAccount[]>([]);
         // 弹窗选中的数据
-        const selectedData = ref<ErmcpLoginUserEx>();
+        const selectedData = ref<ErmcpLoginUser>();
         // 控制异步组件
-        const { componentId, closeComponent, openComponent } = handleModalComponent(handleBtnAction, selectedData);
+        const { componentId, closeComponent, openComponent } = handleModalComponent<ErmcpLoginUser>(handleBtnAction, selectedData as Ref<ErmcpLoginUser>);
+        // 一级 对应的选中数据
+        const firstSelectedData = ref<ErmcpLoginUserEx>();
+        // 二级按钮 打开,处理选中上一层数据
+        function openSecondBtnAction(item: BtnListType, second: ErmcpLoginUser) {
+            tableList.value.forEach((el) => {
+                el.userlist.forEach((sub) => {
+                    if (second.userid === sub.userid) {
+                        firstSelectedData.value = el;
+                    }
+                });
+            });
+            openComponent(item, second);
+        }
 
         initData(() => {
             handleBtnAction();
@@ -135,6 +172,8 @@ export default defineComponent({
             componentId,
             closeComponent,
             openComponent,
+            openSecondBtnAction,
+            firstSelectedData,
         };
     },
 });