Spaces:
Sleeping
Sleeping
style(HistoryDatabase): enhance card header and footer layout with status icons
Browse files- Updated card header to include status icons indicating project availability for different functionalities.
- Added a visual indicator for additional files when more than three are present.
- Improved card footer layout by grouping date and time, and enhancing progress display with status colors.
- Introduced new CSS styles for status icons and improved overall card aesthetics.
frontend/src/components/HistoryDatabase.vue
CHANGED
|
@@ -29,12 +29,25 @@
|
|
| 29 |
@mouseleave="hoveringCard = null"
|
| 30 |
@click="navigateToProject(project)"
|
| 31 |
>
|
| 32 |
-
<!-- 卡片头部:simulation_id和
|
| 33 |
<div class="card-header">
|
| 34 |
<span class="card-id">{{ formatSimulationId(project.simulation_id) }}</span>
|
| 35 |
-
<
|
| 36 |
-
<span
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
</div>
|
| 39 |
|
| 40 |
<!-- 文件列表区域 -->
|
|
@@ -52,6 +65,10 @@
|
|
| 52 |
<span class="file-tag" :class="getFileType(file.filename)">{{ getFileTypeLabel(file.filename) }}</span>
|
| 53 |
<span class="file-name">{{ truncateFilename(file.filename, 20) }}</span>
|
| 54 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
</div>
|
| 56 |
<!-- 无文件时的占位 -->
|
| 57 |
<div class="files-empty" v-else>
|
|
@@ -68,8 +85,13 @@
|
|
| 68 |
|
| 69 |
<!-- 卡片底部 -->
|
| 70 |
<div class="card-footer">
|
| 71 |
-
<
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
</div>
|
| 74 |
|
| 75 |
<!-- 底部装饰线 (hover时展开) -->
|
|
@@ -674,6 +696,33 @@ onUnmounted(() => {
|
|
| 674 |
font-weight: 500;
|
| 675 |
}
|
| 676 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 677 |
/* 轮数进度显示 */
|
| 678 |
.card-progress {
|
| 679 |
display: flex;
|
|
@@ -698,18 +747,34 @@ onUnmounted(() => {
|
|
| 698 |
.card-files-wrapper {
|
| 699 |
position: relative;
|
| 700 |
width: 100%;
|
| 701 |
-
min-height:
|
|
|
|
| 702 |
margin-bottom: 12px;
|
| 703 |
padding: 8px 10px;
|
| 704 |
background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
|
| 705 |
border-radius: 4px;
|
| 706 |
border: 1px solid #e8eaed;
|
|
|
|
| 707 |
}
|
| 708 |
|
| 709 |
.files-list {
|
| 710 |
display: flex;
|
| 711 |
flex-direction: column;
|
| 712 |
-
gap:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 713 |
}
|
| 714 |
|
| 715 |
.file-item {
|
|
@@ -853,6 +918,32 @@ onUnmounted(() => {
|
|
| 853 |
font-weight: 500;
|
| 854 |
}
|
| 855 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 856 |
/* 底部装饰线 */
|
| 857 |
.card-bottom-line {
|
| 858 |
position: absolute;
|
|
@@ -1065,6 +1156,28 @@ onUnmounted(() => {
|
|
| 1065 |
display: flex;
|
| 1066 |
flex-direction: column;
|
| 1067 |
gap: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1068 |
}
|
| 1069 |
|
| 1070 |
.modal-file-item {
|
|
|
|
| 29 |
@mouseleave="hoveringCard = null"
|
| 30 |
@click="navigateToProject(project)"
|
| 31 |
>
|
| 32 |
+
<!-- 卡片头部:simulation_id 和 功能可用状态 -->
|
| 33 |
<div class="card-header">
|
| 34 |
<span class="card-id">{{ formatSimulationId(project.simulation_id) }}</span>
|
| 35 |
+
<div class="card-status-icons">
|
| 36 |
+
<span
|
| 37 |
+
class="status-icon"
|
| 38 |
+
:class="{ available: project.project_id, unavailable: !project.project_id }"
|
| 39 |
+
title="图谱构建"
|
| 40 |
+
>◇</span>
|
| 41 |
+
<span
|
| 42 |
+
class="status-icon available"
|
| 43 |
+
title="环境配置"
|
| 44 |
+
>◈</span>
|
| 45 |
+
<span
|
| 46 |
+
class="status-icon"
|
| 47 |
+
:class="{ available: project.report_id, unavailable: !project.report_id }"
|
| 48 |
+
title="分析报告"
|
| 49 |
+
>◆</span>
|
| 50 |
+
</div>
|
| 51 |
</div>
|
| 52 |
|
| 53 |
<!-- 文件列表区域 -->
|
|
|
|
| 65 |
<span class="file-tag" :class="getFileType(file.filename)">{{ getFileTypeLabel(file.filename) }}</span>
|
| 66 |
<span class="file-name">{{ truncateFilename(file.filename, 20) }}</span>
|
| 67 |
</div>
|
| 68 |
+
<!-- 如果有更多文件,显示提示 -->
|
| 69 |
+
<div v-if="project.files.length > 3" class="files-more">
|
| 70 |
+
+{{ project.files.length - 3 }} 个文件
|
| 71 |
+
</div>
|
| 72 |
</div>
|
| 73 |
<!-- 无文件时的占位 -->
|
| 74 |
<div class="files-empty" v-else>
|
|
|
|
| 85 |
|
| 86 |
<!-- 卡片底部 -->
|
| 87 |
<div class="card-footer">
|
| 88 |
+
<div class="card-datetime">
|
| 89 |
+
<span class="card-date">{{ formatDate(project.created_at) }}</span>
|
| 90 |
+
<span class="card-time">{{ formatTime(project.created_at) }}</span>
|
| 91 |
+
</div>
|
| 92 |
+
<span class="card-progress" :class="getProgressClass(project)">
|
| 93 |
+
<span class="status-dot">●</span> {{ formatRounds(project) }}
|
| 94 |
+
</span>
|
| 95 |
</div>
|
| 96 |
|
| 97 |
<!-- 底部装饰线 (hover时展开) -->
|
|
|
|
| 696 |
font-weight: 500;
|
| 697 |
}
|
| 698 |
|
| 699 |
+
/* 功能状态图标组 */
|
| 700 |
+
.card-status-icons {
|
| 701 |
+
display: flex;
|
| 702 |
+
align-items: center;
|
| 703 |
+
gap: 6px;
|
| 704 |
+
}
|
| 705 |
+
|
| 706 |
+
.status-icon {
|
| 707 |
+
font-size: 0.75rem;
|
| 708 |
+
transition: all 0.2s ease;
|
| 709 |
+
cursor: default;
|
| 710 |
+
}
|
| 711 |
+
|
| 712 |
+
.status-icon.available {
|
| 713 |
+
opacity: 1;
|
| 714 |
+
}
|
| 715 |
+
|
| 716 |
+
/* 不同功能的颜色 */
|
| 717 |
+
.status-icon:nth-child(1).available { color: #3B82F6; } /* 图谱构建 - 蓝色 */
|
| 718 |
+
.status-icon:nth-child(2).available { color: #F59E0B; } /* 环境配置 - 橙色 */
|
| 719 |
+
.status-icon:nth-child(3).available { color: #10B981; } /* 分析报告 - 绿色 */
|
| 720 |
+
|
| 721 |
+
.status-icon.unavailable {
|
| 722 |
+
color: #D1D5DB;
|
| 723 |
+
opacity: 0.5;
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
/* 轮数进度显示 */
|
| 727 |
.card-progress {
|
| 728 |
display: flex;
|
|
|
|
| 747 |
.card-files-wrapper {
|
| 748 |
position: relative;
|
| 749 |
width: 100%;
|
| 750 |
+
min-height: 48px;
|
| 751 |
+
max-height: 110px;
|
| 752 |
margin-bottom: 12px;
|
| 753 |
padding: 8px 10px;
|
| 754 |
background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
|
| 755 |
border-radius: 4px;
|
| 756 |
border: 1px solid #e8eaed;
|
| 757 |
+
overflow: hidden;
|
| 758 |
}
|
| 759 |
|
| 760 |
.files-list {
|
| 761 |
display: flex;
|
| 762 |
flex-direction: column;
|
| 763 |
+
gap: 4px;
|
| 764 |
+
}
|
| 765 |
+
|
| 766 |
+
/* 更多文件提示 */
|
| 767 |
+
.files-more {
|
| 768 |
+
display: flex;
|
| 769 |
+
align-items: center;
|
| 770 |
+
justify-content: center;
|
| 771 |
+
padding: 3px 6px;
|
| 772 |
+
font-family: 'JetBrains Mono', monospace;
|
| 773 |
+
font-size: 0.6rem;
|
| 774 |
+
color: #6B7280;
|
| 775 |
+
background: rgba(255, 255, 255, 0.5);
|
| 776 |
+
border-radius: 3px;
|
| 777 |
+
letter-spacing: 0.3px;
|
| 778 |
}
|
| 779 |
|
| 780 |
.file-item {
|
|
|
|
| 918 |
font-weight: 500;
|
| 919 |
}
|
| 920 |
|
| 921 |
+
/* 日期时间组合 */
|
| 922 |
+
.card-datetime {
|
| 923 |
+
display: flex;
|
| 924 |
+
align-items: center;
|
| 925 |
+
gap: 8px;
|
| 926 |
+
}
|
| 927 |
+
|
| 928 |
+
/* 底部轮数进度显示 */
|
| 929 |
+
.card-footer .card-progress {
|
| 930 |
+
display: flex;
|
| 931 |
+
align-items: center;
|
| 932 |
+
gap: 6px;
|
| 933 |
+
letter-spacing: 0.5px;
|
| 934 |
+
font-weight: 600;
|
| 935 |
+
font-size: 0.65rem;
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
.card-footer .status-dot {
|
| 939 |
+
font-size: 0.5rem;
|
| 940 |
+
}
|
| 941 |
+
|
| 942 |
+
/* 进度状态颜色 - 底部 */
|
| 943 |
+
.card-footer .card-progress.completed { color: #10B981; }
|
| 944 |
+
.card-footer .card-progress.in-progress { color: #F59E0B; }
|
| 945 |
+
.card-footer .card-progress.not-started { color: #9CA3AF; }
|
| 946 |
+
|
| 947 |
/* 底部装饰线 */
|
| 948 |
.card-bottom-line {
|
| 949 |
position: absolute;
|
|
|
|
| 1156 |
display: flex;
|
| 1157 |
flex-direction: column;
|
| 1158 |
gap: 10px;
|
| 1159 |
+
max-height: 200px;
|
| 1160 |
+
overflow-y: auto;
|
| 1161 |
+
padding-right: 4px;
|
| 1162 |
+
}
|
| 1163 |
+
|
| 1164 |
+
/* 自定义滚动条样式 */
|
| 1165 |
+
.modal-files::-webkit-scrollbar {
|
| 1166 |
+
width: 4px;
|
| 1167 |
+
}
|
| 1168 |
+
|
| 1169 |
+
.modal-files::-webkit-scrollbar-track {
|
| 1170 |
+
background: #F3F4F6;
|
| 1171 |
+
border-radius: 2px;
|
| 1172 |
+
}
|
| 1173 |
+
|
| 1174 |
+
.modal-files::-webkit-scrollbar-thumb {
|
| 1175 |
+
background: #D1D5DB;
|
| 1176 |
+
border-radius: 2px;
|
| 1177 |
+
}
|
| 1178 |
+
|
| 1179 |
+
.modal-files::-webkit-scrollbar-thumb:hover {
|
| 1180 |
+
background: #9CA3AF;
|
| 1181 |
}
|
| 1182 |
|
| 1183 |
.modal-file-item {
|