소스 검색

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 년 전
부모
커밋
fa5af8e498

+ 13 - 8
src/common/setup/table/button.ts

@@ -12,14 +12,19 @@ import { BtnClassName, BtnList, ButtonListKey } from './interface';
  */
 function getClassName(val: string): BtnClassName {
     let result: BtnClassName = 'btnDeafault'
-    if (val.includes('disable') || val.includes('cancle') || val.includes('delete')) {
-        result = 'btnDanger'
-    } else if (val === '') {
-        result = 'btnDeafault'
-    } else if (val.includes('add')) {
-        result = 'operBtn'
-    } else {
-        result = 'btnPrimary'
+    const btnDanger = ['disable', 'cancle', 'delete', 'logout', 'locked']
+    const operBtn = ['add', 'modify', 'reset']
+    const map = new Map<BtnClassName, string[]>([
+        ['btnDanger', btnDanger],
+        ['operBtn', operBtn],
+    ])
+    for (const [key, value] of map) {
+        for (const item of value) {
+            if (val.includes(item)) {
+                result = key
+                break;
+            }
+        }
     }
     return result
 }

+ 36 - 10
src/views/information/account_info/compoments/modify-futures-son/index.vue

@@ -61,13 +61,22 @@ import { initData } from '@/common/methods/index';
 import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import {validateAction} from "@/common/setup/form";
+import {FormState} from "@/views/information/account_info/compoments/add-child-futures/interface";
+import {HedgeOutMainConfigReq} from "@/services/proto/accountinfo/interface";
+import {getLongTypeLoginID} from "@/services/bus/login";
+import {getUserId} from "@/services/bus/account";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {hedgeOutMainReq} from "@/services/proto/accountinfo";
 
 export default defineComponent({
     name: 'account_info_futures_btn_child_modify',
     components: {},
-    setup() {
+    setup(name, context) {
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_futures_btn_child_modify');
+
+        const loading = ref<boolean>(false);
         // 证件类型
         // const cardTypeList = ref<AllEnums[]>(getCardType());
         // // 表单
@@ -84,17 +93,34 @@ export default defineComponent({
         // function isPersonal(): boolean {
         //     return formState.userinfotype === '1';
         // }
+        // 增加accountid 就是修改
         // function submit() {
-        //     formRef.value
-        //         .validate()
-        //         .then(() => {
-        //             const param = toRaw(formState);
-        //             applyAction(param);
-        //             console.log('values', formState);
-        //         })
-        //         .catch((error: ValidateErrorEntity<FormState>) => {
-        //             console.log('error', error);
+        //     validateAction<FormState>(formRef, formState).then((res) => {
+        //         let reqParam: HedgeOutMainConfigReq = {
+        //             marketid: 15101, // uint64 内部市场ID(HedgeOutMainConfig)
+        //             limitnumber: 0, // uint64 挂单笔数限额默认0(HedgeOutMainConfig)
+        //             status: 1, // int32 渠道账号状态 1-可买入可卖出 2-可卖出不可买入默认1(HedgeOutMainConfig)
+        //             accountname: res.accountname, // string 账户名称accountname1(Taaccount)
+        //             taaccounttype: 1, // int32 账号类型 - 1:外部账号 2:内部账号 3:内部做市自营账号 4:内部做市接单账号(Taaccount)
+        //             currencyid: 1, // int32 货币ID默认为1(Taaccount)
+        //             outthreshold: 0, // double 出金阈值默认为0(Taaccount)
+        //             ismain: 0, // int32 是否母账号 0:不是母账户 1:是母账户(Taaccount)
+        //             parentaccountid: props.selectedData.mainAcc.accountid, // uint64 所属根账号(Taaccount)
+        //             relateduserid: res.traderUserId, // uint64 关联用户(Taaccount)
+        //             fromaccountid: props.selectedData.mainAcc.accountid, // uint64 所属上级账户(Taaccount)
+        //             trademargintmpid: res.trademargintmpid, // uint64 保证金模板id(TAACCOUNTCONFIG)
+        //             tradefeetmpid: res.tradefeetmpid, // uint64 手续费模板ID(TAACCOUNTCONFIG)
+        //             maxsubaccouts: 0, // uint64 最大子账户数[最大99999][外部母账户用 默认0(TAACCOUNTCONFIG)
+        //             creatorid: Number(getLongTypeLoginID()), // uint64 创建人
+        //             modifierid: Number(getLongTypeLoginID()), // uint64 修改人
+        //             areauserid: getUserId(), // uint64 机构用户ID
+        //         };
+        //
+        //         requestResultLoadingAndInfo(hedgeOutMainReq, reqParam, loading, ['新增期货子账户成功', '新增期货子账户失败:']).then(() => {
+        //             cancel();
+        //             context.emit('refresh');
         //         });
+        //     });
         // }
         return {
             // formState,

+ 3 - 1
src/views/information/account_info/compoments/modify-futures/index.vue

@@ -108,9 +108,11 @@ export default defineComponent({
         const { rules, formState, formRef, initFormData } = handleAddOrModifyFuturesForm();
         watchEffect(() => {
             if (visible.value) {
+              console.log(props.selectedData);
+              
                 mergeTwoObj(formState, props.selectedData?.mainAcc);
                 if(props.selectedData?.mainAcc) {
-                  formState.accountid = props.selectedData.mainAcc.accountid.toString()
+                  formState.accountid = props.selectedData.mainAcc.hedgeaccountcode
                 }
                 queryResultLoadingAndInfo(QueryFuturesCompany, loading).then((res) => {
                     companyList.value = res;