提交 05200e13 authored 作者: 王鹏飞's avatar 王鹏飞

v2

上级 a8a57867
...@@ -6,18 +6,9 @@ defineProps({ data: { type: Object, default: () => ({}) } }) ...@@ -6,18 +6,9 @@ defineProps({ data: { type: Object, default: () => ({}) } })
</script> </script>
<template> <template>
<AppCard :title="data.title" :class="data.className"> <AppCard :title="data.title">
<div class="box"> <div class="box">
<div class="box-left"> <CardBoxCell v-for="(cell, index) in data.items" :data="cell" :key="index"></CardBoxCell>
<div class="box-row" v-for="(row, index) in data.leftItems" :key="index">
<CardBoxCell v-for="(cell, index) in row" :data="cell" :key="index"></CardBoxCell>
</div>
</div>
<div class="box-right" v-if="data.rightItems">
<div class="box-row" v-for="(row, index) in data.rightItems" :key="index">
<CardBoxCell v-for="(cell, index) in row" :data="cell" :key="index"></CardBoxCell>
</div>
</div>
</div> </div>
</AppCard> </AppCard>
</template> </template>
...@@ -25,37 +16,12 @@ defineProps({ data: { type: Object, default: () => ({}) } }) ...@@ -25,37 +16,12 @@ defineProps({ data: { type: Object, default: () => ({}) } })
<style lang="scss"> <style lang="scss">
.box { .box {
display: flex; display: flex;
} padding: 10px 0;
.box-left {
flex: 1;
.box-cell:hover {
background-color: #aa1941;
}
}
.box-right {
flex: 1;
margin-left: 20px;
padding-left: 20px;
border-left: 1px dashed #c1c1c1;
.box-cell:hover {
background-color: #136ca8;
}
} }
.box-row { .box-row {
display: flex; display: flex;
} }
.box-row + .box-row { // .box-cell + .box-cell {
margin-top: 20px; // margin-left: 20px;
} // }
.box-cell + .box-cell {
margin-left: 20px;
}
.is-blue {
.app-card-hd__title {
border-color: #136ca8;
}
.box-cell:hover {
background-color: #136ca8;
}
}
</style> </style>
...@@ -6,33 +6,20 @@ function handleClick() { ...@@ -6,33 +6,20 @@ function handleClick() {
</script> </script>
<template> <template>
<div class="box-cell" v-if="data.href"> <div class="box-cell" :class="data.className" @click="handleClick">
<a :href="data.href" target="_blank"> <a :href="data.href" target="_blank">
<div class="box-cell-icon"> <div class="box-cell-icon">
<img :src="data.icon" class="icon-normal" /> <img :src="data.icon" class="icon-normal" />
<img :src="data.hoverIcon" class="icon-hover" /> <img :src="data.hoverIcon" class="icon-hover" />
</div> </div>
<div class="box-cell-name">{{ data.title }}</div> <div class="box-cell-name" v-html="data.title"></div>
</a> </a>
</div> </div>
<div class="box-cell" @click="handleClick" v-else>
<div class="box-cell-icon">
<img :src="data.icon" class="icon-normal" />
<img :src="data.hoverIcon" class="icon-hover" />
</div>
<div class="box-cell-name">{{ data.title }}</div>
</div>
</template> </template>
<style lang="scss"> <style lang="scss">
.box-cell { .box-cell {
flex: 1; flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #f7f5f5;
height: 150px;
border-radius: 20px; border-radius: 20px;
color: #333; color: #333;
cursor: pointer; cursor: pointer;
...@@ -40,33 +27,43 @@ function handleClick() { ...@@ -40,33 +27,43 @@ function handleClick() {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center;
color: inherit; color: inherit;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
&:hover { &:hover {
color: #fff; .box-cell-icon {
box-shadow: 4px 3px 14px rgba(0, 0, 0, 0.37); background-color: #aa1941;
a { box-shadow: 0px 3px 18px rgba(0, 0, 0, 0.27);
color: #fff;
} }
.icon-normal { .icon-normal {
display: none; display: none;
} }
.icon-hover { .icon-hover {
display: block; display: unset;
}
}
&.is-blue {
&:hover {
.box-cell-icon {
background-color: #005690;
}
} }
} }
} }
.box-cell-icon { .box-cell-icon {
height: 46px; width: 80px;
height: 80px;
background-color: #f7f5f5;
text-align: center;
line-height: 80px;
border-radius: 50%;
img { img {
height: 100%; height: 34px;
object-fit: contain; object-fit: contain;
} }
.icon-normal { .icon-normal {
display: block; display: unset;
} }
.icon-hover { .icon-hover {
display: none; display: none;
...@@ -77,5 +74,7 @@ function handleClick() { ...@@ -77,5 +74,7 @@ function handleClick() {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 28px; line-height: 28px;
text-align: center;
white-space: nowrap;
} }
</style> </style>
import type { Router } from 'vue-router' import type { Router, RouteRecordRaw } from 'vue-router'
import type { AppModule } from '@/types'
export default function ({ router }: { router: Router }) { export default function ({ router }: { router: Router }) {
const modules: Array<AppModule> = Object.values(import.meta.globEager('./**/index.ts')) const modules: Array<{ routes: Array<RouteRecordRaw> }> = Object.values(import.meta.globEager('./**/index.ts'))
modules.forEach(({ routes = [] }) => { modules.forEach(({ routes = [] }) => {
// 注册路由 // 注册路由
routes.forEach(route => { routes.forEach(route => {
......
import type { RouteRecordRaw } from 'vue-router'
export interface UserState { export interface UserState {
id: string id: string
avatar: string avatar: string
...@@ -8,7 +6,3 @@ export interface UserState { ...@@ -8,7 +6,3 @@ export interface UserState {
nickname: string nickname: string
username: string username: string
} }
export interface AppModule {
routes: Array<RouteRecordRaw>
}
...@@ -9,7 +9,7 @@ import checker from 'vite-plugin-checker' ...@@ -9,7 +9,7 @@ import checker from 'vite-plugin-checker'
export default defineConfig(({ mode }) => { export default defineConfig(({ mode }) => {
return { return {
base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/sass/' : '/', base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/sass/' : '/',
plugins: [checker({ eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } }), vue()], plugins: [checker({ vueTsc: true, eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } }), vue()],
server: { server: {
open: true, open: true,
host: 'dev.ezijing.com', host: 'dev.ezijing.com',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论