bug修复

This commit is contained in:
@fawn-nine
2023-09-22 13:57:49 +08:00
parent 036ca42ae9
commit 14e286a7b6

View File

@@ -2,7 +2,7 @@
<el-dialog <el-dialog
:title="!dataForm.splId ? '新增' : '修改'" :title="!dataForm.splId ? '新增' : '修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible" append-to-body> :visible.sync="visible" append-to-body @close="resetform">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="标签名称" prop="labelName"> <el-form-item label="标签名称" prop="labelName">
<el-input v-model="dataForm.labelName" placeholder="标签名称"></el-input> <el-input v-model="dataForm.labelName" placeholder="标签名称"></el-input>
@@ -36,7 +36,7 @@
}, },
methods: { methods: {
init (row) { init (row) {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
@@ -46,7 +46,13 @@
this.dataForm.labelName = row.labelName this.dataForm.labelName = row.labelName
} }
}) })
}, },
// 关闭弹窗
resetform() {
this.visible = false
this.dataForm.splId = 0
console.log('重置id')
},
// 表单提交 // 表单提交
dataFormSubmit () { dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
@@ -68,6 +74,7 @@
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.resetform()
} }
}) })
} else { } else {
@@ -91,6 +98,7 @@
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.resetform()
} }
}) })
} else { } else {