修改app
This commit is contained in:
parent
b235c3aec5
commit
e5572d7c41
|
|
@ -3,7 +3,10 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="./src/assets/images/Union.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<title>动态社交网络演化计算系统CYJ0708</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
975
package-lock.json
generated
975
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -24,6 +24,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.2.3",
|
||||
"amfe-flexible": "^2.2.1",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"less": "^4.3.0",
|
||||
"less-loader": "^12.3.0",
|
||||
"prettier": "^3.6.0",
|
||||
|
|
|
|||
291
src/App.vue
291
src/App.vue
|
|
@ -1,83 +1,76 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<header class="el-header">
|
||||
<div>
|
||||
<img src="./assets/images/head.png" alt="" style="width: 100%; height: 100%" />
|
||||
<div>
|
||||
<!-- 根据状态控制显示 -->
|
||||
<div class="toogle-jianjie" v-if="showToggleJianjie">
|
||||
<img
|
||||
src="./assets/images/toogle-pei.png"
|
||||
alt=""
|
||||
style="width: 640px; margin-left: 640px; margin-top: 176px"
|
||||
/>
|
||||
<img
|
||||
src="./assets/images/cancel.png"
|
||||
alt=""
|
||||
style="margin-left: -40px; margin-bottom: 159px; cursor: pointer"
|
||||
@click="showToggleJianjie = false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<aside class="aside">
|
||||
<nav class="menu">
|
||||
<!-- 手动生成第一个菜单项 -->
|
||||
<div v-for="item in menuItems" :key="item.index" class="el-sub-menu">
|
||||
<div class="menu-title" :class="{'active-parent': hasActiveChild(item)}">
|
||||
<!-- 激活状态的左侧青色图片 -->
|
||||
<img
|
||||
v-if="hasActiveChild(item)"
|
||||
src="./assets/images/titleActiveLeftRec.png"
|
||||
alt=""
|
||||
class="title-active-left"
|
||||
/>
|
||||
<div class="tltlemenu-left">
|
||||
<img
|
||||
src="./assets/images/titlelogo.png"
|
||||
style="width: 20px; height: 20px; margin-right: 12px"
|
||||
/>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<img src="./assets/images/titleright.png" alt="" style="width: 66px; height: 16px" />
|
||||
</div>
|
||||
<ul class="menu-items">
|
||||
<div v-for="child in item.subItems" :key="child.index" style="text-decoration: none">
|
||||
<li
|
||||
:key="child.index"
|
||||
class="el-menu-item"
|
||||
@click="jumpPage(child.index)"
|
||||
:class="{ active: isActive(child.index) }"
|
||||
>
|
||||
<div>
|
||||
{{ child.title }}
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="header-logo"></div>
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-aside>
|
||||
<nav class="menu">
|
||||
<!-- 手动生成第一个菜单项 -->
|
||||
<div v-for="item in menuItems" :key="item.index" class="el-sub-menu">
|
||||
<div class="menu-title" :class="{ 'active-parent': hasActiveChild(item) }">
|
||||
<!-- 激活状态的左侧青色图片 -->
|
||||
<img
|
||||
v-if="hasActiveChild(item)"
|
||||
src="./assets/images/titleActiveLeftRec.png"
|
||||
alt=""
|
||||
class="title-active-left"
|
||||
/>
|
||||
<div class="tltlemenu-left">
|
||||
<img
|
||||
src="./assets/images/titlelogo.png"
|
||||
style="width: 20px; height: 20px; margin-right: 12px"
|
||||
/>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</li>
|
||||
<img
|
||||
src="./assets/images/titleright.png"
|
||||
alt=""
|
||||
style="width: 66px; height: 16px"
|
||||
/>
|
||||
</div>
|
||||
<ul class="menu-items">
|
||||
<div
|
||||
v-for="child in item.subItems"
|
||||
:key="child.index"
|
||||
style="text-decoration: none"
|
||||
>
|
||||
<li
|
||||
:key="child.index"
|
||||
class="el-menu-item"
|
||||
@click="jumpPage(child.index)"
|
||||
:class="{ active: isActive(child.index) }"
|
||||
>
|
||||
<div>
|
||||
{{ child.title }}
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</aside>
|
||||
</nav>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<el-dialog v-model="openDialog" width="500" align-center class="custom-dialog-prepare">
|
||||
<div class="center-tips">
|
||||
<img src="./assets/images/icon/pre-icon.png" alt="" class="pre-icon" />
|
||||
<div class="tips-font">该案例正在开发中</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<main class="main">
|
||||
<!-- 路由视图 -->
|
||||
<router-view></router-view>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
import { onMounted, ref } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const menuItems = [
|
||||
{
|
||||
index: "1",
|
||||
|
|
@ -107,18 +100,18 @@ const menuItems = [
|
|||
{ index: "/group-evolution-4", title: "异常群体捕捉" }
|
||||
]
|
||||
}
|
||||
];
|
||||
]
|
||||
|
||||
const openDialog = ref(false);
|
||||
const openDialog = ref(false)
|
||||
// 判断当前路由是否激活菜单项
|
||||
const isActive = (routePath) => {
|
||||
return route.path === routePath;
|
||||
};
|
||||
return route.path === routePath
|
||||
}
|
||||
|
||||
// 判断父菜单是否有激活的子项
|
||||
const hasActiveChild = (item) => {
|
||||
return item.subItems.some(child => isActive(child.index));
|
||||
};
|
||||
return item.subItems.some((child) => isActive(child.index))
|
||||
}
|
||||
|
||||
//处理跳转页面逻辑
|
||||
const jumpPage = (routePath) => {
|
||||
|
|
@ -133,21 +126,40 @@ const jumpPage = (routePath) => {
|
|||
"/group-evolution-2",
|
||||
"/group-evolution-3",
|
||||
"/group-evolution-4"
|
||||
];
|
||||
]
|
||||
if (activedPaths.includes(routePath)) {
|
||||
router.push({ path: routePath });
|
||||
return;
|
||||
router.push({ path: routePath })
|
||||
return
|
||||
}
|
||||
openDialog.value = true;
|
||||
};
|
||||
// 控制弹窗显示状态
|
||||
const showToggleJianjie = ref(false);
|
||||
openDialog.value = true
|
||||
}
|
||||
|
||||
//禁止用户ctrl+鼠标滚轮 && ctrl + +-缩放页面
|
||||
const disableZoom = () => {
|
||||
const keysToBlock = new Set(["+", "-", "=", "0"])
|
||||
const codesToBlock = new Set(["Equal", "Minus", "NumpadAdd", "NumpadSubtract", "Digit0"])
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && (keysToBlock.has(e.key) || codesToBlock.has(e.code)))
|
||||
e.preventDefault()
|
||||
})
|
||||
document.addEventListener(
|
||||
"wheel",
|
||||
(e) => {
|
||||
if (e.ctrlKey) e.preventDefault()
|
||||
},
|
||||
{ passive: false }
|
||||
)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
disableZoom()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.app-container {
|
||||
width: 100vw;
|
||||
height: 1080px;
|
||||
height: 111vh;
|
||||
background-image: url("./assets/images/bci.png");
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
|
|
@ -178,27 +190,15 @@ const showToggleJianjie = ref(false);
|
|||
}
|
||||
.el-header {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
.toogle-jianjie {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
backdrop-filter: blur(4px);
|
||||
background-color: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
.aside {
|
||||
width: 320px;
|
||||
height: 944px;
|
||||
border: 2px;
|
||||
padding: 16px;
|
||||
left: 16px;
|
||||
color: aliceblue;
|
||||
font-family: Arial, sans-serif;
|
||||
position: absolute;
|
||||
height: 115px;
|
||||
padding: 0;
|
||||
.header-logo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url("./assets/images/head.png");
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
.menu {
|
||||
|
|
@ -208,40 +208,35 @@ const showToggleJianjie = ref(false);
|
|||
border-style: solid;
|
||||
border-image: linear-gradient(to bottom, #3aa1f8, #3aa1f833) 1;
|
||||
background-image: linear-gradient(to right, #063d7133, #081e38cc);
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
width: 288px;
|
||||
height: 176px;
|
||||
}
|
||||
.menu-items {
|
||||
padding: 0 15px;
|
||||
}
|
||||
.menu-title {
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
width: 288px;
|
||||
border-radius: 2px;
|
||||
margin-top: 16px;
|
||||
margin-left: 16px;
|
||||
background-image: linear-gradient(270deg, rgba(6, 61, 113, 0.2) 0%, rgba(8, 30, 56, 0.8) 100%);
|
||||
/* border-image: linear-gradient(to right, #225f9200, #3aa1f8) 1; */
|
||||
border: 2px solid;
|
||||
border-image-source: linear-gradient(90deg, #3AA1F8 0%, rgba(58, 161, 248, 0.2) 100%);
|
||||
border-image-slice: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.menu-title:hover {
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(270deg, rgba(14, 167, 213, 0) 0%, rgba(8, 118, 190, 0.24) 100%);
|
||||
.menu-title {
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
width: 288px;
|
||||
border-radius: 2px;
|
||||
margin-top: 16px;
|
||||
margin-left: 16px;
|
||||
background-image: linear-gradient(270deg, rgba(6, 61, 113, 0.2) 0%, rgba(8, 30, 56, 0.8) 100%);
|
||||
/* border-image: linear-gradient(to right, #225f9200, #3aa1f8) 1; */
|
||||
border: 2px solid;
|
||||
border-image-source: linear-gradient(90deg, #3aa1f8 0%, rgba(58, 161, 248, 0.2) 100%);
|
||||
border-image-slice: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
&:hover {
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(270deg, rgba(14, 167, 213, 0) 0%, rgba(8, 118, 190, 0.24) 100%);
|
||||
}
|
||||
}
|
||||
.menu-items {
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-title.active-parent {
|
||||
/* 设置背景图片 */
|
||||
background-image: url("./assets/images/titleActiveMaskGroup.png"), Linear-gradient(to right,#0876be,#0ea7d500);;
|
||||
background-image:
|
||||
url("./assets/images/titleActiveMaskGroup.png"), Linear-gradient(to right, #0876be, #0ea7d500);
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
position: relative;
|
||||
|
|
@ -286,34 +281,18 @@ const showToggleJianjie = ref(false);
|
|||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
width: 288px;
|
||||
height: 36px;
|
||||
margin-top: 12px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.el-menu-item a {
|
||||
margin-left: 40px;
|
||||
color: aliceblue;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.el-menu-item:hover {
|
||||
background-image: linear-gradient(to right, #0876be, #0ea7d500);
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 1544px;
|
||||
|
||||
margin-left: 360px;
|
||||
margin-top: 16px;
|
||||
.el-main {
|
||||
padding: 0 0;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.main2 {
|
||||
width: 1544px;
|
||||
height: 100%;
|
||||
margin-left: 0px;
|
||||
margin-top: 16px;
|
||||
.el-aside {
|
||||
overflow: visible;
|
||||
color: aliceblue;
|
||||
font-family: Arial, sans-serif;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* src/assets/styles/reset.css */
|
||||
/* 常用的现代 CSS Reset */
|
||||
:where(:root) {
|
||||
line-height: 1.5;
|
||||
height: 100vh;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
|
|
|
|||
30
src/main.js
30
src/main.js
|
|
@ -1,15 +1,15 @@
|
|||
import { createApp } from "vue";
|
||||
import { createPinia } from "pinia";
|
||||
import App from "./App.vue";
|
||||
import ElementPlus from "element-plus";
|
||||
import "./assets/style/reset.css";
|
||||
import "element-plus/dist/index.css"; // 导入所有样式
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
import router from "./router";
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
app.use(pinia);
|
||||
app.use(ElementPlus);
|
||||
app.use(router);
|
||||
app.mount("#app");
|
||||
import { createApp } from "vue"
|
||||
import { createPinia } from "pinia"
|
||||
import App from "./App.vue"
|
||||
import ElementPlus from "element-plus"
|
||||
import "./assets/style/reset.css"
|
||||
import "element-plus/dist/index.css" // 导入所有样式
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate"
|
||||
import router from "./router"
|
||||
const app = createApp(App)
|
||||
const pinia = createPinia()
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
app.use(pinia)
|
||||
app.use(ElementPlus)
|
||||
app.use(router)
|
||||
app.mount("#app")
|
||||
|
|
|
|||
|
|
@ -424,13 +424,6 @@ watch(topicDialog, (val) => {
|
|||
font-weight: 400;
|
||||
opacity: 0.7;
|
||||
}
|
||||
// .search {
|
||||
// width: 360px;
|
||||
// height: 45px;
|
||||
// position: absolute;
|
||||
// top: 18px;
|
||||
// left: 43%;
|
||||
// }
|
||||
.heat {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import removeConsole from "vite-plugin-remove-console"
|
|||
import vue from "@vitejs/plugin-vue"
|
||||
import path from "path"
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), removeConsole()],
|
||||
assetsInclude: ["**/*.csv"], // 明确包含CSV文件
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user