fix: 修复 business 页面 TypeScript 类型错误

This commit is contained in:
2026-05-12 17:44:09 +08:00
parent 8e0615a6fc
commit fe780e32b4
2 changed files with 26 additions and 25 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="取款"
@ -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,7 +483,7 @@ const mapMarketTree = (data: any) => {
*/
const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', value: string) => {
try {
let flag = null
let flag: number | undefined = undefined
// 1.
if (type === 'level') {
//
@ -494,10 +494,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
if (!value) return //
//
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,
@ -521,11 +522,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
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,
@ -665,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 || '',
@ -782,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 = {