所有页面没有数据时显示内容修改
This commit is contained in:
@@ -22,7 +22,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
const token = ref('');
|
||||
|
||||
const userInfo: Api.Auth.UserInfo = reactive({
|
||||
userId: '',
|
||||
user_id: 0,
|
||||
username: '',
|
||||
roles: [],
|
||||
buttons: []
|
||||
@@ -56,12 +56,12 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
|
||||
/** Record the user ID of the previous login session Used to compare with the current user ID on next login */
|
||||
function recordUserId() {
|
||||
if (!userInfo.userId) {
|
||||
if (!userInfo.user_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Store current user ID locally for next login comparison
|
||||
localStg.set('lastLoginUserId', userInfo.userId);
|
||||
localStg.set('lastLoginUserId', String(userInfo.user_id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,14 +70,14 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
* @returns {boolean} Whether to clear all tabs
|
||||
*/
|
||||
function checkTabClear(): boolean {
|
||||
if (!userInfo.userId) {
|
||||
if (!userInfo.user_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const lastLoginUserId = localStg.get('lastLoginUserId');
|
||||
|
||||
// Clear all tabs if current user is different from previous user
|
||||
if (!lastLoginUserId || lastLoginUserId !== userInfo.userId) {
|
||||
if (!lastLoginUserId || lastLoginUserId !== String(userInfo.user_id)) {
|
||||
localStg.remove('globalTabs');
|
||||
tabStore.clearTabs();
|
||||
|
||||
@@ -155,7 +155,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
|
||||
// 同步 AI 插件用户身份(exchange 换 ai_token 用)
|
||||
setAiUser({
|
||||
platform_user_id: String(info.userId),
|
||||
platform_user_id: String(info.user_id),
|
||||
align_key: info.username,
|
||||
display_name: info.username
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ declare namespace Api {
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
userId: string;
|
||||
user_id: number;
|
||||
username: string;
|
||||
roles: string[];
|
||||
buttons: string[];
|
||||
|
||||
@@ -527,7 +527,9 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="rounded-lg border border-dashed bg-white py-12 text-center text-sm text-slate-400">当前筛选条件下暂无变更记录</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-3">
|
||||
<NPagination
|
||||
|
||||
@@ -295,6 +295,9 @@ onMounted(() => {
|
||||
<div class="h-full rounded-full" :style="{ width: `${(a.avg_days / a.total) * 100}%`, background: a.avg_days > 2 ? themeStore.otherColor.error : themeStore.themeColor }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="deptStatistics?.approver_time?.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
|
||||
@@ -214,7 +214,7 @@ onMounted(async () => {
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div v-if="list.length" class="space-y-3 px-4 pb-3">
|
||||
<div v-for="(s, i) in list" :key="`${s.cid ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-3 rounded-lg border px-4 py-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
@@ -345,7 +345,9 @@ onMounted(async () => {
|
||||
<NButton ghost size="small" class="text-xs" @click="jumpTo(s)">查看变更</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="viewAnalysis(s)">查看分析记录</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">当前筛选条件下无新增高风险场景</div>
|
||||
</div>
|
||||
<div v-else class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-3 px-4 py-2 border-t">
|
||||
|
||||
@@ -286,10 +286,7 @@ onMounted(() => {
|
||||
</span>
|
||||
</div>
|
||||
<div class="space-y-2 scroll">
|
||||
<div class="flex flex-col gap-3">
|
||||
<div v-if="list.length===0" class="text-center text-slate-400">
|
||||
暂无数据
|
||||
</div>
|
||||
<div v-if="list.length" class="flex flex-col gap-3">
|
||||
<div
|
||||
class="border border-slate-200 p-4"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@@ -430,6 +427,9 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 进度弹框 -->
|
||||
<NDrawer v-model:show="progressDrawer" :width="502" placement="right">
|
||||
|
||||
@@ -197,7 +197,9 @@ onMounted(() => {
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="text-xs text-slate-400 text-center border rounded-md py-5">暂无数据</div>
|
||||
<div v-else class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-3">
|
||||
<NPagination
|
||||
|
||||
@@ -161,7 +161,9 @@ onMounted(() => {
|
||||
<div class="h-full rounded-full" :class="e.avg_days > hourToDay(homeData?.my_stats?.sign_timely_hours || 0) ? 'bg-[var(--error-color)]' : 'bg-[var(--theme-color)]'" :style="{ width: `${Math.min(100, (e.avg_days / e.total) * 100)}%` }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="homeData?.approver_time?.length===0" class="text-xs text-slate-400 text-center py-3">暂无数据</p>
|
||||
<div v-if="homeData?.approver_time?.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 flex items-center justify-between text-xs">
|
||||
<span class="text-slate-600">考核目标</span>
|
||||
@@ -208,7 +210,9 @@ onMounted(() => {
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">更多高风险场景与分析记录见「高风险」页</p>
|
||||
</div>
|
||||
<p v-else class="text-center text-xs text-slate-400">暂无高风险在办</p>
|
||||
<div v-else class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
|
||||
@@ -214,7 +214,11 @@ onMounted(() => {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="homeData?.approver_eff?.rows?.length===0">
|
||||
<td colspan="4" class="text-center text-xs text-slate-400 py-3">暂无数据</td>
|
||||
<td colspan="4">
|
||||
<div class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-for="r in homeData?.approver_eff?.rows || []" :key="r.p" class="border-b last:border-0">
|
||||
<td class="py-2">
|
||||
@@ -296,6 +300,9 @@ onMounted(() => {
|
||||
<NButton size="small" class="text-[11px]" @click="jumpTo('details_index',r.change_id)">查看</NButton>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="homeData?.accept_detail?.length===0" class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -440,6 +447,9 @@ onMounted(() => {
|
||||
<span class="w-12 shrink-0 text-right text-xs font-bold text-slate-800">{{ e.days }} 天</span>
|
||||
</NProgress>
|
||||
</div>
|
||||
<div v-if="homeData?.dept_approval_days?.length===0" class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
@@ -536,7 +546,9 @@ onMounted(() => {
|
||||
<span class="w-12 shrink-0 text-right text-xs font-bold text-slate-800">{{ r.count }} 起</span>
|
||||
</NProgress>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">可用于申请端填报质量改进:TOP2 理由已纳入 AI 预识别检查项</div>
|
||||
<div v-if="!homeData?.reject?.reasons || homeData?.reject?.reasons?.length===0" class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
|
||||
@@ -239,6 +239,9 @@ onMounted(() => {
|
||||
<NTag size="small" type="error">超期 {{ o.overdue_days }} 天</NTag>
|
||||
<NButton size="small" ghost class="text-xs" :disabled="btnLoading" @click="handleReminder(o.change_id)">催办</NButton>
|
||||
</div>
|
||||
<div v-if="homeData?.overdue_list?.length===0" class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
|
||||
@@ -161,7 +161,9 @@ onMounted(() => {
|
||||
<div class="h-full rounded-full" :class="e.avg_days > hourToDay(homeData?.my_stats?.sign_timely_hours || 0) ? 'bg-[var(--error-color)]' : 'bg-[var(--theme-color)]'" :style="{ width: `${Math.min(100, (e.avg_days / e.total) * 100)}%` }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="homeData?.approver_time?.length===0" class="text-xs text-slate-400 text-center py-3">暂无数据</p>
|
||||
<div v-if="homeData?.approver_time?.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 flex items-center justify-between text-xs">
|
||||
<span class="text-slate-600">考核目标</span>
|
||||
@@ -208,7 +210,9 @@ onMounted(() => {
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">更多高风险场景与分析记录见「高风险」页</p>
|
||||
</div>
|
||||
<p v-else class="text-center text-xs text-slate-400">暂无高风险在办</p>
|
||||
<div v-else class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
|
||||
@@ -308,7 +308,11 @@ onMounted(() => {
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="homeData?.invest?.items?.length===0">
|
||||
<td colspan="6" class="text-center text-xs !text-slate-400">暂无数据</td>
|
||||
<td colspan="6">
|
||||
<div class="h-100% flex items-center justify-center py-3">
|
||||
<NEmpty description="暂无数据" class="!text-xs"></NEmpty>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-for="row in homeData?.invest?.items || []" :key="row.change_id">
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user