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,52 +1,95 @@
<template> <template>
<div> <div>
<!-- 搜索 --> <!-- 搜索 -->
<CustomerListSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch" <CustomerListSearch
@reset="handleReset"></CustomerListSearch> :search-form="searchForm"
<!-- 表格 --> :search-options="searchOptions"
<CustomerListTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="userId" @search="handleSearch"
:tree-props="treeProps" :default-sort="{ prop: 'createTime', order: 'descending' }" @reset="handleReset"
@expand-change="handleGetSubList"> ></CustomerListSearch>
<template #marginRatio="{ row }"> <!-- 表格 -->
<el-button v-if="row.role_id === 5" type="primary" size="small" @click="handleMarginRatio(row)"> <CustomerListTable
修改 :table-data="tableTree"
</el-button> :columns="tableColumnsOptions"
</template> row-key="userId"
<template #commissionRatio="{ row }"> :tree-props="treeProps"
{{ row.commissionRatio }} :default-sort="{ prop: 'createTime', order: 'descending' }"
<el-button v-if="row.role_id === 5" type="primary" size="small" @click="handleCommissionRatio(row)"> @expand-change="handleGetSubList"
修改 >
</el-button> <template #marginRatio="{ row }">
</template> <el-button
<template #action="{ row }"> v-if="row.role_id === 5"
<el-button link type="primary" size="small" @click="handleDetail(row)" v-if="row.userId"> type="primary"
查看详情 size="small"
</el-button> @click="handleMarginRatio(row)"
</template> >
</CustomerListTable> 修改
<!-- 分页 --> </el-button>
<CustomerListPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total" </template>
@pagination-change="handlePaginationChange" /> <template #commissionRatio="{ row }">
<!-- dialog --> {{ row.commissionRatio }}
<CustomerListDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" <el-button
:fullscreen="dialogFullscreen" :show-footer="dialogType !== 'view'" @confirm="handleSubmit" v-if="row.role_id === 5"
@cancel="handleCancel" @close="handleClose"> type="primary"
<CustomerListTable :table-data="marginRatioTree" :columns="marginRatioTableColumnsOptions" row-key="id" size="small"
v-if="dialogType === 'editMarginRatio'"> @click="handleCommissionRatio(row)"
<template #assignedPointDiff="{ row }"> >
<el-form :model="row" :rules="marginRatioRules(row)" :ref="el => setFormRef(el, row.id)"> 修改
<el-form-item prop="assignedPointDifference"> </el-button>
<el-input v-model="row.assignedPointDifference" size="small" placeholder="请输入点差" /> </template>
</el-form-item> <template #action="{ row }">
</el-form> <el-button link type="primary" size="small" @click="handleDetail(row)" v-if="row.userId">
</template> 查看详情
</CustomerListTable> </el-button>
<CustomerListForm :form-data="commissionRatioForm" :form-rules="commissionRatioFormRules" </template>
:form-items="commissionRatioFormItemOptions" ref="commissionRatioFormRef" </CustomerListTable>
v-if="dialogType === 'editCommissionRatio'"></CustomerListForm> <!-- 分页 -->
</CustomerListDialog> <CustomerListPagination
<!-- dialog表格 --> v-model="currentPage"
</div> v-model:pageSizeValue="pageSize"
:total="total"
@pagination-change="handlePaginationChange"
/>
<!-- dialog -->
<CustomerListDialog
:visible="dialogVisible"
:title="dialogTitle"
:type="dialogType"
: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 }">
<el-form
:model="row"
: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>
</template>
</CustomerListTable>
<CustomerListForm
:form-data="commissionRatioForm"
:form-rules="commissionRatioFormRules"
:form-items="commissionRatioFormItemOptions"
ref="commissionRatioFormRef"
v-if="dialogType === 'editCommissionRatio'"
></CustomerListForm>
</CustomerListDialog>
<!-- dialog表格 -->
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -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,15 +118,14 @@ 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: 定义搜索数据
*/ */
const searchForm = ref({ const searchForm = ref({
accountName: '', accountName: '',
startTime: '', startTime: '',
endTime: '', endTime: '',
status: '', status: '',
}) })
const searchOptions = ref(search) const searchOptions = ref(search)
const tableColumnsOptions = ref(tableColumns) const tableColumnsOptions = ref(tableColumns)
@ -115,46 +161,47 @@ const formRefs: any = ref({})
// //
const setFormRef = (el: any, id: any) => { const setFormRef = (el: any, id: any) => {
if (el) formRefs.value[id] = el if (el) formRefs.value[id] = el
} }
// //
const marginRatioRules = (row: any) => { 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+)?$/,
validator: (rule: any, value: any, callback: any) => { message: '只能输入数字(可带小数)',
const inputVal = Number(value || 0) trigger: ['blur', 'change'],
const maxVal = Number(row.pointDifference || 0) },
{
validator: (rule: any, value: any, callback: any) => {
const inputVal = Number(value || 0)
const maxVal = Number(row.pointDifference || 0)
if (inputVal > maxVal) { if (inputVal > maxVal) {
callback(new Error('不能大于可分配点数')) callback(new Error('不能大于可分配点数'))
} else { } else {
callback() callback()
} }
}, },
trigger: ['blur', 'change'] trigger: ['blur', 'change'],
} },
] ],
} }
} }
/** /**
* @description: 定义手续费form数据 * @description: 定义手续费form数据
*/ */
const commissionRatioForm = ref({ const commissionRatioForm = ref({
commissionRatio: '', commissionRatio: '',
}) })
const commissionRatioFormRef = ref() const commissionRatioFormRef = ref()
const commissionRatioFormRules = { 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('')
@ -163,157 +210,175 @@ const selectId = ref('')
* @description: 角色映射方法 * @description: 角色映射方法
*/ */
const roleMap: any = { const roleMap: any = {
1: '平台', 1: '平台',
2: '承包商', 2: '承包商',
3: '特殊做市商', 3: '特殊做市商',
4: '普通做市商', 4: '普通做市商',
5: '代理', 5: '代理',
6: '用户' 6: '用户',
} }
/** /**
* @description: 定义公共请求数据方法 * @description: 定义公共请求数据方法
*/ */
// //
const getCustomerList = async (id: string) => { const getCustomerList = async (id: string) => {
const params = { const params = {
user_id: id, user_id: id,
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
status: searchForm.value.status, ? `${searchForm.value.startTime} 0:00:00`
} : '2026-01-01 0:00:00',
const data: any = await getCustomerListApi(params) reg_end_time:
searchForm.value.endTime.length > 0
? `${searchForm.value.endTime} 23:59:59`
: '2026-03-01 23:59:59',
status: searchForm.value.status,
}
const data: any = await getCustomerListApi(params)
tableTree.value = data.data.map((item: any) => ({ tableTree.value = data.data.map((item: any) => ({
accountName: item.username, accountName: item.username,
userId: item.id, userId: item.id,
status: item.status === 1 ? '正常' : '禁用', status: item.status === 1 ? '正常' : '禁用',
role: roleMap[item.role_id] || '未知', role: roleMap[item.role_id] || '未知',
accountQty: item.account[0].account_count, accountQty: item.account[0].account_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,
children: item.role_id === 5 ? [{ children:
hasChildren: true, item.role_id === 5
}] : undefined, ? [
})) {
hasChildren: true,
// },
total.value = data.total ]
currentPage.value = data.current_page : undefined,
pageSize.value = Number(data.per_page) }))
console.log('tableTree', tableTree.value)
//
total.value = data.total
currentPage.value = data.current_page
pageSize.value = Number(data.per_page)
} }
// //
const getSelfVarietyPointDiffConfig = async (id: string) => { const getSelfVarietyPointDiffConfig = async (id: string) => {
const params = { const params = {
user_id: id, user_id: id,
}
const data: any = await getSelfVarietyPointDiffConfigApi(params)
marginRatioTree.value = data.map((item: any) => {
return {
id: item.id,
varietyName: item.name,
varietyCode: item.code,
pointDifference: item.point_diff,
assignedPointDifference: item.target_point_diff,
} }
const data: any = await getSelfVarietyPointDiffConfigApi(params) })
marginRatioTree.value = data.data.map((item: any) => ({ console.log('marginRatioTree', marginRatioTree.value)
id: item.id,
varietyName: item.name,
varietyCode: item.code,
pointDifference: item.point_diff,
assignedPointDifference: item.target_point_diff
}))
} }
/** /**
* @description: 页面加载完成需要请求的数据 * @description: 页面加载完成需要请求的数据
*/ */
onMounted(() => { onMounted(() => {
getCustomerList(userId.value) getCustomerList(userId.value)
}) })
/** /**
* @description: 定义搜索方法 * @description: 定义搜索方法
*/ */
const handleSearch = async () => { const handleSearch = async () => {
getCustomerList(userId.value) getCustomerList(userId.value)
} }
const handleReset = () => { const handleReset = () => {
searchForm.value = { searchForm.value = {
accountName: '', accountName: '',
startTime: '', startTime: '',
endTime: '', endTime: '',
status: '', status: '',
} }
getCustomerList(userId.value) getCustomerList(userId.value)
} }
/** /**
* @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'
selectId.value = row.userId selectId.value = row.userId
} }
// //
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'
selectId.value = row.userId selectId.value = row.userId
} }
// //
const handleGetSubList = async (row: any) => { const handleGetSubList = async (row: any) => {
const params = { const params = {
user_name: '', user_name: '',
user_id: row.userId, user_id: row.userId,
page: currentPage.value, page: currentPage.value,
page_size: pageSize.value, page_size: pageSize.value,
reg_start_time: '', reg_start_time: '',
reg_end_time: '', reg_end_time: '',
status: '', status: '',
} }
const data: any = await getCustomerListApi(params) const data: any = await getCustomerListApi(params)
if (data.data.length === 0) { if (data.data.length === 0) {
ElMessage({ ElMessage({
message: '暂无数据', message: '暂无数据',
type: 'error', type: 'error',
}) })
row.children = [] row.children = []
return return
} }
row.children = data.data.map((item: any) => ({ row.children = data.data.map((item: any) => ({
accountName: item.username, accountName: item.username,
userId: item.id, userId: item.id,
status: item.status === 1 ? '正常' : '禁用', status: item.status === 1 ? '正常' : '禁用',
role: roleMap[item.role_id] || '未知', role: roleMap[item.role_id] || '未知',
accountQty: item.account[0].account_count, accountQty: item.account[0].account_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,
children: item.role_id === 5 ? [{ children:
hasChildren: true, item.role_id === 5
}] : undefined, ? [
})) {
hasChildren: true,
},
]
: 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)
} }
/** /**
@ -321,57 +386,60 @@ const handlePaginationChange = (page: { currentPage: number, size: number }) =>
*/ */
// //
const handleSubmit = async () => { const handleSubmit = async () => {
const params = { const params = {
user_id: selectId.value, user_id: selectId.value,
toucun_percent: '', toucun_percent: '',
point_diffs_json: '', point_diffs_json: '',
fee_handling_percent: '', fee_handling_percent: '',
fee_setting_id: '', fee_setting_id: '',
risk_control_id: '', risk_control_id: '',
}
if (dialogType.value === 'editMarginRatio') {
//
for (const row of marginRatioTree.value) {
const form = formRefs.value[(row as any).id]
if (!form) continue
try {
await form.validate()
} catch (err) {
console.error(`${(row as any).id} 行验证不通过,请检查`)
return
}
} }
if (dialogType.value === 'editMarginRatio') { // { id: assignedPointDifference }
// const marginRatioJSON = marginRatioTree.value.reduce((acc: any, cur: any) => {
for (const row of marginRatioTree.value) { acc[cur.id] = cur.assignedPointDifference
const form = formRefs.value[(row as any).id] return acc
if (!form) continue }, {})
try {
await form.validate()
} catch (err) {
console.error(`${(row as any).id} 行验证不通过,请检查`)
return
}
}
// { id: assignedPointDifference }
const marginRatioJSON = marginRatioTree.value.reduce((acc: any, cur: any) => {
acc[cur.id] = cur.assignedPointDifference
return acc
}, {})
// //
try { try {
await editCustomerApi({ ...params, point_diffs_json: JSON.stringify(marginRatioJSON) }) await editCustomerApi({ ...params, point_diffs_json: JSON.stringify(marginRatioJSON) })
dialogVisible.value = false dialogVisible.value = false
} catch (err) { } catch (err) {
console.log('提交失败:', err) console.log('提交失败:', err)
}
} }
if (dialogType.value === 'editCommissionRatio') { }
await commissionRatioFormRef.value.validate() if (dialogType.value === 'editCommissionRatio') {
try { await commissionRatioFormRef.value.validate()
await editCustomerApi({ ...params, fee_handling_percent: commissionRatioForm.value.commissionRatio }) try {
dialogVisible.value = false await editCustomerApi({
} catch (err) { ...params,
console.log('提交失败:', err) fee_handling_percent: commissionRatioForm.value.commissionRatio,
} })
dialogVisible.value = false
} catch (err) {
console.log('提交失败:', err)
} }
}
} }
// //
const handleCancel = () => { const handleCancel = () => {
dialogVisible.value = false dialogVisible.value = false
} }
// //
const handleClose = () => { const handleClose = () => {
dialogVisible.value = false dialogVisible.value = false
} }
/** /**
* @description: 定义弹窗表格方法 * @description: 定义弹窗表格方法
@ -380,8 +448,8 @@ const handleClose = () => {
<style scoped lang="scss"> <style scoped lang="scss">
:deep(.placeholder-row) { :deep(.placeholder-row) {
text-align: center; text-align: center;
color: #909399; color: #909399;
/* 灰色和Element空状态颜色一致 */ /* 灰色和Element空状态颜色一致 */
} }
</style> </style>

View File

@ -38,14 +38,19 @@ export const tableColumns = [
// 点差表格配置 // 点差表格配置
export const marginRatioTableColumns = [ export const marginRatioTableColumns = [
// 品种名称 // 品种名称
{ prop: 'varietyName', label: '名称', align: 'center' as const }, { prop: 'varietyName', label: '名称', align: 'center' as const },
// 品种编号 // 品种编号
{ prop: 'varietyCode', label: '编号', align: 'center' as const }, { prop: 'varietyCode', label: '编号', align: 'center' as const },
// 可分配点差 // 可分配点差
{ 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('请先选择账户')
await editAgentNameApi({ if (editName.value === '') return ElMessage.error('请输入账号')
account_id: userInfo?.id || '', editName.value.trim()
account_name: accountName.value, await editAgentNameApi({
}) account_id: account_id,
accountName.value = editName.value.trim() account_name: editName.value,
setStorage('userInfo', { })
...userInfo, await getAccoundList()
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

@ -1,46 +1,54 @@
<template> <template>
<div class="risk"> <div class="risk">
<div class="bar"> <div class="bar">
<span>风控管理</span> <span>风控管理</span>
<el-button type="primary" @click="handleAddRisk">添加</el-button> <el-button type="primary" @click="handleAddRisk">添加</el-button>
<el-button type="primary" @click="handleModifyRisk">修改</el-button> <el-button type="primary" @click="handleModifyRisk">修改</el-button>
<el-button type="danger" @click="handleRiskStatus">停用</el-button> <el-button type="danger" @click="handleRiskStatus">停用</el-button>
</div>
<!-- 表格 -->
<div class="risk-table-content">
<RiskTableSwitch :columns="tableColumnsSwitch" :table-data="tableTreeSwitch" class="table-switch"
@row-click="handleRowClick" row-key="id" highlight-current-row :current-row-key="selectedRowId">
<template #status="{ row }">
<span>{{ row.status === 1 ? '启用' : '停用' }}</span>
</template>
</RiskTableSwitch>
<RiskTableContent :columns="tableColumnsContent" :table-data="[currentContent]" class="table-content"
row-key="id">
<template #contentName="{ row }">
<div class="risk-content-group">
<span>单笔开仓最大数量:{{ row.maxOpenPosition }}</span>
<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>
</div>
<!-- dialog -->
<RiskDialog :visible="dialogVisible" :title="dialogTitle" :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>
</div> </div>
<!-- 表格 -->
<div class="risk-table-content">
<RiskTableSwitch
:columns="tableColumnsSwitch"
:table-data="tableTreeSwitch"
class="table-switch"
@row-click="handleRowClick"
row-key="id"
highlight-current-row
:current-row-key="selectedRowId"
>
<template #status="{ row }">
<span>{{ row.status === 1 ? '启用' : '停用' }}</span>
</template>
</RiskTableSwitch>
<RiskTableContent
:columns="tableColumnsContent"
:table-data="currentContent"
class="table-content"
row-key="id"
>
</RiskTableContent>
</div>
<!-- dialog -->
<RiskDialog
:visible="dialogVisible"
:title="dialogTitle"
: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>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -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: 定义弹窗数据
@ -82,6 +90,116 @@ const dialogType = ref('')
* @description: 定义弹窗表单数据 * @description: 定义弹窗表单数据
*/ */
const dialogForm = ref({ const dialogForm = ref({
id: null,
name: '',
status: 1,
//
isDefault: 1,
maxOpenPosition: null,
maxPositionPerSymbol: null,
maxTotalPosition: null,
strongCloseRatio: null,
maxWithdrawalAmount: null,
isWithdrawalAllowed: 1,
withdrawalTimeSetting: '',
isWithdrawalAuditRequired: 1,
buildCloseTime: null,
minWithdrawalAmount: null,
slippage: null,
minDepositAmount: null,
})
const riskRules = ref(rules())
const riskFormRef = ref()
const RiskFormItems = ref(formItem)
const riskFormOptionsMap = ref({
//
status: [
{ label: '启用', value: 1 },
{ label: '停用', value: 2 },
],
//
isDefault: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
//
isWithdrawalAllowed: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
//
isWithdrawalAuditRequired: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
})
const rowGutter = ref(20)
const colSpan = ref(12)
/**
* @description: 定义公共数据处理方法
*/
/**
* @description: 定义请求数据方法
*/
const getRiskList = async () => {
const data: any = await getRiskListApi()
//
riskOriginData.value = data
//
tableTreeSwitch.value = data.map((item: any) => ({
id: item.id,
name: item.name,
status: item.status,
}))
tableTreeContent.value = data.map((item: any) => ({
id: item.id,
isDefault: item.is_default,
//
maxOpenPosition: item.max_opening_quantity_per_transaction,
//
maxPositionPerSymbol: item.max_holding_quantity_per_variety,
//
maxTotalPosition: item.max_holding_quantity_per_transaction,
//
strongCloseRatio: item.strong_to_average_ratio,
//
maxWithdrawalAmount: item.max_withdrawal_amount_per_transaction,
//
isWithdrawalAllowed: item.withdraw_status === 1 ? '是' : '否',
//
withdrawalTimeSetting: item.withdraw_time,
//
isWithdrawalAuditRequired: item.withdraw_is_check === 1 ? '是' : '否',
//
buildCloseTime: item.open_close_time,
//
minWithdrawalAmount: item.min_withdrawal_amount_per_transaction,
//
slippage: item.slippage,
//
minDepositAmount: item.min_recharge_amount_per_transaction,
}))
//
if (tableTreeSwitch.value.length > 0) {
handleRowClick(tableTreeSwitch.value[0])
}
}
/**
* @description: 页面加载完成需要请求的数据
*/
onMounted(() => {
getRiskList()
})
/**
* @description: 定义bar方法
*/
const handleAddRisk = () => {
dialogVisible.value = true
dialogTitle.value = '添加'
dialogType.value = 'add'
dialogForm.value = {
id: null, id: null,
name: '', name: '',
status: 1, status: 1,
@ -99,264 +217,168 @@ const dialogForm = ref({
minWithdrawalAmount: null, minWithdrawalAmount: null,
slippage: null, slippage: null,
minDepositAmount: null, minDepositAmount: null,
}) }
const riskRules = ref(rules())
const riskFormRef = ref()
const RiskFormItems = ref(formItem)
const riskFormOptionsMap = ref({
//
status: [
{ label: '启用', value: 1 },
{ label: '停用', value: 2 },
],
//
isDefault: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
//
isWithdrawalAllowed: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
//
isWithdrawalAuditRequired: [
{ label: '是', value: 1 },
{ label: '否', value: 2 },
],
})
const rowGutter = ref(20)
const colSpan = ref(12)
/**
* @description: 定义公共数据处理方法
*/
/**
* @description: 定义请求数据方法
*/
const getRiskList = async () => {
const data: any = await getRiskListApi()
//
riskOriginData.value = data
//
tableTreeSwitch.value = data.map((item: any) => ({
id: item.id,
name: item.name,
status: item.status,
}))
tableTreeContent.value = data.map((item: any) => ({
id: item.id,
isDefault: item.is_default,
//
maxOpenPosition: item.max_opening_quantity_per_transaction,
//
maxPositionPerSymbol: item.max_holding_quantity_per_variety,
//
maxTotalPosition: item.max_holding_quantity_per_transaction,
//
strongCloseRatio: item.strong_to_average_ratio,
//
maxWithdrawalAmount: item.max_withdrawal_amount_per_transaction,
//
isWithdrawalAllowed: item.withdraw_status === 1 ? '是' : '否',
//
withdrawalTimeSetting: item.withdraw_time,
//
isWithdrawalAuditRequired: item.withdraw_is_check === 1 ? '是' : '否',
//
buildCloseTime: item.open_close_time,
//
minWithdrawalAmount: item.min_withdrawal_amount_per_transaction,
//
slippage: item.slippage,
//
minDepositAmount: item.min_recharge_amount_per_transaction,
}))
//
if (tableTreeSwitch.value.length > 0) {
handleRowClick(tableTreeSwitch.value[0])
}
}
/**
* @description: 页面加载完成需要请求的数据
*/
onMounted(() => {
getRiskList()
})
/**
* @description: 定义bar方法
*/
const handleAddRisk = () => {
dialogVisible.value = true
dialogTitle.value = '添加'
dialogType.value = 'add'
dialogForm.value = {
id: null,
name: '',
status: 1,
//
isDefault: 1,
maxOpenPosition: null,
maxPositionPerSymbol: null,
maxTotalPosition: null,
strongCloseRatio: null,
maxWithdrawalAmount: null,
isWithdrawalAllowed: 1,
withdrawalTimeSetting: '',
isWithdrawalAuditRequired: 1,
buildCloseTime: null,
minWithdrawalAmount: null,
slippage: null,
minDepositAmount: null,
}
} }
const handleModifyRisk = () => { const handleModifyRisk = () => {
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = '修改' dialogTitle.value = '修改'
dialogType.value = 'edit' dialogType.value = 'edit'
dialogForm.value = { dialogForm.value = {
name: selectedRow.value.name, name: selectedRow.value.name,
status: selectedRow.value.status, status: selectedRow.value.status,
// //
isDefault: selectedRow.value.is_default, isDefault: selectedRow.value.is_default,
maxOpenPosition: selectedRow.value.max_opening_quantity_per_transaction, maxOpenPosition: selectedRow.value.max_opening_quantity_per_transaction,
maxPositionPerSymbol: selectedRow.value.max_holding_quantity_per_variety, maxPositionPerSymbol: selectedRow.value.max_holding_quantity_per_variety,
maxTotalPosition: selectedRow.value.max_holding_quantity_per_transaction, maxTotalPosition: selectedRow.value.max_holding_quantity_per_transaction,
strongCloseRatio: selectedRow.value.strong_to_average_ratio, strongCloseRatio: selectedRow.value.strong_to_average_ratio,
maxWithdrawalAmount: selectedRow.value.max_withdrawal_amount_per_transaction, maxWithdrawalAmount: selectedRow.value.max_withdrawal_amount_per_transaction,
isWithdrawalAllowed: selectedRow.value.withdraw_status, isWithdrawalAllowed: selectedRow.value.withdraw_status,
withdrawalTimeSetting: selectedRow.value.withdraw_time.split('-'), withdrawalTimeSetting: selectedRow.value.withdraw_time.split('-'),
isWithdrawalAuditRequired: selectedRow.value.withdraw_is_check, isWithdrawalAuditRequired: selectedRow.value.withdraw_is_check,
buildCloseTime: selectedRow.value.open_close_time, buildCloseTime: selectedRow.value.open_close_time,
minWithdrawalAmount: selectedRow.value.min_withdrawal_amount_per_transaction, minWithdrawalAmount: selectedRow.value.min_withdrawal_amount_per_transaction,
slippage: selectedRow.value.slippage, slippage: selectedRow.value.slippage,
minDepositAmount: selectedRow.value.min_recharge_amount_per_transaction, minDepositAmount: selectedRow.value.min_recharge_amount_per_transaction,
} as any } as any
} }
const handleRiskStatus = async () => { const handleRiskStatus = async () => {
dialogTitle.value = '停用' dialogTitle.value = '停用'
dialogType.value = 'status' dialogType.value = 'status'
await editRiskApi({ ...selectedRow.value, status: 2 }) await editRiskApi({ ...selectedRow.value, status: 2 })
getRiskList() getRiskList()
} }
/** /**
* @description: 定义表格方法 * @description: 定义表格方法
*/ */
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 {
selectedRow.value = row selectedRow.value = row
} }
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)
if (targetItem) {
currentContent.value = targetItem 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) {
currentContent.value = fields
}
} }
/** /**
* @description: 定义弹窗方法 * @description: 定义弹窗方法
*/ */
const handleSubmit = async () => { const handleSubmit = async () => {
await riskFormRef.value?.validate() await riskFormRef.value?.validate()
const params = { const params = {
name: dialogForm.value.name, name: dialogForm.value.name,
status: dialogForm.value.status, status: dialogForm.value.status,
// //
is_default: dialogForm.value.isDefault, is_default: dialogForm.value.isDefault,
// //
max_opening_quantity_per_transaction: dialogForm.value.maxOpenPosition, max_opening_quantity_per_transaction: dialogForm.value.maxOpenPosition,
// //
max_holding_quantity_per_variety: dialogForm.value.maxPositionPerSymbol, max_holding_quantity_per_variety: dialogForm.value.maxPositionPerSymbol,
// //
max_holding_quantity_per_transaction: dialogForm.value.maxTotalPosition, max_holding_quantity_per_transaction: dialogForm.value.maxTotalPosition,
// //
strong_to_average_ratio: dialogForm.value.strongCloseRatio, strong_to_average_ratio: dialogForm.value.strongCloseRatio,
// //
max_withdrawal_amount_per_transaction: dialogForm.value.maxWithdrawalAmount, max_withdrawal_amount_per_transaction: dialogForm.value.maxWithdrawalAmount,
// //
withdraw_status: dialogForm.value.isWithdrawalAllowed, withdraw_status: dialogForm.value.isWithdrawalAllowed,
// //
withdraw_time: Array.from(dialogForm.value.withdrawalTimeSetting || []).join('-'), withdraw_time: Array.from(dialogForm.value.withdrawalTimeSetting || []).join('-'),
// //
withdraw_is_check: dialogForm.value.isWithdrawalAuditRequired, withdraw_is_check: dialogForm.value.isWithdrawalAuditRequired,
// //
open_close_time: dialogForm.value.buildCloseTime, open_close_time: dialogForm.value.buildCloseTime,
// //
min_withdrawal_amount_per_transaction: dialogForm.value.minWithdrawalAmount, min_withdrawal_amount_per_transaction: dialogForm.value.minWithdrawalAmount,
// //
slippage: dialogForm.value.slippage, slippage: dialogForm.value.slippage,
// //
min_recharge_amount_per_transaction: dialogForm.value.minDepositAmount, min_recharge_amount_per_transaction: dialogForm.value.minDepositAmount,
} }
//
if (dialogType.value === 'add') {
// //
if (dialogType.value === 'add') { await addRiskApi(params)
// getRiskList()
await addRiskApi(params) dialogVisible.value = false
getRiskList() dialogTitle.value = '添加'
dialogVisible.value = false dialogType.value = 'add'
dialogTitle.value = '添加' } else {
dialogType.value = 'add' //
} await editRiskApi({ ...params, id: selectedRow.value.id })
else { getRiskList()
// dialogVisible.value = false
await editRiskApi({ ...params, id: selectedRow.value.id }) dialogTitle.value = '编辑'
getRiskList() dialogType.value = 'edit'
dialogVisible.value = false }
dialogTitle.value = '编辑'
dialogType.value = 'edit'
}
} }
const handleCancel = () => { const handleCancel = () => {
dialogVisible.value = false dialogVisible.value = false
} }
const handleClose = () => { const handleClose = () => {
dialogVisible.value = false dialogVisible.value = false
} }
</script> </script>
<style scoped> <style scoped>
.risk { .risk {
.bar { .bar {
margin-bottom: 10px; margin-bottom: 10px;
display: flex; display: flex;
align-items: center; align-items: center;
span { span {
margin-right: 10px; margin-right: 10px;
}
} }
}
.risk-table-content { .risk-table-content {
display: flex; display: flex;
gap: 10px; gap: 10px;
.table-switch { .table-switch {
flex-basis: 20%; flex-basis: 20%;
min-width: 200px; min-width: 200px;
:deep(.el-table__row.current-row) { :deep(.el-table__row.current-row) {
background-color: #ecf5ff !important; background-color: #ecf5ff !important;
} }
}
} }
}
.table-content { .table-content {
flex: 1; flex: 1;
.risk-content-group { .risk-content-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
}
} }
}
} }
</style> </style>

View File

@ -11,9 +11,9 @@ 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: 'phone', label: '联系电话', type: 'input' as const, width: '200px' },
// 证件类型 // 国籍
{ prop: 'idType', label: '证件类型', type: 'select' as const ,width: "200px"}, { prop: 'nationality', label: '国籍', type: 'select' as const, width: '200px' },
// 上传证件 // 证件类型
{ prop: 'idCard', slotName: 'upload', label: '上传证件' ,type: 'upload' as const}, { 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"}, 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,
} }
// //