@tplc/business 0.7.80 → 0.7.82

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,27 @@
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.7.82](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.81...v0.7.82) (2026-01-20)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * **docs:** enhance documentation for various components, adding usage scenarios, examples, and source locations ([aa54921](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/aa549217140ebd93b569d4fbd1e5236fe66e2c72))
11
+ * **docs:** update lcb-calendar-search and lcb-grid documentation with new examples, configurations, and improved styling ([934131d](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/934131d6bdaba664a789e3c560db19497b630a44))
12
+ * **lcb-list, lcb-product, lcb-wrapper-list:** add empty state support with customizable properties ([a8be092](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/a8be0925ce92256dfb0f164fc9bd21b25b6351d2))
13
+
14
+
15
+ ### 🐛 Bug Fixes | Bug 修复
16
+
17
+ * **MemberRolePopup:** add immediate option to watch for role list fetching ([3bd2d82](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/3bd2d829366d502fe7cde5616572b8b3797fc6bd))
18
+
19
+ ### [0.7.81](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.80...v0.7.81) (2026-01-19)
20
+
21
+
22
+ ### ♻️ Code Refactoring | 代码重构
23
+
24
+ * **lcb-block:** optimize spacing style calculations for improved readability ([1498cd5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1498cd59904603d9d70f7a5df837cb4b588baf1d))
25
+
5
26
  ### [0.7.80](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.71...v0.7.80) (2026-01-19)
6
27
 
7
28
 
@@ -0,0 +1,160 @@
1
+ # 更新日志 - Empty 状态支持
2
+
3
+ **日期**: 2026-01-19
4
+
5
+ ## ✨ 新增功能
6
+
7
+ 创建了独立的 `lcb-empty` 组件,并为 `lcb-product`、`lcb-list` 和 `lcb-wrapper-list` 组件新增了 Empty 空状态支持。
8
+
9
+ ### 功能特性
10
+
11
+ - ✅ 支持自定义空状态图片
12
+ - ✅ 支持自定义空状态文字
13
+ - ✅ 支持自定义图片尺寸(宽度和高度)
14
+ - ✅ 支持自定义文字样式(颜色、大小、粗细)
15
+ - ✅ 支持自定义图片与文字的间距
16
+ - ✅ 通过独立的 `emptyProps` 属性配置
17
+
18
+ ### 配置项
19
+
20
+ ```typescript
21
+ interface LcbEmptyProps {
22
+ image?: string // 空状态图片地址
23
+ text?: string // 空状态文字,默认: '暂无数据'
24
+ imageWidth?: number // 图片宽度(rpx),默认: 400
25
+ imageHeight?: number // 图片高度(rpx),默认: 400
26
+ textColor?: string // 文字颜色,默认: '#999999'
27
+ textSize?: number // 文字大小(rpx),默认: 28
28
+ textWeight?: string // 文字粗细,默认: 'normal'
29
+ gap?: number // 图片与文字间距(rpx),默认: 24
30
+ minHeight?: number // 最小高度(rpx),默认: 400
31
+ paddingTop?: number // 内边距上,默认: 0
32
+ paddingRight?: number // 内边距右,默认: 0
33
+ paddingBottom?: number // 内边距下,默认: 0
34
+ paddingLeft?: number // 内边距左,默认: 0
35
+ }
36
+ ```
37
+
38
+ ### 使用示例
39
+
40
+ ```vue
41
+ <!-- lcb-product 组件 -->
42
+ <lcb-product
43
+ :items="[]"
44
+ :emptyProps="{
45
+ image: '/static/empty.png',
46
+ text: '还没有点亮记录',
47
+ imageWidth: 400,
48
+ imageHeight: 400,
49
+ textColor: '#999999',
50
+ textSize: 28,
51
+ textWeight: 'normal',
52
+ gap: 24,
53
+ }"
54
+ />
55
+
56
+ <!-- lcb-list 组件 -->
57
+ <lcb-list
58
+ pageFilterType="product-filter"
59
+ :emptyProps="{
60
+ image: '/static/empty.png',
61
+ text: '还没有点亮记录',
62
+ }"
63
+ />
64
+
65
+ <!-- lcb-wrapper-list 组件 -->
66
+ <lcb-wrapper-list
67
+ :dataSource="dataSource"
68
+ :emptyProps="{
69
+ image: '/static/empty.png',
70
+ text: '暂无数据',
71
+ }"
72
+ >
73
+ <template #default="{ data }">
74
+ <view>{{ data }}</view>
75
+ </template>
76
+ </lcb-wrapper-list>
77
+
78
+ <!-- 直接使用 lcb-empty 组件 -->
79
+ <lcb-empty
80
+ image="/static/empty.png"
81
+ text="还没有点亮记录"
82
+ />
83
+ ```
84
+
85
+ ## 📁 修改的文件
86
+
87
+ ### 新增组件
88
+ - `packages/business/components/lcb-empty/lcb-empty.vue`
89
+ - 独立的空状态组件
90
+ - 可在多个组件中复用
91
+
92
+ - `packages/business/components/lcb-empty/types.ts`
93
+ - `LcbEmptyProps` 接口定义
94
+
95
+ - `packages/business/components/lcb-empty/README.md`
96
+ - 组件使用文档
97
+
98
+ ### 类型定义
99
+ - `packages/business/components/lcb-product/types.ts`
100
+ - 导入 `LcbEmptyProps` 接口
101
+ - 在 `LcbProductProps` 中添加 `emptyProps` 属性
102
+
103
+ - `packages/business/components/lcb-list/types.ts`
104
+ - 导入 `LcbEmptyProps` 接口
105
+ - 在 `LcbListProps` 中添加 `emptyProps` 属性
106
+
107
+ - `packages/business/components/lcb-wrapper-list/types.ts`
108
+ - 导入 `LcbEmptyProps` 接口
109
+ - 在 `LcbWrapperListProps` 中添加 `emptyProps` 属性
110
+
111
+ ### 组件实现
112
+ - `packages/business/components/lcb-product/lcb-product.vue`
113
+ - 使用 `lcb-empty` 组件替换原有空状态实现
114
+ - 新增 `showEmpty` 和 `mergedEmptyProps` 计算属性
115
+
116
+ - `packages/business/components/lcb-list/lcb-list.vue`
117
+ - 将 `emptyProps` 透传给 `lcb-product` 组件
118
+
119
+ - `packages/business/components/lcb-wrapper-list/lcb-wrapper-list.vue`
120
+ - 添加空状态显示逻辑
121
+ - 使用 `lcb-empty` 组件
122
+ - 新增 `showEmpty` 和 `mergedEmptyProps` 计算属性
123
+
124
+ ### 静态资源
125
+ - `packages/engine/src/static/empty.png`
126
+ - 添加默认空状态图片
127
+
128
+ ### 文档
129
+ - `packages/business/components/lcb-product/EMPTY_USAGE.md` - 详细使用文档
130
+ - `packages/business/components/lcb-product/EMPTY_IMPLEMENTATION.md` - 实现说明
131
+ - `packages/business/components/lcb-product/EMPTY_QUICK_REF.md` - 快速参考
132
+
133
+ ### 示例
134
+ - `packages/engine/src/pages/lcb-product/empty-demo.vue` - 完整示例页面
135
+
136
+ ## 🔄 兼容性
137
+
138
+ - ✅ 向下兼容,不影响现有功能
139
+ - ✅ 可选配置,不配置时使用默认值
140
+ - ✅ 支持所有 `lcb-product` 的布局模式(list、grid、waterfall、horizontal)
141
+
142
+ ## 📝 注意事项
143
+
144
+ 1. 所有尺寸单位使用 `rpx`(响应式像素)
145
+ 2. 空状态在数据加载完成且列表为空时自动显示
146
+ 3. 图片和文字都是可选的,可以只显示其中一个
147
+ 4. 空状态会继承父组件的内边距设置
148
+
149
+ ## 🎯 适用场景
150
+
151
+ - 商品列表为空时的提示
152
+ - 搜索无结果时的展示
153
+ - 筛选条件过滤后无数据的提示
154
+ - 用户收藏、点亮等记录为空的展示
155
+
156
+ ## 📚 相关文档
157
+
158
+ - [详细使用说明](./EMPTY_USAGE.md)
159
+ - [实现文档](./EMPTY_IMPLEMENTATION.md)
160
+ - [快速参考](./EMPTY_QUICK_REF.md)
@@ -0,0 +1,260 @@
1
+ # 🎉 Empty 状态功能已完成
2
+
3
+ ## 概述
4
+
5
+ 已成功创建了独立的 `lcb-empty` 组件,并为 `lcb-product`、`lcb-list` 和 `lcb-wrapper-list` 组件添加了完整的空状态支持功能。用户现在可以通过 `emptyProps` 配置项自定义空状态的所有视觉元素。
6
+
7
+ ![Empty State Example](/static/empty.png)
8
+
9
+ ## ✨ 主要特性
10
+
11
+ - ✅ **独立组件**:抽离为 `lcb-empty` 独立组件,可在多处复用
12
+ - ✅ 自定义空状态图片及尺寸
13
+ - ✅ 自定义空状态文字及样式(颜色、大小、粗细)
14
+ - ✅ 自定义图片与文字的间距
15
+ - ✅ 独立的 `emptyProps` 配置项
16
+ - ✅ 完整的 TypeScript 类型支持
17
+ - ✅ 响应式设计,自动适配不同屏幕
18
+ - ✅ 支持 `lcb-product`、`lcb-list`、`lcb-wrapper-list` 等多个组件
19
+
20
+ ## 🚀 快速开始
21
+
22
+ ```vue
23
+ <template>
24
+ <lcb-product
25
+ :items="productList"
26
+ :emptyProps="{
27
+ image: '/static/empty.png',
28
+ text: '还没有点亮记录',
29
+ }"
30
+ />
31
+ </template>
32
+ ```
33
+
34
+ ## 📦 配置项
35
+
36
+ | 属性 | 类型 | 默认值 | 说明 |
37
+ |------|------|--------|------|
38
+ | `image` | `string` | `''` | 空状态图片地址 |
39
+ | `text` | `string` | `'还没有点亮记录'` | 空状态文字 |
40
+ | `imageWidth` | `number` | `400` | 图片宽度(rpx) |
41
+ | `imageHeight` | `number` | `400` | 图片高度(rpx) |
42
+ | `textColor` | `string` | `'#999999'` | 文字颜色 |
43
+ | `textSize` | `number` | `28` | 文字大小(rpx) |
44
+ | `textWeight` | `string \| number` | `'normal'` | 文字粗细 |
45
+ | `gap` | `number` | `24` | 图片与文字间距(rpx) |
46
+
47
+ ## 📖 完整示例
48
+
49
+ ### 基础用法
50
+
51
+ ```vue
52
+ <lcb-product
53
+ :items="[]"
54
+ :emptyProps="{
55
+ image: '/static/empty.png',
56
+ text: '还没有点亮记录',
57
+ }"
58
+ />
59
+ ```
60
+
61
+ ### 自定义样式
62
+
63
+ ```vue
64
+ <lcb-product
65
+ :items="[]"
66
+ :emptyProps="{
67
+ image: '/static/empty.png',
68
+ text: '暂无数据',
69
+ imageWidth: 500,
70
+ imageHeight: 500,
71
+ textColor: '#666666',
72
+ textSize: 32,
73
+ textWeight: 'bold',
74
+ gap: 32,
75
+ }"
76
+ />
77
+ ```
78
+
79
+ ### 在 lcb-list 中使用
80
+
81
+ ```vue
82
+ <lcb-list
83
+ pageFilterType="product-filter"
84
+ :emptyProps="{
85
+ image: '/static/empty.png',
86
+ text: '还没有点亮记录',
87
+ }"
88
+ />
89
+ ```
90
+
91
+ ### 在 lcb-wrapper-list 中使用
92
+
93
+ ```vue
94
+ <lcb-wrapper-list
95
+ :dataSource="dataSource"
96
+ :emptyProps="{
97
+ image: '/static/empty.png',
98
+ text: '暂无数据',
99
+ }"
100
+ >
101
+ <template #default="{ data }">
102
+ <view>{{ data }}</view>
103
+ </template>
104
+ </lcb-wrapper-list>
105
+ ```
106
+
107
+ ### 直接使用 lcb-empty 组件
108
+
109
+ ```vue
110
+ <lcb-empty
111
+ image="/static/empty.png"
112
+ text="还没有点亮记录"
113
+ :imageWidth="500"
114
+ :imageHeight="500"
115
+ />
116
+ ```
117
+
118
+ ## 📂 项目结构
119
+
120
+ ```
121
+ packages/
122
+ ├── business/
123
+ │ └── components/
124
+ │ ├── lcb-empty/ # 🆕 新增组件
125
+ │ │ ├── lcb-empty.vue # 📄 新增
126
+ │ │ ├── types.ts # 📄 新增
127
+ │ │ └── README.md # 📄 新增
128
+ │ ├── lcb-product/
129
+ │ │ ├── lcb-product.vue # ✅ 已修改
130
+ │ │ ├── types.ts # ✅ 已修改
131
+ │ │ ├── EMPTY_USAGE.md # 📄 新增
132
+ │ │ ├── EMPTY_IMPLEMENTATION.md # 📄 新增
133
+ │ │ └── EMPTY_QUICK_REF.md # 📄 新增
134
+ │ ├── lcb-list/
135
+ │ │ ├── lcb-list.vue # ✅ 已修改
136
+ │ │ └── types.ts # ✅ 已修改
137
+ │ ├── lcb-wrapper-list/
138
+ │ │ ├── lcb-wrapper-list.vue # ✅ 已修改
139
+ │ │ └── types.ts # ✅ 已修改
140
+ │ └── CHANGELOG_EMPTY.md # 📄 新增
141
+ └── engine/
142
+ └── src/
143
+ ├── static/
144
+ │ └── empty.png # 🖼️ 新增
145
+ └── pages/
146
+ └── lcb-product/
147
+ └── empty-demo.vue # 📄 新增
148
+ ```
149
+
150
+ ## 🔍 技术细节
151
+
152
+ ### 类型定义
153
+
154
+ ```typescript
155
+ export interface LcbEmptyProps {
156
+ /** 空状态图片地址 */
157
+ image?: string
158
+ /** 空状态文字 */
159
+ text?: string
160
+ /** 图片宽度(rpx) */
161
+ imageWidth?: number
162
+ /** 图片高度(rpx) */
163
+ imageHeight?: number
164
+ /** 文字颜色 */
165
+ textColor?: string
166
+ /** 文字大小(rpx) */
167
+ textSize?: number
168
+ /** 文字粗细 */
169
+ textWeight?: 'normal' | 'bold' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
170
+ /** 图片与文字的间距(rpx) */
171
+ gap?: number
172
+ /** 最小高度(rpx) */
173
+ minHeight?: number
174
+ /** 内边距配置 */
175
+ paddingTop?: number
176
+ paddingRight?: number
177
+ paddingBottom?: number
178
+ paddingLeft?: number
179
+ }
180
+ ```
181
+
182
+ ### 显示逻辑
183
+
184
+ 空状态在以下条件同时满足时显示:
185
+ - 数据加载完成(`loading === false`)
186
+ - 数据列表为空(`renderList.length === 0`)
187
+
188
+ ### 样式实现
189
+
190
+ - 使用 Flexbox 垂直居中布局
191
+ - 图片使用 `aspectFit` 模式保持比例
192
+ - 所有尺寸使用 `rpx` 单位,响应式适配
193
+ - 继承父组件的内边距设置
194
+
195
+ ## 📚 文档清单
196
+
197
+ 1. **[EMPTY_USAGE.md](./lcb-product/EMPTY_USAGE.md)** - 详细使用文档
198
+ - 配置项说明
199
+ - 使用示例
200
+ - 注意事项
201
+
202
+ 2. **[EMPTY_IMPLEMENTATION.md](./lcb-product/EMPTY_IMPLEMENTATION.md)** - 实现说明
203
+ - 修改的文件列表
204
+ - 技术实现细节
205
+ - 功能特点
206
+
207
+ 3. **[EMPTY_QUICK_REF.md](./lcb-product/EMPTY_QUICK_REF.md)** - 快速参考
208
+ - 配置项速查表
209
+ - 常用配置示例
210
+
211
+ 4. **[CHANGELOG_EMPTY.md](./CHANGELOG_EMPTY.md)** - 更新日志
212
+ - 新增功能说明
213
+ - 兼容性说明
214
+
215
+ 5. **[empty-demo.vue](../engine/src/pages/lcb-product/empty-demo.vue)** - 示例页面
216
+ - 多种配置场景展示
217
+ - 实际效果预览
218
+
219
+ ## ✅ 测试检查
220
+
221
+ - [x] TypeScript 类型检查通过
222
+ - [x] 无 Linter 错误
223
+ - [x] 默认配置正常工作
224
+ - [x] 自定义配置生效
225
+ - [x] 向下兼容性保持
226
+ - [x] 文档完整
227
+
228
+ ## 🎯 适用场景
229
+
230
+ - 商品列表为空时的提示
231
+ - 搜索无结果时的展示
232
+ - 筛选条件过滤后无数据的提示
233
+ - 用户收藏、点亮等记录为空的展示
234
+ - 任何需要空状态提示的列表场景
235
+
236
+ ## 💡 最佳实践
237
+
238
+ 1. **图片选择**:使用清晰、友好的插图,尺寸建议 300-600rpx
239
+ 2. **文字描述**:简洁明了,告知用户当前状态
240
+ 3. **颜色搭配**:文字颜色建议使用中性灰色(#999999)
241
+ 4. **间距设置**:图片与文字间距建议 20-40rpx
242
+ 5. **响应式**:使用 rpx 单位确保在不同设备上显示一致
243
+
244
+ ## 🔗 相关组件
245
+
246
+ - `lcb-empty` - 空状态组件(独立组件)
247
+ - `lcb-product` - 商品列表组件(使用 lcb-empty)
248
+ - `lcb-list` - 通用列表组件(使用 lcb-empty)
249
+ - `lcb-wrapper-list` - 包装列表组件(使用 lcb-empty)
250
+ - `lcb-block` - 容器组件
251
+
252
+ ## 📞 支持
253
+
254
+ 如有问题或建议,请查阅相关文档或联系开发团队。
255
+
256
+ ---
257
+
258
+ **开发时间**: 2026-01-19
259
+ **版本**: v1.0.0
260
+ **状态**: ✅ 已完成
@@ -153,11 +153,15 @@ const close = () => {
153
153
  }
154
154
 
155
155
  // 监听弹窗打开,获取角色列表
156
- watch(show, (newVal) => {
157
- if (newVal && roleList.value.length === 0) {
158
- fetchRoleList()
159
- }
160
- })
156
+ watch(
157
+ show,
158
+ (newVal) => {
159
+ if (newVal && roleList.value.length === 0) {
160
+ fetchRoleList()
161
+ }
162
+ },
163
+ { immediate: true },
164
+ )
161
165
  </script>
162
166
 
163
167
  <style lang="scss" scoped>