Commit fd30659a authored by 王玉鑫's avatar 王玉鑫

feat: icon修改

parent 72d68684
<template> <template>
<div class="flex h-12 items-center justify-between"> <div class="flex h-[50px] items-center justify-between">
<div class="flex h-full items-center"> <div class="flex h-full items-center">
<div> <div>
<img class="h-10 w-auto" src="@/assets/images/logo-head.png" alt="立业云" /> <img class="h-[50px]" :src="titleIcon" alt="立业云" />
</div>
<div
class="ml-4 flex h-8 items-center px-4 font-yahei text-base text-[#C0322B] outline outline-1 outline-[#C0322B]"
>
{{ typeName }}
</div> </div>
</div> </div>
<div v-if="showSearch" class="h-full"> <div v-if="showSearch" class="h-full">
...@@ -32,8 +27,16 @@ ...@@ -32,8 +27,16 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onUnmounted, ref, watchEffect } from 'vue'; import { computed, onUnmounted, ref, watchEffect } from 'vue';
import { useSearchParamsStore } from '@/stores/searchParams.ts'; import { useSearchParamsStore } from '@/stores/searchParams.ts';
import { useRoute } from 'vue-router';
import parkIcon from '@/assets/images/title-icon__park.png';
import categoryIcon from '@/assets/images/title-icon__category.png';
import developIcon from '@/assets/images/title-icon__develop.png';
import landIcon from '@/assets/images/title-icon__land.png';
import policyIcon from '@/assets/images/title-icon__policy.png';
import carrierIcon from '@/assets/images/title-icon__carrier.png';
import { TitleIconType } from '@/types/enum.ts';
withDefaults( withDefaults(
defineProps<{ defineProps<{
...@@ -50,8 +53,27 @@ const emit = defineEmits(['search']); ...@@ -50,8 +53,27 @@ const emit = defineEmits(['search']);
const searchParamsStore = useSearchParamsStore(); const searchParamsStore = useSearchParamsStore();
const route = useRoute();
const parkName = ref(''); const parkName = ref('');
const titleIcon = computed(() => {
const config: Record<TitleIconType, string> = {
[TitleIconType.carrier]: carrierIcon,
[TitleIconType.land]: landIcon,
[TitleIconType.park]: parkIcon,
[TitleIconType.category]: categoryIcon,
[TitleIconType.policy]: policyIcon,
[TitleIconType.develop]: developIcon,
[TitleIconType.user]: developIcon,
[TitleIconType.about]: developIcon,
[TitleIconType.contact]: developIcon,
};
const { iconType } = route.meta || {};
return config[iconType!];
});
watchEffect(() => { watchEffect(() => {
parkName.value = searchParamsStore.searchName?.trim() || ''; parkName.value = searchParamsStore.searchName?.trim() || '';
}); });
......
...@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'; ...@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router'; import type { RouteRecordRaw } from 'vue-router';
/** 首页 */ /** 首页 */
import HomeView from '@/views/home/HomeView.vue'; import HomeView from '@/views/home/HomeView.vue';
import { TitleIconType } from '@/types/enum.ts';
/** 产业园 */ /** 产业园 */
const IndustrialParkList = () => import('@/views/industrial-park/IndustrialParkList.vue'); const IndustrialParkList = () => import('@/views/industrial-park/IndustrialParkList.vue');
...@@ -116,6 +117,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -116,6 +117,7 @@ const routes: readonly RouteRecordRaw[] = [
component: DevelopZoneList, component: DevelopZoneList,
meta: { meta: {
menuName: '开发区', menuName: '开发区',
iconType: TitleIconType.develop,
}, },
}, },
{ {
...@@ -124,6 +126,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -124,6 +126,7 @@ const routes: readonly RouteRecordRaw[] = [
component: IndustrialParkList, component: IndustrialParkList,
meta: { meta: {
menuName: '产业园', menuName: '产业园',
iconType: TitleIconType.park,
}, },
}, },
{ {
...@@ -131,6 +134,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -131,6 +134,7 @@ const routes: readonly RouteRecordRaw[] = [
component: CarrierList, component: CarrierList,
meta: { meta: {
menuName: '载体', menuName: '载体',
iconType: TitleIconType.carrier,
}, },
}, },
{ {
...@@ -138,6 +142,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -138,6 +142,7 @@ const routes: readonly RouteRecordRaw[] = [
component: LandList, component: LandList,
meta: { meta: {
menuName: '土地', menuName: '土地',
iconType: TitleIconType.land,
}, },
}, },
{ {
...@@ -146,6 +151,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -146,6 +151,7 @@ const routes: readonly RouteRecordRaw[] = [
component: IndustryCategory, component: IndustryCategory,
meta: { meta: {
menuName: '产业分类', menuName: '产业分类',
iconType: TitleIconType.category,
}, },
}, },
{ {
...@@ -154,6 +160,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -154,6 +160,7 @@ const routes: readonly RouteRecordRaw[] = [
component: IndustryPolicy, component: IndustryPolicy,
meta: { meta: {
menuName: '产业政策', menuName: '产业政策',
iconType: TitleIconType.policy,
}, },
}, },
{ {
...@@ -162,6 +169,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -162,6 +169,7 @@ const routes: readonly RouteRecordRaw[] = [
component: IndustryPolicyDetail, component: IndustryPolicyDetail,
meta: { meta: {
menuRouteName: RouteName.industryPolicy, menuRouteName: RouteName.industryPolicy,
iconType: TitleIconType.policy,
}, },
}, },
{ {
...@@ -173,11 +181,17 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -173,11 +181,17 @@ const routes: readonly RouteRecordRaw[] = [
// 关于立业云 // 关于立业云
...gen(RouteName.aboutUs), ...gen(RouteName.aboutUs),
component: AboutUs, component: AboutUs,
meta: {
iconType: TitleIconType.about,
},
}, },
{ {
// 联系我们 // 联系我们
...gen(RouteName.contactUs), ...gen(RouteName.contactUs),
component: ContactUs, component: ContactUs,
meta: {
iconType: TitleIconType.contact,
},
}, },
{ {
// 合伙人招募 // 合伙人招募
...@@ -190,6 +204,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -190,6 +204,7 @@ const routes: readonly RouteRecordRaw[] = [
component: IndustrialParkDetail, component: IndustrialParkDetail,
meta: { meta: {
menuRouteName: RouteName.industrialParkList, menuRouteName: RouteName.industrialParkList,
iconType: TitleIconType.park,
}, },
}, },
{ {
...@@ -198,6 +213,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -198,6 +213,7 @@ const routes: readonly RouteRecordRaw[] = [
component: DevelopZoneDetail, component: DevelopZoneDetail,
meta: { meta: {
menuRouteName: RouteName.developZoneList, menuRouteName: RouteName.developZoneList,
iconType: TitleIconType.develop,
}, },
}, },
{ {
...@@ -206,6 +222,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -206,6 +222,7 @@ const routes: readonly RouteRecordRaw[] = [
component: LandDetail, component: LandDetail,
meta: { meta: {
menuRouteName: RouteName.landList, menuRouteName: RouteName.landList,
iconType: TitleIconType.land,
}, },
}, },
{ {
...@@ -214,6 +231,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -214,6 +231,7 @@ const routes: readonly RouteRecordRaw[] = [
component: CarrierDetail, component: CarrierDetail,
meta: { meta: {
menuRouteName: RouteName.carrierList, menuRouteName: RouteName.carrierList,
iconType: TitleIconType.carrier,
}, },
}, },
{ {
...@@ -228,6 +246,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -228,6 +246,7 @@ const routes: readonly RouteRecordRaw[] = [
component: MyPark, component: MyPark,
meta: { meta: {
isAuth: true, isAuth: true,
iconType: TitleIconType.user,
}, },
}, },
{ {
...@@ -236,6 +255,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -236,6 +255,7 @@ const routes: readonly RouteRecordRaw[] = [
component: MyIndustrialDetail, component: MyIndustrialDetail,
meta: { meta: {
isAuth: true, isAuth: true,
iconType: TitleIconType.user,
}, },
}, },
{ {
...@@ -244,6 +264,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -244,6 +264,7 @@ const routes: readonly RouteRecordRaw[] = [
component: MyDevelopDetail, component: MyDevelopDetail,
meta: { meta: {
isAuth: true, isAuth: true,
iconType: TitleIconType.user,
}, },
}, },
{ {
...@@ -252,6 +273,7 @@ const routes: readonly RouteRecordRaw[] = [ ...@@ -252,6 +273,7 @@ const routes: readonly RouteRecordRaw[] = [
component: ChangePassword, component: ChangePassword,
meta: { meta: {
isAuth: true, isAuth: true,
iconType: TitleIconType.user,
}, },
}, },
], ],
......
...@@ -118,3 +118,25 @@ export enum TabMessage { ...@@ -118,3 +118,25 @@ export enum TabMessage {
/** 登录 */ /** 登录 */
login = 'login', login = 'login',
} }
/** 标题icon类型 */
export enum TitleIconType {
/** 载体 */
carrier = 'carrier',
/** 产业园 */
park = 'park',
/** 开发区 */
develop = 'develop',
/** 产业分类 */
category = 'category',
/** 土地 */
land = 'land',
/** 产业政策 */
policy = 'policy',
/** 用户中心 */
user = 'user',
/** 关于我们 */
about = 'about',
/** 联系我们 */
contact = 'contact',
}
import 'vue-router'; import 'vue-router';
import { RouteName } from '@/router/router.ts'; import { RouteName } from '@/router/router.ts';
import { TitleIconType } from '@/types/enum.ts';
declare module 'vue-router' { declare module 'vue-router' {
interface RouteMeta { interface RouteMeta {
...@@ -7,5 +8,6 @@ declare module 'vue-router' { ...@@ -7,5 +8,6 @@ declare module 'vue-router' {
parentMenuName?: string; parentMenuName?: string;
menuRouteName?: RouteName; menuRouteName?: RouteName;
isAuth?: boolean; isAuth?: boolean;
iconType?: TitleIconType;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment