From fe780e32b48d1693a07ef5de6397458783fd07dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8?= Date: Tue, 12 May 2026 17:44:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20business=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20TypeScript=20=E7=B1=BB=E5=9E=8B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/business/index.vue | 25 +++++++++++++------------ src/views/profile/business/options.ts | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/views/profile/business/index.vue b/src/views/profile/business/index.vue index 7e7dc1f..2cb9373 100644 --- a/src/views/profile/business/index.vue +++ b/src/views/profile/business/index.vue @@ -62,7 +62,7 @@ (null) // 菜单状态 const menuVisible = ref(false) const menuOptions = reactive({ x: 0, y: 0, zIndex: 3000 }) -const currentRow = ref(null) +const currentRow = ref(null) const rightClickDialogVisible = ref(false) const rightClickDialogType = ref<'account' | 'acceptOrders' | 'transfer' | 'deposit' | 'withdraw'>( 'account', @@ -336,7 +336,7 @@ const rightClickDialogTitleEnum = { withdraw: '存款', } const rightClickMarketForm = ref({}) -const rightClickMarketFormRules = ref(accountFormItemRules) +const rightClickMarketFormRules = ref>(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 = { role_id: marketForm.value.level, reg_type: activeTab.value === 'email' ? '1' : '2', username: marketForm.value.accountName, diff --git a/src/views/profile/business/options.ts b/src/views/profile/business/options.ts index 90ca9d3..e701315 100644 --- a/src/views/profile/business/options.ts +++ b/src/views/profile/business/options.ts @@ -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 = {