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 <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="取款"
@ -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,7 +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 = null let flag: number | undefined = undefined
// 1. // 1.
if (type === 'level') { if (type === 'level') {
// //
@ -494,10 +494,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
if (!value) return // if (!value) return //
// //
if (marketForm.value?.level * 1 === 5) flag = 1 const levelNum = Number(marketForm.value?.level)
if (marketForm.value?.level * 1 === 6) flag = 2 if (levelNum === 5) flag = 1
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,
@ -521,11 +522,11 @@ const handleMarketFormLinkage = async (type: 'level' | 'parentAccountName', valu
console.log('rulesData:', rulesData); 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,
@ -665,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 || '',
@ -782,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,

View File

@ -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 = {