@tplc/business 0.4.11 → 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 +14 -0
- package/components/lcb-calendar-filter/types.ts +1 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +10 -1
- package/components/lcb-list/hooks/useSelect.ts +20 -4
- package/components/lcb-search/lcb-search.vue +6 -0
- package/package.json +1 -1
- package/types/components/lcb-calendar-filter/types.d.ts +1 -0
- package/types/components/lcb-list/hooks/useSelect.d.ts +1 -0
- package/utils/formatter.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
### [0.4.12](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.11...v0.4.12) (2025-03-25)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ✨ Features | 新功能
|
|
16
|
+
|
|
17
|
+
* 搜索条件处理 ([56fb8cd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/56fb8cd2a4909b885d493809e92eff59ed784c08))
|
|
18
|
+
|
|
5
19
|
### [0.4.11](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.10...v0.4.11) (2025-03-25)
|
|
6
20
|
|
|
7
21
|
### [0.4.10](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.9...v0.4.10) (2025-03-25)
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</lcb-action-view>
|
|
44
44
|
</view>
|
|
45
45
|
</view>
|
|
46
|
-
<lcb-action-view v-bind="link" v-if="link" :url-params="form">
|
|
46
|
+
<lcb-action-view v-bind="link" v-if="link" :url-params="stringify(form)">
|
|
47
47
|
<wd-icon :name="icon" class-prefix="lcb" size="36rpx" color="#000" custom-class="ml-4" />
|
|
48
48
|
</lcb-action-view>
|
|
49
49
|
</lcb-block>
|
|
@@ -58,6 +58,7 @@ import { LcbCalendarSearchProps } from './types'
|
|
|
58
58
|
import { LcbAddress } from '../lcb-city-select/api'
|
|
59
59
|
import { FORM_KEY } from '../../constants'
|
|
60
60
|
import { getHistoryCity } from '../../utils/history'
|
|
61
|
+
import { stringify } from 'qs'
|
|
61
62
|
defineOptions({
|
|
62
63
|
name: 'LcbCalendarSearch',
|
|
63
64
|
options: {
|
|
@@ -114,6 +115,14 @@ onMounted(() => {
|
|
|
114
115
|
},
|
|
115
116
|
)
|
|
116
117
|
})
|
|
118
|
+
watch(
|
|
119
|
+
() => form.value.addressName,
|
|
120
|
+
(val) => {
|
|
121
|
+
if (addressCity.value?.addressName !== val) {
|
|
122
|
+
addressCity.value = form.value as LcbAddress
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
)
|
|
117
126
|
</script>
|
|
118
127
|
|
|
119
128
|
<style lang="scss" scoped>
|
|
@@ -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
|
-
|
|
39
|
+
const getOptions = async () => {
|
|
38
40
|
if (props.apiPath) {
|
|
39
|
-
|
|
40
|
-
|
|
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
|
}
|
|
@@ -152,6 +152,12 @@ const onSelect = (keyword: ProductInfo) => {
|
|
|
152
152
|
cityId: options.cityId,
|
|
153
153
|
...queryParams,
|
|
154
154
|
}
|
|
155
|
+
// 清空值为undefined
|
|
156
|
+
Object.keys(queryParams).forEach((key) => {
|
|
157
|
+
if (queryParams[key] === undefined) {
|
|
158
|
+
delete queryParams[key]
|
|
159
|
+
}
|
|
160
|
+
})
|
|
155
161
|
if (options.jumpType !== 'jump') {
|
|
156
162
|
uni.$emit(`${getPreviousPageId()}_filter_change`, queryParams)
|
|
157
163
|
uni.navigateBack()
|
package/package.json
CHANGED
package/utils/formatter.ts
CHANGED
|
@@ -13,9 +13,15 @@ export const calendarFormatter =
|
|
|
13
13
|
const nowMonth = now.getMonth()
|
|
14
14
|
const nowDa = now.getDate()
|
|
15
15
|
const info = holidayInfo[dayjs(day.date).format('YYYY-MM-DD')]
|
|
16
|
+
if (info?.topText) {
|
|
17
|
+
day.topInfo = info.topText
|
|
18
|
+
}
|
|
16
19
|
if (info?.bottomText) {
|
|
17
20
|
day.bottomInfo = info.bottomText
|
|
18
21
|
}
|
|
22
|
+
if (info?.centerText) {
|
|
23
|
+
day.text = info.centerText
|
|
24
|
+
}
|
|
19
25
|
if (year === nowYear && month === nowMonth && da === nowDa) {
|
|
20
26
|
day.topInfo = t('今天')
|
|
21
27
|
}
|