Merge pull request 'uesr' (#21) from uesr into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/21
This commit is contained in:
@@ -3,10 +3,20 @@
|
|||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
<transition name="fade-transform" type="transition" appear mode="out-in">
|
<transition name="fade-transform" type="transition" appear mode="out-in">
|
||||||
<div>
|
<div>
|
||||||
<component
|
<keep-alive>
|
||||||
:is="Component"
|
<suspense>
|
||||||
:key="route.fullPath"
|
<component v-if="!route.meta.noCache" :is="Component" :key="route.fullPath" />
|
||||||
></component>
|
<template #fallback>
|
||||||
|
<div>Loading...</div>
|
||||||
|
</template>
|
||||||
|
</suspense>
|
||||||
|
</keep-alive>
|
||||||
|
<suspense>
|
||||||
|
<component v-if="route.meta.noCache" :is="Component" :key="route.fullPath" />
|
||||||
|
<template #fallback>
|
||||||
|
<div>Loading...</div>
|
||||||
|
</template>
|
||||||
|
</suspense>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</router-view>
|
</router-view>
|
||||||
|
|||||||
@@ -43,14 +43,6 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
|||||||
route.component = loadView(route.component)
|
route.component = loadView(route.component)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (route.pathParams != null) {
|
|
||||||
let pathParams = route.pathParams
|
|
||||||
route.pathParams = JSON.parse(route.pathParams)
|
|
||||||
route.query = {}
|
|
||||||
for (const key in route.pathParams) {
|
|
||||||
route.query = {[key]: route.pathParams[key]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (route.children !== null && route.children && route.children.length !== 0) {
|
if (route.children !== null && route.children && route.children.length !== 0) {
|
||||||
route.children = formatAsyncRouters(route.children)
|
route.children = formatAsyncRouters(route.children)
|
||||||
}
|
}
|
||||||
@@ -69,12 +61,32 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
|||||||
if (item.children && item.children.length !== 0) {
|
if (item.children && item.children.length !== 0) {
|
||||||
generateMenu(item.children)
|
generateMenu(item.children)
|
||||||
}
|
}
|
||||||
|
if (item.pathParams != null) {
|
||||||
|
item.path = formatPath(item.path, JSON.parse(item.pathParams))
|
||||||
|
}
|
||||||
item.title = item.meta.title
|
item.title = item.meta.title
|
||||||
item.icon = item.meta.icon
|
item.icon = item.meta.icon
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 拼接地址
|
||||||
|
const formatPath = (path, query) => {
|
||||||
|
const queryArr = []
|
||||||
|
let newPath = path
|
||||||
|
for (const key in query) {
|
||||||
|
queryArr.push({label: key, value: query[key]})
|
||||||
|
}
|
||||||
|
queryArr.forEach((item, index)=>{
|
||||||
|
if(!index) {
|
||||||
|
newPath += `?${item.label}=${item.value}`
|
||||||
|
} else {
|
||||||
|
newPath += `&${item.label}=${item.value}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return newPath
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const loadView = (view) => {
|
const loadView = (view) => {
|
||||||
if (import.meta.env.MODE === 'development') {
|
if (import.meta.env.MODE === 'development') {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const searchConfig = ref([
|
|||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
change: async (val) =>{
|
change: async (val) =>{
|
||||||
const { data } = await getDeptOpt({subCompanyId: val.value})
|
const { data } = await getDeptOpt({subCompanyId: val})
|
||||||
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user