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/files.vue | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/files.vue b/src/views/CNAS/resourceDemand/device/component/files.vue
index 4228c5f..bb231a9 100644
--- a/src/views/CNAS/resourceDemand/device/component/files.vue
+++ b/src/views/CNAS/resourceDemand/device/component/files.vue
@@ -5,7 +5,7 @@
<h4><span class="line"></span><span>璁惧妗f</span></h4>
<div class="btns">
<el-button type="primary" size="small" @click="openEditForm" style="">淇妗f</el-button>
- <el-button type="primary" size="small" @click="dialogVisible1 = true" style="">娣诲姞闄勪欢</el-button>
+ <el-button type="primary" size="small" @click="openAddFileDia" style="">娣诲姞闄勪欢</el-button>
<el-button type="primary" size="small" @click="deviceDialog = true" style="">鏌ョ湅璁惧浜岀淮鐮�</el-button>
<el-button type="primary" size="small" @click="handleDownOne" style="">瀵煎嚭</el-button>
</div>
@@ -504,7 +504,9 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage'
+import draftSave from '@/mixins/draftSave'
export default {
+ mixins: [draftSave],
props: {
clickNodeVal: {
type: Object,
@@ -682,6 +684,14 @@
})
this.fileList.push(obj)
}
+ this.draftRestore('fileAdd', 'addFile', row.id, 'dialogVisible1')
+ },
+ // 鎵撳紑娣诲姞闄勪欢寮圭獥
+ openAddFileDia() {
+ this.dialogVisible1 = true
+ this.$nextTick(() => {
+ this.draftRestore('fileAdd', 'addFile', this.clickNodeVal.value, 'dialogVisible1')
+ })
},
handleDeleteClick(row) {
// 鍒犻櫎閫昏緫
@@ -712,6 +722,7 @@
updateDocument(this.addFile).then(res => {
if (res.code == 200) {
this.$message.success('鏇存柊鎴愬姛')
+ this.draftClear('fileAdd')
this.dialogVisible1 = false;
this.getPage()
}
@@ -721,6 +732,7 @@
addDocument(this.addFile).then(res => {
if (res.code == 200) {
this.$message.success('淇濆瓨鎴愬姛')
+ this.draftClear('fileAdd')
this.dialogVisible1 = false;
this.getPage()
}
@@ -804,6 +816,7 @@
this.editData = JSON.parse(JSON.stringify(this.Mdata))
this.$nextTick(() => {
this.dialogVisible = true
+ this.draftRestore('fileRevision', 'editData', this.clickNodeVal.value, 'dialogVisible')
})
},
// 涓嬫鏃ユ湡 = 鏈�杩戞棩鏈� + 鍛ㄦ湡锛堟湀锛夛紝鑷姩璁$畻
@@ -875,6 +888,7 @@
upDeviceParameter(formData).then(res => {
this.$message.success('淇敼鎴愬姛')
this.upLoad = false
+ this.draftClear('fileRevision')
this.getList(this.clickNodeVal.value)
this.dialogVisible = false
}).catch(e => {
@@ -977,6 +991,7 @@
},
dialogVisible1(newVal) {
if (newVal == false) {
+ this.draftStop('fileAdd')
this.isAddFileUpdate = false
this.addFile = {}
this.fileList = []
--
Gitblit v1.9.3