mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-09-13 01:57:29 +08:00
feat(图表): 复制图表后直接添加到仪表盘
使用add_widget方法直接添加到仪表盘
This commit is contained in:
parent
36b1b9d0ae
commit
d06042437f
1 changed files with 12 additions and 3 deletions
|
@ -148,11 +148,20 @@ class BaseChart extends React.Component {
|
|||
$.post(`${rb.baseUrl}/dashboard/chart-copy?id=${that.props.id}`, (res) => {
|
||||
if (res.error_code === 0) {
|
||||
RbHighbar.success($L('图表已复制'))
|
||||
setTimeout(() => location.reload(), 1500)
|
||||
} else {
|
||||
if (window.add_widget) {
|
||||
window.add_widget({
|
||||
chart: res.data,
|
||||
w: 4,
|
||||
h: 4,
|
||||
isManageable: true
|
||||
})
|
||||
window.save_dashboard()
|
||||
setTimeout(() => location.reload(), 1000)
|
||||
} else {
|
||||
RbHighbar.error(res.error_msg || $L('操作失败'))
|
||||
}
|
||||
this.disabled(false)
|
||||
}
|
||||
this.disabled(false)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue