提交 0f2f3983 authored 作者: wangjiahao's avatar wangjiahao

feat: 优化仪表盘页面loading

上级 df0d2a9b
...@@ -30,7 +30,6 @@ export function querySubjectWithGroup(data) { ...@@ -30,7 +30,6 @@ export function querySubjectWithGroup(data) {
return request({ return request({
url: '/panel/subject/querySubjectWithGroup', url: '/panel/subject/querySubjectWithGroup',
method: 'post', method: 'post',
loading: true,
data data
}) })
} }
......
...@@ -4,7 +4,6 @@ export function tree(data) { ...@@ -4,7 +4,6 @@ export function tree(data) {
return request({ return request({
url: '/api/panelView/tree', url: '/api/panelView/tree',
method: 'post', method: 'post',
loading: true,
data data
}) })
} }
......
<template> <template>
<el-row> <el-row>
<el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]"> <el-row v-loading="slidersLoading">
<el-col :span="2"> <el-col :span="2">
<span>&nbsp;</span> <span>&nbsp;</span>
<ul class="direction"> <ul class="direction">
...@@ -100,6 +100,7 @@ export default { ...@@ -100,6 +100,7 @@ export default {
data() { data() {
return { return {
sliders: [], sliders: [],
slidersLoading: false,
sliderWidth: 240, sliderWidth: 240,
imgWidth: 240, imgWidth: 240,
currentIndex: 1, currentIndex: 1,
...@@ -150,8 +151,10 @@ export default { ...@@ -150,8 +151,10 @@ export default {
}) })
}, },
querySubjectWithGroup() { querySubjectWithGroup() {
this.slidersLoading = true
querySubjectWithGroup({}).then(response => { querySubjectWithGroup({}).then(response => {
this.sliders = response.data this.sliders = response.data
this.slidersLoading = false
}) })
}, },
move(offset, direction, speed) { move(offset, direction, speed) {
......
<template> <template>
<el-col> <el-col v-loading="loading">
<el-row style="margin-top: 5px"> <el-row style="margin-top: 5px">
<el-row style="margin-left: 5px;margin-right: 5px"> <el-row style="margin-left: 5px;margin-right: 5px">
<el-input <el-input
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
</span> </span>
</el-tree> </el-tree>
</el-row> </el-row>
<!-- <el-row v-if="detailItem&&detailItem.snapshot" class="detail-class">--> <!-- <el-row v-if="detailItem&&detailItem.snapshot" class="detail-class">-->
<!-- <el-card class="filter-card-class">--> <!-- <el-card class="filter-card-class">-->
<!-- <div slot="header" class="button-div-class">--> <!-- <div slot="header" class="button-div-class">-->
<!-- <span>{{ detailItem.name }}</span>--> <!-- <span>{{ detailItem.name }}</span>-->
<!-- </div>--> <!-- </div>-->
<!-- <img draggable="false" class="view-list-thumbnails" :src="detailItem.snapshot" alt="">--> <!-- <img draggable="false" class="view-list-thumbnails" :src="detailItem.snapshot" alt="">-->
<!-- </el-card>--> <!-- </el-card>-->
<!-- </el-row>--> <!-- </el-row>-->
</el-row> </el-row>
</el-col> </el-col>
</template> </template>
...@@ -68,7 +68,8 @@ export default { ...@@ -68,7 +68,8 @@ export default {
}, },
data: [], data: [],
showdetail: false, showdetail: false,
detailItem: null detailItem: null,
loading: false
} }
}, },
watch: { watch: {
...@@ -91,8 +92,10 @@ export default { ...@@ -91,8 +92,10 @@ export default {
}, },
loadData() { loadData() {
const param = {} const param = {}
this.loading = true
tree(param).then(res => { tree(param).then(res => {
this.data = res.data this.data = res.data
this.loading = false
}) })
}, },
handleDragStart(node, ev) { handleDragStart(node, ev) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论