fix:添加loading
This commit is contained in:
parent
5347812bc3
commit
ab4be9ad69
@ -35,7 +35,24 @@ const usePermissionStore = defineStore(
|
|||||||
generateRoutes(roles) {
|
generateRoutes(roles) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 向后端请求路由数据
|
// 向后端请求路由数据
|
||||||
getRouters().then(res => {
|
getRouters().then(r => {
|
||||||
|
const res = r
|
||||||
|
// 查找 Tc 菜单项目
|
||||||
|
// const tcMenu = res.data.find(item => item.name === 'Tc')
|
||||||
|
// if (tcMenu && tcMenu.children) {
|
||||||
|
// tcMenu.children.forEach((child) => {
|
||||||
|
// switch (child.name) {
|
||||||
|
// case 'EventAnalysisReport/detail':
|
||||||
|
// child.meta = { ...child.meta, activeMenu: '/tc/eventAnalysisReport/index' }
|
||||||
|
// break
|
||||||
|
// case 'VideoScript/detail':
|
||||||
|
// child.meta = { ...child.meta, activeMenu: '/tc/videoScript/index' }
|
||||||
|
// break
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// console.log('res', res.data)
|
||||||
|
|
||||||
const sdata = JSON.parse(JSON.stringify(res.data))
|
const sdata = JSON.parse(JSON.stringify(res.data))
|
||||||
const rdata = JSON.parse(JSON.stringify(res.data))
|
const rdata = JSON.parse(JSON.stringify(res.data))
|
||||||
const defaultData = JSON.parse(JSON.stringify(res.data))
|
const defaultData = JSON.parse(JSON.stringify(res.data))
|
||||||
|
|||||||
@ -111,7 +111,7 @@ service.interceptors.response.use(res => {
|
|||||||
console.log('err' + error)
|
console.log('err' + error)
|
||||||
let { message } = error
|
let { message } = error
|
||||||
if (message == "Network Error") {
|
if (message == "Network Error") {
|
||||||
message = "后端接口连接异常"
|
message = "网络连接异常"
|
||||||
} else if (message.includes("timeout")) {
|
} else if (message.includes("timeout")) {
|
||||||
message = "系统接口请求超时"
|
message = "系统接口请求超时"
|
||||||
} else if (message.includes("Request failed with status code")) {
|
} else if (message.includes("Request failed with status code")) {
|
||||||
|
|||||||
@ -23,11 +23,19 @@
|
|||||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery" :loading="loading">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery" :loading="loading">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div v-if="roleList.length && !loading">
|
<!--loading-->
|
||||||
|
<div
|
||||||
|
v-if="loading"
|
||||||
|
v-loading="loading"
|
||||||
|
class="loading-page"
|
||||||
|
element-loading-text="正在加载..."
|
||||||
|
style="width: 100%; height: calc(100vh - 250px)"
|
||||||
|
></div>
|
||||||
|
<div v-else-if="roleList.length && !loading">
|
||||||
<!-- 表格数据 -->
|
<!-- 表格数据 -->
|
||||||
<el-table v-loading="loading" :data="roleList">
|
<el-table v-loading="loading" :data="roleList">
|
||||||
<el-table-column label="赛事编号" prop="matchNumStr" />
|
<el-table-column label="赛事编号" prop="matchNumStr" />
|
||||||
|
|||||||
@ -22,13 +22,19 @@
|
|||||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery" :loading="loading">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery" :loading="loading">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<!--loading-->
|
||||||
|
<div
|
||||||
<div v-if="roleList.length && !loading">
|
v-if="loading"
|
||||||
|
v-loading="loading"
|
||||||
|
class="loading-page"
|
||||||
|
element-loading-text="正在加载..."
|
||||||
|
style="width: 100%; height: calc(100vh - 250px)"
|
||||||
|
></div>
|
||||||
|
<div v-else-if="roleList.length && !loading">
|
||||||
<!-- 表格数据 -->
|
<!-- 表格数据 -->
|
||||||
<el-table v-loading="loading" :data="roleList">
|
<el-table v-loading="loading" :data="roleList">
|
||||||
<el-table-column label="赛事编号" prop="matchNumStr" />
|
<el-table-column label="赛事编号" prop="matchNumStr" />
|
||||||
|
|||||||
@ -19,11 +19,19 @@
|
|||||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery" :loading="loading">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery" :loading="loading">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div v-if="roleList.length && !loading">
|
<!--loading-->
|
||||||
|
<div
|
||||||
|
v-if="loading"
|
||||||
|
v-loading="loading"
|
||||||
|
class="loading-page"
|
||||||
|
element-loading-text="正在加载..."
|
||||||
|
style="width: 100%; height: calc(100vh - 250px)"
|
||||||
|
></div>
|
||||||
|
<div v-else-if="roleList.length && !loading">
|
||||||
<!-- 表格数据 -->
|
<!-- 表格数据 -->
|
||||||
<el-table v-loading="loading" :data="roleList">
|
<el-table v-loading="loading" :data="roleList">
|
||||||
<el-table-column label="赛事编号" prop="matchNumStr" />
|
<el-table-column label="赛事编号" prop="matchNumStr" />
|
||||||
|
|||||||
@ -22,11 +22,19 @@
|
|||||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery" :loading="loading">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery" :loading="loading">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div v-if="roleList.length && !loading">
|
<!--loading-->
|
||||||
|
<div
|
||||||
|
v-if="loading"
|
||||||
|
v-loading="loading"
|
||||||
|
class="loading-page"
|
||||||
|
element-loading-text="正在加载..."
|
||||||
|
style="width: 100%; height: calc(100vh - 250px)"
|
||||||
|
></div>
|
||||||
|
<div v-else-if="roleList.length && !loading">
|
||||||
<!-- 表格数据 -->
|
<!-- 表格数据 -->
|
||||||
<el-table v-loading="loading" :data="roleList">
|
<el-table v-loading="loading" :data="roleList">
|
||||||
<el-table-column label="赛事编号" prop="matchNumStr" />
|
<el-table-column label="赛事编号" prop="matchNumStr" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user