Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

yu jie 4 tahun lalu
induk
melakukan
54b36cb8ae

+ 4 - 4
src/views/information/account_info/compoments/cancel-business/index.vue

@@ -19,7 +19,7 @@
                 @click="submit">注销
       </a-button>
     </template>
-    <Detail :selectedData="selectedData" />
+    <Detail :selectedData="selectedRow" />
   </a-modal>
 </template>
 
@@ -37,7 +37,7 @@ export default defineComponent({
     name: 'account_info_business_btn_cancel',
     components: { Detail },
     props: {
-        selectedData: {
+        selectedRow: {
             default: {},
             type: Object as PropType<ErmcpLoginUser>,
         },
@@ -53,8 +53,8 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk() {
                     let reqParam: LoginaccountOperateReq = {
-                        userid: props.selectedData.userid,
-                        loginid: props.selectedData.loginid,
+                        userid: props.selectedRow.userid,
+                        loginid: props.selectedRow.loginid,
                         operatetype: 7, // 5: 锁定 6:解锁
                         logintaaccounts: [],
                     };

+ 2 - 2
src/views/information/account_info/compoments/detail-business/index.vue

@@ -12,7 +12,7 @@
                 type="primary"
                 @click="cancel">关闭</a-button>
     </template>
-    <Detail :selectedData="selectedData" />
+    <Detail :selectedData="selectedRow" />
   </a-modal>
 </template>
 
@@ -28,7 +28,7 @@ export default defineComponent({
         Detail,
     },
     props: {
-        selectedData: {
+        selectedRow: {
             type: Object as PropType<ErmcpLoginUser>,
             default: {},
         },

+ 4 - 4
src/views/information/account_info/compoments/locked-business/index.vue

@@ -13,7 +13,7 @@
                 :loading="loading"
                 @click="submit">锁定</a-button>
     </template>
-    <Detail :selectedData="selectedData" />
+    <Detail :selectedData="selectedRow" />
   </a-modal>
 </template>
 
@@ -31,7 +31,7 @@ export default defineComponent({
     name: 'account_info_business_btn_locked',
     components: { Detail },
     props: {
-        selectedData: {
+        selectedRow: {
             default: {},
             type: Object as PropType<ErmcpLoginUser>,
         },
@@ -47,8 +47,8 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk() {
                     let reqParam: LoginaccountOperateReq = {
-                        userid: props.selectedData.userid,
-                        loginid: props.selectedData.loginid,
+                        userid: props.selectedRow.userid,
+                        loginid: props.selectedRow.loginid,
                         operatetype: 5, // 5: 锁定 6:解锁
                         logintaaccounts: [],
                     };

+ 5 - 5
src/views/information/account_info/compoments/reset-business/index.vue

@@ -66,7 +66,7 @@ import { _closeModal } from '@/common/setup/modal/modal';
 export default defineComponent({
     name: 'account_info_business_btn_reset',
     props: {
-        selectedData: {
+        selectedRow: {
             default: {},
             type: Object as PropType<ErmcpLoginUser>,
         },
@@ -77,16 +77,16 @@ export default defineComponent({
         const { rules, formState, formRef } = handlePasswordForm();
         const loading = ref<boolean>(false);
 
-        formState.logincode = props.selectedData.logincode;
+        formState.logincode = props.selectedRow.logincode;
 
         function submit() {
             validateAction<ResetPasswordFormState>(formRef, formState).then((res) => {
                 let reqParam: LoginaccountOperateReq = {
-                    userid: props.selectedData.userid,
-                    loginid: props.selectedData.loginid,
+                    userid: props.selectedRow.userid,
+                    loginid: props.selectedRow.loginid,
                     operatetype: 9, // 5: 锁定 6:解锁
                     logintaaccounts: [],
-                    logincode: props.selectedData.logincode,
+                    logincode: props.selectedRow.logincode,
                     password: res.password,
                 };
                 requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['重置登录账户密码成功', '重置登录账户密码失败:']).then(() => {

+ 4 - 4
src/views/information/account_info/compoments/unlocked-business/index.vue

@@ -13,7 +13,7 @@
                 :loading="loading"
                 @click="submit">解锁</a-button>
     </template>
-    <Detail :selectedData="selectedData" />
+    <Detail :selectedData="selectedRow" />
   </a-modal>
 </template>
 
@@ -31,7 +31,7 @@ export default defineComponent({
     name: 'account_info_business_btn_unlocked',
     components: { Detail },
     props: {
-        selectedData: {
+        selectedRow: {
             default: {},
             type: Object as PropType<ErmcpLoginUser>,
         },
@@ -47,8 +47,8 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk() {
                     let reqParam: LoginaccountOperateReq = {
-                        userid: props.selectedData.userid,
-                        loginid: props.selectedData.loginid,
+                        userid: props.selectedRow.userid,
+                        loginid: props.selectedRow.loginid,
                         operatetype: 6, // 5: 锁定 6:解锁
                         logintaaccounts: [],
                     };

+ 8 - 16
src/views/information/account_info/list/account_info_business/index.vue

@@ -73,6 +73,13 @@ import { getLoginStatusEnumItemName } from '@/common/constants/enumsName';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import BtnList from '@/common/components/btnList/index.vue';
 
+import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
+import { getUserName } from '@/services/bus/user';
+import { _handleTableList } from '../setup';
+import { ref } from 'vue';
+import { handleModalComponent } from '@/common/setup/asyncComponent';
+import { getBtnList_ } from '@/common/setup/table/button';
+
 const Add = defineAsyncComponent(() => import('../../compoments/add-business/index.vue'));
 const Modify = defineAsyncComponent(() => import('../../compoments/modify-business/index.vue'));
 const Reset = defineAsyncComponent(() => import('../../compoments/reset-business/index.vue'));
@@ -81,13 +88,6 @@ const Cancel = defineAsyncComponent(() => import('../../compoments/cancel-busine
 const Detail = defineAsyncComponent(() => import('../../compoments/detail-business/index.vue'));
 const Unlocked = defineAsyncComponent(() => import('../../compoments/unlocked-business/index.vue'));
 
-import { ErmcpLoginUser, ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
-import { getUserName } from '@/services/bus/user';
-import { handleModalData, handleTableList } from '../setup';
-import { ref } from 'vue';
-import { handleModalComponent } from '@/common/setup/asyncComponent';
-import { getBtnList_ } from '@/common/setup/table/button';
-
 export default defineComponent({
     name: 'account_info_business',
     components: {
@@ -108,13 +108,9 @@ export default defineComponent({
         const { tableList, queryTable } = handlerManagerList(loading, 1);
         const [firstBtn, secondBtn] = getBtnList_('account_info_business', true).value;
 
-        // 新增弹窗 角色类型
-        const { selectedData: addModelData, openAction } = handleModalData<ErmcpLoginUserEx>();
-        // 修改 重置密码、详情等弹窗
-        const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpLoginUser>();
         // 处理根据状态显示对应按钮
         function handleBtnAction() {
-            handleTableList(queryTable, tableList, secondBtn);
+            _handleTableList(queryTable, tableList, secondBtn);
         }
         // 弹窗选中的数据
         const selectedData = ref<ErmcpLoginUserEx>();
@@ -134,11 +130,7 @@ export default defineComponent({
             tableList,
             getLoginStatusEnumItemName,
             handleBtnAction,
-            moreModelData,
             getUserName,
-            openAction,
-            addModelData,
-            moreOptenAction,
             componentId,
             closeComponent,
             openComponent,

+ 1 - 1
src/views/information/account_info/list/account_info_manager/index.vue

@@ -125,7 +125,7 @@ export default defineComponent({
         const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpLoginUser>();
         // 处理根据状态显示对应按钮
         function handleBtnAction() {
-            // handleTableList(queryTable, tableList, thirdBtn);
+            handleTableList(queryTable, tableList, thirdBtn);
         }
         initData(() => {
             handleBtnAction();

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

@@ -143,7 +143,7 @@ export default defineComponent({
         const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpLoginUser>();
         // 处理根据状态显示对应按钮
         function handleBtnAction() {
-            // handleTableList(queryTable, tableList, thirdBtn);
+            handleTableList(queryTable, tableList, thirdBtn);
         }
         const { firstBtnData, secondBtnData, btnClick } = handleBtnClickData();
         // 授权期货账户

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

@@ -1,4 +1,5 @@
 import { BtnList } from '@/common/components/btnList/interface';
+import { BtnList as OldBtnType } from "@/common/setup/table/interface";
 import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
 import { reactive, ref, Ref } from "vue";
 
@@ -96,7 +97,29 @@ export function handleModalData<T extends object>() {
     return { selectedData, openAction }
 }
 
-export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: BtnList[]) {
+export function _handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: BtnList[]) {
+    fn().then(() => {
+        tableList.value.forEach((el) => {
+            // 过滤无效
+            const arr = el.userlist.filter((item) => item.loginstatus !== 3);
+            arr.forEach((item) => {
+                const { loginstatus } = item;
+                let result = [...btnList];
+                if (loginstatus === 1) {
+                    // 正常
+                    result = btnList.filter((e) => e.lable !== '解锁');
+                } else if (loginstatus === 2) {
+                    // 冻结
+                    result = btnList.filter((e) => e.lable === '解锁' || e.lable === '详情');
+                }
+                Object.assign(item, { btnList: result });
+            });
+            Object.assign(el, { userlist: arr });
+        });
+    });
+}
+
+export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: OldBtnType[]) {
     fn().then(() => {
         tableList.value.forEach((el) => {
             // 过滤无效