Browse Source

setfoucs

master
pengjun 2 years ago
parent
commit
64e19a2f3a
  1. 19
      src/views/basic-dictionary/BirthPlace.vue

19
src/views/basic-dictionary/BirthPlace.vue

@ -366,6 +366,7 @@ export default {
}, },
// //
edit(row) { edit(row) {
this.resetFields()
this.form = { ...this.curRow }; this.form = { ...this.curRow };
if (this.form.id == undefined) { if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据"); this.$message.warning("请选择操作的数据");
@ -373,8 +374,11 @@ export default {
this.title = 2; this.title = 2;
// this.form = row; // this.form = row;
this.dialogVisible = true; this.dialogVisible = true;
this.getFocus();
} }
}, },
// //
addoredit() { addoredit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
@ -420,15 +424,26 @@ export default {
// //
add() { add() {
this.form = { ...this.curRow };
this.dialogVisible = true; this.dialogVisible = true;
this.title = 1; this.title = 1;
this.form = {}; this.form = {};
this.resetFields();
this.getFocus();
},
getFocus(){
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.refinput.focus(); this.$refs.refinput.focus();
}); });
}, },
//
resetFields(){
this.$nextTick(() => {
this.$refs.form.resetFields();
});
},
getlist() { getlist() {
nativeplacelist(this.pages).then((res) => { nativeplacelist(this.pages).then((res) => {
this.initTableData = [...res.data.items]; this.initTableData = [...res.data.items];

Loading…
Cancel
Save