添加同步资产结构按钮

master
冷调 2024-08-25 18:28:51 +08:00
parent 6e795d5c55
commit 3da2996bfc
3 changed files with 37 additions and 13 deletions

View File

@ -50,3 +50,11 @@ export function delSource(id) {
method: 'delete'
})
}
//同步资产结构
export function synchronous(data) {
return request({
url: '/source/data/synchronous',
method: 'post',
data: data
})
}

View File

@ -42,11 +42,5 @@ export function delData(id) {
method: 'delete'
})
}
//同步资产结构
export function synchronous(data) {
return request({
url: '/source/data/synchronous',
method: 'post',
data: data
})
}

View File

@ -105,10 +105,11 @@
<el-button
size="mini"
type="text"
icon="el-icon-link"
@click="handleConnect(scope.row)"
>同步资产结构</el-button>
<el-button
icon="el-icon-connection"
v-if="scope.row.isInit === 'Y'"
@click="handleStructure(scope.row)"
>同步资产结构</el-button>>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@ -193,7 +194,15 @@
</template>
<script>
import {listSource, getSource, delSource, addSource, updateSource, testConnection} from "@/api/source/source";
import {
listSource,
getSource,
delSource,
addSource,
updateSource,
testConnection,
synchronous
} from "@/api/source/source";
export default {
name: "Source",
@ -294,6 +303,7 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 资产接入 测试连接 */
handleConnect(dataSource) {
testConnection(dataSource).then(res => {
console.log(res)
@ -305,6 +315,18 @@ export default {
}
})
},
/** 同步资产结构 */
handleStructure(dataSource){
synchronous(dataSource).then(res=>{
console.log(res)
if (res.code == 200) {
this.$message.success("同步资产结构成功")
this.getList()
} else {
this.$message.error("同步资产结构失败")
}
})
},
/** 新增按钮操作 */
handleAdd() {
this.reset();