@tplc/business 0.4.144 → 0.4.146
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 +25 -0
- package/components/lcb-form/lcb-form.vue +157 -51
- package/components/lcb-form/types.ts +1 -0
- package/components/lcb-list/components/SelectTagView/index.vue +1 -1
- package/components/lcb-list/components/TagSelect/index.vue +1 -1
- package/package.json +2 -2
- package/types/components/lcb-form/lcb-form.vue.d.ts +3 -0
- package/types/components/lcb-form/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
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.146](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.88...v0.4.146) (2025-06-27)
|
|
6
|
+
|
|
7
|
+
### [0.4.145](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.137...v0.4.145) (2025-06-26)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
11
|
+
|
|
12
|
+
* **release:** 0.4.138 ([0ee0a18](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0ee0a1833bd16737bb8836e3c6a079cc64fb1aa1))
|
|
13
|
+
* **release:** 0.4.139 ([92dc61b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/92dc61b990c23667476c0ac263442e174ca9a8b5))
|
|
14
|
+
* **release:** 0.4.140 ([50fbedc](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/50fbedc1630dd2ef813fd080b2a0c2f02dc31d34))
|
|
15
|
+
* **release:** 0.4.141 ([2783dce](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2783dcef5d5e489482a624a4c269b58d30a85b64))
|
|
16
|
+
* **release:** 0.4.142 ([d28832e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d28832e662b15a73c5211b643c6fc26b4f2eb3d3))
|
|
17
|
+
* **release:** 0.4.143 ([4e60624](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4e606245eea8d216c0587d44b0b3229e6a9434b9))
|
|
18
|
+
* **release:** 0.4.144 ([b117b6b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b117b6bec7d76c12139bc40da456f10e81520172))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### ✨ Features | 新功能
|
|
22
|
+
|
|
23
|
+
* 修改历史记录 ([c4ad91a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c4ad91ab244d2aee37791fe507ee87e67bd80bc6))
|
|
24
|
+
* 修改标题 ([7da5202](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7da52029917c0ea44daa2b2ec36237e9105bde2b))
|
|
25
|
+
* 修改销 ([9e78ead](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9e78ead10c5186ed1805086e32f481e65c0e0b4d))
|
|
26
|
+
* 新增room calendar ([08ed10c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/08ed10c9f34b0c6c32834f0dfad713800d095ae6))
|
|
27
|
+
* 调整字段 ([363344f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/363344f740e50b5fe866024a304f56e7f7b12cc7))
|
|
28
|
+
* 页面点击 ([3af52a2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3af52a217341403dee7ecb2f096196d0c74a888d))
|
|
29
|
+
|
|
5
30
|
### [0.4.144](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.143...v0.4.144) (2025-06-25)
|
|
6
31
|
|
|
7
32
|
### [0.4.143](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.142...v0.4.143) (2025-06-25)
|
|
@@ -1,58 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<lcb-block v-bind="$props">
|
|
3
|
-
<wd-form custom-class="lcb-form" ref="formRef" :model="form">
|
|
3
|
+
<wd-form :custom-class="`lcb-form ${vertical ? 'vertical' : ''}`" ref="formRef" :model="form">
|
|
4
4
|
<wd-cell-group border>
|
|
5
5
|
<block v-for="field in fields" :key="field.entryFormFieldConfigId">
|
|
6
|
-
<wd-input
|
|
7
|
-
v-if="field.frontInputType === 'input'"
|
|
8
|
-
:placeholder="field.frontPlaceholder || t('请输入') + field.fieldCustomName"
|
|
9
|
-
v-model="form[field.field]"
|
|
10
|
-
:label="field.fieldCustomName"
|
|
11
|
-
:required="field.requiredFlag"
|
|
12
|
-
:prop="field.field"
|
|
13
|
-
:rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
|
|
14
|
-
v-bind="field.props"
|
|
15
|
-
/>
|
|
16
|
-
<wd-textarea
|
|
17
|
-
v-else-if="field.frontInputType === 'inputArea'"
|
|
18
|
-
:placeholder="field.frontPlaceholder || t('请输入') + field.fieldCustomName"
|
|
19
|
-
v-model="form[field.field]"
|
|
20
|
-
:label="field.fieldCustomName"
|
|
21
|
-
:required="field.requiredFlag"
|
|
22
|
-
:prop="field.field"
|
|
23
|
-
:rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
|
|
24
|
-
v-bind="field.props"
|
|
25
|
-
/>
|
|
26
|
-
<wd-picker
|
|
27
|
-
v-else-if="field.frontInputType === 'selector'"
|
|
28
|
-
:columns="getColumns(field.frontInputContent)"
|
|
29
|
-
:label="field.fieldCustomName"
|
|
30
|
-
v-model="form[field.field]"
|
|
31
|
-
:required="field.requiredFlag"
|
|
32
|
-
:prop="field.field"
|
|
33
|
-
:rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
|
|
34
|
-
v-bind="field.props"
|
|
35
|
-
/>
|
|
36
|
-
<wd-datetime-picker
|
|
37
|
-
v-else-if="field.frontInputType === 'date'"
|
|
38
|
-
:label="field.fieldCustomName"
|
|
39
|
-
v-model="form[field.field]"
|
|
40
|
-
:required="field.requiredFlag"
|
|
41
|
-
:prop="field.field"
|
|
42
|
-
:type="getDateType(field.frontInputTypeValue)"
|
|
43
|
-
:rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
|
|
44
|
-
v-bind="{
|
|
45
|
-
...field.props,
|
|
46
|
-
...getDateOptions(field.frontInputContent),
|
|
47
|
-
}"
|
|
48
|
-
/>
|
|
49
6
|
<!-- radio -->
|
|
50
7
|
<wd-cell
|
|
51
|
-
v-else
|
|
52
8
|
:title="field.fieldCustomName"
|
|
53
9
|
:required="field.requiredFlag"
|
|
54
10
|
:prop="field.field"
|
|
55
|
-
title-width="230rpx"
|
|
11
|
+
:title-width="!vertical ? '230rpx' : '100%'"
|
|
12
|
+
:vertical="vertical"
|
|
56
13
|
:rules="
|
|
57
14
|
field.requiredFlag
|
|
58
15
|
? [
|
|
@@ -64,11 +21,40 @@
|
|
|
64
21
|
: []
|
|
65
22
|
"
|
|
66
23
|
>
|
|
24
|
+
<wd-input
|
|
25
|
+
v-if="field.frontInputType === 'input'"
|
|
26
|
+
:placeholder="field.frontPlaceholder || t('请输入') + field.fieldCustomName"
|
|
27
|
+
v-model="form[field.field]"
|
|
28
|
+
v-bind="field.props"
|
|
29
|
+
no-border
|
|
30
|
+
/>
|
|
31
|
+
<wd-textarea
|
|
32
|
+
v-else-if="field.frontInputType === 'inputArea'"
|
|
33
|
+
:placeholder="field.frontPlaceholder || t('请输入') + field.fieldCustomName"
|
|
34
|
+
v-model="form[field.field]"
|
|
35
|
+
v-bind="field.props"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<wd-picker
|
|
39
|
+
v-else-if="field.frontInputType === 'selector'"
|
|
40
|
+
:columns="getColumns(field.frontInputContent)"
|
|
41
|
+
v-model="form[field.field]"
|
|
42
|
+
v-bind="field.props"
|
|
43
|
+
/>
|
|
44
|
+
<wd-datetime-picker
|
|
45
|
+
v-else-if="field.frontInputType === 'date'"
|
|
46
|
+
v-model="form[field.field]"
|
|
47
|
+
:type="getDateType(field.frontInputTypeValue)"
|
|
48
|
+
v-bind="{
|
|
49
|
+
...field.props,
|
|
50
|
+
...getDateOptions(field.frontInputContent),
|
|
51
|
+
}"
|
|
52
|
+
/>
|
|
67
53
|
<wd-radio-group
|
|
68
|
-
v-if="field.frontInputType === 'radio'"
|
|
54
|
+
v-else-if="field.frontInputType === 'radio'"
|
|
69
55
|
v-model="form[field.field]"
|
|
70
56
|
v-bind="field.props"
|
|
71
|
-
inline
|
|
57
|
+
:inline="!vertical"
|
|
72
58
|
shape="dot"
|
|
73
59
|
>
|
|
74
60
|
<wd-radio
|
|
@@ -78,6 +64,17 @@
|
|
|
78
64
|
>
|
|
79
65
|
{{ item }}
|
|
80
66
|
</wd-radio>
|
|
67
|
+
<template v-if="field.frontInputTypeValue === '1'">
|
|
68
|
+
<wd-radio :value="customField" key="custom">其他</wd-radio>
|
|
69
|
+
<view class="custom-input" v-if="form[field.field] === customField">
|
|
70
|
+
<wd-input
|
|
71
|
+
:placeholder="`请输入自定义内容`"
|
|
72
|
+
v-model="customInputs[field.field]"
|
|
73
|
+
size="small"
|
|
74
|
+
:no-border="true"
|
|
75
|
+
/>
|
|
76
|
+
</view>
|
|
77
|
+
</template>
|
|
81
78
|
</wd-radio-group>
|
|
82
79
|
<wd-radio-group
|
|
83
80
|
v-else-if="field.frontInputType === 'radioTag'"
|
|
@@ -92,6 +89,17 @@
|
|
|
92
89
|
>
|
|
93
90
|
{{ item }}
|
|
94
91
|
</wd-radio>
|
|
92
|
+
<template v-if="field.frontInputTypeValue === '1'">
|
|
93
|
+
<wd-radio :value="customField" key="custom">其他</wd-radio>
|
|
94
|
+
<view class="custom-input" v-if="form[field.field] === customField">
|
|
95
|
+
<wd-input
|
|
96
|
+
:placeholder="`请输入自定义内容`"
|
|
97
|
+
v-model="customInputs[field.field]"
|
|
98
|
+
size="small"
|
|
99
|
+
:no-border="true"
|
|
100
|
+
/>
|
|
101
|
+
</view>
|
|
102
|
+
</template>
|
|
95
103
|
</wd-radio-group>
|
|
96
104
|
<!-- checkbox -->
|
|
97
105
|
<wd-checkbox-group
|
|
@@ -106,6 +114,17 @@
|
|
|
106
114
|
>
|
|
107
115
|
{{ item }}
|
|
108
116
|
</wd-checkbox>
|
|
117
|
+
<template v-if="field.frontInputTypeValue === '1'">
|
|
118
|
+
<wd-checkbox :modelValue="customField" key="custom">其他</wd-checkbox>
|
|
119
|
+
<view class="custom-input" v-if="form[field.field]?.includes(customField)">
|
|
120
|
+
<wd-input
|
|
121
|
+
:placeholder="`请输入自定义内容`"
|
|
122
|
+
v-model="customInputs[field.field]"
|
|
123
|
+
size="small"
|
|
124
|
+
:no-border="true"
|
|
125
|
+
/>
|
|
126
|
+
</view>
|
|
127
|
+
</template>
|
|
109
128
|
</wd-checkbox-group>
|
|
110
129
|
<!-- checkboxTag -->
|
|
111
130
|
<wd-checkbox-group
|
|
@@ -121,6 +140,17 @@
|
|
|
121
140
|
>
|
|
122
141
|
{{ item }}
|
|
123
142
|
</wd-checkbox>
|
|
143
|
+
<template v-if="field.frontInputTypeValue === '1'">
|
|
144
|
+
<wd-checkbox :modelValue="customField" key="custom">其他</wd-checkbox>
|
|
145
|
+
<view class="custom-input" v-if="form[field.field]?.includes(customField)">
|
|
146
|
+
<wd-input
|
|
147
|
+
:placeholder="`请输入自定义内容`"
|
|
148
|
+
v-model="customInputs[field.field]"
|
|
149
|
+
size="small"
|
|
150
|
+
:no-border="true"
|
|
151
|
+
/>
|
|
152
|
+
</view>
|
|
153
|
+
</template>
|
|
124
154
|
</wd-checkbox-group>
|
|
125
155
|
<wd-upload
|
|
126
156
|
v-else-if="field.frontInputType === 'img'"
|
|
@@ -191,23 +221,34 @@ const props = withDefaults(defineProps<LcbFormProps>(), {
|
|
|
191
221
|
submitText: '提交',
|
|
192
222
|
affirmText: '同意',
|
|
193
223
|
bottomFixed: true,
|
|
224
|
+
vertical: false,
|
|
194
225
|
})
|
|
195
226
|
const fields = ref<LcbFormField[]>()
|
|
227
|
+
const customInputs = ref<Record<string, string>>({})
|
|
228
|
+
const customField = 'custom'
|
|
196
229
|
watch(
|
|
197
230
|
() => props.formType,
|
|
198
231
|
async (newVal) => {
|
|
199
232
|
if (newVal) {
|
|
200
233
|
const {
|
|
201
|
-
data: { entryFormFieldConfigList },
|
|
234
|
+
data: { entryFormFieldConfigList = [], extra = '{}' },
|
|
202
235
|
} = await uni.$lcb.http.post<any>('/entryFormCustom/detail', {
|
|
203
236
|
entryFormConfigId: newVal,
|
|
204
237
|
})
|
|
238
|
+
const extraData = JSON.parse(extra)
|
|
239
|
+
customInputs.value = extraData
|
|
240
|
+
|
|
205
241
|
entryFormFieldConfigList.forEach((item) => {
|
|
206
242
|
if (item.value) {
|
|
207
243
|
if (item.frontInputType === 'img') {
|
|
208
244
|
imgList.value[item.field] = [{ url: item.value }]
|
|
209
245
|
} else if (item.frontInputType === 'checkboxTag' || item.frontInputType === 'checkbox') {
|
|
210
|
-
|
|
246
|
+
const values = JSON.parse(item.value)
|
|
247
|
+
form.value[item.field] = values.map((val) =>
|
|
248
|
+
val === extraData[item.field] ? customField : val,
|
|
249
|
+
)
|
|
250
|
+
} else if (item.frontInputType === 'radioTag' || item.frontInputType === 'radio') {
|
|
251
|
+
form.value[item.field] = extraData[item.field] === item.value ? customField : item.value
|
|
211
252
|
} else if (item.frontInputType === 'date') {
|
|
212
253
|
switch (item.frontInputTypeValue) {
|
|
213
254
|
case 'day':
|
|
@@ -244,7 +285,10 @@ const submit = () => {
|
|
|
244
285
|
}
|
|
245
286
|
formRef.value.validate().then(async ({ valid }) => {
|
|
246
287
|
if (!valid) return
|
|
288
|
+
|
|
247
289
|
if (props.submitUrl) {
|
|
290
|
+
// 用户自定义内容集合
|
|
291
|
+
const extra = {}
|
|
248
292
|
const values = fields.value?.reduce((acc, cur) => {
|
|
249
293
|
if (cur.frontInputType === 'date') {
|
|
250
294
|
switch (cur.frontInputTypeValue) {
|
|
@@ -259,13 +303,34 @@ const submit = () => {
|
|
|
259
303
|
break
|
|
260
304
|
}
|
|
261
305
|
} else {
|
|
262
|
-
|
|
306
|
+
const customValue = customInputs.value[cur.field] || ''
|
|
307
|
+
let fieldValue = form.value[cur.field]
|
|
308
|
+
|
|
309
|
+
// 处理自定义输入值
|
|
310
|
+
if (['radio', 'radioTag'].includes(cur.frontInputType) && fieldValue === customField) {
|
|
311
|
+
fieldValue = customValue
|
|
312
|
+
extra[cur.field] = customValue
|
|
313
|
+
} else if (
|
|
314
|
+
['checkbox', 'checkboxTag'].includes(cur.frontInputType) &&
|
|
315
|
+
Array.isArray(fieldValue)
|
|
316
|
+
) {
|
|
317
|
+
const haveCustom = fieldValue.includes(customField)
|
|
318
|
+
if (haveCustom) {
|
|
319
|
+
extra[cur.field] = customValue
|
|
320
|
+
}
|
|
321
|
+
fieldValue = [...fieldValue, haveCustom ? customValue : '']
|
|
322
|
+
.map((val) => (val === customField ? '' : val))
|
|
323
|
+
.filter((val) => val !== '')
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
acc[cur.field] = fieldValue
|
|
263
327
|
}
|
|
264
328
|
return acc
|
|
265
329
|
}, {})
|
|
266
330
|
await uni.$lcb.http.post(props.submitUrl, {
|
|
267
331
|
entryFormConfigId: props.formType,
|
|
268
332
|
allField: JSON.stringify(values),
|
|
333
|
+
extra: JSON.stringify(extra),
|
|
269
334
|
})
|
|
270
335
|
}
|
|
271
336
|
})
|
|
@@ -308,6 +373,7 @@ watch(
|
|
|
308
373
|
display: flex;
|
|
309
374
|
flex-wrap: wrap;
|
|
310
375
|
gap: 8rpx;
|
|
376
|
+
// flex-direction: column;
|
|
311
377
|
}
|
|
312
378
|
:deep(.wd-checkbox) {
|
|
313
379
|
line-height: inherit !important;
|
|
@@ -319,8 +385,40 @@ watch(
|
|
|
319
385
|
display: flex;
|
|
320
386
|
flex-wrap: wrap;
|
|
321
387
|
gap: 8rpx;
|
|
388
|
+
// flex-direction: column;
|
|
389
|
+
}
|
|
390
|
+
:deep(.wd-picker) {
|
|
391
|
+
.wd-picker__cell {
|
|
392
|
+
padding: 0;
|
|
393
|
+
&:after {
|
|
394
|
+
display: none !important;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
:deep(.wd-textarea) {
|
|
399
|
+
padding: 0;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.vertical {
|
|
404
|
+
:deep(.wd-radio-group) {
|
|
405
|
+
flex-direction: column !important;
|
|
406
|
+
}
|
|
407
|
+
:deep(.wd-checkbox-group) {
|
|
408
|
+
flex-direction: column !important;
|
|
409
|
+
.is-button-box {
|
|
410
|
+
width: 100%;
|
|
411
|
+
box-sizing: border-box;
|
|
412
|
+
}
|
|
413
|
+
.wd-checkbox__txt {
|
|
414
|
+
white-space: break-spaces;
|
|
415
|
+
}
|
|
416
|
+
.wd-checkbox__label {
|
|
417
|
+
height: auto !important;
|
|
418
|
+
}
|
|
322
419
|
}
|
|
323
420
|
}
|
|
421
|
+
|
|
324
422
|
.bottom-fixed {
|
|
325
423
|
position: fixed;
|
|
326
424
|
bottom: 0;
|
|
@@ -330,4 +428,12 @@ watch(
|
|
|
330
428
|
z-index: 5;
|
|
331
429
|
box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
|
|
332
430
|
}
|
|
431
|
+
.custom-input {
|
|
432
|
+
margin-top: 8rpx;
|
|
433
|
+
width: 100%;
|
|
434
|
+
border: 1rpx solid #e5e5e5;
|
|
435
|
+
border-radius: 4rpx;
|
|
436
|
+
padding: 8rpx;
|
|
437
|
+
box-sizing: border-box;
|
|
438
|
+
}
|
|
333
439
|
</style>
|
|
@@ -41,7 +41,7 @@ defineProps<{ title: string; checked?: boolean; size?: 'small' | 'normal' }>()
|
|
|
41
41
|
color: #ffffff;
|
|
42
42
|
}
|
|
43
43
|
&-small {
|
|
44
|
-
width: 112rpx !important;
|
|
44
|
+
min-width: 112rpx !important;
|
|
45
45
|
height: 42rpx !important;
|
|
46
46
|
border-radius: 21rpx !important;
|
|
47
47
|
line-height: 42rpx !important;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tplc/business",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.146",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"业务组件"
|
|
6
6
|
],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"vue": ">=3.2.47",
|
|
14
|
-
"@tplc/wot": "0.1.
|
|
14
|
+
"@tplc/wot": "0.1.88"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18",
|
|
@@ -6,6 +6,7 @@ declare const _default: import('vue').DefineComponent<
|
|
|
6
6
|
submitText: string
|
|
7
7
|
affirmText: string
|
|
8
8
|
bottomFixed: boolean
|
|
9
|
+
vertical: boolean
|
|
9
10
|
}
|
|
10
11
|
>,
|
|
11
12
|
{},
|
|
@@ -25,11 +26,13 @@ declare const _default: import('vue').DefineComponent<
|
|
|
25
26
|
submitText: string
|
|
26
27
|
affirmText: string
|
|
27
28
|
bottomFixed: boolean
|
|
29
|
+
vertical: boolean
|
|
28
30
|
}
|
|
29
31
|
>
|
|
30
32
|
>
|
|
31
33
|
>,
|
|
32
34
|
{
|
|
35
|
+
vertical: boolean
|
|
33
36
|
submitText: string
|
|
34
37
|
affirmText: string
|
|
35
38
|
bottomFixed: boolean
|