diff --git a/apps/src/api/legacy/resident-activity.ts b/apps/src/api/legacy/resident-activity.ts index 344a5cb..f08dcb9 100644 --- a/apps/src/api/legacy/resident-activity.ts +++ b/apps/src/api/legacy/resident-activity.ts @@ -5,6 +5,8 @@ import { requestClient } from '#/api/request'; const SPECIFIED_GIFT_WEEKLY_RANK_BASE = '/go/resident-activity/specified-gift-weekly-rank'; const SIGN_IN_REWARD_BASE = '/go/resident-activity/sign-in-reward'; +const ROOM_TURNOVER_REWARD_BASE = + '/go/resident-activity/room-turnover-reward'; export async function getResidentInviteConfig(sysOrigin: string) { return requestClient.get>('/resident-activity/invite/config', { @@ -135,3 +137,30 @@ export async function pageWeekStarRewardRecords(params: Record) { export async function retryWeekStarRewardRecord(id: number | string) { return retrySpecifiedGiftWeeklyRankRewardRecord(id); } + +export async function getRoomTurnoverRewardConfig(sysOrigin: string) { + return requestClient.get>(`${ROOM_TURNOVER_REWARD_BASE}/config`, { + params: { sysOrigin }, + }); +} + +export async function saveRoomTurnoverRewardConfig(data: Record) { + return requestClient.post>( + `${ROOM_TURNOVER_REWARD_BASE}/config/save`, + data, + ); +} + +export async function getRoomTurnoverRewardCurrentRank(params: Record) { + return requestClient.get>( + `${ROOM_TURNOVER_REWARD_BASE}/current-rank`, + { params }, + ); +} + +export async function pageRoomTurnoverRewardRecords(params: Record) { + return requestClient.get>>( + `${ROOM_TURNOVER_REWARD_BASE}/reward-record/page`, + { params }, + ); +} diff --git a/apps/src/router/routes/modules/app-user.ts b/apps/src/router/routes/modules/app-user.ts index fdad2cf..268a147 100644 --- a/apps/src/router/routes/modules/app-user.ts +++ b/apps/src/router/routes/modules/app-user.ts @@ -85,20 +85,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/friendship-card.vue'), meta: { title: '用户友谊卡配置' }, }, - { - name: 'LotfunInviteUserRule', - path: 'sys/invite-user-rule', - alias: '/sys/invite-user-rule', - component: () => import('#/views/operate/invite-user-rule.vue'), - meta: { title: '邀请用户配置' }, - }, - { - name: 'AswatUserAdvertising', - path: 'sys/user-advertising', - alias: '/sys/user-advertising', - component: () => import('#/views/operate/user-advertising.vue'), - meta: { title: '用户观看广告配置' }, - }, { name: 'OperateUserFreight', path: 'user_freight', @@ -120,13 +106,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/im-account-manager.vue'), meta: { title: 'IM账号管理' }, }, - { - name: 'CheckInLog', - path: 'check/in/log', - alias: '/operate/manager/check/in/log', - component: () => import('#/views/operate/check-in-log.vue'), - meta: { title: '用户签到' }, - }, { name: 'OperateUserManage', path: 'user', @@ -169,13 +148,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/inside-operation-gold.vue'), meta: { title: '内部操作金币' }, }, - { - name: 'GameCouponRunningWater', - path: 'game/coupon/running/water', - alias: '/game/coupon/running/water', - component: () => import('#/views/operate/game-coupon-running-water.vue'), - meta: { title: '游戏券收支记录' }, - }, { name: 'OperateIntegralStream', path: 'integral/stream', diff --git a/apps/src/router/routes/modules/family.ts b/apps/src/router/routes/modules/family.ts index 7091be5..aebfc83 100644 --- a/apps/src/router/routes/modules/family.ts +++ b/apps/src/router/routes/modules/family.ts @@ -1,29 +1,5 @@ import type { RouteRecordRaw } from 'vue-router'; -const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'lucide:house', - order: 15.5, - title: '家族管理', - }, - name: 'FamilyManager', - path: '/family/manager', - children: [ - { - name: 'FamilyConfig', - path: 'family_config', - component: () => import('#/views/family/family-config.vue'), - meta: { title: '家族配置' }, - }, - { - name: 'FamilyList', - path: 'family_list', - component: () => import('#/views/family/family-list.vue'), - meta: { title: '家族列表' }, - }, - ], - }, -]; +const routes: RouteRecordRaw[] = []; export default routes; diff --git a/apps/src/router/routes/modules/operate.ts b/apps/src/router/routes/modules/operate.ts index be989a0..10152d9 100644 --- a/apps/src/router/routes/modules/operate.ts +++ b/apps/src/router/routes/modules/operate.ts @@ -29,12 +29,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/cp-apply.vue'), meta: { title: 'CP申请' }, }, - { - name: 'GamePK', - path: '/game/pk', - component: () => import('#/views/operate/game-pk.vue'), - meta: { title: 'PK记录' }, - }, { name: 'OperateActivityConfig', path: 'activity/cnf', @@ -47,24 +41,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/activity-template.vue'), meta: { title: '活动模版' }, }, - { - name: 'GameLudo', - path: '/game-ludo', - component: () => import('#/views/operate/ludo-game.vue'), - meta: { title: 'Ludo飞行棋' }, - }, { name: 'RefundDeductTagLog', path: 'refund-deduct-tag-log', component: () => import('#/views/operate/refund-deduct-tag-log.vue'), meta: { title: '退款扣除目标' }, }, - { - name: 'OperateCnfLottery', - path: 'cnf/lottery', - component: () => import('#/views/operate/lottery-wheel-config.vue'), - meta: { title: '抽奖品配置' }, - }, { name: 'OperateAdministrator', path: 'administrator', @@ -107,12 +89,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/gift-config.vue'), meta: { title: '礼物管理' }, }, - { - name: 'OperateGameLotteryConfig', - path: '/game/lottery-config', - component: () => import('#/views/operate/game-lottery-config.vue'), - meta: { title: '抽奖概率配置' }, - }, { name: 'GameRedPacketRecord', path: '/game/red/packet/record', @@ -137,30 +113,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/lucky-gift-standard-config.vue'), meta: { title: '幸运礼物规格配置' }, }, - { - name: 'GameLuckyBox', - path: '/game/lucky-box', - component: () => import('#/views/operate/lucky-box.vue'), - meta: { title: 'LuckyBox抽奖记录' }, - }, - { - name: 'GameFruitDaysLog', - path: '/game/fruit/log/fruit-days-log', - component: () => import('#/views/operate/fruit-days-log.vue'), - meta: { title: '摩天轮游戏每日数据' }, - }, - { - name: 'OperateFruitTaskConfig', - path: 'game/fruit/task-config', - component: () => import('#/views/operate/fruit-task-config.vue'), - meta: { title: '摩天轮任务配置' }, - }, - { - name: 'GameTeenPatti', - path: '/game/teen-patti', - component: () => import('#/views/operate/teen-patti.vue'), - meta: { title: '炸金花' }, - }, { name: 'OperateSysCountry', path: 'sys/country', @@ -203,12 +155,6 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/operate/trumpet-list.vue'), meta: { title: '喇叭列表' }, }, - { - name: 'OperateGameEgg', - path: '/game/egg', - component: () => import('#/views/operate/game-egg.vue'), - meta: { title: '砸金蛋' }, - }, { name: 'ActivityHallFame', path: '/activity/hall-fame', diff --git a/apps/src/router/routes/modules/pet.ts b/apps/src/router/routes/modules/pet.ts index b6951f3..aebfc83 100644 --- a/apps/src/router/routes/modules/pet.ts +++ b/apps/src/router/routes/modules/pet.ts @@ -1,41 +1,5 @@ import type { RouteRecordRaw } from 'vue-router'; -const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'lucide:paw-print', - order: 16, - title: '宠物管理', - }, - name: 'PetManager', - path: '/pet/manager', - children: [ - { - name: 'PetFeeding', - path: 'feeding', - component: () => import('#/views/pet/pet-feeding.vue'), - meta: { title: '宠物喂养记录' }, - }, - { - name: 'PetBeans', - path: 'beans', - component: () => import('#/views/pet/pet-beans.vue'), - meta: { title: '豆子账户' }, - }, - { - name: 'PetBeansRunningWater', - path: 'beans/running-water', - component: () => import('#/views/pet/pet-beans-running-water.vue'), - meta: { title: '豆子流水' }, - }, - { - name: 'PetPool', - path: 'pool', - component: () => import('#/views/pet/pet-pool.vue'), - meta: { title: '宠物池' }, - }, - ], - }, -]; +const routes: RouteRecordRaw[] = []; export default routes; diff --git a/apps/src/router/routes/modules/resident-activity.ts b/apps/src/router/routes/modules/resident-activity.ts index deaa202..a7290c1 100644 --- a/apps/src/router/routes/modules/resident-activity.ts +++ b/apps/src/router/routes/modules/resident-activity.ts @@ -42,6 +42,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/resident-activity/week-star.vue'), meta: { title: '指定礼物周榜' }, }, + { + name: 'ResidentRoomTurnoverReward', + path: 'room-turnover-reward', + component: () => import('#/views/resident-activity/room-turnover-reward.vue'), + meta: { title: '房间流水奖励' }, + }, ], }, ]; diff --git a/apps/src/views/operate/gold-running-water.vue b/apps/src/views/operate/gold-running-water.vue index bcb5acf..ff035eb 100644 --- a/apps/src/views/operate/gold-running-water.vue +++ b/apps/src/views/operate/gold-running-water.vue @@ -1,35 +1,31 @@ diff --git a/apps/src/views/resident-activity/week-star.vue b/apps/src/views/resident-activity/week-star.vue index 7777ed3..0a46eb5 100644 --- a/apps/src/views/resident-activity/week-star.vue +++ b/apps/src/views/resident-activity/week-star.vue @@ -88,7 +88,7 @@ const editorLoading = ref(false); const saving = ref(false); const editorGiftLoading = ref(false); const editorReadonly = ref(false); -const editorTitle = ref('新建未来周配置'); +const editorTitle = ref('新建周配置'); const groupPickerOpen = ref(false); const rangeDate = ref<[string, string] | null>(null); @@ -111,14 +111,14 @@ const configQuery = reactive({ }); const snapshotQuery = reactive({ - configId: undefined as number | undefined, + configId: undefined as number | string | undefined, cursor: 1, cycleKey: '', limit: 10, }); const rewardQuery = reactive({ - configId: undefined as number | undefined, + configId: undefined as number | string | undefined, cursor: 1, cycleKey: '', limit: 10, @@ -246,7 +246,7 @@ function resetEditorForCreate() { assignForm(createEmptyForm(selectedSysOrigin.value)); rangeDate.value = null; editorReadonly.value = false; - editorTitle.value = '新建未来周配置'; + editorTitle.value = '新建周配置'; } async function loadGiftOptions(sysOrigin: string) { @@ -284,7 +284,7 @@ async function loadConfigList(reset = false) { } } -async function loadConfigDetail(id: number) { +async function loadConfigDetail(id: number | string) { if (!id) { return; } @@ -461,15 +461,15 @@ async function submitForm() { endAt: form.endAt, giftConfigs: (form.giftConfigs || []).map((item: Record) => ({ giftCandy: Number(item.giftCandy || 0), - giftId: Number(item.giftId || 0), + giftId: item.giftId || 0, giftName: String(item.giftName || ''), giftPhoto: String(item.giftPhoto || ''), sort: Number(item.sort || 0), })), - id: Number(form.id || 0), + id: form.id || 0, rewardConfigs: (form.rewardConfigs || []).map((item: Record) => ({ rank: Number(item.rank || 0), - rewardGroupId: Number(item.rewardGroupId || 0), + rewardGroupId: item.rewardGroupId || 0, rewardGroupName: String(item.rewardGroupName || ''), })), startAt: form.startAt, @@ -491,10 +491,10 @@ function openCreateModal() { } async function openConfigModal(record: Record, readOnly = !record.editable) { - editorTitle.value = readOnly ? '查看周配置' : '编辑未来周配置'; + editorTitle.value = readOnly ? '查看周配置' : '编辑周配置'; editorReadonly.value = readOnly; editorOpen.value = true; - await loadConfigDetail(Number(record.id || 0)); + await loadConfigDetail(record.id || 0); } function handleConfigPageChange(page: number, pageSize: number) { @@ -560,11 +560,11 @@ watch( watch( configList, (list) => { - const configIds = new Set(list.map((item) => Number(item.id || 0))); - if (snapshotQuery.configId && !configIds.has(Number(snapshotQuery.configId))) { + const configIds = new Set(list.map((item) => String(item.id || ''))); + if (snapshotQuery.configId && !configIds.has(String(snapshotQuery.configId))) { snapshotQuery.configId = undefined; } - if (rewardQuery.configId && !configIds.has(Number(rewardQuery.configId))) { + if (rewardQuery.configId && !configIds.has(String(rewardQuery.configId))) { rewardQuery.configId = undefined; } }, @@ -585,8 +585,8 @@ watch( show-search style="width: 180px" /> - 仅未来周可编辑 - + 当前周无配置可补建,已开始配置只读 + ) { halfCheckedKeys.value = event?.halfCheckedKeys || keys?.halfChecked || []; } +function collectMenuIdsWithAncestors(keys: Array) { + const idMap = new Map(); + const parentMap = new Map(); + + for (const item of menusList.value) { + const id = String(item.id); + const parentId = String(item.parentId || ''); + idMap.set(id, item.id); + if (parentId && parentId !== '0') { + parentMap.set(id, parentId); + } + } + + const result = new Set(); + const append = (key: number | string) => { + let current = String(key); + while (current) { + result.add(current); + current = parentMap.get(current) || ''; + } + }; + + keys.forEach(append); + return [...result].map((key) => idMap.get(key) ?? key); +} + async function handleSubmit() { loading.value = true; try { await updateRoleMenus({ id: props.roleId, - menuIds: [...new Set([...checkedKeys.value, ...halfCheckedKeys.value])], + menuIds: collectMenuIdsWithAncestors([ + ...checkedKeys.value, + ...halfCheckedKeys.value, + ]), }); message.success('保存成功'); emit('success');