feat: 优化仪表盘页面loading

This commit is contained in:
wangjiahao 2021-06-04 12:33:08 +08:00
parent 3fd5e678d6
commit fccd7d8f29
2 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,6 @@ export function showTemplateList(data) {
return request({ return request({
url: '/template/templateList', url: '/template/templateList',
data: data, data: data,
loading: true,
method: 'post' method: 'post'
}) })
} }
@ -26,7 +25,6 @@ export function showTemplateList(data) {
export function findOne(id) { export function findOne(id) {
return request({ return request({
url: '/template/findOne/' + id, url: '/template/findOne/' + id,
loading: true,
method: 'get' method: 'get'
}) })
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]"> <el-row v-loading="loading">
<el-row v-if="editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'"> <el-row v-if="editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'">
<el-col :span="18" style="height: 40px"> <el-col :span="18" style="height: 40px">
<el-radio v-model="inputType" label="self"> {{ $t('panel.custom') }}</el-radio> <el-radio v-model="inputType" label="self"> {{ $t('panel.custom') }}</el-radio>
@ -46,6 +46,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
inputType: 'self', inputType: 'self',
fieldName: 'name', fieldName: 'name',
tableRadio: null, tableRadio: null,
@ -92,8 +93,10 @@ export default {
level: '-1', level: '-1',
withChildren: true withChildren: true
} }
this.loading = true
showTemplateList(request).then(res => { showTemplateList(request).then(res => {
this.templateList = res.data this.templateList = res.data
this.loading = false
}) })
}, },
handleExceed(file) { handleExceed(file) {