@tplc/business 0.4.119 → 0.4.120

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,17 @@
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.120](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.119...v0.4.120) (2025-05-23)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 支持wrapper list ([8727bb8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8727bb8d2b55f9d9d5d521175662777649acfada))
11
+ * 新增tabs title ([9aad0cf](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9aad0cfe0c510616b21b3656a2d6b73b7c11fcfd))
12
+ * 暂时提交字段 ([d2378a3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d2378a3fe2d6a68a6a32573aae61085d67bcb6e7))
13
+ * 暂时支持列表 ([a0e6b7b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a0e6b7b3e2c1e013427c5ab659005818ace3b092))
14
+ * 调整按钮信息 ([17424ef](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/17424ef9e93fcda51e5b79de86a94c5e818f152b))
15
+
5
16
  ### [0.4.119](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.115...v0.4.119) (2025-05-21)
6
17
 
7
18
 
package/action.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface DataSource {
22
22
  source?: 'remote' | 'context' | 'user'
23
23
  requestInfo?: {
24
24
  requestUrl: string
25
- requestParams: Record<string, unknown>
25
+ requestParams: string
26
26
  }
27
27
  /** 动态key */
28
28
  dependKey?: string
@@ -50,7 +50,7 @@
50
50
  <script setup lang="ts">
51
51
  import { computed, inject, Ref } from 'vue'
52
52
  import { LcbButtonProps } from './types'
53
- import { PAGE_PROVIDE_KEY } from '../../constants'
53
+ import { PAGE_PROVIDE_KEY, WRAPPER_ITEM_KEY } from '../../constants'
54
54
  import { getFlexStyle, transformValueUnit } from '../../utils/transform'
55
55
  import { getDynamicData } from '../../utils/utils'
56
56
  import { get } from 'lodash-es'
@@ -71,16 +71,20 @@ const props = withDefaults(defineProps<LcbButtonProps>(), {
71
71
  iconSize: 24,
72
72
  })
73
73
  const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
74
+ const wrapperItemData = inject(WRAPPER_ITEM_KEY) as Ref<Record<string, any>>
74
75
  const userStore = uni.$lcb.userStore?.()
76
+ const store = computed(() => {
77
+ return props.keyFromUser
78
+ ? userStore?.userInfo
79
+ : wrapperItemData
80
+ ? wrapperItemData.value
81
+ : pageInfo.value
82
+ })
75
83
 
76
84
  const dynamicValue = computed(() => {
77
85
  let value = props.textDefaultValue
78
86
  if (props.dynamicKey) {
79
- value = get(
80
- props.keyFromUser ? userStore?.userInfo : pageInfo.value,
81
- props.dynamicKey,
82
- props.textDefaultValue,
83
- )
87
+ value = get(store.value, props.dynamicKey, props.textDefaultValue)
84
88
  }
85
89
  return value
86
90
  })
@@ -98,7 +102,7 @@ const innerValue = computed(() => {
98
102
  return dynamicValue.value || props.url
99
103
  }
100
104
  return getDynamicData(props.text, {
101
- store: props.keyFromUser ? userStore?.userInfo : pageInfo.value,
105
+ store: store.value,
102
106
  defaultText: props.textDefaultValue,
103
107
  })
104
108
  })
@@ -108,7 +112,7 @@ const actionProps = computed(() => {
108
112
  return {
109
113
  ...props.action,
110
114
  jumpUrl: getDynamicData(props.action?.jumpUrl, {
111
- store: props.keyFromUser ? userStore?.userInfo : pageInfo.value,
115
+ store: store.value,
112
116
  }),
113
117
  }
114
118
  })
@@ -9,21 +9,30 @@
9
9
  gap: transformValueUnit(gap),
10
10
  }"
11
11
  >
12
- <wd-img
12
+ <view
13
13
  v-for="(item, index) in items"
14
14
  :key="index"
15
+ class="flex flex-col items-center justify-center"
15
16
  :class="{
17
+ 'lcb-tag-active': current === index,
16
18
  'inline-block': tagsMode === 'scroll',
17
19
  }"
18
20
  :style="{
19
21
  fontSize: transformValueUnit(itemFontSize),
22
+ width: transformValueUnit(imgWidth),
23
+ gap: transformValueUnit(imgTitleGap),
24
+ color: current === index ? activeColor : inactiveColor,
20
25
  }"
21
- :width="transformValueUnit(imgWidth)"
22
- height="auto"
23
- mode="widthFix"
24
- :src="current === index ? item.activeUrl : item.inactiveUrl"
25
26
  @click="handleTagClick(item.name, index)"
26
- />
27
+ >
28
+ <wd-img
29
+ :width="transformValueUnit(imgWidth)"
30
+ height="auto"
31
+ mode="widthFix"
32
+ :src="current === index ? item.activeUrl : item.inactiveUrl"
33
+ />
34
+ <view v-if="showTitle" class="truncate px-2">{{ item.title }}</view>
35
+ </view>
27
36
  </view>
28
37
  </lcb-block>
29
38
  </template>
@@ -33,7 +42,11 @@ import { ref } from 'vue'
33
42
  import useSyncForm from '../../../../hooks/useSyncForm'
34
43
  import { transformValueUnit } from '../../../../utils/transform'
35
44
  import { LcbTabsProps } from '../../types'
36
- const props = withDefaults(defineProps<LcbTabsProps>(), {})
45
+ const props = withDefaults(defineProps<LcbTabsProps>(), {
46
+ imgTitleGap: 24,
47
+ activeColor: 'var(--wot-color-theme)',
48
+ inactiveColor: '#333333',
49
+ })
37
50
  const { syncForm } = useSyncForm(props.dynamicScope)
38
51
  const current = ref(0)
39
52
  defineOptions({
@@ -54,7 +67,3 @@ const handleTagClick = (name: string, index: number) => {
54
67
  }
55
68
  handleTagClick(props.items?.[0].name, 0)
56
69
  </script>
57
-
58
- <style lang="scss" scoped>
59
- @import '@tplc/wot/components/common/abstracts/variable';
60
- </style>
@@ -9,6 +9,7 @@ export interface LcbTabsProps extends LcbBlockProps {
9
9
  activeUrl?: string
10
10
  inactiveUrl?: string
11
11
  }[]
12
+ showTitle?: boolean
12
13
  lineWidth?: number
13
14
  lineHeight?: number
14
15
  slidable?: 'always' | 'auto'
@@ -19,4 +20,7 @@ export interface LcbTabsProps extends LcbBlockProps {
19
20
  gap?: number
20
21
  dynamicScope?: string
21
22
  imgWidth?: number
23
+ imgTitleGap?: number
24
+ activeColor?: string
25
+ inactiveColor?: string
22
26
  }
@@ -1,14 +1,17 @@
1
1
  <template>
2
- <lcb-block v-bind="$props" :custom-style="listStyle">
2
+ <lcb-block v-bind="$props" :custom-style="listStyle" v-if="renderList.length">
3
3
  <view
4
4
  v-for="(item, index) in renderList"
5
5
  :key="index"
6
+ class="flex-shrink-0"
6
7
  :style="{
7
8
  width: width ? transformValueUnit(width) : '100%',
8
9
  }"
9
10
  >
10
11
  <WrapperItem :data="item">
11
- <slot />
12
+ <block v-for="com in list" :key="com.id">
13
+ <slot :item="com" />
14
+ </block>
12
15
  </WrapperItem>
13
16
  </view>
14
17
  </lcb-block>
@@ -35,14 +38,19 @@ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
35
38
  })
36
39
  const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
37
40
  const userStore = uni.$lcb.userStore?.()
38
- const renderList = ref<unknown[]>([])
41
+ const renderList = ref<unknown[]>([
42
+ { walletAmount: 1 },
43
+ { walletAmount: 2 },
44
+ { walletAmount: 3 },
45
+ { walletAmount: 4 },
46
+ ])
39
47
 
40
48
  watchEffect(async () => {
41
49
  if (props.dataSource?.source === 'remote') {
42
50
  if (props.dataSource.requestInfo?.requestUrl) {
43
51
  const { data } = await uni.$lcb.http.post(
44
52
  props.dataSource.requestInfo.requestUrl,
45
- props.dataSource.requestInfo.requestParams,
53
+ JSON.parse(props.dataSource.requestInfo.requestParams || '{}'),
46
54
  )
47
55
  renderList.value = data as unknown[]
48
56
  }
@@ -52,21 +60,22 @@ watchEffect(async () => {
52
60
  props.dataSource?.dependKey,
53
61
  [],
54
62
  )
63
+ } else {
64
+ renderList.value = []
55
65
  }
56
66
  })
57
67
  const listStyle = computed(() => {
58
68
  const style = {
59
69
  width: '100%',
60
70
  display: props.display,
61
- flexDirection: props.flexDirection,
71
+ 'flex-direction': props.flexDirection,
62
72
  gap: transformValueUnit(props.gap),
63
- alignItems: 'stretch',
64
- gridTemplateColumns: `repeat(${props.gridColumns}, minmax(0, 1fr))`,
73
+ 'align-items': 'stretch',
74
+ 'grid-template-columns': `repeat(${props.gridColumns}, minmax(0, 1fr))`,
75
+ 'overflow-x': props.scrollX ? 'auto' : 'hidden',
76
+ 'white-space': props.scrollX ? 'nowrap' : 'normal',
65
77
  }
66
- return Object.keys(style)
67
- .filter((key) => style[key])
68
- .map((key) => `${key}:${style[key]}`)
69
- .join(';')
78
+ return style
70
79
  })
71
80
  </script>
72
81
 
@@ -1,3 +1,4 @@
1
+ import { LcbAreaProps } from '../lcb-area/types'
1
2
  import { DataSource } from '../../action'
2
3
  import { LcbBlockProps } from '../lcb-block/types'
3
4
  export interface LcbWrapperListProps extends LcbBlockProps {
@@ -7,4 +8,6 @@ export interface LcbWrapperListProps extends LcbBlockProps {
7
8
  display?: 'flex' | 'grid'
8
9
  flexDirection?: 'row' | 'column'
9
10
  gridColumns?: number
11
+ scrollX?: boolean
12
+ list?: LcbAreaProps[]
10
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.119",
3
+ "version": "0.4.120",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,6 +1,13 @@
1
1
  import { LcbTabsProps } from '../../types'
2
2
  declare const _default: import('vue').DefineComponent<
3
- __VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>,
3
+ __VLS_WithDefaults<
4
+ __VLS_TypePropsToOption<LcbTabsProps>,
5
+ {
6
+ imgTitleGap: number
7
+ activeColor: string
8
+ inactiveColor: string
9
+ }
10
+ >,
4
11
  {},
5
12
  unknown,
6
13
  {},
@@ -11,9 +18,22 @@ declare const _default: import('vue').DefineComponent<
11
18
  string,
12
19
  import('vue').PublicProps,
13
20
  Readonly<
14
- import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>>
21
+ import('vue').ExtractPropTypes<
22
+ __VLS_WithDefaults<
23
+ __VLS_TypePropsToOption<LcbTabsProps>,
24
+ {
25
+ imgTitleGap: number
26
+ activeColor: string
27
+ inactiveColor: string
28
+ }
29
+ >
30
+ >
15
31
  >,
16
- {},
32
+ {
33
+ inactiveColor: string
34
+ activeColor: string
35
+ imgTitleGap: number
36
+ },
17
37
  {}
18
38
  >
19
39
  export default _default
@@ -8,6 +8,7 @@ export interface LcbTabsProps extends LcbBlockProps {
8
8
  activeUrl?: string
9
9
  inactiveUrl?: string
10
10
  }[]
11
+ showTitle?: boolean
11
12
  lineWidth?: number
12
13
  lineHeight?: number
13
14
  slidable?: 'always' | 'auto'
@@ -18,4 +19,7 @@ export interface LcbTabsProps extends LcbBlockProps {
18
19
  gap?: number
19
20
  dynamicScope?: string
20
21
  imgWidth?: number
22
+ imgTitleGap?: number
23
+ activeColor?: string
24
+ inactiveColor?: string
21
25
  }
@@ -1,6 +1,6 @@
1
1
  import { LcbWrapperListProps } from './types'
2
2
  declare function __VLS_template(): {
3
- default?(_: {}): any
3
+ default?(_: { item: import('../lcb-area/types').LcbAreaProps }): any
4
4
  }
5
5
  declare const __VLS_component: import('vue').DefineComponent<
6
6
  __VLS_WithDefaults<
@@ -1,3 +1,4 @@
1
+ import { LcbAreaProps } from '../lcb-area/types'
1
2
  import { DataSource } from '../../action'
2
3
  import { LcbBlockProps } from '../lcb-block/types'
3
4
  export interface LcbWrapperListProps extends LcbBlockProps {
@@ -7,4 +8,6 @@ export interface LcbWrapperListProps extends LcbBlockProps {
7
8
  display?: 'flex' | 'grid'
8
9
  flexDirection?: 'row' | 'column'
9
10
  gridColumns?: number
11
+ scrollX?: boolean
12
+ list?: LcbAreaProps[]
10
13
  }