NEZ-1631 fix:列表页面 默认排序字段 初始化状态修复

This commit is contained in:
zhangyu
2022-03-04 13:59:25 +08:00
parent 5e8964932f
commit be959ad26b
37 changed files with 54 additions and 13 deletions

View File

@@ -15,9 +15,6 @@ export default {
browserWindowZoom
},
async created () {
if (window.outerWidth <= 1024) { // outerWidth 获取设备宽度
document.querySelector('meta[name=viewport]').setAttribute('content', `width=device-width, initial-scale=${window.outerWidth / (1024 * window.devicePixelRatio)}, maximum-scale=1.0, user-scalable=0`)
}
const herfSpiltArr = window.location.href.split('/')
if (herfSpiltArr[3] !== '#') {
herfSpiltArr[3] = '#'
@@ -28,6 +25,7 @@ export default {
const result = await this.$http.get(url)
this.$axios.defaults.baseURL = result.body.baseUrl
const version = result.body.version
const defaultWindowWidth = result.body.width || 1024
if (version !== localStorage.getItem('nz-version')) {
localStorage.clear()
localStorage.clear()
@@ -35,6 +33,9 @@ export default {
herfSpiltArr[2] = herfSpiltArr[2] + '?t=' + new Date().getTime()
window.location.href = herfSpiltArr[0] + '//' + herfSpiltArr[2]
}
if (window.outerWidth <= defaultWindowWidth) { // outerWidth 获取设备宽度
document.querySelector('meta[name=viewport]').setAttribute('content', `width=device-width, initial-scale=${window.outerWidth / (defaultWindowWidth * window.devicePixelRatio)}, maximum-scale=1.0, user-scalable=0`)
}
}
}
</script>

View File

@@ -337,6 +337,10 @@ export default {
},
created () {
const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
if (this.$route.query.orderBy) {
this.orderBy = this.$route.query.orderBy
console.log('asdasdadsadsa')
}
let searchKeys = {}
if (path === 'dc') {
searchKeys = {

View File

@@ -26,7 +26,7 @@ export default {
data () {
return {
operationWidth: '165', // 操作列宽
orderBy: {},
orderBy: null,
severityDataWeight: this.$store.getters.severityDataWeight
}
},
@@ -131,10 +131,12 @@ export default {
if (n) {
const index = n.indexOf('-')
if (index !== -1) {
this.orderBy[n.slice(index + 1)] = 'descending'
this.orderBy = { prop: n.slice(index + 1), order: 'descending' }
} else {
this.orderBy[n] = 'descending'
this.orderBy = { prop: n, order: 'ascending' }
}
// this.orderBy = JSON.parse(JSON.stringify(this.orderBy))
console.log(n, this.orderBy)
}
}
},

View File

@@ -8,6 +8,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -6,6 +6,7 @@
:height="height"
tooltip-effect="light"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
class="no-operation"
@header-dragend="dragend"
@sort-change="tableDataSort"

View File

@@ -6,6 +6,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -5,6 +5,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -6,6 +6,7 @@
:data="tableData"
:height="height"
border
:default-sort="orderBy"
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"

View File

@@ -31,6 +31,7 @@
<template v-slot:default="slotProps">
<alert-message-table
ref="dataTable"
:orderByFa="orderBy"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"

View File

@@ -109,6 +109,7 @@
<template v-slot:default="slotProps">
<alert-rule-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -19,6 +19,7 @@
<template v-slot:default="slotProps">
<alert-silence-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -739,6 +739,7 @@ export default {
})
}
this.tableData = response.data.list
console.log(this.$refs.dataTable.$refs.dataTable)
const globalSearchId = this.$store.getters.getGlobalSearchId
let detailViewRightObj = ''
if (globalSearchId) {

View File

@@ -22,6 +22,7 @@
<template v-slot:default="slotProps">
<agent-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -40,6 +40,7 @@
<template v-slot:default="slotProps">
<asset-meta-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -19,6 +19,7 @@
<template v-slot="slotProps">
<asset-type-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -115,6 +115,7 @@
<template v-slot:default="slotProps">
<dc-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -41,6 +41,7 @@
<template v-slot="slotProps">
<model-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -11,6 +11,7 @@
<template v-slot:default="slotProps">
<operation-log-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -19,6 +19,7 @@
<template v-slot:default="slotProps">
<role-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -46,6 +46,7 @@
<template v-slot="slotProps">
<chartTmplTable
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -38,6 +38,7 @@
<template v-slot:default="slotProps">
<expr-tmpl-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -67,6 +67,7 @@
<template v-slot:default="slotProps">
<terminal-log-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -73,6 +73,7 @@
<template v-slot="slotProps">
<user-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"

View File

@@ -127,6 +127,7 @@
<endpoint-table
ref="dataTable"
v-loading="tools.loading"
:orderByFa="orderBy"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"

View File

@@ -112,6 +112,7 @@
<module-table
ref="dataTable"
v-loading="tools.loading"
:orderByFa="orderBy"
:loading="tools.loading"
:api="url"
:tableId="tableId"

View File

@@ -20,6 +20,7 @@
<template v-slot="slotProps">
<project-table
ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"