@tplc/business 0.4.12 → 0.4.13

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,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.4.13](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.12...v0.4.13) (2025-03-25)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 调整日历 ([89734b6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/89734b6488f7f06e0ce0acc6bb3926c2ff443284))
11
+
5
12
  ### [0.4.12](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.11...v0.4.12) (2025-03-25)
6
13
 
7
14
 
@@ -1,5 +1,6 @@
1
- import { onMounted, onUnmounted, ref, Ref } from 'vue'
1
+ import { inject, onMounted, onUnmounted, ref, Ref, watch } from 'vue'
2
2
  import { FilterItemProps, Option } from '../types'
3
+ import { FORM_KEY } from '../../../constants'
3
4
  const useSelect = (
4
5
  props: FilterItemProps,
5
6
  {
@@ -13,6 +14,7 @@ const useSelect = (
13
14
  },
14
15
  ) => {
15
16
  const options = ref<Option[]>(props.options || [])
17
+ const form = inject<Ref<Record<string, any>>>(FORM_KEY)
16
18
  const onItemClick = (item: Option, valueName?: string) => {
17
19
  let val: string[] | string | undefined
18
20
  const currentValue = valueName ? extraModel?.value[valueName] : model.value
@@ -34,12 +36,18 @@ const useSelect = (
34
36
  }
35
37
  }
36
38
 
37
- onMounted(async () => {
39
+ const getOptions = async () => {
38
40
  if (props.apiPath) {
39
- // 调用接口获取数据
40
- const { data } = await uni.$lcb.http.post<Option[]>(props.apiPath, props.apiParams || {})
41
+ const { data } = await uni.$lcb.http.post<Option[]>(props.apiPath, {
42
+ ...props.apiParams,
43
+ ...form?.value,
44
+ })
41
45
  options.value = data
42
46
  }
47
+ }
48
+
49
+ onMounted(async () => {
50
+ getOptions()
43
51
  if (onOpen) uni.$on('drop-open', onOpen)
44
52
  })
45
53
  onUnmounted(() => {
@@ -53,8 +61,16 @@ const useSelect = (
53
61
  return Boolean(currentValue && currentValue === item.value)
54
62
  }
55
63
  }
64
+ watch(
65
+ () => form?.value?.addressName,
66
+ () => {
67
+ console.log('form?.value?.addressName', form?.value?.addressName)
68
+ getOptions()
69
+ },
70
+ )
56
71
  return {
57
72
  options,
73
+ getOptions,
58
74
  getChecked,
59
75
  onItemClick,
60
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -24,6 +24,7 @@ declare const useSelect: (
24
24
  valueName?: string | undefined
25
25
  }[]
26
26
  >
27
+ getOptions: () => Promise<void>
27
28
  getChecked: (item: Option, valueName?: string) => boolean
28
29
  onItemClick: (item: Option, valueName?: string) => void
29
30
  }