|
|
@@ -53,6 +53,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {button as buttonList} from "@/locale/lang/zh-CN";
|
|
|
+import {localRead, localSave} from "@/libs/base/util";
|
|
|
|
|
|
export default {
|
|
|
name: "dk-modal",
|
|
|
@@ -216,7 +217,6 @@ export default {
|
|
|
this.$emit('input', n)
|
|
|
if(n){
|
|
|
this.displayFlag = true;
|
|
|
- console.log('ft',this.openFlag,n)
|
|
|
this.onVisibleChange(true);
|
|
|
if(this.shortcutFlag){
|
|
|
this.addKeyBoardEvent();
|
|
|
@@ -323,6 +323,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (e) {
|
|
|
+ // console.log('ttttt',this.$route,localRead(this.$route.name + '_temp'))
|
|
|
+ // // if(data && !this.isEmpty(data)){
|
|
|
+ // // // 记录缓存
|
|
|
+ // // localSave(this.$route.name + '_temp', JSON.stringify(data));
|
|
|
+ // // }
|
|
|
+ // let tempData = localRead(this.$route.name + '_temp');
|
|
|
+ // if(tempData){
|
|
|
+ // this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].model = tempData
|
|
|
+ // }
|
|
|
this.$nextTick(() => {
|
|
|
this.focus(); // 聚焦到第一个组件上
|
|
|
})
|
|
|
@@ -333,6 +342,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 记录缓存数据
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/4/9 9:44
|
|
|
+ */
|
|
|
+ handleTempData(data){
|
|
|
+ // console.log('dd1d',data,this.$route)
|
|
|
+ // if(data && !this.isEmpty(data)){
|
|
|
+ // // 记录缓存
|
|
|
+ // localSave(this.$route.name + '_temp', JSON.stringify(data));
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 点击ok
|
|
|
* @author : 周兴
|
|
|
* @date : 2022/7/23 17:35
|
|
|
@@ -352,9 +373,11 @@ export default {
|
|
|
&& this.$refs.modal.$slots.default[0].componentInstance) {
|
|
|
if(this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName]
|
|
|
&& this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].resetFields){
|
|
|
+ this.handleTempData(this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].model);
|
|
|
this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].resetFields();
|
|
|
}
|
|
|
if(this.$refs.modal.$slots.default[0].componentInstance.resetFields){
|
|
|
+ this.handleTempData(this.$refs.modal.$slots.default[0].componentInstance.model);
|
|
|
this.$refs.modal.$slots.default[0].componentInstance.resetFields();
|
|
|
}
|
|
|
}
|
|
|
@@ -432,9 +455,11 @@ export default {
|
|
|
&& this.$refs.modal.$slots.default[0].componentInstance) {
|
|
|
if(this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName]
|
|
|
&& this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].resetFields){
|
|
|
+ this.handleTempData(this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].model);
|
|
|
this.$refs.modal.$slots.default[0].componentInstance.$refs[this.validFormName].resetFields();
|
|
|
}
|
|
|
if(this.$refs.modal.$slots.default[0].componentInstance.resetFields){
|
|
|
+ this.handleTempData(this.$refs.modal.$slots.default[0].componentInstance.model);
|
|
|
this.$refs.modal.$slots.default[0].componentInstance.resetFields();
|
|
|
}
|
|
|
}
|