@tplc/business 0.7.55 → 0.7.57

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,43 @@
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.57](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.55...v0.7.57) (2026-01-09)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * **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))
11
+ * **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))
12
+
13
+
14
+ ### 🚀 Chore | 构建/工程依赖/工具
15
+
16
+ * **release:** 0.7.56 ([1b2216c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1b2216c1e81bdf60b85b9c179f614bb37c0588e5))
17
+
18
+
19
+ ### 🐛 Bug Fixes | Bug 修复
20
+
21
+ * **lcb-tabs:** update currentTab initialization to use item name based on defaultIndex ([aad2d22](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/aad2d22403c8c3ee8987fcdeb153f4637c9594a0))
22
+
23
+ ### [0.7.56](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.54...v0.7.56) (2026-01-08)
24
+
25
+
26
+ ### ♻️ Code Refactoring | 代码重构
27
+
28
+ * **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))
29
+ * **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))
30
+
31
+
32
+ ### 🚀 Chore | 构建/工程依赖/工具
33
+
34
+ * **release:** 0.7.55 ([fe46af8](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/fe46af87b2c0b2cc17f639dbd9a4b18ed43e8efb))
35
+
36
+
37
+ ### ✨ Features | 新功能
38
+
39
+ * **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))
40
+ * **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))
41
+
5
42
  ### [0.7.55](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.52...v0.7.55) (2026-01-08)
6
43
 
7
44
 
package/action.d.ts CHANGED
@@ -24,6 +24,7 @@ export interface DataSource {
24
24
  requestUrl: string
25
25
  requestParams: string
26
26
  }
27
+ dynamicScope?: string
27
28
  /** 动态key */
28
29
  dependKey?: string
29
30
  }
@@ -15,8 +15,9 @@
15
15
  :inactiveColor="tagTitleInactiveColor"
16
16
  :color="tagTitleActiveColor"
17
17
  v-model="currentTab"
18
+ animated
18
19
  >
19
- <wd-tab v-for="tab in items" :key="tab.name" :title="tab.title" :name="tab.name" />
20
+ <wd-tab v-for="tab in items" :key="tab.name" :title="tab.title" :name="tab.name" animated />
20
21
  </wd-tabs>
21
22
  </lcb-block>
22
23
  </template>
@@ -42,7 +43,7 @@ const props = withDefaults(defineProps<LcbTabsProps>(), {
42
43
  slidableNum: 6,
43
44
  defaultIndex: 0,
44
45
  })
45
- const currentTab = ref(props.defaultIndex)
46
+ const currentTab = ref(props.items?.[props.defaultIndex]?.name)
46
47
  const { syncForm } = useSyncForm({
47
48
  dynamicScope: props.dynamicScope,
48
49
  visibleScope: props.visibleScope,
@@ -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: {
@@ -52,16 +53,16 @@ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
52
53
  display: 'flex',
53
54
  flexDirection: 'column',
54
55
  pagingEnabled: false,
55
- pageLimit: 10,
56
56
  pagingUsePageScroll: true,
57
57
  })
58
58
  const { userStore, innerDynamicData } = useDynamicData()
59
+ const { form } = useSyncForm({ dynamicScope: props.dataSource?.dynamicScope })
59
60
  // 使用 shallowRef 优化大数组的响应式性能
60
61
  const renderList = shallowRef<unknown[]>([])
61
62
  const paging = ref()
62
63
  useZPaging(paging)
63
64
  const pageSearch = shallowRef<{ limit: number; page: number }>({
64
- limit: props.pageLimit,
65
+ limit: props.pageProps?.pageLimit || 10,
65
66
  page: 1,
66
67
  })
67
68
 
@@ -83,10 +84,19 @@ const queryList = async (page: number, limit: number) => {
83
84
  pageSearch.value = { page, limit }
84
85
  const data = await dynamicRequest(props.dataSource, innerDynamicData.value, userStore?.userInfo, {
85
86
  pageSearch: pageSearch.value,
87
+ ...form.value,
86
88
  })
87
89
  paging.value?.complete?.(data)
88
90
  }
89
91
 
92
+ const getPageData = () => {
93
+ pageSearch.value = {
94
+ limit: props.pageProps?.pageLimit || 10,
95
+ page: 1,
96
+ }
97
+ paging.value?.reload?.()
98
+ }
99
+
90
100
  watch(
91
101
  () =>
92
102
  [
@@ -95,27 +105,24 @@ watch(
95
105
  userStore?.userInfo,
96
106
  props.pageProps?.pagingEnabled,
97
107
  props.pageProps?.pageLimit,
108
+ form.value,
98
109
  ] as const,
99
110
 
100
- async ([dataSource, dynamicData, userInfo, pagingEnabled, pageLimit = 10]) => {
111
+ async ([dataSource, dynamicData, userInfo, pagingEnabled]) => {
101
112
  if (pagingEnabled) {
102
- pageSearch.value = {
103
- limit: pageLimit,
104
- page: 1,
105
- }
106
- paging.value?.reload?.()
113
+ getPageData()
107
114
  return
108
115
  }
109
116
  // 防止重复请求
110
117
  let data: unknown[] = []
111
- const result = await dynamicRequest(dataSource, dynamicData, userInfo)
118
+ const result = await dynamicRequest(dataSource, dynamicData, userInfo, form.value)
112
119
  if (result) {
113
120
  data = result
114
121
  }
115
122
  // 使用 shallowRef 时需要重新赋值整个数组
116
123
  renderList.value = Array.isArray(data) ? transformStringArrayToObjectArray(data) : []
117
124
  },
118
- { immediate: true },
125
+ { immediate: true, deep: true },
119
126
  )
120
127
 
121
128
  // 优化:缓存 key 获取逻辑,减少属性访问
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.55",
3
+ "version": "0.7.57",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -10,7 +10,6 @@ declare const __VLS_component: import('vue').DefineComponent<
10
10
  display: string
11
11
  flexDirection: string
12
12
  pagingEnabled: boolean
13
- pageLimit: number
14
13
  pagingUsePageScroll: boolean
15
14
  }
16
15
  >,
@@ -31,7 +30,6 @@ declare const __VLS_component: import('vue').DefineComponent<
31
30
  display: string
32
31
  flexDirection: string
33
32
  pagingEnabled: boolean
34
- pageLimit: number
35
33
  pagingUsePageScroll: boolean
36
34
  }
37
35
  >
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
- dataSource.requestInfo.requestUrl,
15
- {
16
- ...baseParams,
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
  }