页面跳转添加loading,添加全局loading

This commit is contained in:
李志鹏
2025-12-12 10:34:10 +08:00
parent 652d89d3be
commit ed83044f81
6 changed files with 50 additions and 21 deletions

View File

@@ -427,7 +427,7 @@
<div class="userSystem" v-show="pastDuePage">
{{ $t('Header.pastDue') }}
</div>
<div class="router" v-if="!getLangIsShowMark">
<div class="router" v-if="!loading">
<home
ref="home"
@setNewProject="() => (leftShow = true)"
@@ -442,10 +442,10 @@
<UpgradePlan ref="UpgradePlan"></UpgradePlan>
<TaskPage ref="TaskPage"></TaskPage>
<div class="mark_loading" v-show="getLangIsShowMark">
<!-- <div class="mark_loading" v-show="loading">
<a-spin size="large" />
</div>
<!-- <RobotAssist v-if="!getLangIsShowMark"></RobotAssist> -->
</div> -->
<!-- <RobotAssist v-if="!loading"></RobotAssist> -->
<scaleVideo ref="scaleVideo"></scaleVideo>
<!-- 进行续订 -->
<renew ref="renew"></renew>
@@ -656,7 +656,7 @@ export default defineComponent({
})
let activeCredits = ref(false)
let getLangIsShowMark = ref(true)
let loading = computed(() => (store.state.loading))
let messageNum = computed(() => {
return store.state.UserHabit.messageSystem.messageNum
})
@@ -1070,7 +1070,7 @@ export default defineComponent({
isMurmur,
credits,
activeCredits,
getLangIsShowMark,
loading,
messageNum,
messageType,
...toRefs(stateList),
@@ -1128,11 +1128,11 @@ export default defineComponent({
this.store
.dispatch('getLangType')
.then(() => {
this.getLangIsShowMark = false
this.store.commit('set_loading', false)
resolve()
})
.catch(() => {
this.getLangIsShowMark = false
this.store.commit('set_loading', false)
reject()
})
})
@@ -1334,7 +1334,7 @@ export default defineComponent({
})
},
setLang(v) {
this.getLangIsShowMark = true
store.commit('set_loading', true)
Https.axiosGet(Https.httpUrls.changeUserLanguage, { params: { language: v } })
.then(rv => {
if (rv) {
@@ -1351,11 +1351,11 @@ export default defineComponent({
window.location.reload()
// window.location.href = '/home';
}
this.getLangIsShowMark = false
store.commit('set_loading', false)
}
})
.catch(() => {
this.getLangIsShowMark = false
store.commit('set_loading', false)
})
},

View File

@@ -43,15 +43,12 @@
<span>{{ t('Login.LogonToAiDA') }}</span>
</div>
<div class="info" v-show="!loginType">{{ t('Login.Infomation') }}</div>
<personal ref="personal" v-if="loginType == 'personal'" v-model:isMask="isMask"></personal>
<personal ref="personal" v-if="loginType == 'personal'"></personal>
<school ref="school" v-if="loginType == 'school'"></school>
<enterprise ref="enterprise" v-if="loginType == 'enterprise'"></enterprise>
</div>
</div>
<div class="mark_loading" v-show="isMask">
<a-spin size="large" />
</div>
</div>
</div>
</template>
@@ -103,7 +100,6 @@ export default defineComponent({
const loginData = reactive({
loginType: "",
isMask: false,
});
const dataDom = reactive({
personal: null as any,