功能优化

This commit is contained in:
hayu 2024-11-18 10:06:51 +08:00
parent e9f80e2b8c
commit 18927c3779
1 changed files with 22 additions and 1 deletions

View File

@ -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();
});
}