@tplc/business 0.7.55 → 0.7.56
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 +19 -0
- package/action.d.ts +1 -0
- package/components/lcb-wrapper-list/lcb-wrapper-list.vue +24 -5
- package/package.json +1 -1
- package/utils/request.ts +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
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.7.56](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.54...v0.7.56) (2026-01-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring | 代码重构
|
|
9
|
+
|
|
10
|
+
* **lcb-product-item:** remove unused type definitions and clean up component structure ([29c4cd2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/29c4cd2da45f3486d5efc654ef736120be697349))
|
|
11
|
+
* **lcb-tabs, lcb-filter-grid, lcb-list, lcb-product:** update useSyncForm to accept an object with dynamicScope and visibleScope, and set defaultIndex for tabs components ([578529d](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/578529d7fadd466d22f660ebfe90362740b8e630))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
15
|
+
|
|
16
|
+
* **release:** 0.7.55 ([fe46af8](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/fe46af87b2c0b2cc17f639dbd9a4b18ed43e8efb))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### ✨ Features | 新功能
|
|
20
|
+
|
|
21
|
+
* **lcb-tabs:** add defaultIndex prop to tabs components and update useSyncForm to accept visibleScope ([d46356f](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d46356f58a2c8b8f035a036d53e39fee0de9e69d))
|
|
22
|
+
* **lcb-wrapper-list:** enhance data handling by adding dynamicScope support and improving form synchronization ([48a562c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/48a562c69d1037073b1bff62b4491959c0ac5ea0))
|
|
23
|
+
|
|
5
24
|
### [0.7.55](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.52...v0.7.55) (2026-01-08)
|
|
6
25
|
|
|
7
26
|
|
package/action.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
|
|
|
40
40
|
import useDynamicData from '../../hooks/useDynamicData'
|
|
41
41
|
import { dynamicRequest } from '../../utils/request'
|
|
42
42
|
import { LcbWrapperListProps } from './types'
|
|
43
|
+
import useSyncForm from '../../hooks/useSyncForm'
|
|
43
44
|
defineOptions({
|
|
44
45
|
name: 'LcbWrapperList',
|
|
45
46
|
options: {
|
|
@@ -56,6 +57,7 @@ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
|
|
|
56
57
|
pagingUsePageScroll: true,
|
|
57
58
|
})
|
|
58
59
|
const { userStore, innerDynamicData } = useDynamicData()
|
|
60
|
+
const { form } = useSyncForm({ dynamicScope: props.dataSource?.requestInfo?.dynamicScope })
|
|
59
61
|
// 使用 shallowRef 优化大数组的响应式性能
|
|
60
62
|
const renderList = shallowRef<unknown[]>([])
|
|
61
63
|
const paging = ref()
|
|
@@ -83,10 +85,19 @@ const queryList = async (page: number, limit: number) => {
|
|
|
83
85
|
pageSearch.value = { page, limit }
|
|
84
86
|
const data = await dynamicRequest(props.dataSource, innerDynamicData.value, userStore?.userInfo, {
|
|
85
87
|
pageSearch: pageSearch.value,
|
|
88
|
+
...form.value,
|
|
86
89
|
})
|
|
87
90
|
paging.value?.complete?.(data)
|
|
88
91
|
}
|
|
89
92
|
|
|
93
|
+
const getPageData = () => {
|
|
94
|
+
pageSearch.value = {
|
|
95
|
+
limit: props.pageProps?.pageLimit || 10,
|
|
96
|
+
page: 1,
|
|
97
|
+
}
|
|
98
|
+
paging.value?.reload?.()
|
|
99
|
+
}
|
|
100
|
+
|
|
90
101
|
watch(
|
|
91
102
|
() =>
|
|
92
103
|
[
|
|
@@ -99,11 +110,7 @@ watch(
|
|
|
99
110
|
|
|
100
111
|
async ([dataSource, dynamicData, userInfo, pagingEnabled, pageLimit = 10]) => {
|
|
101
112
|
if (pagingEnabled) {
|
|
102
|
-
|
|
103
|
-
limit: pageLimit,
|
|
104
|
-
page: 1,
|
|
105
|
-
}
|
|
106
|
-
paging.value?.reload?.()
|
|
113
|
+
getPageData()
|
|
107
114
|
return
|
|
108
115
|
}
|
|
109
116
|
// 防止重复请求
|
|
@@ -118,6 +125,18 @@ watch(
|
|
|
118
125
|
{ immediate: true },
|
|
119
126
|
)
|
|
120
127
|
|
|
128
|
+
watch(
|
|
129
|
+
() => form.value,
|
|
130
|
+
() => {
|
|
131
|
+
if (props.pageProps?.pagingEnabled) {
|
|
132
|
+
getPageData()
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
deep: true,
|
|
137
|
+
},
|
|
138
|
+
)
|
|
139
|
+
|
|
121
140
|
// 优化:缓存 key 获取逻辑,减少属性访问
|
|
122
141
|
const getItemKey = (item: any, index: number) => {
|
|
123
142
|
return item?.id ?? item?.key ?? index
|
package/package.json
CHANGED
package/utils/request.ts
CHANGED
|
@@ -10,13 +10,10 @@ export const dynamicRequest = async (
|
|
|
10
10
|
if (dataSource?.source === 'remote') {
|
|
11
11
|
if (dataSource.requestInfo?.requestUrl) {
|
|
12
12
|
const baseParams = JSON.parse(dataSource.requestInfo.requestParams || '{}')
|
|
13
|
-
const response = await uni.$lcb.http.post(
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
...(extraParams || {}),
|
|
18
|
-
},
|
|
19
|
-
)
|
|
13
|
+
const response = await uni.$lcb.http.post(dataSource.requestInfo.requestUrl, {
|
|
14
|
+
...baseParams,
|
|
15
|
+
...(extraParams || {}),
|
|
16
|
+
})
|
|
20
17
|
/** 如果依赖key存在,则取依赖key的值 */
|
|
21
18
|
return response[dataSource?.dependKey || 'data'] as unknown
|
|
22
19
|
}
|