fix:地址栏参数优化

This commit is contained in:
zyh
2022-11-29 14:23:42 +08:00
parent c0791905c9
commit c99ca6cb1c
3 changed files with 32 additions and 23 deletions

View File

@@ -602,7 +602,7 @@ export default {
for (let index = 0; index < arr.length; index++) { // 遍历找出所有需要 repeat的group 按照 name进行多次的分组 for (let index = 0; index < arr.length; index++) { // 遍历找出所有需要 repeat的group 按照 name进行多次的分组
const item = arr[index] const item = arr[index]
const repeatVariable = this.$loadsh.get(item.param.repeat, 'variable') const repeatVariable = this.$loadsh.get(item.param.repeat, 'variable')
if (item.type === 'group' && repeatVariable) { if (item.type === 'group' && repeatVariable && this.$loadsh.get(this.showHidden[item.id], 'visibility') !== 'hidden') {
const itemPrev = arr[index - 1] const itemPrev = arr[index - 1]
const repeatPrevVariable = this.$loadsh.get(itemPrev.param.repeat, 'variable') const repeatPrevVariable = this.$loadsh.get(itemPrev.param.repeat, 'variable')
if (itemPrev && itemPrev.type === 'group' && repeatPrevVariable === repeatVariable) { if (itemPrev && itemPrev.type === 'group' && repeatPrevVariable === repeatVariable) {

View File

@@ -33,7 +33,9 @@ export default {
changeDetailType (flag) { changeDetailType (flag) {
setTimeout(() => { setTimeout(() => {
const query = { ...this.$route.query, detailType: flag } const query = { ...this.$route.query, detailType: flag }
query.bottomBox = this.detailType !== 'view' if (this.detailType == 'view') {
delete query.bottomBox
}
this.$router.replace({ query: query }).catch(err => {}) this.$router.replace({ query: query }).catch(err => {})
}, 100) }, 100)
if (this.detailType === flag) { if (this.detailType === flag) {

View File

@@ -62,6 +62,7 @@ export default {
params.targetTab = this.$route.query.targetTab params.targetTab = this.$route.query.targetTab
} }
if (!params.targetTab) delete params.targetTab if (!params.targetTab) delete params.targetTab
if (!params.bottomBox) delete params.bottomBox
if (this.detailType === 'list' && this.$refs[detailType]) { if (this.detailType === 'list' && this.$refs[detailType]) {
const obj = { const obj = {
id: this.$refs[detailType].bottomBox.object.id, id: this.$refs[detailType].bottomBox.object.id,
@@ -119,29 +120,35 @@ export default {
} else if (from === 'nzDatalist' && this.bottomBox) { } else if (from === 'nzDatalist' && this.bottomBox) {
params.bottomBox = this.bottomBox.showSubList params.bottomBox = this.bottomBox.showSubList
params.targetTab = this.bottomBox.targetTab params.targetTab = this.bottomBox.targetTab
const obj = { if (!params.targetTab) delete params.targetTab
id: this.bottomBox.object.id, if (!params.bottomBox) delete params.bottomBox
name: this.bottomBox.object.name, if (this.bottomBox.showSubList) { // 关闭bottomBox打开还是关闭
childrenNum: this.bottomBox.object.childrenNum || '', const obj = {
clientState: this.bottomBox.object.clientState || '', id: this.bottomBox.object.id,
protocol: this.bottomBox.object.protocol || '', name: this.bottomBox.object.name,
uuid: this.bottomBox.object.uuid || '', childrenNum: this.bottomBox.object.childrenNum || '',
startTime: this.bottomBox.object.startTime || '', clientState: this.bottomBox.object.clientState || '',
model: { protocol: this.bottomBox.object.protocol || '',
tsgAppliance: this.bottomBox.object.model ? this.bottomBox.object.model.tsgAppliance : '' uuid: this.bottomBox.object.uuid || '',
startTime: this.bottomBox.object.startTime || '',
model: {
tsgAppliance: this.bottomBox.object.model ? this.bottomBox.object.model.tsgAppliance : ''
}
} }
} if (this.bottomBox.object.configs) {
if (this.bottomBox.object.configs) { // 判断是JSON字符串还是对象
// 判断是JSON字符串还是对象 if (typeof (this.bottomBox.object.configs) == 'string') {
if (typeof (this.bottomBox.object.configs) == 'string') { obj.configs = JSON.parse(this.bottomBox.object.configs).map(item => { return { type: item.type, enable: item.enable } })
obj.configs = JSON.parse(this.bottomBox.object.configs).map(item => { return { type: item.type, enable: item.enable } }) } else {
} else { obj.configs = this.bottomBox.object.configs.map(item => { return { type: item.type, enable: item.enable } })
obj.configs = this.bottomBox.object.configs.map(item => { return { type: item.type, enable: item.enable } }) }
} }
} this.removeEmpty(obj)
this.removeEmpty(obj) if (JSON.stringify(obj) != '{}') {
if (JSON.stringify(obj) != '{}') { params.selectObj = JSON.stringify(obj)
params.selectObj = JSON.stringify(obj) }
} else {
delete params.selectObj
} }
this.$router.replace({ path: path, query: params }).catch(err => {}) this.$router.replace({ path: path, query: params }).catch(err => {})
} else if (from === 'nzDetailList' && this.detailViewRightObj) { } else if (from === 'nzDetailList' && this.detailViewRightObj) {