wui-components-v2 1.1.68 → 1.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/api/core/index.ts +74 -74
  2. package/api/menu.ts +45 -45
  3. package/api/page.ts +114 -114
  4. package/api/sys.ts +12 -12
  5. package/components/action-popup/action-popup.vue +46 -17
  6. package/components/add-address-page/add-address-page.vue +77 -77
  7. package/components/custom-date-picker/custom-date-picker.vue +106 -106
  8. package/components/custom-select-picker/custom-select-picker.vue +95 -95
  9. package/components/demo-block/demo-block.vue +63 -63
  10. package/components/detail-popup/detail-popup.vue +99 -99
  11. package/components/evaluation-page/evaluation-page.vue +196 -192
  12. package/components/fold-card/fold-card.vue +171 -171
  13. package/components/form-control/form-control.vue +661 -661
  14. package/components/global-message/global-message.vue +68 -68
  15. package/components/label-value/label-value.vue +144 -144
  16. package/components/list-top-buttons/list-top-buttons.vue +19 -19
  17. package/components/login-form/login-form.vue +126 -126
  18. package/components/mulselect-picker/mulselect-picker.vue +86 -86
  19. package/components/product-card/product-card.vue +201 -201
  20. package/components/search/search.vue +128 -128
  21. package/components/user-choose/user-choose.vue +1 -1
  22. package/components/wui-enume-select-control/wui-enume-select-control.vue +92 -92
  23. package/components/wui-list/wui-list.vue +235 -235
  24. package/components/wui-menus/wui-menus.vue +247 -247
  25. package/components/wui-menus1/components/navbar.vue +43 -43
  26. package/components/wui-menus1/wui-menus.vue +564 -564
  27. package/components/wui-notify-info/wui-notify-info.vue +280 -280
  28. package/components/wui-search-history-babbar/wui-search-history-babbar.vue +204 -204
  29. package/components/wui-select-list/wui-select-list.vue +310 -310
  30. package/components/wui-select-popup/wui-select-popup.vue +612 -612
  31. package/components/wui-system-settings/wui-system-settings.vue +144 -144
  32. package/components/wui-tabbar/wui-tabbar.vue +106 -106
  33. package/components/wui-tree-page/components/tree-item.vue +238 -238
  34. package/components/wui-user/wui-user.vue +202 -197
  35. package/composables/useCompanyFieldFilter.ts +91 -91
  36. package/composables/useEnumes.ts +2 -2
  37. package/composables/useMenus.ts +193 -193
  38. package/index.ts +83 -83
  39. package/package.json +1 -1
  40. package/static/iconfont/iconfont.css +63 -63
  41. package/store/language.ts +151 -151
  42. package/styles/dark-mode.css +523 -485
  43. package/styles/dark-mode.min.css +1 -1
  44. package/styles/dark-mode.scss +28 -0
  45. package/type.ts +2 -2
  46. package/utils/control-tree.ts +2 -2
  47. package/utils/control-type-supportor.ts +148 -148
@@ -1,63 +1,63 @@
1
- @font-face {
2
- font-family: "iconfont"; /* Project id 5037136 */
3
- src: url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.woff2?t=1779959533840') format('woff2'),
4
- url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.woff?t=1779959533840') format('woff'),
5
- url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.ttf?t=1779959533840') format('truetype');
6
- }
7
-
8
- .iconfont {
9
- font-family: "iconfont" !important;
10
- font-size: 16px;
11
- font-style: normal;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- .icon-tingchewei:before {
17
- content: "\e664";
18
- }
19
-
20
- .icon-quanxian:before {
21
- content: "\e63f";
22
- }
23
-
24
- .icon-gongwei:before {
25
- content: "\e641";
26
- }
27
-
28
- .icon-weixiu:before {
29
- content: "\e690";
30
- }
31
-
32
- .icon-bumen:before {
33
- content: "\e686";
34
- }
35
-
36
- .icon-shengchanjidi:before {
37
- content: "\e63b";
38
- }
39
-
40
- .icon-shouye:before {
41
- content: "\e63c";
42
- }
43
-
44
- .icon-renyuan:before {
45
- content: "\e66c";
46
- }
47
-
48
- .icon-apply:before {
49
- content: "\e61c";
50
- }
51
-
52
- .icon-changquguanli:before {
53
- content: "\e607";
54
- }
55
-
56
- .icon-kuaidi:before {
57
- content: "\e6c0";
58
- }
59
-
60
- .icon-menu:before {
61
- content: "\e677";
62
- }
63
-
1
+ @font-face {
2
+ font-family: "iconfont"; /* Project id 5037136 */
3
+ src: url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.woff2?t=1779959533840') format('woff2'),
4
+ url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.woff?t=1779959533840') format('woff'),
5
+ url('//at.alicdn.com/t/c/font_5037136_thr8wd358sl.ttf?t=1779959533840') format('truetype');
6
+ }
7
+
8
+ .iconfont {
9
+ font-family: "iconfont" !important;
10
+ font-size: 16px;
11
+ font-style: normal;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ .icon-tingchewei:before {
17
+ content: "\e664";
18
+ }
19
+
20
+ .icon-quanxian:before {
21
+ content: "\e63f";
22
+ }
23
+
24
+ .icon-gongwei:before {
25
+ content: "\e641";
26
+ }
27
+
28
+ .icon-weixiu:before {
29
+ content: "\e690";
30
+ }
31
+
32
+ .icon-bumen:before {
33
+ content: "\e686";
34
+ }
35
+
36
+ .icon-shengchanjidi:before {
37
+ content: "\e63b";
38
+ }
39
+
40
+ .icon-shouye:before {
41
+ content: "\e63c";
42
+ }
43
+
44
+ .icon-renyuan:before {
45
+ content: "\e66c";
46
+ }
47
+
48
+ .icon-apply:before {
49
+ content: "\e61c";
50
+ }
51
+
52
+ .icon-changquguanli:before {
53
+ content: "\e607";
54
+ }
55
+
56
+ .icon-kuaidi:before {
57
+ content: "\e6c0";
58
+ }
59
+
60
+ .icon-menu:before {
61
+ content: "\e677";
62
+ }
63
+
package/store/language.ts CHANGED
@@ -1,151 +1,151 @@
1
- // src/core-components/store/language.ts
2
- import { defineStore } from 'pinia'
3
- import { computed, ref } from 'vue'
4
- import { language } from '../api/sys'
5
- // 定义语言包类型
6
- type LanguagePackage = Record<string, string>
7
-
8
- export const useLanguageStore = defineStore('language', () => {
9
- // 响应式状态
10
- const currentLanguage = ref<string>('zh-CN') // 默认语言
11
- const languagePackages = ref<Record<string, LanguagePackage>>({})
12
- const loading = ref<boolean>(false)
13
- const loadedLanguages = ref<string[]>([])
14
-
15
- // 计算属性:当前语言包
16
- const currentLangPack = computed<LanguagePackage>(() => {
17
- return languagePackages.value[currentLanguage.value] || {}
18
- })
19
-
20
- // 计算属性:是否已加载当前语言
21
- const isCurrentLanguageLoaded = computed<boolean>(() => {
22
- return loadedLanguages.value.includes(currentLanguage.value)
23
- })
24
-
25
- /**
26
- * 从网络加载语言包
27
- */
28
- const loadLanguageFromNetwork = async (lang: string): Promise<LanguagePackage> => {
29
- try {
30
- // 调用API获取语言包,可根据实际API调整URL
31
- const response = await language(lang)
32
-
33
- if (response.status !== 'success') {
34
- throw new Error(`Failed to fetch language package: ${response.status} ${response.statusText}`)
35
- }
36
-
37
- const data: LanguagePackage = response.value
38
- return data
39
- }
40
- catch (error) {
41
- console.error(`Error loading language package for ${lang}:`, error)
42
- // 返回空对象,避免程序崩溃
43
- return {}
44
- }
45
- }
46
-
47
- /**
48
- * 加载并设置语言
49
- */
50
- const loadLanguage = async (lang: string): Promise<void> => {
51
- // console.log(`网络加载语言 ${lang}...`)
52
- if (loadedLanguages.value.includes(lang)) {
53
- currentLanguage.value = lang
54
- return
55
- }
56
-
57
- loading.value = true
58
- try {
59
- const langPack = await loadLanguageFromNetwork(lang)
60
-
61
- languagePackages.value[lang] = langPack
62
-
63
- loadedLanguages.value.push(lang)
64
-
65
- currentLanguage.value = lang
66
- }
67
- finally {
68
- loading.value = false
69
- }
70
- }
71
-
72
- /**
73
- * 翻译方法
74
- */
75
- const t = (key: string, fallback?: string): string => {
76
- const translation = currentLangPack.value[key]
77
- return translation ?? fallback ?? key
78
- }
79
-
80
- /**
81
- * 批量预加载语言包
82
- */
83
- const preloadLanguages = async (languages: string[]): Promise<void> => {
84
- const promises = languages.map(lang => loadLanguageFromNetwork(lang))
85
- const results = await Promise.allSettled(promises)
86
-
87
- results.forEach((result, index) => {
88
- if (result.status === 'fulfilled') {
89
- const lang = languages[index]
90
- languagePackages.value[lang] = result.value
91
- if (!loadedLanguages.value.includes(lang)) {
92
- loadedLanguages.value.push(lang)
93
- }
94
- }
95
- else {
96
- console.error(`Failed to preload language ${languages[index]}:`, result.reason)
97
- }
98
- })
99
- }
100
-
101
- /**
102
- * 切换语言
103
- */
104
- const switchLanguage = async (lang: string): Promise<void> => {
105
- if (currentLanguage.value !== lang) {
106
- await loadLanguage(lang)
107
- }
108
- }
109
-
110
- /**
111
- * 添加本地语言包(可用于离线或测试场景)
112
- */
113
- const addLocalLanguage = (lang: string, pack: LanguagePackage): void => {
114
- languagePackages.value[lang] = pack
115
- if (!loadedLanguages.value.includes(lang)) {
116
- loadedLanguages.value.push(lang)
117
- }
118
- }
119
-
120
- /**
121
- * 获取所有已加载的语言
122
- */
123
- const getLoadedLanguages = (): string[] => {
124
- return [...loadedLanguages.value]
125
- }
126
-
127
- /**
128
- * 获取当前语言
129
- */
130
- const getCurrentLanguage = (): string => {
131
- return currentLanguage.value
132
- }
133
-
134
- return {
135
- // 状态
136
- currentLanguage,
137
- loading,
138
- loadedLanguages,
139
- currentLangPack,
140
- isCurrentLanguageLoaded,
141
-
142
- // 方法
143
- loadLanguage,
144
- switchLanguage,
145
- t,
146
- preloadLanguages,
147
- addLocalLanguage,
148
- getLoadedLanguages,
149
- getCurrentLanguage,
150
- }
151
- })
1
+ // src/core-components/store/language.ts
2
+ import { defineStore } from 'pinia'
3
+ import { computed, ref } from 'vue'
4
+ import { language } from '../api/sys'
5
+ // 定义语言包类型
6
+ type LanguagePackage = Record<string, string>
7
+
8
+ export const useLanguageStore = defineStore('language', () => {
9
+ // 响应式状态
10
+ const currentLanguage = ref<string>('zh-CN') // 默认语言
11
+ const languagePackages = ref<Record<string, LanguagePackage>>({})
12
+ const loading = ref<boolean>(false)
13
+ const loadedLanguages = ref<string[]>([])
14
+
15
+ // 计算属性:当前语言包
16
+ const currentLangPack = computed<LanguagePackage>(() => {
17
+ return languagePackages.value[currentLanguage.value] || {}
18
+ })
19
+
20
+ // 计算属性:是否已加载当前语言
21
+ const isCurrentLanguageLoaded = computed<boolean>(() => {
22
+ return loadedLanguages.value.includes(currentLanguage.value)
23
+ })
24
+
25
+ /**
26
+ * 从网络加载语言包
27
+ */
28
+ const loadLanguageFromNetwork = async (lang: string): Promise<LanguagePackage> => {
29
+ try {
30
+ // 调用API获取语言包,可根据实际API调整URL
31
+ const response = await language(lang)
32
+
33
+ if (response.status !== 'success') {
34
+ throw new Error(`Failed to fetch language package: ${response.status} ${response.statusText}`)
35
+ }
36
+
37
+ const data: LanguagePackage = response.value
38
+ return data
39
+ }
40
+ catch (error) {
41
+ console.error(`Error loading language package for ${lang}:`, error)
42
+ // 返回空对象,避免程序崩溃
43
+ return {}
44
+ }
45
+ }
46
+
47
+ /**
48
+ * 加载并设置语言
49
+ */
50
+ const loadLanguage = async (lang: string): Promise<void> => {
51
+ // console.log(`网络加载语言 ${lang}...`)
52
+ if (loadedLanguages.value.includes(lang)) {
53
+ currentLanguage.value = lang
54
+ return
55
+ }
56
+
57
+ loading.value = true
58
+ try {
59
+ const langPack = await loadLanguageFromNetwork(lang)
60
+
61
+ languagePackages.value[lang] = langPack
62
+
63
+ loadedLanguages.value.push(lang)
64
+
65
+ currentLanguage.value = lang
66
+ }
67
+ finally {
68
+ loading.value = false
69
+ }
70
+ }
71
+
72
+ /**
73
+ * 翻译方法
74
+ */
75
+ const t = (key: string, fallback?: string): string => {
76
+ const translation = currentLangPack.value[key]
77
+ return translation ?? fallback ?? key
78
+ }
79
+
80
+ /**
81
+ * 批量预加载语言包
82
+ */
83
+ const preloadLanguages = async (languages: string[]): Promise<void> => {
84
+ const promises = languages.map(lang => loadLanguageFromNetwork(lang))
85
+ const results = await Promise.allSettled(promises)
86
+
87
+ results.forEach((result, index) => {
88
+ if (result.status === 'fulfilled') {
89
+ const lang = languages[index]
90
+ languagePackages.value[lang] = result.value
91
+ if (!loadedLanguages.value.includes(lang)) {
92
+ loadedLanguages.value.push(lang)
93
+ }
94
+ }
95
+ else {
96
+ console.error(`Failed to preload language ${languages[index]}:`, result.reason)
97
+ }
98
+ })
99
+ }
100
+
101
+ /**
102
+ * 切换语言
103
+ */
104
+ const switchLanguage = async (lang: string): Promise<void> => {
105
+ if (currentLanguage.value !== lang) {
106
+ await loadLanguage(lang)
107
+ }
108
+ }
109
+
110
+ /**
111
+ * 添加本地语言包(可用于离线或测试场景)
112
+ */
113
+ const addLocalLanguage = (lang: string, pack: LanguagePackage): void => {
114
+ languagePackages.value[lang] = pack
115
+ if (!loadedLanguages.value.includes(lang)) {
116
+ loadedLanguages.value.push(lang)
117
+ }
118
+ }
119
+
120
+ /**
121
+ * 获取所有已加载的语言
122
+ */
123
+ const getLoadedLanguages = (): string[] => {
124
+ return [...loadedLanguages.value]
125
+ }
126
+
127
+ /**
128
+ * 获取当前语言
129
+ */
130
+ const getCurrentLanguage = (): string => {
131
+ return currentLanguage.value
132
+ }
133
+
134
+ return {
135
+ // 状态
136
+ currentLanguage,
137
+ loading,
138
+ loadedLanguages,
139
+ currentLangPack,
140
+ isCurrentLanguageLoaded,
141
+
142
+ // 方法
143
+ loadLanguage,
144
+ switchLanguage,
145
+ t,
146
+ preloadLanguages,
147
+ addLocalLanguage,
148
+ getLoadedLanguages,
149
+ getCurrentLanguage,
150
+ }
151
+ })