@travel-screen/l-module-components 1.0.0

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.
Files changed (75) hide show
  1. package/README.md +86 -0
  2. package/package.json +34 -0
  3. package/src/index.js +60 -0
  4. package/src/l-bar-chart/README.md +302 -0
  5. package/src/l-bar-chart/index.vue +405 -0
  6. package/src/l-bar-chart/interface/index.js +210 -0
  7. package/src/l-data-panel/README.md +331 -0
  8. package/src/l-data-panel/img/images.js +47 -0
  9. package/src/l-data-panel/img/l-data-panel_bg_1.png +0 -0
  10. package/src/l-data-panel/img/l-data-panel_bg_2.png +0 -0
  11. package/src/l-data-panel/img/l-data-panel_bg_3.png +0 -0
  12. package/src/l-data-panel/index.vue +150 -0
  13. package/src/l-data-panel/interface/index.js +249 -0
  14. package/src/l-data-ring/README.md +292 -0
  15. package/src/l-data-ring/img/images.js +21 -0
  16. package/src/l-data-ring/img/l-data-ring_bg.png +0 -0
  17. package/src/l-data-ring/index.vue +93 -0
  18. package/src/l-data-ring/interface/index.js +116 -0
  19. package/src/l-date-picker/README.md +276 -0
  20. package/src/l-date-picker/index.vue +185 -0
  21. package/src/l-date-picker/interface/index.js +128 -0
  22. package/src/l-icon-label/README.md +356 -0
  23. package/src/l-icon-label/img/images.js +28 -0
  24. package/src/l-icon-label/img/l-icon-label_bg.png +0 -0
  25. package/src/l-icon-label/img/l-icon-label_icon.png +0 -0
  26. package/src/l-icon-label/index.vue +162 -0
  27. package/src/l-icon-label/interface/index.js +234 -0
  28. package/src/l-label-value/README.md +358 -0
  29. package/src/l-label-value/img/images.js +19 -0
  30. package/src/l-label-value/img/l-label-value_line.png +0 -0
  31. package/src/l-label-value/index.vue +132 -0
  32. package/src/l-label-value/interface/index.js +116 -0
  33. package/src/l-metric-tile/README.md +391 -0
  34. package/src/l-metric-tile/img/images.js +19 -0
  35. package/src/l-metric-tile/img/l-metric-tile_bg_1.png +0 -0
  36. package/src/l-metric-tile/index.vue +138 -0
  37. package/src/l-metric-tile/interface/index.js +241 -0
  38. package/src/l-module-box/README.md +289 -0
  39. package/src/l-module-box/img/images.js +28 -0
  40. package/src/l-module-box/img/l-module-box_bg.png +0 -0
  41. package/src/l-module-box/img/l-module-box_icon.png +0 -0
  42. package/src/l-module-box/index.vue +125 -0
  43. package/src/l-module-box/interface/index.js +93 -0
  44. package/src/l-module-tag/README.md +243 -0
  45. package/src/l-module-tag/index.vue +137 -0
  46. package/src/l-module-tag/interface/index.js +91 -0
  47. package/src/l-rank-list/README.md +553 -0
  48. package/src/l-rank-list/img/images.js +34 -0
  49. package/src/l-rank-list/img/l-rank-list_icon_line.png +0 -0
  50. package/src/l-rank-list/img/l-rank-list_icon_rank_1.png +0 -0
  51. package/src/l-rank-list/img/l-rank-list_icon_rank_2.png +0 -0
  52. package/src/l-rank-list/img/l-rank-list_icon_rank_other.png +0 -0
  53. package/src/l-rank-list/index.vue +610 -0
  54. package/src/l-rank-list/interface/index.js +343 -0
  55. package/src/l-stat-card/README.md +309 -0
  56. package/src/l-stat-card/img/images.js +36 -0
  57. package/src/l-stat-card/img/img-bg.png +0 -0
  58. package/src/l-stat-card/img/l-stat-card_img_1.png +0 -0
  59. package/src/l-stat-card/index.vue +136 -0
  60. package/src/l-stat-card/interface/index.js +159 -0
  61. package/src/l-tabs/README.md +285 -0
  62. package/src/l-tabs/img/images.js +19 -0
  63. package/src/l-tabs/img/l-tabs_bg.png +0 -0
  64. package/src/l-tabs/index.vue +97 -0
  65. package/src/l-tabs/interface/index.js +115 -0
  66. package/src/l-trend-card/README.md +415 -0
  67. package/src/l-trend-card/img/images.js +41 -0
  68. package/src/l-trend-card/img/l-trend-card_bg.png +0 -0
  69. package/src/l-trend-card/img/l-trend-card_icon_1.png +0 -0
  70. package/src/l-trend-card/img/l-trend-card_icon_down.png +0 -0
  71. package/src/l-trend-card/img/l-trend-card_icon_up.png +0 -0
  72. package/src/l-trend-card/index.vue +181 -0
  73. package/src/l-trend-card/interface/index.js +243 -0
  74. package/src/utils/tooltip.js +30 -0
  75. package/src/utils/util.js +27 -0
@@ -0,0 +1,331 @@
1
+ ---
2
+ AIGC:
3
+ ContentProducer: '001191110102MAD55U9H0F10002'
4
+ ContentPropagator: '001191110102MAD55U9H0F10002'
5
+ Label: '1'
6
+ ProduceID: '2ea2d13c-1fa6-4562-ba6a-3d802bb1abf8'
7
+ PropagateID: '2ea2d13c-1fa6-4562-ba6a-3d802bb1abf8'
8
+ ReservedCode1: '8cf2c751-c37c-421c-bc38-47dabc47f145'
9
+ ReservedCode2: '8cf2c751-c37c-421c-bc38-47dabc47f145'
10
+ ---
11
+
12
+ # LDataPanel 组件说明
13
+
14
+ ## 概述
15
+
16
+ `LDataPanel` 是一个参数化驱动的数据面板组件,采用类似 Element UI 的封装方式。用于展示3个并列的数据卡片(如:重点景区实时接待量、全域实时客流量、文博场馆实时接待量)。所有样式(背景图、数值大小/颜色、标签样式、布局等)均通过 props 参数动态控制。
17
+
18
+ ## 核心特性
19
+
20
+ - ✅ **Props 驱动**:所有样式通过 props 参数控制,类似 Element UI
21
+ - ✅ **默认背景图**:未传入背景图时自动使用组件内置默认背景图
22
+ - ✅ **高度灵活**:支持自定义背景图、尺寸、颜色、字体等所有样式
23
+ - ✅ **类型安全**:支持 String 和 Number 类型的尺寸参数
24
+ - ✅ **3卡片布局**:固定展示3个数据卡片,布局统一
25
+
26
+ ## 文件结构
27
+
28
+ ```
29
+ l-data-panel/
30
+ ├── img/
31
+ │ ├── images.js # 图片映射文件
32
+ │ ├── l-data-panel_bg_1.png # 卡片1默认背景图
33
+ │ ├── l-data-panel_bg_2.png # 卡片2默认背景图
34
+ │ └── l-data-panel_bg_3.png # 卡片3默认背景图
35
+ ├── interface/
36
+ │ └── index.js # Props 定义(30+ 个参数)
37
+ ├── index.vue # 主组件(内联样式驱动)
38
+ └── README.md # 组件说明文档
39
+ ```
40
+
41
+ ## Props 参数
42
+
43
+ ### 基础数据
44
+
45
+ | 参数名 | 类型 | 默认值 | 说明 |
46
+ |--------|------|--------|------|
47
+ | `dataList` | Array | `[]` | 数据列表,每项包含 num(数值)和 label(标签文字) |
48
+
49
+ ### 容器相关
50
+
51
+ | 参数名 | 类型 | 默认值 | 说明 |
52
+ |--------|------|--------|------|
53
+ | `containerDisplay` | String | `'flex'` | 容器显示方式 |
54
+ | `containerJustifyContent` | String | `'space-between'` | 容器对齐方式 |
55
+ | `containerWidth` | String/Number | `'100%'` | 容器宽度 |
56
+ | `containerHeight` | String/Number | `'140px'` | 容器高度 |
57
+ | `containerPadding` | String | `'0 40px'` | 容器内边距 |
58
+ | `containerMarginTop` | String/Number | `'40px'` | 容器顶部外边距 |
59
+ | `containerPointerEvents` | String | `'auto'` | 容器指针事件 |
60
+
61
+ ### 卡片通用样式
62
+
63
+ | 参数名 | 类型 | 默认值 | 说明 |
64
+ |--------|------|--------|------|
65
+ | `cardHeight` | String/Number | `'110px'` | 卡片高度 |
66
+ | `cardDisplay` | String | `'flex'` | 卡片显示方式 |
67
+ | `cardFlexDirection` | String | `'column'` | 卡片主轴方向 |
68
+ | `cardJustifyContent` | String | `'center'` | 卡片交叉轴对齐 |
69
+ | `cardBgRepeat` | String | `'no-repeat'` | 卡片背景重复方式 |
70
+ | `cardBgPosition` | String | `'center'` | 卡片背景位置 |
71
+ | `cardBgSize` | String | `'100% 100%'` | 卡片背景尺寸 |
72
+
73
+ ### 卡片1(左侧)相关
74
+
75
+ | 参数名 | 类型 | 默认值 | 说明 |
76
+ |--------|------|--------|------|
77
+ | `card1Position` | String | `'relative'` | 卡片1定位方式 |
78
+ | `card1Left` | String/Number | `'7px'` | 卡片1左侧偏移 |
79
+ | `card1PaddingRight` | String/Number | `'62px'` | 卡片1右侧内边距 |
80
+ | `card1Width` | String/Number | `'288px'` | 卡片1宽度 |
81
+ | `card1TextAlign` | String | `'right'` | 卡片1文字对齐 |
82
+ | `card1BgImage` | String | `''` | 卡片1背景图(留空使用默认) |
83
+
84
+ ### 卡片2(中间)相关
85
+
86
+ | 参数名 | 类型 | 默认值 | 说明 |
87
+ |--------|------|--------|------|
88
+ | `card2TextAlign` | String | `'center'` | 卡片2文字对齐 |
89
+ | `card2Width` | String/Number | `'267px'` | 卡片2宽度 |
90
+ | `card2BgImage` | String | `''` | 卡片2背景图(留空使用默认) |
91
+
92
+ ### 卡片3(右侧)相关
93
+
94
+ | 参数名 | 类型 | 默认值 | 说明 |
95
+ |--------|------|--------|------|
96
+ | `card3TextAlign` | String | `'left'` | 卡片3文字对齐 |
97
+ | `card3Position` | String | `'relative'` | 卡片3定位方式 |
98
+ | `card3PaddingLeft` | String/Number | `'62px'` | 卡片3左侧内边距 |
99
+ | `card3Left` | String/Number | `'-7px'` | 卡片3左侧偏移 |
100
+ | `card3Width` | String/Number | `'288px'` | 卡片3宽度 |
101
+ | `card3BgImage` | String | `''` | 卡片3背景图(留空使用默认) |
102
+
103
+ ### 数值相关
104
+
105
+ | 参数名 | 类型 | 默认值 | 说明 |
106
+ |--------|------|--------|------|
107
+ | `numFontFamily` | String | `'DINAlternate, DIN Alternate, YouSheBiaoTiHei, sans-serif'` | 数值字体 |
108
+ | `numFontWeight` | String/Number | `'bold'` | 数值字重 |
109
+ | `numFontStyle` | String | `'italic'` | 数值字体样式 |
110
+ | `numFontSize` | String/Number | `'44px'` | 数值字号 |
111
+ | `numColor` | String | `'#ffffff'` | 数值颜色 |
112
+ | `numBackground` | String | `'linear-gradient(180deg, #ffffff 0%, #4aefa0 100%)'` | 数值背景渐变色 |
113
+ | `numBackgroundClip` | String | `'text'` | 数值背景裁剪 |
114
+ | `numTextShadow` | String | `'0px 2px 6px rgba(74, 239, 160, 0.5)'` | 数值文字阴影 |
115
+ | `numLineHeight` | String/Number | `1` | 数值行高 |
116
+ | `numMarginBottom` | String/Number | `'10px'` | 数值底部边距 |
117
+ | `numPaddingRight` | String/Number | `'5px'` | 数值右侧内边距 |
118
+
119
+ ### 标签相关
120
+
121
+ | 参数名 | 类型 | 默认值 | 说明 |
122
+ |--------|------|--------|------|
123
+ | `labelFontFamily` | String | `'PingFangSC, PingFang SC'` | 标签字体 |
124
+ | `labelFontWeight` | String/Number | `500` | 标签字重 |
125
+ | `labelFontSize` | String/Number | `'20px'` | 标签字号 |
126
+ | `labelColor` | String | `'#ffffff'` | 标签颜色 |
127
+ | `labelLineHeight` | String/Number | `1` | 标签行高 |
128
+
129
+ ## 使用方式
130
+
131
+ ### 基本使用
132
+
133
+ ```vue
134
+ <template>
135
+ <l-data-panel
136
+ :dataList="passengerFlowList"
137
+ />
138
+ </template>
139
+
140
+ <script>
141
+ import LDataPanel from '@/components/moduleDataNew/l-data-panel/index.vue'
142
+
143
+ export default {
144
+ components: {
145
+ LDataPanel
146
+ },
147
+ data() {
148
+ return {
149
+ passengerFlowList: [
150
+ { num: 359647, label: '重点景区实时接待量' },
151
+ { num: 4230737, label: '全域实时客流量' },
152
+ { num: 690, label: '文博场馆实时接待量' }
153
+ ]
154
+ }
155
+ }
156
+ }
157
+ </script>
158
+ ```
159
+
160
+ ### 自定义背景图
161
+
162
+ ```vue
163
+ <template>
164
+ <l-data-panel
165
+ :dataList="passengerFlowList"
166
+ :card1BgImage="require('@/assets/custom-bg-1.png')"
167
+ :card2BgImage="require('@/assets/custom-bg-2.png')"
168
+ :card3BgImage="require('@/assets/custom-bg-3.png')"
169
+ />
170
+ </template>
171
+ ```
172
+
173
+ ### 自定义数值和标签样式
174
+
175
+ ```vue
176
+ <template>
177
+ <l-data-panel
178
+ :dataList="passengerFlowList"
179
+ :numFontSize="48"
180
+ numColor="#FF6B6B"
181
+ :numBackground="'linear-gradient(180deg, #FF6B6B 0%, #4CE27E 100%)'"
182
+ :numTextShadow="'0px 2px 8px rgba(255, 107, 107, 0.6)'"
183
+ :labelFontSize="18"
184
+ labelColor="#E8EEF4"
185
+ />
186
+ </template>
187
+ ```
188
+
189
+ ### 完整自定义
190
+
191
+ ```vue
192
+ <template>
193
+ <l-data-panel
194
+ :dataList="passengerFlowList"
195
+ :containerHeight="150"
196
+ :containerPadding="'0 50px'"
197
+ :containerMarginTop="50"
198
+ :cardHeight="120"
199
+ :card1Width="300"
200
+ :card2Width="280"
201
+ :card3Width="300"
202
+ :numFontSize="48"
203
+ numColor="#4CE27E"
204
+ :numBackground="'linear-gradient(180deg, #4CE27E 0%, #36D399 100%)'"
205
+ :numTextShadow="'0px 2px 10px rgba(76, 226, 126, 0.7)'"
206
+ :labelFontSize="18"
207
+ labelColor="#E8EEF4"
208
+ />
209
+ </template>
210
+
211
+ <script>
212
+ export default {
213
+ data() {
214
+ return {
215
+ passengerFlowList: [
216
+ { num: 359647, label: '重点景区实时接待量' },
217
+ { num: 4230737, label: '全域实时客流量' },
218
+ { num: 690, label: '文博场馆实时接待量' }
219
+ ]
220
+ }
221
+ }
222
+ }
223
+ </script>
224
+ ```
225
+
226
+ ## 数据结构
227
+
228
+ ### dataList 格式
229
+
230
+ ```javascript
231
+ [
232
+ { num: 359647, label: '重点景区实时接待量' },
233
+ { num: 4230737, label: '全域实时客流量' },
234
+ { num: 690, label: '文博场馆实时接待量' }
235
+ ]
236
+ ```
237
+
238
+ - `num`: 数值(支持数字或字符串)
239
+ - `label`: 标签文字
240
+
241
+ ## 技术实现
242
+
243
+ ### 内联样式生成
244
+
245
+ 组件通过 computed 属性动态生成内联样式:
246
+
247
+ ```javascript
248
+ computed: {
249
+ numStyle() {
250
+ return {
251
+ fontFamily: this.numFontFamily,
252
+ fontWeight: this.numFontWeight,
253
+ fontStyle: this.numFontStyle,
254
+ fontSize: typeof this.numFontSize === 'number'
255
+ ? `${this.numFontSize}px`
256
+ : this.numFontSize,
257
+ color: this.numColor,
258
+ background: this.numBackground,
259
+ WebkitBackgroundClip: this.numBackgroundClip,
260
+ backgroundClip: this.numBackgroundClip,
261
+ textShadow: this.numTextShadow
262
+ }
263
+ }
264
+ }
265
+ ```
266
+
267
+ ### 默认背景图兜底
268
+
269
+ ```javascript
270
+ import { getImagePath } from './img/images'
271
+
272
+ methods: {
273
+ getCardStyle(cardIndex) {
274
+ const baseStyle = { ...this.cardBaseStyle }
275
+
276
+ // 使用传入的背景图或默认背景图
277
+ backgroundImage: this.card1BgImage || `url(${getImagePath(1)})`
278
+
279
+ return baseStyle
280
+ }
281
+ }
282
+ ```
283
+
284
+ ### 模板绑定
285
+
286
+ ```vue
287
+ <div class="l-data-panel" :style="containerStyle">
288
+ <div
289
+ v-for="(item, index) in dataList"
290
+ :key="index"
291
+ class="l-data-panel__item"
292
+ :class="`l-data-panel__item--${index + 1}`"
293
+ :style="getCardStyle(index + 1)"
294
+ >
295
+ <div class="l-data-panel__num" :style="numStyle">{{ item.num }}</div>
296
+ <div class="l-data-panel__label" :style="labelStyle">{{ item.label }}</div>
297
+ </div>
298
+ </div>
299
+ ```
300
+
301
+ ## 注意事项
302
+
303
+ 1. **背景图可选**:`card1BgImage`、`card2BgImage`、`card3BgImage` 参数是可选的,未传入时使用默认背景图
304
+ 2. **尺寸单位**:Number 类型会自动添加 `px` 单位,String 类型需自行包含单位
305
+ 3. **默认背景图**:组件内置3张默认背景图,位于 `img/` 目录下
306
+ 4. **性能优化**:内联样式通过 computed 缓存,避免重复计算
307
+ 5. **BEM 命名**:使用 `l-data-panel__item`、`l-data-panel__num`、`l-data-panel__label` 等 BEM 命名规范
308
+ 6. **固定3卡片**:本组件固定展示3个数据卡片,数据列表应为3项
309
+ 7. **卡片索引**:卡片索引从1开始(1=左侧,2=中间,3=右侧)
310
+
311
+ ## 适用场景
312
+
313
+ - ✅ 实时客流数据展示
314
+ - ✅ 多维度数据面板展示
315
+ - ✅ 3卡片并排数据对比
316
+ - ✅ 需要自定义背景图和样式的场景
317
+ - ✅ 顶部指标展示模块
318
+
319
+ ## 更新日志
320
+
321
+ - **v1.0.0** (2026-06-18)
322
+ - 从 `moduleData_8` 重命名为 `l-data-panel`
323
+ - 参考 `l-stat-card` 封装结构进行参数化重构
324
+ - 所有样式配置项抽离为 Props 参数(替代 SCSS 变量)
325
+ - 添加详细的字段注释说明
326
+ - 添加默认背景图支持(3张卡片背景图)
327
+ - 支持容器、卡片、数值、标签等所有样式自定义
328
+ - 使用内联样式实现(类似 Element UI)
329
+ - 移除 css/*.scss 文件,全部改为动态参数控制
330
+
331
+ > AI生成
@@ -0,0 +1,47 @@
1
+ /**
2
+ * LDataPanel 组件图片资源映射
3
+ * 提供默认背景图和通过索引获取背景图的方法
4
+ */
5
+
6
+ // 预加载所有图片资源
7
+ const images = {
8
+ bg1: require('./l-data-panel_bg_1.png'),
9
+ bg2: require('./l-data-panel_bg_2.png'),
10
+ bg3: require('./l-data-panel_bg_3.png')
11
+ }
12
+
13
+ /**
14
+ * 获取背景图路径
15
+ * @param {number} index - 图片索引(1, 2, 3)
16
+ * @returns {string} 背景图路径
17
+ */
18
+ export function getImagePath(index) {
19
+ const key = `bg${index}`
20
+ return images[key] || images.bg1
21
+ }
22
+
23
+ /**
24
+ * 获取第一张背景图路径(默认)
25
+ * @returns {string} 背景图路径
26
+ */
27
+ export function getBgPath1() {
28
+ return images.bg1
29
+ }
30
+
31
+ /**
32
+ * 获取第二张背景图路径
33
+ * @returns {string} 背景图路径
34
+ */
35
+ export function getBgPath2() {
36
+ return images.bg2
37
+ }
38
+
39
+ /**
40
+ * 获取第三张背景图路径
41
+ * @returns {string} 背景图路径
42
+ */
43
+ export function getBgPath3() {
44
+ return images.bg3
45
+ }
46
+
47
+ export default images
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <div class="l-data-panel" :style="containerStyle">
3
+ <div
4
+ v-for="(item, index) in dataList"
5
+ :key="index"
6
+ class="l-data-panel__item"
7
+ :class="`l-data-panel__item--${index + 1}`"
8
+ :style="getCardStyle(index + 1)"
9
+ >
10
+ <div class="l-data-panel__num" :style="numStyle">{{ item.num }}</div>
11
+ <div class="l-data-panel__label" :style="labelStyle">{{ item.label }}</div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import interfaceObj from './interface/index'
18
+ import { getImagePath } from './img/images'
19
+
20
+ export default {
21
+ name: 'LDataPanel',
22
+ props: interfaceObj,
23
+ components: {},
24
+ data() {
25
+ return {}
26
+ },
27
+ computed: {
28
+ // 容器样式
29
+ containerStyle() {
30
+ return {
31
+ display: this.containerDisplay,
32
+ justifyContent: this.containerJustifyContent,
33
+ width: typeof this.containerWidth === 'number' ? `${this.containerWidth}px` : this.containerWidth,
34
+ height: typeof this.containerHeight === 'number' ? `${this.containerHeight}px` : this.containerHeight,
35
+ padding: this.containerPadding,
36
+ marginTop: typeof this.containerMarginTop === 'number' ? `${this.containerMarginTop}px` : this.containerMarginTop,
37
+ pointerEvents: this.containerPointerEvents
38
+ }
39
+ },
40
+
41
+ // 卡片通用样式
42
+ cardBaseStyle() {
43
+ return {
44
+ height: typeof this.cardHeight === 'number' ? `${this.cardHeight}px` : this.cardHeight,
45
+ display: this.cardDisplay,
46
+ flexDirection: this.cardFlexDirection,
47
+ justifyContent: this.cardJustifyContent,
48
+ backgroundRepeat: this.cardBgRepeat,
49
+ backgroundPosition: this.cardBgPosition,
50
+ backgroundSize: this.cardBgSize
51
+ }
52
+ },
53
+
54
+ // 数值样式
55
+ numStyle() {
56
+ return {
57
+ fontFamily: this.numFontFamily,
58
+ fontWeight: this.numFontWeight,
59
+ fontStyle: this.numFontStyle,
60
+ fontSize: typeof this.numFontSize === 'number' ? `${this.numFontSize}px` : this.numFontSize,
61
+ color: this.numColor,
62
+ background: this.numBackground,
63
+ WebkitBackgroundClip: this.numBackgroundClip,
64
+ backgroundClip: this.numBackgroundClip,
65
+ textShadow: this.numTextShadow,
66
+ lineHeight: typeof this.numLineHeight === 'number' ? this.numLineHeight : this.numLineHeight,
67
+ marginBottom: typeof this.numMarginBottom === 'number' ? `${this.numMarginBottom}px` : this.numMarginBottom,
68
+ paddingRight: typeof this.numPaddingRight === 'number' ? `${this.numPaddingRight}px` : this.numPaddingRight
69
+ }
70
+ },
71
+
72
+ // 标签样式
73
+ labelStyle() {
74
+ return {
75
+ fontFamily: this.labelFontFamily,
76
+ fontWeight: this.labelFontWeight,
77
+ fontSize: typeof this.labelFontSize === 'number' ? `${this.labelFontSize}px` : this.labelFontSize,
78
+ color: this.labelColor,
79
+ lineHeight: typeof this.labelLineHeight === 'number' ? this.labelLineHeight : this.labelLineHeight
80
+ }
81
+ }
82
+ },
83
+ watch: {},
84
+ mounted() {},
85
+ created() {},
86
+ methods: {
87
+ // 获取每个卡片的样式
88
+ getCardStyle(cardIndex) {
89
+ const baseStyle = { ...this.cardBaseStyle }
90
+
91
+ // 根据卡片索引添加特定样式
92
+ if (cardIndex === 1) {
93
+ Object.assign(baseStyle, {
94
+ position: this.card1Position,
95
+ left: typeof this.card1Left === 'number' ? `${this.card1Left}px` : this.card1Left,
96
+ paddingRight: typeof this.card1PaddingRight === 'number' ? `${this.card1PaddingRight}px` : this.card1PaddingRight,
97
+ width: typeof this.card1Width === 'number' ? `${this.card1Width}px` : this.card1Width,
98
+ textAlign: this.card1TextAlign,
99
+ backgroundImage: this.card1BgImage || `url(${getImagePath(1)})`
100
+ })
101
+ } else if (cardIndex === 2) {
102
+ Object.assign(baseStyle, {
103
+ textAlign: this.card2TextAlign,
104
+ width: typeof this.card2Width === 'number' ? `${this.card2Width}px` : this.card2Width,
105
+ backgroundImage: this.card2BgImage || `url(${getImagePath(2)})`
106
+ })
107
+ } else if (cardIndex === 3) {
108
+ Object.assign(baseStyle, {
109
+ textAlign: this.card3TextAlign,
110
+ position: this.card3Position,
111
+ paddingLeft: typeof this.card3PaddingLeft === 'number' ? `${this.card3PaddingLeft}px` : this.card3PaddingLeft,
112
+ left: typeof this.card3Left === 'number' ? `${this.card3Left}px` : this.card3Left,
113
+ width: typeof this.card3Width === 'number' ? `${this.card3Width}px` : this.card3Width,
114
+ backgroundImage: this.card3BgImage || `url(${getImagePath(3)})`
115
+ })
116
+ }
117
+
118
+ return baseStyle
119
+ }
120
+ }
121
+ }
122
+ </script>
123
+
124
+ <style lang="scss" scoped>
125
+ .l-data-panel {
126
+ &__item {
127
+ // 基础样式通过内联样式控制
128
+
129
+ &--1 {
130
+ // 卡片1特定样式通过内联样式控制
131
+ }
132
+
133
+ &--2 {
134
+ // 卡片2特定样式通过内联样式控制
135
+ }
136
+
137
+ &--3 {
138
+ // 卡片3特定样式通过内联样式控制
139
+ }
140
+ }
141
+
142
+ &__num {
143
+ // 数值样式通过内联样式控制
144
+ }
145
+
146
+ &__label {
147
+ // 标签样式通过内联样式控制
148
+ }
149
+ }
150
+ </style>