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.
Files changed (58) hide show
  1. package/api/feishu.ts +20 -0
  2. package/api/menu.ts +1 -1
  3. package/api/page.ts +1 -1
  4. package/api/sys.ts +1 -1
  5. package/components/add-address-list/add-address-list.vue +187 -0
  6. package/components/add-address-page/add-address-page.vue +76 -0
  7. package/components/add-address-page/config.ts +297 -0
  8. package/components/audio-play/audio-play.vue +3 -3
  9. package/components/card-botom-buttons/card-botom-buttons.vue +4 -3
  10. package/components/custom-date-picker/custom-date-picker.vue +114 -0
  11. package/components/custom-select-picker/custom-select-picker.vue +103 -0
  12. package/components/fold-card/fold-card.vue +16 -9
  13. package/components/form-control/form-control.vue +224 -143
  14. package/components/global-loading/global-loading.vue +1 -1
  15. package/components/global-message/global-message.vue +14 -10
  16. package/components/global-toast/global-toast.vue +1 -1
  17. package/components/list-top-buttons/list-top-buttons.vue +2 -2
  18. package/components/mulselect-picker/mulselect-picker.vue +2 -2
  19. package/components/privacy-popup/privacy-popup.vue +1 -1
  20. package/components/product-card/product-card.vue +2 -2
  21. package/components/search/search.vue +11 -6
  22. package/components/tab-search/tab-search.vue +7 -7
  23. package/components/user-choose/user-choose.vue +133 -0
  24. package/components/wui-default/wui-default.vue +1 -2
  25. package/components/wui-edit-page/wui-edit-page.vue +76 -53
  26. package/components/wui-enume-select-control/wui-enume-select-control.vue +35 -33
  27. package/components/wui-list/wui-list.vue +12 -8
  28. package/components/wui-login1/wui-login.vue +1 -1
  29. package/components/wui-menus1/components/banner-carousel.vue +8 -8
  30. package/components/wui-menus1/components/quick-panel.vue +1 -1
  31. package/components/wui-menus1/components/search-bar.vue +1 -1
  32. package/components/wui-menus1/components/section-menus.vue +1 -1
  33. package/components/wui-menus1/wui-menus.vue +6 -3
  34. package/components/wui-notify-info/notify-handle.vue +1 -1
  35. package/components/wui-notify-info/wui-notify-info.vue +7 -7
  36. package/components/wui-search-history-babbar/wui-search-history-babbar.vue +10 -10
  37. package/components/wui-select-list/wui-select-list.vue +48 -39
  38. package/components/wui-tabbar/wui-tabbar.vue +2 -2
  39. package/components/wui-tree-page/wui-tree-page.vue +9 -10
  40. package/components/wui-user/wui-user.vue +5 -5
  41. package/composables/types/theme.ts +1 -1
  42. package/composables/useCompanyFieldFilter.ts +59 -0
  43. package/composables/useEnumes.ts +36 -35
  44. package/composables/useGlobalLoading.ts +2 -2
  45. package/composables/useGlobalMessage.ts +7 -8
  46. package/composables/useGlobalToast.ts +2 -2
  47. package/composables/useLocale.ts +5 -5
  48. package/composables/useMenus.ts +1 -0
  49. package/composables/useTabbar.ts +2 -3
  50. package/index.d.ts +1 -1
  51. package/index.ts +2 -2
  52. package/package.json +1 -1
  53. package/store/language.ts +8 -11
  54. package/store/manualThemeStore.ts +2 -0
  55. package/store/persist.ts +1 -1
  56. package/type.ts +1 -0
  57. package/utils/control-type-supportor.ts +4 -0
  58. 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-design-uni/components/wd-toast/types'
12
- import { CommonUtil } from 'wot-design-uni'
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 type { MessageOptions, MessageResult } from 'wot-design-uni/components/wd-message-box/types'
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 = MessageOptions & {
7
- success?: (res: MessageResult) => void
8
- fail?: (res: MessageResult) => void
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 MessageOptions
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 MessageOptions
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 MessageOptions
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-design-uni/components/wd-toast/types'
3
- import { CommonUtil } from 'wot-design-uni'
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 {
@@ -1,11 +1,11 @@
1
1
  import { computed, onBeforeMount } from 'vue'
2
- import { Locale } from 'wot-design-uni'
2
+ import { Locale } from '@wot-ui/ui'
3
3
  // 引入英文语言包
4
- import enUS from 'wot-design-uni/locale/lang/en-US'
4
+ import enUS from '@wot-ui/ui/locale/lang/en-US'
5
5
  // 引入中文语言包
6
- import zhCN from 'wot-design-uni/locale/lang/zh-CN'
6
+ import zhCN from '@wot-ui/ui/locale/lang/zh-CN'
7
7
  // 引入阿拉伯语语言包
8
- import arSA from 'wot-design-uni/locale/lang/ar-SA'
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)
@@ -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 '树':
@@ -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 = computed(() => tabbarItems)
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
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import type { App } from 'vue'
6
- import type { ConfigProviderThemeVars } from 'wot-design-uni'
6
+ import type { ConfigProviderThemeVars } from '@wot-ui/ui'
7
7
 
8
8
  // 类型声明
9
9
  export interface ThemeColorOption {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",
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
- // if (loadedLanguages.value.includes(lang)) {
53
- // // 如果已加载过该语言,直接切换
54
- // currentLanguage.value = lang
55
- // return
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
- // loadedLanguages.value.push(lang)
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
@@ -8,7 +8,7 @@
8
8
  * 记得注释
9
9
  */
10
10
  import type { PiniaPluginContext } from 'pinia'
11
- import { CommonUtil } from 'wot-design-uni'
11
+ import { CommonUtil } from '@wot-ui/ui'
12
12
 
13
13
  function persist({ store }: PiniaPluginContext, excludedIds: string[]) {
14
14
  // 检查当前store的id是否在排除列表中
package/type.ts CHANGED
@@ -58,6 +58,7 @@ export interface Config extends Groups {
58
58
  mainPicture?: Columns
59
59
  defaultCriteriaValue?: { [key: string]: string }
60
60
  split2TabCriterias?: Split2TabCriterias[]
61
+ extShowConfig?: { [key: string]: any }
61
62
  }
62
63
 
63
64
  // 列表数据
@@ -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
+ }