wui-components-v2 1.1.41 → 1.1.42
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.
- package/api/feishu.ts +20 -0
- package/api/menu.ts +1 -1
- package/api/page.ts +1 -1
- package/api/sys.ts +1 -1
- package/components/add-address-list/add-address-list.vue +187 -0
- package/components/add-address-page/add-address-page.vue +76 -0
- package/components/add-address-page/config.ts +297 -0
- package/components/audio-play/audio-play.vue +3 -3
- package/components/card-botom-buttons/card-botom-buttons.vue +4 -3
- package/components/custom-date-picker/custom-date-picker.vue +114 -0
- package/components/custom-select-picker/custom-select-picker.vue +103 -0
- package/components/fold-card/fold-card.vue +16 -9
- package/components/form-control/form-control.vue +224 -143
- package/components/global-loading/global-loading.vue +1 -1
- package/components/global-message/global-message.vue +14 -10
- package/components/global-toast/global-toast.vue +1 -1
- package/components/list-top-buttons/list-top-buttons.vue +2 -2
- package/components/mulselect-picker/mulselect-picker.vue +2 -2
- package/components/privacy-popup/privacy-popup.vue +1 -1
- package/components/product-card/product-card.vue +2 -2
- package/components/search/search.vue +11 -6
- package/components/tab-search/tab-search.vue +7 -7
- package/components/user-choose/user-choose.vue +133 -0
- package/components/wui-default/wui-default.vue +1 -2
- package/components/wui-edit-page/wui-edit-page.vue +76 -53
- package/components/wui-enume-select-control/wui-enume-select-control.vue +35 -33
- package/components/wui-list/wui-list.vue +12 -8
- package/components/wui-login1/wui-login.vue +1 -1
- package/components/wui-menus1/components/banner-carousel.vue +8 -8
- package/components/wui-menus1/components/quick-panel.vue +1 -1
- package/components/wui-menus1/components/search-bar.vue +1 -1
- package/components/wui-menus1/components/section-menus.vue +1 -1
- package/components/wui-menus1/wui-menus.vue +6 -3
- package/components/wui-notify-info/notify-handle.vue +1 -1
- package/components/wui-notify-info/wui-notify-info.vue +7 -7
- package/components/wui-search-history-babbar/wui-search-history-babbar.vue +10 -10
- package/components/wui-select-list/wui-select-list.vue +48 -39
- package/components/wui-tabbar/wui-tabbar.vue +2 -2
- package/components/wui-tree-page/wui-tree-page.vue +9 -10
- package/components/wui-user/wui-user.vue +5 -5
- package/composables/types/theme.ts +1 -1
- package/composables/useCompanyFieldFilter.ts +59 -0
- package/composables/useEnumes.ts +36 -35
- package/composables/useGlobalLoading.ts +2 -2
- package/composables/useGlobalMessage.ts +7 -8
- package/composables/useGlobalToast.ts +2 -2
- package/composables/useLocale.ts +5 -5
- package/composables/useMenus.ts +1 -0
- package/composables/useTabbar.ts +2 -3
- package/index.d.ts +1 -1
- package/index.ts +2 -2
- package/package.json +1 -1
- package/store/language.ts +8 -11
- package/store/manualThemeStore.ts +2 -0
- package/store/persist.ts +1 -1
- package/type.ts +1 -0
- package/utils/control-type-supportor.ts +4 -0
- package/utils/index.ts +22 -0
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* 记得注释
|
|
9
9
|
*/
|
|
10
10
|
import { defineStore } from 'pinia'
|
|
11
|
-
import type { ToastOptions } from 'wot-
|
|
12
|
-
import { CommonUtil } from 'wot-
|
|
11
|
+
import type { ToastOptions } from '@wot-ui/ui/components/wd-toast/types'
|
|
12
|
+
import { CommonUtil } from '@wot-ui/ui'
|
|
13
13
|
import { getCurrentPath } from '../utils/index'
|
|
14
14
|
|
|
15
15
|
interface GlobalLoading {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
|
-
import
|
|
3
|
-
import { CommonUtil } from 'wot-design-uni'
|
|
2
|
+
import { CommonUtil } from '@wot-ui/ui'
|
|
4
3
|
import { getCurrentPath } from '../utils/index'
|
|
5
4
|
|
|
6
|
-
export type GlobalMessageOptions =
|
|
7
|
-
success?: (res:
|
|
8
|
-
fail?: (res:
|
|
5
|
+
export type GlobalMessageOptions = any & {
|
|
6
|
+
success?: (res: any) => void
|
|
7
|
+
fail?: (res: any) => void
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
interface GlobalMessage {
|
|
@@ -32,17 +31,17 @@ export const useGlobalMessage = defineStore('global-message', {
|
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
33
|
alert(option: GlobalMessageOptions | string) {
|
|
35
|
-
const messageOptions = CommonUtil.deepMerge({ type: 'alert' }, CommonUtil.isString(option) ? { title: option } : option) as
|
|
34
|
+
const messageOptions = CommonUtil.deepMerge({ type: 'alert' }, CommonUtil.isString(option) ? { title: option } : option) as any
|
|
36
35
|
messageOptions.showCancelButton = false
|
|
37
36
|
this.show(messageOptions)
|
|
38
37
|
},
|
|
39
38
|
confirm(option: GlobalMessageOptions | string) {
|
|
40
|
-
const messageOptions = CommonUtil.deepMerge({ type: 'confirm' }, CommonUtil.isString(option) ? { title: option } : option) as
|
|
39
|
+
const messageOptions = CommonUtil.deepMerge({ type: 'confirm' }, CommonUtil.isString(option) ? { title: option } : option) as any
|
|
41
40
|
messageOptions.showCancelButton = true
|
|
42
41
|
this.show(messageOptions)
|
|
43
42
|
},
|
|
44
43
|
prompt(option: GlobalMessageOptions | string) {
|
|
45
|
-
const messageOptions = CommonUtil.deepMerge({ type: 'prompt' }, CommonUtil.isString(option) ? { title: option } : option) as
|
|
44
|
+
const messageOptions = CommonUtil.deepMerge({ type: 'prompt' }, CommonUtil.isString(option) ? { title: option } : option) as any
|
|
46
45
|
messageOptions.showCancelButton = true
|
|
47
46
|
this.show(messageOptions)
|
|
48
47
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
|
-
import type { ToastOptions } from 'wot-
|
|
3
|
-
import { CommonUtil } from 'wot-
|
|
2
|
+
import type { ToastOptions } from '@wot-ui/ui/components/wd-toast/types'
|
|
3
|
+
import { CommonUtil } from '@wot-ui/ui'
|
|
4
4
|
import { getCurrentPath } from '../utils/index'
|
|
5
5
|
|
|
6
6
|
interface GlobalToast {
|
package/composables/useLocale.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed, onBeforeMount } from 'vue'
|
|
2
|
-
import { Locale } from 'wot-
|
|
2
|
+
import { Locale } from '@wot-ui/ui'
|
|
3
3
|
// 引入英文语言包
|
|
4
|
-
import enUS from 'wot-
|
|
4
|
+
import enUS from '@wot-ui/ui/locale/lang/en-US'
|
|
5
5
|
// 引入中文语言包
|
|
6
|
-
import zhCN from 'wot-
|
|
6
|
+
import zhCN from '@wot-ui/ui/locale/lang/zh-CN'
|
|
7
7
|
// 引入阿拉伯语语言包
|
|
8
|
-
import arSA from 'wot-
|
|
8
|
+
import arSA from '@wot-ui/ui/locale/lang/ar-SA'
|
|
9
9
|
import { useManualThemeStore } from '../store/manualThemeStore'
|
|
10
10
|
|
|
11
11
|
import { useLanguageStore } from '../store/language'
|
|
@@ -23,7 +23,7 @@ export function useLocale() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// 系统语言切换
|
|
26
|
-
function changeSystemLocale() {
|
|
26
|
+
function changeSystemLocale() {
|
|
27
27
|
switch (store.Locale.value) {
|
|
28
28
|
case 'en-US':
|
|
29
29
|
Locale.use('en-US', enUS)
|
package/composables/useMenus.ts
CHANGED
|
@@ -65,6 +65,7 @@ export function useMenus(props?: Props, pagingRef?: Ref<any>) {
|
|
|
65
65
|
console.log(item.pageType)
|
|
66
66
|
switch (item.pageType) {
|
|
67
67
|
case '列表':
|
|
68
|
+
console.log(item, 'item ')
|
|
68
69
|
router.push(`/pages/list/index?sourceId=${item.id}&title=${item.title}`)
|
|
69
70
|
return true
|
|
70
71
|
case '树':
|
package/composables/useTabbar.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed } from 'vue'
|
|
1
|
+
import { computed, ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
export interface TabbarItem {
|
|
4
4
|
name: string
|
|
@@ -9,9 +9,8 @@ export interface TabbarItem {
|
|
|
9
9
|
activeIcon?: string // 激活状态自定义图标路径
|
|
10
10
|
inactiveIcon?: string // 未激活状态自定义图标路径
|
|
11
11
|
}
|
|
12
|
-
// const tabbarItems: TabbarItem[] = uni.getStorageSync('TABBARITEMS')
|
|
13
12
|
export function useTabbar(tabbarItems: TabbarItem[]) {
|
|
14
|
-
const tabbarList =
|
|
13
|
+
const tabbarList = ref<TabbarItem[]>([...tabbarItems])
|
|
15
14
|
|
|
16
15
|
const activeTabbar = computed(() => {
|
|
17
16
|
const item = tabbarList.value.find(item => item.active)
|
package/index.d.ts
CHANGED
package/index.ts
CHANGED
|
@@ -45,7 +45,7 @@ const coms: Array<{ name: string }> = [
|
|
|
45
45
|
Wuilogin1,
|
|
46
46
|
WuiMenus1,
|
|
47
47
|
wuiSearchHistoryBabbar,
|
|
48
|
-
wuienumeSelectControl
|
|
48
|
+
wuienumeSelectControl,
|
|
49
49
|
]
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -74,7 +74,7 @@ export {
|
|
|
74
74
|
iData, // PAD扫描
|
|
75
75
|
// nfc, // nfc读取
|
|
76
76
|
useLanguageStore, // 语言
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export default install
|
package/package.json
CHANGED
package/store/language.ts
CHANGED
|
@@ -36,7 +36,7 @@ export const useLanguageStore = defineStore('language', () => {
|
|
|
36
36
|
|
|
37
37
|
const data: LanguagePackage = response.value
|
|
38
38
|
return data
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
catch (error) {
|
|
41
41
|
console.error(`Error loading language package for ${lang}:`, error)
|
|
42
42
|
// 返回空对象,避免程序崩溃
|
|
@@ -49,24 +49,21 @@ export const useLanguageStore = defineStore('language', () => {
|
|
|
49
49
|
*/
|
|
50
50
|
const loadLanguage = async (lang: string): Promise<void> => {
|
|
51
51
|
console.log(`网络加载语言 ${lang}...`)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// }
|
|
52
|
+
if (loadedLanguages.value.includes(lang)) {
|
|
53
|
+
currentLanguage.value = lang
|
|
54
|
+
return
|
|
55
|
+
}
|
|
57
56
|
|
|
58
57
|
loading.value = true
|
|
59
58
|
try {
|
|
60
59
|
const langPack = await loadLanguageFromNetwork(lang)
|
|
61
60
|
|
|
62
|
-
// 更新语言包数据
|
|
63
61
|
languagePackages.value[lang] = langPack
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
loadedLanguages.value.push(lang)
|
|
66
64
|
|
|
67
|
-
// 设置当前语言
|
|
68
65
|
currentLanguage.value = lang
|
|
69
|
-
}
|
|
66
|
+
}
|
|
70
67
|
finally {
|
|
71
68
|
loading.value = false
|
|
72
69
|
}
|
|
@@ -94,7 +91,7 @@ export const useLanguageStore = defineStore('language', () => {
|
|
|
94
91
|
if (!loadedLanguages.value.includes(lang)) {
|
|
95
92
|
loadedLanguages.value.push(lang)
|
|
96
93
|
}
|
|
97
|
-
}
|
|
94
|
+
}
|
|
98
95
|
else {
|
|
99
96
|
console.error(`Failed to preload language ${languages[index]}:`, result.reason)
|
|
100
97
|
}
|
|
@@ -24,6 +24,7 @@ export const useManualThemeStore = defineStore('manualTheme', {
|
|
|
24
24
|
darkColor2: '#e0e0e0',
|
|
25
25
|
darkColor3: '#a0a0a0',
|
|
26
26
|
colorTheme: themeColorOptions[0].primary,
|
|
27
|
+
colorPrimary: themeColorOptions[0].primary, // 添加主色调变量,用于 tabbar 等组件
|
|
27
28
|
},
|
|
28
29
|
}),
|
|
29
30
|
|
|
@@ -72,6 +73,7 @@ export const useManualThemeStore = defineStore('manualTheme', {
|
|
|
72
73
|
setCurrentThemeColor(color: ThemeColorOption) {
|
|
73
74
|
this.currentThemeColor = color
|
|
74
75
|
this.themeVars.colorTheme = color.primary
|
|
76
|
+
this.themeVars.colorPrimary = color.primary // 同步更新主色调变量
|
|
75
77
|
},
|
|
76
78
|
|
|
77
79
|
/**
|
package/store/persist.ts
CHANGED
package/type.ts
CHANGED
|
@@ -58,6 +58,7 @@ SupportInputTypes.add('float')
|
|
|
58
58
|
SupportInputTypes.add('double')
|
|
59
59
|
SupportInputTypes.add('int')
|
|
60
60
|
SupportInputTypes.add('relselect')
|
|
61
|
+
SupportInputTypes.add('relselect-extdis')
|
|
61
62
|
SupportInputTypes.add('relselectvalue')// 弃用
|
|
62
63
|
SupportInputTypes.add('entity-select-value')
|
|
63
64
|
SupportInputTypes.add('refselect')
|
|
@@ -113,6 +114,9 @@ ControlTypeSupportor.isSupport = function (type: string): boolean {
|
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
ControlTypeSupportor.getSupportControlType = function (fieldConfig: Fields): string {
|
|
117
|
+
if (!fieldConfig) {
|
|
118
|
+
return 'text'
|
|
119
|
+
}
|
|
116
120
|
if (this.isSupport(fieldConfig.extControlType)) {
|
|
117
121
|
return fieldConfig.extControlType
|
|
118
122
|
}
|
package/utils/index.ts
CHANGED
|
@@ -955,3 +955,25 @@ export class RainbowColorGenerator {
|
|
|
955
955
|
return this.lastColorHex
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
+
/**
|
|
959
|
+
* 格式化手机号
|
|
960
|
+
* @param phone 手机号字符串
|
|
961
|
+
* @param mask 隐藏码,默认为****
|
|
962
|
+
* @returns 格式化后的手机号字符串
|
|
963
|
+
*/
|
|
964
|
+
export function formatPhone(phone: string, mask = '****') {
|
|
965
|
+
if (!phone) return '';
|
|
966
|
+
|
|
967
|
+
const cleanPhone = phone.replace(/\D/g, '');
|
|
968
|
+
const len = cleanPhone.length;
|
|
969
|
+
|
|
970
|
+
// 根据号码长度决定显示方式
|
|
971
|
+
if (len === 11) {
|
|
972
|
+
return cleanPhone.slice(0, 3) + mask + cleanPhone.slice(-4);
|
|
973
|
+
} else if (len === 8) {
|
|
974
|
+
// 座机号码等短号码
|
|
975
|
+
return cleanPhone.slice(0, 2) + mask + cleanPhone.slice(-2);
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
return phone;
|
|
979
|
+
}
|