@tplc/business 0.5.49 → 0.5.51

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,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.5.51](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.50...v0.5.51) (2025-11-15)
6
+
7
+ ### [0.5.50](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.49...v0.5.50) (2025-11-15)
8
+
9
+
10
+ ### 🐛 Bug Fixes | Bug 修复
11
+
12
+ * 修改block ([9abe6cf](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/9abe6cfd208f1b62bf806c5e91fd96a3b4d7cf53))
13
+
14
+
15
+ ### ✨ Features | 新功能
16
+
17
+ * 逻辑处理 ([8576a3c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8576a3ce1f0144980cae7ce25e3f944a87b51c80))
18
+
5
19
  ### [0.5.49](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.48...v0.5.49) (2025-11-15)
6
20
 
7
21
 
@@ -45,7 +45,6 @@ const props = withDefaults(defineProps<LcbAreaProps>(), {
45
45
  })
46
46
  const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
47
47
  const innerStyle = computed(() => {
48
- // col-span-2
49
48
  if (props.display === 'grid') {
50
49
  return {
51
50
  gridTemplateColumns: `repeat(${props.gridColumns}, minmax(0, 1fr))`,
@@ -74,8 +73,27 @@ const showArea = computed(() => {
74
73
  if (props.dependKey) {
75
74
  const userStore = uni.$lcb.userStore?.()
76
75
  const value = get(props.keyFromUser ? userStore?.userInfo : pageInfo.value, props.dependKey)
76
+
77
77
  if (props.dependKeyCompareValue) {
78
- return `${value}` === `${props.dependKeyCompareValue}`
78
+ const compareValue = `${props.dependKeyCompareValue}`
79
+ switch (props.compareType) {
80
+ case '=':
81
+ return `${value}` === compareValue
82
+ case '>=':
83
+ return value >= compareValue
84
+ case '<=':
85
+ return value <= compareValue
86
+ case '>':
87
+ return value > compareValue
88
+ case '<':
89
+ return value < compareValue
90
+ case '!=':
91
+ return value !== compareValue
92
+ case 'includes':
93
+ return value.includes(compareValue)
94
+ default:
95
+ return `${value}` === compareValue
96
+ }
79
97
  }
80
98
  if (value === undefined) {
81
99
  return false
@@ -22,4 +22,5 @@ export interface LcbAreaProps extends LcbBlockProps {
22
22
  reverse?: boolean
23
23
  dependKeyCompareValue?: string
24
24
  position?: 'relative' | 'absolute'
25
+ compareType?: '=' | '>=' | '<=' | '>' | '<' | '!=' | 'includes'
25
26
  }
@@ -15,7 +15,7 @@
15
15
  boxShadow:
16
16
  shadowColor && shadowSize ? `0px 0px ${blurSize}px ${shadowSize}px ${shadowColor}` : '',
17
17
  textAlign,
18
- margin: `${transformValueUnit(marginTop || -(floatUp || 0))} ${transformValueUnit(marginRight || marginHorizontal || 0)} ${transformValueUnit(marginBottom || 0)} ${transformValueUnit(marginLeft || marginHorizontal || 0)}`,
18
+ margin: `${transformValueUnit(floatUp ? -floatUp : marginTop || 0)} ${transformValueUnit(marginRight || marginHorizontal || 0)} ${transformValueUnit(marginBottom || 0)} ${transformValueUnit(marginLeft || marginHorizontal || 0)}`,
19
19
  ...customStyle,
20
20
  ...getFlexStyle(align),
21
21
  }"
@@ -102,9 +102,30 @@ const customStyle = computed(() => {
102
102
  const showTitle = computed(() => {
103
103
  if (props.visibleKeyFromUser) {
104
104
  const userInfo = uni.$lcb.userStore?.()?.userInfo
105
- return props.visibleKeyReverse
106
- ? !get(userInfo, props.visibleKeyFromUser)
107
- : get(userInfo, props.visibleKeyFromUser)
105
+ const value = `${get(userInfo, props.visibleKeyFromUser)}`
106
+ if (props.compareType && props.compareValue && value) {
107
+ const compareValue = `${props.compareValue}`
108
+ switch (props.compareType) {
109
+ case '=':
110
+ return value === compareValue
111
+ case '>=':
112
+ return value >= compareValue
113
+ case '<=':
114
+ return value <= compareValue
115
+ case '>':
116
+ return value > compareValue
117
+ case '<':
118
+ return value < compareValue
119
+ case '!=':
120
+ return value !== compareValue
121
+ case 'includes':
122
+ return value.includes(compareValue)
123
+ default:
124
+ return true
125
+ }
126
+ } else {
127
+ return props.visibleKeyReverse ? !value : value
128
+ }
108
129
  }
109
130
  return true
110
131
  })
@@ -39,4 +39,7 @@ export interface LcbTitleProps
39
39
  visibleKeyFromUser?: string
40
40
  /** 依赖值反选 */
41
41
  visibleKeyReverse?: boolean
42
+ /** 依赖值对比类型 */
43
+ compareType?: '=' | '>=' | '<=' | '>' | '<' | '!=' | 'includes'
44
+ compareValue?: string
42
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.5.49",
3
+ "version": "0.5.51",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -22,4 +22,5 @@ export interface LcbAreaProps extends LcbBlockProps {
22
22
  reverse?: boolean
23
23
  dependKeyCompareValue?: string
24
24
  position?: 'relative' | 'absolute'
25
+ compareType?: '=' | '>=' | '<=' | '>' | '<' | '!=' | 'includes'
25
26
  }
@@ -36,4 +36,7 @@ export interface LcbTitleProps
36
36
  visibleKeyFromUser?: string
37
37
  /** 依赖值反选 */
38
38
  visibleKeyReverse?: boolean
39
+ /** 依赖值对比类型 */
40
+ compareType?: '=' | '>=' | '<=' | '>' | '<' | '!=' | 'includes'
41
+ compareValue?: string
39
42
  }