字典优化,tabs优化,自动化代码优化 (#1128)
* server/service/system/sys_dictionary.go: fix 获取字典单条数据时status失效的bug * 增加关闭状态下折叠内容所在menu的高亮提示 * 修复字典变更无法打开的bug * 增加详情页签区分功能 * 增加字典详情区分 * 修复字典功能 Co-authored-by: yancunju <yancunju@autouc.com>
This commit is contained in:
committed by
GitHub
co-authored by
yancunju
parent
9da394f711
commit
e0280a56ce
@@ -1,10 +1,19 @@
|
||||
<template>
|
||||
<el-sub-menu ref="subMenu" :index="routerInfo.name">
|
||||
|
||||
<template #title>
|
||||
<el-icon v-if="routerInfo.meta.icon">
|
||||
<component :is="routerInfo.meta.icon" />
|
||||
</el-icon>
|
||||
<span>{{ routerInfo.meta.title }}</span>
|
||||
<div v-if="!isCollapse" class="gva-subMenu">
|
||||
<el-icon v-if="routerInfo.meta.icon">
|
||||
<component :is="routerInfo.meta.icon" />
|
||||
</el-icon>
|
||||
<span>{{ routerInfo.meta.title }}</span>
|
||||
</div>
|
||||
<template v-else>
|
||||
<el-icon v-if="routerInfo.meta.icon">
|
||||
<component :is="routerInfo.meta.icon" />
|
||||
</el-icon>
|
||||
<span>{{ routerInfo.meta.title }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<slot />
|
||||
</el-sub-menu>
|
||||
@@ -39,15 +48,15 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
// const activeBackground = ref(props.theme.activeBackground)
|
||||
// const activeText = ref(props.theme.activeText)
|
||||
const activeBackground = ref(props.theme.activeBackground)
|
||||
const activeText = ref(props.theme.activeText)
|
||||
const normalText = ref(props.theme.normalText)
|
||||
// const hoverBackground = ref(props.theme.hoverBackground)
|
||||
// const hoverText = ref(props.theme.hoverText)
|
||||
|
||||
watch(() => props.theme, () => {
|
||||
// activeBackground.value = props.theme.activeBackground
|
||||
// activeText.value = props.theme.activeText
|
||||
activeBackground.value = props.theme.activeBackground
|
||||
activeText.value = props.theme.activeText
|
||||
normalText.value = props.theme.normalText
|
||||
// hoverBackground.value = props.theme.hoverBackground
|
||||
// hoverText.value = props.theme.hoverText
|
||||
@@ -58,8 +67,26 @@ watch(() => props.theme, () => {
|
||||
<style lang="scss" scoped>
|
||||
.el-sub-menu{
|
||||
::v-deep(.el-sub-menu__title){
|
||||
padding: 6px;
|
||||
color: v-bind(normalText);
|
||||
}
|
||||
}
|
||||
|
||||
.is-active:not(.is-opened){
|
||||
::v-deep(.el-sub-menu__title) .gva-subMenu{
|
||||
flex:1;
|
||||
height: 100%;
|
||||
line-height: 44px;
|
||||
background: v-bind(activeBackground) !important;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 2px 1px v-bind(activeBackground) !important;
|
||||
i{
|
||||
color: v-bind(activeText);
|
||||
}
|
||||
span{
|
||||
color: v-bind(activeText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
activeValue === name(item) ? userStore.activeColor : '#ddd',
|
||||
}"
|
||||
/>
|
||||
{{ item.meta.title }}</span>
|
||||
{{ fmtTitle(item.meta.title,item) }}</span>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -59,6 +59,7 @@ import { emitter } from '@/utils/bus.js'
|
||||
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useUserStore } from '@/pinia/modules/user'
|
||||
import { fmtTitle } from '@/utils/fmtRouterTitle'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -208,11 +209,11 @@ const setTab = (route) => {
|
||||
|
||||
const historyMap = ref({})
|
||||
|
||||
watch(()=>historys.value,()=>{
|
||||
historyMap.value={}
|
||||
historys.value.forEach((item)=>{
|
||||
watch(() => historys.value, () => {
|
||||
historyMap.value = {}
|
||||
historys.value.forEach((item) => {
|
||||
historyMap.value[getFmtString(item)] = item
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const changeTab = (name) => {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<el-breadcrumb-item
|
||||
v-for="item in matched.slice(1,matched.length)"
|
||||
:key="item.path"
|
||||
>{{ route.params.title || item.meta.title }}</el-breadcrumb-item>
|
||||
>{{ fmtTitle(item.meta.title,route) }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</el-col>
|
||||
<el-col :xs="12" :lg="9" :md="9" :sm="14" :xl="9">
|
||||
@@ -114,6 +114,7 @@ import { computed, ref, onMounted, nextTick } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useUserStore } from '@/pinia/modules/user'
|
||||
import { useRouterStore } from '@/pinia/modules/router'
|
||||
import { fmtTitle } from '@/utils/fmtRouterTitle'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
Reference in New Issue
Block a user