File tree Expand file tree Collapse file tree 3 files changed +64
-32
lines changed Expand file tree Collapse file tree 3 files changed +64
-32
lines changed Original file line number Diff line number Diff line change 11<template >
2- <el-card class =" alarm-change-card" shadow =" hover" >
2+ <el-card class =" alarm-change-card" shadow =" hover" :class = " { 'expandable': item.details } " @click = " handleCardClick " >
33 <div class =" card-content" >
44 <div class =" card-header" >
55 <div class =" alarm-info" >
66 <div class =" service-name" >{{ item.service }}</div >
77 <div class =" change-description" >{{ item.change }}</div >
88 <div class =" timestamp" >{{ item.timestamp }}</div >
99 </div >
10- <el-button
11- type =" text"
12- size =" small"
13- @click =" toggleExpanded"
14- class =" expand-btn"
15- >
10+ <div v-if =" item.details" class =" expand-indicator" >
1611 <el-icon >
1712 <ArrowUp v-if =" isExpanded" />
1813 <ArrowDown v-else />
1914 </el-icon >
20- </el-button >
15+ </div >
2116 </div >
2217
2318 <!-- 详细信息 -->
@@ -45,6 +40,12 @@ const isExpanded = ref(false)
4540const toggleExpanded = () => {
4641 isExpanded .value = ! isExpanded .value
4742}
43+
44+ const handleCardClick = () => {
45+ if (props .item .details ) {
46+ toggleExpanded ()
47+ }
48+ }
4849 </script >
4950
5051<style scoped>
@@ -83,14 +84,24 @@ const toggleExpanded = () => {
8384 color : #6b7280 ;
8485}
8586
86- .expand-btn {
87+ .expand-indicator {
8788 width : 32px ;
8889 height : 32px ;
89- padding : 0 ;
9090 display : flex ;
9191 align-items : center ;
9292 justify-content : center ;
9393 margin-left : 16px ;
94+ color : #6b7280 ;
95+ }
96+
97+ .expandable {
98+ cursor : pointer ;
99+ transition : all 0.2s ease ;
100+ }
101+
102+ .expandable :hover {
103+ transform : translateY (-1px );
104+ box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.15 );
94105}
95106
96107.details-section {
Original file line number Diff line number Diff line change 11<template >
2- <div class =" batch-detail" >
2+ <div class =" batch-detail" :class = " { 'expandable': batch.moduleRecords } " @click = " handleBatchClick " >
33 <div class =" batch-header" >
44 <div class =" batch-info" >
55 <div class =" batch-name" >{{ batch.name }}</div >
1111 {{ batch.status }}
1212 </el-tag >
1313 </div >
14- <el-button
15- v-if =" batch.moduleRecords"
16- type =" text"
17- size =" small"
18- @click =" toggleModuleExpanded"
19- class =" expand-btn"
20- >
14+ <div v-if =" batch.moduleRecords" class =" expand-indicator" >
2115 <el-icon >
2216 <ArrowUp v-if =" isModuleExpanded" />
2317 <ArrowDown v-else />
2418 </el-icon >
25- </el-button >
19+ </div >
2620 </div >
2721
2822 <div class =" batch-details" >
@@ -69,6 +63,13 @@ const toggleModuleExpanded = () => {
6963 isModuleExpanded .value = ! isModuleExpanded .value
7064}
7165
66+ const handleBatchClick = (event : Event ) => {
67+ if (props .batch .moduleRecords ) {
68+ event .stopPropagation () // 阻止事件冒泡到父级
69+ toggleModuleExpanded ()
70+ }
71+ }
72+
7273const getBatchStatusType = (status : string ) => {
7374 switch (status ) {
7475 case ' 异常' :
@@ -113,13 +114,23 @@ const getBatchStatusType = (status: string) => {
113114 font-size : 12px ;
114115}
115116
116- .expand-btn {
117+ .expand-indicator {
117118 width : 24px ;
118119 height : 24px ;
119- padding : 0 ;
120120 display : flex ;
121121 align-items : center ;
122122 justify-content : center ;
123+ color : #6b7280 ;
124+ }
125+
126+ .expandable {
127+ cursor : pointer ;
128+ transition : all 0.2s ease ;
129+ }
130+
131+ .expandable :hover {
132+ background : #f1f5f9 ;
133+ border-color : #cbd5e1 ;
123134}
124135
125136.batch-details {
Original file line number Diff line number Diff line change 11<template >
2- <el-card class =" change-card" shadow =" hover" >
2+ <el-card class =" change-card" shadow =" hover" :class = " { 'expandable': item.batches } " @click = " handleCardClick " >
33 <template #header >
44 <div class =" card-header" >
55 <div class =" card-title" >
1111 <span v-else-if =" item.state === '已完成'" >发布完成,{{ item.ok ? '正常' : '异常' }}</span >
1212 </span >
1313 </div >
14- <el-button
15- v-if =" item.batches"
16- type =" text"
17- size =" small"
18- @click =" toggleExpanded"
19- class =" expand-btn"
20- >
14+ <div v-if =" item.batches" class =" expand-indicator" >
2115 <el-icon >
2216 <ArrowUp v-if =" isExpanded" />
2317 <ArrowDown v-else />
2418 </el-icon >
25- </el-button >
19+ </div >
2620 </div >
2721 </template >
2822
@@ -61,6 +55,12 @@ const toggleExpanded = () => {
6155 isExpanded .value = ! isExpanded .value
6256}
6357
58+ const handleCardClick = () => {
59+ if (props .item .batches ) {
60+ toggleExpanded ()
61+ }
62+ }
63+
6464const getStatusDotClass = (state : string ) => {
6565 switch (state ) {
6666 case ' 已完成' :
@@ -124,13 +124,23 @@ const getProgressColor = (state: string) => {
124124 margin-left : 8px ;
125125}
126126
127- .expand-btn {
127+ .expand-indicator {
128128 width : 32px ;
129129 height : 32px ;
130- padding : 0 ;
131130 display : flex ;
132131 align-items : center ;
133132 justify-content : center ;
133+ color : #6b7280 ;
134+ }
135+
136+ .expandable {
137+ cursor : pointer ;
138+ transition : all 0.2s ease ;
139+ }
140+
141+ .expandable :hover {
142+ transform : translateY (-1px );
143+ box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.15 );
134144}
135145
136146.card-content {
You can’t perform that action at this time.
0 commit comments