fix: hide likei displays in admin

This commit is contained in:
hy 2026-04-22 17:06:02 +08:00
parent 44531d62bb
commit 32c4e70187
38 changed files with 269 additions and 113 deletions

View File

@ -5,7 +5,10 @@ import { useAccessStore } from '@vben/stores';
import { Input, Select } from 'antdv-next';
import { getAllowedSysOrigins } from '#/views/system/shared';
import {
getAllowedSysOrigins,
getDisplayableSysOriginOptions,
} from '#/views/system/shared';
import SysOriginSelect from '#/components/sys-origin-select.vue';
type AccountSelectType = 'LONG' | 'SHORT';
@ -44,9 +47,12 @@ const sysOriginType = ref('');
const sysOriginOptions = computed(() =>
getAllowedSysOrigins(accessStore.accessCodes || []),
);
const displaySysOriginOptions = computed(() =>
getDisplayableSysOriginOptions(sysOriginOptions.value),
);
const showSysOriginTypeSelect = computed(
() => !props.sysOrigin && sysOriginOptions.value.length > 0,
() => !props.sysOrigin && displaySysOriginOptions.value.length > 0,
);
const sysOriginVal = computed(() => props.sysOrigin || sysOriginType.value);
@ -192,7 +198,7 @@ watch(
v-if="showSysOriginTypeSelect && selectType !== 'LONG'"
v-model:value="sysOriginType"
class="account-input__origin"
:options="sysOriginOptions"
:options="displaySysOriginOptions"
@change="handleSysOriginTypeChange"
/>
</div>

View File

@ -1,7 +1,12 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { SYS_ORIGIN_OPTIONS } from '#/views/system/shared';
import {
SYS_ORIGIN_OPTIONS,
getDisplaySysOriginText,
getDisplayableSysOriginOptions,
isHiddenSysOrigin,
} from '#/views/system/shared';
import SysOriginIcon from './sys-origin-icon.vue';
@ -16,15 +21,18 @@ const props = withDefaults(
},
);
const optionMap = new Map(SYS_ORIGIN_OPTIONS.map((item) => [item.value, item]));
const optionMap = new Map(
getDisplayableSysOriginOptions(SYS_ORIGIN_OPTIONS).map((item) => [item.value, item]),
);
const hidden = computed(() => isHiddenSysOrigin(props.value));
const option = computed(() => optionMap.get(String(props.value || '')));
const label = computed(() => option.value?.label || String(props.value || '-'));
const iconCode = computed(() => option.value?.icon || String(props.value || ''));
const label = computed(() => option.value?.label || getDisplaySysOriginText(props.value));
const iconCode = computed(() => option.value?.icon || getDisplaySysOriginText(props.value));
</script>
<template>
<span class="sys-origin-label">
<span v-if="!hidden && label" class="sys-origin-label">
<SysOriginIcon :code="iconCode" :label="label" :size="size" />
<span class="sys-origin-label__text">{{ label }}</span>
</span>

View File

@ -7,7 +7,9 @@ import { Select } from 'antdv-next';
import {
SYS_ORIGIN_OPTIONS,
getAllowedSysOrigins,
getDisplayableSysOriginOptions,
getDisplayableSysOrigins,
isHiddenSysOrigin,
} from '#/views/system/shared';
import SysOriginIcon from './sys-origin-icon.vue';
@ -40,27 +42,36 @@ const attrs = useAttrs();
const accessStore = useAccessStore();
const fallbackOptions = computed(() => {
const options = getAllowedSysOrigins(accessStore.accessCodes || []);
return (options.length > 0 ? options : SYS_ORIGIN_OPTIONS) as AppOriginOption[];
const options = getDisplayableSysOrigins(accessStore.accessCodes || []);
return (options.length > 0 ? options : getDisplayableSysOriginOptions(SYS_ORIGIN_OPTIONS)) as AppOriginOption[];
});
const normalizedOptions = computed(() =>
(props.options?.length ? props.options : fallbackOptions.value).map((item) => {
const value = String(item.value ?? '');
const label = String(item.label ?? ('name' in item ? item.name : '') ?? value);
return {
...item,
icon: String(item.icon || value).toLowerCase(),
label: label || value,
value,
};
}),
getDisplayableSysOriginOptions(props.options?.length ? props.options : fallbackOptions.value).map(
(item) => {
const value = String(item.value ?? '');
const label = String(item.label ?? ('name' in item ? item.name : '') ?? value);
return {
...item,
icon: String(item.icon || value).toLowerCase(),
label: label || value,
value,
};
},
),
);
const optionMap = computed(
() => new Map(normalizedOptions.value.map((item) => [String(item.value), item])),
);
const displayValue = computed<SelectValue>(() => {
if (Array.isArray(props.value)) {
return props.value.filter((item) => !isHiddenSysOrigin(item));
}
return isHiddenSysOrigin(props.value) ? undefined : props.value;
});
const selectAttrs = computed(() => {
const nextAttrs = { ...attrs } as Record<string, any>;
delete nextAttrs.options;
@ -75,7 +86,7 @@ const selectAttrs = computed(() => {
});
function renderContent(option?: Record<string, any> | null) {
if (!option) {
if (!option || isHiddenSysOrigin(option.value ?? option.label ?? option.name)) {
return null;
}
const label = String(option.label || option.name || option.value || '-');
@ -109,6 +120,9 @@ function renderOption(option: Record<string, any>) {
}
function renderLabel(item: Record<string, any>) {
if (isHiddenSysOrigin(item?.value ?? item?.label)) {
return null;
}
return renderContent(
resolveOption(item) || {
icon: item?.value,
@ -127,7 +141,7 @@ function handleChange(value: SelectValue, option: any) {
<template>
<Select
v-bind="selectAttrs"
:value="value"
:value="displayValue"
:options="normalizedOptions"
option-filter-prop="label"
option-label-prop="label"

View File

@ -0,0 +1,17 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { Tag } from 'antdv-next';
import { getDisplaySysOriginText } from '#/views/system/shared';
const props = defineProps<{
value?: unknown;
}>();
const text = computed(() => getDisplaySysOriginText(props.value));
</script>
<template>
<Tag v-if="text">{{ text }}</Tag>
</template>

View File

@ -3,7 +3,10 @@ import { computed, reactive, ref, watch } from 'vue';
import type { LegacyVersionItem } from '#/api/legacy/app-system';
import { addAppVersion, updateAppVersion } from '#/api/legacy/app-system';
import { PLATFORM_ORIGINS } from '#/views/system/shared';
import {
PLATFORM_ORIGINS,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
Form,
@ -45,9 +48,16 @@ const form = reactive<Record<string, any>>({
});
const isAdd = computed(() => !props.updateData);
const title = computed(() =>
isAdd.value ? `添加(${props.sysOrigin || '-'})` : `修改(${props.updateData?.sysOrigin || '-'})`,
);
const title = computed(() => {
const sysOrigin = getDisplaySysOriginText(
isAdd.value ? props.sysOrigin : props.updateData?.sysOrigin,
);
return sysOrigin
? `${isAdd.value ? '添加' : '修改'}(${sysOrigin})`
: isAdd.value
? '添加'
: '修改';
});
const selectedPlatform = computed(
() => PLATFORM_ORIGINS.find((item) => item.value === form.platform) || null,

View File

@ -16,7 +16,11 @@ import {
} from '#/api/legacy/oss';
import InlineFilterField from '#/views/_shared/inline-filter-field.vue';
import InlineFilterToolbar from '#/views/_shared/inline-filter-toolbar.vue';
import { formatDate, getAllowedSysOrigins } from '#/views/system/shared';
import {
formatDate,
getAllowedSysOrigins,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
Button,
@ -279,7 +283,7 @@ loadData(true);
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
{{ record.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.sysOrigin) }}
</template>
<template v-else-if="column.key === 'cover'">
<img

View File

@ -18,6 +18,7 @@ import {
getAccessImgUrl,
simpleUploadFile,
} from '#/api/legacy/oss';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import InlineFilterField from '#/views/_shared/inline-filter-field.vue';
import InlineFilterToolbar from '#/views/_shared/inline-filter-toolbar.vue';
import {
@ -37,7 +38,6 @@ import {
SelectOption,
Switch,
Table,
Tag,
message,
} from 'antdv-next';
@ -356,7 +356,7 @@ loadData(true);
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'sourceType'">
{{ getSourceTypeName(record.sourceType as number | string) }}

View File

@ -2,7 +2,7 @@
import { computed, ref, watch } from 'vue';
import { getRoomProfileDetailsByRoomId } from '#/api/legacy/app-system';
import { formatDate } from '#/views/system/shared';
import { formatDate, getDisplaySysOriginText } from '#/views/system/shared';
import {
Card,
@ -129,7 +129,7 @@ watch(
{{ roomDetails.del ? 'Yes' : 'NO' }}
</DescriptionsItem>
<DescriptionsItem label="平台">
{{ userProfile.sysOriginChild || userProfile.originSys || '-' }}
{{ getDisplaySysOriginText(userProfile.sysOriginChild || userProfile.originSys) }}
</DescriptionsItem>
<DescriptionsItem label="公告">
{{ roomDetails.roomDesc || '-' }}

View File

@ -4,6 +4,7 @@ import { computed, reactive, ref, watch } from 'vue';
import { saveOrUpdateSpecialId } from '#/api/legacy/app-system';
import { getUserBaseInfoBySysOriginAccount } from '#/api/legacy/user';
import AccountInput from '#/components/account-input.vue';
import { getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -173,7 +174,7 @@ async function handleSubmit() {
>
<Form :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" layout="horizontal">
<FormItem label="系统">
<div class="readonly-value">{{ sysOrigin }}</div>
<div class="readonly-value">{{ getDisplaySysOriginText(sysOrigin) }}</div>
</FormItem>
<FormItem label="用户">
<AccountInput

View File

@ -21,6 +21,7 @@ import {
updateSpecialIdExpiredTime,
} from '#/api/legacy/app-system';
import AccountInput from '#/components/account-input.vue';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import InlineFilterField from '#/views/_shared/inline-filter-field.vue';
import InlineFilterToolbar from '#/views/_shared/inline-filter-toolbar.vue';
import { formatDate,
@ -36,7 +37,6 @@ import {
Table,
Tabs,
TabPane,
Tag,
message,
} from 'antdv-next';
@ -398,7 +398,7 @@ loadLogData(true);
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ getSpecialInfo(record).sysOrigin || '-' }}</Tag>
<SysOriginTag :value="getSpecialInfo(record).sysOrigin" />
</template>
<template v-else-if="column.key === 'user'">
<button class="user-cell" type="button" @click="openUserDetails(record)">
@ -509,7 +509,7 @@ loadLogData(true);
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'user'">
<button class="user-cell" type="button" @click="openUserDetails(record as any)">

View File

@ -11,6 +11,8 @@ import SysOriginSelect from '#/components/sys-origin-select.vue';
import InlineFilterField from '#/views/_shared/inline-filter-field.vue';
import InlineFilterToolbar from '#/views/_shared/inline-filter-toolbar.vue';
import { getAllowedSysOrigins } from '#/views/system/shared';
import { getDisplaySysOriginText, getDisplayableSysOrigins } from '#/views/system/shared';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import {
Button,
@ -79,6 +81,9 @@ const sysOriginOptions = computed(() => {
const options = getAllowedSysOrigins(accessStore.accessCodes || []);
return options.length > 0 ? options : SYS_ORIGIN_OPTIONS;
});
const displaySysOriginOptions = computed(() =>
getDisplayableSysOrigins(accessStore.accessCodes || []),
);
const currentPage = computed<
ApprovalGalleryPage | ApprovalHistoryPage | ApprovalTablePage | null
@ -435,6 +440,9 @@ async function handleBulkAction(action: {
}
function renderCellText(cell: ApprovalTableCell) {
if (cell.type === 'origin') {
return getDisplaySysOriginText(cell.text);
}
return cell.text || '-';
}
@ -502,6 +510,7 @@ function isAccountFilter(filter: ApprovalFilter) {
<InlineFilterToolbar>
<template v-for="filter in currentPage?.filters || []" :key="`${filter.type}-${filter.field || filter.label}`">
<InlineFilterField
v-if="filter.type !== 'sysOrigin' || displaySysOriginOptions.length > 0"
:control-width="getFilterControlWidth(filter)"
:label="filter.label"
:label-width="getFilterLabelWidth(filter)"
@ -730,7 +739,7 @@ function isAccountFilter(filter: ApprovalFilter) {
</template>
<template v-else-if="cell.type === 'origin'">
<Tag>{{ renderCellText(cell) }}</Tag>
<SysOriginTag :value="cell.text" />
</template>
<template v-else-if="cell.type === 'images'">

View File

@ -16,6 +16,7 @@ import {
userDynamicTable,
} from '#/api/legacy/dynamic';
import AccountInput from '#/components/account-input.vue';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
@ -370,7 +371,7 @@ loadData(true);
<div class="top-form">
<div class="top-row">
<span>平台</span>
<Tag>{{ query.sysOrigin }}</Tag>
<SysOriginTag :value="query.sysOrigin" />
</div>
<div class="top-row top-input">
<span>权重</span>

View File

@ -8,6 +8,7 @@ import {
activityPicture,
deleteActivityPicture,
} from '#/api/legacy/activity';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { getAllowedSysOrigins } from '#/views/system/shared';
import {
@ -17,7 +18,6 @@ import {
Modal,
Pagination,
Table,
Tag,
message,
} from 'antdv-next';
@ -133,7 +133,7 @@ async function handleCopy(id?: number | string) {
<Page title="活动配置">
<Card>
<div class="toolbar">
<Tag>{{ query.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="query.sysOrigin" />
<Button :loading="loading" type="primary" @click="handleSearch">
搜索
</Button>
@ -149,7 +149,7 @@ async function handleCopy(id?: number | string) {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'picture'">
<Image :src="record.picture" class="picture" />

View File

@ -14,7 +14,7 @@ import {
updateBadge,
} from '#/api/legacy/badge';
import AccountInput from '#/components/account-input.vue';
import { formatDate } from '#/views/system/shared';
import { formatDate, getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -326,7 +326,9 @@ watch(
class="picture-item"
>
<Image :src="item.selectUrl" class="badge-image" />
<div>{{ item.sysOrigin }}</div>
<div v-if="getDisplaySysOriginText(item.sysOrigin)">
{{ getDisplaySysOriginText(item.sysOrigin) }}
</div>
</div>
</div>
</template>

View File

@ -13,6 +13,7 @@ import {
userBeautifulNumberApplyTable,
} from '#/api/legacy/user';
import AccountInput from '#/components/account-input.vue';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
@ -174,7 +175,7 @@ watch(
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'userBaseInfo'">
<UserProfileLink :profile="record.userBaseInfo" />

View File

@ -10,6 +10,7 @@ import {
addActivityPicture,
updateActivityPicture,
} from '#/api/legacy/activity';
import { getDisplaySysOriginText } from '#/views/system/shared';
import { Button, Image, Input, Modal, message } from 'antdv-next';
@ -105,7 +106,13 @@ async function submitForm() {
:confirm-loading="saving"
:open="open"
destroy-on-close
:title="form.id ? `修改(${sysOrigin})` : `新增(${sysOrigin})`"
:title="
getDisplaySysOriginText(sysOrigin)
? `${form.id ? '修改' : '新增'}(${getDisplaySysOriginText(sysOrigin)})`
: form.id
? '修改'
: '新增'
"
width="520px"
@cancel="emit('close')"
@ok="submitForm"

View File

@ -10,7 +10,10 @@ import {
getAccessImgUrl,
simpleUploadFile,
} from '#/api/legacy/oss';
import { getAllowedSysOrigins } from '#/views/system/shared';
import {
getAllowedSysOrigins,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
Button,
@ -48,6 +51,11 @@ const imageInputRef = ref<HTMLInputElement | null>(null);
const sourceInputRef = ref<HTMLInputElement | null>(null);
const uploadTarget = ref<{ field: UploadField; index: number } | null>(null);
function getCardTitle(sysOrigin: unknown) {
const text = getDisplaySysOriginText(sysOrigin);
return text ? `${text} 徽章资源` : '徽章资源';
}
function buildRows(row?: Record<string, any> | null) {
const pictureMap = new Map<string, Record<string, any>>();
(row?.badgePictures || []).forEach((item: Record<string, any>) => {
@ -151,7 +159,7 @@ async function handleRemove(row: Record<string, any>, field: UploadField) {
v-for="item in list"
:key="item.sysOrigin"
size="small"
:title="`${item.sysOrigin} 徽章资源`"
:title="getCardTitle(item.sysOrigin)"
>
<div class="row">
<div class="field">

View File

@ -13,6 +13,7 @@ import {
updateBanner,
} from '#/api/legacy/system';
import AccountInput from '#/components/account-input.vue';
import { getDisplaySysOriginText } from '#/views/system/shared';
import {
AutoComplete,
@ -324,7 +325,13 @@ async function submitForm() {
:confirm-loading="saving"
:open="open"
destroy-on-close
:title="`${form.id ? '修改' : '新增'}(${sysOrigin})`"
:title="
getDisplaySysOriginText(sysOrigin)
? `${form.id ? '修改' : '新增'}(${getDisplaySysOriginText(sysOrigin)})`
: form.id
? '修改'
: '新增'
"
width="760px"
@cancel="emit('close')"
@ok="submitForm"

View File

@ -7,6 +7,7 @@ import {
simpleUploadFile,
} from '#/api/legacy/oss';
import { addMikeType, updateMikeType } from '#/api/legacy/mike';
import { getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -80,9 +81,10 @@ const form = reactive<Record<string, any>>({
sysOrigin: '',
});
const title = computed(() =>
`${form.id ? '修改' : '新增'}(${props.sysOrigin || form.sysOrigin || '-'})`,
);
const title = computed(() => {
const sysOrigin = getDisplaySysOriginText(props.sysOrigin || form.sysOrigin);
return sysOrigin ? `${form.id ? '修改' : '新增'}(${sysOrigin})` : form.id ? '修改' : '新增';
});
watch(
() => props.open,

View File

@ -2,7 +2,7 @@
import { computed, ref, watch } from 'vue';
import { getInAppPurchase } from '#/api/legacy/operate';
import { formatDate } from '#/views/system/shared';
import { formatDate, getDisplaySysOriginText } from '#/views/system/shared';
import {
Descriptions,
@ -99,7 +99,9 @@ watch(
<DescriptionsItem label="跟踪ID">{{ record?.details?.trackId || '-' }}</DescriptionsItem>
<DescriptionsItem label="订阅ID">{{ record?.details?.subscribeId || '-' }}</DescriptionsItem>
<DescriptionsItem label="订单ID" :span="2">{{ record?.details?.orderId || '-' }}</DescriptionsItem>
<DescriptionsItem label="系统">{{ record?.details?.sysOrigin || '-' }}</DescriptionsItem>
<DescriptionsItem v-if="getDisplaySysOriginText(record?.details?.sysOrigin)" label="系统">
{{ getDisplaySysOriginText(record?.details?.sysOrigin) }}
</DescriptionsItem>
<DescriptionsItem label="平台">{{ record?.details?.factory?.platform || '-' }}</DescriptionsItem>
<DescriptionsItem label="渠道">{{ record?.details?.factory?.factoryCode || '-' }}</DescriptionsItem>
<DescriptionsItem label="国家编号">{{ record?.details?.countryCode || '-' }}</DescriptionsItem>

View File

@ -6,6 +6,8 @@ import {
getRoomProfileBySysOriginAccount,
listRoomProfileByAccount,
} from '#/api/legacy/room';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -13,7 +15,6 @@ import {
Input,
Modal,
Select,
Tag,
} from 'antdv-next';
type RoomSelectType = 'LONG_ID' | 'SHORT_ID';
@ -52,6 +53,10 @@ const matchedRoom = ref<Record<string, any> | null>(null);
const roomProfiles = ref<Array<Record<string, any>>>([]);
const selectDialogOpen = ref(false);
function getVisibleSysOrigin(value: unknown) {
return getDisplaySysOriginText(value);
}
watch(
() => props.roomId,
(value) => {
@ -177,7 +182,9 @@ async function clickSearch() {
</div>
<div v-else-if="matchedRoom" class="search-tip search-tip--success">
已匹配: {{ matchedRoom.roomName || matchedRoom.id || '-' }}
<span v-if="matchedRoom.sysOrigin"> / {{ matchedRoom.sysOrigin }}</span>
<span v-if="getVisibleSysOrigin(matchedRoom.sysOrigin)">
/ {{ getVisibleSysOrigin(matchedRoom.sysOrigin) }}
</span>
</div>
<Modal
@ -199,7 +206,7 @@ async function clickSearch() {
/>
<div class="room-copy">
<div class="room-title-row">
<Tag v-if="item.sysOrigin">{{ item.sysOrigin }}</Tag>
<SysOriginTag :value="item.sysOrigin" />
<span class="room-name">{{ item.roomName || '-' }}</span>
</div>
<div class="room-meta">房间ID {{ item.id || '-' }}</div>

View File

@ -5,6 +5,7 @@ import { Button, Input, Modal, message } from 'antdv-next';
import { createBankBalance } from '#/api/legacy/operate';
import AccountInput from '#/components/account-input.vue';
import { getDisplaySysOriginText } from '#/views/system/shared';
const props = defineProps<{
open: boolean;
@ -68,7 +69,7 @@ async function submitForm() {
<div class="form-grid">
<div class="field">
<div class="label">系统</div>
<div class="value">{{ sysOrigin || '-' }}</div>
<div class="value">{{ getDisplaySysOriginText(sysOrigin) }}</div>
</div>
<div class="field">
<div class="label">用户ID</div>

View File

@ -9,7 +9,11 @@ import {
pageDaysUserData,
} from '#/api/legacy/game';
import AccountInput from '#/components/account-input.vue';
import { formatDate, getAllowedSysOrigins } from '#/views/system/shared';
import {
formatDate,
getAllowedSysOrigins,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
Button,
@ -256,7 +260,7 @@ function handleTableChange(_: any, __: any, sorter: any) {
<UserProfileLink :user-profile="record.userProfile" />
</template>
<template v-else-if="column.key === 'sysOrigin'">
{{ record.userProfile?.originSys || record.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.userProfile?.originSys || record.sysOrigin) }}
</template>
<template v-else-if="column.key === 'earningsRate'">
{{ record.earningsRate || 0 }} %

View File

@ -15,7 +15,8 @@ import { useAccessStore } from '@vben/stores';
import { getClsGoldRunningWater } from '#/api/legacy/operate';
import AccountInput from '#/components/account-input.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
getAllowedSysOrigins,
getDisplaySysOriginText } from '#/views/system/shared';
import {
AutoComplete,
@ -287,7 +288,7 @@ void loadData(true);
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
{{ record.runningWater?.sysOrigin || record.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.runningWater?.sysOrigin || record.sysOrigin) }}
</template>
<template v-else-if="column.key === 'userProfile'">
<UserProfileLink

View File

@ -15,7 +15,11 @@ import {
setLuckyDrawRatio,
setPoolPutRatio,
} from '#/api/legacy/game';
import { formatDate, getAllowedSysOrigins } from '#/views/system/shared';
import {
formatDate,
getAllowedSysOrigins,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
Button,
@ -268,7 +272,9 @@ loadData(true);
<Card size="small" title="抽奖情况">
<Descriptions :column="2" bordered size="small">
<DescriptionsItem label="ID">{{ activeRow.id || '-' }}</DescriptionsItem>
<DescriptionsItem label="系统">{{ activeRow.sysOrigin || '-' }}</DescriptionsItem>
<DescriptionsItem v-if="getDisplaySysOriginText(activeRow.sysOrigin)" label="系统">
{{ getDisplaySysOriginText(activeRow.sysOrigin) }}
</DescriptionsItem>
<DescriptionsItem label="门票">{{ activeRow.tickets || 0 }}</DescriptionsItem>
<DescriptionsItem label="抽奖数">{{ activeRow.lotterySize || 0 }}</DescriptionsItem>
<DescriptionsItem label="礼物价值">{{ activeRow.giftTotalAmount || 0 }}</DescriptionsItem>

View File

@ -14,7 +14,8 @@ import {
standardConfigTable,
} from '#/api/legacy/game-lucky-gift';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
getAllowedSysOrigins,
getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -66,6 +67,10 @@ const columns = [
{ dataIndex: 'createTime', key: 'createTime', title: '创建时间', width: 180 },
{ dataIndex: 'actions', key: 'actions', title: '操作', width: 220 },
];
const editTitle = computed(() => {
const sysOrigin = getDisplaySysOriginText(form.id ? form.sysOrigin : query.sysOrigin);
return sysOrigin ? `${form.id ? '修改' : '添加'}(${sysOrigin})` : form.id ? '修改' : '添加';
});
watch(
sysOriginOptions,
@ -220,7 +225,7 @@ function handlePageChange(page: number, pageSize: number) {
<Modal
:confirm-loading="saving"
:open="editOpen"
:title="form.id ? `修改(${form.sysOrigin || '-'})` : `添加(${query.sysOrigin || '-'})`"
:title="editTitle"
@cancel="editOpen = false"
@ok="handleSave"
>

View File

@ -13,7 +13,8 @@ import {
flowLudoGame,
} from '#/api/legacy/game';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
getAllowedSysOrigins,
getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -259,7 +260,7 @@ function openPlayers(record: Record<string, any>) {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
{{ record.history?.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.history?.sysOrigin) }}
</template>
<template v-else-if="column.key === 'roomInfo'">
<div v-if="record.roomProfile" class="room-info">

View File

@ -21,6 +21,7 @@ import {
PRODUCT_SHOWCASE_OPTIONS,
formatDate,
getAllowedSysOrigins,
getDisplaySysOriginText,
} from '#/views/system/shared';
import {
@ -315,7 +316,7 @@ async function handleShelfChange(record: Record<string, any>, checked: boolean)
<Image :src="record.cover" class="cover" />
</template>
<template v-else-if="column.key === 'sysOrigin'">
{{ record.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.sysOrigin) }}
</template>
<template v-else-if="column.key === 'type'">
{{ NOTICE_TYPE_LABELS[record.type] || record.type || '-' }}

View File

@ -15,6 +15,7 @@ import {
} from '#/api/legacy/operate';
import { regionConfigTable } from '#/api/legacy/system';
import AccountInput from '#/components/account-input.vue';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
@ -254,7 +255,7 @@ void loadData(true);
</template>
<template v-else-if="column.key === 'platform'">
<Space size="small">
<Tag>{{ record.details?.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.details?.sysOrigin" />
<Tag>{{ record.details?.factory?.platform || '-' }}</Tag>
<Tag>{{ record.details?.factory?.factoryCode || '-' }}</Tag>
</Space>

View File

@ -12,7 +12,8 @@ import { useAccessStore } from '@vben/stores';
import { getPurchaseTable } from '#/api/legacy/operate';
import AccountInput from '#/components/account-input.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
getAllowedSysOrigins,
getDisplaySysOriginText } from '#/views/system/shared';
import {
Button,
@ -191,7 +192,7 @@ void loadData(true);
</Tag>
</template>
<template v-else-if="column.key === 'sysOrigin'">
{{ record.orderPurchase?.sysOrigin || '-' }}
{{ getDisplaySysOriginText(record.orderPurchase?.sysOrigin) }}
</template>
<template v-else-if="column.key === 'userBaseInfo'">
<Button type="link" @click="openUserDetails(record)">

View File

@ -12,6 +12,7 @@ import {
deleteStartPagePlan,
pageStartPagePlans,
} from '#/api/legacy/system';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import { formatDate,
getAllowedSysOrigins } from '#/views/system/shared';
@ -23,7 +24,6 @@ import {
Pagination,
Select,
Table,
Tag,
message
} from 'antdv-next';
@ -180,7 +180,7 @@ function handleDelete(record: Record<string, any>) {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'type'">
{{ getTypeName(record.type) }}

View File

@ -14,6 +14,7 @@ import {
deleteBanner,
regionConfigTable,
} from '#/api/legacy/system';
import SysOriginTag from '#/components/sys-origin-tag.vue';
import {
formatDate,
getAllowedSysOrigins,
@ -263,7 +264,7 @@ function getStatusColor(record: Record<string, any>) {
<Image :preview="false" :src="record.alertCover" class="small-cover" />
</template>
<template v-else-if="column.key === 'sysOrigin'">
<Tag>{{ record.sysOrigin || '-' }}</Tag>
<SysOriginTag :value="record.sysOrigin" />
</template>
<template v-else-if="column.key === 'content'">
<Popover placement="topLeft" trigger="hover">

View File

@ -21,6 +21,7 @@ import {
Switch,
message,
} from 'antdv-next';
import { getDisplaySysOriginText } from '#/views/system/shared';
import RewardIcon from './reward-icon.vue';
import {
@ -101,9 +102,10 @@ const sourceOptionsMap = reactive<
const selectedDraftResource = ref<DraftSourceOption | null>(null);
const title = computed(() =>
`${form.id ? '修改' : '添加'}${props.sysOrigin || form.sysOrigin || '-'}`,
);
const title = computed(() => {
const sysOrigin = getDisplaySysOriginText(props.sysOrigin || form.sysOrigin);
return sysOrigin ? `${form.id ? '修改' : '添加'}${sysOrigin}` : form.id ? '修改' : '添加';
});
const rewardItems = computed(() => form.rewardConfigList);
const sourceSelectOptions = computed<DraftSourceOption[]>(

View File

@ -1,10 +1,7 @@
<script lang="ts" setup>
import { onBeforeUnmount, onMounted, reactive } from 'vue';
import {
purchaseTodayTotal,
purchaseTodayTotalBySysOrigin,
} from '#/api/legacy/operate';
import { purchaseTodayTotal } from '#/api/legacy/operate';
defineOptions({ name: 'StatisticsDatavPurchaseCount' });
@ -18,7 +15,6 @@ const props = withDefaults(
);
const summary = reactive({
likeiTotal: 0,
total: 0,
});
@ -36,19 +32,11 @@ function formatValue(value: number) {
}
async function loadData() {
const [totalResult, likeiResult] = await Promise.allSettled([
purchaseTodayTotal(),
purchaseTodayTotalBySysOrigin('LIKEI'),
]);
summary.total =
totalResult.status === 'fulfilled'
? normalizeNumber(totalResult.value)
: 0;
summary.likeiTotal =
likeiResult.status === 'fulfilled'
? normalizeNumber(likeiResult.value)
: 0;
try {
summary.total = normalizeNumber(await purchaseTodayTotal());
} catch {
summary.total = 0;
}
}
onMounted(() => {
@ -71,10 +59,6 @@ onBeforeUnmount(() => {
<div class="stat-card__label">总额</div>
<div class="stat-card__value">{{ formatValue(summary.total) }}</div>
</div>
<div class="stat-card">
<div class="stat-card__label">LIKEI</div>
<div class="stat-card__value">{{ formatValue(summary.likeiTotal) }}</div>
</div>
</div>
</template>
@ -82,7 +66,7 @@ onBeforeUnmount(() => {
.stat-grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-columns: minmax(0, 1fr);
}
.stat-card {

View File

@ -7,7 +7,6 @@ import { useAccessStore } from '@vben/stores';
import { getAllowedSysOrigins } from '#/views/system/shared';
import LatestPurchaseList from './components/latest-purchase-list.vue';
import OnlineUserCountOrigin from './components/online-user-count-origin.vue';
import PurchaseCount from './components/purchase-count.vue';
defineOptions({ name: 'StatisticsDatav' });
@ -94,13 +93,6 @@ onBeforeUnmount(() => {
<PurchaseCount />
</div>
</section>
<section class="col-info">
<div class="title">Likei在线</div>
<div class="content">
<OnlineUserCountOrigin origin="LIKEI" />
</div>
</section>
</div>
</div>
</div>

View File

@ -23,6 +23,7 @@ import {
BANK_CARD_TYPES,
formatDate,
getAllowedSysOrigins,
getDisplaySysOriginText,
REGION_ASSIST_TYPES,
} from '#/views/system/shared';
@ -756,7 +757,11 @@ loadCountryOptions();
<Drawer
:open="regionDrawerOpen"
:title="`${regionDrawerTitle}${regionQuery.sysOrigin}`"
:title="
getDisplaySysOriginText(regionQuery.sysOrigin)
? `${regionDrawerTitle}${getDisplaySysOriginText(regionQuery.sysOrigin)}`
: regionDrawerTitle
"
destroy-on-close
width="620"
@close="regionDrawerOpen = false"
@ -897,7 +902,11 @@ loadCountryOptions();
<Drawer
:open="assistDrawerOpen"
:title="`${assistDrawerTitle}${assistQuery.sysOrigin}`"
:title="
getDisplaySysOriginText(assistQuery.sysOrigin)
? `${assistDrawerTitle}${getDisplaySysOriginText(assistQuery.sysOrigin)}`
: assistDrawerTitle
"
destroy-on-close
width="580"
@close="assistDrawerOpen = false"

View File

@ -18,6 +18,37 @@ export const SYS_ORIGIN_OPTIONS: SysOriginOption[] = [
},
];
const HIDDEN_SYS_ORIGINS = new Set(['LIKEI']);
export function normalizeSysOrigin(value: unknown) {
return String(value ?? '')
.trim()
.toUpperCase();
}
export function isHiddenSysOrigin(value: unknown) {
const normalized = normalizeSysOrigin(value);
return normalized ? HIDDEN_SYS_ORIGINS.has(normalized) : false;
}
export function getDisplaySysOriginText(value: unknown, fallback = '') {
if (isHiddenSysOrigin(value)) {
return fallback;
}
const text = String(value ?? '').trim();
return text || fallback;
}
export function getDisplayableSysOriginOptions<T extends { value?: unknown }>(
options: T[],
) {
return options.filter((item) => !isHiddenSysOrigin(item.value));
}
export function getDisplayableSysOrigins(accessCodes: string[] = []) {
return getDisplayableSysOriginOptions(getAllowedSysOrigins(accessCodes));
}
export const REGION_ASSIST_TYPES = [
{
name: '房间贡献活动奖励比例(%)',

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { nextTick, onBeforeUnmount, ref, watch } from 'vue';
import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue';
import { useSortable } from '@vben/hooks';
@ -33,6 +33,7 @@ import {
getTeamPolicyRewardSummary,
type TeamPolicyRewardDetailType,
} from '../policy-shared';
import { getDisplaySysOriginText } from '#/views/system/shared';
defineOptions({ name: 'TeamPolicyRewardEditor' });
@ -56,6 +57,15 @@ const optionMap = ref<Record<string, Array<Record<string, any>>>>({});
let sortableInstance: any = null;
const drawerTitle = computed(() => {
const sysOrigin = getDisplaySysOriginText(props.sysOrigin);
return sysOrigin
? `${props.allowEdit ? '编辑' : '查看'}(${sysOrigin})`
: props.allowEdit
? '编辑'
: '查看';
});
function isCurrency(type?: string) {
return type === 'DIAMOND' || type === 'GOLD';
}
@ -374,7 +384,7 @@ onBeforeUnmount(() => {
<template>
<Drawer
:open="open"
:title="`${allowEdit ? '编辑' : '查看'}(${sysOrigin || '-'})`"
:title="drawerTitle"
destroy-on-close
width="960"
@close="emit('close')"