提交 fccd7d8f authored 作者: wangjiahao's avatar wangjiahao

feat: 优化仪表盘页面loading

上级 3fd5e678
...@@ -18,7 +18,6 @@ export function showTemplateList(data) { ...@@ -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) { ...@@ -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'
}) })
} }
......
<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 { ...@@ -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 { ...@@ -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) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论