wui-components-v2 1.1.41 → 1.1.43

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 +132 -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
@@ -0,0 +1,114 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue'
3
+ import dayjs from 'dayjs/esm/index'
4
+
5
+ defineOptions({
6
+ name: 'CustomDatePicker',
7
+ })
8
+ const props = defineProps({
9
+ modelValue: String,
10
+ placeholder: String,
11
+ columns: {
12
+ type: Array as PropType<SelectOption[]>,
13
+ default: () => [],
14
+ },
15
+ labelKey: { type: String, default: 'label' },
16
+ valueKey: { type: String, default: 'value' },
17
+ type: { type: String, default: 'date' },
18
+ })
19
+
20
+ const emit = defineEmits<{
21
+ 'update:modelValue': [value: string | number]
22
+ }>()
23
+
24
+ interface SelectOption {
25
+ label: string
26
+ value: string | number
27
+ [key: string]: any
28
+ }
29
+
30
+ console.log(props.type, 'props.type')
31
+
32
+ const open = ref(false)
33
+ const currentValue = ref<any>(props.modelValue)
34
+ function clear() {
35
+ currentValue.value = ''
36
+ }
37
+
38
+ watch(
39
+ () => props.modelValue,
40
+ (val) => {
41
+ console.log(val, 'val1111')
42
+ currentValue.value = val
43
+ },
44
+ )
45
+
46
+ watch(currentValue, (val) => {
47
+ emit('update:modelValue', val)
48
+ })
49
+
50
+ const labelText = computed(() => {
51
+ const formatMap: {
52
+ date: string
53
+ datetime: string
54
+ [key: string]: string // 索引签名:允许任意字符串作为键
55
+ } = {
56
+ date: 'YYYY-MM-DD',
57
+ datetime: 'YYYY-MM-DD HH:mm',
58
+ }
59
+ if (['date', 'datetime'].includes(props.type)) {
60
+ return currentValue.value ? dayjs(currentValue.value).format(formatMap[props.type] as string) : ''
61
+ }
62
+ else {
63
+ return currentValue.value || ''
64
+ }
65
+ })
66
+ </script>
67
+
68
+ <template>
69
+ <div class="flex items-center justify-between">
70
+ <wd-input
71
+ v-model="labelText"
72
+ readonly
73
+ :placeholder="placeholder"
74
+ class="flex-1"
75
+ @click="open = true"
76
+ />
77
+ <wd-icon v-if="labelText" name="close-circle" size="16px" @click="clear" />
78
+ <wd-icon v-else name="right" size="16px" @click="clear" />
79
+ </div>
80
+
81
+ <wd-calendar
82
+ v-if="['date', 'datetime'].includes(type)"
83
+ v-model="currentValue"
84
+ v-model:visible="open"
85
+ label-key="label"
86
+ value-key="value"
87
+ class="custom-date-picker"
88
+ :type="type as any"
89
+ />
90
+ <wd-datetime-picker
91
+ v-else
92
+ v-model="currentValue"
93
+ v-model:visible="open"
94
+ label-key="label"
95
+ value-key="value"
96
+ class="custom-date-picker"
97
+ :type="type as any"
98
+ />
99
+ </template>
100
+
101
+ <style scoped lang="scss">
102
+ .custom-date-picker {
103
+ width: 100%;
104
+ :deep(.wd-calendar__wrapper) {
105
+ padding : 0 20px;
106
+ overflow: auto;
107
+ scrollbar-width: none;
108
+ -ms-overflow-style: none;
109
+ }
110
+ :deep(.uni-scroll-view) {
111
+ scrollbar-width: none;
112
+ }
113
+ }
114
+ </style>
@@ -0,0 +1,103 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue'
3
+
4
+ defineOptions({
5
+ name: 'CustomSelectPicker',
6
+ })
7
+ const props = defineProps({
8
+ modelValue: [String, Array],
9
+ placeholder: String,
10
+ columns: {
11
+ type: Array as PropType<SelectOption[]>,
12
+ default: () => [],
13
+ },
14
+ labelKey: { type: String, default: 'label' },
15
+ valueKey: { type: String, default: 'value' },
16
+ type: { type: String, default: 'radio' },
17
+ })
18
+
19
+ const emit = defineEmits<{
20
+ 'update:modelValue': [value: string | number]
21
+ }>()
22
+
23
+ interface SelectOption {
24
+ label: string
25
+ value: string | number
26
+ [key: string]: any
27
+ }
28
+
29
+ const open = ref(false)
30
+ const currentValue = ref<any>(props.modelValue)
31
+ function clear() {
32
+ currentValue.value = ''
33
+ }
34
+
35
+ watch(
36
+ () => props.modelValue,
37
+ (val) => {
38
+ console.log('val', val, Array.isArray(val))
39
+ currentValue.value = val
40
+ },
41
+ )
42
+
43
+ watch(currentValue, (val) => {
44
+ emit('update:modelValue', val)
45
+ })
46
+
47
+ const labelText = computed(() => {
48
+ // 多选情况:currentValue 是数组
49
+ if (Array.isArray(currentValue.value)) {
50
+ const labels = currentValue.value.map((val) => {
51
+ const item = props.columns.find(
52
+ item => item[props.valueKey] === val,
53
+ )
54
+ return item ? item[props.labelKey] : ''
55
+ }).filter(Boolean)
56
+ return labels.join(', ')
57
+ }
58
+ // 单选情况:currentValue 是单个值
59
+ const item = props.columns.find(
60
+ item => item[props.valueKey] === currentValue.value,
61
+ )
62
+ return item ? item[props.labelKey] : ''
63
+ })
64
+ </script>
65
+
66
+ <template>
67
+ <div class="flex items-center justify-between">
68
+ <wd-input
69
+ v-model="labelText"
70
+ readonly
71
+ :placeholder="placeholder"
72
+ class="flex-1"
73
+ @click="open = true"
74
+ />
75
+ <wd-icon v-if="labelText" name="close-circle" size="16px" @click="clear" />
76
+ <wd-icon v-else name="right" size="16px" @click="clear" />
77
+ </div>
78
+
79
+ <wd-select-picker
80
+ v-model="currentValue"
81
+ v-model:visible="open"
82
+ :columns="columns"
83
+ label-key="label"
84
+ value-key="value"
85
+ class="custom-select-picker"
86
+ :type="type as any"
87
+ />
88
+ </template>
89
+
90
+ <style scoped lang="scss">
91
+ .custom-select-picker {
92
+ width: 100%;
93
+ :deep(.wd-select-picker__wrapper) {
94
+ padding : 0 20px;
95
+ overflow: auto;
96
+ scrollbar-width: none;
97
+ -ms-overflow-style: none;
98
+ }
99
+ :deep(.uni-scroll-view) {
100
+ scrollbar-width: none;
101
+ }
102
+ }
103
+ </style>
@@ -86,12 +86,20 @@ function toggleCollapse(contentId: string) {
86
86
  <view class="ma-2 overflow-hidden rounded-xl bg-white shadow-sm dark:bg-[var(--wot-dark-background2)]">
87
87
  <!-- 订单头部 -->
88
88
  <view v-if="props.primaryColumn" class="flex items-center justify-between border-b border-gray-100 p-4">
89
- <view class="flex items-center gap-1 text-base text-gray-800 font-medium dark:text-white">
90
- <slot name="select" />
91
- <view class="mr-1 h-4 w-1 rounded-2xl" :style="{ backgroundColor: currentThemeColor.primary }" />
92
- <view class="w-50 overflow-hidden text-ellipsis whitespace-nowrap font-700">
89
+ <view class="flex items-center gap-4 text-base text-gray-800 font-medium dark:text-white">
90
+ <view class="flex items-center gap-1">
91
+ <slot name="select" />
92
+ <view class="mr-1 h-4 w-1 rounded-2xl" :style="{ backgroundColor: currentThemeColor.primary }" />
93
+ </view>
94
+ <view>
95
+ <view class=" flex items-center gap-2">
96
+ <view class=" overflow-hidden text-ellipsis whitespace-nowrap font-700">
93
97
  {{ formatItemData(data.fieldMap[props.primaryColumn.sourceId], props.primaryColumn.extControlType || props.primaryColumn.controlType) }}
94
98
  </view>
99
+ <slot name="addressInfo" />
100
+ </view>
101
+ <slot name="detailAddress" />
102
+ </view>
95
103
  </view>
96
104
  <view
97
105
  v-if="props.labelColumn"
@@ -127,12 +135,11 @@ function toggleCollapse(contentId: string) {
127
135
  <view class="flex items-center justify-between border-t border-gray-100">
128
136
  <!-- 折叠按钮 -->
129
137
  <view>
130
- <wd-button
131
- v-if="showCollapse"
132
- id="toggle-btn-2"
133
- type="icon"
138
+ <wd-icon
139
+ v-if="showCollapse" id="toggle-btn-2" name="down"
140
+ size="24px"
134
141
  :icon="collapseIcon"
135
- class="mr-auto flex items-center px-3 py-2 text-sm text-blue-600"
142
+ class="mr-auto flex items-center px-3 py-2 text-sm text-[#6b7280] !py-1"
136
143
  @click.stop="toggleCollapse(data.code)"
137
144
  />
138
145
  </view>