@tplc/business 0.4.30 → 0.4.31
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 +7 -0
- package/components/lcb-form/lcb-form.vue +27 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.31](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.30...v0.4.31) (2025-03-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* 字段解析 ([38461f0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/38461f09e19042e31dbd52e3a49810f239ebb255))
|
|
11
|
+
|
|
5
12
|
### [0.4.30](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.27...v0.4.30) (2025-03-28)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -168,6 +168,7 @@ import { LcbFormField, LcbFormProps } from './types'
|
|
|
168
168
|
import { customUpload } from '../../utils/utils'
|
|
169
169
|
import { useTranslate } from '@tplc/wot'
|
|
170
170
|
import { DateTimeType } from '@tplc/wot/types/components/wd-datetime-picker-view/types'
|
|
171
|
+
import dayjs from 'dayjs/esm'
|
|
171
172
|
defineOptions({
|
|
172
173
|
name: 'LcbForm',
|
|
173
174
|
options: {
|
|
@@ -202,7 +203,17 @@ watch(
|
|
|
202
203
|
} else if (item.frontInputType === 'checkboxTag' || item.frontInputType === 'checkbox') {
|
|
203
204
|
form.value[item.field] = JSON.parse(item.value)
|
|
204
205
|
} else if (item.frontInputType === 'date') {
|
|
205
|
-
|
|
206
|
+
switch (item.frontInputTypeValue) {
|
|
207
|
+
case 'day':
|
|
208
|
+
form.value[item.field] = dayjs(item.value, 'YYYY-MM-DD').valueOf()
|
|
209
|
+
break
|
|
210
|
+
case 'month':
|
|
211
|
+
form.value[item.field] = dayjs(item.value, 'YYYY-MM').valueOf()
|
|
212
|
+
break
|
|
213
|
+
case 'year':
|
|
214
|
+
form.value[item.field] = dayjs(item.value, 'YYYY').valueOf()
|
|
215
|
+
break
|
|
216
|
+
}
|
|
206
217
|
} else {
|
|
207
218
|
form.value[item.field] = item.value
|
|
208
219
|
}
|
|
@@ -229,7 +240,21 @@ const submit = () => {
|
|
|
229
240
|
if (!valid) return
|
|
230
241
|
if (props.submitUrl) {
|
|
231
242
|
const values = fields.value?.reduce((acc, cur) => {
|
|
232
|
-
|
|
243
|
+
if (cur.frontInputType === 'date') {
|
|
244
|
+
switch (cur.frontInputTypeValue) {
|
|
245
|
+
case 'day':
|
|
246
|
+
acc[cur.field] = dayjs(form.value[cur.field]).format('YYYY-MM-DD')
|
|
247
|
+
break
|
|
248
|
+
case 'month':
|
|
249
|
+
acc[cur.field] = dayjs(form.value[cur.field]).format('YYYY-MM')
|
|
250
|
+
break
|
|
251
|
+
case 'year':
|
|
252
|
+
acc[cur.field] = dayjs(form.value[cur.field]).format('YYYY')
|
|
253
|
+
break
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
acc[cur.field] = form.value[cur.field]
|
|
257
|
+
}
|
|
233
258
|
return acc
|
|
234
259
|
}, {})
|
|
235
260
|
await uni.$lcb.http.post(props.submitUrl, {
|