合并代码

This commit is contained in:
ym1026
2025-09-01 17:01:35 +08:00
68 changed files with 3110 additions and 618 deletions

View File

@@ -1,11 +1,32 @@
<template>
<div class="main">
<div class="header"></div>
<div class="page">
<router-view/>
<div class="subMenu" v-if="subMenu.length > 0">
<div
class="subItem"
v-for="subItem in subMenu"
:key="subItem.name"
@click="subMenuClick(subItem)"
:class="subCurrentKey == subItem.path ? 'active' : ''"
>
{{ subItem.title }}
</div>
</div>
<div :class="[subMenu.length > 0 ? 'subcontent' : 'content']">
<router-view />
</div>
</div>
<div class="menu">
<div v-for="menu in menuList" :key="menu.name" class="menu-item">
<div
v-for="menu in menuList"
:key="menu.name"
class="menu-item"
@click="menuClick(menu)"
:class="currentKey == menu.path ? 'active' : ''"
>
<i :class="menu.icon"></i>
{{ menu.name }}
</div>
@@ -21,29 +42,83 @@ export default {
components: {},
data() {
return {
currentKey: '',
subCurrentKey: '',
menuList: [
{
name: '系统总览',
icon: 'icon-xitongguanli'
},
{
name: '运行监控',
path: '/monitor'
},
{
name: '系统管理',
icon: 'icon-xitongguanli',
path: '/system',
children: [
{
name: '用户管理',
icon: 'icon-yonghuguanli',
children: [
{
name: '用户列表',
icon: 'icon-yonghuguanli',
path: '/user/list'
}
]
path: '/user'
},
{
name: '角色管理',
path: '/role'
},
{
name: '权限管理',
icon: 'icon-caidanguanli'
},
{
name: '场站管理',
icon: 'icon-caidanguanli'
},
{
name: '服务管理',
icon: 'icon-bumenguanli'
},
{
name: '策略管理',
path: '/policy'
},
{
name: '设备管理',
icon: 'icon-rizhiguanli'
},
{
name: '告警日志',
icon: 'icon-rizhiguanli'
},
{
name: '系统日志',
icon: 'icon-rizhiguanli'
}
]
}
]
],
subMenu: []
}
},
mounted() {
this.initRoute()
},
methods: {
initRoute() {
console.log(this.$route,this.$router)
this.subMenu = this.$route.matched[1].children || []
this.currentKey = '/' + this.$route.fullPath.split('/')[1]
this.subCurrentKey = this.$route.fullPath.split('/')[2]
console.log(this.subCurrentKey)
},
menuClick(menu) {
this.currentKey = menu.path
this.subMenu = menu.children || []
this.$router.push(menu.path)
},
subMenuClick(subMenu) {
this.subCurrentKey = subMenu.path
this.$router.push(subMenu.path)
}
}
}
@@ -56,18 +131,44 @@ export default {
background-size: 100% 100%;
background-repeat: no-repeat;
}
.header {
.header {
width: 100%;
height: 80px;
border: 1px solid red;
height: 70px;
}
.page{
width: calc(100% - 20px);
height: calc(100% - 80px - 15px - 47px - 60px);
margin: 40px 10px 20px 10px;
border-radius: 20px;
// background: #052F4D;
.subMenu {
display: flex;
color: #fff;
margin-left: 10px;
padding-bottom: 20px;
.subItem {
width: 96px;
height: 36px;
line-height: 36px;
text-align: center;
background: #132347;
border: 1px solid #2169c3;
border-radius: 8px;
margin-right: 15px;
font-size: 14px;
font-weight: 700;
cursor: pointer;
}
.active {
background: #27a188;
}
}
.page {
width: calc(100% - 20px);
height: calc(100% - 70px - 65px - 40px);
margin: 20px 10px;
border-radius: 20px;
}
.content{
height: 100%;
}
.subcontent{
height: calc(100% - 46px);
}
.menu {
position: absolute;
@@ -86,6 +187,11 @@ export default {
color: #fff;
font-size: 20px;
font-weight: 700;
cursor: pointer;
}
.active {
border: 1px solid $border-color;
color: #01b3cd;
}
}
</style>

188
web/src/views/monitor.vue Normal file
View File

@@ -0,0 +1,188 @@
<template>
<div class="monitor">
<div class="search">
<div class="left">
<div class="search-item">
<span>场站切换</span>
<a-cascader v-model:value="value" :options="options" placeholder="Please select" />
</div>
</div>
<div class="right">
<div class="search-item">
<span>运行模式</span>
<a-cascader v-model:value="value" :options="options" placeholder="Please select" />
</div>
<div class="search-item">
<span>策略名称</span>
<a-cascader v-model:value="value" :options="options" placeholder="Please select" />
</div>
<div class="search-item">
<a-button type="primary">调控</a-button>
</div>
</div>
</div>
<div class="content">
<div class="stations">
<div class="station-item" v-for="station in stations" :key="station.name" @click="()=>currentKey=station.name" :class="currentKey==station.name?'active':''">
<span class="name">{{ station.name }}</span>
<span class="des">总功率{{ station.power }} W</span>
<span class="des">数量{{ station.num }}</span>
</div>
</div>
<div class="container">
<device v-if="stationType" />
<videos v-else />
</div>
</div>
</div>
</template>
<script>
import device from '@/components/monitor/device.vue'
import videos from '@/components/monitor/videos.vue'
export default {
name: 'MonitorView',
components: {
device,
videos
},
data() {
return {
currentKey:'储能系统1',
stationType: 1,
value: [],
options: [
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake'
}
]
}
]
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen'
}
]
}
]
}
],
stations: [
{
name: '储能系统1',
power: 60,
num: 62
},
{
name: '储能系统2',
power: 60,
num: 62
}
// {
// name: "储能系统3",
// power: 60,
// num: 62
// },
// {
// name: "储能系统4",
// }
]
}
}
}
</script>
<style scoped lang="scss">
@import url(@/style/color.scss);
.monitor {
width: 100%;
height: 100%;
padding: 20px;
background: $bg1-color;
border-radius: 15px;
.search {
display: flex;
justify-content: space-between;
.search-item {
span {
margin-right: 20px;
}
color: #fff;
margin-left: 30px;
&:first-child {
margin-left: 0;
}
}
.left,
.right {
display: flex;
}
}
.content {
width: 100%;
height: calc(100% - 32px - 20px);
margin-top: 20px;
display: flex;
justify-content: space-between;
.stations {
min-width: 155px;
max-width: 235px;
width: 13%;
height: 100%;
border-radius: 12px;
background: $bg2-color;
padding: 15px 0;
overflow-y: auto;
.station-item {
width: calc(100% - 30px);
margin: 0 15px 15px 15px;
border-radius: 12px;
display: flex;
flex-direction: column;
color: #fff;
padding: 10px 15px;
cursor: pointer;
.name {
font-size: 20px;
font-weight: 700;
line-height: 50px;
}
.des {
font-size: 14px;
font-weight: 600;
line-height: 40px;
}
}
.active{
background: $bg3-color;
}
}
.container {
width: 87%;
display: flex;
}
}
}
</style>

View File

@@ -1,27 +0,0 @@
<template>
<div class="monitor">
<div class="search">
<div class="left">
<div class="search-item">
<span>场站切换</span>
<a-cascader v-model:value="value" :options="options" placeholder="Please select" />
</div>
</div>
<div class="right"></div>
</div>
</div>
</template>
<script setup>
</script>
<style scoped lang="scss">
.monitor{
padding: 10px;
.search{
display: flex;
justify-content: space-between;
}
}
</style>

View File

@@ -0,0 +1,36 @@
<template>
<div class="system">
<router-view/>
</div>
</template>
<script>
export default {
name: '',
components:{
},
props: {
},
data() {
return {
}
},
mounted() {
},
methods:{
},
}
</script>
<style lang="scss" scoped>
.system{
width: 100%;
height: 100%;
background: $bg1-color;
border-radius: 15px;
}
</style>

View File

@@ -0,0 +1,46 @@
<template>
<div class="policy">
<searchBox :btn-option-list="btnOptionList" @onSearch="onSearch" @operateForm="operateForm"/>
</div>
</template>
<script>
import searchBox from '@/components/SearchBox.vue'
export default {
name: '',
components:{searchBox
},
props: {
},
data() {
return {
btnOptionList:[
{label:'新增',icon:'icon-tianjia',type:'add'},
{label:'删除',icon:'icon-tianjia',type:'del'}
]
}
},
mounted() {
},
methods:{
onSearch(data){
console.log(data)
},
operateForm(type){
console.log(type )
},
}
}
</script>
<style lang="scss" scoped>
.policy{
width: 100%;
height: 100%;
padding: 0 15px;
}
</style>

View File

@@ -0,0 +1,30 @@
<template>
<div >
</div>
</template>
<script>
export default {
name: '',
components:{
},
props: {
},
data() {
return {
}
},
mounted() {
},
methods:{
},
}
</script>
<style lang="scss" scoped>
</style>