mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-10-15 05:19:13 +00:00
Merge branch 'main' into i18n-dev-new
This commit is contained in:
@@ -13,6 +13,18 @@ import auth from '@/directive/auth'
|
||||
import { store } from '@/pinia'
|
||||
import App from './App.vue'
|
||||
import i18n from './i18n' // added by mohamed hassan to multilangauge
|
||||
/**
|
||||
* @description 导入加载进度条,防止首屏加载时间过长,用户等待
|
||||
*
|
||||
* */
|
||||
import Nprogress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })
|
||||
Nprogress.start()
|
||||
|
||||
/**
|
||||
* 无需在这块结束,会在路由中间件中结束此块内容
|
||||
* */
|
||||
|
||||
const app = createApp(App)
|
||||
app.config.productionTip = false
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useUserStore } from '@/pinia/modules/user'
|
||||
import { useRouterStore } from '@/pinia/modules/router'
|
||||
import getPageTitle from '@/utils/page'
|
||||
import router from '@/router'
|
||||
import Nprogress from 'nprogress'
|
||||
|
||||
let asyncRouterFlag = 0
|
||||
|
||||
@@ -37,6 +38,7 @@ async function handleKeepAlive(to) {
|
||||
}
|
||||
|
||||
router.beforeEach(async(to, from) => {
|
||||
Nprogress.start()
|
||||
const userStore = useUserStore()
|
||||
to.meta.matched = [...to.matched]
|
||||
handleKeepAlive(to)
|
||||
@@ -99,3 +101,13 @@ router.beforeEach(async(to, from) => {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
// 路由加载完成后关闭进度条
|
||||
Nprogress.done()
|
||||
})
|
||||
|
||||
router.onError(() => {
|
||||
// 路由发生错误后销毁进度条
|
||||
Nprogress.remove()
|
||||
})
|
||||
|
||||
@@ -77,7 +77,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
asyncRouters.forEach(asyncRouter => {
|
||||
router.addRoute(asyncRouter)
|
||||
})
|
||||
router.push({ name: userInfo.value.authority.defaultRouter })
|
||||
await router.push({ name: userInfo.value.authority.defaultRouter })
|
||||
loadingInstance.value.close()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -58,4 +58,8 @@
|
||||
.keyword{
|
||||
width: 220px;
|
||||
margin: 0 0 0 30px;
|
||||
}
|
||||
}
|
||||
|
||||
#nprogress .bar {
|
||||
background: #4D70FF !important; //自定义颜色
|
||||
}
|
||||
|
||||
+1
-17
@@ -461,22 +461,6 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
input::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
@@ -597,7 +581,7 @@ li {
|
||||
}
|
||||
.aside {
|
||||
.el-menu--collapse {
|
||||
>.el-menu-item{
|
||||
>.el-menu-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
ref="loginForm"
|
||||
:model="loginFormData"
|
||||
:rules="rules"
|
||||
:validate-on-rule-change="false"
|
||||
@keyup.enter="submitForm"
|
||||
>
|
||||
<el-form-item prop="username">
|
||||
|
||||
@@ -58,7 +58,10 @@
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="middleDate.fieldType!=='string'&&item.value==='LIKE'"
|
||||
:disabled="
|
||||
(middleDate.fieldType!=='string'&&item.value==='LIKE')||
|
||||
((middleDate.fieldType!=='int'&&middleDate.fieldType!=='time.Time'&&middleDate.fieldType!=='float64')&&(item.value==='BETWEEN' || item.value==='NOT BETWEEN'))
|
||||
"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -133,6 +136,14 @@ const typeSearchOptions = ref([
|
||||
{
|
||||
label: 'LIKE',
|
||||
value: 'LIKE'
|
||||
},
|
||||
{
|
||||
label: 'BETWEEN',
|
||||
value: 'BETWEEN'
|
||||
},
|
||||
{
|
||||
label: 'NOT BETWEEN',
|
||||
value: 'NOT BETWEEN'
|
||||
}
|
||||
])
|
||||
const typeOptions = ref([
|
||||
|
||||
Reference in New Issue
Block a user