功能优化
This commit is contained in:
parent
e9f80e2b8c
commit
18927c3779
|
|
@ -54,6 +54,8 @@
|
|||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
ref="editButton"
|
||||
:disabled="isEditing"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -80,7 +82,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @close="handleClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
|
|
@ -191,6 +193,7 @@
|
|||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
isEditing: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
|
|
@ -313,6 +316,13 @@
|
|||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.isEditing = false;
|
||||
this.reset();
|
||||
},
|
||||
// 处理对话框关闭
|
||||
handleClose() {
|
||||
this.open = false;
|
||||
this.isEditing = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
|
|
@ -350,6 +360,7 @@
|
|||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.isEditing = true;
|
||||
let param={
|
||||
userId:row.userId
|
||||
}
|
||||
|
|
@ -360,6 +371,14 @@
|
|||
this.open = true;
|
||||
this.title = "编辑人员";
|
||||
this.$forceUpdate()
|
||||
|
||||
// 使用 $nextTick 确保 DOM 已经更新
|
||||
// 在下一个 tick 中取消按钮焦点
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.editButton) {
|
||||
this.$refs.editButton.$el.blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
|
@ -370,12 +389,14 @@
|
|||
updateUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.isEditing = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.isEditing = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue