Compare commits
	
		
			2 Commits
		
	
	
		
			f58efb0e08
			...
			fe0ffbdf11
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fe0ffbdf11 | |||
| 7645cba791 | 
| @ -365,9 +365,9 @@ export const getStepStatusText = (status: string | number): string => { | ||||
|   const statusMap: Record<string, string> = { | ||||
|     '1': '待执行', | ||||
|     '2': '执行中', | ||||
|     '3': '已完成', | ||||
|     '3': '失败', | ||||
|     '4': '已延期', | ||||
|     '5': '失败' | ||||
|     '5': '已完成' | ||||
|   }; | ||||
|   return statusMap[statusStr] || '未知状态'; | ||||
| }; | ||||
|  | ||||
| @ -589,7 +589,8 @@ const pagedTasks = computed(() => { | ||||
|   let filtered = [...tasks.value]; | ||||
|   if (keyword.value && keyword.value.trim()) { | ||||
|     const kw = keyword.value.trim(); | ||||
|     filtered = filtered.filter((t) => | ||||
|     filtered = filtered.filter( | ||||
|       (t) => | ||||
|         (t.title && t.title.includes(kw)) || | ||||
|         (t.reporter && t.reporter.includes(kw)) || | ||||
|         (t.maintainer && t.maintainer.includes(kw)) || | ||||
|  | ||||
| @ -190,7 +190,8 @@ | ||||
| } | ||||
|  | ||||
| /* 步骤状态样式 - 已完成 */ | ||||
| .task-detail-container .step-status.status-completed { | ||||
| .task-detail-container .step-status.status-completed, | ||||
| .task-detail-container .step-status.tag-completed { | ||||
|   background-color: #f6ffed; | ||||
|   color: #52c41a; | ||||
|   border: 1px solid #b7eb8f; | ||||
| @ -203,6 +204,20 @@ | ||||
|   border: 1px solid #ffccc7; | ||||
| } | ||||
|  | ||||
| /* 步骤状态样式 - 未完成 */ | ||||
| .task-detail-container .step-status.status-unknown { | ||||
|   background-color: #f5f5f5; | ||||
|   color: #999; | ||||
|   border: 1px solid #d9d9d9; | ||||
| } | ||||
|  | ||||
| /* 步骤状态样式 - 失败 */ | ||||
| .task-detail-container .step-status.status-failed { | ||||
|   background-color: #fff2f0; | ||||
|   color: #ff4d4f; | ||||
|   border: 1px solid #ffccc7; | ||||
| } | ||||
|  | ||||
| /* 通用状态颜色样式 */ | ||||
| .status-pending { | ||||
|   color: #e6a23c; | ||||
|  | ||||
| @ -376,7 +376,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未执行' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
| @ -615,7 +615,8 @@ const pagedTableData = computed(() => { | ||||
|  | ||||
|   if (keyword.value && keyword.value.trim()) { | ||||
|     const kw = keyword.value.trim(); | ||||
|     filteredData = filteredData.filter((item) => | ||||
|     filteredData = filteredData.filter( | ||||
|       (item) => | ||||
|         (item.title && item.title.includes(kw)) || | ||||
|         (item.description && item.description.includes(kw)) || | ||||
|         (item.creator && item.creator.includes(kw)) || | ||||
| @ -729,10 +730,10 @@ const getStatusClass = (status) => { | ||||
|   // 处理可能的数字输入 | ||||
|   const statusStr = status?.toString() || ''; | ||||
|   const statusClassMap = { | ||||
|     '1': 'status-pending', | ||||
|     '2': 'status-delayed', | ||||
|     '3': 'status-executing', | ||||
|     '4': 'status-completed' | ||||
|     '1': 'status-pending', // 待执行 - 蓝色 | ||||
|     '2': 'status-unknown', // 未完成 - 灰色 | ||||
|     '3': 'status-failed', // 失败 - 红色 | ||||
|     '4': 'status-completed' // 已完成 - 绿色 | ||||
|   }; | ||||
|   return statusClassMap[statusStr] || 'status-unknown'; | ||||
| }; | ||||
|  | ||||
| @ -434,7 +434,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未执行' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
| @ -706,10 +706,10 @@ const getStatusClass = (status) => { | ||||
|   // 处理可能的数字输入 | ||||
|   const statusStr = status?.toString() || ''; | ||||
|   const statusClassMap = { | ||||
|     '1': 'status-pending', | ||||
|     '2': 'status-delayed', | ||||
|     '3': 'status-executing', | ||||
|     '4': 'status-completed' | ||||
|     '1': 'status-pending', // 待执行 - 蓝色 | ||||
|     '2': 'status-unknown', // 未执行 - 灰色 | ||||
|     '3': 'status-failed', // 失败 - 红色 | ||||
|     '4': 'status-completed' // 已完成 - 绿色 | ||||
|   }; | ||||
|   return statusClassMap[statusStr] || 'status-unknown'; | ||||
| }; | ||||
|  | ||||
| @ -736,15 +736,6 @@ const handleInspectionManagement2 = () => { | ||||
| const handleInspectionManagement3 = () => { | ||||
|   router.push('/znxj/sygl/shiyanjilu'); | ||||
| }; | ||||
| // 10. 方法:切换功能选项卡 | ||||
| const switchTab = (tab) => { | ||||
|   activeTab.value = tab; | ||||
|   // 实际应用中需根据选项卡加载对应数据 | ||||
|   if (tab === 'record') { | ||||
|     // 加载统计数据 | ||||
|     updateStatData(timeRange.value); | ||||
|   } | ||||
| }; | ||||
|  | ||||
| // 11. 方法:更新统计数据(根据时间范围) | ||||
| const updateStatData = (range) => { | ||||
| @ -805,12 +796,6 @@ const getRecordStatusText = (status) => { | ||||
|   return statusMap[status] || ''; | ||||
| }; | ||||
|  | ||||
| // 进度条颜色 | ||||
| const getProgressColor = (status) => { | ||||
|   const colorMap = { 'drafted': '#ccc', 'in-progress': '#3b82f6', 'completed': '#10b981', 'paused': '#9e9e9e' }; | ||||
|   return colorMap[status] || '#ccc'; | ||||
| }; | ||||
|  | ||||
| // 18. 新增实验记录弹窗相关 | ||||
| const showRecordDialog = ref(false); | ||||
| const saveLoading = ref(false); // 保存加载状态 | ||||
| @ -1123,21 +1108,6 @@ const handleEditRecord = async (row) => { | ||||
|     loading.value = false; | ||||
|   } | ||||
| }; | ||||
| // 添加新步骤 | ||||
| const addStep = () => { | ||||
|   formData.value.steps.push({ name: '', intendedPurpose: '', intendedTime: '' }); | ||||
| }; | ||||
|  | ||||
| // 删除步骤 | ||||
| const deleteStep = (index) => { | ||||
|   // 确保至少保留一个步骤 | ||||
|   if (formData.value.steps.length <= 1) { | ||||
|     ElMessage.warning('至少需要保留一个步骤'); | ||||
|     return; | ||||
|   } | ||||
|   // 从数组中删除指定索引的步骤 | ||||
|   formData.value.steps.splice(index, 1); | ||||
| }; | ||||
|  | ||||
| // 添加新设备 | ||||
| const addEquipment = () => { | ||||
| @ -1233,19 +1203,6 @@ const formatDate = (dateString) => { | ||||
|   const seconds = String(date.getSeconds()).padStart(2, '0'); | ||||
|   return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; | ||||
| }; | ||||
|  | ||||
| // 日期时间格式化函数 | ||||
| const formatDateTime = (dateString) => { | ||||
|   if (!dateString) return ''; | ||||
|   const date = new Date(dateString); | ||||
|   const year = date.getFullYear(); | ||||
|   const month = String(date.getMonth() + 1).padStart(2, '0'); | ||||
|   const day = String(date.getDate()).padStart(2, '0'); | ||||
|   const hours = String(date.getHours()).padStart(2, '0'); | ||||
|   const minutes = String(date.getMinutes()).padStart(2, '0'); | ||||
|   const seconds = String(date.getSeconds()).padStart(2, '0'); | ||||
|   return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
|  | ||||
| @ -360,7 +360,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未完成' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
| @ -633,7 +633,7 @@ const getStatusClass = (status) => { | ||||
|   const classMap = { | ||||
|     '1': 'tag-pending', // 待执行 | ||||
|     '4': 'tag-executing', // 执行中 | ||||
|     '2': 'tag-delayed', // 已延期 | ||||
|     '2': 'status-unknown', // 未完成 | ||||
|     '5': 'tag-completed', // 已完成 | ||||
|     '3': 'status-failed', // 失败 | ||||
|     'completed': 'tag-completed', | ||||
| @ -864,6 +864,12 @@ onMounted(async () => { | ||||
|   border-color: #b7eb8f; | ||||
| } | ||||
|  | ||||
| .tag-incomplete { | ||||
|   background-color: #f5f5f5; | ||||
|   color: #999; | ||||
|   border-color: #d9d9d9; | ||||
| } | ||||
|  | ||||
| /* 保留原有的部分样式以确保兼容性 */ | ||||
| .status-in-progress { | ||||
|   background-color: #fffbe6; | ||||
|  | ||||
| @ -376,7 +376,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未执行' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
| @ -553,10 +553,11 @@ const getStatusClass = (status) => { | ||||
|   // 处理可能的数字输入 | ||||
|   const statusStr = status?.toString() || ''; | ||||
|   const statusClassMap = { | ||||
|     '1': 'status-pending', | ||||
|     '2': 'status-delayed', | ||||
|     '3': 'status-executing', | ||||
|     '4': 'status-completed' | ||||
|     '1': 'status-pending', // 待执行 | ||||
|     '2': 'status-unknown', // 未完成 - 灰色 | ||||
|     '3': 'status-failed', // 失败 - 红色 | ||||
|     '4': 'status-executing', // 执行中 | ||||
|     '5': 'status-completed' // 已完成 - 绿色 | ||||
|   }; | ||||
|   return statusClassMap[statusStr] || 'status-unknown'; | ||||
| }; | ||||
| @ -591,7 +592,7 @@ const getStepStatusText = (status) => { | ||||
|   const statusMap = { | ||||
|     '1': '待执行', | ||||
|     '2': '执行中', | ||||
|     '3': '已完成', | ||||
|     '3': '失败', | ||||
|     '4': '已延期' | ||||
|   }; | ||||
|   return statusMap[statusStr] || '未知状态'; | ||||
| @ -764,9 +765,9 @@ const mapApiToView = (apiData) => { | ||||
|       result: '-' | ||||
|     }, | ||||
|     '2': { | ||||
|       statusText: '已延期', | ||||
|       statusText: '未完成', | ||||
|       cardClass: 'card-delayed', | ||||
|       tagClass: 'tag-delayed', | ||||
|       tagClass: 'status-unknown', | ||||
|       actionText: '重新安排', | ||||
|       actionClass: 'reschedule-btn', | ||||
|       result: '-' | ||||
| @ -774,7 +775,7 @@ const mapApiToView = (apiData) => { | ||||
|     '3': { | ||||
|       statusText: '失败', | ||||
|       cardClass: 'card-failed', | ||||
|       tagClass: 'tag-failed', | ||||
|       tagClass: 'status-failed', | ||||
|       actionText: '重新执行', | ||||
|       actionClass: 'reschedule-btn', | ||||
|       result: '失败', | ||||
| @ -1607,6 +1608,12 @@ const getTaskStatusClass = (status) => { | ||||
|   border-color: #ffccc7; | ||||
| } | ||||
|  | ||||
| .tag-incomplete { | ||||
|   background-color: #f5f5f5; | ||||
|   color: #999; | ||||
|   border-color: #d9d9d9; | ||||
| } | ||||
|  | ||||
| .task-details { | ||||
|   margin-bottom: 16px; | ||||
| } | ||||
| @ -1887,10 +1894,14 @@ const getTaskStatusClass = (status) => { | ||||
|   color: #f56c6c; | ||||
| } | ||||
|  | ||||
| .status-failed { | ||||
| .status-unknown { | ||||
|   color: #909399; | ||||
| } | ||||
|  | ||||
| .status-failed { | ||||
|   color: #f56c6c; | ||||
| } | ||||
|  | ||||
| /* 响应式设计 */ | ||||
| @media (max-width: 1200px) { | ||||
|   .task-cards { | ||||
|  | ||||
| @ -391,7 +391,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未执行' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
| @ -468,9 +468,9 @@ const getStatusClass = (status) => { | ||||
|   const statusStr = status?.toString() || ''; | ||||
|   const statusClassMap = { | ||||
|     '1': 'status-pending', | ||||
|     '2': 'status-delayed', | ||||
|     '3': 'status-executing', | ||||
|     '4': 'status-completed' | ||||
|     '2': 'status-unknown', // 未完成状态显示为灰色 | ||||
|     '3': 'status-failed', // 失败状态显示为红色 | ||||
|     '4': 'status-completed' // 已完成状态显示为绿色 | ||||
|   }; | ||||
|   return statusClassMap[statusStr] || 'status-unknown'; | ||||
| }; | ||||
| @ -1462,166 +1462,6 @@ const handleAction = async (task) => { | ||||
|   } | ||||
| } | ||||
|  | ||||
| /* 任务详情弹窗样式 */ | ||||
| .task-detail-container { | ||||
|   max-height: 600px; | ||||
|   overflow-y: auto; | ||||
| } | ||||
|  | ||||
| /* 步骤条展示样式 */ | ||||
| .step-item { | ||||
|   display: flex; | ||||
|   align-items: flex-start; | ||||
|   margin-bottom: 12px; | ||||
|   padding: 12px; | ||||
|   background-color: #fafafa; | ||||
|   border-radius: 6px; | ||||
|   transition: all 0.3s ease; | ||||
| } | ||||
|  | ||||
| .step-item:hover { | ||||
|   background-color: #f5f7fa; | ||||
|   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||||
| } | ||||
|  | ||||
| .step-number { | ||||
|   width: 28px; | ||||
|   height: 28px; | ||||
|   background-color: #409eff; | ||||
|   color: white; | ||||
|   border-radius: 50%; | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|   justify-content: center; | ||||
|   margin-right: 12px; | ||||
|   font-size: 14px; | ||||
|   font-weight: bold; | ||||
|   flex-shrink: 0; | ||||
| } | ||||
|  | ||||
| .step-info { | ||||
|   flex: 1; | ||||
| } | ||||
|  | ||||
| .step-name { | ||||
|   font-weight: 500; | ||||
|   color: #1d2129; | ||||
|   margin-bottom: 4px; | ||||
|   font-size: 14px; | ||||
| } | ||||
|  | ||||
| .step-purpose { | ||||
|   color: #606266; | ||||
|   margin-bottom: 4px; | ||||
|   font-size: 13px; | ||||
| } | ||||
|  | ||||
| .step-time, | ||||
| .step-finish-time, | ||||
| .step-remark { | ||||
|   color: #909399; | ||||
|   font-size: 12px; | ||||
|   margin-bottom: 2px; | ||||
| } | ||||
|  | ||||
| .step-status { | ||||
|   padding: 4px 12px; | ||||
|   border-radius: 4px; | ||||
|   font-size: 12px; | ||||
|   font-weight: 500; | ||||
|   flex-shrink: 0; | ||||
|   margin-top: 4px; | ||||
| } | ||||
|  | ||||
| /* 步骤状态样式 */ | ||||
| .step-status.status-pending { | ||||
|   background-color: #e6f7ff; | ||||
|   color: #1677ff; | ||||
|   border: 1px solid #91d5ff; | ||||
| } | ||||
|  | ||||
| .step-status.status-executing { | ||||
|   background-color: #fffbe6; | ||||
|   color: #fa8c16; | ||||
|   border: 1px solid #ffe58f; | ||||
| } | ||||
|  | ||||
| .step-status.status-completed { | ||||
|   background-color: #f6ffed; | ||||
|   color: #52c41a; | ||||
|   border: 1px solid #b7eb8f; | ||||
| } | ||||
|  | ||||
| .step-status.status-delayed { | ||||
|   background-color: #fff2f0; | ||||
|   color: #ff4d4f; | ||||
|   border: 1px solid #ffccc7; | ||||
| } | ||||
|  | ||||
| .detail-card { | ||||
|   margin-bottom: 20px; | ||||
|   padding: 20px; | ||||
|   background-color: #fafafa; | ||||
|   border-radius: 8px; | ||||
|   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); | ||||
| } | ||||
|  | ||||
| .card-title { | ||||
|   margin: 0 0 16px 0; | ||||
|   padding-bottom: 12px; | ||||
|   border-bottom: 2px solid #409eff; | ||||
|   font-size: 16px; | ||||
|   font-weight: 600; | ||||
|   color: #303133; | ||||
| } | ||||
|  | ||||
| .card-content { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   gap: 12px; | ||||
| } | ||||
|  | ||||
| .info-row { | ||||
|   display: flex; | ||||
|   flex-wrap: wrap; | ||||
|   gap: 20px; | ||||
| } | ||||
|  | ||||
| .info-item { | ||||
|   flex: 1; | ||||
|   min-width: 280px; | ||||
| } | ||||
|  | ||||
| .info-item.full-width { | ||||
|   min-width: 100%; | ||||
| } | ||||
|  | ||||
| .info-label { | ||||
|   display: inline-block; | ||||
|   width: 100px; | ||||
|   color: #606266; | ||||
|   font-weight: 500; | ||||
| } | ||||
|  | ||||
| .info-value { | ||||
|   color: #303133; | ||||
|   word-break: break-word; | ||||
| } | ||||
|  | ||||
| .fail-reason { | ||||
|   color: #f56c6c; | ||||
| } | ||||
|  | ||||
| .no-info { | ||||
|   color: #909399; | ||||
|   font-style: italic; | ||||
|   padding: 10px 0; | ||||
| } | ||||
|  | ||||
| .loading-details { | ||||
|   padding: 20px 0; | ||||
| } | ||||
|  | ||||
| /* 状态颜色样式 */ | ||||
| .status-pending { | ||||
|   color: #e6a23c; | ||||
|  | ||||
| @ -475,7 +475,7 @@ | ||||
|                   <div v-if="node.remark" class="step-remark">备注:{{ node.remark }}</div> | ||||
|                 </div> | ||||
|                 <div class="step-status" :class="getStatusClass(node.status)"> | ||||
|                   {{ node.status === '2' ? '未完成' : '已完成' }} | ||||
|                   {{ node.status === '2' ? '未执行' : node.status === '3' ? '失败' : '已完成' }} | ||||
|                 </div> | ||||
|                 <!-- 连接线 --> | ||||
|                 <div v-if="index < detailData.nodes.length - 1" class="step-connector" :class="{ 'connector-completed': node.status !== '2' }"></div> | ||||
| @ -1090,10 +1090,10 @@ const getStatusClass = (status) => { | ||||
|   // 处理可能的数字输入 | ||||
|   const statusStr = status?.toString() || ''; | ||||
|   const statusClassMap = { | ||||
|     '1': 'status-pending', | ||||
|     '2': 'status-delayed', | ||||
|     '3': 'status-executing', | ||||
|     '4': 'status-completed' | ||||
|     '1': 'status-pending', // 待执行 - 蓝色 | ||||
|     '2': 'status-unknown', // 未执行 - 灰色 | ||||
|     '3': 'status-failed', // 失败 - 红色 | ||||
|     '4': 'status-completed' // 已完成 - 绿色 | ||||
|   }; | ||||
|   return statusClassMap[statusStr] || 'status-unknown'; | ||||
| }; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user