|
@@ -4,18 +4,12 @@
|
|
|
<div class="w_1200">
|
|
|
<el-row :gutter="20" align="middle">
|
|
|
<el-col :span="12" class="top_1">
|
|
|
- <el-image class="images" :src="logoUrl" fit="fill" />
|
|
|
- <!-- <el-image
|
|
|
- class="image"
|
|
|
- v-if="configInfo && configInfo.logoUrl && configInfo.logoUrl.length > 0"
|
|
|
- :src="configInfo.logoUrl[0].url"
|
|
|
- fit="fill"
|
|
|
- />
|
|
|
- <el-image class="image" v-else :src="siteInfo.logoUrl" fit="fill" />
|
|
|
+ <!-- <el-image class="images" :src="logoUrl" fit="fill" /> -->
|
|
|
+ <el-image class="image" :src="siteInfo.logoUrl" fit="fill" />
|
|
|
<div class="content">
|
|
|
- <text class="title">{{ configInfo.zhTitle || siteInfo.zhTitle }}</text>
|
|
|
- <text class="english">{{ siteInfo.zhBrief }}</text>
|
|
|
- </div> -->
|
|
|
+ <text class="title">{{ siteInfo.zhTitle }}</text>
|
|
|
+ <!-- <text class="english">{{ siteInfo.zhBrief }}</text> -->
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
<el-col :span="12" v-if="user && user.id" class="top_2">
|
|
|
<el-dropdown>
|
|
@@ -39,25 +33,22 @@
|
|
|
</div>
|
|
|
<div class="w_1200">
|
|
|
<el-col :span="24" class="top_3">
|
|
|
- <el-menu :default-active="current" mode="horizontal" @select="selectMenu">
|
|
|
- <template v-for="item in data" :key="item._id">
|
|
|
- <template v-if="item.type === '0'">
|
|
|
- <el-sub-menu :index="item._id" :class="[current == item.href ? 'current' : '']">
|
|
|
- <template #title>
|
|
|
- <span @click="selectMenu(item.href)">{{ item.title }}</span>
|
|
|
- </template>
|
|
|
- <el-menu-item v-for="tag in item.children" :key="tag._id" :index="tag.href">
|
|
|
- <template v-slot:default>
|
|
|
- {{ tag.title }}
|
|
|
- </template>
|
|
|
- </el-menu-item>
|
|
|
- </el-sub-menu>
|
|
|
- </template>
|
|
|
- <template v-else-if="item.type === '1'">
|
|
|
- <el-menu-item :index="item.href"> {{ item.title }}</el-menu-item>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </el-menu>
|
|
|
+ <el-col :span="24" class="list">
|
|
|
+ <span
|
|
|
+ class="text"
|
|
|
+ v-for="(item, index) in data"
|
|
|
+ :key="index"
|
|
|
+ @click="selectMenu(item.route)"
|
|
|
+ :style="{
|
|
|
+ backgroundColor: item.hover ? '#2374ff' : 'transparent',
|
|
|
+ color: item.hover ? '#ffffff' : ''
|
|
|
+ }"
|
|
|
+ @mouseover="handleMouseOver(index)"
|
|
|
+ @mouseleave="handleMouseLeave(index)"
|
|
|
+ >
|
|
|
+ {{ item.title }}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -104,7 +95,7 @@
|
|
|
// 图片引入
|
|
|
import logoUrl from '/images/logo-jilin.png'
|
|
|
import logoBottom from '/images/logo-jilinbai.png'
|
|
|
-import { footInfo, menuList } from '@/layout/site'
|
|
|
+import { siteInfo, footInfo, menuList } from '@/layout/site'
|
|
|
// 接口
|
|
|
import { TagsStore } from '@/store/api/system/tags'
|
|
|
const store = TagsStore()
|
|
@@ -112,7 +103,6 @@ import { DesignStore } from '@/store/api/platform/design'
|
|
|
const designStore = DesignStore()
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
|
-const current = ref(route.name || 'one')
|
|
|
import { UserStore } from '@/store/user'
|
|
|
const userStore = UserStore()
|
|
|
const user = computed(() => userStore.user)
|
|
@@ -128,6 +118,10 @@ const search = async () => {
|
|
|
const res = await store.query({ is_use: '0' })
|
|
|
// if (res.errcode == '0' && res.total > 0) data.value = res.data
|
|
|
// else data.value = menuList
|
|
|
+ for (const val of menuList) {
|
|
|
+ if (route.name === val.route) val.hover = true
|
|
|
+ else val.hover = false
|
|
|
+ }
|
|
|
data.value = menuList
|
|
|
// 基础设置
|
|
|
const result = await designStore.query({})
|
|
@@ -137,7 +131,10 @@ const search = async () => {
|
|
|
}
|
|
|
}
|
|
|
const selectMenu = (item, query) => {
|
|
|
- current.value = item
|
|
|
+ for (const val of data.value) {
|
|
|
+ if (route.name === val.route) val.hover = true
|
|
|
+ else val.hover = false
|
|
|
+ }
|
|
|
router.push({ path: `/${item}`, query })
|
|
|
}
|
|
|
// 登录|注册
|
|
@@ -159,6 +156,19 @@ const toCommon = (type) => {
|
|
|
else if (type == '2') router.push('/center')
|
|
|
else if (type == '3') router.push('/sign')
|
|
|
}
|
|
|
+const handleMouseOver = (index) => {
|
|
|
+ data.value[index].hover = true
|
|
|
+}
|
|
|
+const handleMouseLeave = (index) => {
|
|
|
+ data.value[index].hover = false
|
|
|
+ const arr = data.value.every((i) => i.hover === false)
|
|
|
+ if (arr) {
|
|
|
+ for (const val of data.value) {
|
|
|
+ if (route.name === val.route) val.hover = true
|
|
|
+ else val.hover = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
// 退出登录
|
|
|
const toLogout = () => {
|
|
|
userStore.logOut()
|
|
@@ -257,6 +267,16 @@ provide('selectMenu', selectMenu)
|
|
|
}
|
|
|
.top_3 {
|
|
|
margin: 5px 0 0 0;
|
|
|
+ .list {
|
|
|
+ padding: 10px 0;
|
|
|
+ .text {
|
|
|
+ padding: 10px;
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
+ font-size: $global-font-size-18;
|
|
|
+ color: #333333;
|
|
|
+ cursor: pointer; /* 改变鼠标样式为手形 */
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.center {
|