Browse Source

Merge remote-tracking branch 'origin/master'

yu.jie 4 years ago
parent
commit
2457098c23

+ 1 - 2
src/common/setup/table/button.ts

@@ -34,7 +34,7 @@ export function getThirdMenuData(): OperationTabMenu[] {
     return data;
 }
 
-export function handleBtnList(list: OperationTabMenu | undefined, menuType: keyof ButtonListKey, hasDetail: boolean) {
+export function handleBtnList(list: OperationTabMenu | undefined, menuType: keyof ButtonListKey, hasDetail: boolean, commonName: string[] = ['新增']) {
     const commonBtn = ref<BtnList[]>([]); // 通用按钮列表,不用选中数据才显示
     const forDataBtn = ref<BtnList[]>([]); // 针对数据按钮列表,选中某条数据才显示
     if (list && list.children) {
@@ -43,7 +43,6 @@ export function handleBtnList(list: OperationTabMenu | undefined, menuType: keyo
             if (type === 2) { // 按钮类型
                 const { openAction } = openModal(code as keyof ModalName);
                 const item = { lable: title, callback: openAction, className: getClassName(code) }
-                const commonName = ['新增'] // 目前通用的按钮只要新增,需要添加其它的时候需要往这里添加
                 if (commonName.includes(title)) { // 
                     commonBtn.value.push(item)
                 } else {

+ 49 - 29
src/views/information/account_info/compoments/cancel-trader/index.vue

@@ -23,44 +23,55 @@
             :model="formState">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="登录账号"
+          <a-form-item label="所属用户"
                        name="">
-            <span class="white">{{formState.accountname}}</span>
+            <span class="white">{{rolename}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="账户名称"
-                       name="">
-            <span class="white">{{formState.logincode}}</span>
+                       name="logincode">
+            <a-input class="dialogInput"
+                     readonly
+                     style="width: 200px"
+                     v-model:value="formState.logincode"
+                     placeholder="请输入账户名称" />
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="登录密码"
-                       name="">
-            <a-input-password class="dialogInput"
-                              style="width: 200px"
-                              value="2323423"
-                              v-model:value="formState.password"
-                              readonly />
+          <a-form-item label="登录账号"
+                       name="accountname">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     readonly
+                     v-model:value="formState.accountname"
+                     placeholder="请输入登录账号" />
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="手机号码"
-                       name="">
-            <span class="white">{{formState.mobile}}</span>
+                       name="mobile">
+            <a-input class="dialogInput"
+                     v-model:value="formState.mobile"
+                     style="width: 200px"
+                     readonly
+                     placeholder="请输入手机号码" />
           </a-form-item>
         </a-col>
         <a-col :span="24">
-          <a-form-item label="账户角色"
-                       name="userinfotype">
+          <a-form-item label="授权期货账户"
+                       class="checkboxGroupItem"
+                       name="logintaaccounts">
             <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="formState.roleids">
+                              v-model:value="formState.logintaaccounts">
               <a-row>
-                <a-col :span="12">
-                  <a-checkbox :value="22">业务员</a-checkbox>
-                </a-col>
-                <a-col :span="12">
-                  <a-checkbox :value="23">跟单员</a-checkbox>
+                <a-col :span="12"
+                       v-for="(item, index) in selectedData.acclist"
+                       :key="index">
+                  <a-checkbox disabled
+                              :value="item.accountid">
+                    {{item.accountname}}/{{item.accountid}}
+                  </a-checkbox>
                 </a-col>
               </a-row>
             </a-checkbox-group>
@@ -78,8 +89,8 @@ import { Modal } from 'ant-design-vue';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
-import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
-import { handleBusinessForm } from '../setup';
+import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
+import { handleBusinessForm, handleRoleName } from '../setup';
 import { mergeTwoObj } from '@/utils/objHandle';
 
 export default defineComponent({
@@ -87,8 +98,16 @@ export default defineComponent({
     components: {},
     props: {
         selectedData: {
-            default: {},
             type: Object as PropType<ErmcpLoginUser>,
+            default: {},
+        },
+        tableList: {
+            type: Array as PropType<ErmcpLoginUserEx[]>,
+            default: [],
+        },
+        accountList: {
+            default: [],
+            type: Object as PropType<ErmcpTaAccount[]>,
         },
     },
     setup(props, context) {
@@ -96,9 +115,13 @@ export default defineComponent({
         const { visible, cancel } = closeModal('account_info_trade_btn_logout');
         const loading = ref<boolean>(false);
         const { formState } = handleBusinessForm();
+        const { rolename, getRoleName } = handleRoleName();
         watchEffect(() => {
             if (visible.value) {
-                mergeTwoObj(formState, props.selectedData);
+                const { selectedData, tableList } = props;
+                mergeTwoObj(formState, selectedData);
+                getRoleName(tableList, selectedData);
+                formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
             }
         });
         function submit() {
@@ -126,10 +149,7 @@ export default defineComponent({
 
         return {
             formState,
-            // rules,
-            // formRef,
-            // cardTypeList,
-            // isPersonal,
+            rolename,
             visible,
             cancel,
             submit,