@tplc/business 0.3.95 → 0.3.96
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 +7 -0
- package/components/lcb-form/lcb-form.vue +1 -0
- package/components/lcb-list/hooks/useSelect.ts +1 -1
- package/components/lcb-list/types.ts +1 -0
- package/components/lcb-nav/Search/index.vue +1 -1
- package/components/lcb-search/lcb-search.vue +1 -1
- package/components/lcb-tabs/components/Tags/index.vue +75 -0
- package/components/lcb-tabs/lcb-tabs.vue +7 -2
- package/components/lcb-tabs/types.ts +3 -0
- package/package.json +1 -1
- package/types/components/lcb-list/types.d.ts +1 -0
- package/types/components/{lcb-tags/Tag → lcb-tabs/components/Tags}/index.vue.d.ts +3 -5
- package/types/components/lcb-tabs/lcb-tabs.vue.d.ts +6 -0
- package/types/components/lcb-tabs/types.d.ts +3 -0
- package/components/lcb-tags/Tag/index.vue +0 -28
- package/components/lcb-tags/lcb-tags.vue +0 -42
- package/components/lcb-tags/types.ts +0 -30
- package/types/components/lcb-tags/lcb-tags.vue.d.ts +0 -59
- package/types/components/lcb-tags/types.d.ts +0 -13
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.3.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.95...v0.3.96) (2025-03-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* 调整底部数据 ([9f72871](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9f72871c2c3b3a70c2140828182cd3ecd527a3f7))
|
|
11
|
+
|
|
5
12
|
### [0.3.95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.93...v0.3.95) (2025-03-21)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -26,7 +26,7 @@ const useSelect = (
|
|
|
26
26
|
onMounted(async () => {
|
|
27
27
|
if (props.apiPath) {
|
|
28
28
|
// 调用接口获取数据
|
|
29
|
-
const { data } = await uni.$lcb.http.
|
|
29
|
+
const { data } = await uni.$lcb.http.post<Option[]>(props.apiPath, props.apiParams || {})
|
|
30
30
|
options.value = data
|
|
31
31
|
}
|
|
32
32
|
})
|
|
@@ -108,7 +108,7 @@ getLocation()
|
|
|
108
108
|
const form = inject<Ref<Record<string, any>>>(FORM_KEY)
|
|
109
109
|
const onSearch = (e: { detail: { value: string } }) => {
|
|
110
110
|
if (form) {
|
|
111
|
-
form.value.
|
|
111
|
+
form.value.keywords = e.detail.value
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
</script>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="w-100vw">
|
|
3
|
+
<lcb-block v-bind="$props">
|
|
4
|
+
<view
|
|
5
|
+
:class="{
|
|
6
|
+
'flex flex-wrap': tagsMode === 'tiled',
|
|
7
|
+
'flex whitespace-nowrap overflow-x-auto': tagsMode === 'scroll',
|
|
8
|
+
}"
|
|
9
|
+
:style="{
|
|
10
|
+
gap: transformValueUnit(gap),
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<view
|
|
14
|
+
v-for="(item, index) in items"
|
|
15
|
+
:key="index"
|
|
16
|
+
class="lcb-tag"
|
|
17
|
+
:class="{
|
|
18
|
+
'lcb-tag-active': current === index,
|
|
19
|
+
'inline-block': tagsMode === 'scroll',
|
|
20
|
+
}"
|
|
21
|
+
:style="{
|
|
22
|
+
fontSize: transformValueUnit(itemFontSize),
|
|
23
|
+
}"
|
|
24
|
+
@click="handleTagClick(item.name, index)"
|
|
25
|
+
>
|
|
26
|
+
{{ item.title }}
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
</lcb-block>
|
|
30
|
+
</view>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { FORM_KEY } from '../../../../constants'
|
|
35
|
+
import { LcbTabsProps } from '../../types'
|
|
36
|
+
import { inject, ref, Ref } from 'vue'
|
|
37
|
+
import { transformValueUnit } from '../../../../utils/transform'
|
|
38
|
+
|
|
39
|
+
withDefaults(defineProps<LcbTabsProps>(), {})
|
|
40
|
+
const form = inject<Ref<Record<string, any>>>(FORM_KEY)
|
|
41
|
+
const current = ref()
|
|
42
|
+
defineOptions({
|
|
43
|
+
name: 'LcbTagsItem',
|
|
44
|
+
options: {
|
|
45
|
+
addGlobalClass: true,
|
|
46
|
+
virtualHost: true,
|
|
47
|
+
styleIsolation: 'shared',
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
const handleTagClick = (name: string, index: number) => {
|
|
51
|
+
current.value = index
|
|
52
|
+
try {
|
|
53
|
+
const params = JSON.parse(name)
|
|
54
|
+
form!.value = {
|
|
55
|
+
...form!.value,
|
|
56
|
+
...params,
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(error)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped>
|
|
65
|
+
@import '@tplc/wot/components/common/abstracts/variable';
|
|
66
|
+
.lcb-tag {
|
|
67
|
+
padding: 8rpx 32rpx;
|
|
68
|
+
border-radius: 10000rpx;
|
|
69
|
+
background-color: #eeeeee;
|
|
70
|
+
}
|
|
71
|
+
.lcb-tag-active {
|
|
72
|
+
background-color: $-color-theme;
|
|
73
|
+
color: #ffffff;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<wd-sticky v-if="sticky">
|
|
3
|
-
<Tabs v-bind="$props" />
|
|
3
|
+
<Tabs v-bind="$props" v-if="mode === 'tabs'" />
|
|
4
|
+
<Tags v-bind="$props" v-else />
|
|
4
5
|
</wd-sticky>
|
|
5
|
-
<Tabs v-else v-bind="$props" />
|
|
6
|
+
<Tabs v-else-if="mode === 'tabs'" v-bind="$props" />
|
|
7
|
+
<Tags v-else v-bind="$props" />
|
|
6
8
|
</template>
|
|
7
9
|
|
|
8
10
|
<script setup lang="ts">
|
|
9
11
|
import { LcbTabsProps } from './types'
|
|
10
12
|
import Tabs from './components/Tabs/index.vue'
|
|
13
|
+
import Tags from './components/Tags/index.vue'
|
|
11
14
|
defineOptions({
|
|
12
15
|
name: 'LcbTabs',
|
|
13
16
|
options: {
|
|
@@ -18,6 +21,8 @@ defineOptions({
|
|
|
18
21
|
})
|
|
19
22
|
withDefaults(defineProps<LcbTabsProps>(), {
|
|
20
23
|
itemFontSize: 28,
|
|
24
|
+
tagsMode: 'tiled',
|
|
25
|
+
gap: 16,
|
|
21
26
|
})
|
|
22
27
|
</script>
|
|
23
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LcbTabsProps } from '../../types'
|
|
2
2
|
declare const _default: import('vue').DefineComponent<
|
|
3
|
-
__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
3
|
+
__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>,
|
|
4
4
|
{},
|
|
5
5
|
unknown,
|
|
6
6
|
{},
|
|
@@ -11,9 +11,7 @@ declare const _default: import('vue').DefineComponent<
|
|
|
11
11
|
string,
|
|
12
12
|
import('vue').PublicProps,
|
|
13
13
|
Readonly<
|
|
14
|
-
import('vue').ExtractPropTypes<
|
|
15
|
-
__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTagsItemProps>, {}>
|
|
16
|
-
>
|
|
14
|
+
import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>>
|
|
17
15
|
>,
|
|
18
16
|
{},
|
|
19
17
|
{}
|
|
@@ -4,6 +4,8 @@ declare const _default: import('vue').DefineComponent<
|
|
|
4
4
|
__VLS_TypePropsToOption<LcbTabsProps>,
|
|
5
5
|
{
|
|
6
6
|
itemFontSize: number
|
|
7
|
+
tagsMode: string
|
|
8
|
+
gap: number
|
|
7
9
|
}
|
|
8
10
|
>,
|
|
9
11
|
{},
|
|
@@ -21,12 +23,16 @@ declare const _default: import('vue').DefineComponent<
|
|
|
21
23
|
__VLS_TypePropsToOption<LcbTabsProps>,
|
|
22
24
|
{
|
|
23
25
|
itemFontSize: number
|
|
26
|
+
tagsMode: string
|
|
27
|
+
gap: number
|
|
24
28
|
}
|
|
25
29
|
>
|
|
26
30
|
>
|
|
27
31
|
>,
|
|
28
32
|
{
|
|
33
|
+
gap: number
|
|
29
34
|
itemFontSize: number
|
|
35
|
+
tagsMode: 'scroll' | 'tiled'
|
|
30
36
|
},
|
|
31
37
|
{}
|
|
32
38
|
>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view v-for="(item, index) in items" :key="index" class="px-8rpx py-5rpx">
|
|
3
|
-
<view
|
|
4
|
-
class="border-solid border-1 flex py-4rpx px-6rpx leading-none"
|
|
5
|
-
:style="{
|
|
6
|
-
borderRadius: transformValueUnit(tagRadius),
|
|
7
|
-
fontSize: transformValueUnit(fontSize),
|
|
8
|
-
color: tagColor,
|
|
9
|
-
borderColor: tagColor,
|
|
10
|
-
}"
|
|
11
|
-
>
|
|
12
|
-
<view>{{ item }}</view>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import type { LcbTagsItemProps } from '../types'
|
|
19
|
-
import { transformValueUnit } from '../../../utils/transform'
|
|
20
|
-
|
|
21
|
-
// defineProps<LcbImageProps>() @click="onClickItem(each.urlObj)"
|
|
22
|
-
|
|
23
|
-
const props = withDefaults(defineProps<LcbTagsItemProps>(), {})
|
|
24
|
-
</script>
|
|
25
|
-
<style lang="scss" scoped>
|
|
26
|
-
.tag {
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<lcb-block v-bind="$props">
|
|
3
|
-
<scroll-view v-if="mode == 1" scroll-x class="w-full whitespace-nowrap">
|
|
4
|
-
<view class="flex shrink-0 h-46rpx relative -mx-8rpx">
|
|
5
|
-
<Tag v-bind="itemProps" />
|
|
6
|
-
</view>
|
|
7
|
-
</scroll-view>
|
|
8
|
-
<view v-if="mode == 2" class="flex flex-wrap relative -mx-8rpx">
|
|
9
|
-
<Tag v-bind="itemProps" />
|
|
10
|
-
</view>
|
|
11
|
-
</lcb-block>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import { LcbTagsProps } from './types'
|
|
16
|
-
import Tag from './Tag/index.vue'
|
|
17
|
-
import { computed } from 'vue'
|
|
18
|
-
import { formatJson } from '../../utils/utils'
|
|
19
|
-
defineOptions({
|
|
20
|
-
name: 'LcbTags',
|
|
21
|
-
options: {
|
|
22
|
-
addGlobalClass: true,
|
|
23
|
-
virtualHost: true,
|
|
24
|
-
styleIsolation: 'shared',
|
|
25
|
-
},
|
|
26
|
-
})
|
|
27
|
-
const props = withDefaults(defineProps<LcbTagsProps>(), {
|
|
28
|
-
fontSize: 24,
|
|
29
|
-
tagColor: '#000',
|
|
30
|
-
})
|
|
31
|
-
const itemProps = computed(() => {
|
|
32
|
-
const data = props.items
|
|
33
|
-
return {
|
|
34
|
-
items: typeof data === 'object' ? data : formatJson(data, []),
|
|
35
|
-
fontSize: props.fontSize,
|
|
36
|
-
tagRadius: props.tagRadius,
|
|
37
|
-
tagColor: props.tagColor,
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// interface ActionView {
|
|
2
|
-
// title: string
|
|
3
|
-
// icon?: string
|
|
4
|
-
// link: LcbActionViewProps
|
|
5
|
-
// url?: string
|
|
6
|
-
// mode: number
|
|
7
|
-
// hotSpot?: {
|
|
8
|
-
// x: number
|
|
9
|
-
// y: number
|
|
10
|
-
// width: number
|
|
11
|
-
// height: number
|
|
12
|
-
// urlObj: LcbActionViewProps
|
|
13
|
-
// }[]
|
|
14
|
-
// }
|
|
15
|
-
|
|
16
|
-
export interface LcbTagsProps {
|
|
17
|
-
// Define the component's prop types here
|
|
18
|
-
items?: any
|
|
19
|
-
mode?: 1 | 2 // 1是不换行滚动 这是加在大部分产品里的用法 2是自然换行
|
|
20
|
-
tagRadius?: number
|
|
21
|
-
fontSize?: number
|
|
22
|
-
tagColor?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface LcbTagsItemProps {
|
|
26
|
-
items: object[]
|
|
27
|
-
tagRadius?: number
|
|
28
|
-
fontSize?: number
|
|
29
|
-
tagColor?: string
|
|
30
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { LcbTagsProps } from './types'
|
|
2
|
-
declare const _default: import('vue').DefineComponent<
|
|
3
|
-
__VLS_WithDefaults<
|
|
4
|
-
__VLS_TypePropsToOption<LcbTagsProps>,
|
|
5
|
-
{
|
|
6
|
-
fontSize: number
|
|
7
|
-
tagColor: string
|
|
8
|
-
}
|
|
9
|
-
>,
|
|
10
|
-
{},
|
|
11
|
-
unknown,
|
|
12
|
-
{},
|
|
13
|
-
{},
|
|
14
|
-
import('vue').ComponentOptionsMixin,
|
|
15
|
-
import('vue').ComponentOptionsMixin,
|
|
16
|
-
{},
|
|
17
|
-
string,
|
|
18
|
-
import('vue').PublicProps,
|
|
19
|
-
Readonly<
|
|
20
|
-
import('vue').ExtractPropTypes<
|
|
21
|
-
__VLS_WithDefaults<
|
|
22
|
-
__VLS_TypePropsToOption<LcbTagsProps>,
|
|
23
|
-
{
|
|
24
|
-
fontSize: number
|
|
25
|
-
tagColor: string
|
|
26
|
-
}
|
|
27
|
-
>
|
|
28
|
-
>
|
|
29
|
-
>,
|
|
30
|
-
{
|
|
31
|
-
fontSize: number
|
|
32
|
-
tagColor: string
|
|
33
|
-
},
|
|
34
|
-
{}
|
|
35
|
-
>
|
|
36
|
-
export default _default
|
|
37
|
-
type __VLS_WithDefaults<P, D> = {
|
|
38
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D
|
|
39
|
-
? __VLS_Prettify<
|
|
40
|
-
P[K] & {
|
|
41
|
-
default: D[K]
|
|
42
|
-
}
|
|
43
|
-
>
|
|
44
|
-
: P[K]
|
|
45
|
-
}
|
|
46
|
-
type __VLS_Prettify<T> = {
|
|
47
|
-
[K in keyof T]: T[K]
|
|
48
|
-
} & {}
|
|
49
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
|
|
50
|
-
type __VLS_TypePropsToOption<T> = {
|
|
51
|
-
[K in keyof T]-?: {} extends Pick<T, K>
|
|
52
|
-
? {
|
|
53
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
|
|
54
|
-
}
|
|
55
|
-
: {
|
|
56
|
-
type: import('vue').PropType<T[K]>
|
|
57
|
-
required: true
|
|
58
|
-
}
|
|
59
|
-
}
|