fix:详情页面优化
This commit is contained in:
@@ -244,6 +244,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -151,6 +151,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -33,13 +33,13 @@
|
|||||||
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
||||||
</div>
|
</div>
|
||||||
<div :style="{ height: nzTableHeight }" class="nz-detail-view" :class="dataLength?'':'nz-detail-view-no-data'">
|
<div :style="{ height: nzTableHeight }" class="nz-detail-view" :class="dataLength?'':'nz-detail-view-no-data'">
|
||||||
<div class="nz-detail-view-left" v-if="dataLength">
|
<div class="nz-detail-view-left" v-show="dataLength">
|
||||||
<slot name="nz-detail-view-list"></slot>
|
<slot name="nz-detail-view-list"></slot>
|
||||||
<div v-if="showLayout.indexOf('pagination') > -1" class="nz-detail-view-pagination">
|
<div v-if="showLayout.indexOf('pagination') > -1" class="nz-detail-view-pagination">
|
||||||
<slot name="pagination"></slot>
|
<slot name="pagination"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="no-data">
|
<div v-if="!dataLength" class="no-data">
|
||||||
<svg class="icon" aria-hidden="true">
|
<svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#nz-icon-no-data-list"></use>
|
<use xlink:href="#nz-icon-no-data-list"></use>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
@@ -132,7 +135,7 @@ export default {
|
|||||||
this.detailViewRightObj = detailViewRightObj
|
this.detailViewRightObj = detailViewRightObj
|
||||||
this.pageObj.total = response.data.total
|
this.pageObj.total = response.data.total
|
||||||
this.pageObj.pages = response.data.pages
|
this.pageObj.pages = response.data.pages
|
||||||
if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) {
|
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
||||||
this.toTopBtnHandler(this.scrollbarWrap)
|
this.toTopBtnHandler(this.scrollbarWrap)
|
||||||
@@ -214,7 +217,9 @@ export default {
|
|||||||
},
|
},
|
||||||
dragend () {
|
dragend () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
if (this.$refs.dataTable) {
|
||||||
|
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
search (searchObj) {
|
search (searchObj) {
|
||||||
@@ -859,14 +864,16 @@ export default {
|
|||||||
if (pageSize && pageSize !== 'undefined') {
|
if (pageSize && pageSize !== 'undefined') {
|
||||||
this.pageObj.pageSize = pageSize
|
this.pageObj.pageSize = pageSize
|
||||||
}
|
}
|
||||||
|
console.log(this.$refs.dataTable, this.$refs.dataDetail)
|
||||||
|
const tableTitle = this.$refs.dataTable ? this.$refs.dataTable.tableTitle : this.$refs.dataDetail.tableTitle
|
||||||
let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
|
let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
|
||||||
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle
|
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : tableTitle
|
||||||
this.tools.customTableTitle = this.$refs.dataTable.tableTitle.map((item, index) => { // 修复切换中英文的问题
|
this.tools.customTableTitle = tableTitle.map((item, index) => { // 修复切换中英文的问题
|
||||||
item.show = localStorageTableTitle[index].show
|
item.show = localStorageTableTitle[index].show
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
if (localStorageTableTitle && (localStorageTableTitle.length > this.$refs.dataTable.tableTitle.length)) {
|
if (localStorageTableTitle && (localStorageTableTitle.length > tableTitle.length)) {
|
||||||
const arr = localStorageTableTitle.splice(this.$refs.dataTable.tableTitle.length, localStorageTableTitle.length)
|
const arr = localStorageTableTitle.splice(tableTitle.length, localStorageTableTitle.length)
|
||||||
arr.forEach(item => {
|
arr.forEach(item => {
|
||||||
item.minWidth = item.label.length * 16 + 20
|
item.minWidth = item.label.length * 16 + 20
|
||||||
})
|
})
|
||||||
@@ -875,7 +882,9 @@ export default {
|
|||||||
if (!this.fromBottom) {
|
if (!this.fromBottom) {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
if (this.$refs.dataTable) {
|
||||||
|
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export default {
|
|||||||
props: {},
|
props: {},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
detailType: 'list',
|
detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list',
|
||||||
detailViewRightObj: '',
|
detailViewRightObj: '',
|
||||||
detailViewLoading: false,
|
detailViewLoading: false,
|
||||||
detailTimer: ''
|
detailTimer: ''
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
if (this.detailType === flag) {
|
if (this.detailType === flag) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$refs.dataList.bottomBox.showSubList = false
|
// this.$refs.dataList.bottomBox.showSubList = false
|
||||||
if (this.orderBy) {
|
if (this.orderBy) {
|
||||||
this.detailViewRightObj = ''
|
this.detailViewRightObj = ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -287,6 +287,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
</nzDetailView>
|
</nzDetailView>
|
||||||
<nz-data-list
|
<nz-data-list
|
||||||
v-loading="detailViewLoading"
|
v-loading="detailViewLoading"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
@@ -612,8 +612,9 @@ export default {
|
|||||||
resolve(data)
|
resolve(data)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const title = this.tools.customTableTitle
|
const title = this.tools.customTableTitle
|
||||||
const originalTitle = title.slice(0, this.$refs.dataTable.tableTitle.length) // 原title
|
const tableTitle = this.$refs.dataTable ? this.$refs.dataTable.tableTitle : this.$refs.dataDetail.tableTitle
|
||||||
const oldLabelTitle = title.slice(this.$refs.dataTable.tableTitle.length, title.length) // 旧labelTitle
|
const originalTitle = title.slice(0, tableTitle.length) // 原title
|
||||||
|
const oldLabelTitle = title.slice(tableTitle.length, title.length) // 旧labelTitle
|
||||||
|
|
||||||
const newLabel = showData.filter(item => { return !oldLabelTitle.find(t => { return item.label === t.label }) })
|
const newLabel = showData.filter(item => { return !oldLabelTitle.find(t => { return item.label === t.label }) })
|
||||||
const keepLabel = oldLabelTitle.filter(item => showData.find(t => item.label === t.label))
|
const keepLabel = oldLabelTitle.filter(item => showData.find(t => item.label === t.label))
|
||||||
@@ -718,6 +719,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
@@ -745,7 +749,7 @@ export default {
|
|||||||
this.detailViewRightObj = detailViewRightObj
|
this.detailViewRightObj = detailViewRightObj
|
||||||
this.pageObj.total = response.data.total
|
this.pageObj.total = response.data.total
|
||||||
this.pageObj.pages = response.data.pages
|
this.pageObj.pages = response.data.pages
|
||||||
if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) {
|
if (!this.scrollbarWrap && this.$refs.dataTable&& this.$refs.dataTable.$refs.dataTable) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
||||||
this.toTopBtnHandler(this.scrollbarWrap)
|
this.toTopBtnHandler(this.scrollbarWrap)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<nz-data-list
|
<nz-data-list
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
:from="fromRoute.dc"
|
:from="fromRoute.dc"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<nz-data-list
|
<nz-data-list
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
:from="fromRoute.terminalLog"
|
:from="fromRoute.terminalLog"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<nz-data-list
|
<nz-data-list
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
:from="fromRoute.user"
|
:from="fromRoute.user"
|
||||||
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<nz-data-list
|
<nz-data-list
|
||||||
v-loading="detailViewLoading"
|
v-loading="detailViewLoading"
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
:api="url"
|
:api="url"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
:from="fromRoute.endpoint"
|
:from="fromRoute.endpoint"
|
||||||
@@ -628,6 +628,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
:tableId="tableId"
|
:tableId="tableId"
|
||||||
v-show="detailType === 'list'"
|
v-if="detailType === 'list'"
|
||||||
:custom-table-title.sync="tools.customTableTitle"
|
:custom-table-title.sync="tools.customTableTitle"
|
||||||
:from="fromRoute.module"
|
:from="fromRoute.module"
|
||||||
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
||||||
@@ -409,6 +409,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
@@ -147,6 +147,9 @@ export default {
|
|||||||
if (this.needAlertDaysData) {
|
if (this.needAlertDaysData) {
|
||||||
response.data.list.forEach(item => {
|
response.data.list.forEach(item => {
|
||||||
item.trendLoading = true
|
item.trendLoading = true
|
||||||
|
item.left= 0
|
||||||
|
item.top= 0
|
||||||
|
item.alertNumtooltipShow= false
|
||||||
item.alertDaysData = [
|
item.alertDaysData = [
|
||||||
{
|
{
|
||||||
metric: { priority: 'P1' },
|
metric: { priority: 'P1' },
|
||||||
|
|||||||
Reference in New Issue
Block a user