@tplc/business 0.4.96 → 0.4.97

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.4.97](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.96...v0.4.97) (2025-05-07)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.96 ([bca9fb3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bca9fb32bf0d24a014144be1f022d198c4affa30))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * area 支持 key ([dfded5b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/dfded5bbf79cf894c5815cadb76509c0def5b736))
16
+ * 新增数据 ([abab3d2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/abab3d2467b033132fbd06819f9c17dbeaa5d1bb))
17
+
18
+ ### [0.4.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.95...v0.4.96) (2025-05-07)
5
19
  ### [0.4.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.92...v0.4.96) (2025-05-06)
6
20
 
7
21
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <lcb-block v-bind="$props">
2
+ <lcb-block v-bind="$props" v-if="showArea">
3
3
  <view
4
4
  class="h-full"
5
5
  :style="{
@@ -28,6 +28,7 @@
28
28
  import { computed } from 'vue'
29
29
  import { LcbAreaProps } from './types'
30
30
  import { transformValueUnit } from '@tplc/business/utils/transform'
31
+ import { get } from 'lodash-es'
31
32
  defineOptions({
32
33
  name: 'LcbArea',
33
34
  options: {
@@ -66,6 +67,16 @@ const getStyle = (index: number) => {
66
67
  flexShrink: props.display === 'flex' ? (props.flexShrink ?? 1) : undefined,
67
68
  }
68
69
  }
70
+
71
+ const showArea = computed(() => {
72
+ if (props.dependKey) {
73
+ const userStore = uni.$lcb.userStore?.()
74
+ return props.reverse
75
+ ? !get(userStore?.userInfo, props.dependKey)
76
+ : Boolean(get(userStore?.userInfo, props.dependKey))
77
+ }
78
+ return true
79
+ })
69
80
  </script>
70
81
 
71
82
  <style lang="scss" scoped>
@@ -17,4 +17,7 @@ export interface LcbAreaProps extends LcbBlockProps {
17
17
  }[]
18
18
  flexShrink?: number
19
19
  overflowX?: 'hidden' | 'initial' | 'auto'
20
+ dependKey?: string
21
+ keyFromUser?: boolean
22
+ reverse?: boolean
20
23
  }
@@ -97,6 +97,7 @@ import { ActionView } from '../../action'
97
97
  import { transformValueUnit } from '../../utils/transform'
98
98
  import { LcbImgNavProps } from './types'
99
99
  import { PAGE_PROVIDE_KEY } from '../../constants'
100
+ import { get } from 'lodash-es'
100
101
  const emits = defineEmits(['click'])
101
102
  const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
102
103
  const userStore = uni.$lcb.userStore?.()
@@ -140,12 +141,12 @@ const renderItems = computed(() => {
140
141
  if (item.dependKey) {
141
142
  if (item.keyFromUser) {
142
143
  return props.reverse
143
- ? !userStore?.userInfo?.[item.dependKey]
144
- : Boolean(userStore?.userInfo?.[item.dependKey])
144
+ ? !get(userStore?.userInfo, item.dependKey)
145
+ : Boolean(get(userStore?.userInfo, item.dependKey))
145
146
  } else {
146
147
  return props.reverse
147
- ? !pageInfo.value?.[item.dependKey]
148
- : Boolean(pageInfo.value?.[item.dependKey])
148
+ ? !get(pageInfo.value, item.dependKey)
149
+ : Boolean(get(pageInfo.value, item.dependKey))
149
150
  }
150
151
  }
151
152
  return true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.96",
3
+ "version": "0.4.97",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -17,4 +17,7 @@ export interface LcbAreaProps extends LcbBlockProps {
17
17
  }[]
18
18
  flexShrink?: number
19
19
  overflowX?: 'hidden' | 'initial' | 'auto'
20
+ dependKey?: string
21
+ keyFromUser?: boolean
22
+ reverse?: boolean
20
23
  }
@@ -60,8 +60,8 @@ declare const _default: import('vue').DefineComponent<
60
60
  {
61
61
  title: string
62
62
  fontWeight: number
63
- styleGroup: 1 | 2 | 3 | 4
64
63
  keyFromUser: boolean
64
+ styleGroup: 1 | 2 | 3 | 4
65
65
  back: boolean
66
66
  textSize: number
67
67
  topStyle: 1 | 2