This commit is contained in:
李远 2026-03-17 13:13:11 +08:00
parent a73ec399f7
commit 161f1996d4
1 changed files with 14 additions and 17 deletions

View File

@ -175,7 +175,8 @@ const activeTab = ref('email')
const marketPointTree = ref<any>([])
const marketPointTableColumnsOptions = computed(() => {
return dialogType.value !== 'view' ? marketPointTableColumns : viewMarketPointTableColumns;
});//保存当前选中的表格行
});
//保存当前选中的表格行
const selectedRow = ref<any>(null)
/**
* @description 数据处理方法
@ -199,7 +200,9 @@ const mapMarketTree = (data: any) => {
floatProfitLoss: "后续添加",//浮动盈亏
closeProfitLoss: item.wallet_capital.closing_profit,//平仓盈亏
riskMargin: item.wallet_capital.risk,//风险保证金
serviceFee: item.wallet_capital.service//服务费
serviceFee: item.wallet_capital.service,//服务费
//使用这个字段来判断是否是做市商
roleId: item.role_id,
}))
}
@ -371,13 +374,8 @@ const handleAddMarket = async () => {
// 编辑做市商
const handleEditMarket = async () => {
if (!selectedRow.value) {
ElMessage.warning('请先选择要编辑的做市商!');
return;
}
const row = selectedRow.value;
console.log('row', row);
console.log('rowrowrowrowrow', row.role_id);
// 解析上级ID
const getParentIdFromPath = (path: string, level: number) => {
@ -438,7 +436,7 @@ const handleEditMarket = async () => {
// 查看点差
const handleViewPointDiff = async (row: any) => {
try {
const data = await getPointDiffConfigListApi({ user_id: row.id });
const data = await getPointDiffConfigListApi({ user_id: row.role_id });
marketPointTree.value = data.map((item: any) => ({
...item,
varietyName: item.name,
@ -472,6 +470,7 @@ const handleRowClick = (row: any) => {
// 分页变更
const handlePaginationChange = async (page: { currentPage: number, pageSize: number }) => {
currentPage.value = page.currentPage
pageSize.value = page.pageSize
await getMarketList()
}
@ -479,14 +478,7 @@ const handlePaginationChange = async (page: { currentPage: number, pageSize: num
/**
* @description dialog方法
*/
//提交
/**
* @description 提交之前构造数据
*/
// 格式化点差为 { "1":"42", "2":"38" } 格式的对象
// 提交之前构造数据:格式化点差为 { "1":"42", "2":"38" } 格式的对象
const formatPointDiffToObject = () => {
if (!marketPointTree.value || !marketPointTree.value.length) return {};
@ -502,6 +494,7 @@ const formatPointDiffToObject = () => {
return pointDiffObj; // 返回纯对象,而非数组
};
//提交
const handleSubmit = async () => {
// console.log('提交', marketPointTree.value);
await marketFormRef.value?.validate()
@ -535,6 +528,10 @@ const handleSubmit = async () => {
}
// 4. 调用编辑接口
await editMarketApi(params)
// 5. 刷新表格数据
await getMarketList()
dialogVisible.value = false
marketForm.value = { ...initMarketForm }
}
}