@tplc/wot 0.1.63 → 0.1.64
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/CHANGELOG.md +13 -0
- package/components/wd-select-picker/index.scss +13 -0
- package/components/wd-select-picker/types.ts +14 -0
- package/components/wd-select-picker/wd-select-picker.vue +34 -1
- package/package.json +1 -1
- package/types/components/wd-select-picker/types.d.ts +17 -0
- package/types/components/wd-select-picker/wd-select-picker.vue.d.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.64](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.75...v0.1.64) (2025-03-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.1.63 ([6286500](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6286500e9cf7b2096ea980ecc69949324cf12859))
|
|
11
|
+
* **release:** 0.3.76 ([74cab95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/74cab959ceab17fcc46662bd9bdc9e219e551547))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ✨ Features | 新功能
|
|
15
|
+
|
|
16
|
+
* 支持banner 底部 ([1e0b38c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1e0b38ccba18240f4b18f78a84e0810ae8b67460))
|
|
17
|
+
|
|
5
18
|
### [0.1.63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.76...v0.1.63) (2025-03-10)
|
|
6
19
|
|
|
7
20
|
### [0.1.62](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.57...v0.1.62) (2025-02-24)
|
|
@@ -146,6 +146,19 @@
|
|
|
146
146
|
justify-content: center;
|
|
147
147
|
background: $-picker-loading-bg;
|
|
148
148
|
}
|
|
149
|
+
@include e(no-more) {
|
|
150
|
+
text-align: center;
|
|
151
|
+
color: $-cell-arrow-color;
|
|
152
|
+
padding: 24rpx 0;
|
|
153
|
+
font-size: 28rpx;
|
|
154
|
+
}
|
|
155
|
+
@include e(innerLoading) {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
background: $-picker-loading-bg;
|
|
160
|
+
padding: 24rpx 0;
|
|
161
|
+
}
|
|
149
162
|
// selectPiceker多出的样式
|
|
150
163
|
@include edeep(header) {
|
|
151
164
|
height: 72px;
|
|
@@ -10,6 +10,16 @@ import {
|
|
|
10
10
|
import type { FormItemRule } from '../wd-form/types'
|
|
11
11
|
|
|
12
12
|
export type SelectPickerType = 'checkbox' | 'radio' | 'button'
|
|
13
|
+
export type SelectPickerRemote = {
|
|
14
|
+
action: (
|
|
15
|
+
search: string,
|
|
16
|
+
params: { pageNum: number; pageSize: number },
|
|
17
|
+
) => Promise<Record<string, any>[]>
|
|
18
|
+
valueKey?: string
|
|
19
|
+
labelKey?: string
|
|
20
|
+
pageSize?: number
|
|
21
|
+
isPage?: boolean
|
|
22
|
+
}
|
|
13
23
|
|
|
14
24
|
export const selectPickerProps = {
|
|
15
25
|
...baseProps,
|
|
@@ -75,6 +85,10 @@ export const selectPickerProps = {
|
|
|
75
85
|
safeAreaInsetBottom: makeBooleanProp(true),
|
|
76
86
|
/** 可搜索(目前只支持本地搜索) */
|
|
77
87
|
filterable: makeBooleanProp(false),
|
|
88
|
+
/** 远程搜索配置 */
|
|
89
|
+
remoteConfig: {
|
|
90
|
+
type: Object as PropType<SelectPickerRemote>,
|
|
91
|
+
},
|
|
78
92
|
/** 搜索框占位符 */
|
|
79
93
|
filterPlaceholder: String,
|
|
80
94
|
/** 是否超出隐藏 */
|
|
@@ -60,11 +60,13 @@
|
|
|
60
60
|
placeholder-left
|
|
61
61
|
@change="handleFilterChange"
|
|
62
62
|
/>
|
|
63
|
+
|
|
63
64
|
<scroll-view
|
|
64
65
|
:class="`wd-select-picker__wrapper ${filterable ? 'is-filterable' : ''} ${loading ? 'is-loading' : ''} ${customContentClass}`"
|
|
65
66
|
:scroll-y="!loading"
|
|
66
67
|
:scroll-top="scrollTop"
|
|
67
68
|
:scroll-with-animation="true"
|
|
69
|
+
@scrolltolower="handleScrollToLower"
|
|
68
70
|
>
|
|
69
71
|
<!-- 多选 -->
|
|
70
72
|
<view v-if="type === 'checkbox' && isArray(selectList)" id="wd-checkbox-group">
|
|
@@ -163,6 +165,10 @@
|
|
|
163
165
|
<view v-if="loading" class="wd-select-picker__loading" @touchmove="noop">
|
|
164
166
|
<wd-loading :color="loadingColor" />
|
|
165
167
|
</view>
|
|
168
|
+
<view v-if="innerLoading" class="wd-select-picker__innerLoading">
|
|
169
|
+
<wd-loading :color="loadingColor" />
|
|
170
|
+
</view>
|
|
171
|
+
<view v-if="noMore" class="wd-select-picker__no-more">没有更多数据了</view>
|
|
166
172
|
</scroll-view>
|
|
167
173
|
<!-- 确认按钮 -->
|
|
168
174
|
<view v-if="showConfirm" class="wd-select-picker__footer">
|
|
@@ -206,7 +212,10 @@ const filterVal = ref<string>('')
|
|
|
206
212
|
const filterColumns = ref<Array<Record<string, any>>>([])
|
|
207
213
|
const scrollTop = ref<number | null>(0) // 滚动位置
|
|
208
214
|
const cell = useCell()
|
|
209
|
-
|
|
215
|
+
const pageNum = ref<number>(1)
|
|
216
|
+
const noMore = ref<boolean>(false)
|
|
217
|
+
const innerLoading = ref<boolean>(false)
|
|
218
|
+
const innerColumns = ref<Array<Record<string, any>>>([])
|
|
210
219
|
const showValue = computed(() => {
|
|
211
220
|
const value = valueFormat(props.modelValue)
|
|
212
221
|
let showValueTemp: string = ''
|
|
@@ -316,10 +325,34 @@ const isRequired = computed(() => {
|
|
|
316
325
|
}
|
|
317
326
|
return props.required || props.rules.some((rule) => rule.required) || formRequired
|
|
318
327
|
})
|
|
328
|
+
/** 获取远程数据 */
|
|
329
|
+
const getRemoteData = async () => {
|
|
330
|
+
innerLoading.value = true
|
|
331
|
+
const res = await props.remoteConfig?.action(filterVal.value, {
|
|
332
|
+
pageNum: pageNum.value,
|
|
333
|
+
pageSize: props.remoteConfig?.pageSize || 10,
|
|
334
|
+
})
|
|
319
335
|
|
|
336
|
+
if (res) {
|
|
337
|
+
if (res.length) {
|
|
338
|
+
pageNum.value++
|
|
339
|
+
innerColumns.value = [...innerColumns.value, ...res]
|
|
340
|
+
} else {
|
|
341
|
+
noMore.value = true
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
innerLoading.value = false
|
|
345
|
+
}
|
|
346
|
+
const handleScrollToLower = () => {
|
|
347
|
+
if (noMore.value || innerLoading.value || !props.remoteConfig?.isPage) return
|
|
348
|
+
getRemoteData()
|
|
349
|
+
}
|
|
320
350
|
onBeforeMount(() => {
|
|
321
351
|
selectList.value = valueFormat(props.modelValue)
|
|
322
352
|
filterColumns.value = props.columns
|
|
353
|
+
if (props.remoteConfig) {
|
|
354
|
+
getRemoteData()
|
|
355
|
+
}
|
|
323
356
|
})
|
|
324
357
|
|
|
325
358
|
const { proxy } = getCurrentInstance() as any
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
2
|
import type { FormItemRule } from '../wd-form/types'
|
|
3
3
|
export type SelectPickerType = 'checkbox' | 'radio' | 'button'
|
|
4
|
+
export type SelectPickerRemote = {
|
|
5
|
+
action: (
|
|
6
|
+
search: string,
|
|
7
|
+
params: {
|
|
8
|
+
pageNum: number
|
|
9
|
+
pageSize: number
|
|
10
|
+
},
|
|
11
|
+
) => Promise<Record<string, any>[]>
|
|
12
|
+
valueKey?: string
|
|
13
|
+
labelKey?: string
|
|
14
|
+
pageSize?: number
|
|
15
|
+
isPage?: boolean
|
|
16
|
+
}
|
|
4
17
|
export declare const selectPickerProps: {
|
|
5
18
|
/** 选择器左侧文案 */
|
|
6
19
|
label: StringConstructor
|
|
@@ -122,6 +135,10 @@ export declare const selectPickerProps: {
|
|
|
122
135
|
type: BooleanConstructor
|
|
123
136
|
default: boolean
|
|
124
137
|
}
|
|
138
|
+
/** 远程搜索配置 */
|
|
139
|
+
remoteConfig: {
|
|
140
|
+
type: PropType<SelectPickerRemote>
|
|
141
|
+
}
|
|
125
142
|
/** 搜索框占位符 */
|
|
126
143
|
filterPlaceholder: StringConstructor
|
|
127
144
|
/** 是否超出隐藏 */
|
|
@@ -92,6 +92,9 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
92
92
|
type: BooleanConstructor
|
|
93
93
|
default: boolean
|
|
94
94
|
}
|
|
95
|
+
remoteConfig: {
|
|
96
|
+
type: import('vue').PropType<import('./types').SelectPickerRemote>
|
|
97
|
+
}
|
|
95
98
|
filterPlaceholder: StringConstructor
|
|
96
99
|
ellipsis: {
|
|
97
100
|
type: BooleanConstructor
|
|
@@ -242,6 +245,9 @@ declare const _default: __VLS_WithTemplateSlots<
|
|
|
242
245
|
type: BooleanConstructor
|
|
243
246
|
default: boolean
|
|
244
247
|
}
|
|
248
|
+
remoteConfig: {
|
|
249
|
+
type: import('vue').PropType<import('./types').SelectPickerRemote>
|
|
250
|
+
}
|
|
245
251
|
filterPlaceholder: StringConstructor
|
|
246
252
|
ellipsis: {
|
|
247
253
|
type: BooleanConstructor
|