@tplc/business 0.4.28 → 0.4.30
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 +32 -0
- package/components/lcb-list/components/ComponentGroup/index.vue +2 -16
- package/components/lcb-list/components/FilterSlider/index.vue +4 -1
- package/components/lcb-list/components/TreeSelect/index.vue +48 -3
- package/components/lcb-list/components/UnconditionedLayout/index.vue +124 -0
- package/components/lcb-nav/SharePopup/index.vue +1 -0
- package/components/lcb-product/lcb-product.vue +32 -29
- package/package.json +1 -1
- package/types/components/lcb-list/components/UnconditionedLayout/index.vue.d.ts +83 -0
- package/types/utils/transform.d.ts +6 -0
- package/utils/transform.ts +22 -0
- package/components/lcb-list/components/UnCondiLayout/index.vue +0 -84
- package/types/components/lcb-list/components/UnCondiLayout/index.vue.d.ts +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
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.4.30](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.27...v0.4.30) (2025-03-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.1.74 ([49a4e72](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/49a4e720a3744603630bbe7e042a5bb3ba2e4033))
|
|
11
|
+
* **release:** 0.1.75 ([282ba19](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/282ba19d36ce4949929c105fb276d74ad1ca1986))
|
|
12
|
+
* **release:** 0.4.28 ([ba26479](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ba264791fe2027308ab17cc27d6e9731d9773ba9))
|
|
13
|
+
* **release:** 0.4.29 ([ac8affb](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ac8affb6c17cdd9dcdfa8bc0a585e7ff40322509))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
* backup ([5934345](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/59343452497456c698c7c6e0d9cafb4cc18ea842))
|
|
19
|
+
* lcb-city-select 自动清空额外字段 ([229b530](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/229b530f93fe237a9674a48c1248cae955fa9006))
|
|
20
|
+
* search 焦点 ([76a175f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/76a175ff3fc3f91c66bedf39af6780f11d0cb686))
|
|
21
|
+
* 初始化字段 ([2bb232b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2bb232bcf514bb880e92ebe2e1c78c424f5a22b6))
|
|
22
|
+
* 同步city ([155266f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/155266f0e8dd302b5e974968552146e6d8448f5d))
|
|
23
|
+
* 字段同步 ([5395b64](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5395b6415bbb5d7ef7396fbc949940ce0ccab2a5))
|
|
24
|
+
* 支持img ([508b7f9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/508b7f97b40f3c473e8a4528814db54b74e8b919))
|
|
25
|
+
* 暂时完善数据同步 ([66af8a1](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/66af8a18e04913c407ccae7e1463a19b6aa584c3))
|
|
26
|
+
* 暂时完成数据 ([0e97d09](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0e97d09182421a21a90659a785e10ae5489d9e61))
|
|
27
|
+
* 样式 ([5e4039c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5e4039ca29a673da67790e424cf2e7fc35fa1d1d))
|
|
28
|
+
* 调整组件 ([6b4ce6c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6b4ce6c95ee380e143df93b6de16e6c8af0116d7))
|
|
29
|
+
|
|
30
|
+
### [0.4.29](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.28...v0.4.29) (2025-03-27)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### ✨ Features | 新功能
|
|
34
|
+
|
|
35
|
+
* 调整组件 ([6b4ce6c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6b4ce6c95ee380e143df93b6de16e6c8af0116d7))
|
|
36
|
+
|
|
5
37
|
### [0.4.28](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.75...v0.4.28) (2025-03-27)
|
|
6
38
|
|
|
7
39
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<view v-if="child.component === 'slider'" class="!text-26rpx slider-title">
|
|
8
8
|
{{
|
|
9
9
|
getSliderTitle(
|
|
10
|
+
translate,
|
|
10
11
|
innerFilter[child.valueName],
|
|
11
12
|
child.componentProps.max,
|
|
12
13
|
child.componentProps.min,
|
|
@@ -41,6 +42,7 @@ import FilterSlider from '../FilterSlider/index.vue'
|
|
|
41
42
|
import TagSelect from '../TagSelect/index.vue'
|
|
42
43
|
import ActionView from '../ActionView/index.vue'
|
|
43
44
|
import { useTranslate } from '@tplc/wot'
|
|
45
|
+
import { getSliderTitle } from '../../../../utils/transform'
|
|
44
46
|
defineOptions({
|
|
45
47
|
name: 'ComponentGroup',
|
|
46
48
|
options: {
|
|
@@ -83,22 +85,6 @@ const onCancel = () => {
|
|
|
83
85
|
const onSubmit = () => {
|
|
84
86
|
emits('submit', innerFilter.value)
|
|
85
87
|
}
|
|
86
|
-
const getSliderTitle = (value?: number[], max = 0, min = 0) => {
|
|
87
|
-
if (value) {
|
|
88
|
-
const [start, end] = value
|
|
89
|
-
if (start === min && end === max) {
|
|
90
|
-
return translate('不限')
|
|
91
|
-
} else if (end === max || end === undefined) {
|
|
92
|
-
return `¥${start}` + translate('以上')
|
|
93
|
-
} else if (start === min) {
|
|
94
|
-
return `¥${end}` + translate('以下')
|
|
95
|
-
} else {
|
|
96
|
-
return `¥${start}-${end}`
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
return ''
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
88
|
</script>
|
|
103
89
|
<style lang="scss" scoped>
|
|
104
90
|
@import '@tplc/wot/components/common/abstracts/variable';
|
|
@@ -36,6 +36,8 @@ import SelectTagView from '../SelectTagView/index.vue'
|
|
|
36
36
|
import { onMounted, onUnmounted, ref, watch, inject } from 'vue'
|
|
37
37
|
import type { SliderInstance } from '@tplc/wot/components/wd-slider/types'
|
|
38
38
|
import useSyncValues from '../../hooks/useSyncValues'
|
|
39
|
+
import { getSliderTitle } from '../../../../utils/transform'
|
|
40
|
+
import { useTranslate } from '@tplc/wot'
|
|
39
41
|
defineOptions({
|
|
40
42
|
name: 'FilterSlider',
|
|
41
43
|
options: {
|
|
@@ -50,6 +52,7 @@ const slider = ref<SliderInstance>()
|
|
|
50
52
|
const props = withDefaults(defineProps<FilterSliderProps>(), {
|
|
51
53
|
step: 100,
|
|
52
54
|
})
|
|
55
|
+
const { translate } = useTranslate()
|
|
53
56
|
const model = defineModel<number[]>()
|
|
54
57
|
const innerValue = ref<number[]>()
|
|
55
58
|
const { syncValues } = useSyncValues()
|
|
@@ -91,7 +94,7 @@ watch(
|
|
|
91
94
|
props.valueName,
|
|
92
95
|
[
|
|
93
96
|
{
|
|
94
|
-
label:
|
|
97
|
+
label: getSliderTitle(translate, innerValue.value, props.max, props.min),
|
|
95
98
|
value: `${innerValue.value}`,
|
|
96
99
|
},
|
|
97
100
|
],
|
|
@@ -60,11 +60,13 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script setup lang="ts">
|
|
63
|
-
import { getCurrentInstance, nextTick, watch, ref, computed
|
|
63
|
+
import { getCurrentInstance, nextTick, watch, ref, computed } from 'vue'
|
|
64
64
|
import { TreeSelectProps } from './type'
|
|
65
65
|
import useSelect from '../../hooks/useSelect'
|
|
66
66
|
import SelectTagView from '../SelectTagView/index.vue'
|
|
67
67
|
import ActionView from '../ActionView/index.vue'
|
|
68
|
+
import useSyncValues from '../../hooks/useSyncValues'
|
|
69
|
+
import { Option } from '../../types'
|
|
68
70
|
defineOptions({
|
|
69
71
|
name: 'TreeSelect',
|
|
70
72
|
options: {
|
|
@@ -75,6 +77,7 @@ defineOptions({
|
|
|
75
77
|
})
|
|
76
78
|
const props = defineProps<TreeSelectProps>()
|
|
77
79
|
const modelKeys = defineModel<string[]>('keys')
|
|
80
|
+
const { syncValues } = useSyncValues()
|
|
78
81
|
const innerValue = ref(props.value)
|
|
79
82
|
const toView = ref('')
|
|
80
83
|
const extraModel = ref({
|
|
@@ -97,11 +100,14 @@ const { onItemClick, options, getChecked } = useSelect(props, {
|
|
|
97
100
|
onOpen,
|
|
98
101
|
})
|
|
99
102
|
const currentCategory = ref(0)
|
|
103
|
+
|
|
100
104
|
const onSubmit = () => {
|
|
101
|
-
|
|
105
|
+
const params = {
|
|
102
106
|
...extraModel.value,
|
|
103
107
|
[props.valueName]: innerValue.value,
|
|
104
|
-
}
|
|
108
|
+
}
|
|
109
|
+
setValues(params)
|
|
110
|
+
emits('submit', params)
|
|
105
111
|
}
|
|
106
112
|
const onCategoryClick = (index: number) => {
|
|
107
113
|
currentCategory.value = index
|
|
@@ -149,6 +155,45 @@ const onCancel = () => {
|
|
|
149
155
|
{} as Record<string, any>,
|
|
150
156
|
)
|
|
151
157
|
}
|
|
158
|
+
/** 递归获取optionsMap key为value 值位options */
|
|
159
|
+
const optionsMap = computed(() => {
|
|
160
|
+
const map = {} as Record<string, Option>
|
|
161
|
+
options.value.forEach((v) => {
|
|
162
|
+
if (v.value) {
|
|
163
|
+
map[`${v.valueName || props.valueName}_${v.value}`] = v
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (v.children) {
|
|
167
|
+
v.children.forEach((child) => {
|
|
168
|
+
map[`${v.valueName || props.valueName}_${child.value}`] = child
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
return map
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
const setValues = (params: Record<string, any>) => {
|
|
176
|
+
const getOptions = (value: string | string[], valueName: string) => {
|
|
177
|
+
if (Array.isArray(value)) {
|
|
178
|
+
return value.map((v) => optionsMap.value[`${valueName}_${v}`])
|
|
179
|
+
} else {
|
|
180
|
+
return [optionsMap.value[`${valueName}_${value}`]]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (params[props.valueName]) {
|
|
184
|
+
const options = getOptions(params[props.valueName], props.valueName)
|
|
185
|
+
syncValues(props.valueName, options)
|
|
186
|
+
}
|
|
187
|
+
modelKeys.value?.forEach((v: string) => {
|
|
188
|
+
if (v !== props.valueName && params[v]) {
|
|
189
|
+
const currentOptions = options.value.find((option) => option.valueName === v)
|
|
190
|
+
if (currentOptions) {
|
|
191
|
+
const options = getOptions(params[v], v)
|
|
192
|
+
syncValues(v, options)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
}
|
|
152
197
|
</script>
|
|
153
198
|
<style lang="scss" scoped>
|
|
154
199
|
@import '@tplc/wot/components/common/abstracts/variable';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="extendJson" :style="itemStyle" class="overflow-hidden text-3">
|
|
3
|
+
<view
|
|
4
|
+
class="flex items-center justify-center p-3 bg-white box-border"
|
|
5
|
+
v-if="extendJson.resultTitle"
|
|
6
|
+
>
|
|
7
|
+
<view class="flex items-center justify-center">
|
|
8
|
+
<img :src="extendJson.resultIcon" alt="" class="w-4 h-4" />
|
|
9
|
+
<view class="ml-2">
|
|
10
|
+
<view class="mt-1">{{ extendJson.resultTitle }}</view>
|
|
11
|
+
<view class="text-#969696 text-2.5">{{ extendJson.resultSubTitle }}</view>
|
|
12
|
+
</view>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
<view class="p-3 bg-#F5F5F5 box-border">
|
|
16
|
+
<view class="flex items-center justify-between">
|
|
17
|
+
<view class="flex items-center gap-1">
|
|
18
|
+
<img :src="extendJson.optionIcon" alt="" class="w-3 h-3" />
|
|
19
|
+
{{ extendJson.optionTitle }}
|
|
20
|
+
</view>
|
|
21
|
+
<view class="flex items-center justify-center" @click="handleClearAll">
|
|
22
|
+
<wd-icon name="delete1" size="16" />
|
|
23
|
+
<text class="ml-0.5">清空</text>
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
<view class="flex flex-wrap gap-1 mt-2">
|
|
27
|
+
<block v-for="tag in options" :key="tag.key">
|
|
28
|
+
<view
|
|
29
|
+
v-for="option in tag.options"
|
|
30
|
+
:key="option.value"
|
|
31
|
+
@click="removeTag(option.value, tag.key, tag.options!.length)"
|
|
32
|
+
class="rounded-1 flex items-center bg-white px-2 py-0.5 gap-1 box-border overflow-hidden"
|
|
33
|
+
>
|
|
34
|
+
<text class="tag-text text-3">{{ option.label }}</text>
|
|
35
|
+
<wd-icon name="close" size="20rpx" color="#969696" />
|
|
36
|
+
</view>
|
|
37
|
+
</block>
|
|
38
|
+
</view>
|
|
39
|
+
</view>
|
|
40
|
+
</view>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts" setup>
|
|
44
|
+
import { ListFormChooserValues } from '../../types'
|
|
45
|
+
import { LIST_FORM_CHOOSER_VALUES, FORM_KEY } from '../../../../constants'
|
|
46
|
+
import { Ref, computed, inject } from 'vue'
|
|
47
|
+
import { transformValueUnit } from '../../../../utils/transform'
|
|
48
|
+
defineOptions({
|
|
49
|
+
name: 'UnconditionedLayout',
|
|
50
|
+
options: {
|
|
51
|
+
addGlobalClass: true,
|
|
52
|
+
virtualHost: true,
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
interface UnconditionedLayoutConfig {
|
|
56
|
+
optionTitle: string
|
|
57
|
+
resultIcon: string
|
|
58
|
+
resultTitle: string
|
|
59
|
+
optionIcon: string
|
|
60
|
+
resultSubTitle: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const list = inject(LIST_FORM_CHOOSER_VALUES) as Ref<ListFormChooserValues>
|
|
64
|
+
const form = inject(FORM_KEY) as Ref<Record<string, any>>
|
|
65
|
+
const props = withDefaults(
|
|
66
|
+
defineProps<{
|
|
67
|
+
extendJson?: UnconditionedLayoutConfig
|
|
68
|
+
borderRadius?: number
|
|
69
|
+
shadowSize?: number
|
|
70
|
+
shadowColor?: string
|
|
71
|
+
blurSize?: number
|
|
72
|
+
}>(),
|
|
73
|
+
{
|
|
74
|
+
borderRadius: 12,
|
|
75
|
+
shadowSize: 1,
|
|
76
|
+
shadowColor: '#D6D7DA',
|
|
77
|
+
blurSize: 5,
|
|
78
|
+
},
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
const itemStyle = computed(() => {
|
|
82
|
+
return {
|
|
83
|
+
borderRadius: transformValueUnit(props.borderRadius),
|
|
84
|
+
boxShadow:
|
|
85
|
+
props.shadowColor && props.shadowSize
|
|
86
|
+
? `0px 0px ${props.blurSize}px ${props.shadowSize}px ${props.shadowColor}`
|
|
87
|
+
: '',
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const options = computed(() => {
|
|
92
|
+
return Object.keys(list.value)
|
|
93
|
+
.filter((v) => list.value[v])
|
|
94
|
+
.map((v) => {
|
|
95
|
+
return {
|
|
96
|
+
key: v,
|
|
97
|
+
options: list.value[v],
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 移除单个标签
|
|
104
|
+
*/
|
|
105
|
+
const removeTag = (value: string, key: string, length: number) => {
|
|
106
|
+
if (length === 1) {
|
|
107
|
+
form.value[key] = undefined
|
|
108
|
+
list.value[key] = []
|
|
109
|
+
} else {
|
|
110
|
+
list.value[key] = list.value[key]!.filter((v) => v.value !== value)
|
|
111
|
+
form.value[key] = form.value[key].filter((v: string) => v !== value)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 清空所有标签
|
|
117
|
+
*/
|
|
118
|
+
const handleClearAll = () => {
|
|
119
|
+
Object.keys(list.value).forEach((v) => {
|
|
120
|
+
form.value[v] = undefined
|
|
121
|
+
list.value[v] = []
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
</script>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { inject, Ref, ref, useAttrs, watch, watchEffect } from 'vue'
|
|
3
3
|
import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
|
|
4
|
+
import UnconditionedLayout from '../lcb-list/components/UnconditionedLayout/index.vue'
|
|
4
5
|
import { LcbProductProps } from './types'
|
|
5
6
|
import { transformValueUnit } from '../../utils/transform'
|
|
6
7
|
import { calculateImageHeight } from '../../utils/utils'
|
|
@@ -149,35 +150,37 @@ defineExpose({
|
|
|
149
150
|
width: itemWidth ? `${itemWidth}rpx` : '100%',
|
|
150
151
|
}"
|
|
151
152
|
>
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
153
|
+
<block v-for="(item, index) in renderList" :key="`${item?.productId}:${index}`">
|
|
154
|
+
<UnconditionedLayout
|
|
155
|
+
v-if="item.productType === 'noProductOption'"
|
|
156
|
+
v-bind="{ ...item, ...$props, ...attrs }"
|
|
157
|
+
/>
|
|
158
|
+
<lcb-action-view v-bind="item.link" v-else>
|
|
159
|
+
<slot name="item" :item="item">
|
|
160
|
+
<lcb-absolute-config-layout
|
|
161
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
162
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
163
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
164
|
+
:dataset="{
|
|
165
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
166
|
+
...item,
|
|
167
|
+
}"
|
|
168
|
+
/>
|
|
169
|
+
<lcb-product-item
|
|
170
|
+
v-else
|
|
171
|
+
v-bind="{ ...item, ...$props, ...attrs }"
|
|
172
|
+
:layoutType="layoutType"
|
|
173
|
+
:coverImgStyle="{
|
|
174
|
+
width: layoutType === 'vertical' ? '100%' : transformValueUnit(imageWidth),
|
|
175
|
+
height: layoutType === 'vertical' ? transformValueUnit(imageHeight) : undefined,
|
|
176
|
+
minHeight: layoutType !== 'vertical' ? transformValueUnit(imageHeight) : undefined,
|
|
177
|
+
borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
|
|
178
|
+
...($props?.coverImgStyle ?? {}),
|
|
179
|
+
}"
|
|
180
|
+
></lcb-product-item>
|
|
181
|
+
</slot>
|
|
182
|
+
</lcb-action-view>
|
|
183
|
+
</block>
|
|
181
184
|
</view>
|
|
182
185
|
<!-- 双列 -->
|
|
183
186
|
<view
|
package/package.json
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
interface UnconditionedLayoutConfig {
|
|
2
|
+
optionTitle: string
|
|
3
|
+
resultIcon: string
|
|
4
|
+
resultTitle: string
|
|
5
|
+
optionIcon: string
|
|
6
|
+
resultSubTitle: string
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<
|
|
9
|
+
__VLS_WithDefaults<
|
|
10
|
+
__VLS_TypePropsToOption<{
|
|
11
|
+
extendJson?: UnconditionedLayoutConfig
|
|
12
|
+
borderRadius?: number
|
|
13
|
+
shadowSize?: number
|
|
14
|
+
shadowColor?: string
|
|
15
|
+
blurSize?: number
|
|
16
|
+
}>,
|
|
17
|
+
{
|
|
18
|
+
borderRadius: number
|
|
19
|
+
shadowSize: number
|
|
20
|
+
shadowColor: string
|
|
21
|
+
blurSize: number
|
|
22
|
+
}
|
|
23
|
+
>,
|
|
24
|
+
{},
|
|
25
|
+
unknown,
|
|
26
|
+
{},
|
|
27
|
+
{},
|
|
28
|
+
import('vue').ComponentOptionsMixin,
|
|
29
|
+
import('vue').ComponentOptionsMixin,
|
|
30
|
+
{},
|
|
31
|
+
string,
|
|
32
|
+
import('vue').PublicProps,
|
|
33
|
+
Readonly<
|
|
34
|
+
import('vue').ExtractPropTypes<
|
|
35
|
+
__VLS_WithDefaults<
|
|
36
|
+
__VLS_TypePropsToOption<{
|
|
37
|
+
extendJson?: UnconditionedLayoutConfig
|
|
38
|
+
borderRadius?: number
|
|
39
|
+
shadowSize?: number
|
|
40
|
+
shadowColor?: string
|
|
41
|
+
blurSize?: number
|
|
42
|
+
}>,
|
|
43
|
+
{
|
|
44
|
+
borderRadius: number
|
|
45
|
+
shadowSize: number
|
|
46
|
+
shadowColor: string
|
|
47
|
+
blurSize: number
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
>
|
|
51
|
+
>,
|
|
52
|
+
{
|
|
53
|
+
shadowColor: string
|
|
54
|
+
shadowSize: number
|
|
55
|
+
blurSize: number
|
|
56
|
+
borderRadius: number
|
|
57
|
+
},
|
|
58
|
+
{}
|
|
59
|
+
>
|
|
60
|
+
export default _default
|
|
61
|
+
type __VLS_WithDefaults<P, D> = {
|
|
62
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D
|
|
63
|
+
? __VLS_Prettify<
|
|
64
|
+
P[K] & {
|
|
65
|
+
default: D[K]
|
|
66
|
+
}
|
|
67
|
+
>
|
|
68
|
+
: P[K]
|
|
69
|
+
}
|
|
70
|
+
type __VLS_Prettify<T> = {
|
|
71
|
+
[K in keyof T]: T[K]
|
|
72
|
+
} & {}
|
|
73
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
|
|
74
|
+
type __VLS_TypePropsToOption<T> = {
|
|
75
|
+
[K in keyof T]-?: {} extends Pick<T, K>
|
|
76
|
+
? {
|
|
77
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
|
|
78
|
+
}
|
|
79
|
+
: {
|
|
80
|
+
type: import('vue').PropType<T[K]>
|
|
81
|
+
required: true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -5,3 +5,9 @@ export declare const getJsonStrFirstUrl: (jsonStr?: string) => any
|
|
|
5
5
|
export declare const getJsonStrList: (jsonStr?: string) => any
|
|
6
6
|
/** 删除其他外部字段 */
|
|
7
7
|
export declare const cleanOutSizeKeys: (obj: Record<string, any>, keys?: string[]) => {}
|
|
8
|
+
export declare const getSliderTitle: (
|
|
9
|
+
translate: (v: string) => string,
|
|
10
|
+
value?: number[],
|
|
11
|
+
max?: number,
|
|
12
|
+
min?: number,
|
|
13
|
+
) => string
|
package/utils/transform.ts
CHANGED
|
@@ -26,3 +26,25 @@ export const cleanOutSizeKeys = (
|
|
|
26
26
|
return acc
|
|
27
27
|
}, {})
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
export const getSliderTitle = (
|
|
31
|
+
translate: (v: string) => string,
|
|
32
|
+
value?: number[],
|
|
33
|
+
max = 0,
|
|
34
|
+
min = 0,
|
|
35
|
+
) => {
|
|
36
|
+
if (value) {
|
|
37
|
+
const [start, end] = value
|
|
38
|
+
if (start === min && end === max) {
|
|
39
|
+
return translate('不限')
|
|
40
|
+
} else if (end === max || end === undefined) {
|
|
41
|
+
return `¥${start}` + translate('以上')
|
|
42
|
+
} else if (start === min) {
|
|
43
|
+
return `¥${end}` + translate('以下')
|
|
44
|
+
} else {
|
|
45
|
+
return `¥${start}-${end}`
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
return ''
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="un-condi-layout p-3">
|
|
3
|
-
<view class="un-condi-tags">
|
|
4
|
-
<view v-for="(tag, index) in tags" :key="index" class="un-condi-tag radius-12rpx m-1">
|
|
5
|
-
<text class="tag-text text-3">{{ tag.label }}</text>
|
|
6
|
-
<text class="tag-close" @click="handleRemoveTag(tag, index)">×</text>
|
|
7
|
-
</view>
|
|
8
|
-
</view>
|
|
9
|
-
<view class="un-condi-clear" @click="handleClearAll">
|
|
10
|
-
<wd-img src="/static/icons/clear.png" width="40rpx" height="40rpx" />
|
|
11
|
-
<text class="clear-text text-3 text-#969696 m-1">清空</text>
|
|
12
|
-
</view>
|
|
13
|
-
</view>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import type { PropType } from 'vue'
|
|
18
|
-
|
|
19
|
-
interface TagItem {
|
|
20
|
-
label: string
|
|
21
|
-
value: string | number
|
|
22
|
-
type?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const props = defineProps({
|
|
26
|
-
tags: {
|
|
27
|
-
type: Array as PropType<TagItem[]>,
|
|
28
|
-
default: () => [],
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 移除单个标签
|
|
34
|
-
*/
|
|
35
|
-
const handleRemoveTag = (tag: TagItem, index: number) => {}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 清空所有标签
|
|
39
|
-
*/
|
|
40
|
-
const handleClearAll = () => {}
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<style lang="scss" scoped>
|
|
44
|
-
.un-condi-layout {
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: row;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
align-items: center;
|
|
49
|
-
width: 100%;
|
|
50
|
-
background-color: #fff;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.un-condi-tags {
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: row;
|
|
56
|
-
flex-wrap: wrap;
|
|
57
|
-
flex: 1;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.un-condi-tag {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: row;
|
|
63
|
-
align-items: center;
|
|
64
|
-
padding: 10rpx 20rpx;
|
|
65
|
-
background-color: #f5f5f5;
|
|
66
|
-
|
|
67
|
-
.tag-text {
|
|
68
|
-
color: #333;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.tag-close {
|
|
72
|
-
margin-left: 10rpx;
|
|
73
|
-
font-size: 32rpx;
|
|
74
|
-
color: #969696;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.un-condi-clear {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-direction: row;
|
|
81
|
-
align-items: center;
|
|
82
|
-
padding-left: 20rpx;
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { PropType } from 'vue'
|
|
2
|
-
interface TagItem {
|
|
3
|
-
label: string
|
|
4
|
-
value: string | number
|
|
5
|
-
type?: string
|
|
6
|
-
}
|
|
7
|
-
declare const _default: import('vue').DefineComponent<
|
|
8
|
-
{
|
|
9
|
-
tags: {
|
|
10
|
-
type: PropType<TagItem[]>
|
|
11
|
-
default: () => never[]
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
{},
|
|
15
|
-
unknown,
|
|
16
|
-
{},
|
|
17
|
-
{},
|
|
18
|
-
import('vue').ComponentOptionsMixin,
|
|
19
|
-
import('vue').ComponentOptionsMixin,
|
|
20
|
-
{},
|
|
21
|
-
string,
|
|
22
|
-
import('vue').PublicProps,
|
|
23
|
-
Readonly<
|
|
24
|
-
import('vue').ExtractPropTypes<{
|
|
25
|
-
tags: {
|
|
26
|
-
type: PropType<TagItem[]>
|
|
27
|
-
default: () => never[]
|
|
28
|
-
}
|
|
29
|
-
}>
|
|
30
|
-
>,
|
|
31
|
-
{
|
|
32
|
-
tags: TagItem[]
|
|
33
|
-
},
|
|
34
|
-
{}
|
|
35
|
-
>
|
|
36
|
-
export default _default
|