Merge branch 'dev_vite' of ssh://18.167.251.121:10002/aidlab/aida_front into dev_vite

This commit is contained in:
2025-12-12 10:35:54 +08:00
6 changed files with 50 additions and 21 deletions

View File

@@ -1,7 +1,16 @@
<template> <template>
<router-view/> <router-view/>
<div class="loading" v-show="loading"><a-spin delay="0.5" /></div>
</template> </template>
<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';
const store = useStore();
const loading = computed(() => store.state.loading || store.state.view_loading);
</script>
<style lang="less"> <style lang="less">
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
@@ -9,7 +18,19 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
height: 100%; height: 100%;
} }
.loading{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.4);
display: flex;
align-items: center;
justify-content: center;
z-index: 999999999999;
color: #fff;
}
.ipad{ .ipad{
*{ *{
-webkit-touch-callout:none; -webkit-touch-callout:none;

View File

@@ -553,13 +553,14 @@ export default defineComponent({
loginType: "EMAIL", loginType: "EMAIL",
userId: this.userId, userId: this.userId,
}; };
this.$emit('update:isMask',true) this.store.commit('set_loading', true)
Https.axiosPost(Https.httpUrls.accountLogin, data) Https.axiosPost(Https.httpUrls.accountLogin, data)
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv); this.setSuccessLogin(rv);
this.store.commit('set_loading', false)
}) })
.catch((res) => { .catch((res) => {
this.$emit('update:isMask',false) this.store.commit('set_loading', false)
}); });
},1000) },1000)
}, },

View File

@@ -498,6 +498,7 @@ function isTimeRangePassed(timeRange) {
} }
router.beforeEach((to: any, from, next) => { router.beforeEach((to: any, from, next) => {
store.commit("set_view_loading", true);
//系统维护时间 //系统维护时间
const time = '2025-11-21T23:00:00 - 2025-11-22T00:00:00'; const time = '2025-11-21T23:00:00 - 2025-11-22T00:00:00';
if (isTimeRangePassed(time) == 'in_progress') { if (isTimeRangePassed(time) == 'in_progress') {
@@ -540,5 +541,7 @@ router.beforeEach((to: any, from, next) => {
// if(systemUser == 0){//游客用户只能进入这两个页面 // if(systemUser == 0){//游客用户只能进入这两个页面
}); });
router.afterEach((to, from) => {
store.commit("set_view_loading", false);
});
export default router; export default router;

View File

@@ -13,10 +13,18 @@ export interface RootState{
export default createStore<RootState>({ export default createStore<RootState>({
state: { state: {
loading: false,
view_loading: false,
}, },
getters: { getters: {
}, },
mutations: { mutations: {
set_loading(state, v){
state.loading = v;
},
set_view_loading(state, v){
state.view_loading = v;
},
}, },
actions: { actions: {
}, },

View File

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

View File

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