@tplc/business 0.4.117 → 0.4.119

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,27 +2,71 @@
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.117](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.116...v0.4.117) (2025-05-15)
5
+ ### [0.4.119](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.115...v0.4.119) (2025-05-21)
6
6
 
7
- ### [0.4.116](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.115...v0.4.116) (2025-05-15)
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.115 ([15cc0e1](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/15cc0e19900cf11bb7e8ac16cfc9c5e67e1b1bf6))
11
+ * **release:** 0.4.116 ([55d9a73](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/55d9a737f40a44ea1170a4b63e8c6cba0f03e535))
12
+ * **release:** 0.4.117 ([3b53e8e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3b53e8eb27df03cfe005f41ef899141021ecf9e4))
13
+ * **release:** 0.4.118 ([c953fde](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c953fdefd8171082bc6e7c265905cbcd423f2cdd))
8
14
 
9
15
 
10
16
  ### ✨ Features | 新功能
11
17
 
18
+ * button 预览图片修改 ([1e27b47](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1e27b4719962edb6d1223f159b75c7784aea4066))
19
+ * 修改脚本 ([fa308af](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fa308afcd6221c79d32947881b81c13288d6bc72))
20
+ * 反选判断 ([6dea74e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6dea74e65d9843766f7911eff2b01b00d72320d6))
12
21
  * 新增button enablePreview ([ab91670](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ab91670293731aa12ce7f76a6dc2e8f63c77a3dd))
22
+ * 暂时提交 ([0921daa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0921daa2e8226bbedafeb64a5e3c2e0522228c82))
23
+ * 暂时提交area支持list 还差样式 ([a815d4b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a815d4be226a97ef91a63cbce90cdb51feb4540d))
24
+ * 补充文档 ([45cffbd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/45cffbd548e36ac779c44e6caee637c0b858a432))
25
+ * 调整button位置 ([f13c6ee](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f13c6ee1d678b7e24d1d71286ee10ea82a27d7d3))
26
+ * 调整数据 ([f5e0fd2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f5e0fd2ccd9153d089949ce24620cd222bfc47ea))
27
+ * 调整配置 ([426199e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/426199e2b441a2bf17288add847874218d0f2032))
13
28
 
14
- ### [0.4.115](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.114...v0.4.115) (2025-05-15)
29
+ ### [0.4.118](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.117...v0.4.118) (2025-05-19)
30
+
31
+
32
+ ### 🚀 Chore | 构建/工程依赖/工具
33
+
34
+ * **release:** 0.4.115 ([2d74c83](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2d74c838e391ad6517877fbcbf3a1867a8cdf053))
35
+
36
+
37
+ ### ✨ Features | 新功能
38
+
39
+ * button 预览图片修改 ([1e27b47](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1e27b4719962edb6d1223f159b75c7784aea4066))
40
+ * 反选判断 ([6dea74e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6dea74e65d9843766f7911eff2b01b00d72320d6))
41
+ * 暂时提交 ([0921daa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0921daa2e8226bbedafeb64a5e3c2e0522228c82))
42
+ * 暂时提交area支持list 还差样式 ([a815d4b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a815d4be226a97ef91a63cbce90cdb51feb4540d))
43
+ * 补充文档 ([45cffbd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/45cffbd548e36ac779c44e6caee637c0b858a432))
44
+
45
+ ### [0.4.115](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.112...v0.4.115) (2025-05-15)
46
+
47
+
48
+ ### 🚀 Chore | 构建/工程依赖/工具
49
+
50
+ * **release:** 0.4.113 ([72dd9dd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/72dd9dd453292322440b0b1ce06ec70e6ba094ff))
51
+ * **release:** 0.4.114 ([775e408](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/775e408f8aa9ecca5477c60ec99c28cbd34a0e8b))
52
+ ### [0.4.117](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.116...v0.4.117) (2025-05-15)
53
+
54
+ ### [0.4.116](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.115...v0.4.116) (2025-05-15)
15
55
 
16
56
 
17
57
  ### ✨ Features | 新功能
18
58
 
19
- * 动态图片跳转 ([2061cc9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2061cc92205af00523e94825b3aef32102fabe17))
59
+ * 新增button enablePreview ([ab91670](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ab91670293731aa12ce7f76a6dc2e8f63c77a3dd))
20
60
 
21
- ### [0.4.114](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.113...v0.4.114) (2025-05-14)
61
+ ### [0.4.115](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.114...v0.4.115) (2025-05-15)
22
62
 
23
63
 
24
64
  ### ✨ Features | 新功能
25
65
 
66
+ * history 根据productName唯一 ([27149ba](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27149ba0de8dd19cb84be79703d9915222634a99))
67
+ * propmt ([7904ba7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7904ba753b23dd38ca995c64a2a9c269ad9c95de))
68
+
69
+
26
70
  * wec ([86e30e1](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/86e30e1b610da8c4441b264cf2e0cefe35739af6))
27
71
 
28
72
  ### [0.4.113](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.111...v0.4.113) (2025-05-14)
package/action.d.ts CHANGED
@@ -18,7 +18,15 @@ export type IResData<T> = {
18
18
  msg: string
19
19
  data: T
20
20
  }
21
-
21
+ export interface DataSource {
22
+ source?: 'remote' | 'context' | 'user'
23
+ requestInfo?: {
24
+ requestUrl: string
25
+ requestParams: Record<string, unknown>
26
+ }
27
+ /** 动态key */
28
+ dependKey?: string
29
+ }
22
30
  export interface LcbGlobal {
23
31
  http: {
24
32
  get<T>(url: string, query?: Record<string, any> | undefined): Promise<IResData<T>>
@@ -76,6 +76,9 @@ const showArea = computed(() => {
76
76
  if (props.dependKeyCompareValue) {
77
77
  return `${value}` === `${props.dependKeyCompareValue}`
78
78
  }
79
+ if (value === undefined) {
80
+ return false
81
+ }
79
82
  return props.reverse ? !value : Boolean(value)
80
83
  }
81
84
  return true
@@ -8,7 +8,7 @@
8
8
  v-else-if="dynamicKey && hideWhenDynamicKeyNotExist ? dynamicValue : true"
9
9
  >
10
10
  <lcb-block
11
- v-bind="$props"
11
+ v-bind="styleOptions[0]"
12
12
  :customClass="`${customClass} border-solid`"
13
13
  :customStyle="{
14
14
  width: props.fillWidth ? '100%' : 'fit-content',
@@ -16,7 +16,12 @@
16
16
  ...innerItemStyle,
17
17
  }"
18
18
  >
19
- <lcb-action-view v-bind="actionProps" @avatar="onAvatar" @click="handleClick">
19
+ <lcb-action-view
20
+ v-bind="actionProps"
21
+ @avatar="onAvatar"
22
+ @click="handleClick"
23
+ :customStyle="styleOptions[1]"
24
+ >
20
25
  <view class="!flex items-center justify-center" :style="`gap: ${iconGap}rpx`">
21
26
  <wd-icon
22
27
  v-if="icon"
@@ -118,7 +123,23 @@ const onAvatar = (headImgUrl) => {
118
123
  const innerStyle = computed(() => {
119
124
  return getFlexStyle(props.align)
120
125
  })
126
+
121
127
  const innerItemStyle = computed(() => {
122
128
  return getFlexStyle(props.itemAlign)
123
129
  })
130
+
131
+ const styleOptions = computed<[Record<string, any>, string]>(() => {
132
+ const {
133
+ paddingVertical,
134
+ paddingHorizontal,
135
+ paddingTop,
136
+ paddingBottom,
137
+ paddingLeft,
138
+ paddingRight,
139
+ ...other
140
+ } = props
141
+
142
+ const actionStyle = `width: 100%; padding:${transformValueUnit(paddingTop || paddingVertical)} ${transformValueUnit(paddingRight || paddingHorizontal)} ${transformValueUnit(paddingBottom || paddingVertical)} ${transformValueUnit(paddingLeft || paddingHorizontal)}`
143
+ return [other, actionStyle]
144
+ })
124
145
  </script>
@@ -143,6 +143,9 @@ const renderItems = computed(() => {
143
143
  if (item.dependKeyCompareValue) {
144
144
  return `${value}` === `${item.dependKeyCompareValue}`
145
145
  }
146
+ if (value === undefined) {
147
+ return false
148
+ }
146
149
  return item.reverse ? !value : Boolean(value)
147
150
  }
148
151
  return true
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <slot />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { WRAPPER_ITEM_KEY } from '../../../../constants'
7
+ import { provide, ref, watch } from 'vue'
8
+
9
+ defineOptions({
10
+ name: 'LcbWrapperItem',
11
+ options: {
12
+ addGlobalClass: true,
13
+ virtualHost: true,
14
+ styleIsolation: 'shared',
15
+ },
16
+ })
17
+ const props = defineProps<{
18
+ data?: unknown
19
+ }>()
20
+ const data = ref(props.data)
21
+ provide(WRAPPER_ITEM_KEY, data)
22
+
23
+ watch(
24
+ () => props.data,
25
+ (newVal) => {
26
+ data.value = newVal
27
+ },
28
+ {
29
+ deep: true,
30
+ },
31
+ )
32
+ </script>
33
+
34
+ <style lang="scss" scoped></style>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <lcb-block v-bind="$props" :custom-style="listStyle">
3
+ <view
4
+ v-for="(item, index) in renderList"
5
+ :key="index"
6
+ :style="{
7
+ width: width ? transformValueUnit(width) : '100%',
8
+ }"
9
+ >
10
+ <WrapperItem :data="item">
11
+ <slot />
12
+ </WrapperItem>
13
+ </view>
14
+ </lcb-block>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ import { computed, inject, Ref, ref, watchEffect } from 'vue'
19
+ import { LcbWrapperListProps } from './types'
20
+ import { get } from 'lodash-es'
21
+ import { PAGE_PROVIDE_KEY } from '@tplc/business/constants'
22
+ import { transformValueUnit } from '@tplc/business/utils/transform'
23
+ import WrapperItem from './components/WrapperItem/index.vue'
24
+ defineOptions({
25
+ name: 'LcbWrapperList',
26
+ options: {
27
+ addGlobalClass: true,
28
+ virtualHost: true,
29
+ styleIsolation: 'shared',
30
+ },
31
+ })
32
+ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ })
36
+ const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
37
+ const userStore = uni.$lcb.userStore?.()
38
+ const renderList = ref<unknown[]>([])
39
+
40
+ watchEffect(async () => {
41
+ if (props.dataSource?.source === 'remote') {
42
+ if (props.dataSource.requestInfo?.requestUrl) {
43
+ const { data } = await uni.$lcb.http.post(
44
+ props.dataSource.requestInfo.requestUrl,
45
+ props.dataSource.requestInfo.requestParams,
46
+ )
47
+ renderList.value = data as unknown[]
48
+ }
49
+ } else if (props.dataSource?.dependKey) {
50
+ renderList.value = get(
51
+ props.dataSource?.source === 'context' ? pageInfo.value : userStore?.userInfo,
52
+ props.dataSource?.dependKey,
53
+ [],
54
+ )
55
+ }
56
+ })
57
+ const listStyle = computed(() => {
58
+ const style = {
59
+ width: '100%',
60
+ display: props.display,
61
+ flexDirection: props.flexDirection,
62
+ gap: transformValueUnit(props.gap),
63
+ alignItems: 'stretch',
64
+ gridTemplateColumns: `repeat(${props.gridColumns}, minmax(0, 1fr))`,
65
+ }
66
+ return Object.keys(style)
67
+ .filter((key) => style[key])
68
+ .map((key) => `${key}:${style[key]}`)
69
+ .join(';')
70
+ })
71
+ </script>
72
+
73
+ <style lang="scss" scoped></style>
@@ -0,0 +1,10 @@
1
+ import { DataSource } from '../../action'
2
+ import { LcbBlockProps } from '../lcb-block/types'
3
+ export interface LcbWrapperListProps extends LcbBlockProps {
4
+ dataSource?: DataSource
5
+ gap?: number
6
+ width?: number
7
+ display?: 'flex' | 'grid'
8
+ flexDirection?: 'row' | 'column'
9
+ gridColumns?: number
10
+ }
package/constants.ts CHANGED
@@ -11,3 +11,5 @@ export const USER_BASIC_INFO = 'user_basic_info'
11
11
  export const LIST_FORM_CHOOSER_VALUES = 'list_form_chooser_values'
12
12
  /** 页面动态数据 */
13
13
  export const PAGE_DYNAMIC_DATA = 'page_dynamic_data'
14
+ /** 列表页表单选择项 */
15
+ export const WRAPPER_ITEM_KEY = 'wrapper_item_key'
package/global.d.ts CHANGED
@@ -47,6 +47,7 @@ declare module 'vue' {
47
47
  'lcb-vip': (typeof import('@tplc/business/components/lcb-vip/lcb-vip.vue'))['default']
48
48
  'lcb-waterfall-item': (typeof import('@tplc/business/components/lcb-waterfall/lcb-waterfall-item.vue'))['default']
49
49
  'lcb-waterfall': (typeof import('@tplc/business/components/lcb-waterfall/lcb-waterfall.vue'))['default']
50
+ 'lcb-wrapper-list': (typeof import('@tplc/business/components/lcb-wrapper-list/lcb-wrapper-list.vue'))['default']
50
51
  }
51
52
  }
52
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.117",
3
+ "version": "0.4.119",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -0,0 +1,47 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any
3
+ }
4
+ declare const __VLS_component: import('vue').DefineComponent<
5
+ __VLS_TypePropsToOption<{
6
+ data?: unknown
7
+ }>,
8
+ {},
9
+ unknown,
10
+ {},
11
+ {},
12
+ import('vue').ComponentOptionsMixin,
13
+ import('vue').ComponentOptionsMixin,
14
+ {},
15
+ string,
16
+ import('vue').PublicProps,
17
+ Readonly<
18
+ import('vue').ExtractPropTypes<
19
+ __VLS_TypePropsToOption<{
20
+ data?: unknown
21
+ }>
22
+ >
23
+ >,
24
+ {},
25
+ {}
26
+ >
27
+ declare const _default: __VLS_WithTemplateSlots<
28
+ typeof __VLS_component,
29
+ ReturnType<typeof __VLS_template>
30
+ >
31
+ export default _default
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S
35
+ }
36
+ }
37
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
38
+ type __VLS_TypePropsToOption<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K>
40
+ ? {
41
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
42
+ }
43
+ : {
44
+ type: import('vue').PropType<T[K]>
45
+ required: true
46
+ }
47
+ }
@@ -0,0 +1,71 @@
1
+ import { LcbWrapperListProps } from './types'
2
+ declare function __VLS_template(): {
3
+ default?(_: {}): any
4
+ }
5
+ declare const __VLS_component: import('vue').DefineComponent<
6
+ __VLS_WithDefaults<
7
+ __VLS_TypePropsToOption<LcbWrapperListProps>,
8
+ {
9
+ display: string
10
+ flexDirection: string
11
+ }
12
+ >,
13
+ {},
14
+ unknown,
15
+ {},
16
+ {},
17
+ import('vue').ComponentOptionsMixin,
18
+ import('vue').ComponentOptionsMixin,
19
+ {},
20
+ string,
21
+ import('vue').PublicProps,
22
+ Readonly<
23
+ import('vue').ExtractPropTypes<
24
+ __VLS_WithDefaults<
25
+ __VLS_TypePropsToOption<LcbWrapperListProps>,
26
+ {
27
+ display: string
28
+ flexDirection: string
29
+ }
30
+ >
31
+ >
32
+ >,
33
+ {
34
+ display: 'flex' | 'grid'
35
+ flexDirection: 'row' | 'column'
36
+ },
37
+ {}
38
+ >
39
+ declare const _default: __VLS_WithTemplateSlots<
40
+ typeof __VLS_component,
41
+ ReturnType<typeof __VLS_template>
42
+ >
43
+ export default _default
44
+ type __VLS_WithDefaults<P, D> = {
45
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
46
+ ? __VLS_Prettify<
47
+ P[K] & {
48
+ default: D[K]
49
+ }
50
+ >
51
+ : P[K]
52
+ }
53
+ type __VLS_Prettify<T> = {
54
+ [K in keyof T]: T[K]
55
+ } & {}
56
+ type __VLS_WithTemplateSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S
59
+ }
60
+ }
61
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
62
+ type __VLS_TypePropsToOption<T> = {
63
+ [K in keyof T]-?: {} extends Pick<T, K>
64
+ ? {
65
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
66
+ }
67
+ : {
68
+ type: import('vue').PropType<T[K]>
69
+ required: true
70
+ }
71
+ }
@@ -0,0 +1,10 @@
1
+ import { DataSource } from '../../action'
2
+ import { LcbBlockProps } from '../lcb-block/types'
3
+ export interface LcbWrapperListProps extends LcbBlockProps {
4
+ dataSource?: DataSource
5
+ gap?: number
6
+ width?: number
7
+ display?: 'flex' | 'grid'
8
+ flexDirection?: 'row' | 'column'
9
+ gridColumns?: number
10
+ }
@@ -11,3 +11,5 @@ export declare const USER_BASIC_INFO = 'user_basic_info'
11
11
  export declare const LIST_FORM_CHOOSER_VALUES = 'list_form_chooser_values'
12
12
  /** 页面动态数据 */
13
13
  export declare const PAGE_DYNAMIC_DATA = 'page_dynamic_data'
14
+ /** 列表页表单选择项 */
15
+ export declare const WRAPPER_ITEM_KEY = 'wrapper_item_key'