From ccbf3d4e906943b7d114d0e86d32f65b956735ff Mon Sep 17 00:00:00 2001
From: 86156 <823267011@qq.com>
Date: Fri, 2 Jan 2026 17:15:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=86=99=E5=85=A5=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/l2/report/pdo.vue | 44 +++++--
src/views/l2/report/roller.vue | 84 +++++++------
src/views/l2/report/stop.vue | 80 +++++++------
src/views/l2/send/drive.vue | 209 ++++++++++++++-------------------
src/views/l2/track/rect.vue | 100 ++++++++++------
5 files changed, 273 insertions(+), 244 deletions(-)
diff --git a/src/views/l2/report/pdo.vue b/src/views/l2/report/pdo.vue
index 2f0b786..350d8ec 100644
--- a/src/views/l2/report/pdo.vue
+++ b/src/views/l2/report/pdo.vue
@@ -6,8 +6,8 @@
Performance Report
- Please select time range to view data
-
+ Displaying data for the last month by default
+
Performance
@@ -70,14 +70,14 @@
{{ displayTimeRange }}
- Reselect Time
+ Change Time Range
-
+
+
:summary="reportSummary"
:dataset="reportDetail"
:columns="columns"
@@ -97,7 +97,7 @@ export default {
data() {
return {
loading: false,
- hasSelectedTime: false,
+ hasSelectedTime: true, // Directly show report content
timeRange: {
startTime: '',
endTime: ''
@@ -123,7 +123,31 @@ export default {
}
}
},
+ created() {
+ this.setDefaultTimeRangeAndFetch()
+ },
methods: {
+ setDefaultTimeRangeAndFetch() {
+ const end = new Date()
+ const start = new Date()
+ start.setMonth(start.getMonth() - 1)
+
+ this.timeRange.endTime = this.formatDate(end)
+ this.timeRange.startTime = this.formatDate(start)
+
+ this.fetchReportData()
+ },
+
+ formatDate(date) {
+ const year = date.getFullYear()
+ const month = (date.getMonth() + 1).toString().padStart(2, '0')
+ const day = date.getDate().toString().padStart(2, '0')
+ const hours = date.getHours().toString().padStart(2, '0')
+ const minutes = date.getMinutes().toString().padStart(2, '0')
+ const seconds = date.getSeconds().toString().padStart(2, '0')
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+ },
+
handleTimeReset() {
this.timeRange = {
startTime: '',
@@ -146,9 +170,7 @@ export default {
},
handleReturn() {
this.hasSelectedTime = false
- this.handleTimeReset()
- this.reportSummary = []
- this.reportDetail = []
+ // Do not reset time, so user can see the previous selection
},
async fetchReportData() {
this.loading = true
@@ -157,7 +179,7 @@ export default {
startTime: this.timeRange.startTime,
endTime: this.timeRange.endTime,
pageNum: 1,
- pageSize: 1000
+ pageSize: 1000 // Assuming we fetch all data for the report
}
const res = await getReportSummary(queryParams)
this.reportSummary = [
@@ -309,4 +331,4 @@ export default {
}
}
}
-
\ No newline at end of file
+
diff --git a/src/views/l2/report/roller.vue b/src/views/l2/report/roller.vue
index bc15eba..81bdd59 100644
--- a/src/views/l2/report/roller.vue
+++ b/src/views/l2/report/roller.vue
@@ -6,8 +6,8 @@
Roll Change Report
- Please select time range to view data
-
+ Displaying data for the last month by default
+
Roll Change
@@ -23,8 +23,6 @@
-
-
-
-
Query
-
Reset
-
@@ -62,22 +56,17 @@
Report Type:
-
Roll Change Report
-
|
Time Range:
-
{{ displayTimeRange }}
-
Reselect Time
-
+
Change Time Range
:summary="reportSummary"
:dataset="reportDetail"
:columns="columns"
@@ -97,7 +86,7 @@ export default {
data() {
return {
loading: false,
- hasSelectedTime: false,
+ hasSelectedTime: true,
timeRange: {
startTime: '',
endTime: ''
@@ -114,16 +103,38 @@ export default {
displayTimeRange() {
if (!this.canQuery) return '-'
return `${this.timeRange.startTime} to ${this.timeRange.endTime}`
- // 至
},
overviewInfo() {
return {
- reportLabel: 'Roll Change Report', // 换辊报表
+ reportLabel: 'Roll Change Report',
rangeText: this.displayTimeRange
}
}
},
+ created() {
+ this.setDefaultTimeRangeAndFetch()
+ },
methods: {
+ setDefaultTimeRangeAndFetch() {
+ const end = new Date()
+ const start = new Date()
+ start.setMonth(start.getMonth() - 1)
+
+ this.timeRange.endTime = this.formatDateTime(end)
+ this.timeRange.startTime = this.formatDateTime(start)
+
+ this.fetchReportData()
+ },
+ formatDateTime(date) {
+ 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}`
+ },
+
handleTimeReset() {
this.timeRange = {
startTime: '',
@@ -132,11 +143,11 @@ export default {
},
async handleTimeConfirm() {
if (!this.canQuery) {
- this.$message.warning('Please select complete time range') // 请选择完整的时间范围
+ this.$message.warning('Please select complete time range')
return
}
if (new Date(this.timeRange.startTime) > new Date(this.timeRange.endTime)) {
- this.$message.warning('Start time cannot be later than end time') // 开始时间不能晚于结束时间
+ this.$message.warning('Start time cannot be later than end time')
return
}
this.hasSelectedTime = true
@@ -144,9 +155,6 @@ export default {
},
handleReturn() {
this.hasSelectedTime = false
- this.handleTimeReset()
- this.reportSummary = []
- this.reportDetail = []
},
async fetchReportData() {
this.loading = true
@@ -162,26 +170,26 @@ export default {
...item
}))
this.columns = [
- { label: 'Change ID', prop: 'changeid' }, // 换辊号
- { label: 'Roll ID', prop: 'rollid' }, // 轧辊号
- { label: 'Type', prop: 'type' }, // 类型
- { label: 'Position', prop: 'position' }, // 位置
- { label: 'Diameter', prop: 'diameter' }, // 直径
- { label: 'Roughness', prop: 'rough' }, // 粗糙度
- { label: 'Crown', prop: 'crown' }, // 凸度
- { label: 'Rolled Length', prop: 'rolledLength' }, // 轧制长度
- { label: 'Rolled Weight', prop: 'rolledWeight' }, // 轧制重量
- { label: 'Rolled Count', prop: 'rolledCount' }, // 轧制次数
- { label: 'Install Time', prop: 'instalTime' }, // 上线时间
- { label: 'Uninstall Time', prop: 'deinstalTime' } // 下线时间
+ { label: 'Change ID', prop: 'changeid' },
+ { label: 'Roll ID', prop: 'rollid' },
+ { label: 'Type', prop: 'type' },
+ { label: 'Position', prop: 'position' },
+ { label: 'Diameter', prop: 'diameter' },
+ { label: 'Roughness', prop: 'rough' },
+ { label: 'Crown', prop: 'crown' },
+ { label: 'Rolled Length', prop: 'rolledLength' },
+ { label: 'Rolled Weight', prop: 'rolledWeight' },
+ { label: 'Rolled Count', prop: 'rolledCount' },
+ { label: 'Install Time', prop: 'instalTime' },
+ { label: 'Uninstall Time', prop: 'deinstalTime' }
]
this.reportSummary = [
- { label: 'Data Count', value: this.reportDetail.length }, // 数据条数
- { label: 'Time Range', value: this.displayTimeRange } // 时间范围
+ { label: 'Data Count', value: this.reportDetail.length },
+ { label: 'Time Range', value: this.displayTimeRange }
]
} catch (error) {
console.error(error)
- this.$message.error('Failed to fetch report data') // 获取报表数据失败
+ this.$message.error('Failed to fetch report data')
} finally {
this.loading = false
}
@@ -300,4 +308,4 @@ export default {
}
}
}
-
\ No newline at end of file
+
diff --git a/src/views/l2/report/stop.vue b/src/views/l2/report/stop.vue
index 62a1932..8355abf 100644
--- a/src/views/l2/report/stop.vue
+++ b/src/views/l2/report/stop.vue
@@ -6,8 +6,8 @@
Stoppage Report
- Please select time range to view data
-
+ Displaying data for the last month by default
+
Stoppage
@@ -18,13 +18,10 @@
-
-
-
-
Query
-
Reset
-
@@ -62,22 +55,17 @@
Report Type:
-
Stoppage Report
-
|
Time Range:
-
{{ displayTimeRange }}
-
Reselect Time
-
+
Change Date Range
:summary="reportSummary"
:dataset="reportDetail"
:columns="columns"
@@ -97,7 +85,7 @@ export default {
data() {
return {
loading: false,
- hasSelectedTime: false,
+ hasSelectedTime: true,
timeRange: {
startTime: '',
endTime: ''
@@ -105,14 +93,14 @@ export default {
reportSummary: [],
reportDetail: [],
columns: [
- { label: 'Coil ID', prop: 'coilid' }, // 钢卷号
- { label: 'Shift', prop: 'shift' }, // 班次号
- { label: 'Group', prop: 'area' }, // 组
- { label: 'Start Time', prop: 'startDate' }, // 开始时间
- { label: 'End Time', prop: 'endDate' }, // 结束时间
- { label: 'Duration [min]', prop: 'duration' }, // 持续时间[分钟]
- { label: 'Stoppage Type', prop: 'unit' }, // 停机类型
- { label: 'Remark', prop: 'remark' } // 备注
+ { label: 'Coil ID', prop: 'coilid' },
+ { label: 'Shift', prop: 'shift' },
+ { label: 'Group', prop: 'area' },
+ { label: 'Start Time', prop: 'startDate' },
+ { label: 'End Time', prop: 'endDate' },
+ { label: 'Duration [min]', prop: 'duration' },
+ { label: 'Stoppage Type', prop: 'unit' },
+ { label: 'Remark', prop: 'remark' }
]
}
},
@@ -123,16 +111,35 @@ export default {
displayTimeRange() {
if (!this.canQuery) return '-'
return `${this.timeRange.startTime} to ${this.timeRange.endTime}`
- // 至
},
overviewInfo() {
return {
- reportLabel: 'Stoppage Report', // 停机报表
+ reportLabel: 'Stoppage Report',
rangeText: this.displayTimeRange
}
}
},
+ created() {
+ this.setDefaultDateRangeAndFetch()
+ },
methods: {
+ setDefaultDateRangeAndFetch() {
+ const end = new Date()
+ const start = new Date()
+ start.setMonth(start.getMonth() - 1)
+
+ this.timeRange.endTime = this.formatDate(end)
+ this.timeRange.startTime = this.formatDate(start)
+
+ this.fetchReportData()
+ },
+ formatDate(date) {
+ const year = date.getFullYear()
+ const month = String(date.getMonth() + 1).padStart(2, '0')
+ const day = String(date.getDate()).padStart(2, '0')
+ return `${year}-${month}-${day}`
+ },
+
handleTimeReset() {
this.timeRange = {
startTime: '',
@@ -141,11 +148,11 @@ export default {
},
async handleTimeConfirm() {
if (!this.canQuery) {
- this.$message.warning('Please select complete date range') // 请选择完整的日期范围
+ this.$message.warning('Please select complete date range')
return
}
if (new Date(this.timeRange.startTime) > new Date(this.timeRange.endTime)) {
- this.$message.warning('Start date cannot be later than end date') // 开始日期不能晚于结束日期
+ this.$message.warning('Start date cannot be later than end date')
return
}
this.hasSelectedTime = true
@@ -153,9 +160,6 @@ export default {
},
handleReturn() {
this.hasSelectedTime = false
- this.handleTimeReset()
- this.reportSummary = []
- this.reportDetail = []
},
async fetchReportData() {
this.loading = true
@@ -171,14 +175,14 @@ export default {
const res2 = await getStoppageSummary(queryParams)
this.reportSummary = [
- { label: 'Statistics Range', value: this.displayTimeRange }, // 统计区间
- { label: 'Stoppage Count', value: res2.data?.[0] || 0 }, // 停机次数
- { label: 'Stoppage Duration [hours]', value: res2.data?.[1] || 0 }, // 停机时长[小时]
- { label: 'Operation Rate', value: (res2.data?.[2] || 0) + ' %' } // 作业率
+ { label: 'Statistics Range', value: this.displayTimeRange },
+ { label: 'Stoppage Count', value: res2.data?.[0] || 0 },
+ { label: 'Stoppage Duration [hours]', value: res2.data?.[1] || 0 },
+ { label: 'Operation Rate', value: (res2.data?.[2] || 0) + ' %' }
]
} catch (error) {
console.error(error)
- this.$message.error('Failed to fetch report data') // 获取报表数据失败
+ this.$message.error('Failed to fetch report data')
} finally {
this.loading = false
}
@@ -257,7 +261,7 @@ export default {
.selector-content {
width: 100%;
- max-width: 600px;
+ max-width: 640px;
padding: 0 20px;
}
}
@@ -297,4 +301,4 @@ export default {
}
}
}
-
\ No newline at end of file
+
diff --git a/src/views/l2/send/drive.vue b/src/views/l2/send/drive.vue
index 038f454..0c0dd4e 100644
--- a/src/views/l2/send/drive.vue
+++ b/src/views/l2/send/drive.vue
@@ -21,8 +21,8 @@