From 39154a82354b08c2449918c0665457fdb2701b9b Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期五, 16 十月 2026 16:02:23 +0800
Subject: [PATCH] 设备模块各标签页弹窗新增草稿自动保存与恢复:编辑或录入数据中途关闭/刷新页面,再次打开同一弹窗时自动恢复未保存的编辑内容(弹窗显示"已恢复上次未保存的编辑内容"提示),保存成功后草稿自动清除;新增 src/mixins/draftSave.js 同时清理设备死代码:management.vue 数采配置旧弹窗及其提交方法、calibration.vue 被注释的导出按钮、device.js 中 numberCollect/deviceMetricRecordExport 两个死接口定义

---
 src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue b/src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue
index 3269482..9b01a34 100644
--- a/src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue
+++ b/src/views/CNAS/resourceDemand/device/component/addYearPlanDia.vue
@@ -96,11 +96,13 @@
   deviceScopeSearch
 } from '@/api/cnas/resourceDemand/device.js'
 import Sortable from "sortablejs";
+import draftSave from '@/mixins/draftSave'
 
 export default {
   name: "addYearPlanDia",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
   components: {},
+  mixins: [draftSave],
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
@@ -134,6 +136,10 @@
           calibrationPlanDetailList: [],
         }
         this.calibrationPlanDetailList = []
+        this.$nextTick(() => {
+          this.draftRestore('addYearPlanDiaForm', 'form', '', 'applicationForm')
+          this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', '', 'applicationForm')
+        })
       } else {
         this.getRowInfo(row)
       }
@@ -148,6 +154,10 @@
           this.form.planName = res.data.planName
           this.form.planYear = res.data.planYear
           this.form.planId = res.data.planId
+          this.$nextTick(() => {
+            this.draftRestore('addYearPlanDiaForm', 'form', this.form.planId, 'applicationForm')
+            this.draftRestore('addYearPlanDiaRows', 'calibrationPlanDetailList', this.form.planId, 'applicationForm')
+          })
         }
       }).catch(err => {
         this.yearTableLoading = false
@@ -215,6 +225,8 @@
         addDeviceCalibrationPlan(this.form).then(res => {
           if (res.code == 200) {
             this.$message.success('鏂板鎴愬姛')
+            this.draftClear('addYearPlanDiaForm')
+            this.draftClear('addYearPlanDiaRows')
             this.closeDialog()
             this.$emit('closeDia')
           }
@@ -226,6 +238,8 @@
         updateDeviceCalibrationPlan(this.form).then(res => {
           if (res.code == 200) {
             this.$message.success('鏂板鎴愬姛')
+            this.draftClear('addYearPlanDiaForm')
+            this.draftClear('addYearPlanDiaRows')
             this.closeDialog()
             this.$emit('closeDia')
           }
@@ -236,6 +250,8 @@
       }
     },
     closeDialog() {
+      this.draftStop('addYearPlanDiaForm')
+      this.draftStop('addYearPlanDiaRows')
       this.applicationForm = false
     },
     // 鑾峰彇鎵�鏈夎澶�

--
Gitblit v1.9.3