diff --git a/src/api/zhinengxunjian/shiyan/renwu.ts b/src/api/zhinengxunjian/shiyan/renwu.ts index bb49cb1..64e60ec 100644 --- a/src/api/zhinengxunjian/shiyan/renwu.ts +++ b/src/api/zhinengxunjian/shiyan/renwu.ts @@ -39,3 +39,11 @@ export const syrenwuDetail = (id) => { method: 'get' }); }; + +export const syrenwujilu = (data) => { + return request({ + url: '/ops/testTask/record', + method: 'get', + params: data + }); +}; diff --git a/src/utils/index.ts b/src/utils/index.ts index 2b0aad5..9ddb698 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -316,3 +316,58 @@ export const removeClass = (ele: HTMLElement, cls: string) => { export const isExternal = (path: string) => { return /^(https?:|http?:|mailto:|tel:)/.test(path); }; + +/** + * 获取步骤状态对应的样式类 + * @param {string|number} status - 步骤状态码 + * @returns {string} 样式类名 + */ +export const getStatusClass = (status: string | number): string => { + // 处理可能的数字输入 + const statusStr = status?.toString() || ''; + const statusClassMap: Record = { + '1': 'status-pending', + '2': 'status-executing', + '3': 'status-completed', + '4': 'status-delayed', + '5': 'status-failed' + }; + return statusClassMap[statusStr] || 'status-unknown'; +}; + +/** + * 格式化日期时间(用于步骤条) + * @param {string} dateTime - 日期时间字符串 + * @returns {string} 格式化后的日期时间 + */ +export const formatDateTime = (dateTime: string): string => { + if (!dateTime) return '-'; + try { + const date = new Date(dateTime); + 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'); + return `${year}-${month}-${day} ${hours}:${minutes}`; + } catch (error) { + return dateTime; + } +}; + +/** + * 获取步骤状态文本 + * @param {string|number} status - 步骤状态码 + * @returns {string} 状态文本 + */ +export const getStepStatusText = (status: string | number): string => { + const statusStr = status?.toString() || ''; + const statusMap: Record = { + '1': '待执行', + '2': '执行中', + '3': '已完成', + '4': '已延期', + '5': '失败' + }; + return statusMap[statusStr] || '未知状态'; +}; diff --git a/src/views/zhinengxunjian/InspectionManagement.vue b/src/views/zhinengxunjian/InspectionManagement.vue index adcb6d7..91860e6 100644 --- a/src/views/zhinengxunjian/InspectionManagement.vue +++ b/src/views/zhinengxunjian/InspectionManagement.vue @@ -312,43 +312,101 @@ v-model="detailDialogVisible" title="巡检计划详情" width="800px" - class="detail-dialog" - center - :show-close="true" - custom-class="beautified-detail-dialog" + :before-close="handleCloseDetailDialog" + class="custom-experiment-dialog" > -
-
-

{{ detailData.planName || '巡检计划' }}

- - {{ detailData.status === '1' ? '启用' : detailData.status === '2' ? '停用' : '-' }} - +
+ +
+

基础信息

+
+
+
+ 计划名称: + {{ detailData.planName || '-' }} +
+
+ 状态: + + + {{ detailData.status === '1' ? '启用' : detailData.status === '2' ? '停用' : '-' }} + + +
+
+
+
+ 计划类型: + {{ getPlanTypeText(detailData.planType) || '-' }} +
+
+ 巡检对象: + {{ getObjectTypeText(detailData.objectType) || '-' }} +
+
+
+
+ 巡检频率: + {{ detailData.inspectionFrequency || '-' }} +
+
+ 负责人: + {{ detailData.nickName || '-' }} +
+
+
+
+ 开始日期: + {{ formatDate(detailData.beginTime) || '-' }} +
+
+ 结束日期: + {{ formatDate(detailData.endTime) || '-' }} +
+
+
+
+ 计划开始时间: + {{ detailData.planBeginTime || '-' }} +
+
+ 持续时间: + {{ detailData.duration || '-' }}分钟 +
+
+
+
+ 巡检项: +
+ + {{ item.name }} + + + - +
+
+
+ 电站ID: + {{ detailData.projectId || '-' }} +
+
+
-
- - {{ getPlanTypeText(detailData.planType) || '-' }} - {{ getObjectTypeText(detailData.objectType) || '-' }} - {{ detailData.inspectionFrequency || '-' }} - {{ detailData.nickName || '-' }} - {{ formatDate(detailData.beginTime) || '-' }} - {{ formatDate(detailData.endTime) || '-' }} - {{ detailData.planBeginTime || '-' }} - {{ detailData.duration || '-' }}分钟 - {{ detailData.inspectionItemId || '-' }} - {{ detailData.projectId || '-' }} - -
- -
-

备注信息

-

{{ detailData.remark }}

+ +
+

备注信息

+
+
+ {{ detailData.remark }} +
+
@@ -980,6 +1038,8 @@ const handleInspectionManagement3 = () => { diff --git a/src/views/zhinengxunjian/baoxiuguanli.vue b/src/views/zhinengxunjian/baoxiuguanli.vue index b103a91..cba778b 100644 --- a/src/views/zhinengxunjian/baoxiuguanli.vue +++ b/src/views/zhinengxunjian/baoxiuguanli.vue @@ -1080,6 +1080,8 @@ onMounted(async () => { diff --git a/src/views/zhinengxunjian/shiyanjilu.vue b/src/views/zhinengxunjian/shiyanjilu.vue index 8903a9a..370174d 100644 --- a/src/views/zhinengxunjian/shiyanjilu.vue +++ b/src/views/zhinengxunjian/shiyanjilu.vue @@ -1,6 +1,7 @@