Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6ead05eb39
|
|
@ -62,7 +62,7 @@
|
||||||
<context-menu-item
|
<context-menu-item
|
||||||
v-if="
|
v-if="
|
||||||
([1, 2, 3, 4].includes(userStore!.userInfo!.role_id) ||
|
([1, 2, 3, 4].includes(userStore!.userInfo!.role_id) ||
|
||||||
(userStore!.userInfo!.role_id === 5 && userStore!.userInfo!.type === 1)) &&
|
(userStore!.userInfo!.role_id === 5 && (userStore!.userInfo as any).type === 1)) &&
|
||||||
userStore!.userInfo!.role_id === currentRow.role_id
|
userStore!.userInfo!.role_id === currentRow.role_id
|
||||||
"
|
"
|
||||||
label="取款"
|
label="取款"
|
||||||
|
|
@ -277,7 +277,7 @@ const marketForm = ref({
|
||||||
maxPositionRatio: '',
|
maxPositionRatio: '',
|
||||||
maxCommissionRatio: '',
|
maxCommissionRatio: '',
|
||||||
})
|
})
|
||||||
const marketFormRules = rules(marketForm.value)
|
const marketFormRules = computed(() => rules(marketForm.value, undefined, dialogType.value === 'edit'))
|
||||||
const marketFormRef = ref()
|
const marketFormRef = ref()
|
||||||
const marketFormItemOptions = computed(() => {
|
const marketFormItemOptions = computed(() => {
|
||||||
return marketFormItem.map((item) => {
|
return marketFormItem.map((item) => {
|
||||||
|
|
@ -323,7 +323,7 @@ const selectedRow = ref<any>(null)
|
||||||
// 菜单状态
|
// 菜单状态
|
||||||
const menuVisible = ref(false)
|
const menuVisible = ref(false)
|
||||||
const menuOptions = reactive({ x: 0, y: 0, zIndex: 3000 })
|
const menuOptions = reactive({ x: 0, y: 0, zIndex: 3000 })
|
||||||
const currentRow = ref(null)
|
const currentRow = ref<any>(null)
|
||||||
const rightClickDialogVisible = ref(false)
|
const rightClickDialogVisible = ref(false)
|
||||||
const rightClickDialogType = ref<'account' | 'acceptOrders' | 'transfer' | 'deposit' | 'withdraw'>(
|
const rightClickDialogType = ref<'account' | 'acceptOrders' | 'transfer' | 'deposit' | 'withdraw'>(
|
||||||
'account',
|
'account',
|
||||||
|
|
@ -336,7 +336,7 @@ const rightClickDialogTitleEnum = {
|
||||||
withdraw: '存款',
|
withdraw: '存款',
|
||||||
}
|
}
|
||||||
const rightClickMarketForm = ref<any>({})
|
const rightClickMarketForm = ref<any>({})
|
||||||
const rightClickMarketFormRules = ref(accountFormItemRules)
|
const rightClickMarketFormRules = ref<Record<string, any>>(accountFormItemRules)
|
||||||
const rightClickMarketFormItemOptions = ref(accountFormItemList)
|
const rightClickMarketFormItemOptions = ref(accountFormItemList)
|
||||||
|
|
||||||
// 行右键点击
|
// 行右键点击
|
||||||
|
|
@ -483,6 +483,7 @@ const mapMarketTree = (data: any) => {
|
||||||
*/
|
*/
|
||||||
const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', value: string) => {
|
const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', value: string) => {
|
||||||
try {
|
try {
|
||||||
|
let flag: number | undefined = undefined
|
||||||
// 1. 级别变更:获取所属上级账户列表
|
// 1. 级别变更:获取所属上级账户列表
|
||||||
if (type === 'level') {
|
if (type === 'level') {
|
||||||
// 清空关联数据,避免脏数据
|
// 清空关联数据,避免脏数据
|
||||||
|
|
@ -493,11 +494,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
|
||||||
if (!value) return // 未选择级别,直接返回
|
if (!value) return // 未选择级别,直接返回
|
||||||
|
|
||||||
// 调用获取上级账户列表接口
|
// 调用获取上级账户列表接口
|
||||||
let flag = null
|
const levelNum = Number(marketForm.value?.level)
|
||||||
if (marketForm.value?.level * 1 === 5) flag = 1
|
if (levelNum === 5) flag = 1
|
||||||
if (marketForm.value?.level * 1 === 6) flag = 2
|
if (levelNum === 6) flag = 2
|
||||||
console.log('datasssssssssssss', marketForm.value)
|
console.log('datasssssssssssss', marketForm.value)
|
||||||
const data = await getParAgentListApi({ role_id: +value === 6 ? 5 : value, flag: flag })
|
const data = await getParAgentListApi({ role_id: +value === 6 ? 5 : value, flag })
|
||||||
// 格式化下拉选项
|
// 格式化下拉选项
|
||||||
marketFormOptionsMap.value.parentAccountName = data.map((item: any) => ({
|
marketFormOptionsMap.value.parentAccountName = data.map((item: any) => ({
|
||||||
label: item.username,
|
label: item.username,
|
||||||
|
|
@ -519,12 +520,13 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
|
||||||
)
|
)
|
||||||
if (!rulesData) return // 未找到匹配项,直接返回
|
if (!rulesData) return // 未找到匹配项,直接返回
|
||||||
|
|
||||||
|
console.log('rulesData:', rulesData);
|
||||||
// 赋值最大头寸和手续费比例
|
// 赋值最大头寸和手续费比例
|
||||||
marketForm.value.maxPositionRatio = rulesData.row.wallet_capital.toucun_percent
|
marketForm.value.maxPositionRatio = String(rulesData.row.wallet_capital.toucun_percent)
|
||||||
marketForm.value.maxCommissionRatio = rulesData.row.wallet_capital.fee_handling_percent
|
marketForm.value.maxCommissionRatio = String(rulesData.row.wallet_capital.fee_handling_percent)
|
||||||
|
|
||||||
// 调用获取点差列表接口
|
// 调用获取点差列表接口
|
||||||
const data = await getPointDiffConfigListApi({ user_id: value, flag: flag })
|
const data = await getPointDiffConfigListApi({ user_id: value, flag })
|
||||||
// 格式化点差表格数据(按实际需求调整)
|
// 格式化点差表格数据(按实际需求调整)
|
||||||
marketPointTree.value = data.map((item: any) => ({
|
marketPointTree.value = data.map((item: any) => ({
|
||||||
...item,
|
...item,
|
||||||
|
|
@ -664,7 +666,7 @@ const handleEditMarket = async () => {
|
||||||
marketForm.value = {
|
marketForm.value = {
|
||||||
...initMarketForm,
|
...initMarketForm,
|
||||||
accountName: row.accountName || '',
|
accountName: row.accountName || '',
|
||||||
level: String(row.level) || '',
|
level: row.level || '',
|
||||||
parentAccountName: '',
|
parentAccountName: '',
|
||||||
riskControlTemplate: row.wallet_capital.risk_control_id || '',
|
riskControlTemplate: row.wallet_capital.risk_control_id || '',
|
||||||
positionRatio: row.positionRatio || '',
|
positionRatio: row.positionRatio || '',
|
||||||
|
|
@ -781,7 +783,7 @@ const handleSubmit = async () => {
|
||||||
console.log('pointDiffObj', pointDiffObj)
|
console.log('pointDiffObj', pointDiffObj)
|
||||||
if (!pointDiffObj) return
|
if (!pointDiffObj) return
|
||||||
if (dialogType.value === 'add') {
|
if (dialogType.value === 'add') {
|
||||||
const params = {
|
const params: Record<string, any> = {
|
||||||
role_id: marketForm.value.level,
|
role_id: marketForm.value.level,
|
||||||
reg_type: activeTab.value === 'email' ? '1' : '2',
|
reg_type: activeTab.value === 'email' ? '1' : '2',
|
||||||
username: marketForm.value.accountName,
|
username: marketForm.value.accountName,
|
||||||
|
|
|
||||||
|
|
@ -110,21 +110,21 @@ export const viewMarketPointTableColumns = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export const accountFormItemList = [
|
export const accountFormItemList = [
|
||||||
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
|
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
|
||||||
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
|
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
|
||||||
{ label: '当前余额', prop: 'amount_old', type: 'input', disabled: true },
|
{ label: '当前余额', prop: 'amount_old', type: 'input' as const, disabled: true },
|
||||||
{ label: '调整金额', prop: 'amount', type: 'input' },
|
{ label: '调整金额', prop: 'amount', type: 'input' as const },
|
||||||
{ label: '调整后余额', prop: 'amount_new', type: 'input', disabled: true },
|
{ label: '调整后余额', prop: 'amount_new', type: 'input' as const, disabled: true },
|
||||||
]
|
]
|
||||||
export const accountFormItemRules = {
|
export const accountFormItemRules = {
|
||||||
amount: [{ required: true, message: '请输入调整金额', trigger: ['blur', 'change'] }],
|
amount: [{ required: true, message: '请输入调整金额', trigger: ['blur', 'change'] }],
|
||||||
}
|
}
|
||||||
|
|
||||||
export const acceptOrdersFormItemList = [
|
export const acceptOrdersFormItemList = [
|
||||||
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
|
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
|
||||||
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
|
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
|
||||||
{ label: '当前停止接单金额', prop: 'bail_stop_order_old', type: 'input', disabled: true },
|
{ label: '当前停止接单金额', prop: 'bail_stop_order_old', type: 'input' as const, disabled: true },
|
||||||
{ label: '调整金额', prop: 'bail_stop_order', type: 'input' },
|
{ label: '调整金额', prop: 'bail_stop_order', type: 'input' as const },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const acceptOrdersFormItemRules = {
|
export const acceptOrdersFormItemRules = {
|
||||||
|
|
@ -132,10 +132,10 @@ export const acceptOrdersFormItemRules = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const transferFormItemList = [
|
export const transferFormItemList = [
|
||||||
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
|
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
|
||||||
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
|
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
|
||||||
{ label: '当前持仓转移金额', prop: 'bail_change_order_old', type: 'input', disabled: true },
|
{ label: '当前持仓转移金额', prop: 'bail_change_order_old', type: 'input' as const, disabled: true },
|
||||||
{ label: '调整金额', prop: 'bail_change_order', type: 'input' },
|
{ label: '调整金额', prop: 'bail_change_order', type: 'input' as const },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const transferFormItemRules = {
|
export const transferFormItemRules = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
|
|
||||||
|
|
||||||
export const rules = (marketForm: any, row?: any): FormRules => {
|
export const rules = (marketForm: any, row?: any, isEdit?: boolean): FormRules => {
|
||||||
return {
|
return {
|
||||||
email: [
|
email: [
|
||||||
{ required: true, message: '请输入邮箱地址', trigger: ['blur', 'change'] },
|
{ required: true, message: '请输入邮箱地址', trigger: ['blur', 'change'] },
|
||||||
|
|
@ -31,10 +31,10 @@ export const rules = (marketForm: any, row?: any): FormRules => {
|
||||||
{ required: true, message: '请输入账号名称', trigger: 'blur' }
|
{ required: true, message: '请输入账号名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
level: [
|
level: [
|
||||||
{ required: true, message: '请选择等级', trigger: 'change' }
|
{ required: !isEdit, message: '请选择等级', trigger: 'change' }
|
||||||
],
|
],
|
||||||
parentAccountName: [
|
parentAccountName: [
|
||||||
{ required: true, message: '请选择上级账号', trigger: 'change' }
|
{ required: !isEdit, message: '请选择上级账号', trigger: 'change' }
|
||||||
],
|
],
|
||||||
riskControlTemplate: [
|
riskControlTemplate: [
|
||||||
{ required: true, message: '请选择风控模板', trigger: 'change' }
|
{ required: true, message: '请选择风控模板', trigger: 'change' }
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@
|
||||||
<div class="info-text">
|
<div class="info-text">
|
||||||
<div class="username-row">
|
<div class="username-row">
|
||||||
<span class="username-text">{{ userInfo.username }}</span>
|
<span class="username-text">{{ userInfo.username }}</span>
|
||||||
<el-button link type="primary" size="small" @click="showEditDialog('username')">{{ t('personalCenter.modify') }}</el-button>
|
<el-button link type="primary" size="small" @click="showEditDialog('username')">{{
|
||||||
|
t('personalCenter.modify') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-time">{{ t('personalCenter.lastLogin') }}:{{ userInfo.last_login }}</div>
|
<div class="login-time">{{ t('personalCenter.lastLogin') }}:{{ userInfo.last_login }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -29,9 +30,9 @@
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">{{ t('personalCenter.email') }}</span>
|
<span class="label">{{ t('personalCenter.email') }}</span>
|
||||||
<span class="value">{{ userInfo.email || t('personalCenter.notSet') }}</span>
|
<span class="value">{{ userInfo.email || t('personalCenter.notSet') }}</span>
|
||||||
<template v-if="canBindEmail">
|
<template v-if="!userInfo.email">
|
||||||
<el-button v-if="!userInfo.email" link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.goToBind') }}</el-button>
|
<el-button link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.goToBind')
|
||||||
<el-button v-else link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.rebind') }}</el-button>
|
}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
|
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
|
||||||
|
|
@ -40,10 +41,10 @@
|
||||||
|
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">{{ t('personalCenter.mobile') }}</span>
|
<span class="label">{{ t('personalCenter.mobile') }}</span>
|
||||||
<span class="value">{{ userInfo.mobile || t('personalCenter.notBound') }}</span>
|
<span class="value">{{ userInfo.mobile || t('personalCenter.notBound') }}</span> {{ }}
|
||||||
<template v-if="canBindMobile">
|
<template v-if="!userInfo.mobile">
|
||||||
<el-button v-if="!userInfo.mobile" link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.bind') }}</el-button>
|
<el-button link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.bind')
|
||||||
<el-button v-else link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.rebind') }}</el-button>
|
}}</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
|
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
|
||||||
|
|
@ -72,8 +73,7 @@
|
||||||
@cancel="handleEditDialogReset" @close="handleEditDialogReset">
|
@cancel="handleEditDialogReset" @close="handleEditDialogReset">
|
||||||
<el-form ref="editFormRef" :model="editForm" :rules="getEditRules()" label-width="80px" label-position="top">
|
<el-form ref="editFormRef" :model="editForm" :rules="getEditRules()" label-width="80px" label-position="top">
|
||||||
<el-form-item v-if="editField === 'mobile'" :label="editForm.label" prop="value" class="phone-item">
|
<el-form-item v-if="editField === 'mobile'" :label="editForm.label" prop="value" class="phone-item">
|
||||||
<el-select v-model="editForm.countryCode" :teleported="false" value-key="code" placeholder="国家"
|
<el-select v-model="editForm.countryCode" :teleported="false" value-key="code" placeholder="国家" size="large">
|
||||||
size="large">
|
|
||||||
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code" :value="item.code">
|
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code" :value="item.code">
|
||||||
<div class="country-option">
|
<div class="country-option">
|
||||||
<span class="country-name">{{ item.name }}</span>
|
<span class="country-name">{{ item.name }}</span>
|
||||||
|
|
@ -95,8 +95,8 @@
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<!-- 密码修改弹窗 → 验证码模式 -->
|
<!-- 密码修改弹窗 → 验证码模式 -->
|
||||||
<Dialog :visible="passwordDialogVisible" :title="t('personalCenter.modifyPassword')" width="500px" @confirm="handlePasswordConfirm"
|
<Dialog :visible="passwordDialogVisible" :title="t('personalCenter.modifyPassword')" width="500px"
|
||||||
@cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
|
@confirm="handlePasswordConfirm" @cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
|
||||||
<el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordFormRules" label-width="100px"
|
<el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordFormRules" label-width="100px"
|
||||||
label-position="top">
|
label-position="top">
|
||||||
<!-- 选择验证方式 -->
|
<!-- 选择验证方式 -->
|
||||||
|
|
@ -120,14 +120,14 @@
|
||||||
|
|
||||||
<!-- 新密码1 -->
|
<!-- 新密码1 -->
|
||||||
<el-form-item :label="t('personalCenter.newPassword')" prop="login_password1">
|
<el-form-item :label="t('personalCenter.newPassword')" prop="login_password1">
|
||||||
<el-input v-model="passwordForm.login_password1" type="password" show-password :placeholder="t('personalCenter.passwordPlaceholder')"
|
<el-input v-model="passwordForm.login_password1" type="password" show-password
|
||||||
size="large" />
|
:placeholder="t('personalCenter.passwordPlaceholder')" size="large" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 新密码2 -->
|
<!-- 新密码2 -->
|
||||||
<el-form-item :label="t('personalCenter.confirmPassword')" prop="login_password2">
|
<el-form-item :label="t('personalCenter.confirmPassword')" prop="login_password2">
|
||||||
<el-input v-model="passwordForm.login_password2" type="password" show-password :placeholder="t('personalCenter.confirmPasswordPlaceholder')"
|
<el-input v-model="passwordForm.login_password2" type="password" show-password
|
||||||
size="large" />
|
:placeholder="t('personalCenter.confirmPasswordPlaceholder')" size="large" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
@ -208,7 +208,7 @@ const phoneCaptchaState = initCaptchaState('phone');
|
||||||
const emailCaptchaState = initCaptchaState('email');
|
const emailCaptchaState = initCaptchaState('email');
|
||||||
|
|
||||||
const showPwdSendButton = ref(true);
|
const showPwdSendButton = ref(true);
|
||||||
const pwdSendState = ref({ isCounting: false, countdown: 0 });
|
const pwdSendState = reactive({ isCounting: false, countdown: 0 });
|
||||||
const pwdMobileCaptchaState = initCaptchaState('phone');
|
const pwdMobileCaptchaState = initCaptchaState('phone');
|
||||||
const pwdEmailCaptchaState = initCaptchaState('email');
|
const pwdEmailCaptchaState = initCaptchaState('email');
|
||||||
|
|
||||||
|
|
@ -458,9 +458,28 @@ const handleSendPwdCaptcha = async () => {
|
||||||
|
|
||||||
const updatePwdSendState = () => {
|
const updatePwdSendState = () => {
|
||||||
const t = passwordForm.verifyType === 'email' ? pwdEmailCaptchaState : pwdMobileCaptchaState;
|
const t = passwordForm.verifyType === 'email' ? pwdEmailCaptchaState : pwdMobileCaptchaState;
|
||||||
pwdSendState.value = { isCounting: t.isCounting.value, countdown: t.countdown.value };
|
pwdSendState.isCounting = t.isCounting.value;
|
||||||
|
pwdSendState.countdown = t.countdown.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 监听倒计时状态变化(实时同步到UI)
|
||||||
|
watch(
|
||||||
|
() => pwdMobileCaptchaState.countdown.value,
|
||||||
|
() => {
|
||||||
|
if (passwordForm.verifyType === 'mobile') {
|
||||||
|
updatePwdSendState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => pwdEmailCaptchaState.countdown.value,
|
||||||
|
() => {
|
||||||
|
if (passwordForm.verifyType === 'email') {
|
||||||
|
updatePwdSendState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 提交修改密码
|
// 提交修改密码
|
||||||
const handlePasswordConfirm = async () => {
|
const handlePasswordConfirm = async () => {
|
||||||
if (!passwordFormRef.value) return;
|
if (!passwordFormRef.value) return;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ const countdown = ref(0)
|
||||||
watch(
|
watch(
|
||||||
() => props.sendState,
|
() => props.sendState,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
|
console.log('监听 倒数 变化');
|
||||||
|
|
||||||
isCounting.value = newVal.isCounting
|
isCounting.value = newVal.isCounting
|
||||||
countdown.value = newVal.countdown
|
countdown.value = newVal.countdown
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue