feat(): 数据同步

chao
chao 2024-04-22 20:02:46 +08:00
parent eefc9723bb
commit 617e845404
2 changed files with 38 additions and 1 deletions

View File

@ -42,9 +42,18 @@ export function delSource(id) {
method: 'delete'
})
}
// 测试数据源连接
export function testConnection(id) {
return request({
url: '/data/source/testConnection/' + id,
method: 'post'
})
}
// 资产同步
export function assetSynchronization(id) {
return request({
url: '/data/source/assetSynchronization/' + id,
method: 'post'
})
}

View File

@ -112,6 +112,14 @@
v-hasPermi="['data:source:testConnection']"
>测试链接
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="assetSynchronization(scope.row.id)"
v-hasPermi="['data:source:assetSynchronization']"
>同步数据结构
</el-button>
<el-button
size="mini"
type="text"
@ -287,7 +295,15 @@
</template>
<script>
import {listSource, getSource, delSource, addSource, updateSource, testConnection} from "@/api/data/source";
import {
listSource,
getSource,
delSource,
addSource,
updateSource,
testConnection,
assetSynchronization
} from "@/api/data/source";
import {listType} from "@/api/data/type";
export default {
@ -374,6 +390,18 @@ export default {
this.getTypeList();
},
methods: {
//
assetSynchronization(id) {
assetSynchronization(id).then(response => {
console.log(response)
if (response.data) {
this.$modal.msgSuccess("同步成功");
} else {
this.$modal.msgError("同步失败");
}
this.getList();
})
},
//
testConnection(id) {
testConnection(id).then(response => {