feat(web): add Ant workspace tabs and harden page chrome
Persist workspace tabs in the app shell with Ant Design styling aligned to the desktop top bar, and fix tab bar layout flicker on select. Add shared PageHeader components, query helpers, and missing header state across CRM views; improve mobile shell layout and Vite HMR stability on Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -54,8 +54,8 @@ const currentInitial = computed(() => {
|
||||
|
||||
const canSwitch = computed(() => orgs.value.length > 1);
|
||||
const isWorkspace = computed(() => props.variant === 'workspace');
|
||||
/** در حالت workspace منو همیشه باز میشود؛ در حالت پیشفرض فقط وقتی بیش از یکی باشد */
|
||||
const menuEnabled = computed(() => isWorkspace.value || canSwitch.value);
|
||||
/** فقط وقتی بیش از یک محیط باشد نمایش و تعویض فعال است */
|
||||
const menuEnabled = computed(() => canSwitch.value);
|
||||
|
||||
function apiError(e: unknown, fallback: string) {
|
||||
if (axios.isAxiosError(e)) {
|
||||
@@ -163,20 +163,23 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="rootEl" class="org-switch" :class="{ 'org-ws': isWorkspace, compact }">
|
||||
<div
|
||||
v-if="canSwitch"
|
||||
ref="rootEl"
|
||||
class="org-switch"
|
||||
:class="{ 'org-ws': isWorkspace, compact }"
|
||||
>
|
||||
<button
|
||||
class="org-btn"
|
||||
:class="{
|
||||
compact,
|
||||
static: !menuEnabled,
|
||||
'org-ws': isWorkspace,
|
||||
open,
|
||||
}"
|
||||
type="button"
|
||||
:title="currentName"
|
||||
:aria-expanded="open"
|
||||
:aria-haspopup="menuEnabled ? 'listbox' : undefined"
|
||||
:aria-disabled="!menuEnabled"
|
||||
aria-haspopup="listbox"
|
||||
@click.stop="toggle"
|
||||
>
|
||||
<template v-if="isWorkspace">
|
||||
@@ -306,20 +309,24 @@ onUnmounted(() => {
|
||||
.org-btn.org-ws {
|
||||
align-items: center;
|
||||
gap: 0.7rem;
|
||||
padding: 0.45rem 0.55rem;
|
||||
border-radius: 16px;
|
||||
padding: 0.5rem 0.65rem;
|
||||
border-radius: 12px;
|
||||
border: 1px solid transparent;
|
||||
color: #0f172a;
|
||||
text-align: start;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.org-btn.org-ws:hover,
|
||||
.org-btn.org-ws.open {
|
||||
background: #f8fafc;
|
||||
background: #f3f4f6;
|
||||
border-color: #eef2f7;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.org-btn.org-ws.static:hover {
|
||||
background: #f8fafc;
|
||||
background: #f3f4f6;
|
||||
border-color: #eef2f7;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user