fix: 列表no data样式展示异常问题

This commit is contained in:
@changcode
2021-10-22 19:39:49 +08:00
parent fa2da5a3c1
commit 2351baa8f3
37 changed files with 97 additions and 56 deletions

View File

@@ -263,12 +263,13 @@
</div>
</draggable>
<!-- <el-row v-if="dataList.length === 0" class="noData"></el-row>-->
<div v-if="dataList.length === 0" class="no-data">
<div v-if="panelLoading" class="no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-panel"></use>
</svg>
<div class="no-data-div">No data</div>
</div>
<div v-else>&nbsp;</div>
<!--<div class="page-shadow" v-if="showShadow"></div>-->
</div>
</template>
@@ -303,7 +304,7 @@ export default {
obj: Object,
panelLock: { type: Boolean, default: false },
hasGroup: { type: Boolean, default: true },
panelDataList: Array
panelDataList: Array,
},
components: {
@@ -332,6 +333,7 @@ export default {
start: '',
end: ''
},
panelLoading: false,
extraMarginBottom: 0, // dom额外的margin
panelId: '',
timer: null,
@@ -715,12 +717,13 @@ export default {
item.isLoaded = false
})
// chart数据存在dataTotalListBak中
if (response.data.list) {
if (response.data.list.length > 0) {
this.dataTotalListBak = response.data.list
this.panelLoading = false
} else {
this.dataTotalListBak = response.data
this.panelLoading = true
}
let chartListTmp = []
// 查询条件带name
if (this.filter.searchName) {

View File

@@ -24,6 +24,7 @@
<alertMessageTable
ref="dataTable"
:api="url"
:loading="tools.loading"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"
:now-time="nowTime"

View File

@@ -17,6 +17,7 @@
ref="dataTable"
:api="url"
v-loading="tools.loading"
:loading="tools.loading"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"
:table-data="tableData"

View File

@@ -17,6 +17,7 @@
ref="dataTable"
:api="url"
v-loading="tools.loading"
:loading="tools.loading"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"
:table-data="tableData"

View File

@@ -17,6 +17,7 @@
<cabinet-table
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"

View File

@@ -52,6 +52,7 @@
:data="tableData"
border
v-loading="tools.loading"
:loading="tools.loading"
class="nz-table endpoint-table"
:height="$tableHeight.noPagination"
:cell-class-name="messageStyle"

View File

@@ -17,6 +17,7 @@
<endpoint-table
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"

View File

@@ -14,6 +14,7 @@
<operation-log-table
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"

View File

@@ -14,6 +14,7 @@
<terminal-log-table
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="subTableHeight"

View File

@@ -27,6 +27,10 @@
<div class="detail-row-info">
<div class="asset-manageIp">
<span class="flex-align-center">
<span v-if="item.status" >
<span :class="{'active-icon green-bg':item.status == 1,'active-icon gray-bg':item.status == 0}"></span>
</span>
<span v-else style="display: inline-block;width: 13px"></span>
<span class="user-name-top">{{item.name}}</span>
<el-tag size="mini" v-if="mfaEnable == '1' || item.mfaLevel > 0" style="margin-left: 5px">2FA</el-tag>
</span>

View File

@@ -16,6 +16,7 @@
<asset-table
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tableTitle"
:height="mainTableHeight"

View File

@@ -17,6 +17,7 @@
style="height: calc(100% - 200px)"
ref="dataTable"
v-loading="tools.loading"
:loading="tools.loading"
:api="url"
:custom-table-title="tableTitle"
:height="mainTableHeight"

View File

@@ -125,13 +125,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -104,7 +104,7 @@
{{ $t('overall.enabled') }}
</div>
<div slot="reference" v-else-if="scope.row[item.prop] === 0">
<div class="active-icon red-bg inline-block"></div>
<div class="active-icon gray-bg inline-block"></div>
{{ $t('overall.disabled') }}
</div>
</el-popover>
@@ -133,13 +133,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -102,13 +102,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -81,13 +81,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -132,13 +132,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -69,13 +69,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -83,13 +83,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -50,13 +50,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -64,13 +64,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -83,13 +83,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -46,7 +46,7 @@
{{ $t('overall.enabled') }}
</div>
<div v-else-if="scope.row[item.prop] === 'OFF'">
<div class="active-icon red-bg inline-block"></div>
<div class="active-icon gray-bg inline-block"></div>
{{ $t('overall.disabled') }}
</div>
</template>
@@ -99,15 +99,15 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -184,13 +184,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -56,13 +56,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -72,13 +72,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -89,13 +89,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -76,13 +76,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -81,13 +81,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -45,13 +45,14 @@
<span v-else>-</span>
</template>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -80,13 +80,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -64,13 +64,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -103,13 +103,14 @@
</template>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -54,12 +54,12 @@
</template>
</template>
<template v-else-if="item.prop === 'status'">
<div v-if="scope.row[item.prop] === 1">
<div v-if="scope.row[item.prop] == 1">
<div class="active-icon green-bg inline-block"></div>
{{ $t('overall.enabled') }}
</div>
<div v-else-if="scope.row[item.prop] === 0">
<div class="active-icon red-bg inline-block"></div>
<div v-else-if="scope.row[item.prop] == 0">
<div class="active-icon gray-bg inline-block"></div>
{{ $t('overall.disabled') }}
</div>
</template>
@@ -93,13 +93,14 @@
</el-dropdown>
</div>
</el-table-column>
<template v-if="!loading" slot="empty">
<div class="right-no-data">
<template slot="empty">
<div v-if="!loading" class="right-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div style="font-size: 16px;color: #333333;font-weight: 400;">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>

View File

@@ -44,6 +44,7 @@
ref="dataDetail"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:detailViewRightObj="detailViewRightObj"
:api="url"
:table-data="tableData"

View File

@@ -25,6 +25,7 @@
ref="dataDetail"
:orderByFa="orderBy"
v-loading="tools.loading"
:loading="tools.loading"
:detailViewRightObj="detailViewRightObj"
:api="url"
:table-data="tableData"

View File

@@ -566,6 +566,7 @@ export default {
this.$store.state.showPanel.id = 0
this.$store.state.showPanel.name = ''
this.$store.state.showPanel.type = 'dashboard'
} else {
if (response.msg) {
this.$message.error(response.msg)