feat: 开户备注、账单展示优化与后台代理管理增强
- 新增初始上分备注(日常上分/开户赠金/自定义)及前后台校验与展示 - 优化钱包流水类型与备注显示,区分管理员/代理/玩家上下分 - 修复登录后语言被后端覆盖的问题,登录时同步当前语言到服务端 - 后台代理/玩家表格操作栏重构,充值订单增加备注列 - 前台个人中心、充值、账单与验证码组件体验优化 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
53
apps/admin/src/composables/useAdminTableRowActionsLayout.ts
Normal file
53
apps/admin/src/composables/useAdminTableRowActionsLayout.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { ref, provide, inject, onMounted, onBeforeUnmount, nextTick, type Ref, type InjectionKey } from 'vue';
|
||||
|
||||
export const AdminTableRowActionsMenuKey: InjectionKey<Ref<boolean>> = Symbol('adminTableRowActionsMenu');
|
||||
|
||||
const MOBILE_MAX = 768;
|
||||
|
||||
export function useAdminTableRowActionsProvider(tableWrapRef: Ref<HTMLElement | null>) {
|
||||
const useMenu = ref(false);
|
||||
|
||||
function update() {
|
||||
const wrap = tableWrapRef.value;
|
||||
if (!wrap) return;
|
||||
|
||||
if (window.innerWidth <= MOBILE_MAX) {
|
||||
useMenu.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const table = wrap.querySelector('.el-table') as HTMLElement | null;
|
||||
if (!table) {
|
||||
useMenu.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
useMenu.value = table.scrollWidth > wrap.clientWidth + 2;
|
||||
}
|
||||
|
||||
let observer: ResizeObserver | null = null;
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick();
|
||||
update();
|
||||
if (tableWrapRef.value) {
|
||||
observer = new ResizeObserver(() => update());
|
||||
observer.observe(tableWrapRef.value);
|
||||
const table = tableWrapRef.value.querySelector('.el-table');
|
||||
if (table) observer.observe(table);
|
||||
}
|
||||
window.addEventListener('resize', update);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
observer?.disconnect();
|
||||
window.removeEventListener('resize', update);
|
||||
});
|
||||
|
||||
provide(AdminTableRowActionsMenuKey, useMenu);
|
||||
return useMenu;
|
||||
}
|
||||
|
||||
export function useAdminTableRowActionsMenu() {
|
||||
return inject(AdminTableRowActionsMenuKey, null);
|
||||
}
|
||||
Reference in New Issue
Block a user