wui-components-v2 1.1.70 → 1.1.71

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 (79) hide show
  1. package/api/feishu.ts +20 -20
  2. package/api/index.ts +4 -4
  3. package/api/login.ts +51 -51
  4. package/api/tree.ts +28 -28
  5. package/components/action-popup/action-popup.vue +116 -116
  6. package/components/add-address-list/add-address-list.vue +187 -187
  7. package/components/add-address-page/config.ts +297 -297
  8. package/components/audio-play/audio-play.vue +220 -220
  9. package/components/batch-upload-file/batch-upload-file.vue +75 -75
  10. package/components/card-botom-buttons/card-botom-buttons.vue +279 -279
  11. package/components/demo-card/demo-card.vue +44 -44
  12. package/components/fold-card/fold-card.vue +2 -2
  13. package/components/global-loading/GlobalLoading.md +366 -366
  14. package/components/global-loading/global-loading.vue +55 -55
  15. package/components/global-message/GlobalMessage.md +570 -570
  16. package/components/global-toast/GlobalToast.md +261 -261
  17. package/components/global-toast/global-toast.vue +56 -56
  18. package/components/label-value/open-value-more.vue +56 -56
  19. package/components/loading/loading.vue +5 -5
  20. package/components/login-form-box/login-form-box.vue +65 -65
  21. package/components/phone-login-form/phone-login-form.vue +204 -204
  22. package/components/privacy-popup/privacy-popup.vue +191 -191
  23. package/components/scan-input/scan-input.vue +406 -406
  24. package/components/select-col-picker/select-col-picker.vue +168 -168
  25. package/components/tab-search/tab-search.vue +73 -73
  26. package/components/tree-select/components/TreeNode.vue +200 -200
  27. package/components/tree-select/components/index.vue +471 -471
  28. package/components/tree-select/components/tree-select.vue +56 -56
  29. package/components/tree-select/index.vue +93 -93
  30. package/components/user-choose/user-choose.vue +169 -151
  31. package/components/video-play/video-play.vue +56 -56
  32. package/components/wui-auto-update-component/wui-auto-update-component.vue +132 -132
  33. package/components/wui-default/wui-default.vue +49 -49
  34. package/components/wui-details-page/wui-details-page.vue +147 -147
  35. package/components/wui-edit-page/wui-edit-page-copy.vue +757 -757
  36. package/components/wui-edit-page/wui-edit-page.vue +793 -793
  37. package/components/wui-login/wui-login.vue +43 -43
  38. package/components/wui-login1/wui-login.vue +41 -41
  39. package/components/wui-menus/wui-menus-top.vue +137 -137
  40. package/components/wui-menus/wui-menus-top1.vue +8 -8
  41. package/components/wui-menus1/components/banner-carousel.vue +320 -320
  42. package/components/wui-menus1/components/quick-panel.vue +55 -55
  43. package/components/wui-menus1/components/search-bar.vue +49 -49
  44. package/components/wui-menus1/components/section-menus.vue +208 -208
  45. package/components/wui-menus1/wui-menus-top.vue +718 -718
  46. package/components/wui-menus1/wui-menus-top1.vue +398 -398
  47. package/components/wui-notify-info/notify-handle.vue +53 -53
  48. package/components/wui-scan-binding-sensor/wui-scan-binding-sensor.vue +75 -75
  49. package/components/wui-search-history-babbar/components/SearchBar.vue +70 -70
  50. package/components/wui-select-popup/wui-select-popup.vue +1 -0
  51. package/components/wui-tree-page/wui-tree-page.vue +297 -297
  52. package/components/wui-update-component/wui-update-component.vue +221 -221
  53. package/composables/types/theme.ts +65 -65
  54. package/composables/types/user.ts +5 -5
  55. package/composables/useColorGenerator.ts +221 -221
  56. package/composables/useEnumes.ts +43 -43
  57. package/composables/useEventBus.ts +37 -37
  58. package/composables/useGlobalLoading.ts +47 -47
  59. package/composables/useGlobalMessage.ts +53 -53
  60. package/composables/useGlobalToast.ts +63 -63
  61. package/composables/useLocale.ts +54 -54
  62. package/composables/useManualTheme.ts +179 -179
  63. package/composables/useSectionMenus.ts +120 -120
  64. package/composables/useTabbar.ts +50 -50
  65. package/composables/useTheme.ts +74 -74
  66. package/composables/useUser.ts +24 -24
  67. package/index.d.ts +90 -90
  68. package/package.json +24 -24
  69. package/store/manualThemeStore.ts +143 -143
  70. package/store/persist.ts +41 -41
  71. package/store/themeStore.ts +74 -74
  72. package/store/userStore.ts +22 -22
  73. package/styles/dark-mode.scss +498 -498
  74. package/type.ts +154 -154
  75. package/utils/control-tree.ts +353 -353
  76. package/utils/eventBus.ts +36 -36
  77. package/utils/idata-scan.ts +99 -99
  78. package/utils/index.ts +979 -979
  79. package/utils/rsaEncrypt.ts +10 -10
@@ -1,261 +1,261 @@
1
- # GlobalToast 全局提示组件
2
-
3
- ## 概述
4
-
5
- GlobalToast 是基于 `wot-design-uni` 的 `wd-toast` 组件封装的全局提示组件,通过 Pinia 状态管理实现全局调用。
6
-
7
- ## 组件特性
8
-
9
- - 基于 `wd-toast` 组件封装
10
- - 支持多种提示类型:成功、错误、信息、警告
11
- - 自动页面路径检测,确保在正确页面显示
12
- - 支持自定义图标、位置、持续时间等
13
- - 虚拟节点设计,不在 DOM 中创建额外层级
14
-
15
- ## 安装使用
16
-
17
- ### 1. 注册全局组件
18
-
19
- 在 `App.vue` 或根组件中注册:
20
-
21
- ```vue
22
- <template>
23
- <div>
24
- <!-- 其他内容 -->
25
- <GlobalToast />
26
- </div>
27
- </template>
28
- ```
29
-
30
- ### 2. 在组件中使用
31
-
32
- ```typescript
33
- import { useGlobalToast } from '@/composables/useGlobalToast'
34
-
35
- const toast = useGlobalToast()
36
- ```
37
-
38
- ## API 文档
39
-
40
- ### 基础用法
41
-
42
- ```typescript
43
- // 普通提示
44
- toast.show('这是一条提示信息')
45
-
46
- // 自定义配置
47
- toast.show({
48
- msg: '自定义提示',
49
- duration: 3000,
50
- position: 'top'
51
- })
52
- ```
53
-
54
- ### 快捷方法
55
-
56
- #### success(option)
57
- 成功提示,显示绿色成功图标
58
-
59
- ```typescript
60
- toast.success('操作成功')
61
- toast.success({
62
- msg: '保存成功',
63
- duration: 2000
64
- })
65
- ```
66
-
67
- **默认配置:**
68
- - 图标:success
69
- - 持续时间:1500ms
70
-
71
- #### error(option)
72
- 错误提示,显示红色错误图标
73
-
74
- ```typescript
75
- toast.error('操作失败')
76
- toast.error({
77
- msg: '网络错误,请重试',
78
- duration: 3000
79
- })
80
- ```
81
-
82
- **默认配置:**
83
- - 图标:error
84
- - 方向:vertical(垂直布局)
85
-
86
- #### info(option)
87
- 信息提示,显示蓝色信息图标
88
-
89
- ```typescript
90
- toast.info('这是一条信息')
91
- toast.info({
92
- msg: '请注意查看',
93
- position: 'top'
94
- })
95
- ```
96
-
97
- **默认配置:**
98
- - 图标:info
99
-
100
- #### warning(option)
101
- 警告提示,显示黄色警告图标
102
-
103
- ```typescript
104
- toast.warning('警告信息')
105
- toast.warning({
106
- msg: '请谨慎操作',
107
- iconName: 'warning'
108
- })
109
- ```
110
-
111
- **默认配置:**
112
- - 图标:warning
113
-
114
- #### close()
115
- 手动关闭提示
116
-
117
- ```typescript
118
- toast.close()
119
- ```
120
-
121
- ## 参数说明
122
-
123
- ### ToastOptions
124
-
125
- | 参数 | 类型 | 默认值 | 说明 |
126
- |------|------|--------|------|
127
- | msg | string | - | 提示内容 |
128
- | duration | number | 2000 | 持续时间(ms),0表示不自动关闭 |
129
- | position | string | 'middle' | 显示位置:'top' \| 'middle' \| 'bottom' |
130
- | iconName | string | - | 图标名称 |
131
- | direction | string | - | 布局方向:'horizontal' \| 'vertical' |
132
- | cover | boolean | false | 是否显示遮罩 |
133
- | show | boolean | - | 是否显示(内部使用) |
134
-
135
- ### 方法参数
136
-
137
- 所有方法都支持两种参数类型:
138
-
139
- 1. **字符串参数**:直接传入提示文本
140
- 2. **选项对象**:传入完整的 ToastOptions 配置
141
-
142
- ## 使用示例
143
-
144
- ### 基础示例
145
-
146
- ```typescript
147
- export default {
148
- setup() {
149
- const toast = useGlobalToast()
150
-
151
- const handleSuccess = () => {
152
- toast.success('操作成功!')
153
- }
154
-
155
- const handleError = () => {
156
- toast.error('操作失败,请重试')
157
- }
158
-
159
- const handleCustom = () => {
160
- toast.show({
161
- msg: '自定义提示',
162
- duration: 5000,
163
- position: 'top',
164
- iconName: 'info'
165
- })
166
- }
167
-
168
- return {
169
- handleSuccess,
170
- handleError,
171
- handleCustom
172
- }
173
- }
174
- }
175
- ```
176
-
177
- ### 异步操作示例
178
-
179
- ```typescript
180
- async function handleSubmit() {
181
- const toast = useGlobalToast()
182
-
183
- try {
184
- // 提交数据
185
- await submitData()
186
- toast.success('提交成功')
187
- }
188
- catch (error) {
189
- toast.error(`提交失败:${error.message}`)
190
- }
191
- }
192
- ```
193
-
194
- ### 长文本提示
195
-
196
- ```typescript
197
- function showLongMessage() {
198
- toast.info({
199
- msg: '这是一条很长的提示信息,可能需要更长的显示时间',
200
- duration: 4000,
201
- position: 'top'
202
- })
203
- }
204
- ```
205
-
206
- ## 实现原理
207
-
208
- ### 状态管理
209
- - 使用 Pinia 管理全局状态
210
- - 状态包含:`toastOptions`(提示配置)、`currentPage`(当前页面路径)
211
-
212
- ### 页面检测机制
213
- - 调用提示方法时记录当前页面路径
214
- - 组件监听状态变化时验证页面路径
215
- - 确保提示信息在正确的页面显示
216
-
217
- ### 组件配置
218
- ```typescript
219
- export default {
220
- options: {
221
- virtualHost: true, // 虚拟节点
222
- addGlobalClass: true, // 支持全局样式
223
- styleIsolation: 'shared' // 样式隔离共享
224
- }
225
- }
226
- ```
227
-
228
- ## 最佳实践
229
-
230
- 1. **选择合适的提示类型**
231
- - 成功操作使用 `success()`
232
- - 错误信息使用 `error()`
233
- - 一般信息使用 `info()`
234
- - 警告信息使用 `warning()`
235
-
236
- 2. **控制显示时长**
237
- - 简短消息:1500-2000ms
238
- - 长消息:3000-4000ms
239
- - 重要消息:可设置为0,用户手动关闭
240
-
241
- 3. **位置选择**
242
- - 一般提示:middle(默认)
243
- - 不遮挡内容:top 或 bottom
244
- - 重要提示:middle + cover
245
-
246
- 4. **避免频繁调用**
247
- ```typescript
248
- // ❌ 避免快速连续调用
249
- toast.success('第一条')
250
- toast.success('第二条') // 会覆盖第一条
251
-
252
- // ✅ 推荐做法
253
- toast.success('操作完成')
254
- ```
255
-
256
- ## 注意事项
257
-
258
- 1. 组件需要在应用根组件中注册才能正常使用
259
- 2. 提示会自动在对应页面显示,切换页面时会自动关闭
260
- 3. 同时只能显示一个提示,新的提示会覆盖旧的提示
261
- 4. 使用 `duration: 0` 时记得手动调用 `close()` 关闭
1
+ # GlobalToast 全局提示组件
2
+
3
+ ## 概述
4
+
5
+ GlobalToast 是基于 `wot-design-uni` 的 `wd-toast` 组件封装的全局提示组件,通过 Pinia 状态管理实现全局调用。
6
+
7
+ ## 组件特性
8
+
9
+ - 基于 `wd-toast` 组件封装
10
+ - 支持多种提示类型:成功、错误、信息、警告
11
+ - 自动页面路径检测,确保在正确页面显示
12
+ - 支持自定义图标、位置、持续时间等
13
+ - 虚拟节点设计,不在 DOM 中创建额外层级
14
+
15
+ ## 安装使用
16
+
17
+ ### 1. 注册全局组件
18
+
19
+ 在 `App.vue` 或根组件中注册:
20
+
21
+ ```vue
22
+ <template>
23
+ <div>
24
+ <!-- 其他内容 -->
25
+ <GlobalToast />
26
+ </div>
27
+ </template>
28
+ ```
29
+
30
+ ### 2. 在组件中使用
31
+
32
+ ```typescript
33
+ import { useGlobalToast } from '@/composables/useGlobalToast'
34
+
35
+ const toast = useGlobalToast()
36
+ ```
37
+
38
+ ## API 文档
39
+
40
+ ### 基础用法
41
+
42
+ ```typescript
43
+ // 普通提示
44
+ toast.show('这是一条提示信息')
45
+
46
+ // 自定义配置
47
+ toast.show({
48
+ msg: '自定义提示',
49
+ duration: 3000,
50
+ position: 'top'
51
+ })
52
+ ```
53
+
54
+ ### 快捷方法
55
+
56
+ #### success(option)
57
+ 成功提示,显示绿色成功图标
58
+
59
+ ```typescript
60
+ toast.success('操作成功')
61
+ toast.success({
62
+ msg: '保存成功',
63
+ duration: 2000
64
+ })
65
+ ```
66
+
67
+ **默认配置:**
68
+ - 图标:success
69
+ - 持续时间:1500ms
70
+
71
+ #### error(option)
72
+ 错误提示,显示红色错误图标
73
+
74
+ ```typescript
75
+ toast.error('操作失败')
76
+ toast.error({
77
+ msg: '网络错误,请重试',
78
+ duration: 3000
79
+ })
80
+ ```
81
+
82
+ **默认配置:**
83
+ - 图标:error
84
+ - 方向:vertical(垂直布局)
85
+
86
+ #### info(option)
87
+ 信息提示,显示蓝色信息图标
88
+
89
+ ```typescript
90
+ toast.info('这是一条信息')
91
+ toast.info({
92
+ msg: '请注意查看',
93
+ position: 'top'
94
+ })
95
+ ```
96
+
97
+ **默认配置:**
98
+ - 图标:info
99
+
100
+ #### warning(option)
101
+ 警告提示,显示黄色警告图标
102
+
103
+ ```typescript
104
+ toast.warning('警告信息')
105
+ toast.warning({
106
+ msg: '请谨慎操作',
107
+ iconName: 'warning'
108
+ })
109
+ ```
110
+
111
+ **默认配置:**
112
+ - 图标:warning
113
+
114
+ #### close()
115
+ 手动关闭提示
116
+
117
+ ```typescript
118
+ toast.close()
119
+ ```
120
+
121
+ ## 参数说明
122
+
123
+ ### ToastOptions
124
+
125
+ | 参数 | 类型 | 默认值 | 说明 |
126
+ |------|------|--------|------|
127
+ | msg | string | - | 提示内容 |
128
+ | duration | number | 2000 | 持续时间(ms),0表示不自动关闭 |
129
+ | position | string | 'middle' | 显示位置:'top' \| 'middle' \| 'bottom' |
130
+ | iconName | string | - | 图标名称 |
131
+ | direction | string | - | 布局方向:'horizontal' \| 'vertical' |
132
+ | cover | boolean | false | 是否显示遮罩 |
133
+ | show | boolean | - | 是否显示(内部使用) |
134
+
135
+ ### 方法参数
136
+
137
+ 所有方法都支持两种参数类型:
138
+
139
+ 1. **字符串参数**:直接传入提示文本
140
+ 2. **选项对象**:传入完整的 ToastOptions 配置
141
+
142
+ ## 使用示例
143
+
144
+ ### 基础示例
145
+
146
+ ```typescript
147
+ export default {
148
+ setup() {
149
+ const toast = useGlobalToast()
150
+
151
+ const handleSuccess = () => {
152
+ toast.success('操作成功!')
153
+ }
154
+
155
+ const handleError = () => {
156
+ toast.error('操作失败,请重试')
157
+ }
158
+
159
+ const handleCustom = () => {
160
+ toast.show({
161
+ msg: '自定义提示',
162
+ duration: 5000,
163
+ position: 'top',
164
+ iconName: 'info'
165
+ })
166
+ }
167
+
168
+ return {
169
+ handleSuccess,
170
+ handleError,
171
+ handleCustom
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ ### 异步操作示例
178
+
179
+ ```typescript
180
+ async function handleSubmit() {
181
+ const toast = useGlobalToast()
182
+
183
+ try {
184
+ // 提交数据
185
+ await submitData()
186
+ toast.success('提交成功')
187
+ }
188
+ catch (error) {
189
+ toast.error(`提交失败:${error.message}`)
190
+ }
191
+ }
192
+ ```
193
+
194
+ ### 长文本提示
195
+
196
+ ```typescript
197
+ function showLongMessage() {
198
+ toast.info({
199
+ msg: '这是一条很长的提示信息,可能需要更长的显示时间',
200
+ duration: 4000,
201
+ position: 'top'
202
+ })
203
+ }
204
+ ```
205
+
206
+ ## 实现原理
207
+
208
+ ### 状态管理
209
+ - 使用 Pinia 管理全局状态
210
+ - 状态包含:`toastOptions`(提示配置)、`currentPage`(当前页面路径)
211
+
212
+ ### 页面检测机制
213
+ - 调用提示方法时记录当前页面路径
214
+ - 组件监听状态变化时验证页面路径
215
+ - 确保提示信息在正确的页面显示
216
+
217
+ ### 组件配置
218
+ ```typescript
219
+ export default {
220
+ options: {
221
+ virtualHost: true, // 虚拟节点
222
+ addGlobalClass: true, // 支持全局样式
223
+ styleIsolation: 'shared' // 样式隔离共享
224
+ }
225
+ }
226
+ ```
227
+
228
+ ## 最佳实践
229
+
230
+ 1. **选择合适的提示类型**
231
+ - 成功操作使用 `success()`
232
+ - 错误信息使用 `error()`
233
+ - 一般信息使用 `info()`
234
+ - 警告信息使用 `warning()`
235
+
236
+ 2. **控制显示时长**
237
+ - 简短消息:1500-2000ms
238
+ - 长消息:3000-4000ms
239
+ - 重要消息:可设置为0,用户手动关闭
240
+
241
+ 3. **位置选择**
242
+ - 一般提示:middle(默认)
243
+ - 不遮挡内容:top 或 bottom
244
+ - 重要提示:middle + cover
245
+
246
+ 4. **避免频繁调用**
247
+ ```typescript
248
+ // ❌ 避免快速连续调用
249
+ toast.success('第一条')
250
+ toast.success('第二条') // 会覆盖第一条
251
+
252
+ // ✅ 推荐做法
253
+ toast.success('操作完成')
254
+ ```
255
+
256
+ ## 注意事项
257
+
258
+ 1. 组件需要在应用根组件中注册才能正常使用
259
+ 2. 提示会自动在对应页面显示,切换页面时会自动关闭
260
+ 3. 同时只能显示一个提示,新的提示会覆盖旧的提示
261
+ 4. 使用 `duration: 0` 时记得手动调用 `close()` 关闭
@@ -1,56 +1,56 @@
1
- <script lang="ts" setup>
2
- import { storeToRefs } from 'pinia'
3
- import { useToast } from '@wot-ui/ui'
4
- import { defineOptions, nextTick, ref, watch } from 'vue'
5
- import { useGlobalToast } from '../../composables/useGlobalToast'
6
- import { getCurrentPath } from '../../utils/index'
7
-
8
- defineOptions({
9
- name: 'GlobalToast',
10
- })
11
-
12
- const { toastOptions, currentPage } = storeToRefs(useGlobalToast())
13
-
14
- const { close: closeGlobalToast } = useGlobalToast()
15
-
16
- const toast = useToast('globalToast')
17
- const currentPath = getCurrentPath()
18
-
19
- // #ifdef MP-ALIPAY
20
- const hackAlipayVisible = ref(false)
21
-
22
- nextTick(() => {
23
- hackAlipayVisible.value = true
24
- })
25
- // #endif
26
-
27
- watch(() => toastOptions.value, (newVal) => {
28
- if (newVal && newVal.show) {
29
- if (currentPage.value === currentPath) {
30
- toast.show(toastOptions.value)
31
- }
32
- }
33
- else {
34
- toast.close()
35
- }
36
- })
37
- </script>
38
-
39
- <script lang="ts">
40
- export default {
41
- options: {
42
- virtualHost: true,
43
- addGlobalClass: true,
44
- styleIsolation: 'shared',
45
- },
46
- }
47
- </script>
48
-
49
- <template>
50
- <!-- #ifdef MP-ALIPAY -->
51
- <wd-toast v-if="hackAlipayVisible" selector="globalToast" :closed="closeGlobalToast" />
52
- <!-- #endif -->
53
- <!-- #ifndef MP-ALIPAY -->
54
- <wd-toast selector="globalToast" :closed="closeGlobalToast" />
55
- <!-- #endif -->
56
- </template>
1
+ <script lang="ts" setup>
2
+ import { storeToRefs } from 'pinia'
3
+ import { useToast } from '@wot-ui/ui'
4
+ import { defineOptions, nextTick, ref, watch } from 'vue'
5
+ import { useGlobalToast } from '../../composables/useGlobalToast'
6
+ import { getCurrentPath } from '../../utils/index'
7
+
8
+ defineOptions({
9
+ name: 'GlobalToast',
10
+ })
11
+
12
+ const { toastOptions, currentPage } = storeToRefs(useGlobalToast())
13
+
14
+ const { close: closeGlobalToast } = useGlobalToast()
15
+
16
+ const toast = useToast('globalToast')
17
+ const currentPath = getCurrentPath()
18
+
19
+ // #ifdef MP-ALIPAY
20
+ const hackAlipayVisible = ref(false)
21
+
22
+ nextTick(() => {
23
+ hackAlipayVisible.value = true
24
+ })
25
+ // #endif
26
+
27
+ watch(() => toastOptions.value, (newVal) => {
28
+ if (newVal && newVal.show) {
29
+ if (currentPage.value === currentPath) {
30
+ toast.show(toastOptions.value)
31
+ }
32
+ }
33
+ else {
34
+ toast.close()
35
+ }
36
+ })
37
+ </script>
38
+
39
+ <script lang="ts">
40
+ export default {
41
+ options: {
42
+ virtualHost: true,
43
+ addGlobalClass: true,
44
+ styleIsolation: 'shared',
45
+ },
46
+ }
47
+ </script>
48
+
49
+ <template>
50
+ <!-- #ifdef MP-ALIPAY -->
51
+ <wd-toast v-if="hackAlipayVisible" selector="globalToast" :closed="closeGlobalToast" />
52
+ <!-- #endif -->
53
+ <!-- #ifndef MP-ALIPAY -->
54
+ <wd-toast selector="globalToast" :closed="closeGlobalToast" />
55
+ <!-- #endif -->
56
+ </template>