Explorar o código

commit 管理账户新增

yu.jie %!s(int64=4) %!d(string=hai) anos
pai
achega
631c99cb8c

+ 19 - 2
src/views/information/account_info/compoments/add-managers/index.vue

@@ -79,6 +79,9 @@ import { handleBusinessForm } from '../setup';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { validateAction } from '@/common/setup/form';
 import { BusinessFormState } from '../interface';
+import {LoginaccountOperateReq, LoginTaaccount} from "@/services/proto/accountinfo/interface";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {loginAccountOperate} from "@/services/proto/accountinfo";
 
 export default defineComponent({
     name: 'account_info_manager_btn_add',
@@ -89,14 +92,28 @@ export default defineComponent({
             type: Array as PropType<ErmcpLoginUserEx[]>,
         },
     },
-    setup() {
+    setup(props, context) {
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_manager_btn_add');
         const { rules, formState, formRef } = handleBusinessForm();
         const loading = ref<boolean>(false);
 
         function submit() {
-            validateAction<BusinessFormState>(formRef, formState).then((res) => {});
+            validateAction<BusinessFormState>(formRef, formState).then((res) => {
+                const reqParam: LoginaccountOperateReq = {
+                    operatetype: 3, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
+                    logincode: res.logincode, // string 登录账号
+                    accountname: res.accountname, // string 账户名称
+                    password: res.password, // string 登录密码(明文)
+                    mobile: res.mobile, // string 手机号码(明文)
+                    roleids: [Number(res.userid)], // uint64 账号角色
+                    logintaaccounts: [], // LoginTaaccount 期货账户(勾选交易员必填)
+                };
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增成功', '新增失败:']).then(() => {
+                    cancel();
+                    context.emit('refresh');
+                });
+            });
         }
         return {
             formState,