From cd8b52bdf89a4d1101f72e0ece9f4df22a3d3f7a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 16:03:32 +0800
Subject: [PATCH] feat(mdm): 物料列表隐藏辅单位与销售价列

---
 src/main.ts |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/src/main.ts b/src/main.ts
index e208cd2..e60e320 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,10 +1,12 @@
-import { initPreferences, preferencesManager } from './packages/preferences/src';
+import { watch } from 'vue';
+import { initPreferences, preferences, preferencesManager } from './packages/preferences/src';
 import { unmountGlobalLoading } from './packages/utils/src';
 
 import { overridesPreferences, preferencesExtension } from './preferences';
 
 declare const __APP_LOGO__: string;
 declare const __APP_FAVICON__: string;
+declare const __APP_NAME__: string;
 
 /**
  * 搴旂敤鍒濆鍖栧畬鎴愪箣鍚庡啀杩涜椤甸潰鍔犺浇娓叉煋
@@ -23,10 +25,39 @@
     overrides: overridesPreferences,
   });
 
+  // 棣栨鍗囩骇鍚屾鍝佺墝涓昏壊锛岄伩鍏嶆棫鐨勮摑鑹插亸濂介伄鐩栨湰娆′富棰樻洿鏂般��
+  // 鍗囩骇鍚庣敤鎴峰湪鍋忓ソ璁剧疆涓�夋嫨鐨勯鑹插拰鏄庢殫妯″紡浠嶄細淇濈暀銆�
+  document.documentElement.dataset.brandTheme = 'herbal';
+  const brandThemeKey = `${namespace}-herbal-theme-v1`;
+  try {
+    if (!localStorage.getItem(brandThemeKey)) {
+      preferencesManager.updatePreferences({
+        theme: { builtinType: 'custom', colorPrimary: '#a51d24' },
+      });
+      localStorage.setItem(brandThemeKey, '1');
+    }
+  } catch {
+    preferencesManager.updatePreferences({
+      theme: { builtinType: 'custom', colorPrimary: '#a51d24' },
+    });
+  }
+  watch(
+    () => preferences.theme.colorPrimary,
+    (color) => { document.documentElement.dataset.herbalPalette = String(color.toLowerCase() === '#a51d24'); },
+    { immediate: true, flush: 'sync' },
+  );
+
   // 寮哄埗瑕嗙洊鍏徃 logo 鍜� favicon锛岀粫杩� localStorage 缂撳瓨
   if (__APP_LOGO__) {
     preferencesManager.updatePreferences({ logo: { source: __APP_LOGO__ } });
   }
+  // 寮哄埗瑕嗙洊鍏徃鍚嶇О锛岀粫杩� localStorage 缂撳瓨
+  if (__APP_NAME__) {
+    preferencesManager.updatePreferences({
+      app: { name: __APP_NAME__ },
+      copyright: { companyName: __APP_NAME__ },
+    });
+  }
   if (__APP_FAVICON__) {
     const link = document.querySelector('link[rel="icon"]');
     if (link) {

--
Gitblit v1.9.3