feat: 同步资产结构到数据库

master
baize 2024-04-23 09:31:09 +08:00
parent 491185be53
commit 685e19cc72
2 changed files with 22 additions and 1 deletions

View File

@ -48,6 +48,14 @@ export function updateSource(data) {
data: data data: data
}) })
} }
//同步数据库接入
export function Synchronization(data){
return request({
url:'/dataSource/source/synchronization',
method:'post',
data:data
})
}
// 删除数据源 // 删除数据源
export function delSource(id) { export function delSource(id) {
@ -56,3 +64,4 @@ export function delSource(id) {
method: 'delete' method: 'delete'
}) })
} }

View File

@ -171,6 +171,11 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['dataSource:source:remove']" v-hasPermi="['dataSource:source:remove']"
>删除</el-button> >删除</el-button>
<el-button
size="mini"
type="text"
@click="Synchronization(scope.row)"
>同步数据库</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -338,7 +343,7 @@ import {
addSource, addSource,
updateSource, updateSource,
listType, listType,
testConnection testConnection, Synchronization
} from "@/api/dataSource/source"; } from "@/api/dataSource/source";
export default { export default {
@ -402,6 +407,13 @@ export default {
this.findAccessType(); this.findAccessType();
}, },
methods: { methods: {
Synchronization(dataSource){
Synchronization(dataSource).then(
res=>{
this.$message.success(res.msg)
}
)
},
testConnection(source){ testConnection(source){
testConnection(source).then( testConnection(source).then(
res=>{ res=>{