fix:全局搜索 跳转 详细视图选中
This commit is contained in:
@@ -141,7 +141,14 @@ export default {
|
||||
})
|
||||
return item
|
||||
})
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.inputDateQuery = this.handlerTableData(this.tableData)
|
||||
this.pageObj.total = this.tableData.length
|
||||
if (!this.scrollbarWrap) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)">
|
||||
<el-popover
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
@mouseenter="labelHover(item, 'asset', true, $event)"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
@mouseenter="labelHover(item, 'dc', true, $event)"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
@mouseenter="labelHover(item, 'endpoint', true, $event)"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
@mouseenter="labelHover(item, 'module', true, $event)"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
v-for="(item,index) in tableData"
|
||||
:key="index"
|
||||
class="detail-row"
|
||||
:id="'globalSearch' + item.id"
|
||||
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
|
||||
@click="detailViewRightShow(item)"
|
||||
>
|
||||
|
||||
@@ -103,7 +103,14 @@ export default {
|
||||
response.data.list[i].status = response.data.list[i].status + ''
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) {
|
||||
|
||||
@@ -66,6 +66,22 @@ export default {
|
||||
this.$emit('orderDetail', this.orderBy, n)
|
||||
}
|
||||
}
|
||||
},
|
||||
tableData: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
if (n && n.length) {
|
||||
const id = this.$store.getters.getGlobalSearchId
|
||||
if (id) {
|
||||
setTimeout(() => {
|
||||
if (document.getElementById('globalSearch' + id)) {
|
||||
document.getElementById('globalSearch' + id).scrollIntoView(true)
|
||||
this.$store.commit('setGlobalSearchId', '')
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,14 @@ export default {
|
||||
item.receiverShow = temp
|
||||
})
|
||||
this.tableData = response.data.list
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap) {
|
||||
|
||||
@@ -713,7 +713,14 @@ export default {
|
||||
response.data.list[i].status = response.data.list[i].status + ''
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) {
|
||||
|
||||
@@ -184,7 +184,14 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.tableData = response.data.list
|
||||
this.nowTime = this.utcTimeToTimezoneStr(response.time)
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap) {
|
||||
|
||||
@@ -624,7 +624,14 @@ export default {
|
||||
})
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap) {
|
||||
|
||||
@@ -405,7 +405,14 @@ export default {
|
||||
response.data.list[i].status = response.data.list[i].status + ''
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.detailViewRightObj = this.tableData[0]
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
this.detailViewRightObj = detailViewRightObj
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
if (!this.scrollbarWrap) {
|
||||
|
||||
Reference in New Issue
Block a user