From 27c8277d717b34b55f3ea967027b53b067f77df3 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 16:58:49 +0800
Subject: [PATCH] feat 功能变更
---
src/views/mes/dv/telemetry/data.ts | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/src/views/mes/dv/telemetry/data.ts b/src/views/mes/dv/telemetry/data.ts
new file mode 100644
index 0000000..417341d
--- /dev/null
+++ b/src/views/mes/dv/telemetry/data.ts
@@ -0,0 +1,98 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { MesDvTelemetryApi } from '#/api/mes/dv/telemetry';
+
+/** 鏄惁寮傚父閫夐」锛堝竷灏斿�硷紝鍚庣鐩存帴鎺ユ敹锛� */
+export const ANOMALY_OPTIONS = [
+ { label: '姝e父', value: false },
+ { label: '寮傚父', value: true },
+];
+
+/** 鍘嗗彶璁板綍鎼滅储琛ㄥ崟 */
+export function useHistoryGridFormSchema(): VbenFormSchema[] {
+ return [
+ {
+ fieldName: 'deviceName',
+ label: '璁惧鍚嶇О',
+ component: 'Input',
+ componentProps: { allowClear: true, placeholder: '璇疯緭鍏ヨ澶囧悕绉�' },
+ },
+ {
+ fieldName: 'paramName',
+ label: '淇″彿鍚嶇О',
+ component: 'Input',
+ componentProps: { allowClear: true, placeholder: '璇疯緭鍏ヤ俊鍙峰悕绉�' },
+ },
+ {
+ fieldName: 'whetherAnomaly',
+ label: '鏄惁寮傚父',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: ANOMALY_OPTIONS,
+ placeholder: '璇烽�夋嫨鏄惁寮傚父',
+ },
+ },
+ {
+ fieldName: 'telemetryDataTime',
+ label: '閬ユ祴鏃堕棿',
+ component: 'RangePicker',
+ componentProps: { class: '!w-full', valueFormat: 'YYYY-MM-DD HH:mm:ss' },
+ },
+ ];
+}
+
+/** 瀹炴椂鏁版嵁瀛楁 */
+export function useLatestColumns(): VxeTableGridOptions<MesDvTelemetryApi.Telemetry>['columns'] {
+ return [
+ { field: 'deviceName', title: '璁惧鍚嶇О', minWidth: 140 },
+ { field: 'paramName', title: '淇″彿鍚嶇О', minWidth: 140 },
+ { field: 'timelyValue', title: '淇″彿鍊�(瀹炴椂)', width: 120 },
+ {
+ field: 'whetherAnomaly',
+ title: '鏄惁寮傚父',
+ width: 100,
+ slots: { default: 'anomaly' },
+ },
+ { field: 'shiftName', title: '鐝', width: 100 },
+ {
+ field: 'telemetryDataTime',
+ title: '閬ユ祴鏃堕棿',
+ width: 180,
+ formatter: 'formatDateTime',
+ },
+ { field: 'standardValue', title: '鏍囧噯鍊�', width: 110 },
+ { field: 'avgValue', title: '鍧囧��', width: 110 },
+ { field: 'maxValue', title: '鏈�澶у��', width: 110 },
+ { field: 'minValue', title: '鏈�灏忓��', width: 110 },
+ ];
+}
+
+/** 鍘嗗彶璁板綍瀛楁 */
+export function useHistoryColumns(): VxeTableGridOptions<MesDvTelemetryApi.Telemetry>['columns'] {
+ return [
+ { field: 'deviceName', title: '璁惧鍚嶇О', minWidth: 140 },
+ { field: 'paramName', title: '淇″彿鍚嶇О', minWidth: 140 },
+ { field: 'timelyValue', title: '淇″彿鍊�', width: 110 },
+ {
+ field: 'whetherAnomaly',
+ title: '鏄惁寮傚父',
+ width: 100,
+ slots: { default: 'anomaly' },
+ },
+ { field: 'shiftName', title: '鐝', width: 100 },
+ { field: 'billNo', title: '鍗曟嵁鍙�', minWidth: 120 },
+ {
+ field: 'telemetryDataTime',
+ title: '閬ユ祴鏃堕棿',
+ width: 180,
+ formatter: 'formatDateTime',
+ },
+ {
+ field: 'pullTime',
+ title: '鎷夊彇鏃堕棿',
+ width: 180,
+ formatter: 'formatDateTime',
+ },
+ ];
+}
--
Gitblit v1.9.3