View reload

This commit is contained in:
devezhao 2019-05-07 13:51:37 +08:00
parent 9b6b67449f
commit 4cdf09bd90
2 changed files with 10 additions and 8 deletions

View file

@ -249,7 +249,7 @@ class RbForm extends React.Component {
static postAfter(data, notReload) {
let rlp = window.RbListPage || parent.RbListPage
if (rlp) rlp._RbList.reload()
if (window.RbViewPage && notReload !== true) location.reload()
if (window.RbViewPage && notReload !== true) window.RbViewPage.reload()
}
}

View file

@ -50,7 +50,7 @@ class RbViewForm extends React.Component {
$.get(`${rb.baseUrl}/app/entity/record-lastModified?id=${this.state.id}`, (res) => {
if (res.error_code === 0) {
if (res.data.lastModified !== this.__lastModified) {
handle.showLoading()
handle && handle.showLoading()
setTimeout(() => { location.reload() }, window.VIEW_LOAD_DELAY || 200)
}
} else if (res.error_msg === 'NO_EXISTS') {
@ -123,12 +123,8 @@ const RbViewPage = {
that.__cleanButton()
}
$('.J_close').click(() => {
if (parent && parent.rb.RbViewModalGet(id)) parent.rb.RbViewModalGet(id).hide()
})
$('.J_reload').click(() => {
location.reload()
})
$('.J_close').click(() => { this.hide() })
$('.J_reload').click(() => { this.reload() })
},
initRecordMeta() {
@ -282,6 +278,12 @@ const RbViewPage = {
if (parent.RbListPage) parent.RbListPage._RbList.reload()
else setTimeout(function () { parent.location.reload() }, 1000)
}
},
//
reload() {
if (parent && parent.rb.RbViewModalGet(this.__id)) parent.rb.RbViewModalGet(this.__id).showLoading()
setTimeout(() => { location.reload() }, 20)
}
}