@tplc/business 0.3.92 → 0.3.94
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 +26 -0
- package/components/lcb-agreement-view/lcb-agreement-view.vue +1 -1
- package/components/lcb-form/lcb-form.vue +97 -12
- package/components/lcb-form/types.ts +13 -0
- package/components/lcb-list/components/FilterList/index.vue +1 -0
- package/components/lcb-operation-actions/BtnViews.vue +11 -3
- package/components/lcb-operation-actions/types.ts +1 -0
- package/components/lcb-product-item/components/ItemValue.vue +7 -1
- package/components/lcb-product-item/lcb-product-item.vue +13 -9
- package/components/lcb-tags/Tag/index.vue +13 -12
- package/package.json +1 -1
- package/types/components/lcb-form/types.d.ts +13 -0
- package/types/components/lcb-operation-actions/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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.3.94](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.71...v0.3.94) (2025-03-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.1.72 ([400430d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/400430db387cf82e0c0e6f216c1ccd995b137f82))
|
|
11
|
+
* **release:** 0.3.91 ([5802f24](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5802f24980a6fb4cfebf7a048e5d19e0dba8baf0))
|
|
12
|
+
* **release:** 0.3.92 ([07fa5e8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/07fa5e82f05b7d5c2d2d53c9bd4a500f00c3fa6a))
|
|
13
|
+
* **release:** 0.3.93 ([7561a9b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7561a9be483cda4c50ef7ae4fabd8df5fe7729d7))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
* search ([44a5a00](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/44a5a00c99e269fe73650afb3428f1fb799b215b))
|
|
19
|
+
* 搜索支持输入 ([345275a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/345275a417f3399739c512d628796d163862f0cc))
|
|
20
|
+
* 支持搜索输入 ([048387b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/048387bde999bec89539232dfc4bdff9fd68b54e))
|
|
21
|
+
* 新增字段 ([efedb08](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/efedb08a1c3a01b4f2a61ad1a5a5b15168e59119))
|
|
22
|
+
* 背景颜色 ([422624c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/422624c66c8ed859dcbe228541b777d7aa4edcc1))
|
|
23
|
+
|
|
24
|
+
### [0.3.93](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.92...v0.3.93) (2025-03-20)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### ✨ Features | 新功能
|
|
28
|
+
|
|
29
|
+
* 搜索支持输入 ([345275a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/345275a417f3399739c512d628796d163862f0cc))
|
|
30
|
+
|
|
5
31
|
### [0.3.92](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.91...v0.3.92) (2025-03-20)
|
|
6
32
|
|
|
7
33
|
### [0.3.91](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.72...v0.3.91) (2025-03-20)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<wd-popup closable position="center" custom-class="!bg-transparent" v-model="show">
|
|
6
6
|
<view class="agreement-popup">
|
|
7
7
|
<view class="title">{{ data?.name }}</view>
|
|
8
|
-
<view class="max-h-60vh overflow-y-auto">
|
|
8
|
+
<view class="max-h-60vh overflow-y-auto w-full">
|
|
9
9
|
<mpHtml :content="data?.content" />
|
|
10
10
|
</view>
|
|
11
11
|
</view>
|
|
@@ -45,18 +45,22 @@
|
|
|
45
45
|
"
|
|
46
46
|
v-bind="field.props"
|
|
47
47
|
/>
|
|
48
|
-
<wd-
|
|
48
|
+
<wd-datetime-picker
|
|
49
49
|
v-else-if="field.frontInputType === 'date'"
|
|
50
50
|
:label="field.fieldCustomName"
|
|
51
51
|
v-model="form[field.field]"
|
|
52
52
|
:required="field.requiredFlag"
|
|
53
53
|
:prop="field.field"
|
|
54
|
+
:type="getDateType(field.frontInputTypeValue)"
|
|
54
55
|
:rules="
|
|
55
56
|
field.requiredFlag
|
|
56
57
|
? [{ required: true, message: t('请选择') + field.fieldCustomName }]
|
|
57
58
|
: []
|
|
58
59
|
"
|
|
59
|
-
v-bind="
|
|
60
|
+
v-bind="{
|
|
61
|
+
...field.props,
|
|
62
|
+
...getDateOptions(field.frontInputContent),
|
|
63
|
+
}"
|
|
60
64
|
/>
|
|
61
65
|
<!-- radio -->
|
|
62
66
|
<wd-cell
|
|
@@ -95,18 +99,48 @@
|
|
|
95
99
|
{{ item }}
|
|
96
100
|
</wd-radio>
|
|
97
101
|
</wd-radio-group>
|
|
102
|
+
<!-- checkbox -->
|
|
103
|
+
<wd-checkbox-group
|
|
104
|
+
v-else-if="field.frontInputType === 'checkbox'"
|
|
105
|
+
v-model="form[field.field]"
|
|
106
|
+
v-bind="field.props"
|
|
107
|
+
>
|
|
108
|
+
<wd-checkbox
|
|
109
|
+
v-for="item in getColumns(field.frontInputContent)"
|
|
110
|
+
:key="item"
|
|
111
|
+
:modelValue="item"
|
|
112
|
+
>
|
|
113
|
+
{{ item }}
|
|
114
|
+
</wd-checkbox>
|
|
115
|
+
</wd-checkbox-group>
|
|
116
|
+
<!-- checkboxTag -->
|
|
117
|
+
<wd-checkbox-group
|
|
118
|
+
v-else-if="field.frontInputType === 'checkboxTag'"
|
|
119
|
+
v-model="form[field.field]"
|
|
120
|
+
v-bind="field.props"
|
|
121
|
+
shape="button"
|
|
122
|
+
>
|
|
123
|
+
<wd-checkbox
|
|
124
|
+
v-for="item in getColumns(field.frontInputContent)"
|
|
125
|
+
:key="item"
|
|
126
|
+
:modelValue="item"
|
|
127
|
+
>
|
|
128
|
+
{{ item }}
|
|
129
|
+
</wd-checkbox>
|
|
130
|
+
</wd-checkbox-group>
|
|
98
131
|
<wd-upload
|
|
99
132
|
v-else-if="field.frontInputType === 'img'"
|
|
100
133
|
:label="field.fieldCustomName"
|
|
101
134
|
accept="image"
|
|
102
135
|
:limit="1"
|
|
136
|
+
v-model:file-list="imgList[field.field]"
|
|
103
137
|
:upload-method="customUpload"
|
|
104
138
|
v-bind="field.props"
|
|
105
139
|
/>
|
|
106
140
|
</wd-cell>
|
|
107
141
|
</block>
|
|
108
142
|
</wd-cell-group>
|
|
109
|
-
<view class="text-center text-3 mt-6" v-if="agreementType">
|
|
143
|
+
<view class="text-center text-3 mt-6" v-if="agreementType && fields">
|
|
110
144
|
<wd-checkbox v-model="form.agreement">
|
|
111
145
|
<view class="flex">
|
|
112
146
|
<text>{{ t('同意') }}</text>
|
|
@@ -118,7 +152,14 @@
|
|
|
118
152
|
</view>
|
|
119
153
|
</wd-checkbox>
|
|
120
154
|
</view>
|
|
121
|
-
<wd-button
|
|
155
|
+
<wd-button
|
|
156
|
+
type="primary"
|
|
157
|
+
@click="submit"
|
|
158
|
+
block
|
|
159
|
+
size="large"
|
|
160
|
+
custom-class="!w-90% my-3"
|
|
161
|
+
v-if="fields"
|
|
162
|
+
>
|
|
122
163
|
{{ t(submitText) }}
|
|
123
164
|
</wd-button>
|
|
124
165
|
</wd-form>
|
|
@@ -130,6 +171,7 @@ import { ref, watch } from 'vue'
|
|
|
130
171
|
import { LcbFormField, LcbFormProps } from './types'
|
|
131
172
|
import { customUpload } from '../../utils/utils'
|
|
132
173
|
import { useTranslate } from '@tplc/wot'
|
|
174
|
+
import { DateTimeType } from '@tplc/wot/types/components/wd-datetime-picker-view/types'
|
|
133
175
|
defineOptions({
|
|
134
176
|
name: 'LcbForm',
|
|
135
177
|
options: {
|
|
@@ -142,6 +184,7 @@ const { translate: t } = useTranslate()
|
|
|
142
184
|
const form = ref({
|
|
143
185
|
agreement: false,
|
|
144
186
|
})
|
|
187
|
+
const imgList = ref({})
|
|
145
188
|
const formRef = ref()
|
|
146
189
|
const props = withDefaults(defineProps<LcbFormProps>(), {
|
|
147
190
|
submitText: '提交',
|
|
@@ -156,6 +199,19 @@ watch(
|
|
|
156
199
|
} = await uni.$lcb.http.post<any>('/entryFormCustom/detail', {
|
|
157
200
|
entryFormConfigId: newVal,
|
|
158
201
|
})
|
|
202
|
+
entryFormFieldConfigList.forEach((item) => {
|
|
203
|
+
if (item.value) {
|
|
204
|
+
if (item.frontInputType === 'img') {
|
|
205
|
+
imgList.value[item.field] = [{ url: item.value }]
|
|
206
|
+
} else if (item.frontInputType === 'checkboxTag' || item.frontInputType === 'checkbox') {
|
|
207
|
+
form.value[item.field] = JSON.parse(item.value)
|
|
208
|
+
} else if (item.frontInputType === 'date') {
|
|
209
|
+
form.value[item.field] = Number(item.value)
|
|
210
|
+
} else {
|
|
211
|
+
form.value[item.field] = item.value
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
})
|
|
159
215
|
|
|
160
216
|
fields.value = entryFormFieldConfigList
|
|
161
217
|
}
|
|
@@ -173,28 +229,57 @@ const submit = () => {
|
|
|
173
229
|
})
|
|
174
230
|
return
|
|
175
231
|
}
|
|
176
|
-
formRef.value.validate().then(async (
|
|
232
|
+
formRef.value.validate().then(async ({ valid }) => {
|
|
233
|
+
if (!valid) return
|
|
177
234
|
if (props.submitUrl) {
|
|
235
|
+
const values = fields.value?.reduce((acc, cur) => {
|
|
236
|
+
if (cur.frontInputType === 'img') {
|
|
237
|
+
const imgInfo = imgList.value[cur.field]?.[0]
|
|
238
|
+
acc[cur.field] = imgInfo?.response || imgInfo?.url
|
|
239
|
+
} else {
|
|
240
|
+
acc[cur.field] = form.value[cur.field]
|
|
241
|
+
}
|
|
242
|
+
return acc
|
|
243
|
+
}, {})
|
|
178
244
|
await uni.$lcb.http.post(props.submitUrl, {
|
|
179
245
|
entryFormConfigId: props.formType,
|
|
180
|
-
allField: JSON.stringify(
|
|
181
|
-
})
|
|
182
|
-
uni.showToast({
|
|
183
|
-
title: t('提交成功'),
|
|
184
|
-
icon: 'success',
|
|
246
|
+
allField: JSON.stringify(values),
|
|
185
247
|
})
|
|
186
248
|
}
|
|
187
249
|
})
|
|
188
250
|
}
|
|
251
|
+
const getDateType = (frontInputTypeValue: string) => {
|
|
252
|
+
return ({
|
|
253
|
+
day: 'date',
|
|
254
|
+
year: 'year',
|
|
255
|
+
month: 'year-month',
|
|
256
|
+
}[frontInputTypeValue] || 'time') as DateTimeType
|
|
257
|
+
}
|
|
258
|
+
const getDateOptions = (frontInputContent: string) => {
|
|
259
|
+
if (frontInputContent.includes('[')) return {}
|
|
260
|
+
return JSON.parse(frontInputContent || '{}')
|
|
261
|
+
}
|
|
189
262
|
</script>
|
|
190
263
|
|
|
191
264
|
<style lang="scss" scoped>
|
|
192
265
|
.lcb-form {
|
|
193
266
|
:deep(.wd-radio) {
|
|
194
|
-
line-height: inherit;
|
|
267
|
+
line-height: inherit !important;
|
|
195
268
|
}
|
|
196
269
|
:deep(.wd-radio-group) {
|
|
197
|
-
text-align: left;
|
|
270
|
+
text-align: left !important;
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-wrap: wrap;
|
|
273
|
+
gap: 8rpx;
|
|
274
|
+
}
|
|
275
|
+
:deep(.wd-checkbox) {
|
|
276
|
+
line-height: inherit !important;
|
|
277
|
+
}
|
|
278
|
+
:deep(.wd-checkbox-group) {
|
|
279
|
+
text-align: left !important;
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-wrap: wrap;
|
|
282
|
+
gap: 8rpx;
|
|
198
283
|
}
|
|
199
284
|
}
|
|
200
285
|
</style>
|
|
@@ -57,6 +57,19 @@ export interface LcbFormField {
|
|
|
57
57
|
* 组件的props
|
|
58
58
|
*/
|
|
59
59
|
props: Record<string, any>
|
|
60
|
+
range: string[]
|
|
61
|
+
/**
|
|
62
|
+
* 最小日期
|
|
63
|
+
*/
|
|
64
|
+
minDate: number
|
|
65
|
+
/**
|
|
66
|
+
* 最大日期
|
|
67
|
+
*/
|
|
68
|
+
maxDate: number
|
|
69
|
+
/**
|
|
70
|
+
* 默认日期
|
|
71
|
+
*/
|
|
72
|
+
defaultDate: number
|
|
60
73
|
}
|
|
61
74
|
export interface LcbFormProps extends LcbBlockProps {
|
|
62
75
|
fields: LcbFormField[]
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
@refresh="$emit('refresh', { item })"
|
|
8
8
|
@nav="$emit('cancel')"
|
|
9
9
|
>
|
|
10
|
-
<wd-button v-bind="getBtnProps(item)" :size="size">
|
|
10
|
+
<wd-button v-bind="getBtnProps(item)" :size="size">
|
|
11
|
+
{{ item.buttonName || item.name }}
|
|
12
|
+
</wd-button>
|
|
11
13
|
</lcb-action-view>
|
|
12
14
|
<view class="absolute">
|
|
13
15
|
<wd-message-box />
|
|
@@ -40,8 +42,14 @@ withDefaults(defineProps<LcbOperationActionsProps>(), {
|
|
|
40
42
|
const emits = defineEmits(['refresh', 'cancel'])
|
|
41
43
|
const getBtnProps = (item: IPageBtn) => {
|
|
42
44
|
return {
|
|
43
|
-
type:
|
|
44
|
-
|
|
45
|
+
type:
|
|
46
|
+
Number(item.styleContent?.buttonType) === 6 ||
|
|
47
|
+
item.styleContent?.buttonType?.includes?.('theme')
|
|
48
|
+
? 'primary'
|
|
49
|
+
: 'info',
|
|
50
|
+
plain:
|
|
51
|
+
Number(item.styleContent?.buttonType) === 6 ||
|
|
52
|
+
item.styleContent?.buttonType?.includes?.('Hollow'),
|
|
45
53
|
size: 'small',
|
|
46
54
|
...item.buttonProps,
|
|
47
55
|
} as ButtonProps
|
|
@@ -316,9 +316,15 @@ const value = computed(() => {
|
|
|
316
316
|
<view>{{ value }}</view>
|
|
317
317
|
</view>
|
|
318
318
|
</slot>
|
|
319
|
+
<slot :value="value" v-if="prop === 'orderSkuCountTips'" name="orderSkuCountTips">
|
|
320
|
+
<view :class="className" :style="style" class="text-22rpx text-gray-500 flex items-center">
|
|
321
|
+
<view>{{ value }}</view>
|
|
322
|
+
</view>
|
|
323
|
+
</slot>
|
|
324
|
+
|
|
319
325
|
<slot :value="value" v-if="prop === 'distanceTips'" name="distanceTips">
|
|
320
326
|
<view :class="className" :style="style" class="text-22rpx text-gray-500 flex items-center">
|
|
321
|
-
<
|
|
327
|
+
<wd-icon name="location" />
|
|
322
328
|
<view>{{ value }}</view>
|
|
323
329
|
</view>
|
|
324
330
|
</slot>
|
|
@@ -184,11 +184,12 @@ const itemStyle = computed(() => {
|
|
|
184
184
|
<!-- </template> -->
|
|
185
185
|
</ItemValue>
|
|
186
186
|
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</
|
|
187
|
+
<view class="flex gap-1 items-center">
|
|
188
|
+
<ItemValue prop="orderSkuCountTips" />
|
|
189
|
+
<view class="text-3.5 text-#969696" v-if="orderSkuCountTips && orderTips">·</view>
|
|
190
|
+
<ItemValue prop="orderTips" />
|
|
191
|
+
</view>
|
|
192
|
+
|
|
192
193
|
<ItemValue prop="distanceTips">
|
|
193
194
|
<!-- <template #distanceTips="{ value }"> -->
|
|
194
195
|
<!-- <slot name="distanceTips" :value="value" /> -->
|
|
@@ -325,12 +326,15 @@ const itemStyle = computed(() => {
|
|
|
325
326
|
<slot name="tags" :value="value" />
|
|
326
327
|
</template> -->
|
|
327
328
|
</ItemValue>
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
<view class="flex gap-1 items-center">
|
|
330
|
+
<ItemValue prop="orderSkuCountTips"></ItemValue>
|
|
331
|
+
<view class="text-3.5 text-#969696" v-if="orderSkuCountTips && orderTips">·</view>
|
|
332
|
+
<ItemValue prop="orderTips">
|
|
333
|
+
<!-- <template #orderTips="{ value }">
|
|
331
334
|
<slot name="orderTips" :value="value" />
|
|
332
335
|
</template> -->
|
|
333
|
-
|
|
336
|
+
</ItemValue>
|
|
337
|
+
</view>
|
|
334
338
|
<ItemValue prop="distanceTips"></ItemValue>
|
|
335
339
|
</view>
|
|
336
340
|
<view class="flex-1"></view>
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view v-for="(item, index) in items" :key="index" class="px-8rpx py-5rpx">
|
|
3
|
-
<view
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<view
|
|
4
|
+
class="border-solid border-1 flex py-4rpx px-6rpx leading-none"
|
|
5
|
+
:style="{
|
|
6
|
+
borderRadius: transformValueUnit(tagRadius),
|
|
7
|
+
fontSize: transformValueUnit(fontSize),
|
|
8
|
+
color: tagColor,
|
|
9
|
+
borderColor: tagColor,
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
9
12
|
<view>{{ item }}</view>
|
|
10
13
|
</view>
|
|
11
14
|
</view>
|
|
12
|
-
|
|
13
15
|
</template>
|
|
14
16
|
|
|
15
17
|
<script setup lang="ts">
|
|
16
|
-
import type { LcbTagsItemProps } from '../types'
|
|
18
|
+
import type { LcbTagsItemProps } from '../types'
|
|
17
19
|
import { transformValueUnit } from '../../../utils/transform'
|
|
18
20
|
|
|
19
21
|
// defineProps<LcbImageProps>() @click="onClickItem(each.urlObj)"
|
|
20
22
|
|
|
21
|
-
const props = withDefaults(defineProps<LcbTagsItemProps>(), {
|
|
22
|
-
|
|
23
|
-
})
|
|
23
|
+
const props = withDefaults(defineProps<LcbTagsItemProps>(), {})
|
|
24
24
|
</script>
|
|
25
25
|
<style lang="scss" scoped>
|
|
26
|
-
.tag {
|
|
26
|
+
.tag {
|
|
27
|
+
}
|
|
27
28
|
</style>
|
package/package.json
CHANGED
|
@@ -56,6 +56,19 @@ export interface LcbFormField {
|
|
|
56
56
|
* 组件的props
|
|
57
57
|
*/
|
|
58
58
|
props: Record<string, any>
|
|
59
|
+
range: string[]
|
|
60
|
+
/**
|
|
61
|
+
* 最小日期
|
|
62
|
+
*/
|
|
63
|
+
minDate: number
|
|
64
|
+
/**
|
|
65
|
+
* 最大日期
|
|
66
|
+
*/
|
|
67
|
+
maxDate: number
|
|
68
|
+
/**
|
|
69
|
+
* 默认日期
|
|
70
|
+
*/
|
|
71
|
+
defaultDate: number
|
|
59
72
|
}
|
|
60
73
|
export interface LcbFormProps extends LcbBlockProps {
|
|
61
74
|
fields: LcbFormField[]
|