添加搜索

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">
<AnimatedNumber :value="walletCapital.amount || 0" :decimals="2" />
</span>
</div>
<template v-if="isAgent">
</div>
<div class="detail-item">
<span class="label">点差</span>
<span class="value">{{ walletCapital.commission_point_diff || '0.00' }}</span>
</div>
<div class="detail-item">
<span class="label">手续费</span>
<span class="value">{{ walletCapital.commission_fee_handling || '0.00' }}</span>
</div>
</template>
<span class="label">冻结点差</span>
<span class="value">{{ walletCapital.freeze || '0.00' }}</span>
</div>
</div>
</div>
<div class="wallet-actions">
@ -144,67 +138,67 @@
</div>
<!-- {{ userInfo.role_id }} -->
<!-- 个人账户 -->
<section class="section my-accounts" v-if="userInfo.type*1 !== 2 && userInfo.role_id * 1 === 5" >
<h2 class="section-title">
<el-icon><User /></el-icon>
个人账户
<el-button type="primary" size="small" @click="handleAddSubAccount" v-auth="'user_createAccount'">
<el-icon><Plus /></el-icon>
添加子账户
</el-button>
</h2>
<div class="account-grid">
<div
v-for="item in accountList"
:key="item.id"
class="account-card"
@click="handleAccountClick(item)"
>
<div class="account-header">
<div class="account-name">
<span v-if="isEdit !== item.account_id">{{ item.account_name }}</span>
<el-input
v-else
v-model="editName"
size="small"
@blur="handleSave"
@keyup.enter="handleSave"
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>
<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">
<el-icon><User /></el-icon>
个人账户
<el-button type="primary" size="small" @click="handleAddSubAccount" v-auth="'user_createAccount'">
<el-icon><Plus /></el-icon>
添加子账户
</el-button>
</h2>
<div class="account-grid">
<div
v-for="item in accountList"
:key="item.id"
class="account-card"
@click="handleAccountClick(item)"
>
<div class="account-header">
<div class="account-name">
<span v-if="isEdit !== item.account_id">{{ item.account_name }}</span>
<el-input
v-else
v-model="editName"
size="small"
@blur="handleSave"
@keyup.enter="handleSave"
ref="inputRef"
/>
</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 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 class="stat-item">
<span class="stat-label">杠杆</span>
<span class="stat-value">1:{{ item?.wallets_trade?.lever || '--' }}</span>
</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 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>
</section>
</section>
<!-- 推广板块 -->
<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()
// role_id === 5
const isAgent = computed(() => userStore.userInfo?.role_id === 5)
//
const startSteps = ref([

View File

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