@tplc/business 0.4.119 → 0.4.121
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 +34 -0
- package/action.d.ts +1 -1
- package/components/lcb-button/lcb-button.vue +12 -8
- package/components/lcb-tabs/components/Imgs/index.vue +20 -11
- package/components/lcb-tabs/types.ts +4 -0
- package/components/{lcb-wrapper-list/components/WrapperItem/index.vue → lcb-wrapper-item/lcb-wrapper-item.vue} +2 -2
- package/components/lcb-wrapper-list/lcb-wrapper-list.vue +18 -14
- package/components/lcb-wrapper-list/types.ts +3 -0
- package/package.json +1 -1
- package/types/components/lcb-tabs/components/Imgs/index.vue.d.ts +23 -3
- package/types/components/lcb-tabs/types.d.ts +4 -0
- package/types/components/{lcb-wrapper-list/components/WrapperItem/index.vue.d.ts → lcb-wrapper-item/lcb-wrapper-item.vue.d.ts} +2 -0
- package/types/components/lcb-wrapper-list/lcb-wrapper-list.vue.d.ts +1 -1
- package/types/components/lcb-wrapper-list/types.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
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.121](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.118...v0.4.121) (2025-05-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.4.119 ([fc07cca](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fc07cca4b92b3cb37ed5b1c9dab9bc09cd9c18ba))
|
|
11
|
+
* **release:** 0.4.120 ([0149526](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/014952692ea4faa667524a9a76b2eb38c7a86633))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ✨ Features | 新功能
|
|
15
|
+
|
|
16
|
+
* update version ([ce2daf3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ce2daf34dbb5c69b69514a15346fe2907199a276))
|
|
17
|
+
* 修改脚本 ([fa308af](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fa308afcd6221c79d32947881b81c13288d6bc72))
|
|
18
|
+
* 支持wrapper list ([8727bb8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8727bb8d2b55f9d9d5d521175662777649acfada))
|
|
19
|
+
* 新增tabs title ([9aad0cf](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9aad0cfe0c510616b21b3656a2d6b73b7c11fcfd))
|
|
20
|
+
* 暂时提交字段 ([d2378a3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d2378a3fe2d6a68a6a32573aae61085d67bcb6e7))
|
|
21
|
+
* 暂时支持列表 ([a0e6b7b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a0e6b7b3e2c1e013427c5ab659005818ace3b092))
|
|
22
|
+
* 类型调整 ([10e87ef](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/10e87efe6511eb751ac3480ba3c1b4fab1c20df0))
|
|
23
|
+
* 调整button位置 ([f13c6ee](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f13c6ee1d678b7e24d1d71286ee10ea82a27d7d3))
|
|
24
|
+
* 调整按钮信息 ([17424ef](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/17424ef9e93fcda51e5b79de86a94c5e818f152b))
|
|
25
|
+
* 调整数据 ([f5e0fd2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f5e0fd2ccd9153d089949ce24620cd222bfc47ea))
|
|
26
|
+
* 调整配置 ([426199e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/426199e2b441a2bf17288add847874218d0f2032))
|
|
27
|
+
|
|
28
|
+
### [0.4.120](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.119...v0.4.120) (2025-05-23)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### ✨ Features | 新功能
|
|
32
|
+
|
|
33
|
+
* 支持wrapper list ([8727bb8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8727bb8d2b55f9d9d5d521175662777649acfada))
|
|
34
|
+
* 新增tabs title ([9aad0cf](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9aad0cfe0c510616b21b3656a2d6b73b7c11fcfd))
|
|
35
|
+
* 暂时提交字段 ([d2378a3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d2378a3fe2d6a68a6a32573aae61085d67bcb6e7))
|
|
36
|
+
* 暂时支持列表 ([a0e6b7b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a0e6b7b3e2c1e013427c5ab659005818ace3b092))
|
|
37
|
+
* 调整按钮信息 ([17424ef](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/17424ef9e93fcda51e5b79de86a94c5e818f152b))
|
|
38
|
+
|
|
5
39
|
### [0.4.119](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.115...v0.4.119) (2025-05-21)
|
|
6
40
|
|
|
7
41
|
|
package/action.d.ts
CHANGED
|
@@ -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, undefined) as unknown 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:
|
|
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:
|
|
115
|
+
store: store.value,
|
|
112
116
|
}),
|
|
113
117
|
}
|
|
114
118
|
})
|
|
@@ -9,21 +9,30 @@
|
|
|
9
9
|
gap: transformValueUnit(gap),
|
|
10
10
|
}"
|
|
11
11
|
>
|
|
12
|
-
<
|
|
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
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
-
import { WRAPPER_ITEM_KEY } from '../../../../constants'
|
|
7
6
|
import { provide, ref, watch } from 'vue'
|
|
8
7
|
|
|
9
8
|
defineOptions({
|
|
@@ -16,9 +15,10 @@ defineOptions({
|
|
|
16
15
|
})
|
|
17
16
|
const props = defineProps<{
|
|
18
17
|
data?: unknown
|
|
18
|
+
provideKey: string
|
|
19
19
|
}>()
|
|
20
20
|
const data = ref(props.data)
|
|
21
|
-
provide(
|
|
21
|
+
provide(props.provideKey, data)
|
|
22
22
|
|
|
23
23
|
watch(
|
|
24
24
|
() => props.data,
|
|
@@ -1,15 +1,14 @@
|
|
|
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
|
-
<slot />
|
|
12
|
-
</WrapperItem>
|
|
11
|
+
<slot :data="item" :list="list" />
|
|
13
12
|
</view>
|
|
14
13
|
</lcb-block>
|
|
15
14
|
</template>
|
|
@@ -20,7 +19,6 @@ import { LcbWrapperListProps } from './types'
|
|
|
20
19
|
import { get } from 'lodash-es'
|
|
21
20
|
import { PAGE_PROVIDE_KEY } from '@tplc/business/constants'
|
|
22
21
|
import { transformValueUnit } from '@tplc/business/utils/transform'
|
|
23
|
-
import WrapperItem from './components/WrapperItem/index.vue'
|
|
24
22
|
defineOptions({
|
|
25
23
|
name: 'LcbWrapperList',
|
|
26
24
|
options: {
|
|
@@ -35,14 +33,19 @@ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
|
|
|
35
33
|
})
|
|
36
34
|
const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
|
|
37
35
|
const userStore = uni.$lcb.userStore?.()
|
|
38
|
-
const renderList = ref<unknown[]>([
|
|
36
|
+
const renderList = ref<unknown[]>([
|
|
37
|
+
{ walletAmount: 1 },
|
|
38
|
+
{ walletAmount: 2 },
|
|
39
|
+
{ walletAmount: 3 },
|
|
40
|
+
{ walletAmount: 4 },
|
|
41
|
+
])
|
|
39
42
|
|
|
40
43
|
watchEffect(async () => {
|
|
41
44
|
if (props.dataSource?.source === 'remote') {
|
|
42
45
|
if (props.dataSource.requestInfo?.requestUrl) {
|
|
43
46
|
const { data } = await uni.$lcb.http.post(
|
|
44
47
|
props.dataSource.requestInfo.requestUrl,
|
|
45
|
-
props.dataSource.requestInfo.requestParams,
|
|
48
|
+
JSON.parse(props.dataSource.requestInfo.requestParams || '{}'),
|
|
46
49
|
)
|
|
47
50
|
renderList.value = data as unknown[]
|
|
48
51
|
}
|
|
@@ -52,21 +55,22 @@ watchEffect(async () => {
|
|
|
52
55
|
props.dataSource?.dependKey,
|
|
53
56
|
[],
|
|
54
57
|
)
|
|
58
|
+
} else {
|
|
59
|
+
renderList.value = []
|
|
55
60
|
}
|
|
56
61
|
})
|
|
57
62
|
const listStyle = computed(() => {
|
|
58
63
|
const style = {
|
|
59
64
|
width: '100%',
|
|
60
65
|
display: props.display,
|
|
61
|
-
|
|
66
|
+
'flex-direction': props.flexDirection,
|
|
62
67
|
gap: transformValueUnit(props.gap),
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
'align-items': 'stretch',
|
|
69
|
+
'grid-template-columns': `repeat(${props.gridColumns}, minmax(0, 1fr))`,
|
|
70
|
+
'overflow-x': props.scrollX ? 'auto' : 'hidden',
|
|
71
|
+
'white-space': props.scrollX ? 'nowrap' : 'normal',
|
|
65
72
|
}
|
|
66
|
-
return
|
|
67
|
-
.filter((key) => style[key])
|
|
68
|
-
.map((key) => `${key}:${style[key]}`)
|
|
69
|
-
.join(';')
|
|
73
|
+
return style
|
|
70
74
|
})
|
|
71
75
|
</script>
|
|
72
76
|
|
|
@@ -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,13 @@
|
|
|
1
1
|
import { LcbTabsProps } from '../../types'
|
|
2
2
|
declare const _default: import('vue').DefineComponent<
|
|
3
|
-
__VLS_WithDefaults<
|
|
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<
|
|
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
|
}
|
|
@@ -4,6 +4,7 @@ declare function __VLS_template(): {
|
|
|
4
4
|
declare const __VLS_component: import('vue').DefineComponent<
|
|
5
5
|
__VLS_TypePropsToOption<{
|
|
6
6
|
data?: unknown
|
|
7
|
+
provideKey: string
|
|
7
8
|
}>,
|
|
8
9
|
{},
|
|
9
10
|
unknown,
|
|
@@ -18,6 +19,7 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
18
19
|
import('vue').ExtractPropTypes<
|
|
19
20
|
__VLS_TypePropsToOption<{
|
|
20
21
|
data?: unknown
|
|
22
|
+
provideKey: string
|
|
21
23
|
}>
|
|
22
24
|
>
|
|
23
25
|
>,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LcbWrapperListProps } from './types'
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
|
-
default?(_: {}): any
|
|
3
|
+
default?(_: { data: unknown; list: import('../lcb-area/types').LcbAreaProps[] | undefined }): 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
|
}
|