@tplc/business 0.3.100 → 0.4.1

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,15 @@
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.1](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.101...v0.4.1) (2025-03-22)
6
+
7
+ ### [0.3.101](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.100...v0.3.101) (2025-03-22)
8
+
9
+
10
+ ### ✨ Features | 新功能
11
+
12
+ * 还差数据统一 ([4f87b06](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4f87b06331726ae4bf505c4ebae62076688ee9dc))
13
+
5
14
  ### [0.3.100](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.99...v0.3.100) (2025-03-22)
6
15
 
7
16
  ### [0.3.99](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.98...v0.3.99) (2025-03-22)
@@ -22,6 +22,7 @@
22
22
  :selected="getSelect(item)"
23
23
  ref="dropMenu"
24
24
  @opened="handleOpened"
25
+ @open="handleOpen"
25
26
  >
26
27
  <view class="lcb-filter__popup">
27
28
  <FilterSelect
@@ -119,5 +120,8 @@ const getSelect = (item: FilterComponent) => {
119
120
  const handleOpened = () => {
120
121
  uni.$emit('drop-opened')
121
122
  }
123
+ const handleOpen = () => {
124
+ uni.$emit('drop-open')
125
+ }
122
126
  </script>
123
127
  <style lang="scss" scoped></style>
@@ -82,7 +82,17 @@ const extraModel = ref({
82
82
  })
83
83
  const itemTopPositions = ref<{ top: number; bottom: number }[]>([])
84
84
  const emits = defineEmits(['submit'])
85
- const { onItemClick, options, getChecked } = useSelect(props, { model: innerValue, extraModel })
85
+ const onOpen = () => {
86
+ innerValue.value = props.value
87
+ extraModel.value = {
88
+ ...props.filterValue,
89
+ }
90
+ }
91
+ const { onItemClick, options, getChecked } = useSelect(props, {
92
+ model: innerValue,
93
+ extraModel,
94
+ onOpen,
95
+ })
86
96
  const currentCategory = ref(0)
87
97
  const onSubmit = () => {
88
98
  let count = 0
@@ -1,13 +1,15 @@
1
- import { onMounted, ref, Ref } from 'vue'
1
+ import { onMounted, onUnmounted, ref, Ref } from 'vue'
2
2
  import { FilterItemProps, Option } from '../types'
3
3
  const useSelect = (
4
4
  props: FilterItemProps,
5
5
  {
6
6
  model,
7
7
  extraModel,
8
+ onOpen,
8
9
  }: {
9
10
  model: Ref<string | string[] | undefined>
10
11
  extraModel?: Ref<Record<string, any>>
12
+ onOpen?: () => void
11
13
  },
12
14
  ) => {
13
15
  const options = ref<Option[]>(props.options || [])
@@ -38,6 +40,10 @@ const useSelect = (
38
40
  const { data } = await uni.$lcb.http.post<Option[]>(props.apiPath, props.apiParams || {})
39
41
  options.value = data
40
42
  }
43
+ if (onOpen) uni.$on('drop-open', onOpen)
44
+ })
45
+ onUnmounted(() => {
46
+ if (onOpen) uni.$off('drop-open', onOpen)
41
47
  })
42
48
  const getChecked = (item: Option, valueName?: string) => {
43
49
  const currentValue = valueName ? extraModel?.value[valueName] : model.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.100",
3
+ "version": "0.4.1",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -5,9 +5,11 @@ declare const useSelect: (
5
5
  {
6
6
  model,
7
7
  extraModel,
8
+ onOpen,
8
9
  }: {
9
10
  model: Ref<string | string[] | undefined>
10
11
  extraModel?: Ref<Record<string, any>>
12
+ onOpen?: () => void
11
13
  },
12
14
  ) => {
13
15
  options: Ref<