From ac541472c2b614841624770fa408bb6c0dea5697 Mon Sep 17 00:00:00 2001
From: 86156 <823267011@qq.com>
Date: Fri, 31 Oct 2025 17:18:30 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=BB=E5=8A=A8=E7=AB=AF?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=8C=E5=90=8E=E7=AB=AF=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=BA=86=E6=89=80=E6=9C=89=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/klp-mono.iml | 12 +
.idea/modules.xml | 8 +
apps/hand-factory/api/pocket/plantState.js | 162 +++
.../klp-product-statistic.vue | 862 +++++++++------
.../klp-shutdown-statistic.vue | 945 +++++++++++------
.../klp-team-performance.vue | 513 +++++++--
.../hand-factory/components/lines/acidity.vue | 996 ++++++++++++------
apps/hand-factory/components/lines/paint.vue | 290 ++---
apps/hand-factory/config.js | 4 +-
9 files changed, 2530 insertions(+), 1262 deletions(-)
create mode 100644 .idea/klp-mono.iml
create mode 100644 .idea/modules.xml
create mode 100644 apps/hand-factory/api/pocket/plantState.js
diff --git a/.idea/klp-mono.iml b/.idea/klp-mono.iml
new file mode 100644
index 0000000..449f465
--- /dev/null
+++ b/.idea/klp-mono.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..01fa956
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/apps/hand-factory/api/pocket/plantState.js b/apps/hand-factory/api/pocket/plantState.js
new file mode 100644
index 0000000..34f597e
--- /dev/null
+++ b/apps/hand-factory/api/pocket/plantState.js
@@ -0,0 +1,162 @@
+import request from '@/utils/request'
+
+// =========================== 状态定义相关 ===========================
+
+/**
+ * 获取所有状态定义及其当前值(用于初始化缓存)
+ * 返回数据结构:
+ * {
+ * id: 定义ID (对应VALUE字段编号,如id=14对应VALUE14),
+ * name: 指标名称,
+ * units: 单位,
+ * comments: 说明,
+ * currentValue: 当前值,
+ * currentInsdate: 当前值时间
+ * }
+ */
+export function getAllPlantStateDefines() {
+ return request({
+ url: '/pocket/proPlantStateDefine/allWithValues',
+ method: 'get'
+ })
+}
+
+// =========================== 当前数据相关 ===========================
+
+// 查询设备状态当前数据列表
+export function listPlantStateCurrent(query) {
+ return request({
+ url: '/pocket/proPlantStateCurrent/selectAll',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询单条设备状态当前数据
+export function getPlantStateCurrent(type, insdate) {
+ return request({
+ url: '/pocket/proPlantStateCurrent/one',
+ method: 'get',
+ params: { type, insdate }
+ })
+}
+
+// 查询设备状态历史数据列表
+export function listPlantStateHistory(query) {
+ return request({
+ url: '/pocket/proPlantStateHistory/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询设备状态历史数据详情
+export function getPlantStateHistory(insdate) {
+ return request({
+ url: '/pocket/proPlantStateHistory/' + insdate,
+ method: 'get'
+ })
+}
+
+// 查询停机列表
+export function listStoppage(query) {
+ return request({
+ url: '/pocket/proStoppage/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询停机详情
+export function getStoppage(stopId) {
+ return request({
+ url: '/pocket/proStoppage/' + stopId,
+ method: 'get'
+ })
+}
+
+// =========================== 班组信息相关 ===========================
+
+/**
+ * 获取当前班组信息
+ * 返回数据结构:
+ * {
+ * shift: 班次 (如:A/B/C 或 早/中/晚),
+ * crew: 班组编号,
+ * seqNum: 序列号,
+ * sysTime: 系统时间
+ * }
+ */
+export function getCurrentShift() {
+ return request({
+ url: '/pocket/shiftCurrent/current',
+ method: 'get'
+ })
+}
+
+// =========================== 生产统计相关 ===========================
+
+/**
+ * 获取生产统计汇总数据
+ * @param {string} startDate - 开始日期 (yyyy-MM-dd)
+ * @param {string} endDate - 结束日期 (yyyy-MM-dd)
+ */
+export function getProductionSummary(startDate, endDate) {
+ return request({
+ url: '/pocket/productionStatistics/summary',
+ method: 'get',
+ params: { startDate, endDate }
+ })
+}
+
+/**
+ * 获取班组产量统计
+ * @param {string} startDate - 开始日期
+ * @param {string} endDate - 结束日期
+ */
+export function getCrewProduction(startDate, endDate) {
+ return request({
+ url: '/pocket/productionStatistics/crewProduction',
+ method: 'get',
+ params: { startDate, endDate }
+ })
+}
+
+/**
+ * 获取厚度分布统计
+ * @param {string} startDate - 开始日期
+ * @param {string} endDate - 结束日期
+ */
+export function getThicknessDistribution(startDate, endDate) {
+ return request({
+ url: '/pocket/productionStatistics/thicknessDistribution',
+ method: 'get',
+ params: { startDate, endDate }
+ })
+}
+
+/**
+ * 获取宽度分布统计
+ * @param {string} startDate - 开始日期
+ * @param {string} endDate - 结束日期
+ */
+export function getWidthDistribution(startDate, endDate) {
+ return request({
+ url: '/pocket/productionStatistics/widthDistribution',
+ method: 'get',
+ params: { startDate, endDate }
+ })
+}
+
+/**
+ * 获取班组绩效统计
+ * @param {string} startDate - 开始日期
+ * @param {string} endDate - 结束日期
+ */
+export function getTeamPerformance(startDate, endDate) {
+ return request({
+ url: '/pocket/productionStatistics/teamPerformance',
+ method: 'get',
+ params: { startDate, endDate }
+ })
+}
diff --git a/apps/hand-factory/components/klp-product-statistic/klp-product-statistic.vue b/apps/hand-factory/components/klp-product-statistic/klp-product-statistic.vue
index a80bd16..f5b0c86 100644
--- a/apps/hand-factory/components/klp-product-statistic/klp-product-statistic.vue
+++ b/apps/hand-factory/components/klp-product-statistic/klp-product-statistic.vue
@@ -1,147 +1,141 @@
-
-
-
-
+
+
+
{{ item.label }}
-
-
+
+
-
-
- 选择日期:{{ startDate }}
+
+
+ 日期
+ {{ startDate }}
+
+
+
+
+
+
+
+ 起
+ {{ startDate }}
+
+
+ 至
+
+
+ 止
+ {{ endDate }}
+
-
-
-
-
- 开始月份:{{ startDate }}
-
-
-
-
- 结束月份:{{ endDate }}
-
-
-
-
-
-
-
- 开始年份:{{ startDate }}
+
+
+
+ 起
+ {{ startDate }}
+
+
+ 至
+
+
+ 止
+ {{ endDate }}
+
-
-
- 结束年份:{{ endDate }}
-
+
+
+
+
+
+
+
+ {{ item.label }}
+
+ {{ item.value }}
+ {{ item.unit }}
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+ 厚度分布
+
+
+
+
+
+
+ 宽度分布
+
+
+
+
-
\ No newline at end of file
+
+.pie-chart-item {
+ flex: 1;
+ background: #fff;
+ border: 1rpx solid #e4e7ed;
+ border-radius: 8rpx;
+ padding: 24rpx 0 32rpx 0;
+ min-height: 520rpx;
+ display: flex;
+ flex-direction: column;
+}
+
+.pie-title {
+ display: block;
+ text-align: center;
+ font-size: 26rpx;
+ color: #606266;
+ font-weight: 500;
+ margin-bottom: 16rpx;
+ padding: 0 16rpx;
+ flex-shrink: 0;
+}
+
+.pie-chart-wrapper {
+ flex: 1;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
diff --git a/apps/hand-factory/components/klp-shutdown-statistic/klp-shutdown-statistic.vue b/apps/hand-factory/components/klp-shutdown-statistic/klp-shutdown-statistic.vue
index d6f213c..d171aeb 100644
--- a/apps/hand-factory/components/klp-shutdown-statistic/klp-shutdown-statistic.vue
+++ b/apps/hand-factory/components/klp-shutdown-statistic/klp-shutdown-statistic.vue
@@ -1,99 +1,142 @@
-
-
-
+
+
+
{{ item.label }}
-
-
+
+
-
-
- 选择日期:{{ startDate }}
+
+
+ 日期
+ {{ startDate }}
+
+
+
+
+
+
+
+ 起
+ {{ startDate }}
+
+
+ 至
+
+
+ 止
+ {{ endDate }}
+
-
-
-
-
- 开始月份:{{ startDate }}
-
-
-
-
- 结束月份:{{ endDate }}
-
-
-
-
-
-
-
- 开始年份:{{ startDate }}
+
+
+
+ 起
+ {{ startDate }}
+
+
+ 至
+
+
+ 止
+ {{ endDate }}
+
-
-
- 结束年份:{{ endDate }}
-
+
+
+
+
+
+
+
+ {{ item.label }}
+
+ {{ item.value }}
+ {{ item.unit }}
+
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ 📊
+ 此时间段未发生停机
+
-
-
-
-
+
+
+
+
+
+
+
+ 📊
+ 此时间段未发生停机
+
-
-
+
+
+
+
+
+
+
+ 机组:
+ {{ item.machine }}
+
+
+ 备注:
+ {{ item.remark }}
+
+
+
+ 暂无停机记录
+
+
@@ -125,6 +168,15 @@ function getDefaultDate(type = "day") {
}
}
+// 获取上个月的年月
+function getLastMonth() {
+ const date = new Date();
+ date.setMonth(date.getMonth() - 1); // 减1个月
+ const year = date.getFullYear();
+ const month = (date.getMonth() + 1).toString().padStart(2, "0");
+ return `${year}-${month}`;
+}
+
/**
* 格式化日期
* @param {Date} date - 日期对象
@@ -156,171 +208,82 @@ export default {
activeTab: "day",
// 开始日期/月份/年份
startDate: getDefaultDate(),
- // 结束日期/月份/年份
+ // 结束日期/月份/年份(默认)
endDate: getDefaultDate(),
// 视图切换选项
timeTabs: [
- { label: "日视图", value: "day" },
- { label: "月视图", value: "month" },
- { label: "年视图", value: "year" }
+ { label: "日", value: "day" },
+ { label: "月", value: "month" },
+ { label: "年", value: "year" }
],
- // 混合图表数据
- chartData: {
- categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
- series: [
- {
- name: "曲面",
- type: "area",
- style: "curve",
- data: [70, 50, 85, 130, 64, 88]
- },
- {
- name: "柱1",
- index: 1,
- type: "column",
- data: [40, { value: 30, color: "#f04864" }, 55, 110, 24, 58]
- },
- {
- name: "柱2",
- index: 1,
- type: "column",
- data: [50, 20, 75, 60, 34, 38]
- },
- {
- name: "曲线",
- type: "line",
- style: "curve",
- color: "#1890ff",
- disableLegend: true,
- data: [70, 50, 85, 130, 64, 88]
- },
- {
- name: "折线",
- type: "line",
- color: "#2fc25b",
- data: [120, 140, 105, 170, 95, 160]
- },
- {
- name: "点",
- index: 2,
- type: "point",
- color: "#f04864",
- data: [100, 80, 125, 150, 112, 132]
- }
- ]
+ // 汇总数据
+ summaryData: [
+ { label: "停机时间", value: 0, unit: "min" },
+ { label: "停机次数", value: 0, unit: "次" },
+ { label: "作业率", value: 0, unit: "%" }
+ ],
+ // 停机趋势图(月/年视图)
+ trendChartData: {
+ categories: [],
+ series: []
},
- // 混合图表配置
- opts: {
- color: [
- "#1890FF",
- "#91CB74",
- "#FAC858",
- "#EE6666",
- "#73C0DE",
- "#3CA272",
- "#FC8452",
- "#9A60B4",
- "#ea7ccc"
- ],
+ trendChartOpts: {
+ color: ["#0066cc", "#f56c6c"],
padding: [15, 15, 0, 15],
enableScroll: false,
- legend: {},
- xAxis: {
- disableGrid: true,
- title: "单位:年"
- },
+ legend: { position: "top" },
+ xAxis: { disableGrid: true },
yAxis: {
- disabled: false,
- disableGrid: false,
- splitNumber: 5,
gridType: "dash",
dashLength: 4,
- gridColor: "#CCCCCC",
- padding: 10,
- showTitle: true,
+ gridColor: "#e4e7ed",
data: [
- { position: "left", title: "折线" },
- { position: "right", min: 0, max: 200, title: "柱状图", textAlign: "left" },
- { position: "right", min: 0, max: 200, title: "点", textAlign: "left" }
+ { position: "left", title: "停机时间(min)" },
+ { position: "right", title: "作业率(%)" }
]
},
- extra: { mix: { column: { width: 20 } } }
- },
- // 汇总数据(供 k-metric-card 使用)
- summaryData: [
- { label: "停机时间", value: 730, unit: "min" },
- { label: "停机次数", value: 9 },
- { label: "作业率", value: 49.31, unit: "%" }
- ],
- // 表格列配置(日视图详细信息)
- columns: [
- { title: "起止时间", key: "time" },
- { title: "持续时间", key: "duration" },
- { title: "备注", key: "remark" },
- { title: "机组", key: "machine" }
- ],
- // 表格数据(日视图详细信息)
- tableData: [
- {
- time: "2022-01-01 08:00:00",
- duration: "30min",
- remark: "设备维护",
- machine: "1号机"
- },
- {
- time: "2022-01-01 10:00:00",
- duration: "20min",
- remark: "设备故障",
- machine: "2号机"
- },
- {
- time: "2022-01-01 12:00:00",
- duration: "40min",
- remark: "设备维护",
- machine: "3号机"
- }
- ],
- // 饼图数据
- pieChartData: {
- series: [
- {
- data: [
- { name: "一班", value: 50 },
- { name: "二班", value: 30 },
- { name: "三班", value: 20 },
- { name: "四班", value: 18, labelText: "四班:18人" },
- { name: "五班", value: 8 }
- ]
+ extra: {
+ mix: {
+ column: { width: 20 }
}
- ]
+ }
},
// 饼图配置
- pieOpts: {
- color: [
- "#1890FF",
- "#91CB74",
- "#FAC858",
- "#EE6666",
- "#73C0DE",
- "#3CA272",
- "#FC8452",
- "#9A60B4",
- "#ea7ccc"
- ],
- padding: [5, 5, 5, 5],
+ pieChartOpts: {
+ color: ["#0066cc", "#409eff", "#66b1ff", "#a0cfff", "#d9ecff"],
+ padding: [15, 15, 15, 15],
enableScroll: false,
+ legend: {
+ show: true,
+ position: "bottom",
+ lineHeight: 16,
+ fontSize: 10,
+ fontColor: "#666",
+ margin: 5,
+ itemGap: 8
+ },
extra: {
pie: {
activeOpacity: 0.5,
activeRadius: 10,
- offsetAngle: 0,
labelWidth: 15,
- border: true,
- borderWidth: 3,
- borderColor: "#FFFFFF"
+ border: false,
+ ringWidth: 0,
+ offsetAngle: 0,
+ disablePieStroke: true
}
}
- }
+ },
+ // 班组停机分布
+ crewPieData: {
+ series: [{ data: [] }]
+ },
+ // 停机类型分布
+ typePieData: {
+ series: [{ data: [] }]
+ },
+ // 停机详细列表
+ tableData: []
};
},
// 5. 计算属性(替代 Vue3 的 computed 函数)
@@ -351,10 +314,24 @@ export default {
// 切换视图(日/月/年)
handleTabChange(tab) {
this.activeTab = tab;
- // 重置日期:日视图首尾日期相同,月/年视图首尾默认当前
- const defaultDate = getDefaultDate();
- this.startDate = defaultDate;
- this.endDate = tab === "day" ? defaultDate : getDefaultDate(tab);
+
+ // 重置日期
+ if (tab === "day") {
+ // 日视图:首尾日期相同(今天)
+ const today = getDefaultDate();
+ this.startDate = today;
+ this.endDate = today;
+ } else if (tab === "month") {
+ // 月视图:上个月到这个月
+ this.startDate = getLastMonth();
+ this.endDate = getDefaultDate("month");
+ } else {
+ // 年视图:今年
+ const currentYear = getDefaultDate("year");
+ this.startDate = currentYear;
+ this.endDate = currentYear;
+ }
+
// 切换视图时重新加载数据
this.loadStoppageData();
},
@@ -394,47 +371,65 @@ export default {
// 加载停机数据
loadStoppageData() {
uni.showLoading({ title: '加载中' })
-
+
+ // 转换为完整日期格式
+ const start = this.formatFullDate(this.startDate, true)
+ const end = this.formatFullDate(this.endDate, false)
+
const queryParams = {
pageNum: 1,
pageSize: 100,
- startDate: this.startDate,
- endDate: this.endDate
+ startDate: start,
+ endDate: end
}
-
+
+ console.log('停机查询参数:', queryParams)
+
listStoppage(queryParams).then(response => {
uni.hideLoading()
-
+
+ console.log('停机统计响应:', response)
+
if (response.code === 200 && response.rows && response.rows.length > 0) {
// 处理停机数据
console.log('停机数据:', response.rows)
-
+
// 更新表格数据(日视图)
this.tableData = response.rows.map(item => ({
time: this.formatDateTime(item.startDate) + ' - ' + this.formatDateTime(item.endDate),
- duration: item.duration + 'min',
+ duration: this.secondsToMinutes(item.duration) + 'min',
remark: item.remark || '-',
machine: item.unit || '-'
}))
-
- // 计算汇总数据
- const totalDuration = response.rows.reduce((sum, item) => sum + (item.duration || 0), 0)
+
+ // 计算汇总数据(秒转分钟)
+ const totalDurationSeconds = response.rows.reduce((sum, item) => sum + (Number(item.duration) || 0), 0)
+ const totalDurationMinutes = this.secondsToMinutes(totalDurationSeconds)
const totalCount = response.rows.length
-
+
+ // 计算作业率(需要知道总可用时间)
+ const totalAvailableMinutes = this.getTotalAvailableMinutes()
+ const workRate = this.calculateWorkRate(totalDurationMinutes, totalAvailableMinutes)
+
this.summaryData = [
- { label: '停机时间', value: totalDuration, unit: 'min' },
- { label: '停机次数', value: totalCount },
- { label: '作业率', value: this.calculateWorkRate(totalDuration), unit: '%' }
+ { label: '停机时间', value: totalDurationMinutes, unit: 'min' },
+ { label: '停机次数', value: totalCount, unit: '次' },
+ { label: '作业率', value: workRate, unit: '%' }
]
-
+
// 更新饼图数据(按班组统计)
const crewMap = {}
+ const typeMap = {}
+
response.rows.forEach(item => {
const crew = item.crew || '未知班组'
- crewMap[crew] = (crewMap[crew] || 0) + (item.duration || 0)
+ const type = item.stopType || '未知类型'
+ const durationMinutes = this.secondsToMinutes(item.duration)
+ crewMap[crew] = (crewMap[crew] || 0) + durationMinutes
+ typeMap[type] = (typeMap[type] || 0) + durationMinutes
})
-
- this.pieChartData = {
+
+ this.crewPieData = {
series: [{
data: Object.keys(crewMap).map(crew => ({
name: crew,
@@ -442,13 +437,45 @@ export default {
}))
}]
}
+
+ this.typePieData = {
+ series: [{
+ data: Object.keys(typeMap).map(type => ({
+ name: type,
+ value: typeMap[type]
+ }))
+ }]
+ }
+
+ // 如果是月/年视图,构建趋势图
+ if (this.activeTab !== 'day' && response.rows.length > 0) {
+ this.buildTrendChart(response.rows)
+ }
} else {
// 没有数据时使用默认值
console.log('暂无停机数据')
+ // 清空数据
+ this.tableData = []
+ this.summaryData = [
+ { label: '停机时间', value: 0, unit: 'min' },
+ { label: '停机次数', value: 0, unit: '次' },
+ { label: '作业率', value: 100, unit: '%' }
+ ]
+ this.crewPieData = { series: [{ data: [] }] }
+ this.typePieData = { series: [{ data: [] }] }
+ // 清空趋势图
+ this.trendChartData = {
+ categories: [],
+ series: []
+ }
}
}).catch(error => {
uni.hideLoading()
console.error('加载停机数据失败:', error)
+ uni.showToast({
+ title: '加载失败',
+ icon: 'none'
+ })
})
},
// 格式化日期时间
@@ -462,12 +489,140 @@ export default {
const minutes = String(date.getMinutes()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}`
},
+ // 获取总可用时间(分钟)
+ getTotalAvailableMinutes() {
+ const start = new Date(this.formatFullDate(this.startDate, true))
+ const end = new Date(this.formatFullDate(this.endDate, false))
+
+ // 计算天数差
+ const diffTime = end - start
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1 // 包含结束日期
+
+ // 每天1440分钟(24小时)
+ return diffDays * 1440
+ },
+
// 计算作业率
- calculateWorkRate(stopDuration) {
- // 假设一天工作24小时,1440分钟
- const totalMinutes = 1440
- const workRate = ((totalMinutes - stopDuration) / totalMinutes) * 100
+ calculateWorkRate(stopDuration, totalAvailableMinutes) {
+ if (!totalAvailableMinutes || totalAvailableMinutes === 0) {
+ return 100
+ }
+ const workRate = ((totalAvailableMinutes - stopDuration) / totalAvailableMinutes) * 100
return Math.max(0, Math.min(100, workRate)).toFixed(2)
+ },
+
+ // 构建趋势图(月/年视图)
+ buildTrendChart(stoppageData) {
+ if (!stoppageData || stoppageData.length === 0) {
+ console.log('无法构建趋势图:数据为空')
+ this.trendChartData = {
+ categories: [],
+ series: []
+ }
+ return
+ }
+
+ // 按日期分组统计
+ const dateMap = {}
+ stoppageData.forEach(item => {
+ if (!item.startDate) return
+ const date = this.formatDate(item.startDate)
+ if (!dateMap[date]) {
+ dateMap[date] = { duration: 0, count: 0 }
+ }
+ const durationMinutes = this.secondsToMinutes(item.duration)
+ dateMap[date].duration += durationMinutes
+ dateMap[date].count += 1
+ })
+
+ const categories = Object.keys(dateMap).sort()
+
+ if (categories.length === 0) {
+ console.log('无法构建趋势图:无有效日期')
+ this.trendChartData = {
+ categories: [],
+ series: []
+ }
+ return
+ }
+
+ const durationData = []
+ const rateData = []
+
+ categories.forEach(date => {
+ durationData.push(dateMap[date].duration)
+ // 趋势图中每个点是单天的作业率,所以总时间是1440分钟
+ const rate = this.calculateWorkRate(dateMap[date].duration, 1440)
+ rateData.push(Number(rate))
+ })
+
+ console.log('趋势图数据构建成功:', { categories, durationData, rateData })
+
+ this.trendChartData = {
+ categories: categories,
+ series: [
+ {
+ name: "停机时间",
+ type: "column",
+ index: 0,
+ data: durationData
+ },
+ {
+ name: "作业率",
+ type: "line",
+ index: 1,
+ style: "curve",
+ data: rateData
+ }
+ ]
+ }
+ },
+
+ // 格式化日期(简短格式)
+ formatDate(dateStr) {
+ if (!dateStr) return ''
+ const date = new Date(dateStr)
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ return `${month}/${day}`
+ },
+
+ // 秒转分钟(保留整数)
+ secondsToMinutes(seconds) {
+ if (!seconds || seconds === 0) return 0
+ return Math.round(Number(seconds) / 60)
+ },
+
+ // 格式化为完整日期(用于查询)
+ formatFullDate(dateStr, isStart) {
+ if (!dateStr) return ''
+
+ // 如果已经是完整日期格式 yyyy-MM-dd,直接返回
+ if (dateStr.length === 10) {
+ return dateStr
+ }
+
+ // 月份格式 yyyy-MM
+ if (dateStr.length === 7) {
+ if (isStart) {
+ return `${dateStr}-01`
+ } else {
+ const [year, month] = dateStr.split('-')
+ const lastDay = new Date(year, month, 0).getDate()
+ return `${dateStr}-${String(lastDay).padStart(2, '0')}`
+ }
+ }
+
+ // 年份格式 yyyy
+ if (dateStr.length === 4) {
+ if (isStart) {
+ return `${dateStr}-01-01`
+ } else {
+ return `${dateStr}-12-31`
+ }
+ }
+
+ return dateStr
}
},
// 生命周期钩子
@@ -477,78 +632,280 @@ export default {
};
-
\ No newline at end of file
+
+.empty-text {
+ font-size: 28rpx;
+ color: #909399;
+}
+
diff --git a/apps/hand-factory/components/klp-team-performance/klp-team-performance.vue b/apps/hand-factory/components/klp-team-performance/klp-team-performance.vue
index 03287d1..38b44f5 100644
--- a/apps/hand-factory/components/klp-team-performance/klp-team-performance.vue
+++ b/apps/hand-factory/components/klp-team-performance/klp-team-performance.vue
@@ -1,54 +1,90 @@
-
-
-
-
-
-
- ◀
-
-
-
- 选择月份:
- {{ formattedMonth }}
-
-
-
-
- ▶
-
-
- ▼
+
+
+
+
+ ◀
+
+
+
+ {{ formattedMonth }}
+ ▼
+
+ ▶
+
-
-
+
+
+
+
+
+ {{ index + 1 }}
+
+ {{ item.team }}
+ {{ item.shift }}
+
+
+ {{ item.score }}
+ 分
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row[col.key] }}
+
+
+ 暂无数据
+
+
-
\ No newline at end of file
+
+/* 区块样式 */
+.ranking-section,
+.chart-section,
+.detail-section {
+ margin-bottom: 24rpx;
+}
+
+.section-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 20rpx;
+ padding-left: 16rpx;
+ border-left: 4rpx solid #0066cc;
+}
+
+.section-title {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #303133;
+}
+
+/* 排名列表 */
+.ranking-list {
+ background: #fff;
+ border-radius: 8rpx;
+ border: 1rpx solid #e4e7ed;
+ overflow: hidden;
+}
+
+.ranking-item {
+ display: flex;
+ align-items: center;
+ padding: 24rpx;
+ border-bottom: 1rpx solid #f5f7fa;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ &.rank-1 .rank-badge {
+ background: #0066cc;
+ }
+
+ &.rank-2 .rank-badge {
+ background: #409eff;
+ }
+
+ &.rank-3 .rank-badge {
+ background: #66b1ff;
+ }
+}
+
+.rank-badge {
+ width: 56rpx;
+ height: 56rpx;
+ border-radius: 50%;
+ background: #a0cfff;
+ color: #fff;
+ font-size: 28rpx;
+ font-weight: 600;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-right: 24rpx;
+}
+
+.rank-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ gap: 8rpx;
+}
+
+.team-name {
+ font-size: 30rpx;
+ color: #303133;
+ font-weight: 500;
+}
+
+.team-shift {
+ font-size: 24rpx;
+ color: #909399;
+}
+
+.rank-score {
+ display: flex;
+ align-items: baseline;
+ gap: 4rpx;
+}
+
+.score-value {
+ font-size: 48rpx;
+ color: #0066cc;
+ font-weight: 600;
+ line-height: 1;
+}
+
+.score-label {
+ font-size: 22rpx;
+ color: #909399;
+}
+
+/* 图表容器 */
+.chart-wrapper {
+ background: #fff;
+ border: 1rpx solid #e4e7ed;
+ border-radius: 8rpx;
+ padding: 24rpx 16rpx;
+ min-height: 450rpx;
+}
+
+/* 详细数据表格 */
+.detail-table {
+ background: #fff;
+ border-radius: 8rpx;
+ border: 1rpx solid #e4e7ed;
+ overflow: hidden;
+}
+
+.table-header {
+ display: flex;
+ background: #0066cc;
+ color: #fff;
+}
+
+.header-cell {
+ color: #fff !important;
+ font-weight: 500;
+}
+
+.table-row {
+ display: flex;
+ border-bottom: 1rpx solid #f5f7fa;
+
+ &:last-child {
+ border-bottom: none;
+ }
+}
+
+.table-cell {
+ flex: 1;
+ padding: 24rpx 12rpx;
+ text-align: center;
+ font-size: 26rpx;
+ color: #303133;
+}
+
+/* 空状态 */
+.empty-state {
+ padding: 100rpx 0;
+ text-align: center;
+}
+
+.empty-text {
+ font-size: 28rpx;
+ color: #909399;
+}
+
diff --git a/apps/hand-factory/components/lines/acidity.vue b/apps/hand-factory/components/lines/acidity.vue
index 37d16a5..a19cfcf 100644
--- a/apps/hand-factory/components/lines/acidity.vue
+++ b/apps/hand-factory/components/lines/acidity.vue
@@ -1,9 +1,9 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
- {{ timeRange }}
-
-
-
-
-
+
+
+ ⟳
+
-
-
-
-
+
+
+
+
+ 网络状态
+ {{ webStatus[0].value }}
+
+
+
+ 当前班组
+ {{ webStatus[1].value }}
+
+
+
+ 更新时间
+ {{ lastUpdateTime }}
+
-
-
-
-
+
+
+ 速度监控
+
+
+ {{ item.label }}
+ {{ item.value }}
+ {{ item.unit }}
-
+
-
-
-
-
+
+
+ 酸槽温度趋势
+
+
+
+
+
+
+
+ 活套运行状态
+
+
+ {{ item.label }}
+ {{ item.value }}
+ {{ item.unit }}
+
+
+
+
+
+
+ 酸槽浓度监控
+
+
+
+
+
+ 酸浓度
+ {{ tank.hclCont }} g/L
+
+
+
+ 铁盐浓度
+ {{ tank.feCont }} g/L
+
+
+
+
+
+
+
+
+ 工艺参数
+
+
+ {{ item.label }}
+ {{ item.value }}
+ {{ item.unit }}
+
+
-
+
-
+
-
+
-
-
-
-
-
diff --git a/apps/hand-factory/components/lines/paint.vue b/apps/hand-factory/components/lines/paint.vue
index d2fdbf8..b97bbfb 100644
--- a/apps/hand-factory/components/lines/paint.vue
+++ b/apps/hand-factory/components/lines/paint.vue
@@ -1,141 +1,5 @@
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 轧机
- 6390000
-
-
-
-
- 圆剪盘
- 6390000
-
-
-
-
- 设备编号:
- M-001
-
-
- 运行状态:
- 正常
-
-
-
-
-
- 当前产量:
- 2580 件
-
-
- 合格率:
- 98.5%
-
-
-
-
-
-
- 酸洗
- 6390000
-
-
-
-
- 入口活套
- 6390000
-
-
-
-
- 设备编号:
- M-001
-
-
- 运行状态:
- 正常
-
-
-
-
-
- 当前产量:
- 2580 件
-
-
- 合格率:
- 98.5%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 9.9
-
-
- 工艺缎带钢线速度
-
-
-
-
-
-
- 126.0
-
-
- 轧机出口带钢线速度
-
-
-
-
-
-
@@ -152,7 +16,8 @@