@@ -73,7 +74,8 @@ export default {
paperList: [],
currentPaper: null,
isEditMode: false,
- listLoading: false
+ listLoading: false,
+ dialogVisible: false
}
},
computed: {
@@ -85,15 +87,25 @@ export default {
watch: {
visible: {
handler(newVal) {
+ this.dialogVisible = newVal
if (newVal) {
this.initDialog()
- } else {
- this.resetDialog()
}
},
immediate: true
+ },
+ dialogVisible(newVal) {
+ // 当对话框关闭时,通知父组件
+ this.$emit('update:visible', newVal)
}
},
+ beforeDestroy() {
+ // 确保组件销毁前清理状态
+ this.paperList = []
+ this.currentPaper = null
+ this.isEditMode = false
+ this.listLoading = false
+ },
methods: {
// 初始化对话框
async initDialog() {
@@ -232,7 +244,15 @@ export default {
// 关闭对话框
handleClose() {
- this.$emit('update:visible', false)
+ this.dialogVisible = false
+ },
+
+ // 对话框关闭事件处理
+ handleDialogClose() {
+ // 延迟清理状态,避免销毁时机冲突
+ this.$nextTick(() => {
+ this.resetDialog()
+ })
}
}
}
@@ -352,15 +372,8 @@ export default {
.paper-management-dialog {
border-radius: 8px !important;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
- z-index: 2000 !important;
-}
-
-.paper-management-dialog .el-dialog__wrapper {
- z-index: 2000 !important;
}
-
-
.paper-management-dialog .el-dialog__header {
padding: 16px 20px 12px !important;
border-bottom: 1px solid #e4e7ed !important;