@tplc/wot 0.1.62 → 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 +15 -0
- package/components/wd-img/wd-img.vue +33 -7
- 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/components/wd-swiper/types.ts +2 -0
- package/components/wd-swiper/wd-swiper.vue +1 -0
- package/components/wd-swiper-nav/types.ts +8 -0
- package/components/wd-swiper-nav/wd-swiper-nav.vue +3 -0
- 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/types/components/wd-swiper/types.d.ts +4 -0
- package/types/components/wd-swiper/wd-swiper.vue.d.ts +9 -0
- package/types/components/wd-swiper-nav/types.d.ts +14 -0
- package/types/components/wd-swiper-nav/wd-swiper-nav.vue.d.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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
|
+
|
|
18
|
+
### [0.1.63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.76...v0.1.63) (2025-03-10)
|
|
19
|
+
|
|
5
20
|
### [0.1.62](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.57...v0.1.62) (2025-02-24)
|
|
6
21
|
|
|
7
22
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<image
|
|
4
4
|
v-if="status !== 'success'"
|
|
5
5
|
:class="`wd-img__image coverImg ${customImage}`"
|
|
6
|
-
:src="wrapPhoto({ photo: src, width: lazyPlaceWidth })"
|
|
6
|
+
:src="wrapPhoto({ photo: src, width: lazyPlaceWidth, type: 2 })"
|
|
7
7
|
:mode="mode"
|
|
8
8
|
:lazy-load="lazyLoad"
|
|
9
9
|
/>
|
|
10
10
|
<image
|
|
11
11
|
:class="`wd-img__image coverImg ${customImage}`"
|
|
12
|
-
:src="wrapPhoto({ photo: src, width, type:
|
|
12
|
+
:src="wrapPhoto({ photo: src, width, type: 1 })"
|
|
13
13
|
:mode="mode"
|
|
14
14
|
:lazy-load="lazyLoad"
|
|
15
15
|
@load="handleLoad"
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<script lang="ts" setup>
|
|
38
|
-
import { computed, ref } from 'vue'
|
|
38
|
+
import { computed, ref, watch } from 'vue'
|
|
39
39
|
import { addUnit, isDef, objToStyle } from '../common/util'
|
|
40
40
|
import { imgProps } from './types'
|
|
41
41
|
|
|
@@ -80,15 +80,41 @@ function handleLoad(event: Event) {
|
|
|
80
80
|
emit('load', event)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function wrapPhoto({ photo, width =
|
|
83
|
+
function wrapPhoto({ photo, width = 100, type = 1 }: any) {
|
|
84
|
+
let finalWidth = width
|
|
85
|
+
if (type === 1) {
|
|
86
|
+
if (typeof width === 'string') {
|
|
87
|
+
const imgWidth = parseInt(width.replace('rpx', ''))
|
|
88
|
+
if (width.includes('rpx')) {
|
|
89
|
+
finalWidth = imgWidth * 6
|
|
90
|
+
} else if (width.includes('px')) {
|
|
91
|
+
finalWidth = imgWidth * 3
|
|
92
|
+
} else if (width.includes('%')) {
|
|
93
|
+
finalWidth = 1500
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
finalWidth = width * 3
|
|
97
|
+
}
|
|
98
|
+
if (finalWidth > 1500) {
|
|
99
|
+
finalWidth = 1500
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
84
103
|
const isctyun = photo?.indexOf('.ctyun') >= 0
|
|
85
104
|
const sym = photo?.indexOf('?') > 0 ? '&' : '?'
|
|
86
105
|
const suffix = isctyun
|
|
87
|
-
? `${sym}x-amz-process=image/resize,w_${
|
|
88
|
-
: `${sym}x-oss-process=image/resize,m_mfit,w_${
|
|
89
|
-
const url = `${photo}${
|
|
106
|
+
? `${sym}x-amz-process=image/resize,w_${finalWidth},m_lfit`
|
|
107
|
+
: `${sym}x-oss-process=image/resize,m_mfit,w_${finalWidth}&imageView2/2/w/${finalWidth}`
|
|
108
|
+
const url = `${photo}${suffix}`
|
|
90
109
|
return url
|
|
91
110
|
}
|
|
111
|
+
|
|
112
|
+
watch(
|
|
113
|
+
() => props.src,
|
|
114
|
+
() => {
|
|
115
|
+
status.value = 'loading'
|
|
116
|
+
},
|
|
117
|
+
)
|
|
92
118
|
</script>
|
|
93
119
|
|
|
94
120
|
<style lang="scss" scoped>
|
|
@@ -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
|
|
@@ -37,6 +37,14 @@ export const swiperNavprops = {
|
|
|
37
37
|
* 指示器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等
|
|
38
38
|
*/
|
|
39
39
|
type: makeStringProp<SwiperIndicatorType>('dots'),
|
|
40
|
+
/**
|
|
41
|
+
* 指示器活动颜色
|
|
42
|
+
*/
|
|
43
|
+
activityColor: makeStringProp('var(--wot-color-theme)'),
|
|
44
|
+
/**
|
|
45
|
+
* 指示器非活动颜色
|
|
46
|
+
*/
|
|
47
|
+
inactiveColor: makeStringProp('#e7e7e7'),
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
export type SwiperNavProps = ExtractPropTypes<typeof swiperNavprops>
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
v-for="(item, index) in total"
|
|
14
14
|
:key="index"
|
|
15
15
|
:class="`wd-swiper-nav__item--${type} ${current === index ? 'is-active' : ''} is-${direction}`"
|
|
16
|
+
:style="{
|
|
17
|
+
backgroundColor: current === index ? activityColor : inactiveColor,
|
|
18
|
+
}"
|
|
16
19
|
></view>
|
|
17
20
|
</block>
|
|
18
21
|
<block v-if="type === 'fraction'">{{ current + 1 }}/{{ total }}</block>
|
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
|
|
@@ -127,6 +127,10 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
127
127
|
type: BooleanConstructor
|
|
128
128
|
default: boolean
|
|
129
129
|
}
|
|
130
|
+
indicatorCustomStyle: {
|
|
131
|
+
type: import('vue').PropType<string>
|
|
132
|
+
default: string
|
|
133
|
+
}
|
|
130
134
|
customStyle: {
|
|
131
135
|
type: import('vue').PropType<string>
|
|
132
136
|
default: string
|
|
@@ -274,6 +278,10 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
274
278
|
type: BooleanConstructor
|
|
275
279
|
default: boolean
|
|
276
280
|
}
|
|
281
|
+
indicatorCustomStyle: {
|
|
282
|
+
type: import('vue').PropType<string>
|
|
283
|
+
default: string
|
|
284
|
+
}
|
|
277
285
|
customStyle: {
|
|
278
286
|
type: import('vue').PropType<string>
|
|
279
287
|
default: string
|
|
@@ -321,6 +329,7 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
321
329
|
customNextImageClass: string
|
|
322
330
|
itemPadding: string
|
|
323
331
|
imageRadius: string
|
|
332
|
+
indicatorCustomStyle: string
|
|
324
333
|
},
|
|
325
334
|
{}
|
|
326
335
|
>
|
|
@@ -54,6 +54,20 @@ export declare const swiperNavprops: {
|
|
|
54
54
|
type: import('vue').PropType<SwiperIndicatorType>
|
|
55
55
|
default: SwiperIndicatorType
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* 指示器活动颜色
|
|
59
|
+
*/
|
|
60
|
+
activityColor: {
|
|
61
|
+
type: import('vue').PropType<string>
|
|
62
|
+
default: string
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 指示器非活动颜色
|
|
66
|
+
*/
|
|
67
|
+
inactiveColor: {
|
|
68
|
+
type: import('vue').PropType<string>
|
|
69
|
+
default: string
|
|
70
|
+
}
|
|
57
71
|
customStyle: {
|
|
58
72
|
type: import('vue').PropType<string>
|
|
59
73
|
default: string
|
|
@@ -28,6 +28,14 @@ declare const _default: import('vue').DefineComponent<
|
|
|
28
28
|
type: import('vue').PropType<import('./types').SwiperIndicatorType>
|
|
29
29
|
default: import('./types').SwiperIndicatorType
|
|
30
30
|
}
|
|
31
|
+
activityColor: {
|
|
32
|
+
type: import('vue').PropType<string>
|
|
33
|
+
default: string
|
|
34
|
+
}
|
|
35
|
+
inactiveColor: {
|
|
36
|
+
type: import('vue').PropType<string>
|
|
37
|
+
default: string
|
|
38
|
+
}
|
|
31
39
|
customStyle: {
|
|
32
40
|
type: import('vue').PropType<string>
|
|
33
41
|
default: string
|
|
@@ -78,6 +86,14 @@ declare const _default: import('vue').DefineComponent<
|
|
|
78
86
|
type: import('vue').PropType<import('./types').SwiperIndicatorType>
|
|
79
87
|
default: import('./types').SwiperIndicatorType
|
|
80
88
|
}
|
|
89
|
+
activityColor: {
|
|
90
|
+
type: import('vue').PropType<string>
|
|
91
|
+
default: string
|
|
92
|
+
}
|
|
93
|
+
inactiveColor: {
|
|
94
|
+
type: import('vue').PropType<string>
|
|
95
|
+
default: string
|
|
96
|
+
}
|
|
81
97
|
customStyle: {
|
|
82
98
|
type: import('vue').PropType<string>
|
|
83
99
|
default: string
|
|
@@ -97,9 +113,11 @@ declare const _default: import('vue').DefineComponent<
|
|
|
97
113
|
current: number
|
|
98
114
|
direction: import('../wd-swiper/types').DirectionType
|
|
99
115
|
total: number
|
|
116
|
+
inactiveColor: string
|
|
100
117
|
minShowNum: number
|
|
101
118
|
indicatorPosition: import('../wd-swiper/types').IndicatorPositionType
|
|
102
119
|
showControls: boolean
|
|
120
|
+
activityColor: string
|
|
103
121
|
},
|
|
104
122
|
{}
|
|
105
123
|
>
|