添加搜索

This commit is contained in:
2026-07-01 10:48:27 +08:00
parent 3986db42f5
commit 242cc83843
2 changed files with 74 additions and 72 deletions

View File

@ -111,17 +111,11 @@
<span class="value"> <span class="value">
<AnimatedNumber :value="walletCapital.amount || 0" :decimals="2" /> <AnimatedNumber :value="walletCapital.amount || 0" :decimals="2" />
</span> </span>
</div> </div>
<template v-if="isAgent">
<div class="detail-item"> <div class="detail-item">
<span class="label">点差</span> <span class="label">冻结点差</span>
<span class="value">{{ walletCapital.commission_point_diff || '0.00' }}</span> <span class="value">{{ walletCapital.freeze || '0.00' }}</span>
</div> </div>
<div class="detail-item">
<span class="label">手续费</span>
<span class="value">{{ walletCapital.commission_fee_handling || '0.00' }}</span>
</div>
</template>
</div> </div>
</div> </div>
<div class="wallet-actions"> <div class="wallet-actions">
@ -144,67 +138,67 @@
</div> </div>
<!-- {{ userInfo.role_id }} --> <!-- {{ userInfo.role_id }} -->
<!-- 个人账户 --> <!-- 个人账户 -->
<section class="section my-accounts" v-if="userInfo.type*1 !== 2 && userInfo.role_id * 1 === 5" > <section class="section my-accounts" v-if="(userInfo.type*1 !== 1 && userInfo.role_id * 1 === 5) || userInfo.role_id * 1 === 6" >
<h2 class="section-title"> <h2 class="section-title">
<el-icon><User /></el-icon> <el-icon><User /></el-icon>
个人账户 个人账户
<el-button type="primary" size="small" @click="handleAddSubAccount" v-auth="'user_createAccount'"> <el-button type="primary" size="small" @click="handleAddSubAccount" v-auth="'user_createAccount'">
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
添加子账户 添加子账户
</el-button> </el-button>
</h2> </h2>
<div class="account-grid"> <div class="account-grid">
<div <div
v-for="item in accountList" v-for="item in accountList"
:key="item.id" :key="item.id"
class="account-card" class="account-card"
@click="handleAccountClick(item)" @click="handleAccountClick(item)"
> >
<div class="account-header"> <div class="account-header">
<div class="account-name"> <div class="account-name">
<span v-if="isEdit !== item.account_id">{{ item.account_name }}</span> <span v-if="isEdit !== item.account_id">{{ item.account_name }}</span>
<el-input <el-input
v-else v-else
v-model="editName" v-model="editName"
size="small" size="small"
@blur="handleSave" @blur="handleSave"
@keyup.enter="handleSave" @keyup.enter="handleSave"
ref="inputRef" ref="inputRef"
/> />
</div>
<div class="account-actions">
<el-icon size="18" @click.stop="handleEdit(item.account_name, item.account_id)">
<EditPen />
</el-icon>
<el-icon size="18" @click.stop="handleSetting(item.account_id)">
<Setting />
</el-icon>
</div>
</div>
<div class="account-body">
<div class="account-number">{{ item.account_id || '--' }}</div>
<div class="account-stats">
<div class="stat-item">
<span class="stat-label">净资产</span>
<span class="stat-value">
<AnimatedNumber :value="item?.wallets_trade?.amount || 0" :decimals="2" />
</span>
</div> </div>
<div class="stat-item"> <div class="account-actions">
<span class="stat-label">余额</span> <el-icon size="18" @click.stop="handleEdit(item.account_name, item.account_id)">
<span class="stat-value"> <EditPen />
<AnimatedNumber :value="item?.wallets_trade?.amount || 0" :decimals="2" /> </el-icon>
</span> <el-icon size="18" @click.stop="handleSetting(item.account_id)">
<Setting />
</el-icon>
</div> </div>
<div class="stat-item"> </div>
<span class="stat-label">杠杆</span> <div class="account-body">
<span class="stat-value">1:{{ item?.wallets_trade?.lever || '--' }}</span> <div class="account-number">{{ item.account_id || '--' }}</div>
<div class="account-stats">
<div class="stat-item">
<span class="stat-label">净资产</span>
<span class="stat-value">
<AnimatedNumber :value="item?.wallets_trade?.amount || 0" :decimals="2" />
</span>
</div>
<div class="stat-item">
<span class="stat-label">余额</span>
<span class="stat-value">
<AnimatedNumber :value="item?.wallets_trade?.amount || 0" :decimals="2" />
</span>
</div>
<div class="stat-item">
<span class="stat-label">杠杆</span>
<span class="stat-value">1:{{ item?.wallets_trade?.lever || '--' }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </section>
</section>
<!-- 推广板块 --> <!-- 推广板块 -->
<section class="section promotion" v-if="userInfo.type * 1 === 2 && userInfo.role_id * 1 === 5"> <section class="section promotion" v-if="userInfo.type * 1 === 2 && userInfo.role_id * 1 === 5">
@ -310,7 +304,6 @@ import AnimatedNumber from '@/views/agent/user/AnimatedNumber.vue'
const userStore = useUserStore() const userStore = useUserStore()
// role_id === 5 // role_id === 5
const isAgent = computed(() => userStore.userInfo?.role_id === 5)
// //
const startSteps = ref([ const startSteps = ref([

View File

@ -11,11 +11,12 @@
</header> </header>
<div class="table-container"> <div class="table-container">
<div class="table-container-left"> <div class="table-container-left">
<Table ref="singleTableRef" :show-column-setting="false" :table-data="tableData" :columns="tableColumns" row-key="id" :loading="loading" <Table ref="singleTableRef" :show-column-setting="false" :table-data="tableData" :columns="tableColumns"
:highlight-current-row="true" @current-change="handleCurrentChange" /> row-key="id" :loading="loading" :highlight-current-row="true" @current-change="handleCurrentChange" />
</div> </div>
<div class="table-container-right"> <div class="table-container-right">
<Table :show-column-setting="false" row-key="id" :table-data="tableDataDetail" :columns="tableColumnsDetail" :loading="detailLoading" /> <Table :show-column-setting="false" row-key="id" :table-data="tableDataDetail" :columns="tableColumnsDetail"
:loading="detailLoading" />
</div> </div>
</div> </div>
<el-dialog v-model="dialogVisible" :title="dialogTitleType === 1 ? '添加手续费模板' : '编辑手续费模板'" width="500"> <el-dialog v-model="dialogVisible" :title="dialogTitleType === 1 ? '添加手续费模板' : '编辑手续费模板'" width="500">
@ -94,7 +95,8 @@ const { buttonLoading: submitDetailLoading, startButtonLoading: startSubmitDetai
const tableData = ref<any[]>([]) const tableData = ref<any[]>([])
const tableColumns = [ const tableColumns = [
{ prop: 'name', label: '名称' }, { prop: 'name', label: '名称' },
{ prop: 'type', label: '状态' }, { prop: 'typeName', label: '状态' },
{ prop: 'statusName', label: '是否默认' },
] ]
const currentRow = ref<Record<string, any>>({}) const currentRow = ref<Record<string, any>>({})
const singleTableRef = ref() const singleTableRef = ref()
@ -117,6 +119,7 @@ const setCurrent = (row: any) => {
// //
const handleCurrentChange = (row: any) => { const handleCurrentChange = (row: any) => {
currentRow.value = row currentRow.value = row
console.log('currentRow.value:', currentRow.value);
fetchItemDetail(row.id) fetchItemDetail(row.id)
} }
@ -133,7 +136,13 @@ const getTableData = async () => {
startLoading() startLoading()
try { try {
const res = await getFeeSettingList() const res = await getFeeSettingList()
tableData.value = Array.isArray(res) ? res : [] tableData.value = Array.isArray(res) ? res.map((item) => {
return {
...item,
typeName: item.type === 1 ? '是' : "否",
statusName: item.type === 1 ? '正常' : "封禁"
}
}) : []
handleTableDataAfterLoad() handleTableDataAfterLoad()
} finally { } finally {
stopLoading() stopLoading()
@ -182,6 +191,7 @@ const editFee = () => {
id: currentRow.value.id, id: currentRow.value.id,
name: currentRow.value.name, name: currentRow.value.name,
type: currentRow.value.type, type: currentRow.value.type,
status: currentRow.value.status * 1,
description: currentRow.value.description, description: currentRow.value.description,
} }
} }
@ -277,4 +287,3 @@ header {
} }
} }
</style> </style>