deving
This commit is contained in:
+7
-7
@@ -147,8 +147,8 @@ async def get_status(task_id: str, db_session: AsyncSession = Depends(get_db_ses
|
|||||||
"status": task.status,
|
"status": task.status,
|
||||||
"progress": task.progress,
|
"progress": task.progress,
|
||||||
"current_step": task.current_step,
|
"current_step": task.current_step,
|
||||||
"upload_time": task.created_time.isoformat() if task.created_time else "",
|
"upload_time": task.created_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.created_time else "",
|
||||||
"completed_at": task.completed_time.isoformat() if task.completed_time else "",
|
"completed_at": task.completed_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.completed_time else "",
|
||||||
"error": task.error_message if task.error_message else ""
|
"error": task.error_message if task.error_message else ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ async def get_file_history(db_session: AsyncSession = Depends(get_db_session)):
|
|||||||
file_groups[filename].append({
|
file_groups[filename].append({
|
||||||
"task_id": task.task_id,
|
"task_id": task.task_id,
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
"upload_time": task.created_time.isoformat() if task.created_time else "",
|
"upload_time": task.created_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.created_time else "",
|
||||||
"status": task.status,
|
"status": task.status,
|
||||||
"file_size": stp_file.file_size
|
"file_size": stp_file.file_size
|
||||||
})
|
})
|
||||||
@@ -260,9 +260,9 @@ async def get_file_records(filename: str, db_session: AsyncSession = Depends(get
|
|||||||
"task_id": task.task_id,
|
"task_id": task.task_id,
|
||||||
"filename": stp_file.original_filename,
|
"filename": stp_file.original_filename,
|
||||||
"file_size": stp_file.file_size,
|
"file_size": stp_file.file_size,
|
||||||
"upload_time": task.created_time.isoformat() if task.created_time else "",
|
"upload_time": task.created_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.created_time else "",
|
||||||
"status": task.status,
|
"status": task.status,
|
||||||
"completed_at": task.completed_time.isoformat() if task.completed_time else ""
|
"completed_at": task.completed_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.completed_time else ""
|
||||||
})
|
})
|
||||||
|
|
||||||
# 按上传时间排序(最新的在前)
|
# 按上传时间排序(最新的在前)
|
||||||
@@ -380,8 +380,8 @@ async def result_page(request: Request, task_id: str, db_session: AsyncSession =
|
|||||||
"status": task.status,
|
"status": task.status,
|
||||||
"progress": task.progress,
|
"progress": task.progress,
|
||||||
"current_step": task.current_step,
|
"current_step": task.current_step,
|
||||||
"upload_time": task.created_time.isoformat() if task.created_time else "",
|
"upload_time": task.created_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.created_time else "",
|
||||||
"completed_at": task.completed_time.isoformat() if task.completed_time else "",
|
"completed_at": task.completed_time.astimezone().strftime('%Y-%m-%d %H:%M:%S') if task.completed_time else "",
|
||||||
"error": task.error_message if task.error_message else ""
|
"error": task.error_message if task.error_message else ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-4
@@ -56,8 +56,8 @@ function displayFileList(files) {
|
|||||||
<div class="file-info">
|
<div class="file-info">
|
||||||
<div class="file-name">📄 ${file.filename}</div>
|
<div class="file-name">📄 ${file.filename}</div>
|
||||||
<div class="file-meta">
|
<div class="file-meta">
|
||||||
总记录: ${file.record_count} 条 |
|
总记录: ${file.record_count} 条 |
|
||||||
最后上传: ${new Date(file.last_upload).toLocaleString()}
|
最后上传: ${formatDateTime(file.last_upload)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="expand-btn" onclick="event.stopPropagation(); toggleFileRecords('${file.filename}')">
|
<button class="expand-btn" onclick="event.stopPropagation(); toggleFileRecords('${file.filename}')">
|
||||||
@@ -110,7 +110,7 @@ async function toggleFileRecords(filename) {
|
|||||||
<div class="record-item" onclick="viewRecordDetails('${record.task_id}')">
|
<div class="record-item" onclick="viewRecordDetails('${record.task_id}')">
|
||||||
<div class="record-header">
|
<div class="record-header">
|
||||||
<div class="record-time">
|
<div class="record-time">
|
||||||
📅 ${new Date(record.upload_time).toLocaleString()}
|
📅 ${formatDateTime(record.upload_time)}
|
||||||
</div>
|
</div>
|
||||||
<div class="record-status status-${record.status}">
|
<div class="record-status status-${record.status}">
|
||||||
${getStatusText(record.status)}
|
${getStatusText(record.status)}
|
||||||
@@ -120,7 +120,7 @@ async function toggleFileRecords(filename) {
|
|||||||
<div>文件大小: ${formatFileSize(record.file_size)}</div>
|
<div>文件大小: ${formatFileSize(record.file_size)}</div>
|
||||||
<div>任务ID: ${record.task_id}</div>
|
<div>任务ID: ${record.task_id}</div>
|
||||||
<div>状态: ${record.status}</div>
|
<div>状态: ${record.status}</div>
|
||||||
${record.completed_at ? `<div>完成时间: ${new Date(record.completed_at).toLocaleTimeString()}</div>` : ''}
|
${record.completed_at ? `<div>完成时间: ${formatDateTime(record.completed_at)}</div>` : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`).join('');
|
`).join('');
|
||||||
@@ -186,6 +186,12 @@ function formatFileSize(bytes) {
|
|||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatDateTime(dateString) {
|
||||||
|
if (!dateString) return 'N/A';
|
||||||
|
// 后端已经返回格式化的时间字符串,直接返回
|
||||||
|
return dateString;
|
||||||
|
}
|
||||||
|
|
||||||
// 跳转到上传页面
|
// 跳转到上传页面
|
||||||
async function goToUpload() {
|
async function goToUpload() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+22
-2
@@ -173,11 +173,31 @@ body {
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 关键工艺参数三列布局 - 使用最高优先级 */
|
||||||
.key-info-categories {
|
.key-info-categories {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: repeat(3, 1fr) !important;
|
grid-template-columns: repeat(3, 1fr) !important;
|
||||||
gap: 20px;
|
gap: 20px !important;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 确保所有子元素正确布局 */
|
||||||
|
.key-info-categories > .category-section {
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: column !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-info-categories > .category-section .category-content {
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: column !important;
|
||||||
|
gap: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 覆盖 result.html 内联样式 */
|
||||||
|
.result-section .key-info-categories {
|
||||||
|
display: grid !important;
|
||||||
|
grid-template-columns: repeat(3, 1fr) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-grid {
|
.data-grid {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>分析结果 - STP文件几何分析工具</title>
|
<title>分析结果 - STP文件几何分析工具</title>
|
||||||
<link rel="stylesheet" href="/static/style.css?v=10">
|
<link rel="stylesheet" href="/static/style.css?v=12">
|
||||||
<style>
|
<style>
|
||||||
.result-container {
|
.result-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>分析结果快照 - STP文件几何分析工具</title>
|
<title>分析结果快照 - STP文件几何分析工具</title>
|
||||||
<link rel="stylesheet" href="/static/style.css?v=10">
|
<link rel="stylesheet" href="/static/style.css?v=12">
|
||||||
<style>
|
<style>
|
||||||
.snapshot-container {
|
.snapshot-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
|
|||||||
Reference in New Issue
Block a user