BUG修复

This commit is contained in:
Songsl 2026-04-27 20:38:32 +08:00
parent bfe93f348d
commit adcbbb6752
15 changed files with 682 additions and 583 deletions

View File

@ -10,3 +10,8 @@ export async function getWalletCapital(): Promise<any> {
return await request.get<any>('/user/getWalletCapital') return await request.get<any>('/user/getWalletCapital')
} }
//重置密码
export const editAccountPass = (params: any) => {
return request.post('/user/editAccountPass', { ...params })
}

View File

@ -42,7 +42,7 @@ const userInfo = getStorage<any>('userInfo')
const activeUserName = ref(userInfo?.username || '') const activeUserName = ref(userInfo?.username || '')
const activeItem = ref('currentUser') const activeItem = ref('currentUser')
const dropdownItems = [ const dropdownItems = [
{ label: '切换账户', command: 'account' }, // { label: '', command: 'account' },
{ label: '修改密码', command: 'password' }, { label: '修改密码', command: 'password' },
{ label: '退出登录', command: 'logout' } { label: '退出登录', command: 'logout' }
] ]

View File

@ -1,20 +1,39 @@
<template> <template>
<div> <div>
<!-- 搜索 --> <!-- 搜索 -->
<CustomerListSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch" <CustomerListSearch
@reset="handleReset"></CustomerListSearch> :search-form="searchForm"
:search-options="searchOptions"
@search="handleSearch"
@reset="handleReset"
></CustomerListSearch>
<!-- 表格 --> <!-- 表格 -->
<CustomerListTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="userId" <CustomerListTable
:tree-props="treeProps" :default-sort="{ prop: 'createTime', order: 'descending' }" :table-data="tableTree"
@expand-change="handleGetSubList"> :columns="tableColumnsOptions"
row-key="userId"
:tree-props="treeProps"
:default-sort="{ prop: 'createTime', order: 'descending' }"
@expand-change="handleGetSubList"
>
<template #marginRatio="{ row }"> <template #marginRatio="{ row }">
<el-button v-if="row.role_id === 5" type="primary" size="small" @click="handleMarginRatio(row)"> <el-button
v-if="row.role_id === 5"
type="primary"
size="small"
@click="handleMarginRatio(row)"
>
修改 修改
</el-button> </el-button>
</template> </template>
<template #commissionRatio="{ row }"> <template #commissionRatio="{ row }">
{{ row.commissionRatio }} {{ row.commissionRatio }}
<el-button v-if="row.role_id === 5" type="primary" size="small" @click="handleCommissionRatio(row)"> <el-button
v-if="row.role_id === 5"
type="primary"
size="small"
@click="handleCommissionRatio(row)"
>
修改 修改
</el-button> </el-button>
</template> </template>
@ -25,25 +44,49 @@
</template> </template>
</CustomerListTable> </CustomerListTable>
<!-- 分页 --> <!-- 分页 -->
<CustomerListPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total" <CustomerListPagination
@pagination-change="handlePaginationChange" /> v-model="currentPage"
v-model:pageSizeValue="pageSize"
:total="total"
@pagination-change="handlePaginationChange"
/>
<!-- dialog --> <!-- dialog -->
<CustomerListDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" <CustomerListDialog
:fullscreen="dialogFullscreen" :show-footer="dialogType !== 'view'" @confirm="handleSubmit" :visible="dialogVisible"
@cancel="handleCancel" @close="handleClose"> :title="dialogTitle"
<CustomerListTable :table-data="marginRatioTree" :columns="marginRatioTableColumnsOptions" row-key="id" :type="dialogType"
v-if="dialogType === 'editMarginRatio'"> :fullscreen="dialogFullscreen"
:show-footer="dialogType !== 'view'"
@confirm="handleSubmit"
@cancel="handleCancel"
@close="handleClose"
>
<CustomerListTable
:table-data="marginRatioTree"
:columns="marginRatioTableColumnsOptions"
row-key="id"
v-if="dialogType === 'editMarginRatio'"
style="height: 600px"
>
<template #assignedPointDiff="{ row }"> <template #assignedPointDiff="{ row }">
<el-form :model="row" :rules="marginRatioRules(row)" :ref="el => setFormRef(el, row.id)"> <el-form
<el-form-item prop="assignedPointDifference"> :model="row"
<el-input v-model="row.assignedPointDifference" size="small" placeholder="请输入点差" /> :rules="marginRatioRules(row)"
:ref="(el) => setFormRef(el, row.id)"
>
<el-form-item style="margin-bottom: 0" prop="assignedPointDifference">
<el-input v-model="row.assignedPointDifference" placeholder="请输入点差" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
</CustomerListTable> </CustomerListTable>
<CustomerListForm :form-data="commissionRatioForm" :form-rules="commissionRatioFormRules" <CustomerListForm
:form-items="commissionRatioFormItemOptions" ref="commissionRatioFormRef" :form-data="commissionRatioForm"
v-if="dialogType === 'editCommissionRatio'"></CustomerListForm> :form-rules="commissionRatioFormRules"
:form-items="commissionRatioFormItemOptions"
ref="commissionRatioFormRef"
v-if="dialogType === 'editCommissionRatio'"
></CustomerListForm>
</CustomerListDialog> </CustomerListDialog>
<!-- dialog表格 --> <!-- dialog表格 -->
</div> </div>
@ -60,7 +103,11 @@ import CustomerListForm from '@/components/common/Form.vue'
import { search, tableColumns, marginRatioTableColumns, commissionRatioFormItem } from './options' import { search, tableColumns, marginRatioTableColumns, commissionRatioFormItem } from './options'
// //
import { getCustomerListApi, getSelfVarietyPointDiffConfigApi, editCustomerApi } from '@/api/modules/agent/customerList' import {
getCustomerListApi,
getSelfVarietyPointDiffConfigApi,
editCustomerApi,
} from '@/api/modules/agent/customerList'
// //
import { getStorage } from '@/utils/storage' import { getStorage } from '@/utils/storage'
@ -71,7 +118,6 @@ const router = useRouter()
const userInfo: any = getStorage('userInfo') const userInfo: any = getStorage('userInfo')
const userId = ref(userInfo?.id || '') const userId = ref(userInfo?.id || '')
/** /**
* @description: 定义搜索数据 * @description: 定义搜索数据
*/ */
@ -122,7 +168,11 @@ const marginRatioRules = (row: any) => {
return { return {
assignedPointDifference: [ assignedPointDifference: [
{ required: true, message: '请输入数字', trigger: ['blur', 'change'] }, { required: true, message: '请输入数字', trigger: ['blur', 'change'] },
{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可带小数)', trigger: ['blur', 'change'] }, {
pattern: /^\d+(\.\d+)?$/,
message: '只能输入数字(可带小数)',
trigger: ['blur', 'change'],
},
{ {
validator: (rule: any, value: any, callback: any) => { validator: (rule: any, value: any, callback: any) => {
const inputVal = Number(value || 0) const inputVal = Number(value || 0)
@ -134,15 +184,12 @@ const marginRatioRules = (row: any) => {
callback() callback()
} }
}, },
trigger: ['blur', 'change'] trigger: ['blur', 'change'],
} },
] ],
} }
} }
/** /**
* @description: 定义手续费form数据 * @description: 定义手续费form数据
*/ */
@ -154,7 +201,7 @@ const commissionRatioFormRules = {
commissionRatio: [ commissionRatio: [
{ required: true, message: '请输入手续费分成比例', trigger: ['blur', 'change'] }, { required: true, message: '请输入手续费分成比例', trigger: ['blur', 'change'] },
{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可带小数)', trigger: ['blur', 'change'] }, { pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可带小数)', trigger: ['blur', 'change'] },
] ],
} }
const commissionRatioFormItemOptions = ref(commissionRatioFormItem) const commissionRatioFormItemOptions = ref(commissionRatioFormItem)
const selectId = ref('') const selectId = ref('')
@ -168,10 +215,9 @@ const roleMap: any = {
3: '特殊做市商', 3: '特殊做市商',
4: '普通做市商', 4: '普通做市商',
5: '代理', 5: '代理',
6: '用户' 6: '用户',
} }
/** /**
* @description: 定义公共请求数据方法 * @description: 定义公共请求数据方法
*/ */
@ -182,8 +228,14 @@ const getCustomerList = async (id: string) => {
page: currentPage.value, page: currentPage.value,
page_size: pageSize.value, page_size: pageSize.value,
user_name: searchForm.value.accountName, user_name: searchForm.value.accountName,
reg_start_time: searchForm.value.startTime.length > 0 ? `${searchForm.value.startTime} 0:00:00` : '2026-01-01 0:00:00', reg_start_time:
reg_end_time: searchForm.value.endTime.length > 0 ? `${searchForm.value.endTime} 23:59:59` : '2026-03-01 23:59:59', searchForm.value.startTime.length > 0
? `${searchForm.value.startTime} 0:00:00`
: '2026-01-01 0:00:00',
reg_end_time:
searchForm.value.endTime.length > 0
? `${searchForm.value.endTime} 23:59:59`
: '2026-03-01 23:59:59',
status: searchForm.value.status, status: searchForm.value.status,
} }
const data: any = await getCustomerListApi(params) const data: any = await getCustomerListApi(params)
@ -197,11 +249,16 @@ const getCustomerList = async (id: string) => {
commissionRatio: item.wallet_capital.fee_handling_percent, commissionRatio: item.wallet_capital.fee_handling_percent,
createTime: item.created_at, createTime: item.created_at,
role_id: item.role_id, role_id: item.role_id,
children: item.role_id === 5 ? [{ children:
item.role_id === 5
? [
{
hasChildren: true, hasChildren: true,
}] : undefined, },
]
: undefined,
})) }))
console.log('tableTree', tableTree.value)
// //
total.value = data.total total.value = data.total
currentPage.value = data.current_page currentPage.value = data.current_page
@ -214,13 +271,16 @@ const getSelfVarietyPointDiffConfig = async (id: string) => {
user_id: id, user_id: id,
} }
const data: any = await getSelfVarietyPointDiffConfigApi(params) const data: any = await getSelfVarietyPointDiffConfigApi(params)
marginRatioTree.value = data.data.map((item: any) => ({ marginRatioTree.value = data.map((item: any) => {
return {
id: item.id, id: item.id,
varietyName: item.name, varietyName: item.name,
varietyCode: item.code, varietyCode: item.code,
pointDifference: item.point_diff, pointDifference: item.point_diff,
assignedPointDifference: item.target_point_diff assignedPointDifference: item.target_point_diff,
})) }
})
console.log('marginRatioTree', marginRatioTree.value)
} }
/** /**
@ -250,14 +310,14 @@ const handleReset = () => {
* @description: 定义表格方法 * @description: 定义表格方法
*/ */
const handleDetail = (row: any) => { const handleDetail = (row: any) => {
console.log('查看详情', row); console.log('查看详情', row)
router.push(`/agent/customerDetail/${row.userId}`) router.push(`/agent/customerDetail/${row.userId}`)
} }
// //
const handleMarginRatio = (row: any) => { const handleMarginRatio = (row: any) => {
getSelfVarietyPointDiffConfig(row.userId) getSelfVarietyPointDiffConfig(row.userId)
console.log('修改点差', row); console.log('修改点差', row)
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = '修改点差' dialogTitle.value = '修改点差'
dialogType.value = 'editMarginRatio' dialogType.value = 'editMarginRatio'
@ -266,7 +326,7 @@ const handleMarginRatio = (row: any) => {
// //
const handleCommissionRatio = (row: any) => { const handleCommissionRatio = (row: any) => {
console.log('修改手续费比例', row); console.log('修改手续费比例', row)
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = '修改手续费' dialogTitle.value = '修改手续费'
dialogType.value = 'editCommissionRatio' dialogType.value = 'editCommissionRatio'
@ -302,16 +362,21 @@ const handleGetSubList = async (row: any) => {
commissionRatio: item.wallet_capital.fee_handling_percent, commissionRatio: item.wallet_capital.fee_handling_percent,
createTime: item.created_at, createTime: item.created_at,
role_id: item.role_id, role_id: item.role_id,
children: item.role_id === 5 ? [{ children:
item.role_id === 5
? [
{
hasChildren: true, hasChildren: true,
}] : undefined, },
]
: undefined,
})) }))
} }
/** /**
* @description: 定义分页方法 * @description: 定义分页方法
*/ */
const handlePaginationChange = (page: { currentPage: number, size: number }) => { const handlePaginationChange = (page: { currentPage: number; size: number }) => {
currentPage.value = page.currentPage currentPage.value = page.currentPage
getCustomerList(userId.value) getCustomerList(userId.value)
} }
@ -358,7 +423,10 @@ const handleSubmit = async () => {
if (dialogType.value === 'editCommissionRatio') { if (dialogType.value === 'editCommissionRatio') {
await commissionRatioFormRef.value.validate() await commissionRatioFormRef.value.validate()
try { try {
await editCustomerApi({ ...params, fee_handling_percent: commissionRatioForm.value.commissionRatio }) await editCustomerApi({
...params,
fee_handling_percent: commissionRatioForm.value.commissionRatio,
})
dialogVisible.value = false dialogVisible.value = false
} catch (err) { } catch (err) {
console.log('提交失败:', err) console.log('提交失败:', err)

View File

@ -45,7 +45,12 @@ export const marginRatioTableColumns = [
// 可分配点差 // 可分配点差
{ prop: 'pointDifference', 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',
},
] ]
// 手续费分成比例form配置 // 手续费分成比例form配置

View File

@ -7,21 +7,21 @@
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>实名认证</span> <router-link to="/profile/kyc">实名认证</router-link>
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="item"> <div class="item">
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>存款</span> <router-link to="/capital/rechange">存款</router-link>
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="item"> <div class="item">
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>交易</span> <router-link to="/trade/exe">交易</router-link>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -32,19 +32,19 @@
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>存款</span> <router-link to="/capital/rechange">存款</router-link>
</router-link> </router-link>
<router-link to="" class="item"> <router-link to="" class="item">
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>取款</span> <router-link to="/capital/withdraw">取款</router-link>
</router-link> </router-link>
<router-link to="" class="item"> <router-link to="" class="item">
<el-icon color="#409eff"> <el-icon color="#409eff">
<CircleCheckFilled /> <CircleCheckFilled />
</el-icon> </el-icon>
<span>交易</span> <router-link to="/trade/exe">交易</router-link>
</router-link> </router-link>
</div> </div>
</el-card> </el-card>
@ -53,9 +53,9 @@
<el-popover placement="right" trigger="hover" class="wallet-popover"> <el-popover placement="right" trigger="hover" class="wallet-popover">
<div class="link"> <div class="link">
<router-link to="" class="item">转账</router-link> <router-link to="/capital/transfer" class="item">转账</router-link>
<router-link to="" class="item">取款</router-link> <router-link to="/capital/withdraw" class="item">取款</router-link>
<router-link to="" class="item">资金明细</router-link> <router-link to="/capital/fundFlow" class="item">资金明细</router-link>
</div> </div>
<template #reference> <template #reference>
<div class="wallet"> <div class="wallet">
@ -102,30 +102,28 @@
<div class="account-list"> <div class="account-list">
<div class="list" v-for="item in accountList" :key="item.id"> <div class="list" v-for="item in accountList" :key="item.id">
<div class="item item-setting"> <div class="item item-setting">
<div class="setting-content" v-if="!isEdit"> <div class="setting-content" v-if="isEdit !== item.account_id">
<span>账户名称:</span> <span>账户名称:</span>
<span>{{ accountName }}</span> <span>{{ item.account_name }}</span>
</div> </div>
<div class="setting-content" v-else> <div class="setting-content" v-else>
<span class="setting-label">账户名称:</span> <span class="setting-label">账户名称:</span>
<span v-if="!isEdit">{{ accountName }}</span>
<el-input <el-input
v-model="editName" v-model="editName"
@blur="handleSave" @blur="handleSave"
@keyup.enter="handleSave" @keyup.enter="handleSave"
ref="inputRef" ref="inputRef"
size="small" size="small"
v-else
/> />
</div> </div>
<div class="setting-group"> <div class="setting-group">
<span> <span>
<el-icon @click="handleEdit"> <el-icon @click="handleEdit(item.account_name, item.account_id)">
<EditPen /> <EditPen />
</el-icon> </el-icon>
</span> </span>
<span> <span>
<el-icon @click="handleSetting"> <el-icon @click="handleSetting(item.account_id)">
<Setting /> <Setting />
</el-icon> </el-icon>
</span> </span>
@ -229,7 +227,7 @@ import {
resetPasswordApi, resetPasswordApi,
leverageLeverApi, leverageLeverApi,
} from '@/api/modules/agent' } from '@/api/modules/agent'
import { getAllAccount, getWalletCapital } from '@/api/modules/dashboard.ts' import { getAllAccount, getWalletCapital, editAccountPass } from '@/api/modules/dashboard.ts'
// //
import { getStorage, setStorage } from '@/utils/storage' import { getStorage, setStorage } from '@/utils/storage'
@ -246,7 +244,7 @@ const dialogType = ref('add')
const accountList = ref([]) const accountList = ref([])
const getAccoundList = async () => { const getAccoundList = async () => {
const res = await getAllAccount({ username: userStore.userInfo.username }) const res = await getAllAccount({ username: '' })
console.log(res) console.log(res)
accountList.value = res accountList.value = res
} }
@ -292,8 +290,8 @@ const colSpan = ref(12)
// //
const userInfo = getStorage<any>('userInfo') const userInfo = getStorage<any>('userInfo')
const accountName = ref(userInfo?.username || '') const accountName = ref(userInfo?.username || '')
const editName = ref(accountName.value) const editName = ref('')
const isEdit = ref(false) const isEdit = ref('')
const inputRef = ref<HTMLInputElement>() const inputRef = ref<HTMLInputElement>()
/* /*
@ -349,24 +347,26 @@ const handleSubmit = async () => {
} }
if (dialogType.value === 'add') { if (dialogType.value === 'add') {
await createAgentApi(params) await createAgentApi(params)
await getAccoundList()
dialogVisible.value = false dialogVisible.value = false
} else if (dialogType.value === 'setting') { } else if (dialogType.value === 'setting') {
const params = { const params = {
reg_type: userInfo?.reg_type || '', account_id: account_id || '',
login_password1: subAccountForm.value.resetPassword, user_password: subAccountForm.value.resetPassword,
login_password2: subAccountForm.value.confirmPassword, account_password: subAccountForm.value.confirmPassword,
email: userInfo?.email || '',
mobile: userInfo?.mobile || '',
code: '123456',
} }
await resetPasswordApi(params) await editAccountPass(params)
await getAccoundList()
subAccountForm.value.resetPassword = ''
subAccountForm.value.confirmPassword = ''
dialogVisible.value = false dialogVisible.value = false
} else if (dialogType.value === 'leverage') { } else if (dialogType.value === 'leverage') {
const params = { const params = {
account_id: userInfo?.id || '', account_id: account_id || '',
lever: subAccountForm.value.leverage, lever: subAccountForm.value.leverage,
} }
await leverageLeverApi(params) await leverageLeverApi(params)
await getAccoundList()
dialogVisible.value = false dialogVisible.value = false
} }
} }
@ -382,36 +382,34 @@ const handleCancel = () => {
*/ */
// //
const handleEdit = async () => { let account_id = ''
isEdit.value = true const handleEdit = async (name: string, id: string) => {
// DOM if (isEdit.value) return (isEdit.value = '')
await nextTick() isEdit.value = id
inputRef.value?.focus() editName.value = name
account_id = id
} }
// //
const handleSave = async () => { const handleSave = async () => {
if (editName.value.trim()) { if (account_id === '') return ElMessage.error('请先选择账户')
if (editName.value === '') return ElMessage.error('请输入账号')
editName.value.trim()
await editAgentNameApi({ await editAgentNameApi({
account_id: userInfo?.id || '', account_id: account_id,
account_name: accountName.value, account_name: editName.value,
}) })
accountName.value = editName.value.trim() await getAccoundList()
setStorage('userInfo', {
...userInfo,
username: accountName.value,
})
} else {
editName.value = accountName.value //
}
isEdit.value = false isEdit.value = false
} }
/** /**
* @description: 设置方法 * @description: 设置方法
*/ */
const handleSetting = () => { const handleSetting = (id: string) => {
dialogVisible.value = true dialogVisible.value = true
account_id = id
dialogTitle.value = '编辑账号' dialogTitle.value = '编辑账号'
dialogType.value = 'setting' dialogType.value = 'setting'
} }

View File

@ -5,8 +5,18 @@ export const formItem = [
//重置密码formItem //重置密码formItem
export const resetPasswordFormItem = [ export const resetPasswordFormItem = [
{label: '密码',prop: 'resetPassword',type: 'password' as const,placeholder: '请输入密码',}, {
{label: '确认密码',prop: 'confirmPassword',type: 'password' as const,placeholder: '请确认密码',}, label: '登录密码',
prop: 'resetPassword',
type: 'password' as const,
placeholder: '请输入登录密码',
},
{
label: '新密码',
prop: 'confirmPassword',
type: 'password' as const,
placeholder: '请确认新密码',
},
] ]
//修改杠杆formItem //修改杠杆formItem

View File

@ -9,14 +9,7 @@ export const rules = (subAccountForm: any): FormRules => {
{ required: true, message: '请选择杠杆比例', trigger: ['change'] } { required: true, message: '请选择杠杆比例', trigger: ['change'] }
], ],
confirmPassword: [ confirmPassword: [
{ required: true, message: '请确认密码', trigger: ['blur'] }, { required: true, message: '请确认密码', trigger: ['blur'] }
{ validator: (rule: any, value: string, callback: any) => {
if (value !== subAccountForm.resetPassword) {
callback(new Error('两次密码不一致'))
} else {
callback()
}
}, trigger: ['blur'] }
] ]
} }
} }

View File

@ -8,37 +8,45 @@
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<div class="risk-table-content"> <div class="risk-table-content">
<RiskTableSwitch :columns="tableColumnsSwitch" :table-data="tableTreeSwitch" class="table-switch" <RiskTableSwitch
@row-click="handleRowClick" row-key="id" highlight-current-row :current-row-key="selectedRowId"> :columns="tableColumnsSwitch"
:table-data="tableTreeSwitch"
class="table-switch"
@row-click="handleRowClick"
row-key="id"
highlight-current-row
:current-row-key="selectedRowId"
>
<template #status="{ row }"> <template #status="{ row }">
<span>{{ row.status === 1 ? '启用' : '停用' }}</span> <span>{{ row.status === 1 ? '启用' : '停用' }}</span>
</template> </template>
</RiskTableSwitch> </RiskTableSwitch>
<RiskTableContent :columns="tableColumnsContent" :table-data="[currentContent]" class="table-content" <RiskTableContent
row-key="id"> :columns="tableColumnsContent"
<template #contentName="{ row }"> :table-data="currentContent"
<div class="risk-content-group"> class="table-content"
<span>单笔开仓最大数量:{{ row.maxOpenPosition }}</span> row-key="id"
<span>单品种最大持仓数量:{{ row.maxPositionPerSymbol }}</span> >
<span>总品种最大持仓数量:{{ row.maxTotalPosition }}</span>
<span>强平比例:{{ row.strongCloseRatio }}</span>
<span>每次出金最大金额:{{ row.maxWithdrawalAmount }}</span>
<span>是否允许出金:{{ row.isWithdrawalAllowed }}</span>
<span>出金时间设置:{{ row.withdrawalTimeSetting }}</span>
<span>是否需要出金审核:{{ row.isWithdrawalAuditRequired }}</span>
<span>建仓多少秒不能平仓:{{ row.buildCloseTime }}</span>
<span>每次出金最小金额:{{ row.minWithdrawalAmount }}</span>
<span>滑点:{{ row.slippage }}</span>
<span>每次入金最小金额:{{ row.minDepositAmount }}</span>
</div>
</template>
</RiskTableContent> </RiskTableContent>
</div> </div>
<!-- dialog --> <!-- dialog -->
<RiskDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" @confirm="handleSubmit" <RiskDialog
@cancel="handleCancel" @close="handleClose"> :visible="dialogVisible"
<RiskForm :form-data="dialogForm" :form-rules="riskRules" :form-items="RiskFormItems" :title="dialogTitle"
:options-map="riskFormOptionsMap" :row-gutter="rowGutter" :col-span="colSpan" ref="riskFormRef" /> :type="dialogType"
@confirm="handleSubmit"
@cancel="handleCancel"
@close="handleClose"
>
<RiskForm
:form-data="dialogForm"
:form-rules="riskRules"
:form-items="RiskFormItems"
:options-map="riskFormOptionsMap"
:row-gutter="rowGutter"
:col-span="colSpan"
ref="riskFormRef"
/>
</RiskDialog> </RiskDialog>
</div> </div>
</template> </template>
@ -70,7 +78,7 @@ const riskOriginData = ref<any[]>([])
// //
const selectedRow = ref<any>({}) const selectedRow = ref<any>({})
// //
const currentContent = ref<any>({}) const currentContent = ref<any>([])
/** /**
* @description: 定义弹窗数据 * @description: 定义弹窗数据
@ -247,7 +255,7 @@ const handleRiskStatus = async () => {
*/ */
const handleRowClick = (row: any) => { const handleRowClick = (row: any) => {
// //
const originRow = riskOriginData.value.find(item => item.id === row.id) const originRow = riskOriginData.value.find((item) => item.id === row.id)
if (originRow) { if (originRow) {
selectedRow.value = originRow // selectedRow.value = originRow //
} else { } else {
@ -256,8 +264,24 @@ const handleRowClick = (row: any) => {
selectedRowId.value = row.id selectedRowId.value = row.id
// //
const targetItem = tableTreeContent.value.find((item: any) => item.id === row.id) const targetItem = tableTreeContent.value.find((item: any) => item.id === row.id)
const fields = [
{ text: '单笔开仓最大数量' + targetItem.maxOpenPosition },
{ text: '单品种最大持仓数量' + targetItem.maxPositionPerSymbol },
{ text: '总品种最大持仓数量' + targetItem.maxTotalPosition },
{ text: '强平比例' + targetItem.strongCloseRatio },
{ text: '每次出金最大金额' + targetItem.maxWithdrawalAmount },
{ text: '是否允许出金' + targetItem.isWithdrawalAllowed },
{ text: '出金时间设置' + targetItem.withdrawalTimeSetting },
{ text: '是否需要出金审核' + targetItem.isWithdrawalAuditRequired },
{ text: '建仓多少秒不能平仓' + targetItem.buildCloseTime },
{ text: '每次出金最小金额' + targetItem.minWithdrawalAmount },
{ text: '滑点' + targetItem.slippage },
{ text: '每次入金最小金额' + targetItem.minDepositAmount },
]
if (targetItem) { if (targetItem) {
currentContent.value = targetItem currentContent.value = fields
} }
} }
@ -304,8 +328,7 @@ const handleSubmit = async () => {
dialogVisible.value = false dialogVisible.value = false
dialogTitle.value = '添加' dialogTitle.value = '添加'
dialogType.value = 'add' dialogType.value = 'add'
} } else {
else {
// //
await editRiskApi({ ...params, id: selectedRow.value.id }) await editRiskApi({ ...params, id: selectedRow.value.id })
getRiskList() getRiskList()
@ -322,7 +345,6 @@ const handleClose = () => {
} }
</script> </script>
<style scoped> <style scoped>
.risk { .risk {
.bar { .bar {

View File

@ -12,8 +12,8 @@ export const tableColumnsSwitch = [
] ]
export const tableColumnsContent = [ export const tableColumnsContent = [
// 内容 // 内容
{label: '内容', prop: 'content', align: 'center' as const,slotName: 'contentName'}, { label: '内容', prop: 'text', align: 'center' as const },
] ]
export const formItem = [ export const formItem = [
// 名称 // 名称
{label: '名称', prop: 'name', type: 'input' as const, placeholder: '请输入名称',labelWidth: '150px'}, {label: '名称', prop: 'name', type: 'input' as const, placeholder: '请输入名称',labelWidth: '150px'},

View File

@ -238,8 +238,8 @@ const getCustomerList = async () => {
userId: item.id, userId: item.id,
status: item.status === 1 ? '正常' : '禁用', status: item.status === 1 ? '正常' : '禁用',
role: item.role.title || '未知', role: item.role.title || '未知',
accountQty: item.son_user[0].son_user_count, accountQty: item.son_user[0]?.son_user_count,
commissionRatio: item.wallet_capital.fee_handling_percent, commissionRatio: item?.wallet_capital?.fee_handling_percent,
createTime: item.created_at, createTime: item.created_at,
role_id: item.role_id, role_id: item.role_id,
})) }))

View File

@ -10,9 +10,6 @@
<div class="tab-item"> <div class="tab-item">
<el-button :type="tabType === 'identity' ? 'primary' : 'default'" @click="tabType = 'identity'">身份信息</el-button> <el-button :type="tabType === 'identity' ? 'primary' : 'default'" @click="tabType = 'identity'">身份信息</el-button>
</div> </div>
<div class="tab-item">
<el-button :type="tabType === 'contact' ? 'primary' : 'default'" @click="tabType = 'contact'">联系信息</el-button>
</div>
</div> </div>
<article> <article>
<p class="warn"> <p class="warn">

View File

@ -1,14 +1,15 @@
export const identityFormItems = [ export const identityFormItems = [
// 国籍
{ prop: 'nationality', label: '国籍', type: 'select' as const ,width: "200px"},
// 证件类型
{ prop: 'idType', label: '证件类型', type: 'select' as const ,width: "200px"},
// 上传证件
{ prop: 'idCard', slotName: 'upload', label: '上传证件' ,type: 'upload' as const},
]
export const contactFormItems = [
// 联系电话 // 联系电话
{ prop: 'phone', label: '联系电话', type: 'input' as const ,width: "200px"}, { prop: 'phone', label: '联系电话', type: 'input' as const, width: '200px' },
// 国籍
{ prop: 'nationality', label: '国籍', type: 'select' as const, width: '200px' },
// 证件类型
{ prop: 'idType', label: '证件类型', type: 'select' as const, width: '200px' },
// 上传证件
{ prop: 'idCard', slotName: 'upload', label: '上传证件', type: 'upload' as const },
]
export const contactFormItems = [
] ]

View File

@ -13,7 +13,7 @@
<!-- 表格组件 --> <!-- 表格组件 -->
<ClientTable :table-data="clientTree" :columns="clientTableColumns"> <ClientTable :table-data="clientTree" :columns="clientTableColumns">
<template #status="{ row }"> <template #status="{ row }">
<el-switch :model-value="row.status === 1" :active-value="true" :inactive-value="false" /> {{row.status === 1 ? '正常' : '禁用'}}
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<el-button type="primary" size="small" @click="handleChange(row)"> <el-button type="primary" size="small" @click="handleChange(row)">
@ -287,7 +287,7 @@ const handleChange = (row: any) => {
riskTemplate: row.wallet_capital.risk_control_id, riskTemplate: row.wallet_capital.risk_control_id,
userName: row.username, userName: row.username,
status: row.status, status: row.status,
isUpgrade: 1, isUpgrade: 2,
} as any } as any
console.log('rowrowrowrowrowrowrowrowrow', clientForm.value) console.log('rowrowrowrowrowrowrowrowrow', clientForm.value)
getOptions() getOptions()

View File

@ -21,14 +21,10 @@
@row-click="handleRowClick" @row-click="handleRowClick"
> >
<template #onlineStatus="{ row }"> <template #onlineStatus="{ row }">
<el-switch {{ ['', '上线', '下线'][row.onlineStatus] }}
:model-value="row.onlineStatus === 1"
:active-value="true"
:inactive-value="false"
/>
</template> </template>
<template #tradeStatus="{ row }"> <template #tradeStatus="{ row }">
<el-switch :model-value="row.status === 1" :active-value="true" :inactive-value="false" /> {{ ['', '开启', '禁用'][row.tradeStatus] }}
</template> </template>
</VarietyTable> </VarietyTable>
</div> </div>
@ -296,6 +292,8 @@ const handleEdit = () => {
pointDecimalPlaces: row.point_diff_decimal_place, pointDecimalPlaces: row.point_diff_decimal_place,
imageUrl: row.image, imageUrl: row.image,
feeInventoryTime: row.fee_inventory_time, feeInventoryTime: row.fee_inventory_time,
tradeStatus: row.status,
onlineStatus: row.online_status,
// //
isDefault: row.is_default, isDefault: row.is_default,
} as any } as any

View File

@ -276,8 +276,10 @@ const handleForgotPassword = async () => {
email: forgotPasswordForm.value.email, email: forgotPasswordForm.value.email,
reg_type: getForgotType === 'email' ? 1 : 2, reg_type: getForgotType === 'email' ? 1 : 2,
code: forgotPasswordForm.value.code, code: forgotPasswordForm.value.code,
login_password1: md5Encrypt(forgotPasswordForm.value.password), // login_password1: md5Encrypt(forgotPasswordForm.value.password),
login_password2: md5Encrypt(forgotPasswordForm.value.confirmPassword), // login_password2: md5Encrypt(forgotPasswordForm.value.confirmPassword),
login_password1: forgotPasswordForm.value.password,
login_password2: forgotPasswordForm.value.confirmPassword,
} }
// //