@tplc/business 0.2.66 → 0.2.67

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,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.2.67](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.66...v0.2.67) (2025-01-05)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 新增配置 ([3f75c1f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3f75c1f75f1f86d1f5049700bef7af0b1d1185cd))
11
+
5
12
  ### [0.2.66](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.65...v0.2.66) (2025-01-05)
6
13
 
7
14
 
@@ -25,53 +25,33 @@
25
25
  </template>
26
26
 
27
27
  <FilterList
28
- v-bind="{ ...info.listInfo, listType, ...attrs }"
28
+ v-bind="{ ...info.listInfo, listType, ...props }"
29
29
  :autoHeight="!isSticky"
30
30
  v-model="items"
31
31
  v-if="mode === 'list'"
32
32
  >
33
33
  <slot name="list" :items="items" v-if="$slots.list" />
34
34
  <template v-else>
35
- <lcb-product
36
- v-bind="{ ...attrs, form }"
37
- :listType="listType"
38
- :imageWidth="imageWidth"
39
- :imageHeight="imageHeight"
40
- :items="items"
41
- :titleLineClamp="titleLineClamp"
42
- :layoutType="layoutType"
43
- v-if="$slots.item"
44
- >
35
+ <lcb-product v-bind="{ ...$props, form }" :items="items" v-if="$slots.item">
45
36
  <template #item="{ item }">
46
37
  <slot name="item" :item="item"></slot>
47
38
  </template>
48
39
  </lcb-product>
49
- <lcb-product
50
- v-bind="{ ...attrs, form }"
51
- :imageWidth="imageWidth"
52
- :listType="listType"
53
- :items="items"
54
- :imageHeight="imageHeight"
55
- :layoutType="layoutType"
56
- :titleLineClamp="titleLineClamp"
57
- v-else
58
- />
40
+ <lcb-product v-bind="{ ...$props, form }" :items="items" v-else />
59
41
  </template>
60
42
  </FilterList>
61
- <lcb-map v-else-if="mode === 'map'" v-bind="{ ...info.listInfo, ...attrs }" />
43
+ <lcb-map v-else-if="mode === 'map'" v-bind="{ ...info.listInfo, ...$props }" />
62
44
  </template>
63
- <!-- <lcb-product v-bind="{ ...attrs }" :listType="listType" :items="mockData.data" v-else /> -->
64
45
  </template>
65
46
 
66
47
  <script setup lang="ts">
67
- import { inject, Ref, ref, useAttrs, watch } from 'vue'
48
+ import { inject, Ref, ref, watch } from 'vue'
68
49
  import { getFilterDetail, LcbFilterResult } from './api'
69
50
  import FilterList from './components/FilterList/index.vue'
70
51
  import FilterView from './components/FilterView/index.vue'
71
52
  import { LcbListProps } from './types'
72
53
  import { FORM_KEY } from '../../constants'
73
54
  import './index.scss'
74
- const attrs = useAttrs()
75
55
  /** 是否悬停 */
76
56
  const sticky = ref(false)
77
57
  const items = ref([])
@@ -87,7 +67,7 @@ const titleObj = ref<Record<string, any>>({})
87
67
  const form = inject<Ref<Record<string, any>>>(FORM_KEY)
88
68
  const props = withDefaults(defineProps<LcbListProps>(), {
89
69
  pageFilterType: 'hotelTravelFilter',
90
- border: true,
70
+ borderRadius: 12,
91
71
  styleMode: 'default',
92
72
  listType: 'list',
93
73
  isSticky: true,
@@ -4,15 +4,18 @@ import { LcbProductProps } from '../lcb-product/types'
4
4
  export interface LcbListProps {
5
5
  pageFilterType?: string
6
6
  pageListProps?: PageListProps
7
- border?: boolean
7
+ borderRadius?: number
8
8
  styleMode?: 'default' | 'plain'
9
9
  imageWidth?: number
10
+ border?: boolean
10
11
  imageHeight?: number
11
12
  titleLineClamp?: number
12
13
  listType?: LcbProductProps['listType']
13
14
  isSticky?: boolean
14
15
  mode?: 'map' | 'list'
15
16
  layoutType?: 'vertical' | 'horizontal'
17
+ imageRadius?: number
18
+ itemWidth?: number // 列表项宽度
16
19
  }
17
20
  export interface Option {
18
21
  label: string
@@ -4,7 +4,6 @@ import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
4
4
  import { LcbProductProps } from './types'
5
5
  import { transformValueUnit } from '../../utils/transform'
6
6
 
7
- const attrs = useAttrs()
8
7
  const uWaterfallRef = ref()
9
8
  defineOptions({
10
9
  name: 'LcbProduct',
@@ -55,16 +54,15 @@ watch(
55
54
  />
56
55
  <lcb-product-item
57
56
  v-else
58
- v-bind="{ ...item, ...attrs }"
57
+ v-bind="{ ...item, ...$props }"
59
58
  :layoutType="layoutType"
60
59
  :coverImgStyle="{
61
60
  width: layoutType === 'vertical' ? '100%' : transformValueUnit(imageWidth),
62
61
  height: layoutType === 'vertical' ? transformValueUnit(imageHeight) : undefined,
63
62
  minHeight: layoutType !== 'vertical' ? transformValueUnit(imageHeight) : undefined,
64
63
  borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
65
- ...(attrs?.coverImgStyle ?? {}),
64
+ ...($props?.coverImgStyle ?? {}),
66
65
  }"
67
- :titleLineClamp="titleLineClamp"
68
66
  ></lcb-product-item>
69
67
  </slot>
70
68
  </lcb-action-view>
@@ -89,15 +87,14 @@ watch(
89
87
  />
90
88
  <lcb-product-item
91
89
  v-else
92
- v-bind="{ ...item, ...attrs }"
90
+ v-bind="{ ...item, ...$props }"
93
91
  layoutType="vertical"
94
92
  :coverImgStyle="{
95
93
  width: '100%',
96
94
  height: transformValueUnit(imageHeight),
97
95
  borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
98
- ...(attrs?.coverImgStyle ?? {}),
96
+ ...($props?.coverImgStyle ?? {}),
99
97
  }"
100
- :titleLineClamp="titleLineClamp"
101
98
  ></lcb-product-item>
102
99
  </slot>
103
100
  </view>
@@ -126,10 +123,9 @@ watch(
126
123
  />
127
124
  <lcb-product-item
128
125
  v-else
129
- v-bind="{ ...item, ...attrs }"
126
+ v-bind="{ ...item, ...$props }"
130
127
  layoutType="vertical"
131
128
  tag-overflow-wrap
132
- :titleLineClamp="titleLineClamp"
133
129
  >
134
130
  <template #coverImg="{ value }">
135
131
  <image :src="value" class="w-full" mode="widthFix" />
@@ -159,10 +155,9 @@ watch(
159
155
  />
160
156
  <lcb-product-item
161
157
  v-else
162
- v-bind="{ ...item, ...attrs }"
158
+ v-bind="{ ...item, ...$props }"
163
159
  layoutType="vertical"
164
160
  tag-overflow-wrap
165
- :titleLineClamp="titleLineClamp"
166
161
  >
167
162
  <template #coverImg="{ value }">
168
163
  <image :src="value" class="w-full" mode="widthFix" />
@@ -181,7 +176,10 @@ watch(
181
176
  v-for="(item, index) in items"
182
177
  :key="`${item?.productId}:${index}`"
183
178
  class="inline-block"
184
- :style="{ width: `${itemWidth}rpx`, marginLeft: index === 0 ? 0 : '24rpx' }"
179
+ :style="{
180
+ width: `${itemWidth}rpx`,
181
+ marginLeft: index === 0 ? 0 : '24rpx',
182
+ }"
185
183
  >
186
184
  <slot name="item" :item="item">
187
185
  <lcb-absolute-config-layout
@@ -202,7 +200,7 @@ watch(
202
200
  height: layoutType === 'vertical' ? transformValueUnit(imageHeight) : undefined,
203
201
  minHeight: layoutType !== 'vertical' ? transformValueUnit(imageHeight) : undefined,
204
202
  borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
205
- ...(attrs?.coverImgStyle ?? {}),
203
+ ...($props?.coverImgStyle ?? {}),
206
204
  }"
207
205
  :titleLineClamp="titleLineClamp"
208
206
  ></lcb-product-item>
@@ -4,11 +4,13 @@ export interface LcbProductProps {
4
4
  imageWidth?: number
5
5
  imageHeight?: number
6
6
  imageRadius?: number
7
+ borderRadius?: number
7
8
  itemWidth?: number // 列表项宽度
8
9
  items?: Record<string, any>[]
9
10
  form?: Record<string, any>
10
11
  layoutType?: 'vertical' | 'horizontal' // 布局方式
11
12
  titleLineClamp?: number
13
+ coverImgStyle?: Record<string, any>
12
14
  renderItemAbsoluteConfigLayout?: {
13
15
  dataset?: Record<string, any>
14
16
  blocks: any[]
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { computed, provide, useAttrs } from 'vue'
2
+ import { provide, useAttrs } from 'vue'
3
3
  import { LcbProductItemProps } from './types'
4
4
  import ItemValue from './components/ItemValue.vue'
5
+ import { transformValueUnit } from '../../utils/transform'
5
6
  defineOptions({
6
7
  name: 'LcbProductItem',
7
8
  options: {
@@ -46,6 +47,7 @@ const props = withDefaults(defineProps<LcbProductItemProps>(), {
46
47
  tagsVisible: true,
47
48
  addressIntroVisible: true,
48
49
  distanceVisible: true,
50
+ borderRadius: 12,
49
51
  })
50
52
  const attrs = useAttrs()
51
53
  provide('lcb-product-item-props', props)
@@ -93,7 +95,10 @@ defineSlots<{
93
95
  <view
94
96
  v-if="layoutType === 'horizontal'"
95
97
  :class="className"
96
- class="flex flex-col gap-1 px-2 py-3 bg-white relative"
98
+ class="flex flex-col gap-1 px-2 py-3 bg-white relative overflow-clip"
99
+ :style="{
100
+ borderRadius: transformValueUnit(borderRadius),
101
+ }"
97
102
  >
98
103
  <slot name="itemSection" />
99
104
  <slot name="itemTopSection" />
@@ -123,33 +128,6 @@ defineSlots<{
123
128
  <view class="flex flex-col flex-1 text-26rpx overflow-hidden relative">
124
129
  <slot name="contentSection" />
125
130
  <view class="flex flex-col gap-[5px] overflow-hidden">
126
- <!-- <template
127
- v-for="propName in ['productName', 'subTitle', 'addressIntro', 'distance', 'tags']"
128
- :key="propName"
129
- >
130
- <ItemValue :prop="propName" v-if="!!$slots?.[propName]">
131
- <template #coverImg="{ value }"><slot name="coverImg" :value="value" /></template>
132
- <template #productName="{ value }"><slot name="productName" :value="value" /></template>
133
- <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
134
- <template #price="{ value }"><slot name="price" :value="value" /></template>
135
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
136
- <template #priceSuffix="{ value }">
137
- <slot name="priceSuffix" :value="value" />
138
- </template>
139
- <template #scribePrice="{ value }">
140
- <slot name="scribePrice" :value="value" />
141
- </template>
142
- <template #scribePriceUnit="{ value }">
143
- <slot name="scribePriceUnit" :value="value" />
144
- </template>
145
- <template #tags="{ value }"><slot name="tags" :value="value" /></template>
146
- <template #addressIntro="{ value }">
147
- <slot name="addressIntro" :value="value" />
148
- </template>
149
- <template #distance="{ value }"><slot name="distance" :value="value" /></template>
150
- </ItemValue>
151
- <ItemValue :prop="propName" v-else />
152
- </template> -->
153
131
  <view class="text-ellipsis line-clamp-2">
154
132
  <ItemValue prop="productName">
155
133
  <!-- <template #productName="{ value }"><slot name="productName" :value="value" /></template> -->
@@ -257,7 +235,14 @@ defineSlots<{
257
235
  </view>
258
236
 
259
237
  <!-- 竖向布局 -->
260
- <view v-if="layoutType === 'vertical'" class="flex bg-white relative" :class="className">
238
+ <view
239
+ v-if="layoutType === 'vertical'"
240
+ class="flex bg-white relative overflow-hidden"
241
+ :class="className"
242
+ :style="{
243
+ borderRadius: transformValueUnit(borderRadius),
244
+ }"
245
+ >
261
246
  <slot name="itemSection" />
262
247
  <slot name="itemLeftSection" />
263
248
  <view class="flex-1 flex flex-col w-full overflow-hidden">
@@ -15,7 +15,7 @@ export interface LcbProductItemProps {
15
15
  tagRound?: boolean
16
16
  distanceUnit?: string
17
17
  imageType?: 'square' | 'vertical' | 'horizontal'
18
-
18
+ borderRadius?: number
19
19
  coverImg?: any
20
20
  productName?: any
21
21
  headImg?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.66",
3
+ "version": "0.2.67",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -20,16 +20,19 @@ declare const __VLS_component: import('vue').DefineComponent<
20
20
  >,
21
21
  {
22
22
  mode: 'map' | 'list'
23
+ imageRadius: number
23
24
  imageWidth: number
25
+ borderRadius: number
24
26
  imageHeight: number
25
27
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
26
28
  pageFilterType: string
27
29
  pageListProps: import('./components/FilterList/type').PageListProps
28
- border: boolean
29
30
  styleMode: 'default' | 'plain'
31
+ border: boolean
30
32
  titleLineClamp: number
31
33
  isSticky: boolean
32
34
  layoutType: 'vertical' | 'horizontal'
35
+ itemWidth: number
33
36
  },
34
37
  {}
35
38
  >
@@ -3,15 +3,18 @@ import { LcbProductProps } from '../lcb-product/types'
3
3
  export interface LcbListProps {
4
4
  pageFilterType?: string
5
5
  pageListProps?: PageListProps
6
- border?: boolean
6
+ borderRadius?: number
7
7
  styleMode?: 'default' | 'plain'
8
8
  imageWidth?: number
9
+ border?: boolean
9
10
  imageHeight?: number
10
11
  titleLineClamp?: number
11
12
  listType?: LcbProductProps['listType']
12
13
  isSticky?: boolean
13
14
  mode?: 'map' | 'list'
14
15
  layoutType?: 'vertical' | 'horizontal'
16
+ imageRadius?: number
17
+ itemWidth?: number
15
18
  }
16
19
  export interface Option {
17
20
  label: string
@@ -25,11 +25,13 @@ declare const __VLS_component: import('vue').DefineComponent<
25
25
  imageRadius: number
26
26
  items: Record<string, any>[]
27
27
  imageWidth: number
28
+ borderRadius: number
28
29
  imageHeight: number
29
30
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
30
31
  titleLineClamp: number
31
32
  layoutType: 'vertical' | 'horizontal'
32
33
  itemWidth: number
34
+ coverImgStyle: Record<string, any>
33
35
  renderItemAbsoluteConfigLayout: {
34
36
  dataset?: Record<string, any>
35
37
  blocks: any[]
@@ -3,11 +3,13 @@ export interface LcbProductProps {
3
3
  imageWidth?: number
4
4
  imageHeight?: number
5
5
  imageRadius?: number
6
+ borderRadius?: number
6
7
  itemWidth?: number
7
8
  items?: Record<string, any>[]
8
9
  form?: Record<string, any>
9
10
  layoutType?: 'vertical' | 'horizontal'
10
11
  titleLineClamp?: number
12
+ coverImgStyle?: Record<string, any>
11
13
  renderItemAbsoluteConfigLayout?: {
12
14
  dataset?: Record<string, any>
13
15
  blocks: any[]
@@ -99,6 +99,7 @@ declare const __VLS_component: import('vue').DefineComponent<
99
99
  tagsVisible: boolean
100
100
  addressIntroVisible: boolean
101
101
  distanceVisible: boolean
102
+ borderRadius: number
102
103
  }
103
104
  >,
104
105
  {},
@@ -148,11 +149,13 @@ declare const __VLS_component: import('vue').DefineComponent<
148
149
  tagsVisible: boolean
149
150
  addressIntroVisible: boolean
150
151
  distanceVisible: boolean
152
+ borderRadius: number
151
153
  }
152
154
  >
153
155
  >
154
156
  >,
155
157
  {
158
+ borderRadius: number
156
159
  titleLineClamp: number
157
160
  layoutType: 'vertical' | 'horizontal'
158
161
  tagOverflowWrap: boolean
@@ -13,6 +13,7 @@ export interface LcbProductItemProps {
13
13
  tagRound?: boolean
14
14
  distanceUnit?: string
15
15
  imageType?: 'square' | 'vertical' | 'horizontal'
16
+ borderRadius?: number
16
17
  coverImg?: any
17
18
  productName?: any
18
19
  headImg?: string