优化管理员管理目录中菜单的样式

This commit is contained in:
2026-04-28 13:44:24 +08:00
parent 26f4151339
commit d7375222ce
7 changed files with 111 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
namespace app\admin\controller\admin;
use app\common\controller\Backend;
use support\think\Db;
use support\Response;
use Webman\Http\Request as WebmanRequest;
@@ -51,9 +52,28 @@ class AdminWallet extends Backend
->where($where)
->order($order)
->paginate($limit);
$items = $res->items();
$channelIds = [];
foreach ($items as $item) {
$channelId = intval($item['admin']['channel_id'] ?? 0);
if ($channelId > 0) {
$channelIds[] = $channelId;
}
}
$channelNames = [];
if ($channelIds !== []) {
$channelNames = Db::name('channel')
->whereIn('id', array_values(array_unique($channelIds)))
->column('name', 'id');
}
foreach ($items as &$item) {
$channelId = intval($item['admin']['channel_id'] ?? 0);
$item['channel_name'] = $channelId > 0 ? strval($channelNames[$channelId] ?? '') : '';
}
unset($item);
return $this->success('', [
'list' => $res->items(),
'list' => $items,
'total' => $res->total(),
'remark' => get_route_remark(),
]);

View File

@@ -3,6 +3,7 @@ export default {
admin_id: 'admin_id',
admin_username: 'admin_username',
channel_id: 'channel_id',
channel_name: 'channel',
balance: 'available_balance',
frozen_balance: 'frozen_balance',
total_income: 'total_income',

View File

@@ -11,7 +11,14 @@ export default {
balance_before: 'balance_before',
balance_after: 'balance_after',
ref_type: 'ref_type',
ref_title: 'reference_title',
ref_id: 'ref_id',
'ref title agent_commission_record': 'Agent commission',
'ref title admin_withdraw_order': 'Admin withdraw order',
'ref title withdraw_order': 'Withdraw order',
'ref title deposit_order': 'Deposit order',
'ref title bet_order': 'Bet order',
'ref title admin_user_wallet_adjust': 'Admin wallet adjustment',
idempotency_key: 'idempotency_key',
operator_admin_username: 'operator_admin',
remark: 'remark',

View File

@@ -3,6 +3,7 @@ export default {
admin_id: '管理员ID',
admin_username: '管理员账号',
channel_id: '渠道ID',
channel_name: '渠道',
balance: '可用余额',
frozen_balance: '冻结余额',
total_income: '累计入账',

View File

@@ -11,7 +11,14 @@ export default {
balance_before: '变动前余额',
balance_after: '变动后余额',
ref_type: '来源类型',
ref_title: '关联标题',
ref_id: '来源ID',
'ref title agent_commission_record': '代理分红记录',
'ref title admin_withdraw_order': '管理员提现单',
'ref title withdraw_order': '用户提现单',
'ref title deposit_order': '用户充值单',
'ref title bet_order': '注单记录',
'ref title admin_user_wallet_adjust': '后台钱包调整',
idempotency_key: '幂等键',
operator_admin_username: '操作管理员',
remark: '备注',

View File

@@ -27,10 +27,51 @@ const baTable = new baTableClass(
pk: 'id',
column: [
{ type: 'selection', align: 'center', operator: false },
{ label: t('admin.adminWallet.id'), prop: 'id', align: 'center', width: 70, operator: 'RANGE', sortable: 'custom' },
{ label: t('admin.adminWallet.admin_id'), prop: 'admin_id', align: 'center', width: 90, operator: 'RANGE', sortable: false },
{ label: t('admin.adminWallet.admin_username'), prop: 'admin.username', align: 'center', minWidth: 140, operator: 'LIKE' },
{ label: t('admin.adminWallet.channel_id'), prop: 'admin.channel_id', align: 'center', width: 100, operator: 'RANGE' },
{
label: t('admin.adminWallet.id'),
prop: 'id',
align: 'center',
width: 70,
operator: 'RANGE',
sortable: 'custom',
},
{
label: t('admin.adminWallet.admin_id'),
prop: 'admin_id',
align: 'center',
show: false,
width: 90,
operator: 'RANGE',
sortable: false,
},
{
label: t('admin.adminWallet.admin_username'),
prop: 'admin.username',
align: 'center',
minWidth: 140,
operator: 'LIKE',
render: 'tag',
customRenderAttr: {
tag: () => ({
color: '#e8f3ff',
style: { color: '#1677ff', borderColor: '#91caff' },
}),
},
},
{
label: t('admin.adminWallet.channel_name'),
prop: 'channel_name',
align: 'center',
minWidth: 120,
operator: 'LIKE',
render: 'tag',
customRenderAttr: {
tag: () => ({
color: '#f0f9eb',
style: { color: '#67c23a', borderColor: '#b3e19d' },
}),
},
},
{ label: t('admin.adminWallet.balance'), prop: 'balance', align: 'center', minWidth: 120, operator: 'RANGE' },
{ label: t('admin.adminWallet.frozen_balance'), prop: 'frozen_balance', align: 'center', minWidth: 120, operator: 'RANGE' },
{ label: t('admin.adminWallet.total_income'), prop: 'total_income', align: 'center', minWidth: 120, operator: 'RANGE' },

View File

@@ -21,6 +21,24 @@ defineOptions({
const { t } = useI18n()
const tableRef = useTemplateRef('tableRef')
const refTypeReplace = {
agent_commission_record: t('admin.adminWalletRecord.ref title agent_commission_record'),
admin_withdraw_order: t('admin.adminWalletRecord.ref title admin_withdraw_order'),
withdraw_order: t('admin.adminWalletRecord.ref title withdraw_order'),
deposit_order: t('admin.adminWalletRecord.ref title deposit_order'),
bet_order: t('admin.adminWalletRecord.ref title bet_order'),
admin_user_wallet_adjust: t('admin.adminWalletRecord.ref title admin_user_wallet_adjust'),
}
const refTypeTagCustom = {
agent_commission_record: 'success',
admin_withdraw_order: 'warning',
withdraw_order: 'danger',
deposit_order: 'primary',
bet_order: 'info',
admin_user_wallet_adjust: 'warning',
}
const baTable = new baTableClass(
new baTableApi('/admin/admin.AdminWalletRecord/'),
{
@@ -45,8 +63,17 @@ const baTable = new baTableClass(
{ label: t('admin.adminWalletRecord.amount'), prop: 'amount', align: 'center', minWidth: 100, operator: 'RANGE' },
{ label: t('admin.adminWalletRecord.balance_before'), prop: 'balance_before', align: 'center', minWidth: 110, operator: 'RANGE' },
{ label: t('admin.adminWalletRecord.balance_after'), prop: 'balance_after', align: 'center', minWidth: 110, operator: 'RANGE' },
{ label: t('admin.adminWalletRecord.ref_type'), prop: 'ref_type', align: 'center', minWidth: 120, operator: 'LIKE' },
{ label: t('admin.adminWalletRecord.ref_id'), prop: 'ref_id', align: 'center', minWidth: 100, operator: 'RANGE' },
{
label: t('admin.adminWalletRecord.ref_title'),
prop: 'ref_type',
align: 'center',
minWidth: 150,
operator: 'eq',
render: 'tag',
replaceValue: refTypeReplace,
custom: refTypeTagCustom,
},
{ label: t('admin.adminWalletRecord.ref_id'), prop: 'ref_id', align: 'center', minWidth: 100, operator: 'RANGE', show: false },
{ label: t('admin.adminWalletRecord.idempotency_key'), prop: 'idempotency_key', align: 'center', minWidth: 180, operator: 'LIKE' },
{ label: t('admin.adminWalletRecord.operator_admin_username'), prop: 'operatorAdmin.username', align: 'center', minWidth: 130, operator: 'LIKE' },
{ label: t('admin.adminWalletRecord.remark'), prop: 'remark', align: 'center', minWidth: 180, operator: 'LIKE', showOverflowTooltip: true },