master
parent
fdb6f388ce
commit
67af1bb935
|
@ -23,6 +23,21 @@ export function insertDataSource(dataSource) {
|
|||
})
|
||||
}
|
||||
|
||||
export function updateDataSource(data) {
|
||||
return request({
|
||||
url: '/data/data',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteDataSource(id) {
|
||||
return request({
|
||||
url: '/data/data/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function dataSynchronization(dataSourceResp) {
|
||||
return request({
|
||||
url: '/data/data/dataSynchronization',
|
||||
|
|
|
@ -105,14 +105,14 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-connection"
|
||||
@click="testConnect(scope.row)"
|
||||
v-hasPermi="['system:access:remove']"
|
||||
>测试连接</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-video-play"
|
||||
@click="dataSynchronization(scope.row)"
|
||||
v-hasPermi="['system:access:remove']"
|
||||
>同步数据</el-button>
|
||||
|
@ -159,18 +159,6 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="用户名" prop="dataSourceUsername">
|
||||
<el-input v-model="form.dataSourceUsername" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="密码" prop="dataSourcePassword">
|
||||
<el-input v-model="form.dataSourcePassword" placeholder="请输入密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="数据接入类型" prop="type">
|
||||
|
@ -185,6 +173,18 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="用户名" prop="dataSourceUsername">
|
||||
<el-input v-model="form.dataSourceUsername" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="密码" prop="dataSourcePassword">
|
||||
<el-input v-model="form.dataSourcePassword" placeholder="请输入密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
|
@ -270,13 +270,13 @@
|
|||
<script>
|
||||
|
||||
import {
|
||||
dataSynchronization,
|
||||
dataSynchronization, deleteDataSource,
|
||||
getAllDataType,
|
||||
getDataSourceList,
|
||||
insertDataSource,
|
||||
queryStructure,
|
||||
testConnect
|
||||
} from "@/api/dataSource/data";
|
||||
testConnect, updateDataSource
|
||||
} from '@/api/dataSource/data'
|
||||
|
||||
export default {
|
||||
name: "Access",
|
||||
|
@ -465,15 +465,13 @@ export default {
|
|||
this.reset();
|
||||
this.form = row;
|
||||
this.dataSourceParamList = [];
|
||||
if (this.form.additionalConfiguration!=undefined){
|
||||
this.form.additionalConfiguration.split("&").forEach(param => {
|
||||
let paramArr = param.split("=");
|
||||
this.dataSourceParamList.push({
|
||||
name: paramArr[0],
|
||||
val: paramArr[1]
|
||||
})
|
||||
this.form.additionalConfiguration.split("&").forEach(param => {
|
||||
let paramArr = param.split("=");
|
||||
this.dataSourceParamList.push({
|
||||
name: paramArr[0],
|
||||
val: paramArr[1]
|
||||
})
|
||||
}
|
||||
})
|
||||
this.open = true;
|
||||
this.title = "修改数据接入";
|
||||
},
|
||||
|
@ -485,29 +483,43 @@ export default {
|
|||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log('from:',this.form)
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
} else {
|
||||
insertDataSource(this.form).then(
|
||||
res => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
}
|
||||
)
|
||||
|
||||
if (this.form.id == null){
|
||||
console.log('from:',this.form)
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList()
|
||||
} else {
|
||||
insertDataSource(this.form).then(
|
||||
res => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}else {
|
||||
updateDataSource(this.form).then(res =>{
|
||||
if (res.code == 200){
|
||||
this.$message.success('修改成功!')
|
||||
this.open = false
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据接入编号为"' + ids + '"的数据项?').then(() => {
|
||||
deleteDataSource(ids);
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.reset();
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
queryDataBase(row) {
|
||||
|
|
|
@ -162,7 +162,8 @@ export default {
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
background-image: url("../assets/images/login-background.jpg");
|
||||
//background-image: url("../assets/images/login-background.jpg");
|
||||
background-image: url("D:/images/background-ruoyi/windows01.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue