修改更新bug
This commit is contained in:
parent
efdc2edd99
commit
8ba0bc8d80
|
@ -9,6 +9,7 @@ const datasyncgetTableInfo = (params)=>getAction("/datasync/getTableInfo",params
|
|||
const datasynctestConn = (params)=>getAction("/datasync/testConn",params);
|
||||
const datasyncsyncOriginalData = (params)=>getAction("/datasync/syncOriginalData",params);
|
||||
const datasyncgetSyncLog = (params)=>getAction("/datasync/getSyncLog",params);
|
||||
const datasyncupdateSyncRecord = (params)=>putAction("/datasync/updateSyncRecord",params);
|
||||
|
||||
export {
|
||||
datasyncqueryPage,
|
||||
|
@ -19,7 +20,8 @@ export {
|
|||
datasyncgetTableInfo,
|
||||
datasynctestConn,
|
||||
datasyncsyncOriginalData,
|
||||
datasyncgetSyncLog
|
||||
datasyncgetSyncLog,
|
||||
datasyncupdateSyncRecord
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<creatdblink ref="modalForm"></creatdblink>
|
||||
<creatdblink ref="modalForm" @ok="loadData"></creatdblink>
|
||||
<syncLog ref="syncLog"></syncLog>
|
||||
</a-card>
|
||||
</template>
|
||||
|
|
|
@ -92,6 +92,7 @@ import {
|
|||
dataTypePageList,
|
||||
dataTypeDeleteById } from '@/api/dataType'
|
||||
import { datasyncqueryPage,
|
||||
datasyncupdateSyncRecord,
|
||||
datasyncqueryById,
|
||||
datasyncsyncOriginalData,
|
||||
datasynccreateSyncRecord,
|
||||
|
@ -176,7 +177,12 @@ import { datasyncqueryPage,
|
|||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
console.log(record);
|
||||
this.model = Object.assign({},record);
|
||||
this.getselect();
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
|
@ -185,6 +191,7 @@ import { datasyncqueryPage,
|
|||
console.log(record);
|
||||
this.model = Object.assign({},record);
|
||||
this.getselect();
|
||||
this.recordId = model.id;
|
||||
datasyncqueryById({id:this.model.id}).then((res) => {
|
||||
if (res.success) {
|
||||
let model = {};
|
||||
|
@ -227,6 +234,7 @@ import { datasyncqueryPage,
|
|||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
if(this.recordId == ''){
|
||||
datasynccreateSyncRecord({sourceIp:values.ip,
|
||||
sourcePort:values.port,
|
||||
username:values.username,
|
||||
|
@ -242,6 +250,24 @@ import { datasyncqueryPage,
|
|||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
datasyncupdateSyncRecord({id:this.recordId,sourceIp:values.ip,
|
||||
sourcePort:values.port,
|
||||
username:values.username,
|
||||
password:values.password,
|
||||
sourceDatabase:values.database,
|
||||
dataTypeId:values.dataType,
|
||||
shipModelId:values.shipModel,
|
||||
shipNumId:values.shipNum}).then((res) => {
|
||||
if (res.success) {
|
||||
this.recordId = res.result
|
||||
this.$message.success(res.message);
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -333,13 +359,14 @@ import { datasyncqueryPage,
|
|||
},
|
||||
|
||||
onOk(value) {
|
||||
|
||||
this.$emit('ok');
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
this.$emit('ok');
|
||||
this.close();
|
||||
},
|
||||
handleCancel () {
|
||||
|
|
Loading…
Reference in New Issue
Block a user