style(order-delivery-reply): 新增导出excel,批次条可直接填写首批次回复
This commit is contained in:
1 parent
91a4bd538d
commit
8c97d5ed21
20 files changed
+902
-192
No files matched your search
@@ -1,6 +1,9 @@
|
||||
/**
|
||||
* shared/composables/useTheme.ts
|
||||
* 主题 preference 与 dark/light 切换(全局单例)。
|
||||
* 用途:主题 preference 与 dark/light 切换(单文档内全局单例)。
|
||||
* 逻辑:initTheme 读 localStorage + matchMedia 完成本文档初始化;同时监听 storage 事件做跨文档同步——
|
||||
* storage 事件只在「其他同源文档」触发,聊天壳父页面切换主题时,iframe 内嵌工作台页
|
||||
* (如订单交期回复 /apps/order-delivery-reply)无需刷新即可实时跟随变暗/变亮。
|
||||
*/
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
@@ -15,6 +18,7 @@ const systemPrefersDark = ref(false);
|
||||
|
||||
let initialized = false;
|
||||
let mediaListenerCleanup: (() => void) | null = null;
|
||||
let storageListenerCleanup: (() => void) | null = null;
|
||||
|
||||
const appliedTheme = computed<AppliedTheme>(() => {
|
||||
if (themePreference.value === 'system') {
|
||||
@@ -68,6 +72,19 @@ const initTheme = () => {
|
||||
media.addEventListener('change', onMediaChange);
|
||||
mediaListenerCleanup = () => media.removeEventListener('change', onMediaChange);
|
||||
|
||||
// 跨文档主题同步:本监听只在「被其他文档修改 localStorage」时触发(自身切换走 setThemePreference),
|
||||
// 使 iframe 等同源文档即时跟随父壳的亮暗切换。
|
||||
const onStorageChange = (event: StorageEvent) => {
|
||||
if (event.key !== THEME_KEY) return;
|
||||
const stored = parseTheme(event.newValue);
|
||||
if (stored) {
|
||||
themePreference.value = stored;
|
||||
applyTheme();
|
||||
}
|
||||
};
|
||||
window.addEventListener('storage', onStorageChange);
|
||||
storageListenerCleanup = () => window.removeEventListener('storage', onStorageChange);
|
||||
|
||||
const stored = parseTheme(localStorage.getItem(THEME_KEY));
|
||||
if (stored) {
|
||||
themePreference.value = stored;
|
||||
@@ -78,6 +95,8 @@ const initTheme = () => {
|
||||
const cleanupTheme = () => {
|
||||
mediaListenerCleanup?.();
|
||||
mediaListenerCleanup = null;
|
||||
storageListenerCleanup?.();
|
||||
storageListenerCleanup = null;
|
||||
initialized = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,4 +28,38 @@
|
||||
.divide-subtle > :not([hidden]) ~ :not([hidden]) {
|
||||
border-color: var(--border-subtle);
|
||||
}
|
||||
|
||||
/* 状态前景文字:badge 之外的行内强调(如「超量」标记、成功/告警说明) */
|
||||
.text-status-success { color: var(--status-success-fg); }
|
||||
.text-status-info { color: var(--status-info-fg); }
|
||||
.text-status-warning { color: var(--status-warning-fg); }
|
||||
.text-status-error { color: var(--status-error-fg); }
|
||||
|
||||
/* 表格行交互态:选中=info、直达定位高亮=warning,状态令牌亮暗自适应 */
|
||||
.bg-row-selected { background-color: var(--status-info-bg); }
|
||||
.bg-row-highlight { background-color: var(--status-warning-bg); }
|
||||
|
||||
/* 表格行悬停:无交互态的行悬停压暗;选中/高亮行保持状态色不被悬停覆盖 */
|
||||
.hover-row:hover:not(.bg-row-selected):not(.bg-row-highlight) {
|
||||
background-color: var(--bg-surface-soft);
|
||||
}
|
||||
|
||||
/* 表格冻结列单元格:必须实色基底(防透出横向滚动内容)。
|
||||
选中/高亮态用「实色底 + 状态色平铺叠加」——暗色状态令牌为半透明 rgba,
|
||||
直接当背景色会在横向滚动时透出下层内容。 */
|
||||
.frozen-cell { background-color: var(--bg-surface); }
|
||||
.hover-row:hover:not(.bg-row-selected):not(.bg-row-highlight) .frozen-cell {
|
||||
background-color: var(--bg-surface-soft);
|
||||
}
|
||||
.frozen-cell--selected {
|
||||
background-color: var(--bg-surface);
|
||||
background-image: linear-gradient(var(--status-info-bg), var(--status-info-bg));
|
||||
}
|
||||
.frozen-cell--highlight {
|
||||
background-color: var(--bg-surface);
|
||||
background-image: linear-gradient(var(--status-warning-bg), var(--status-warning-bg));
|
||||
}
|
||||
|
||||
/* 冻结列右缘分隔阴影(与 admin-table-sticky-right-cell 同型),亮暗共用 */
|
||||
.shadow-sticky-col { box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.12); }
|
||||
}
|
||||
Reference in new issue
Block a user