|
|
|
@ -156,6 +156,7 @@ export default {
|
|
|
|
|
name: "Userdatasource",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
operationType:null,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
@ -184,7 +185,8 @@ export default {
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {
|
|
|
|
|
datasourceId: null,
|
|
|
|
|
userId: null},
|
|
|
|
|
userId: null
|
|
|
|
|
},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
datasourceId: [
|
|
|
|
@ -226,6 +228,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.operationType = null
|
|
|
|
|
this.form = {
|
|
|
|
|
datasourceId: null,
|
|
|
|
|
userId: null
|
|
|
|
@ -250,12 +253,14 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.operationType = 1
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加用户数据";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.operationType = 2
|
|
|
|
|
this.reset();
|
|
|
|
|
const datasourceId = row.datasourceId || this.ids
|
|
|
|
|
getUserdatasource(datasourceId).then(response => {
|
|
|
|
@ -268,17 +273,20 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.datasourceId != null) {
|
|
|
|
|
if (this.operationType === 2) {
|
|
|
|
|
updateUserdatasource(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.operationType = null
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
if(this.operationType === 1){
|
|
|
|
|
addUserdatasource(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.operationType = null
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|