diff --git a/src/config/api.js b/src/config/api.js index 374d7a4..b95cd24 100644 --- a/src/config/api.js +++ b/src/config/api.js @@ -1,8 +1,8 @@ // API配置文件 export const API_CONFIG = { // API服务器基础地址 - // BASE_URL: 'http://192.168.110.38:8100', - BASE_URL: 'http://localhost:8100', + BASE_URL: 'http://192.168.110.38:8100', + // BASE_URL: 'http://localhost:8100', // API端点 ENDPOINTS: { diff --git a/src/utils/dateFormat.js b/src/utils/dateFormat.js index 146d12f..e6429ab 100644 --- a/src/utils/dateFormat.js +++ b/src/utils/dateFormat.js @@ -36,7 +36,7 @@ export function formatDateTime(date) { } /** - * 根据时间范围文字(如"近1年")计算开始和结束日期 + * 根据时间范围文字(如"近1天")计算开始和结束日期 * @param {string} timeRange - 时间范围文字 * @returns {Object} 包含开始和结束日期的对象 */ @@ -44,7 +44,15 @@ export function getDateRangeByTimeRange(timeRange) { const endDate = new Date(); const startDate = new Date(); - if (timeRange === '近1年') { + if (timeRange === '近1天') { + startDate.setDate(endDate.getDate() - 1); + } else if (timeRange === '近3天') { + startDate.setDate(endDate.getDate() - 3); + } else if (timeRange === '近1周') { + startDate.setDate(endDate.getDate() - 7); + } else if (timeRange === '近1月') { + startDate.setMonth(endDate.getMonth() - 1); + } else if (timeRange === '近1年') { startDate.setFullYear(endDate.getFullYear() - 1); } else if (timeRange === '近2年') { startDate.setFullYear(endDate.getFullYear() - 2); diff --git a/src/views/plan/EquipmentStatus.vue b/src/views/plan/EquipmentStatus.vue index f88e99a..c19deaa 100644 --- a/src/views/plan/EquipmentStatus.vue +++ b/src/views/plan/EquipmentStatus.vue @@ -56,57 +56,94 @@ -
-
- 设备编号: - {{ selectedEquipmentCode }} -
-
- 轴号: - {{ selectedAxle.axle_number }} -
-
- 运行状态: - - {{ selectedAxle.update_time ? '运行中' : '不在运行' }} - -
-
- 规格: - {{ selectedAxle.specification || '无' }} -
-
- 型号: - {{ selectedAxle.model || '无' }} -
-
- 线盘: - {{ selectedAxle.raw_wire_disc || '无' }} -
-
- 完成度: - {{ (selectedAxle.degree_of_completion * 100).toFixed(1) }}% -
-
-
库存信息
-
- 总箱数: - {{ selectedAxle.total_number }} +
+ +
+
基本信息
+
+ 设备编号: + {{ selectedEquipmentCode }}
-
- 总净重: - {{ selectedAxle.total_net_weight }}kg +
+ 轴号: + {{ selectedAxle.axle_number }}
-
- 总毛重: - {{ selectedAxle.total_gross_weight }}kg +
+ 运行状态: + + {{ selectedAxle.update_time ? '运行中' : '不在运行' }} + +
+
+ 规格: + {{ selectedAxle.specification || '无' }} +
+
+ 型号: + {{ selectedAxle.model || '无' }} +
+
+ 线盘: + {{ selectedAxle.raw_wire_disc || '无' }} +
+
+ 完成度: + {{ (selectedAxle.degree_of_completion * 100).toFixed(1) }}% +
+
+
库存信息
+
+ 总箱数: + {{ selectedAxle.total_number }} +
+
+ 总净重: + {{ selectedAxle.total_net_weight }}kg +
+
+ 总毛重: + {{ selectedAxle.total_gross_weight }}kg +
+
+
+ 最后更新: + {{ selectedAxle.update_time }}
-
- 最后更新: - {{ selectedAxle.update_time }} + + +
+
+
历史数据分析
+ + + + + +
+ +
+ +
+ 暂无历史数据 +
+ +
+ + + +
+
+ +
+
+ +
+
+
+
@@ -569,8 +1029,26 @@ const handleClose = () => { } /* 对话框样式 */ -.axle-details { - padding: 10px 0; +.axle-details-container { + display: flex; + min-height: 500px; +} + +/* 左侧面板样式 */ +.axle-info-panel { + flex: 1; + padding: 10px 20px 10px 10px; + border-right: 1px solid #EBEEF5; + max-height: 500px; + overflow-y: auto; +} + +/* 右侧面板样式 */ +.history-chart-panel { + flex: 1; + padding: 10px; + display: flex; + flex-direction: column; } .detail-row { @@ -606,6 +1084,44 @@ const handleClose = () => { color: #f56c6c; } +/* 图表控制区域 */ +.chart-controls { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; +} + +/* 图表容器样式 */ +.charts-container { + flex: 1; + display: flex; + flex-direction: column; +} + +.chart { + height: 400px; + width: 100%; +} + +/* 加载状态 */ +.chart-loading { + height: 400px; + display: flex; + align-items: center; + justify-content: center; +} + +/* 无数据状态 */ +.no-history-data { + height: 400px; + display: flex; + align-items: center; + justify-content: center; + color: #909399; + font-size: 16px; +} + /* 添加悬停效果,提示用户可以双击 */ .axle-item { cursor: pointer;