Merge remote-tracking branch 'origin/master'

This commit is contained in:
Songsl 2026-05-13 09:16:24 +08:00
commit 6ead05eb39
5 changed files with 70 additions and 47 deletions

View File

@ -62,7 +62,7 @@
<context-menu-item
v-if="
([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
"
label="取款"
@ -277,7 +277,7 @@ const marketForm = ref({
maxPositionRatio: '',
maxCommissionRatio: '',
})
const marketFormRules = rules(marketForm.value)
const marketFormRules = computed(() => rules(marketForm.value, undefined, dialogType.value === 'edit'))
const marketFormRef = ref()
const marketFormItemOptions = computed(() => {
return marketFormItem.map((item) => {
@ -323,7 +323,7 @@ const selectedRow = ref<any>(null)
//
const menuVisible = ref(false)
const menuOptions = reactive({ x: 0, y: 0, zIndex: 3000 })
const currentRow = ref(null)
const currentRow = ref<any>(null)
const rightClickDialogVisible = ref(false)
const rightClickDialogType = ref<'account' | 'acceptOrders' | 'transfer' | 'deposit' | 'withdraw'>(
'account',
@ -336,7 +336,7 @@ const rightClickDialogTitleEnum = {
withdraw: '存款',
}
const rightClickMarketForm = ref<any>({})
const rightClickMarketFormRules = ref(accountFormItemRules)
const rightClickMarketFormRules = ref<Record<string, any>>(accountFormItemRules)
const rightClickMarketFormItemOptions = ref(accountFormItemList)
//
@ -483,6 +483,7 @@ const mapMarketTree = (data: any) => {
*/
const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', value: string) => {
try {
let flag: number | undefined = undefined
// 1.
if (type === 'level') {
//
@ -493,11 +494,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
if (!value) return //
//
let flag = null
if (marketForm.value?.level * 1 === 5) flag = 1
if (marketForm.value?.level * 1 === 6) flag = 2
const levelNum = Number(marketForm.value?.level)
if (levelNum === 5) flag = 1
if (levelNum === 6) flag = 2
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) => ({
label: item.username,
@ -519,12 +520,13 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
)
if (!rulesData) return //
console.log('rulesData:', rulesData);
//
marketForm.value.maxPositionRatio = rulesData.row.wallet_capital.toucun_percent
marketForm.value.maxCommissionRatio = rulesData.row.wallet_capital.fee_handling_percent
marketForm.value.maxPositionRatio = String(rulesData.row.wallet_capital.toucun_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) => ({
...item,
@ -664,7 +666,7 @@ const handleEditMarket = async () => {
marketForm.value = {
...initMarketForm,
accountName: row.accountName || '',
level: String(row.level) || '',
level: row.level || '',
parentAccountName: '',
riskControlTemplate: row.wallet_capital.risk_control_id || '',
positionRatio: row.positionRatio || '',
@ -781,7 +783,7 @@ const handleSubmit = async () => {
console.log('pointDiffObj', pointDiffObj)
if (!pointDiffObj) return
if (dialogType.value === 'add') {
const params = {
const params: Record<string, any> = {
role_id: marketForm.value.level,
reg_type: activeTab.value === 'email' ? '1' : '2',
username: marketForm.value.accountName,

View File

@ -110,21 +110,21 @@ export const viewMarketPointTableColumns = [
]
export const accountFormItemList = [
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
{ label: '当前余额', prop: 'amount_old', type: 'input', disabled: true },
{ label: '调整金额', prop: 'amount', type: 'input' },
{ label: '调整后余额', prop: 'amount_new', type: 'input', disabled: true },
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
{ label: '当前余额', prop: 'amount_old', type: 'input' as const, disabled: true },
{ label: '调整金额', prop: 'amount', type: 'input' as const },
{ label: '调整后余额', prop: 'amount_new', type: 'input' as const, disabled: true },
]
export const accountFormItemRules = {
amount: [{ required: true, message: '请输入调整金额', trigger: ['blur', 'change'] }],
}
export const acceptOrdersFormItemList = [
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
{ label: '当前停止接单金额', prop: 'bail_stop_order_old', type: 'input', disabled: true },
{ label: '调整金额', prop: 'bail_stop_order', type: 'input' },
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
{ label: '当前停止接单金额', prop: 'bail_stop_order_old', type: 'input' as const, disabled: true },
{ label: '调整金额', prop: 'bail_stop_order', type: 'input' as const },
]
export const acceptOrdersFormItemRules = {
@ -132,10 +132,10 @@ export const acceptOrdersFormItemRules = {
}
export const transferFormItemList = [
{ label: '账户名', prop: 'username', type: 'input', disabled: true },
{ label: '币种', prop: 'currency', type: 'input', disabled: true },
{ label: '当前持仓转移金额', prop: 'bail_change_order_old', type: 'input', disabled: true },
{ label: '调整金额', prop: 'bail_change_order', type: 'input' },
{ label: '账户名', prop: 'username', type: 'input' as const, disabled: true },
{ label: '币种', prop: 'currency', type: 'input' as const, disabled: true },
{ label: '当前持仓转移金额', prop: 'bail_change_order_old', type: 'input' as const, disabled: true },
{ label: '调整金额', prop: 'bail_change_order', type: 'input' as const },
]
export const transferFormItemRules = {

View File

@ -1,7 +1,7 @@
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 {
email: [
{ required: true, message: '请输入邮箱地址', trigger: ['blur', 'change'] },
@ -31,10 +31,10 @@ export const rules = (marketForm: any, row?: any): FormRules => {
{ required: true, message: '请输入账号名称', trigger: 'blur' }
],
level: [
{ required: true, message: '请选择等级', trigger: 'change' }
{ required: !isEdit, message: '请选择等级', trigger: 'change' }
],
parentAccountName: [
{ required: true, message: '请选择上级账号', trigger: 'change' }
{ required: !isEdit, message: '请选择上级账号', trigger: 'change' }
],
riskControlTemplate: [
{ required: true, message: '请选择风控模板', trigger: 'change' }

View File

@ -17,7 +17,8 @@
<div class="info-text">
<div class="username-row">
<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 class="login-time">{{ t('personalCenter.lastLogin') }}{{ userInfo.last_login }}</div>
</div>
@ -29,9 +30,9 @@
<div class="info-item">
<span class="label">{{ t('personalCenter.email') }}</span>
<span class="value">{{ userInfo.email || t('personalCenter.notSet') }}</span>
<template v-if="canBindEmail">
<el-button v-if="!userInfo.email" link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.goToBind') }}</el-button>
<el-button v-else link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.rebind') }}</el-button>
<template v-if="!userInfo.email">
<el-button link type="primary" @click="showEditDialog('email')">{{ t('personalCenter.goToBind')
}}</el-button>
</template>
<template v-else>
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
@ -40,10 +41,10 @@
<div class="info-item">
<span class="label">{{ t('personalCenter.mobile') }}</span>
<span class="value">{{ userInfo.mobile || t('personalCenter.notBound') }}</span>
<template v-if="canBindMobile">
<el-button v-if="!userInfo.mobile" link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.bind') }}</el-button>
<el-button v-else link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.rebind') }}</el-button>
<span class="value">{{ userInfo.mobile || t('personalCenter.notBound') }}</span> {{ }}
<template v-if="!userInfo.mobile">
<el-button link type="primary" @click="showEditDialog('mobile')">{{ t('personalCenter.bind')
}}</el-button>
</template>
<template v-else>
<el-tag type="success" size="small">{{ t('personalCenter.bound') }}</el-tag>
@ -72,8 +73,7 @@
@cancel="handleEditDialogReset" @close="handleEditDialogReset">
<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-select v-model="editForm.countryCode" :teleported="false" value-key="code" placeholder="国家"
size="large">
<el-select v-model="editForm.countryCode" :teleported="false" value-key="code" placeholder="国家" size="large">
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code" :value="item.code">
<div class="country-option">
<span class="country-name">{{ item.name }}</span>
@ -95,8 +95,8 @@
</Dialog>
<!-- 密码修改弹窗 验证码模式 -->
<Dialog :visible="passwordDialogVisible" :title="t('personalCenter.modifyPassword')" width="500px" @confirm="handlePasswordConfirm"
@cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
<Dialog :visible="passwordDialogVisible" :title="t('personalCenter.modifyPassword')" width="500px"
@confirm="handlePasswordConfirm" @cancel="handlePasswordDialogReset" @close="handlePasswordDialogReset">
<el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordFormRules" label-width="100px"
label-position="top">
<!-- 选择验证方式 -->
@ -120,14 +120,14 @@
<!-- 新密码1 -->
<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')"
size="large" />
<el-input v-model="passwordForm.login_password1" type="password" show-password
:placeholder="t('personalCenter.passwordPlaceholder')" size="large" />
</el-form-item>
<!-- 新密码2 -->
<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')"
size="large" />
<el-input v-model="passwordForm.login_password2" type="password" show-password
:placeholder="t('personalCenter.confirmPasswordPlaceholder')" size="large" />
</el-form-item>
</el-form>
</Dialog>
@ -208,7 +208,7 @@ const phoneCaptchaState = initCaptchaState('phone');
const emailCaptchaState = initCaptchaState('email');
const showPwdSendButton = ref(true);
const pwdSendState = ref({ isCounting: false, countdown: 0 });
const pwdSendState = reactive({ isCounting: false, countdown: 0 });
const pwdMobileCaptchaState = initCaptchaState('phone');
const pwdEmailCaptchaState = initCaptchaState('email');
@ -458,9 +458,28 @@ const handleSendPwdCaptcha = async () => {
const updatePwdSendState = () => {
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 () => {
if (!passwordFormRef.value) return;

View File

@ -49,6 +49,8 @@ const countdown = ref(0)
watch(
() => props.sendState,
(newVal) => {
console.log('监听 倒数 变化');
isCounting.value = newVal.isCounting
countdown.value = newVal.countdown
},