This commit is contained in:
haoxianrui
2024-07-06 05:10:07 +08:00
5 changed files with 62 additions and 78 deletions

View File

@@ -96,8 +96,6 @@ function changeLayout(layout: string) {
settingsStore.changeLayout(layout); settingsStore.changeLayout(layout);
if (layout === LayoutEnum.MIX) { if (layout === LayoutEnum.MIX) {
route.name && againActiveTop(route.name as string); route.name && againActiveTop(route.name as string);
} else if (layout === LayoutEnum.TOP) {
appStore.openSideBar();
} }
} }

View File

@@ -8,14 +8,13 @@
:active-text-color="variables['menu-active-text']" :active-text-color="variables['menu-active-text']"
:unique-opened="false" :unique-opened="false"
:collapse-transition="false" :collapse-transition="false"
:mode="layout === 'top' ? 'horizontal' : 'vertical'" :mode="mode"
> >
<SidebarMenuItem <SidebarMenuItem
v-for="route in menuList" v-for="route in menuList"
:key="route.path" :key="route.path"
:item="route" :item="route"
:base-path="resolvePath(route.path)" :base-path="resolvePath(route.path)"
:is-collapse="!appStore.sidebar.opened"
/> />
</el-menu> </el-menu>
</template> </template>
@@ -25,11 +24,11 @@ import { useSettingsStore, useAppStore } from "@/store";
import { isExternal } from "@/utils/index"; import { isExternal } from "@/utils/index";
import path from "path-browserify"; import path from "path-browserify";
import variables from "@/styles/variables.module.scss"; import variables from "@/styles/variables.module.scss";
import { LayoutEnum } from "@/enums/LayoutEnum";
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const appStore = useAppStore(); const appStore = useAppStore();
const currentRoute = useRoute(); const currentRoute = useRoute();
const layout = computed(() => settingsStore.layout);
const props = defineProps({ const props = defineProps({
menuList: { menuList: {
required: true, required: true,
@@ -43,6 +42,9 @@ const props = defineProps({
required: true, required: true,
}, },
}); });
const mode = computed(() => {
return settingsStore.layout === LayoutEnum.TOP ? "horizontal" : "vertical";
});
/** /**
* 解析路径 * 解析路径

View File

@@ -38,7 +38,7 @@
<!-- 左侧和顶部布局 --> <!-- 左侧和顶部布局 -->
<div v-else :class="{ hasTagsView: showTagsView }" class="main-container"> <div v-else :class="{ hasTagsView: showTagsView }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }"> <div :class="{ 'fixed-header': fixedHeader }">
<NavBar v-if="layout === 'left'" /> <NavBar v-if="layout === LayoutEnum.LEFT" />
<TagsView v-if="showTagsView" /> <TagsView v-if="showTagsView" />
</div> </div>
<AppMain /> <AppMain />

View File

@@ -2,15 +2,12 @@
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { defineComponent } from "vue"; defineOptions({
defineComponent({
name: "Page401", name: "Page401",
}); });
const state = reactive({ const state = reactive({
errGif: new URL(`../../assets/images/401.gif`, import.meta.url).href, errGif: new URL(`../../assets/images/401.gif`, import.meta.url).href,
ewizardClap: ewizardClap:
"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646", "https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",
dialogVisible: false, dialogVisible: false,
@@ -26,7 +23,7 @@ function back() {
</script> </script>
<template> <template>
<div class="errPage-container"> <div class="page-container">
<el-button icon="el-icon-arrow-left" class="pan-back-btn" @click="back"> <el-button icon="el-icon-arrow-left" class="pan-back-btn" @click="back">
返回 返回
</el-button> </el-button>
@@ -65,10 +62,9 @@ function back() {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.errPage-container { .page-container {
width: 800px; width: 100%;
max-width: 100%; padding: 100px;
margin: 100px auto;
.pan-back-btn { .pan-back-btn {
color: #fff; color: #fff;

View File

@@ -1,19 +1,19 @@
<!-- setup 无法设置组件名称组件名称keepAlive必须 -->
<script lang="ts">
export default {
name: "Page404",
};
</script>
<script setup lang="ts"> <script setup lang="ts">
function message() { import { useRouter } from "vue-router";
return "The webmaster said that you can not enter this page...";
defineOptions({
name: "Page404",
});
const router = useRouter();
function back() {
router.back();
} }
</script> </script>
<template> <template>
<div class="wscn-http404-container"> <div class="page-container">
<div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" src="@/assets/images/404.png" alt="404" /> <img class="pic-404__parent" src="@/assets/images/404.png" alt="404" />
<img <img
@@ -43,34 +43,26 @@ function message() {
>wallstreetcn</a >wallstreetcn</a
> >
</div> </div>
<div class="bullshit__headline">{{ message() }}</div> <div class="bullshit__headline">
The webmaster said that you can not enter this page...
</div>
<div class="bullshit__info"> <div class="bullshit__info">
Please check that the URL you entered is correct, or click the button Please check that the URL you entered is correct, or click the button
below to return to the homepage. below to return to the homepage.
</div> </div>
<a href="" class="bullshit__return-home">Back to home</a> <a href="#" class="bullshit__return-home" @click.prevent="back">
</div> Back to home
</a>
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.wscn-http404-container { .page-container {
position: absolute; display: flex;
top: 40%; padding: 100px;
left: 50%;
transform: translate(-50%, -50%);
}
.wscn-http404 {
position: relative;
width: 1200px;
padding: 0 50px;
overflow: hidden;
.pic-404 { .pic-404 {
position: relative;
float: left;
width: 600px; width: 600px;
overflow: hidden; overflow: hidden;
@@ -79,8 +71,6 @@ function message() {
} }
&__child { &__child {
position: absolute;
&.left { &.left {
top: 17px; top: 17px;
left: 220px; left: 220px;
@@ -198,8 +188,6 @@ function message() {
} }
.bullshit { .bullshit {
position: relative;
float: left;
width: 300px; width: 300px;
padding: 30px 0; padding: 30px 0;
overflow: hidden; overflow: hidden;