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/usageAuthorization.vue | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue b/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
index 8db89c6..f3e8ab6 100644
--- a/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
+++ b/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
@@ -80,7 +80,7 @@
<span style="width: 90px;margin-left: 10px">琚巿鏉冧汉锛�</span>
<el-select v-model="delegatedUser" clearable filterable multiple
placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
- <el-option v-for="item in responsibleOptions" :key="item.name" :label="item.name" :value="item.name">
+ <el-option v-for="item in inspectorOptions" :key="item.name" :label="item.name" :value="item.name">
</el-option>
</el-select>
</div>
@@ -122,11 +122,13 @@
} from "@/api/cnas/resourceDemand/device";
import {selectUserCondition} from "@/api/system/user";
import {mapGetters} from "@/utils/store-compat";
+import draftSave from '@/mixins/draftSave'
export default {
name: '',
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
components: {limsTable},
+ mixins: [draftSave],
props: {
clickNodeVal: {
type: Object,
@@ -229,6 +231,7 @@
}
],
responsibleOptions: [],
+ inspectorOptions: [],
operationType: '',
usageTableDia: false,
deviceImpowerDetails: [],
@@ -322,13 +325,23 @@
this.deviceImpowerDetails.forEach(item => {
item['delegatedUserArr'] = item.delegatedUser.split(',')
})
+ this.restoreImpowerDraft()
}
}).catch(error => {
console.error(error)
})
+ } else {
+ this.restoreImpowerDraft()
}
this.getEquipOptions()
this.getUserList()
+ },
+ restoreImpowerDraft() {
+ if (this.operationType === 'add' || this.operationType === 'edit') {
+ const rid = this.operationType === 'edit' ? this.impowerId : ''
+ this.draftRestore('usageAuthorizationForm', 'form', rid, 'usageTableDia')
+ this.draftRestore('usageAuthorizationRows', 'deviceImpowerDetails', rid, 'usageTableDia')
+ }
},
closeDialog () {
this.usageTableDia = false
@@ -337,7 +350,7 @@
// 娣诲姞璁惧
addTableRow() {
this.addEquipDia = true
- this.delegatedUser = this.responsibleOptions.map((item) => item.name);
+ this.delegatedUser = this.inspectorOptions.map((item) => item.name);
this.getEquipOptions()
},
// 鍒犻櫎琛ㄦ牸琛�
@@ -355,6 +368,8 @@
addImpower(this.form).then(res => {
if (res.code == 200) {
this.$message.success('鏂板鎴愬姛')
+ this.draftClear('usageAuthorizationForm')
+ this.draftClear('usageAuthorizationRows')
this.usageTableDia = false
this.refreshTableList()
}
@@ -366,6 +381,8 @@
updateImpower(this.form).then(res => {
if (res.code == 200) {
this.$message.success('淇敼鎴愬姛')
+ this.draftClear('usageAuthorizationForm')
+ this.draftClear('usageAuthorizationRows')
this.usageTableDia = false
this.refreshTableList()
}
@@ -453,6 +470,12 @@
this.responsibleOptions = res.data
}
})
+ // 琚巿鏉冧汉涓嬫媺鍙彇妫�娴嬪憳瑙掕壊浜哄憳
+ selectUserCondition({type: 3}).then(res => {
+ if (res.code == 200) {
+ this.inspectorOptions = res.data
+ }
+ })
},
},
watch: {
--
Gitblit v1.9.3