feat(header): 搜索框改居中命令面板,应用列表数据与 loading 与 AppList 共享
- header.scss: 删旧 .search-box 与 fade1/search-animation/icon-animation 动画段,
新增 app-cmdk-* 面板样式。样式段必须放顶层——面板 Teleport 到 body,嵌进
.default-header 会生成后代选择器而匹配不到
- Header.vue: 搜索 li 收敛为单图标 + openSearch;模板末尾追加 <Teleport to="body">
命令面板,支持实时过滤 / ↑↓ 键盘导航 / Enter 打开 / Esc 关闭 / 空结果态;
删 watch(isSearching) 与空函数 showSeachBox;挂/卸 window keydown
- store/index.ts: 新增 appListLoading 字段与 setAppListLoading
- utils/bschLinkPage.ts: 抽出 openAppPage(app, ifameAppIdArr),与点击应用图标同一路径
- AppList.vue: reloadAppData 写 store(数据 + loading,try/finally);
linkPage(item) 委托 openAppPage
硬约束保持不动:watch(searchAppText) -> mittBus.emit("searchChange")(背景应用网格靠它过滤)、
isSearchIconShow(route.name === "apps")。
This commit is contained in:
@@ -12,6 +12,8 @@ export interface IdefaultStore {
|
||||
curUserSettingInfo: UserSettingInfo;
|
||||
curUserMenuList: Array<any>; //当前角色菜单
|
||||
curUserAppList: Array<any>; //当前角色所有应用
|
||||
/** 应用列表加载态(AppList 拉取时写入,Header 命令面板共享同一状态;2026-10-08) */
|
||||
appListLoading: boolean;
|
||||
curRoleUid: string | null; //当前角色uid
|
||||
/** 未读消息数(msgCenter/summary 拉取 + WS newMessage 实时累加;Header 角标与 /msg 页左栏同源) */
|
||||
unreadCount: number;
|
||||
@@ -53,6 +55,7 @@ export const useDefaultStore = defineStore("defaultStore", {
|
||||
curUserMenuList: [],
|
||||
curRoleUid: null,
|
||||
unreadCount: 0,
|
||||
appListLoading: false,
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
@@ -74,6 +77,9 @@ export const useDefaultStore = defineStore("defaultStore", {
|
||||
setCurUserAppList(apps: any[]) {
|
||||
this.curUserAppList = apps;
|
||||
},
|
||||
setAppListLoading(v: boolean) {
|
||||
this.appListLoading = v;
|
||||
},
|
||||
setCurUserMenuList(menus: any[]) {
|
||||
this.curUserMenuList = menus;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user