NEZ-2162 feat: 添加 保留打开底部弹窗的状态

This commit is contained in:
zhangyu
2022-09-05 15:35:32 +08:00
parent 3f3ce50513
commit c2ae213235
13 changed files with 110 additions and 18 deletions

View File

@@ -27,16 +27,79 @@ export default {
}, 200)
qv && this.$set(val.target, val.propertyName, qv)
})
if (q.bottomBox && JSON.parse(q.bottomBox)) {
this.$nextTick(() => {
this.detailType = q.detailType
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
this.$refs[detailType].bottomBox.showSubList = JSON.parse(q.bottomBox)
this.$refs[detailType].bottomBox.targetTab = q.targetTab
this.$refs[detailType].bottomBox.object = JSON.parse(q.selectObj)
})
} else if (this.detailType === 'view') {
this.detailType = q.detailType
this.detailViewRightObj = JSON.parse(q.selectObj)
this.$store.commit('setGlobalSearchId', this.detailViewRightObj.id)
}
},
// 更新path包含请求参数
updatePath (param, path) {
updatePath (param, path, from) {
const params = lodash.cloneDeep(param)
Object.keys(params).forEach(key => {
if (!params[key]) {
delete params[key]
}
})
this.$router.replace({ path: path, query: params }).catch(err => {})
if (!from) {
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
params.detailType = this.detailType
params.bottomBox = this.$refs[detailType].bottomBox.showSubList
if (this.detailType === 'list') {
params.targetTab = this.$refs[detailType].bottomBox.targetTab
} else {
params.targetTab = this.$route.query.targetTab
}
if (this.detailType === 'list') {
params.selectObj = JSON.stringify({
id: this.$refs[detailType].bottomBox.object.id,
name: this.$refs[detailType].bottomBox.object.name,
config: this.$refs[detailType].bottomBox.object.config || '',
childrenNum: this.$refs[detailType].bottomBox.object.childrenNum || ''
})
} else {
this.$nextTick(() => {
params.selectObj = JSON.stringify({
id: this.$refs[detailType].detailViewRightObj.id,
name: this.$refs[detailType].detailViewRightObj.name,
config: this.$refs[detailType].detailViewRightObj.config || '',
childrenNum: this.$refs[detailType].detailViewRightObj.childrenNum || ''
})
})
}
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'nzDatalist') {
params.bottomBox = this.bottomBox.showSubList
params.targetTab = this.bottomBox.targetTab
params.selectObj = JSON.stringify({
id: this.bottomBox.object.id,
name: this.bottomBox.object.name,
config: this.bottomBox.object.config || '',
childrenNum: this.bottomBox.object.childrenNum || ''
})
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'nzDetailList') {
params.targetTab = this.$route.query.targetTab
params.selectObj = JSON.stringify({
id: this.detailViewRightObj.id,
name: this.detailViewRightObj.name,
config: this.detailViewRightObj.config || '',
childrenNum: this.detailViewRightObj.childrenNum || ''
})
this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'bottomBox') {
params.targetTab = this.targetTab
this.$router.replace({ path: path, query: params }).catch(err => {})
}
},
setSearchInput (val, qv) {
let dataList = ''