@tplc/business 0.4.30 → 0.4.32

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 CHANGED
@@ -2,6 +2,28 @@
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.32](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.29...v0.4.32) (2025-03-29)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.30 ([56994b6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/56994b6b39d31332c139b0d8b01844adb35d8dde))
11
+ * **release:** 0.4.31 ([79ab614](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/79ab614e586068201cc3f41dabce96750d0d8aec))
12
+
13
+
14
+ ### ✨ Features | 新功能
15
+
16
+ * form 数据转换 ([779c3d6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/779c3d6f8be76f67a82645ffacf648d7669cca3d))
17
+ * 字段解析 ([38461f0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/38461f09e19042e31dbd52e3a49810f239ebb255))
18
+ * 暂时完成数据 ([0e97d09](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0e97d09182421a21a90659a785e10ae5489d9e61))
19
+
20
+ ### [0.4.31](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.30...v0.4.31) (2025-03-28)
21
+
22
+
23
+ ### ✨ Features | 新功能
24
+
25
+ * 字段解析 ([38461f0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/38461f09e19042e31dbd52e3a49810f239ebb255))
26
+
5
27
  ### [0.4.30](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.27...v0.4.30) (2025-03-28)
6
28
 
7
29
 
@@ -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
- form.value[item.field] = Number(item.value)
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
- acc[cur.field] = form.value[cur.field]
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, {
@@ -1,26 +1,26 @@
1
1
  <template>
2
- <view v-if="extendJson" :style="itemStyle" class="overflow-hidden text-3">
2
+ <view v-if="extendJson" :style="itemStyle" class="overflow-hidden text-3.5">
3
3
  <view
4
4
  class="flex items-center justify-center p-3 bg-white box-border"
5
5
  v-if="extendJson.resultTitle"
6
6
  >
7
7
  <view class="flex items-center justify-center">
8
- <img :src="extendJson.resultIcon" alt="" class="w-4 h-4" />
8
+ <image :src="extendJson.resultIcon" alt="" class="h-4 w-4" />
9
9
  <view class="ml-2">
10
10
  <view class="mt-1">{{ extendJson.resultTitle }}</view>
11
- <view class="text-#969696 text-2.5">{{ extendJson.resultSubTitle }}</view>
11
+ <view class="text-#969696 text-3">{{ extendJson.resultSubTitle }}</view>
12
12
  </view>
13
13
  </view>
14
14
  </view>
15
15
  <view class="p-3 bg-#F5F5F5 box-border">
16
16
  <view class="flex items-center justify-between">
17
17
  <view class="flex items-center gap-1">
18
- <img :src="extendJson.optionIcon" alt="" class="w-3 h-3" />
18
+ <image :src="extendJson.optionIcon" alt="" class="w-3.5 h-3.5" />
19
19
  {{ extendJson.optionTitle }}
20
20
  </view>
21
21
  <view class="flex items-center justify-center" @click="handleClearAll">
22
22
  <wd-icon name="delete1" size="16" />
23
- <text class="ml-0.5">清空</text>
23
+ <text class="ml-0.5 text-3">清空</text>
24
24
  </view>
25
25
  </view>
26
26
  <view class="flex flex-wrap gap-1 mt-2">
@@ -37,6 +37,13 @@
37
37
  </block>
38
38
  </view>
39
39
  </view>
40
+ <view
41
+ class="py-2 px-3 bg-white box-border flex items-center gap-1"
42
+ v-if="extendJson.recommendTitle"
43
+ >
44
+ <image :src="extendJson.recommendIcon" alt="" class="w-3.5 h-3.5" />
45
+ <view>{{ extendJson.recommendTitle }}</view>
46
+ </view>
40
47
  </view>
41
48
  </template>
42
49
 
@@ -58,6 +65,8 @@ interface UnconditionedLayoutConfig {
58
65
  resultTitle: string
59
66
  optionIcon: string
60
67
  resultSubTitle: string
68
+ recommendTitle: string
69
+ recommendIcon: string
61
70
  }
62
71
 
63
72
  const list = inject(LIST_FORM_CHOOSER_VALUES) as Ref<ListFormChooserValues>
@@ -116,6 +125,7 @@ const removeTag = (value: string, key: string, length: number) => {
116
125
  * 清空所有标签
117
126
  */
118
127
  const handleClearAll = () => {
128
+ form.value.keywords = undefined
119
129
  Object.keys(list.value).forEach((v) => {
120
130
  form.value[v] = undefined
121
131
  list.value[v] = []
@@ -58,6 +58,7 @@ const getData = async () => {
58
58
  productIdList: props.items.map((item) => item.productId),
59
59
  productType: props.items[0].productType,
60
60
  listType: props.listType,
61
+ sortType: props.sortType,
61
62
  ...requestParams,
62
63
  })
63
64
  renderList.value = data as Record<string, any>[]
@@ -121,7 +122,7 @@ watch(
121
122
  { immediate: true, deep: true },
122
123
  )
123
124
  watch(
124
- () => props.listType,
125
+ () => [props.listType, props.sortType],
125
126
  () => {
126
127
  getData()
127
128
  },
@@ -12,6 +12,7 @@ export interface LcbProductProps extends LcbBlockProps {
12
12
  borderRadius?: number
13
13
  column?: number
14
14
  itemWidth?: number // 列表项宽度
15
+ sortType?: number // 排序类型
15
16
  items?: {
16
17
  productId: string
17
18
  [key: string]: any
@@ -48,11 +48,11 @@
48
48
  mode="aspectFill"
49
49
  />
50
50
  </view>
51
- <view v-if="item.price">
51
+ <view v-if="item.price" class="ml-2">
52
52
  <text class="font-600 text-primary text-3.5">¥{{ item.price }}</text>
53
53
  <text>{{ item.priceSuffix }}</text>
54
54
  </view>
55
- <view v-else-if="item.tags">
55
+ <view v-else-if="item.tags" class="ml-2">
56
56
  {{ getJsonStrFirstUrl(item.tags) }}
57
57
  </view>
58
58
  </view>
@@ -75,8 +75,13 @@
75
75
  @click="onClear"
76
76
  />
77
77
  </view>
78
- <lcb-action-view v-bind="link" :urlParams="stringify(addressCity)" v-else>
79
- {{ placeholder }}
78
+ <lcb-action-view
79
+ v-bind="link"
80
+ :urlParams="stringify(addressCity)"
81
+ v-else
82
+ custom-class="flex-1"
83
+ >
84
+ {{ form.keywords || placeholder }}
80
85
  </lcb-action-view>
81
86
  </view>
82
87
  </lcb-block>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -4,6 +4,8 @@ interface UnconditionedLayoutConfig {
4
4
  resultTitle: string
5
5
  optionIcon: string
6
6
  resultSubTitle: string
7
+ recommendTitle: string
8
+ recommendIcon: string
7
9
  }
8
10
  declare const _default: import('vue').DefineComponent<
9
11
  __VLS_WithDefaults<
@@ -10,6 +10,7 @@ export interface LcbProductProps extends LcbBlockProps {
10
10
  borderRadius?: number
11
11
  column?: number
12
12
  itemWidth?: number
13
+ sortType?: number
13
14
  items?: {
14
15
  productId: string
15
16
  [key: string]: any