|
@@ -43,18 +43,17 @@
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
-import { defineComponent, ref, PropType, watchEffect } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, ref, PropType } from 'vue';
|
|
|
import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
|
|
import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
|
|
|
import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
|
|
import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
|
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import { loginAccountOperate } from '@/services/proto/accountinfo';
|
|
import { loginAccountOperate } from '@/services/proto/accountinfo';
|
|
|
-import { mergeTwoObj } from '@/utils/objHandle';
|
|
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
import { handleTradeForm } from '../setup';
|
|
import { handleTradeForm } from '../setup';
|
|
|
import { TraderFormState } from '../interface';
|
|
import { TraderFormState } from '../interface';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- name: 'account_info_trade_btn_modify',
|
|
|
|
|
|
|
+ name: 'account_info_trade_btn_add',
|
|
|
props: {
|
|
props: {
|
|
|
selectedData: {
|
|
selectedData: {
|
|
|
type: Object as PropType<ErmcpLoginUserEx>,
|
|
type: Object as PropType<ErmcpLoginUserEx>,
|
|
@@ -63,15 +62,9 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
// 控制关闭弹窗
|
|
// 控制关闭弹窗
|
|
|
- const { visible, cancel } = closeModal('account_info_trade_btn_modify');
|
|
|
|
|
|
|
+ const { visible, cancel } = closeModal('account_info_trade_btn_add');
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
const { rules, formState, formRef } = handleTradeForm();
|
|
const { rules, formState, formRef } = handleTradeForm();
|
|
|
- watchEffect(() => {
|
|
|
|
|
- if (visible.value) {
|
|
|
|
|
- const { selectedData } = props;
|
|
|
|
|
- mergeTwoObj(formState, selectedData);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
function submit() {
|
|
function submit() {
|
|
|
validateAction<TraderFormState>(formRef, formState).then((res) => {
|
|
validateAction<TraderFormState>(formRef, formState).then((res) => {
|
|
|
const reqParam: LoginaccountOperateReq = {
|
|
const reqParam: LoginaccountOperateReq = {
|
|
@@ -82,7 +75,7 @@ export default defineComponent({
|
|
|
mobile: res.mobile, // string 手机号码(明文)
|
|
mobile: res.mobile, // string 手机号码(明文)
|
|
|
accountname: res.rolename,
|
|
accountname: res.rolename,
|
|
|
};
|
|
};
|
|
|
- requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
|
|
|
|
|
|
|
+ requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增成功', '新增失败:']).then(() => {
|
|
|
cancel();
|
|
cancel();
|
|
|
context.emit('refresh');
|
|
context.emit('refresh');
|
|
|
});
|
|
});
|