修改用户数据添加表单

master
夜笙歌 2 years ago
parent c9f20ac392
commit 3e0cff9f47

@ -253,15 +253,15 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.operationType = 1
this.reset(); this.reset();
this.operationType = 1
this.open = true; this.open = true;
this.title = "添加用户数据"; this.title = "添加用户数据";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.operationType = 2
this.reset(); this.reset();
this.operationType = 2
const datasourceId = row.datasourceId || this.ids const datasourceId = row.datasourceId || this.ids
getUserdatasource(datasourceId).then(response => { getUserdatasource(datasourceId).then(response => {
this.form = response.data; this.form = response.data;
@ -273,12 +273,12 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log(this.operationType)
if (this.operationType === 2) { if (this.operationType === 2) {
updateUserdatasource(this.form).then(response => { updateUserdatasource(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
this.operationType = null
}); });
} }
if(this.operationType === 1){ if(this.operationType === 1){
@ -286,7 +286,6 @@ export default {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
this.operationType = null
}); });
} }
} }

Loading…
Cancel
Save