From 4b712be3bed7b443a9f7d9e0c11cc50fdf35effc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=BF=9C?= <2970639877@qq.com> Date: Tue, 17 Mar 2026 15:59:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/account/agent.ts | 2 +- src/api/modules/account/market.ts | 2 +- src/components/common/Search.vue | 2 +- src/views/account/agent/index.vue | 311 ++++++++++++++++++-- src/views/account/agent/options.ts | 20 +- src/views/account/agent/rules.ts | 12 + src/views/account/agent/备份.vue | 341 ---------------------- src/views/account/market-maker/index.vue | 2 + src/views/account/market-maker/options.ts | 10 +- src/views/account/market-maker/rules.ts | 2 +- 10 files changed, 332 insertions(+), 372 deletions(-) create mode 100644 src/views/account/agent/rules.ts delete mode 100644 src/views/account/agent/备份.vue diff --git a/src/api/modules/account/agent.ts b/src/api/modules/account/agent.ts index c557ed3..910720b 100644 --- a/src/api/modules/account/agent.ts +++ b/src/api/modules/account/agent.ts @@ -18,6 +18,6 @@ export async function getFeeTemplateOptionsApi(): Promise { return request.get('user/getFeeSettingOptions') } //编辑代理点差 -export async function editPointDiffConfigApi(params: pointDiffConfigParams): Promise { +export async function editPointDiffApi(params: pointDiffConfigParams): Promise { return request.post('/agent/editAgent',{...params}) } \ No newline at end of file diff --git a/src/api/modules/account/market.ts b/src/api/modules/account/market.ts index 223b26f..45c71f2 100644 --- a/src/api/modules/account/market.ts +++ b/src/api/modules/account/market.ts @@ -1,7 +1,7 @@ import { request } from '@/api'; import type{ searchParams,pointDiffConfigParams } from '@/api/types/account/market' -// 查询做市商列表 +// 查询和获取做市商列表 export async function getMarketListApi(params: searchParams): Promise { return request.get('agent/getAgentList', { ...params }) } diff --git a/src/components/common/Search.vue b/src/components/common/Search.vue index 982cd2b..73f8972 100644 --- a/src/components/common/Search.vue +++ b/src/components/common/Search.vue @@ -56,7 +56,7 @@ - {{ buttonConfig.searchText || '查询' }} + {{ buttonConfig.searchText || '搜索' }} {{ buttonConfig.resetText || '重置' }} diff --git a/src/views/account/agent/index.vue b/src/views/account/agent/index.vue index b2fbafa..c581c6c 100644 --- a/src/views/account/agent/index.vue +++ b/src/views/account/agent/index.vue @@ -1,27 +1,67 @@ diff --git a/src/views/account/agent/options.ts b/src/views/account/agent/options.ts index 712d1c0..98b1a13 100644 --- a/src/views/account/agent/options.ts +++ b/src/views/account/agent/options.ts @@ -41,24 +41,36 @@ export const agentTableColumns = [ ] -// 定义点差表格列配置 -export const agentPointTableColumns = [ +// 查看点差表格列配置 +export const viewAgentPointTableColumns = [ { prop: 'varietyName', label: '品种名称', align: 'center' as const }, { prop: 'varietyCode', label: '品种编号', align: 'center' as const }, { prop: 'pointDifference', label: '可用点差', align: 'center' as const }, { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const }, ] +//编辑点差表格列配置 +export const agentPointTableColumns = ([ + { prop: 'varietyName', label: '名称', align: 'center' as const }, + { prop: 'varietyCode', label: '编号', align: 'center' as const }, + { prop: 'pointDifference', label: '可分配点差', align: 'center' as const }, + { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName: 'assignedPointDiff' }, +]) + + //编辑点差form配置 export const PointDiffFormItem = [ //代理名称 { prop: 'username', label: '代理名称', type: 'input' as const, placeholder: '代理名称', width: '120px' }, //所属上级 { prop: 'parentUsername', label: '所属上级', type: 'input' as const, placeholder: '所属上级', width: '120px' }, - //手续费 - { prop: 'feeRate', label: '手续费', type: 'input' as const, placeholder: '手续费', width: '120px' }, //风控模板 { prop: 'riskTemplate', label: '风控模板', type: 'select' as const, placeholder: '风控模板', width: '120px' }, //手续费模板 { prop: 'feeTemplate', label: '手续费模板', type: 'select' as const, placeholder: '手续费模板', width: '120px' }, + //头寸 + { prop: 'positionRatio', label: '头寸', type: 'input' as const, placeholder: '请输入头寸', width: '120px' }, + //手续费 + { prop: 'feeRate', label: '手续费', type: 'input' as const, placeholder: '手续费', width: '120px' }, + ] diff --git a/src/views/account/agent/rules.ts b/src/views/account/agent/rules.ts new file mode 100644 index 0000000..74062db --- /dev/null +++ b/src/views/account/agent/rules.ts @@ -0,0 +1,12 @@ +import type{ FormRules } from 'element-plus' + +export const rules = (): FormRules => { + return { + name: [ + { required: true, message: '请输入名称', trigger: ['blur'] } + ], + pointDiff: [ + { required: true, message: '请输入点差', trigger: ['blur'] } + ], + } +} \ No newline at end of file diff --git a/src/views/account/agent/备份.vue b/src/views/account/agent/备份.vue deleted file mode 100644 index e7f2aaa..0000000 --- a/src/views/account/agent/备份.vue +++ /dev/null @@ -1,341 +0,0 @@ - - - - diff --git a/src/views/account/market-maker/index.vue b/src/views/account/market-maker/index.vue index 80b2af5..7b4af44 100644 --- a/src/views/account/market-maker/index.vue +++ b/src/views/account/market-maker/index.vue @@ -512,6 +512,7 @@ const handleSubmit = async () => { fee_handling_percent: marketForm.value.commissionRatio, point_diffs_json: JSON.stringify(pointDiffObj), risk_control_id: marketForm.value.riskControlTemplate, + fee_setting_id: '', } await addMarketApi(params) // 5. 刷新表格数据 @@ -525,6 +526,7 @@ const handleSubmit = async () => { point_diffs_json: JSON.stringify(pointDiffObj), risk_control_id: marketForm.value.riskControlTemplate, fee_handling_percent: marketForm.value.commissionRatio, + fee_setting_id: '', } // 4. 调用编辑接口 await editMarketApi(params) diff --git a/src/views/account/market-maker/options.ts b/src/views/account/market-maker/options.ts index 9d03216..1ab43a9 100644 --- a/src/views/account/market-maker/options.ts +++ b/src/views/account/market-maker/options.ts @@ -48,11 +48,11 @@ export const marketFormItem = [ //账户名称 { label: '账户名称', prop: 'accountName', type: 'input' as const, placeholder: '请输入账户名称', }, //级别 - { label: '级别', prop: 'level', type: 'select' as const, placeholder: '请选择级别'}, + { label: '级别', prop: 'level', type: 'select' as const, placeholder: '请选择级别' }, //所属上级 { label: '所属上级', prop: 'parentAccountName', type: 'select' as const, placeholder: '请选择所属上级账户名称', }, - // 风控模板 - { label: '风控模板', prop: 'riskControlTemplate', type: 'select' as const, placeholder: '请选择风控模板'}, + // 风控模板 + { label: '风控模板', prop: 'riskControlTemplate', type: 'select' as const, placeholder: '请选择风控模板' }, //头寸 { label: '头寸', prop: 'positionRatio', type: 'input' as const, placeholder: '请输入头寸', }, //手续费 @@ -79,7 +79,7 @@ export const marketPointTableColumns = ([ { prop: 'varietyName', label: '名称', align: 'center' as const }, { prop: 'varietyCode', label: '编号', align: 'center' as const }, { prop: 'pointDifference', label: '可分配点差', align: 'center' as const }, - { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName:'assignedPointDiff'}, + { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const, slotName: 'assignedPointDiff' }, ]) // 查看点差表格列配置 @@ -87,5 +87,5 @@ export const viewMarketPointTableColumns = ([ { prop: 'varietyName', label: '名称', align: 'center' as const }, { prop: 'varietyCode', label: '编号', align: 'center' as const }, { prop: 'pointDifference', label: '可分配点差', align: 'center' as const }, - { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const}, + { prop: 'assignedPointDifference', label: '已分配点差', align: 'center' as const }, ]) \ No newline at end of file diff --git a/src/views/account/market-maker/rules.ts b/src/views/account/market-maker/rules.ts index db97cb4..8ac3122 100644 --- a/src/views/account/market-maker/rules.ts +++ b/src/views/account/market-maker/rules.ts @@ -135,7 +135,7 @@ export const rules = (marketForm: any, row?: any): FormRules => { if (row && row.pointDifference !== undefined) { const maxPointDiff = Number(row.pointDifference) if (numValue > maxPointDiff) { - return callback(new Error(`不能超过可分配点差(${maxPointDiff})`)) + return callback(new Error(`可分配点差为(${maxPointDiff})`)) } }