vue2-client 1.12.31 → 1.12.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.31",
3
+ "version": "1.12.33",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -2,7 +2,11 @@
2
2
  <div>
3
3
  <div v-if="render" class="XCard">
4
4
  <template v-for="(card, itemIndex) in data">
5
- <a-card :key="'card' + itemIndex" class="data-card">
5
+ <a-card
6
+ :key="'card' + itemIndex"
7
+ class="data-card"
8
+ :class="{ 'card-clicked': card.isClicked }"
9
+ >
6
10
  <div
7
11
  v-if="config && card[config.ribbon]"
8
12
  class="ribbon"
@@ -11,7 +15,7 @@
11
15
  </div>
12
16
  <!-- 自定义标题 -->
13
17
  <template #title>
14
- <div class="custom-title" @click="clickFooter(card, 'cardclick')">
18
+ <div class="custom-title" @click="clickFooter(card, 'cardclick', itemIndex)">
15
19
  <a-tooltip placement="top">
16
20
  <template #title>{{ card[config.id] }}</template>
17
21
  <div class="title-id" v-if="card[config.id]">{{ card[config.id] }}</div>
@@ -57,18 +61,18 @@
57
61
  <template v-else-if="item.type === 'custom' && tableColumns">
58
62
  <!-- 根据 tableColumns 显示自定义内容 -->
59
63
  <span v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">
60
- <template v-if="column.slotType === 'badge'">
61
- <x-badge
62
- :service-name="serviceName"
63
- :env="env"
64
- :dataCard="true"
65
- :badge-key="column.slotKeyMap"
66
- :value="card[item.key]" />
67
- </template>
68
- <template v-else>
69
- <slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
70
- </template>
71
- </span>
64
+ <template v-if="column.slotType === 'badge'">
65
+ <x-badge
66
+ :service-name="serviceName"
67
+ :env="env"
68
+ :dataCard="true"
69
+ :badge-key="column.slotKeyMap"
70
+ :value="card[item.key]" />
71
+ </template>
72
+ <template v-else>
73
+ <slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
74
+ </template>
75
+ </span>
72
76
  </template>
73
77
  <template v-else>
74
78
  <span class="body-item-value">{{ card[item.key] }}</span>
@@ -85,7 +89,7 @@
85
89
  <template #actions>
86
90
  <a-row align="middle" class="custom-actions" v-if="config && config.footer && config.footer.length > 0">
87
91
  <template v-for="(item, footerIndex) in config.footer">
88
- <a-col :key="'footer_' + footerIndex" class="footer-item" :span="11" @click="clickFooter(card, item.emit)">
92
+ <a-col :key="'footer_' + footerIndex" class="footer-item" :span="11" @click="clickFooter(card, item.emit, itemIndex)">
89
93
  <span>
90
94
  <a-icon :type="item.icon" class="footer-icon" />
91
95
  <span>{{ item.label }}</span>
@@ -191,7 +195,8 @@ export default {
191
195
  // 分页大小选项
192
196
  pageSizeOptions: ['4', '6', '8', '10'],
193
197
  // 数据总数
194
- total: 0
198
+ total: 0,
199
+ activeCardIndex: null, // 新增:记录当前激活的卡片索引
195
200
  }
196
201
  },
197
202
  created () {
@@ -301,7 +306,19 @@ export default {
301
306
  return result
302
307
  },
303
308
  // 点击按钮
304
- clickFooter (data, eventName) {
309
+ clickFooter (data, eventName, index) {
310
+ if (eventName === 'cardclick') {
311
+ // 清除所有卡片的点击状态
312
+ if (this.data && Array.isArray(this.data)) {
313
+ this.data.forEach(item => {
314
+ if (item.isClicked) {
315
+ this.$set(item, 'isClicked', false)
316
+ }
317
+ })
318
+ }
319
+ // 设置当前卡片的点击状态
320
+ this.$set(data, 'isClicked', true)
321
+ }
305
322
  this.$emit('cardEmit', data, eventName)
306
323
  },
307
324
  // 获取数据
@@ -457,6 +474,13 @@ export default {
457
474
  color: black;
458
475
  }
459
476
  }
477
+
478
+ &.card-clicked {
479
+ :deep(.ant-card-head) {
480
+ background-color: #e6f7ff;
481
+ transition: background-color 0.3s ease;
482
+ }
483
+ }
460
484
  }
461
485
 
462
486
  .custom-title {