@tplc/business 0.4.13 → 0.4.14

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,8 @@
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.14](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.13...v0.4.14) (2025-03-25)
6
+
5
7
  ### [0.4.13](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.12...v0.4.13) (2025-03-25)
6
8
 
7
9
 
@@ -59,6 +59,8 @@ import { LcbAddress } from '../lcb-city-select/api'
59
59
  import { FORM_KEY } from '../../constants'
60
60
  import { getHistoryCity } from '../../utils/history'
61
61
  import { stringify } from 'qs'
62
+ import { cleanOutSizeKeys } from '../../utils/transform'
63
+ import { getCurrentPage } from '../../utils/utils'
62
64
  defineOptions({
63
65
  name: 'LcbCalendarSearch',
64
66
  options: {
@@ -90,10 +92,18 @@ watch(
90
92
  () => addressCity.value,
91
93
  (val) => {
92
94
  if (val) {
93
- form.value.cityId = val?.cityId
94
- form.value.areaId = val?.areaId
95
+ const params: Record<string, any> = {
96
+ cityId: val?.cityId,
97
+ areaId: val?.areaId,
98
+ addressName: val?.addressName,
99
+ }
95
100
  if (val.keywords) {
96
- form.value.keywords = val.keywords
101
+ params.keywords = val.keywords
102
+ }
103
+ const datas = cleanOutSizeKeys(form.value, Object.keys(getCurrentPage().options))
104
+ form.value = {
105
+ ...datas,
106
+ ...params,
97
107
  }
98
108
  }
99
109
  },
@@ -14,7 +14,7 @@
14
14
  </view>
15
15
  <view class="scroll-view flex-1 w-0 bg-#FAFAFA pl-4" v-if="mode === 'single'">
16
16
  <view
17
- v-for="item in options[currentCategory].children"
17
+ v-for="item in options[currentCategory]?.children"
18
18
  :key="item.label"
19
19
  @click="onItemClick(item, options[currentCategory].valueName)"
20
20
  class="filter-select flex justify-between items-center !px-36rpx !py-30rpx"
@@ -64,7 +64,6 @@ const useSelect = (
64
64
  watch(
65
65
  () => form?.value?.addressName,
66
66
  () => {
67
- console.log('form?.value?.addressName', form?.value?.addressName)
68
67
  getOptions()
69
68
  },
70
69
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -3,3 +3,5 @@ export declare const transformValueUnit: (value?: number | string, uni?: string)
3
3
  export declare const getJsonStrFirstUrl: (jsonStr?: string) => any
4
4
  /** 获取json字符串列表 */
5
5
  export declare const getJsonStrList: (jsonStr?: string) => any
6
+ /** 删除其他外部字段 */
7
+ export declare const cleanOutSizeKeys: (obj: Record<string, any>, keys?: string[]) => {}
@@ -12,3 +12,17 @@ export const getJsonStrFirstUrl = (jsonStr = '[]') => {
12
12
  export const getJsonStrList = (jsonStr = '[]') => {
13
13
  return JSON.parse(jsonStr)
14
14
  }
15
+
16
+ /** 删除其他外部字段 */
17
+ export const cleanOutSizeKeys = (
18
+ obj: Record<string, any>,
19
+ /** 保留字段 */
20
+ keys: string[] = [],
21
+ ) => {
22
+ return Object.keys(obj).reduce((acc, key) => {
23
+ if ([...keys, ...['endDate', 'startDate', 'keywords']].includes(key)) {
24
+ acc[key] = obj[key]
25
+ }
26
+ return acc
27
+ }, {})
28
+ }