fix:修改表格loading bug

This commit is contained in:
zhangyu
2021-05-19 11:32:41 +08:00
parent fd77ced048
commit 8f530c6c0f
11 changed files with 10 additions and 14 deletions

View File

@@ -9,6 +9,7 @@
:targetTab="targetTab" :targetTab="targetTab"
@changeTab="changeTab" @changeTab="changeTab"
class="full-width-height" class="full-width-height"
v-loading="tools.loading"
> >
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template> <template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-slot:top-tool-right> <template v-slot:top-tool-right>
@@ -19,7 +20,6 @@
<template v-slot> <template v-slot>
<alertMessageTable <alertMessageTable
ref="dataTable" ref="dataTable"
v-loading="tools.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="mainTableHeight" :height="mainTableHeight"

View File

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

View File

@@ -14,6 +14,7 @@
<template v-slot> <template v-slot>
<cabinet-table <cabinet-table
ref="dataTable" ref="dataTable"
v-loading="tools.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="mainTableHeight" :height="mainTableHeight"

View File

@@ -320,6 +320,7 @@ export default {
this.$set(this.endpointSearchLabel, 'moduleIds', this.module.id) this.$set(this.endpointSearchLabel, 'moduleIds', this.module.id)
} }
this.$set(this.endpointSearchLabel, 'pageSize', '-1') this.$set(this.endpointSearchLabel, 'pageSize', '-1')
this.tools.loading = true
this.$get('monitor/endpoint', this.endpointSearchLabel).then(response => { this.$get('monitor/endpoint', this.endpointSearchLabel).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {

View File

@@ -16,7 +16,7 @@ export default {
}, },
/* 工具参数 */ /* 工具参数 */
tools: { tools: {
loading: false, // 是否显示table加载动画 loading: true, // 是否显示table加载动画
customTableTitle: [], // 自定义列工具的数据 customTableTitle: [], // 自定义列工具的数据
extraTableTitle: [] // 特殊页面asset额外的列 extraTableTitle: [] // 特殊页面asset额外的列
}, },

View File

@@ -1,15 +1,6 @@
<template> <template>
<div class="mc" @click.self="clickOutside"> <div class="mc" @click.self="clickOutside">
<div class="right-box right-box-project-alert"> <div class="right-box right-box-project-alert">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns">
<!--<button id="edit-ep-del" type="button" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien nz-btn-style-light ">-->
<!--<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span>-->
<!--<span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span>-->
<!--</button>-->
</div>
<!-- end--顶部按钮-->
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box-title">Alert messages</div> <div class="right-box-title">Alert messages</div>
<!-- end--标题--> <!-- end--标题-->

View File

@@ -11,6 +11,7 @@
:layout="['searchInput', 'elementSet']" :layout="['searchInput', 'elementSet']"
:search-msg="searchMsg" :search-msg="searchMsg"
@search="search" @search="search"
v-loading="tools.loading"
> >
<template v-slot:top-tool-right> <template v-slot:top-tool-right>
<el-select v-model="state" class="margin-r-10" size="small" value-key="value" @change="getTableData"> <el-select v-model="state" class="margin-r-10" size="small" value-key="value" @change="getTableData">
@@ -26,7 +27,6 @@
<template v-slot:default="slotProps"> <template v-slot:default="slotProps">
<alert-message-table <alert-message-table
ref="dataTable" ref="dataTable"
v-loading="tools.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="mainTableHeight" :height="mainTableHeight"

View File

@@ -97,6 +97,7 @@ export const parentTableCommon = {
methods: { methods: {
getTableData: function () { getTableData: function () {
this.searchLabel.pageSize = -1 this.searchLabel.pageSize = -1
this.tools.loading = true
this.$get(this.url, this.searchLabel).then(response => { this.$get(this.url, this.searchLabel).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {

View File

@@ -106,6 +106,7 @@ export default {
pageNo: this.pageObj.pageNo, pageNo: this.pageObj.pageNo,
pageSize: this.pageObj.pageSize pageSize: this.pageObj.pageSize
} }
this.tools.loading = true
this.$get(this.url, params).then(response => { this.$get(this.url, params).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {

View File

@@ -47,7 +47,7 @@
<template v-slot:default="slotProps"> <template v-slot:default="slotProps">
<endpoint-table <endpoint-table
ref="dataTable" ref="dataTable"
:loading="tools.loading" v-loading="tools.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="dataListLayout.indexOf('clickSearch') > -1 ? endpointTableHeight : mainTableHeight" :height="dataListLayout.indexOf('clickSearch') > -1 ? endpointTableHeight : mainTableHeight"

View File

@@ -1 +1 @@
{"baseUrl":"http://192.168.40.42:8080/nz-admin/", "version": "2.0.2021.05.11.19.43"} {"baseUrl":"/", "version": "2.0.2021.05.11.19.43"}