@tplc/business 0.4.25 → 0.4.27

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,22 @@
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.27](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.24...v0.4.27) (2025-03-27)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.25 ([2ad40e5](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2ad40e5abc837b15a5cc2a9ece27d8c30e4db150))
11
+ * **release:** 0.4.26 ([2057c24](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2057c245e4692eecd64f8ec1f0850792ba6672ca))
12
+
13
+
14
+ ### ✨ Features | 新功能
15
+
16
+ * 修改数据 ([e068701](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e0687014bb0d3fef33658acc50f742326d60a783))
17
+ * 支持过滤 ([7fd93ce](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7fd93ce323e2276b4a8e837340eeda1fe1926981))
18
+
19
+ ### [0.4.26](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.25...v0.4.26) (2025-03-26)
20
+
5
21
  ### [0.4.25](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.18...v0.4.25) (2025-03-26)
6
22
 
7
23
 
@@ -55,6 +55,7 @@ export interface FilterTagsProps {
55
55
  apiPath: string
56
56
  options: Option[]
57
57
  unit?: string
58
+ step?: number
58
59
  }
59
60
 
60
61
  interface BtnComponent {
@@ -81,7 +81,7 @@ const getSliderTitle = (value?: number[], max = 0, min = 0) => {
81
81
  const [start, end] = value
82
82
  if (start === min && end === max) {
83
83
  return translate('不限')
84
- } else if (end === max) {
84
+ } else if (end === max || end === undefined) {
85
85
  return `¥${start}` + translate('以上')
86
86
  } else if (start === min) {
87
87
  return `¥${end}` + translate('以下')
@@ -14,7 +14,7 @@
14
14
  custom-min-class="left-0 slider-text"
15
15
  custom-max-class="right--2 slider-text"
16
16
  :active-color="themeColor"
17
- :step="50"
17
+ :step="step"
18
18
  unit="¥"
19
19
  />
20
20
  <view class="grid grid-cols-4 gap-4 mt-2" v-if="options.length">
@@ -46,7 +46,9 @@ defineOptions({
46
46
  const themeColor = inject('theme-color', '#3875FF')
47
47
  const showLabel = ref(false)
48
48
  const slider = ref<SliderInstance>()
49
- const props = defineProps<FilterSliderProps>()
49
+ const props = withDefaults(defineProps<FilterSliderProps>(), {
50
+ step: 100,
51
+ })
50
52
  const model = defineModel<number[]>()
51
53
  const innerValue = ref<number[]>()
52
54
  const onItemClick = (value) => {
@@ -90,6 +92,8 @@ const onDragend = () => {
90
92
  showLabel.value = false
91
93
  if (innerValue.value?.[0] === props.max && innerValue.value?.[1] === props.max) {
92
94
  model.value = [innerValue.value?.[0]]
95
+ } else if (innerValue.value?.[0] === props.min && innerValue.value?.[1] === props.max) {
96
+ model.value = undefined
93
97
  } else {
94
98
  model.value = innerValue.value
95
99
  }
@@ -71,7 +71,7 @@
71
71
  :size="iconSize"
72
72
  :color="iconColor"
73
73
  v-if="form.keywords"
74
- @click="form.keywords = ''"
74
+ @touchend.prevent="form.keywords = ''"
75
75
  />
76
76
  </view>
77
77
  <lcb-action-view v-bind="link" :urlParams="stringify(addressCity)" v-else>
@@ -118,7 +118,7 @@ import { ChildHotAddress } from '../lcb-city-select/api'
118
118
  import useLocation from '../../hooks/useLocation'
119
119
  import { getHistoryCity } from '../../utils/history'
120
120
  import { parse, stringify } from 'qs'
121
- import { inject, Ref, ref, watchEffect } from 'vue'
121
+ import { inject, Ref, ref, watch, watchEffect } from 'vue'
122
122
  import { FORM_KEY } from '../../constants'
123
123
  import LcbSearchHistory from './components/SearchHistory/index.vue'
124
124
  import LcbSearchList from './components/SearchList/index.vue'
@@ -168,12 +168,10 @@ const popupProvide = inject('wd-popup', {
168
168
  getLocation()
169
169
  const form = inject(FORM_KEY) as Ref<Record<string, any>>
170
170
  const onSearch = async (e: { detail: { value: string } }) => {
171
- if (form?.value?.keywords) {
172
- uni.$emit(`${getPreviousPageId()}_filter_change`, {
173
- keywords: form?.value?.keywords,
174
- })
175
- uni.navigateBack()
176
- }
171
+ uni.$emit(`${getPreviousPageId()}_filter_change`, {
172
+ keywords: form?.value?.keywords,
173
+ })
174
+ uni.navigateBack()
177
175
  }
178
176
  const onSelect = (keyword: ProductInfo) => {
179
177
  searchHistoryRef.value?.saveHistory(keyword)
@@ -213,6 +211,26 @@ const onCancel = () => {
213
211
  watchEffect(() => {
214
212
  popupProvide.value = form.value?.keywords && props.productTypeList && top
215
213
  })
214
+ watch(
215
+ () => addressCity.value,
216
+ (val) => {
217
+ if (val) {
218
+ const params: Record<string, any> = {
219
+ cityId: val?.cityId,
220
+ areaId: val?.areaId,
221
+ provinceId: val?.provinceId,
222
+ addressName: val?.addressName,
223
+ }
224
+ if (val.keywords) {
225
+ params.keywords = val.keywords
226
+ }
227
+ form.value = {
228
+ ...form.value,
229
+ ...params,
230
+ }
231
+ }
232
+ },
233
+ )
216
234
  </script>
217
235
 
218
236
  <style lang="scss" scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.25",
3
+ "version": "0.4.27",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -50,6 +50,7 @@ export interface FilterTagsProps {
50
50
  apiPath: string
51
51
  options: Option[]
52
52
  unit?: string
53
+ step?: number
53
54
  }
54
55
  interface BtnComponent {
55
56
  postRequest: string
@@ -4,7 +4,12 @@ type __VLS_PublicProps = {
4
4
  modelValue?: number[]
5
5
  } & typeof __VLS_typeProps
6
6
  declare const _default: import('vue').DefineComponent<
7
- __VLS_TypePropsToOption<__VLS_PublicProps>,
7
+ __VLS_WithDefaults<
8
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
9
+ {
10
+ step: number
11
+ }
12
+ >,
8
13
  {},
9
14
  unknown,
10
15
  {},
@@ -16,13 +21,36 @@ declare const _default: import('vue').DefineComponent<
16
21
  },
17
22
  string,
18
23
  import('vue').PublicProps,
19
- Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
24
+ Readonly<
25
+ import('vue').ExtractPropTypes<
26
+ __VLS_WithDefaults<
27
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
28
+ {
29
+ step: number
30
+ }
31
+ >
32
+ >
33
+ > & {
20
34
  'onUpdate:modelValue'?: ((modelValue: number[]) => any) | undefined
21
35
  },
22
- {},
36
+ {
37
+ step: number
38
+ },
23
39
  {}
24
40
  >
25
41
  export default _default
42
+ type __VLS_WithDefaults<P, D> = {
43
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
44
+ ? __VLS_Prettify<
45
+ P[K] & {
46
+ default: D[K]
47
+ }
48
+ >
49
+ : P[K]
50
+ }
51
+ type __VLS_Prettify<T> = {
52
+ [K in keyof T]: T[K]
53
+ } & {}
26
54
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
27
55
  type __VLS_TypePropsToOption<T> = {
28
56
  [K in keyof T]-?: {} extends Pick<T, K>