添加同步资产结构按钮

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' 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' method: 'delete'
}) })
} }
//同步资产结构
export function synchronous(data) {
return request({
url: '/source/data/synchronous',
method: 'post',
data: data
})
}

View File

@ -105,10 +105,11 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-link" icon="el-icon-connection"
@click="handleConnect(scope.row)" v-if="scope.row.isInit === 'Y'"
>同步资产结构</el-button> @click="handleStructure(scope.row)"
<el-button >同步资产结构</el-button>>
<el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@ -193,7 +194,15 @@
</template> </template>
<script> <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 { export default {
name: "Source", name: "Source",
@ -294,6 +303,7 @@ export default {
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 资产接入 测试连接 */
handleConnect(dataSource) { handleConnect(dataSource) {
testConnection(dataSource).then(res => { testConnection(dataSource).then(res => {
console.log(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() { handleAdd() {
this.reset(); this.reset();