-
{{ currentHoverNumber }}%
-
-
-
-
{{ item.value?item.value:0 }}
-
-
+
diff --git a/web/src/components/Home/Pv.vue b/web/src/components/Home/Pv.vue
index ffafc4a..7503c8b 100644
--- a/web/src/components/Home/Pv.vue
+++ b/web/src/components/Home/Pv.vue
@@ -138,7 +138,7 @@ export default {
}
},
legend: {
- top: 20,
+ top: 10,
textStyle: {
color: '#fff'
}
@@ -147,7 +147,8 @@ export default {
left: '3%',
right: '4%',
bottom: '5%',
- containLabel: true
+ top: '32%',
+ // containLabel: true
},
xAxis: {
type: 'category',
@@ -165,7 +166,7 @@ export default {
lineStyle: { type: 'dashed', color: '#435463' }
},
axisLabel: {
- interval: 4,
+ // interval: 4,
color: '#fff',
fontSize:12
@@ -193,37 +194,4 @@ export default {
}
}
-.text_Cur {
- border-bottom: 1px solid transparent;
- border-top: 1px solid transparent;
- border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
- padding: 0px 15px;
- font-size: 14px;
- margin: 3px 0px;
- height: 45px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- & > div:last-child {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: end;
- }
- .mark {
- font-size: 16px;
- margin-right: 2px;
- }
-
- background: linear-gradient(
- 90deg,
- rgba(0, 186, 173, 0.15) 0%,
- rgba(61, 254, 250, 0.15) 49.2%,
- rgba(61, 254, 250, 0) 100%
- );
- .d {
- margin-left: 1px;
- font-size: 12px;
- }
-}
diff --git a/web/src/components/Home/onLine.vue b/web/src/components/Home/onLine.vue
index c9f551d..eeb1466 100644
--- a/web/src/components/Home/onLine.vue
+++ b/web/src/components/Home/onLine.vue
@@ -28,7 +28,7 @@ export default {
props: {
infoKey: {
type: String,
- default:''
+ default: ''
},
total: {
type: Object,
@@ -98,20 +98,18 @@ export default {
watch: {
total: {
- handler(newVal,oldVal) {
- if (newVal&&newVal!==oldVal) {
+ handler(newVal, oldVal) {
+ if (newVal && newVal !== oldVal) {
this.curList.forEach((item) => {
- item.value = newVal[item.key] || 0;
- });
+ item.value = newVal[item.key] || 0
+ })
}
},
immediate: true,
deep: true
}
},
- mounted() {
- console.log(this.total,'total')
- },
+ mounted() {},
methods: {}
}
@@ -148,14 +146,13 @@ export default {
.content-left,
.content-right {
- width: calc((100% - 110px) / 2);
- // width: 40%;
+ width: 40%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
height: 100%;
- .item{
+ .item {
align-items: flex-start;
justify-content: center;
}
@@ -172,7 +169,7 @@ export default {
}
.online-icon {
- width: 110px;
+ width: 20%;
height: 130px;
background-image: url('@/assets/home/onLineIcon.png');
background-size: contain;
diff --git a/web/src/components/SearchBox.vue b/web/src/components/SearchBox.vue
index 80b0b74..4befc3f 100644
--- a/web/src/components/SearchBox.vue
+++ b/web/src/components/SearchBox.vue
@@ -333,7 +333,7 @@ input:-internal-autofill-selected {
justify-content: space-between;
align-items: center;
.button {
- margin-left: 10px;
+ // margin-left: 10px;
}
}
}
diff --git a/web/src/components/TreeTable.vue b/web/src/components/TreeTable.vue
index 73c8db3..dbc4a82 100644
--- a/web/src/components/TreeTable.vue
+++ b/web/src/components/TreeTable.vue
@@ -10,7 +10,8 @@
:row-class-name="(record, index) => rowClassName(record, index)"
row-key="key"
size="middle"
- :row-selection="rowSelection"
+ :row-selection="newTableOpt.select
+ ?rowSelection:null"
:indent-size="30"
:check-strictly="false"
@resizeColumn="handleResizeColumn"
@@ -100,6 +101,7 @@ export default {
},
computed: {
rowSelection() {
+
const { selectedRowKeys } = this
return {
checkStrictly: this.tableOption.checkStrictly,
@@ -152,7 +154,6 @@ export default {
this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows[selectedRows.length - 1]
this.selectedArr=selectedRows
- console.log(selectedRowKeys, this.selectedArr ,"selectedRowKeys")
this.$emit('getSelectedIds', selectedRowKeys)
},
onSelect(record, selected) {
@@ -439,8 +440,13 @@ export default {
}
:deep(.ant-table-container > .ant-table-content > table) {
+
border-inline-start: 1px solid var(--theme-bg) !important;
}
+ :deep(.ant-table.ant-table-has-fix-left.ant-table-middle.ant-table-bordered){
+ border-radius: 20px !important;
+
+ }
:deep(.ant-pagination-item-link) {
color: var(--theme-text-default) !important;
diff --git a/web/src/components/monitor/device.vue b/web/src/components/monitor/device.vue
index f0f14ae..689d8dc 100644
--- a/web/src/components/monitor/device.vue
+++ b/web/src/components/monitor/device.vue
@@ -376,7 +376,6 @@ export default {
}
},
async openModal(item, val) {
- console.log(item, '=============')
this.modalComponent = val
this.modalOpen = true
if (val == 1) {
diff --git a/web/src/components/statisticalAnalysis/energyEchart.vue b/web/src/components/statisticalAnalysis/energyEchart.vue
index b7c199e..495d6cf 100644
--- a/web/src/components/statisticalAnalysis/energyEchart.vue
+++ b/web/src/components/statisticalAnalysis/energyEchart.vue
@@ -173,6 +173,7 @@ export default {
},
// 初始化柱状图
initBarCharts() {
+
this.chartOptions.forEach((option, index) => {
if (option.type === 'bar') {
const dom = this.$refs[`chartContainer${index}`]?.[0];
diff --git a/web/src/request/index.js b/web/src/request/index.js
index c8e7e27..a5c6afe 100644
--- a/web/src/request/index.js
+++ b/web/src/request/index.js
@@ -1,7 +1,7 @@
import axios from 'axios'
import openNotification from '../utils/notification'
// import { message } from 'ant-design-vue'
-
+import router from 'vue-router'
const service = axios.create({
baseURL: '/api',
timeout: 120000
@@ -17,13 +17,14 @@ service.interceptors.response.use(
const res = response.data
if (res.errCode !== 0) {
+ console.log(res, 'res')
if ((res.ERR_TOKEN = 2 || res.errmsg == '校验token过期')) {
setTimeout(() => {
// router.push({ path: '/login' })
}, 1000)
} else {
console.log(res.errmsg, 'res.errmsg')
- message.error(res.errmsg)
+ // message.error(res.errmsg)
// openNotification({
// status: 'error',
// desc: res.tip
diff --git a/web/src/router/index.js b/web/src/router/index.js
index 6198021..b2d8a11 100644
--- a/web/src/router/index.js
+++ b/web/src/router/index.js
@@ -13,41 +13,48 @@ export const routes = [
{
path: '/',
name: '/',
- redirect: '/Home',
+ redirect: '/home',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "main" */ '@/views/MainView.vue'),
children: [
{
- path: 'Home',
- component: () => import(/* webpackChunkName: "monitor" */ '@/views/sub/Home.vue')
+ path: 'home',
+ component: () => import(/* webpackChunkName: "monitor" */ '@/views/sub/Home.vue'),
+ meta: { requiresAuth: true }
},
{
path: 'monitor',
name: 'monitor',
title: '运行监控',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "monitor" */ '@/views/monitor.vue')
},
{
path: 'predict',
name: 'predict',
title: '预测管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "predict" */ '@/views/predict.vue')
},
{
path: 'statisticalAnalysis',
name: 'statisticalAnalysis',
title: '统计分析',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "monitor" */ '@/views/statisticalAnalysis.vue')
},
{
path: 'system',
name: 'system',
redirect: '/system/user',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/index.vue'),
children: [
{
path: 'user',
name: 'user',
title: '用户管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/user.vue')
},
@@ -55,12 +62,14 @@ export const routes = [
name: 'role',
path: 'role',
title: '角色管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/role.vue')
},
{
name: 'permission',
path: 'permission',
title: '权限管理',
+ meta: { requiresAuth: true },
component: () =>
import(/* webpackChunkName: "system" */ '@/views/system/permission.vue')
},
@@ -68,36 +77,42 @@ export const routes = [
name: 'station',
path: 'station',
title: '场站管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/station.vue')
},
{
name: 'service',
path: 'service',
title: '服务管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/service.vue')
},
{
path: 'policy',
name: 'policy',
title: '策略管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/policy.vue')
},
{
name: 'device',
path: 'device',
title: '设备管理',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/device.vue')
},
{
name: 'alarmlog',
path: 'alarmlog',
title: '告警日志',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/alarmLog.vue')
},
{
name: 'syslog',
path: 'syslog',
title: '系统日志',
+ meta: { requiresAuth: true },
component: () => import(/* webpackChunkName: "system" */ '@/views/system/log.vue')
}
]
@@ -111,22 +126,26 @@ const router = createRouter({
routes
})
+// 全局前置守卫
router.beforeEach((to, from, next) => {
- console.log(to)
- const token = localStorage.getItem('token') || ''
+ const isLoggedIn = localStorage.getItem('token') // 检查用户是否已登录
- if (to.path == '/login') {
- if (token && token != '') {
- next('/')
+ // 2. 如果访问登录页且已登录,跳转到首页
+ if (to.path === '/login' && isLoggedIn) {
+ next('/')
+ return
+ }
+
+ // 3. 检查路由权限
+ if (to.matched.some((record) => record.meta.requiresAuth)) {
+ if (!isLoggedIn) {
+ // 未登录则重定向到登录页,并携带原路径
+ next('/login')
} else {
next()
}
} else {
- if (token && token != '') {
- next()
- } else {
- next('/login')
- }
+ next() // 无需认证的路由直接放行
}
})
diff --git a/web/src/style/antd.scss b/web/src/style/antd.scss
index 2fdb35d..4472c11 100644
--- a/web/src/style/antd.scss
+++ b/web/src/style/antd.scss
@@ -18,8 +18,14 @@ $page-border: #cad2dd;
.ant-switch {
background: #b1c4c4;
}
-.ant-switch.ant-switch-checked{
- background: #00fffb
+.ant-switch.ant-switch-checked {
+ background: #00fffb;
+}
+.ant-select .ant-select-arrow {
+ background: transparent !important;
+}
+.ant-select .ant-select-clear {
+ background: transparent !important;
}
.ant-switch .ant-switch-handle::before {
@@ -58,9 +64,8 @@ $page-border: #cad2dd;
.ant-picker-input input::placeholder {
color: #ffffff3b !important;
}
- .ant-picker-suffix{
+ .ant-picker-suffix {
color: #ffffff !important;
-
}
}
.ant-input-affix-wrapper {
@@ -163,3 +168,38 @@ $page-border: #cad2dd;
color: #fff !important;
}
}
+
+// 添加统一布局的样式
+.text_Cur {
+ border-bottom: 1px solid transparent;
+ border-top: 1px solid transparent;
+ border-image: linear-gradient(to right, transparent, #1d8a7b, transparent) 1;
+ padding: 0px 15px;
+ font-size: 12px;
+ margin: 3px 0px;
+ height: 40px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ & > div:last-child {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: end;
+ }
+ .mark {
+ font-size: 16px;
+ margin-right: 2px;
+ }
+
+ background: linear-gradient(
+ 90deg,
+ rgba(0, 186, 173, 0.15) 0%,
+ rgba(61, 254, 250, 0.15) 49.2%,
+ rgba(61, 254, 250, 0) 100%
+ );
+ .d {
+ margin-left: 1px;
+ font-size: 12px;
+ }
+}
diff --git a/web/src/utils/dealWithData.js b/web/src/utils/dealWithData.js
index c85a981..afe9909 100644
--- a/web/src/utils/dealWithData.js
+++ b/web/src/utils/dealWithData.js
@@ -5,8 +5,6 @@ export function getRunDays(date) {
const timeDiff = today - launchDate // 毫秒差
const daysRun = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)) // 转换为天数
- console.log(`从 2023-01-01 到今天已经运行了 ${daysRun} 天`)
-
return daysRun
}
export function processData(data, keys) {
diff --git a/web/src/views/LoginView.vue b/web/src/views/LoginView.vue
index 2787e4e..aac664d 100644
--- a/web/src/views/LoginView.vue
+++ b/web/src/views/LoginView.vue
@@ -76,7 +76,6 @@ export default {
const res = await getReq('/login',this.form )
this.loading = false
- console.log(res);
if (res.errcode === 0) {
this.$message.success('登录成功')
@@ -91,7 +90,6 @@ export default {
// this.$message.error(res.message || '登录失败')
// }
} catch (error) {
- console.log(error);
this.loading = false
this.$message.error('请求失败,请稍后重试')
diff --git a/web/src/views/MainView.vue b/web/src/views/MainView.vue
index d2a0ac3..3de7552 100644
--- a/web/src/views/MainView.vue
+++ b/web/src/views/MainView.vue
@@ -75,7 +75,6 @@ export default {
$route: {
immediate: true,
handler(to) {
- console.log(this.dynamicMenuList, 'this.dynamicMenuList')
// // 更新当前激活的菜单项
// // this.currentKey = to.matched[0]?.path || ''
this.menuList = this.dynamicMenuList
@@ -147,7 +146,6 @@ export default {
}
},
generateMenu(routes) {
- console.log(routes, 'routes')
return routes.map((route) => ({
...route,
title: route.name,
diff --git a/web/src/views/statisticalAnalysis.vue b/web/src/views/statisticalAnalysis.vue
index 8d585a6..6147dbe 100644
--- a/web/src/views/statisticalAnalysis.vue
+++ b/web/src/views/statisticalAnalysis.vue
@@ -20,7 +20,7 @@
>
@@ -166,7 +166,7 @@ export default {
}
],
chartData: {},
- chartDatav: {},
+ chartDatav: {}
},
2: {
chartOptions: [
@@ -281,19 +281,20 @@ export default {
}
},
activeKey: 1,
- interval:null,
+ interval: null,
tabList: [
{
key: 1,
name: '储能设备'
},
- {
- key: 2,
- name: '光伏设备'
- },
+
{
key: 3,
name: '充电设备'
+ },
+ {
+ key: 2,
+ name: '光伏设备'
}
],
tableList: {
@@ -505,123 +506,115 @@ export default {
watch: {
activeKey: {
handler(newVal) {
- if (!newVal) return;
-
+ if (!newVal) return
+
// 清除之前的数据
- this.resetDataForInactiveKey();
-
+ this.resetDataForInactiveKey()
+
// 并行加载新数据
- Promise.all([
- this.getEchartsListForActiveKey(),
- this.getTableListForActiveKey()
- ]).then(() => {
- this.$nextTick(() => {
- this.getStatCharts();
-
- });
- });
+ Promise.all([this.getStationList(),this.getEchartsListForActiveKey(), this.getTableListForActiveKey()]).then(
+ () => {
+ this.$nextTick(() => {
+ this.getStatCharts()
+ })
+ }
+ )
},
immediate: true // 添加立即执行
}
},
async mounted() {
- // 优先加载第一个页面(activeKey=1)所需的数据
+ // 优先加载第一个页面(activeKey=1)所需的数据
await Promise.all([
this.getStationList(),
this.getEchartsListForActiveKey(),
this.getTableListForActiveKey()
- ]);
-
+ ])
+
// 初始化实时刷新
- this.startRealtimeRefresh();
+ this.startRealtimeRefresh()
},
beforeUnmount() {
- console.log('beforeUnmount')
- clearInterval(this.interval); // 组件销毁时清除定时器
+ clearInterval(this.interval) // 组件销毁时清除定时器
},
methods: {
forceRerender() {
- this.renderKey += 1;
+ this.renderKey += 1
},
resetDataForInactiveKey() {
- // 重置非当前激活页面的数据,减少内存占用
+ // 重置非当前激活页面的数据,减少内存占用
Object.keys(this.echartsInfo).forEach((key) => {
if (key != this.activeKey) {
- this.echartsInfo[key].chartData={}
- this.echartsInfo[key].chartDatav={}
-
+ this.echartsInfo[key].chartData = {}
+ this.echartsInfo[key].chartDatav = {}
}
- });
-
+ })
+
Object.keys(this.tableList).forEach((key) => {
if (key != this.activeKey) {
- this.echartsInfo[key].tableData={}
-
+ this.echartsInfo[key].tableData = {}
}
- });
+ })
},
async getEchartsListForActiveKey() {
- if (!this.activeKey) return;
- this.loading.chart = true;
-
- const currentInfo = this.echartsInfo[this.activeKey];
+ if (!this.activeKey) return
+ this.loading.chart = true
+
+ const currentInfo = this.echartsInfo[this.activeKey]
const query = {
...this.paramsDate,
category: this.activeKey
- };
-
+ }
+
try {
- const res = await getReq('/queryStatDayList', query);
+ const res = await getReq('/queryStatDayList', query)
if (res.errcode === 0) {
- this.echartsInfo[this.activeKey].chartData=res.data
- this.loading.chart = false;
+ this.echartsInfo[this.activeKey].chartData = res.data
+ this.loading.chart = false
} else {
- throw res;
+ throw res
}
} catch (error) {
- this.loading.chart = false;
- this.echartsInfo[this.activeKey].chartData={}
-
+ this.loading.chart = false
+ this.echartsInfo[this.activeKey].chartData = {}
}
},
// 专门获取当前激活页面的表格数据
async getTableListForActiveKey() {
- this.loading.table = true;
- if (!this.activeKey) return;
-
- const currentInfo = this.tableList[this.activeKey];
+ this.loading.table = true
+ if (!this.activeKey) return
+
+ const currentInfo = this.tableList[this.activeKey]
const query = {
...this.paramsDate,
category: this.activeKey,
page_size: currentInfo.pageOption.pageSize,
pageNumber: currentInfo.pageOption.page
- };
-
+ }
+
try {
- const res = await getReq('/queryStatDayList', query);
+ const res = await getReq('/queryStatDayList', query)
if (res.errcode === 0) {
- this.tableList[this.activeKey].tableData=res.data.list || res.data
- this.tableList[this.activeKey].pageOption.count=res.data.count || 0
- this.loading.table = false;
+ this.tableList[this.activeKey].tableData = res.data.list || res.data
+ this.tableList[this.activeKey].pageOption.count = res.data.count || 0
+ this.loading.table = false
} else {
- throw res;
+ throw res
}
} catch (error) {
-
- this.tableList[this.activeKey].tableData=[]
- this.tableList[this.activeKey].pageOption.count= 0
- this.loading.table = false;
+ this.tableList[this.activeKey].tableData = []
+ this.tableList[this.activeKey].pageOption.count = 0
+ this.loading.table = false
}
},
startRealtimeRefresh() {
this.interval = setInterval(() => {
if (this.activeKey) {
- this.getStatCharts(); // 定时获取最新实时数据
+ this.getStatCharts() // 定时获取最新实时数据
}
- }, 10000); // 30秒刷新一次
+ }, 10000) // 30秒刷新一次
},
-
async getStationList() {
const params = {
page_size: 1000,
@@ -655,45 +648,19 @@ export default {
this.tableList[this.activeKey].pageOption.pageSize = e.pageSize
this.tableList[this.activeKey].pageOption.page = e.page
this.getTableListForActiveKey()
-
},
onSearch(data) {
this.paramsDate.start_date = data.time ? data.time[0] : ''
this.paramsDate.end_date = data.time ? data.time[1] : ''
this.tableList[this.activeKey].pageOption.page = 1
- this.getStationList(),
- this.getEchartsListForActiveKey(),
- this.getTableListForActiveKey()
+ this.getStationList(), this.getEchartsListForActiveKey(), this.getTableListForActiveKey()
},
changeStation() {
- this.getStatCharts();
+ this.getStatCharts()
},
-
- // async getEchartsList() {
- // const key = activeKey || this.activeKey;
- // if (!key) return;
- // const currentInfo = this.echartsInfo[this.activeKey]
- // const query = {
- // ...this.paramsDate,
- // category: this.activeKey
- // }
- // try {
- // const res = await getReq('/queryStatDayList', query)
- // if (res.errcode === 0) {
- // this.echartsInfo[this.activeKey].chartData = res.data
- // console.log(
- // this.echartsInfo[this.activeKey].chartData,
- // ' this.echartsInfo[this.activeKey].chartData'
- // )
- // } else {
- // throw res
- // }
- // } catch (error) {
- // this.echartsInfo[this.activeKey].chartData = {}
- // }
- // },
+
async getStatCharts() {
const currentInfo = this.echartsInfo[this.activeKey]
const query = {
@@ -704,97 +671,21 @@ export default {
try {
const res = await getReq('/queryStatCharts', query)
if (res.errcode === 0) {
- this.echartsInfo[this.activeKey].chartDatav = {
- "V":[100.0,100.0,100.0], // 电压曲线
- "I":[10.0,10.0,10.0], // 电流曲线
- "P":[1000.0,1000.0,1000.0], // 功率曲线
- }
-
+ this.echartsInfo[this.activeKey].chartDatav = res.data
// x轴0点到24点
-
-
-
} else {
throw res
}
} catch (error) {
this.echartsInfo[this.activeKey].chartDatav = {
- "V":[100.0,100.0,100.0], // 电压曲线
- "I":[10.0,10.0,10.0], // 电流曲线
- "P":[1000.0,1000.0,1000.0], // 功率曲线
+ V: [100.0, 100.0, 100.0], // 电压曲线
+ I: [10.0, 10.0, 10.0], // 电流曲线
+ P: [1000.0, 1000.0, 1000.0] // 功率曲线
}
}
- },
+ }
- // async getTableList() {
- // const currentInfo = this.tableList[this.activeKey]
- // const query = {
- // ...this.paramsDate,
- // category: this.activeKey,
- // page_size: currentInfo.pageOption.pageSize,
- // pageNumber: currentInfo.pageOption.page
- // }
- // try {
- // const res = await getReq('/queryStatDayList', query)
- // if (res.errcode === 0) {
- // this.tableList[this.activeKey].pageOption.tableData = res.data
- // this.tableList[this.activeKey].pageOption.pageOption = {
- // page: res.data.page,
- // pageSize: res.data.page_size,
- // count: res.data.count
- // }
- // } else {
- // throw res
- // }
- // } catch (error) {
- // this.tableList[this.activeKey].pageOption.tableData = [
- // {
- // key1: '1515151515',
- // key2: '设备1111',
- // key3: '类型',
- // key4: '电量',
- // key5: '时长',
- // key6: '时长',
- // key7: 'dianl',
- // key8: '时长',
- // key9: '时长11'
- // },
- // {
- // key1: '1515151515',
- // key2: '设备1111',
- // key3: '类型',
- // key4: '电量',
- // key5: '时长',
- // key6: '时长',
- // key7: 'dianl',
- // key8: '时长',
- // key9: '时长11'
- // },
- // {
- // key1: '1515151515',
- // key2: '设备1111',
- // key3: '类型',
- // key4: '电量',
- // key5: '时长',
- // key6: '时长',
- // key7: 'dianl',
- // key8: '时长',
- // key9: '时长11'
- // },
- // {
- // key1: '1515151515',
- // key2: '设备1111',
- // key3: '类型',
- // key4: '电量',
- // key5: '时长',
- // key6: '时长',
- // key7: 'dianl',
- // key8: '时长',
- // key9: '时长11'
- // }
- // ]
- // }
- // }
+
}
}
diff --git a/web/src/views/sub/Home.vue b/web/src/views/sub/Home.vue
index 0381e2f..dfb28ea 100644
--- a/web/src/views/sub/Home.vue
+++ b/web/src/views/sub/Home.vue
@@ -48,46 +48,45 @@ import Alarm from '@/components/Home/Alarm.vue'
import Map from '@/components/Home/Map.vue'
import { getReq, postReq } from '@/request/api'
import { getRunDays, getDateDaysAgo } from '@/utils/dealWithData'
-import { markRaw } from 'vue';
+import { markRaw } from 'vue'
export default {
name: 'Home',
components: { Map },
data() {
return {
showFlag: false,
-
stationId: null,
deviceInfo: {},
list: [
{
title: '运行状况',
class: 'online-status',
- componentId:markRaw(onLine),
+ componentId: markRaw(onLine),
infoKey: 'onLineTotal'
},
{
title: '运行分析',
class: 'stats-cards',
- componentId:markRaw( Operational),
- infoKey: ''
+ componentId: markRaw(Operational),
+ infoKey: 'operationTotal'
},
{
title: '储能设备',
class: 'energy-status',
- componentId:markRaw( Energy),
+ componentId: markRaw(Energy),
infoKey: 'energy'
},
{
title: '充电设备',
class: 'charge-analysis',
- componentId:markRaw( Charge),
+ componentId: markRaw(Charge),
infoKey: 'charge'
},
{
title: '光伏设备',
class: 'work-order',
- componentId:markRaw( Pv),
+ componentId: markRaw(Pv),
infoKey: 'pv'
},
{
@@ -114,16 +113,28 @@ export default {
await Promise.all([
this.getOnLineList(),
this.getStatTotalList(),
+ this.getOperTotalList(),
this.getStatDayList(1),
this.getStatDayList(2),
this.getStatDayList(3)
- ])
- // this.showFlag=true
+ ]).then((r) => {
+ if (
+ this.deviceInfo.energy.length &&
+ this.deviceInfo.charge.length &&
+ this.deviceInfo.pv.length
+ ) {
+ const newArr = this.mergedArray(
+ this.deviceInfo.energy,
+ this.deviceInfo.charge,
+ this.deviceInfo.pv
+ )
+ this.deviceInfo.alarm = newArr
+ }
+ })
},
methods: {
getCurrentStation(e) {
- console.log(e, 'getCurrentStation')
this.stationId = e
},
// 查询系统统计信息
@@ -134,7 +145,6 @@ export default {
if (res.errcode === 0) {
this.deviceInfo.onLine = JSON.parse(JSON.stringify(res.data))
this.deviceInfo.onLine.runDays = getRunDays(res.data.launch_date)
- console.log(JSON.parse(JSON.stringify(res.data)), this.deviceInfo.onLine, '111111111111')
} else {
throw res
}
@@ -151,7 +161,7 @@ export default {
// station_id:场站ID,为0或不传查询所有场站总计
// category:类别,1:储能设备,2:充电设备,3:光伏设备,为0或不传查询所有类别总计
const query = {
- date: new Date(),
+ date: getDateDaysAgo(0),
stationId: this.stationId,
category: 0
}
@@ -161,28 +171,25 @@ export default {
const { income_charge: incomeCharge, income_elect: incomeElect } =
this.deviceInfo.allTotal
this.deviceInfo.allTotal.incomeTotal = +incomeCharge + +incomeElect
- console.log(
- this.deviceInfo.allTotal.incomeTotal,
- incomeCharge,
- incomeElect,
- ' this.deviceInfo.allTotal.incomeTotal'
- )
} else {
throw res
}
} catch (error) {
- this.deviceInfo.allTotal = {
- storageElectIn: 2,
- storageElectOut: 5,
- chargeElect: 4,
- chargeNum: 5,
- incomeCharge: 7,
- incomeElect: 7,
- solarElectGen: 7,
- solarElectGrid: 7
+ this.deviceInfo.allTotal = {}
+ this.deviceInfo.allTotal.incomeTotal = 0
+ }
+ },
+ // 运行分析 联调
+ async getOperTotalList() {
+ try {
+ const res = await getReq('/queryStatStation', {})
+ if (res.errcode === 0) {
+ this.deviceInfo.operationTotal = res.data
+ } else {
+ throw res
}
- this.deviceInfo.allTotal.incomeTotal =
- this.deviceInfo.allTotal.incomeCharge + this.deviceInfo.allTotal.incomeElect
+ } catch (error) {
+ this.deviceInfo.operationTotal = [ ]
}
},
@@ -205,18 +212,6 @@ export default {
if (res.errcode === 0) {
this.list.forEach((item) => {
this.deviceInfo[arr[category]] = res.data
- if (
- this.deviceInfo.energy.length &&
- this.deviceInfo.charge.length &&
- this.deviceInfo.pv.length
- ) {
- const newArr = this.mergedArray(
- this.deviceInfo.energy,
- this.deviceInfo.charge,
- this.deviceInfo.pv
- )
- this.deviceInfo.alarm = newArr
- }
})
} else {
throw res
@@ -257,7 +252,7 @@ export default {
}
.tianditu {
- width: calc(100% - 520px * 2);
+ width: 44%;
height: 100%;
margin: 0px 15px;
}
@@ -265,7 +260,7 @@ export default {
.content-left,
.content-right {
height: 100%;
- width: 520px;
+ width: 28%;
display: flex;
flex-direction: column;
align-items: center;
diff --git a/web/src/views/system/permission.vue b/web/src/views/system/permission.vue
index b6ed69f..54d90d4 100644
--- a/web/src/views/system/permission.vue
+++ b/web/src/views/system/permission.vue
@@ -1,11 +1,6 @@