From 59fd39341b29d32ea55f63b4e7213ab97e838291 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 18:48:40 +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/trade/variety.ts | 16 +++ src/components/common/Form.vue | 6 +- src/views/account/agent/index.vue | 17 +-- src/views/trade/variety/index.vue | 217 ++++++++++++++++++++++++++++- src/views/trade/variety/options.ts | 78 +++++++++++ src/views/trade/variety/rules.ts | 8 ++ 6 files changed, 322 insertions(+), 20 deletions(-) create mode 100644 src/api/modules/trade/variety.ts create mode 100644 src/views/trade/variety/options.ts create mode 100644 src/views/trade/variety/rules.ts diff --git a/src/api/modules/trade/variety.ts b/src/api/modules/trade/variety.ts new file mode 100644 index 0000000..438b81b --- /dev/null +++ b/src/api/modules/trade/variety.ts @@ -0,0 +1,16 @@ +import { request } from '@/api'; + +// 获取品种列表 +export async function getVarietyListApi(params: any): Promise { + return request.get('/contractVariety/getList', {...params}) +} + +//创建合约品种 +export async function createVarietyApi(params: any): Promise { + return request.post('/contractVariety/createVariety', {...params}) +} + +//编辑合约品种 +export async function updateVarietyApi(params: any): Promise { + return request.post('/contractVariety/editVariety', {...params}) +} \ No newline at end of file diff --git a/src/components/common/Form.vue b/src/components/common/Form.vue index e6e2cbb..8b25aff 100644 --- a/src/components/common/Form.vue +++ b/src/components/common/Form.vue @@ -2,7 +2,7 @@ + + + + diff --git a/src/views/trade/variety/options.ts b/src/views/trade/variety/options.ts new file mode 100644 index 0000000..08859c6 --- /dev/null +++ b/src/views/trade/variety/options.ts @@ -0,0 +1,78 @@ +/** + * @description: 搜索配置 + */ +export const search = [ + // 品种名称 + { prop: 'varietyName', label: '品种名称', type: 'input' as const, placeholder: '请输入品种名称' }, +] + +/** + * @description: 表格配置 + */ +export const tableColumns = [ + // id + { prop: 'id', label: 'ID', align: 'center' as const }, + // 名称 + { prop: 'varietyName', label: '名称', align: 'center' as const }, + // 编号 + { prop: 'varietyCode', label: '编号', align: 'center' as const }, + //上下线状态 + { slotName: 'onlineStatus', label: '上下线状态', align: 'center' as const }, + // 交易状态 + { slotName: 'tradeStatus', label: '交易状态', align: 'center' as const }, + // 币种 + { prop: 'currency', label: '币种', align: 'center' as const }, + // 最小点差 + { prop: 'minPoint', label: '最小点差', align: 'center' as const }, + // 最大点差 + { prop: 'maxPoint', label: '最大点差', align: 'center' as const }, + // 合约大小 + { prop: 'contractSize', label: '合约大小', align: 'center' as const }, + // 最小波动 + { prop: 'minFlux', label: '最小波动', align: 'center' as const }, + // 单位 + { prop: 'unit', label: '单位', align: 'center' as const }, + // 所属交易组 + { prop: 'tradeGroup', label: '所属交易组', align: 'center' as const }, + // 多头库存费 + { prop: 'longStockFee', label: '多头库存费', align: 'center' as const }, + // 空头库存费 + { prop: 'shortStockFee', label: '空头库存费', align: 'center' as const }, + // 止盈水平 + { prop: 'profitLevel', label: '止盈水平', align: 'center' as const }, +] + +/** + * @description: dialog表单配置 + */ +export const editDialogFormItem = [ + // 名称 + { prop: 'varietyName', label: '名称', type: 'input' as const, placeholder: '请输入名称' }, + // 编号 + { prop: 'varietyCode', label: '编号', type: 'input' as const, placeholder: '请输入编号' }, + // 上下线状态 + { prop: 'onlineStatus', label: '上下线状态', type: 'switch' as const, class: 'online-status-switch' }, + // 交易状态 + { prop: 'tradeStatus', label: '交易状态', type: 'switch' as const, class: 'trade-status-switch' }, + // 币种 + { prop: 'currency', label: '币种', type: 'input' as const, placeholder: '请输入币种' }, + // 最小点差 + { prop: 'minPoint', label: '最小点差', type: 'input' as const, placeholder: '请输入最小点差' }, + // 最大点差 + { prop: 'maxPoint', label: '最大点差', type: 'input' as const, placeholder: '请输入最大点差' }, + // 合约大小 + { prop: 'contractSize', label: '合约大小', type: 'input' as const, placeholder: '请输入合约大小' }, + // 最小波动 + { prop: 'minFlux', label: '最小波动', type: 'input' as const, placeholder: '请输入最小波动' }, + // 单位 + { prop: 'unit', label: '单位', type: 'input' as const, placeholder: '请输入单位' }, + // 所属交易组 + { prop: 'tradeGroup', label: '所属交易组', type: 'input' as const, placeholder: '请输入所属交易组' }, + // 多头库存费 + { prop: 'longStockFee', label: '多头库存费', type: 'input' as const, placeholder: '请输入多头库存费' }, + // 空头库存费 + { prop: 'shortStockFee', label: '空头库存费', type: 'input' as const, placeholder: '请输入空头库存费' }, + // 止盈水平 + { prop: 'profitLevel', label: '止盈水平', type: 'input' as const, placeholder: '请输入止盈水平' }, + +] diff --git a/src/views/trade/variety/rules.ts b/src/views/trade/variety/rules.ts new file mode 100644 index 0000000..0a47db1 --- /dev/null +++ b/src/views/trade/variety/rules.ts @@ -0,0 +1,8 @@ +import type { FormRules } from 'element-plus' +export const rules = (): FormRules => { + return { + name: [ + { required: true, message: '请输入名称', trigger: ['blur'] } + ], + } +} \ No newline at end of file