diff --git a/api/ems/site.js b/api/ems/site.js
index e881768..3b252ce 100644
--- a/api/ems/site.js
+++ b/api/ems/site.js
@@ -104,10 +104,10 @@ export function getSingleSiteBaseInfo(data) {
})
}
-//单站监控 首页 总累计运行数据
-export function getDzjkHomeView(siteId) {
+//单站监控 首页 总累计运行数据(基于日表)
+export function getDzjkHomeTotalView(siteId) {
return request({
- url: `/ems/siteMonitor/homeView?siteId=${siteId}`,
+ url: `/ems/siteMonitor/homeTotalView?siteId=${siteId}`,
method: 'get'
})
}
@@ -138,18 +138,30 @@ export function getSevenChargeData(data) {
})
}
-//单站监控 首页 当日功率曲线
-export function getPointData(data) {
- return request({
- url: `/ems/siteMonitor/getPointData`,
- method: 'get',
- data
- })
-}
-
-// 获取站点包含的设备种类 用来判断单站监控设备监控的菜单栏展示
-export function getSiteAllDeviceCategory(data) {
- return request({
+//单站监控 首页 当日功率曲线
+export function getPointData(data) {
+ return request({
+ url: `/ems/siteMonitor/getPointData`,
+ method: 'get',
+ data
+ })
+}
+
+// 点位配置-曲线数据(与管理端一致)
+export function getPointConfigCurve(data) {
+ return request({
+ url: `/ems/pointConfig/curve`,
+ method: 'post',
+ data,
+ headers: {
+ repeatSubmit: false
+ }
+ })
+}
+
+// 获取站点包含的设备种类 用来判断单站监控设备监控的菜单栏展示
+export function getSiteAllDeviceCategory(data) {
+ return request({
url: `/ems/siteConfig/getSiteAllDeviceCategory`,
method: 'get',
data
diff --git a/components/SiteSelector/index.vue b/components/SiteSelector/index.vue
new file mode 100644
index 0000000..bc03748
--- /dev/null
+++ b/components/SiteSelector/index.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/components/SiteSwitchHeader/index.vue b/components/SiteSwitchHeader/index.vue
new file mode 100644
index 0000000..0747bdd
--- /dev/null
+++ b/components/SiteSwitchHeader/index.vue
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
diff --git a/config.js b/config.js
index 246f0a0..82fbb5d 100644
--- a/config.js
+++ b/config.js
@@ -1,7 +1,7 @@
// 应用全局配置
module.exports = {
// todo 打包项目时切换baseUrl
- //baseUrl: 'http://localhost:8089',
+ // baseUrl: 'http://localhost:8089',
// 测试环境
baseUrl: 'http://110.40.171.179:8089',
// 生产环境
diff --git a/pages/index.vue b/pages/index.vue
index c85c9d0..aacfb8b 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1,20 +1,7 @@
-
-
-
-
-
-
- {{ baseInfo.siteAddress || '-' }}
-
-
-
- {{ baseInfo.runningTime || '-' }}
-
-
-
+
@@ -63,34 +50,37 @@
import {
getAllSites,
getSingleSiteBaseInfo,
- getDzjkHomeView,
+ getDzjkHomeTotalView,
getProjectDisplayData,
getAmmeterRevenueData
} from '@/api/ems/site.js'
+ import SiteSwitchHeader from '@/components/SiteSwitchHeader/index.vue'
+ const createSiteTypeOptions = () => ([{
+ text: '储能',
+ value: 'cn',
+ children: []
+ },
+ {
+ text: '光能',
+ value: 'gn',
+ children: []
+ },
+ {
+ text: '岸电',
+ value: 'ad',
+ children: []
+ }
+ ])
export default {
+ components: {
+ SiteSwitchHeader
+ },
data() {
return {
pageScrollTop: 0,
siteOptions: [],
- siteTypeOptions: [{
- text: '储能',
- value: 'cn',
- children: []
- },
- {
- text: '光能',
- value: 'gn',
- disable: true,
- children: []
- },
- {
- text: '岸电',
- value: 'ad',
- disable: true,
- children: []
- }
- ],
+ siteTypeOptions: createSiteTypeOptions(),
siteId: '',
mapUrl: '',
baseInfo: {},
@@ -251,21 +241,29 @@
getSiteList() {
getAllSites().then(response => {
const data = response?.data || []
- const children = data.map(item => {
- return {
+ const canAccessAll = !this.belongSite || this.belongSite.length === 0 || this.belongSite.includes('all')
+ const siteTypeOptions = createSiteTypeOptions().map(item => ({
+ ...item,
+ children: []
+ }))
+ data.forEach(item => {
+ if (!canAccessAll && !this.belongSite.includes(item.siteId)) return
+ const siteType = (item.siteType || item.type || 'cn').toString().toLowerCase()
+ const typeOption = siteTypeOptions.find(i => i.value === siteType) || siteTypeOptions.find(i => i.value === 'cn')
+ if (!typeOption) return
+ typeOption.children.push({
text: item.siteName,
value: item.siteId,
id: item.id,
longitude: Number(item.longitude || 0),
- latitude: Number(item.latitude || 0),
- disable: !this.belongSite || this.belongSite.length === 0 || this.belongSite.includes('all') ? false : !this
- .belongSite.includes(item.siteId)
- }
+ latitude: Number(item.latitude || 0)
+ })
})
- this.siteTypeOptions.find(i => i.value === 'cn').children = children
- this.siteOptions = children
- const defaultSiteId = this.isAvailableSite(this.currentSiteId) ? this.currentSiteId : (children.find(item => !item
- .disable)?.value || '')
+ this.siteTypeOptions = siteTypeOptions.filter(item => (item.children || []).length > 0)
+ this.siteOptions = this.siteTypeOptions.reduce((result, typeItem) => {
+ return result.concat(typeItem.children || [])
+ }, [])
+ const defaultSiteId = this.isAvailableSite(this.currentSiteId) ? this.currentSiteId : (this.siteOptions[0]?.value || '')
if (defaultSiteId) {
this.siteId = defaultSiteId
this.$store.commit('SET_CURRENTSITEID', defaultSiteId)
@@ -290,7 +288,7 @@
},
getRunningInfo() {
return Promise.all([
- getDzjkHomeView(this.siteId),
+ getDzjkHomeTotalView(this.siteId),
getProjectDisplayData(this.siteId)
]).then(([homeResponse, displayResponse]) => {
this.runningInfo = homeResponse?.data || {}
@@ -416,71 +414,6 @@
padding-top: 0;
}
- .site-sections-list {
- background: linear-gradient(to right, #547ef4, #679ff5);
- padding: 30rpx 30rpx;
- padding-bottom: 100rpx;
- color: #fff;
-
- .info {
- color: #fff;
- font-size: 26rpx;
- line-height: 30rpx;
- vertical-align: middle;
- margin-top: 20rpx;
-
- >.list {
- display: flex;
- justify-content: flex-start;
- align-items: center;
-
- &:not(:last-child) {
- margin-bottom: 20rpx;
- }
-
- >.uni-icons {
- margin-right: 10rpx;
- }
- }
- }
-
- .uni-data-tree {
- ::v-deep {
- .input-value {
- border: none;
- padding-left: 0;
-
- .selected-area {
- width: 90%;
- flex: none;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- .selected-list {
- color: #fff;
- }
- }
-
- .text-color {
- color: #fff;
- font-size: 34rpx;
- line-height: 36rpx;
- font-weight: bolder;
- }
-
- .arrow-area {
- transform: rotate(-135deg);
-
- .input-arrow {
- border-color: #fff;
- }
- }
- }
- }
- }
- }
-
.base-info {
margin-top: -80rpx;
border-radius: 80rpx 80rpx 0 0;
diff --git a/pages/work/index.vue b/pages/work/index.vue
index 0d0808e..c655681 100644
--- a/pages/work/index.vue
+++ b/pages/work/index.vue
@@ -1,32 +1,20 @@
-
-
-
-
-
-
-
- {{baseInfo.siteAddress || '-'}}
-
-
-
- {{baseInfo.runningTime || '-'}}
-
-
-
+
+
+
- 装机功率(MW)
+ 装机功率(MWh)
{{baseInfo.installPower | formatNumber}}
- 装机容量(MW)
+ 装机容量(MWh)
{{baseInfo.installCapacity | formatNumber}}
@@ -66,29 +54,49 @@