This commit is contained in:
zhouhuang 2024-11-25 10:59:36 +08:00
commit dbb8a120d7
28 changed files with 531 additions and 406 deletions

38
Jenkinsfile vendored
View File

@ -1,15 +1,17 @@
pipeline {
parameters {
choice choices: ['all', 'ui', 'service'], description: 'all - 前端和后端 ; ui - 仅发版前端 ; service - 仅发版后端', name: 'publish_type'
choice choices: ['all', 'ui', 'dn', 'service'], description: 'all - 前端和后端 ; ui - 仅发版前端 ; dn - 采集程序 service - 仅发版后端', name: 'publish_type'
}
agent any
agent none
stages {
stage('拉取源码') {
agent any
steps {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'd62224c5-69cf-474a-8845-c2c2bbe1fc00', url: 'https://git.jsspisoft.com/ry-das.git']])
}
}
stage('编译UI') {
agent any
when {
expression { params.publish_type == "ui" || params.publish_type == "all" }
}
@ -23,6 +25,7 @@ pipeline {
}
}
stage('编译后端') {
agent any
when {
expression { params.publish_type == "service" || params.publish_type == "all" }
}
@ -34,8 +37,24 @@ pipeline {
}
}
}
stage('编译采集程序') {
agent {
docker {
image 'docker.jsspisoft.com/common/openeuler:24.03-builder'
}
}
when {
expression { params.publish_type == "dn" || params.publish_type == "all" }
}
steps {
dir("$WORKSPACE/das-dn") {
sh 'cmake --preset default'
sh 'cmake --build build'
}
}
}
stage('发版前端') {
agent any
when {
expression { params.publish_type == "ui" || params.publish_type == "all" }
}
@ -46,6 +65,7 @@ pipeline {
}
}
stage('发版后端') {
agent any
when {
expression { params.publish_type == "service" || params.publish_type == "all" }
}
@ -56,5 +76,17 @@ pipeline {
}
}
}
stage('发版采集程序') {
agent any
when {
expression { params.publish_type == "dn" || params.publish_type == "all" }
}
steps {
dir("$WORKSPACE/das-dn") {
sh 'sudo rsync -av build/application root@192.168.109.187:/das/app/das-dn/bin/'
sh 'sudo ssh -t root@192.168.109.187 systemctl restart das-dn'
}
}
}
}
}

View File

@ -11,6 +11,8 @@ public class DeviceEventInfo {
@JsonSerialize(using = ToStringSerializer.class)
private Long eventId;
private String attributeCode;
private Integer eventType;
private Integer eventLevel;

View File

@ -255,7 +255,7 @@ public class TDEngineService {
});
//初始化event_info
String eventInfo = "create stable IF NOT EXISTS event_info (event_time timestamp,event_id bigint primary key,event_type tinyint,event_level tinyint,event_text varchar(256),confirmed tinyint,confirm_account varchar(32),confirm_time timestamp) tags (device_id bigint,device_code varchar(64),device_name varchar(192))";
String eventInfo = "create stable IF NOT EXISTS event_info (event_time timestamp,event_id bigint primary key,attributecode varchar(64),event_type tinyint,event_level tinyint,event_text varchar(256),confirmed tinyint,confirm_account varchar(32),confirm_time timestamp) tags (device_id bigint,device_code varchar(64),device_name varchar(192))";
try {
pstmt.executeUpdate(eventInfo);
} catch (SQLException ex) {
@ -399,7 +399,9 @@ public class TDEngineService {
sb.append(dv.getEventTime());
sb.append(",");
sb.append(dv.getEventId());
sb.append(",");
sb.append(",'");
sb.append(dv.getAttributeCode());
sb.append("',");
sb.append(dv.getEventType());
sb.append(",");
sb.append(dv.getEventLevel());
@ -417,7 +419,7 @@ public class TDEngineService {
pstmt.executeUpdate(sb.toString());
log.info("告警信息入库:{}",sb.toString());
} catch (SQLException ex) {
log.error("save yc error", ex);
log.error("save deviceEvent error", ex);
}
});
} catch (SQLException ex) {

View File

@ -218,7 +218,7 @@ public class DataServiceImpl implements DataService {
Map<String, String> HighModelFieldList = allIotModelField.stream().filter(field -> field.getHighSpeed() == 1 && field.getAttributeType() != 199).collect(Collectors.toMap(SysIotModelField::getAttributeCode, SysIotModelField::getDataType, (value1, value2) -> value1));
Map<String, String> calculateFieldList = allIotModelField.stream().filter(field -> field.getAttributeType() == 199).collect(Collectors.toMap(SysIotModelField::getAttributeCode, SysIotModelField::getDataType, (value1, value2) -> value1));
Map<String, String> fieldCodeNameList = allIotModelField.stream().collect(Collectors.toMap(SysIotModelField::getAttributeCode, SysIotModelField::getAttributeName, (value1, value2) -> value1));
Map<String, Integer> eventLevelList = allIotModelField.stream().filter(field -> field.getAttributeType() == 140 && field.getLevel() != null).collect(Collectors.toMap(SysIotModelField::getAttributeCode, SysIotModelField::getLevel, (value1, value2) -> value1));
Map<String, Integer> eventLevelList = allIotModelField.stream().collect(Collectors.toMap(SysIotModelField::getAttributeCode, SysIotModelField::getLevel, (value1, value2) -> value1));
Map<String, Object> map = new HashMap<>();
for (String field : HighModelFieldList.keySet()) {
map.put(field, HighModelFieldList.get(field));

View File

@ -161,8 +161,6 @@ public class SysEnumServiceImpl implements SysEnumService {
PageQuery pageQuery = new PageQuery();
pageQuery.setPageNum(sysEnumValuesDto.getPageNum());
pageQuery.setPageSize(sysEnumValuesDto.getPageSize());
//只返回有效的数据
sysEnumValuesDto.setIsActive(1);
IPage<SysEnumValuesVo> iPage =
sysEnumValuesMapper.queryEnumValuesList(pageQuery.build(), sysEnumValuesDto);
return PageDataInfo.build(iPage.getRecords(), iPage.getTotal());

View File

@ -622,6 +622,17 @@ public class SysIotModelServiceImpl implements SysIotModelService {
else {
fieldCodeNameMap.put(sysIotModelField.getAttributeCode(), sysIotModelField.getAttributeName());
}
if (sysIotModelField.getLevel() != null){
Map<String, Integer> levelMap = dataService.eventLevelMap.get(modelCode);
if (levelMap == null) {
Map<String, Integer> calMap = new HashMap<>();
calMap.put(sysIotModelField.getAttributeCode(), sysIotModelField.getLevel());
dataService.eventLevelMap.put(modelCode, calMap);
} else {
levelMap.put(sysIotModelField.getAttributeCode(), sysIotModelField.getLevel());
}
}
if (sysIotModelField.getAttributeType() == 199) {
Map<String, String> map = dataService.calculateIotFieldMap.get(modelCode);
if (map == null) {
@ -670,6 +681,9 @@ public class SysIotModelServiceImpl implements SysIotModelService {
String modelCode = dataService.iotModelMap.get(sysIotModelField.getIotModelId().toString());
Map<String, String> fieldCodeName = dataService.fieldCodeNameMap.get(modelCode);
fieldCodeName.remove(sysIotModelField.getAttributeCode());
if (sysIotModelField.getLevel() != null){
dataService.eventLevelMap.remove(sysIotModelField.getAttributeCode());
}
if (sysIotModelField.getAttributeType() == 199) {
Map<String, String> map = dataService.calculateIotFieldMap.get(modelCode);
map.remove(sysIotModelField.getAttributeCode());

View File

@ -346,6 +346,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
DeviceEventInfo deviceEventInfo = new DeviceEventInfo();
deviceEventInfo.setEventTime(item.getEventTime());
deviceEventInfo.setEventId(IdWorker.getId());
deviceEventInfo.setAttributeCode(item.getAttrCode());
deviceEventInfo.setDeviceId(item.getDeviceId());
deviceEventInfo.setDeviceName(deviceInfoCache.getDeviceName());
deviceEventInfo.setDeviceCode(deviceInfoCache.getDeviceCode());
@ -363,10 +364,14 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
if (!StringUtils.isEmpty(eventType) && eventType.equals("遥信变位")) {
if (item.getAttrValue().equals(0)) {
deviceEventInfo.setEventText(fieldName + " 复归");
deviceEventInfo.setEventLevel(0);
} else {
deviceEventInfo.setEventText(fieldName + " 动作");
deviceEventInfo.setEventLevel(dataService.eventLevelMap.get(model).get(fieldName));
Integer level = dataService.eventLevelMap.get(model).get(item.getAttrCode());
log.info("level:{}",level);
log.info("fieldname{}",fieldName);
deviceEventInfo.setEventLevel( level == null ? 0 : level);
}
} else {
deviceEventInfo.setEventText(fieldName + eventType + ",属性值为:" + item.getAttrValue() + ",越限值为:" + item.getLimitValue());

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class WindFarmRealDataDto implements Serializable {
@ -21,4 +22,9 @@ public class WindFarmRealDataDto implements Serializable {
* 风场名称
*/
private String WindFarmName;
/**
* 物模型属性
*/
private List<String> attributesList;
}

View File

@ -122,24 +122,8 @@ public class HomeServiceImpl implements HomeService {
windFarmId = defaultWindFarmId;
}
List<SnapshotValueQueryParam> paramList = new ArrayList<>();
//构建需要查询的物模型属
List<String> attributesList = new ArrayList<>();
//功率
attributesList.add("windfarmactivepower");
//平均风速
attributesList.add("windfarmavgwindspeed");
//日利用小时
attributesList.add("windfarmdayoperationhours");
//月利用小时
attributesList.add("windfarmmonthoperationhours");
//日发电量
attributesList.add("windfarmdayprodenergy");
//月发电量
attributesList.add("windfarmmonthprodenergy");
//年发电量
attributesList.add("windfarmyearprodenergy");
//总发电量
attributesList.add("windfarmtotalprodenergy");
//构建需要查询的物模型属
List<String> attributesList = windFarmRealDataDto.getAttributesList();
//构建查询属性参数
SnapshotValueQueryParam snapshotValueQueryParam = new SnapshotValueQueryParam();
snapshotValueQueryParam.setAttributes(attributesList);

View File

@ -20,7 +20,7 @@
<if test="sysEnumValuesDto.enumTypeId != null and sysEnumValuesDto.enumTypeId != ''">
and e.enum_type_id =#{sysEnumValuesDto.enumTypeId}
</if>
<if test="sysEnumValuesDto.isActive != null and sysEnumValuesDto.isActive != ''">
<if test="sysEnumValuesDto.isActive != null ">
and e.is_active =#{sysEnumValuesDto.isActive}
</if>
order by e.order_number asc

View File

@ -78,7 +78,7 @@
where se.id = #{id}
</select>
<select id="getAllIotModelField" resultType="com.das.modules.equipment.entity.SysIotModelField">
select simf.attribute_name as attributeName, simf.attribute_code as attributeCode,simf.highspeed as highSpeed,simf.datatype as dataType,simf.attribute_type as attributeType from sys_iot_model_field simf where simf.iot_model_id = #{id} order by simf.attribute_code
select simf.attribute_name as attributeName, simf.attribute_code as attributeCode,simf.highspeed as highSpeed,simf.datatype as dataType,simf.attribute_type as attributeType,simf.level as level from sys_iot_model_field simf where simf.iot_model_id = #{id} order by simf.attribute_code
</select>

View File

@ -63,12 +63,7 @@ PS: 同一节点只允许建立一条连接。
"protocol": 1,
//协议参数
"params": {},
"devices": ["11234131","1234123"]
}
],
//物模型信息
"equipments": [
{
"devices": [ {
//设备ID
"id": "11234131",
//设备IOT地址
@ -128,9 +123,204 @@ PS: 同一节点只允许建立一条连接。
}
}
]
}, {
//设备ID
"id": "11234131",
//设备IOT地址
"addr": "12341235",
//属性列表
"attrs":[
{
//属性名
"name": "Ia",
//属性类型
"type": "yc",
//是否高频属性, 0 - 不是, 1 - 是
"highSpeed": 1,
//属性参数
"params": {
//上界
"upBound": 9999,
//下界
"lowBound": 0,
//基值, default: 0
"base": 0,
//系数, default: 1
"coef": 1,
//限值1, default: 0
"limit1Enable": 0,
//限值1下限
"limit1Low": 123.0,
//限值1上限
"limit1High": 999.0,
//限值2, default: 0
"limit2Enable": 0,
//限值2上限
"limit2High": 999.0,
//限值2下限
"limit2Low": 0.0
}
},
{
"name": "Switch01",
"type": "yx",
"params": {
//是否取反,default: 0
"invert": 0
}
}
],
//服务列表
"services": [
{
//服务名
"name": "start",
//服务类型
"type": "yk",
//服务参数
"params": {
}
}
]
}]
},
{
//链路ID
"linkId": "1235112",
//链路名称
"linkName": "2#风机",
//协议号
"protocol": 12,
//协议参数
"params": {},
"devices": [ {
//设备ID
"id": "11234131",
//设备IOT地址
"addr": "12341235",
//属性列表
"attrs":[
{
//属性名
"name": "Ia",
//属性类型
"type": "yc",
//是否高频属性, 0 - 不是, 1 - 是
"highSpeed": 1,
//属性参数
"params": {
//上界
"upBound": 9999,
//下界
"lowBound": 0,
//基值, default: 0
"base": 0,
//系数, default: 1
"coef": 1,
//限值1, default: 0
"limit1Enable": 0,
//限值1下限
"limit1Low": 123.0,
//限值1上限
"limit1High": 999.0,
//限值2, default: 0
"limit2Enable": 0,
//限值2上限
"limit2High": 999.0,
//限值2下限
"limit2Low": 0.0
}
},
{
"name": "Switch01",
"type": "yx",
"params": {
//是否取反,default: 0
"order": 0,
"invert": 0
}
}
],
//服务列表
"services": [
{
//服务名
"name": "start",
//服务类型
"type": "yk",
//服务参数
"params": {
"order": 0
}
}
]
}, {
//设备ID
"id": "11234131",
//设备IOT地址
"addr": "12341235",
//属性列表
"attrs":[
{
//属性名
"name": "Ia",
//属性类型
"type": "yc",
//是否高频属性, 0 - 不是, 1 - 是
"highSpeed": 1,
//属性参数
"params": {
"order": 0
//上界
"upBound": 9999,
//下界
"lowBound": 0,
//基值, default: 0
"base": 0,
//系数, default: 1
"coef": 1,
//限值1, default: 0
"limit1Enable": 0,
//限值1下限
"limit1Low": 123.0,
//限值1上限
"limit1High": 999.0,
//限值2, default: 0
"limit2Enable": 0,
//限值2上限
"limit2High": 999.0,
//限值2下限
"limit2Low": 0.0
}
},
{
"name": "Switch01",
"type": "yx",
"params": {
//是否取反,default: 0
"invert": 0,
"order": 0
}
}
],
//服务列表
"services": [
{
//服务名
"name": "start",
//服务类型
"type": "yk",
//服务参数
"params": {
"order": 0
}
}
]
}]
}
]
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -184,12 +184,16 @@ function createAxios<Data = any, T = ApiPromise<Data>>(axiosConfig: AxiosRequest
error.config && removePending(error.config)
options.loading && closeLoading(options) // 关闭loading
options.showErrorMessage && httpErrorStatusHandle(error) // 处理错误状态码
if (error.response.status == 401) {
let routerPath = adminBaseRoute.path
adminInfo.removeToken()
routerPath += '/login'
router.push({ path: routerPath })
if (error.response){
if (error.response.status == 401) {
let routerPath = adminBaseRoute.path
adminInfo.removeToken()
routerPath += '/login'
router.push({ path: routerPath })
}
}
return Promise.reject(error) // 错误继续返回给到具体页面
}
)

View File

@ -1,25 +1,117 @@
<template>
<div class="default-main" ref="HomeHight">
<el-row style="margin: 0px;">
<el-col :md="24" :lg="24" class="col-top">
<el-row class="overview">
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem" style="margin-left: 0px;">
<img class="small-panel-pic" src="~assets/dashboard/overview01.png" alt="" />
<div class="small-base">
<div class="small-title">全场平均风速</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmavgwindspeed}}</span>
<span>m/s</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem">
<img class="small-panel-pic" src="~assets/dashboard/overview02.png" alt="" />
<div class="small-base">
<div class="small-title">全场实时有功</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmactivepower}}</span>
<span>MW</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem">
<img class="small-panel-pic" src="~assets/dashboard/overview03.png" alt="" />
<div class="small-base">
<div class="small-title">全场实时无功</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmreactivepower}}</span>
<span>kvar</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem">
<img class="small-panel-pic" src="~assets/dashboard/overview04.png" alt="" />
<div class="small-base">
<div class="small-title">日发电量</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmdayprodenergy}}</span>
<span>kWh</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem">
<img class="small-panel-pic" src="~assets/dashboard/overview05.png" alt="" />
<div class="small-base">
<div class="small-title">本月发电量</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmmonthprodenergy}}</span>
<span>kWh</span>
</div>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="8" :md="8" :lg="4">
<div class="overviewItem" style="margin-right: 0px;">
<img class="small-panel-pic" src="~assets/dashboard/overview06.png" alt="" />
<div class="small-base">
<div class="small-title">年发电量</div>
<div class="small-value">
<span class="content-number">{{realData.attributeMap.windfarmyearprodenergy}}</span>
<span>kWh</span>
</div>
</div>
</div>
</el-col>
</el-row>
</el-col>
<el-col :md="24" :lg="24">
<div class="AlertPart">
<div class="AlertPic">
<img src="~assets/dashboard/alert01.png" alt="">
</div>
<div class="realAlert"
ref="scrollRef"
@mouseover.native="clearScroll"
@mouseleave.native="createScroll"
>
<p v-for="(item,index) in tableData"
:key="index"
@mouseover="showButton"
@mouseout="hideButton"
>
<span>{{item.eventTimeFormate}}</span>
<span>{{item.deviceCode}}</span>
<span>{{item.eventText}}</span>
<span v-show="showConfirmButton" >
<a style="color: #0277b3; cursor: pointer;" @click="open(item)" >确认</a>
</span>
</p>
</div>
</div>
</el-col>
<el-col :md="24" :lg="24" class="col-center" style="padding-right: 10px;">
<div class="grid-content ep-bg-purple-light">
<!--风机矩阵-->
<div class="matrix panelBg">
<div class="homeHeader">
<div class="cardLabel">风机矩阵</div>
<div class="realAlert"
ref="scrollRef"
@mouseover.native="clearScroll"
@mouseleave.native="createScroll">
<p v-for="(item,index) in tableData"
:key="index"
@click="open(item)" >
<span>{{item.deviceCode}}</span>
<span>{{item.eventText}}</span>
<span>{{item.eventTimeFormate}}</span>
</p>
<!-- <span v-if="tableData.length==0">暂无告警</span>-->
</div>
</div>
<el-scrollbar>
@ -28,29 +120,6 @@
</div>
</div>
</el-col>
<!-- <el-col :md="24" :lg="8" style="padding: 0px">
<div class="grid-content ep-bg-purple cardContentRight">
&lt;!&ndash;实时告警&ndash;&gt;
<div class="realPart panelBg" style="margin-bottom: 0">
<el-text class="mx-1 homelabel">实时告警</el-text>
<div class="realAlert"
ref="scrollRef"
@mouseover.native="clearScroll"
@mouseleave.native="createScroll">
<ul>
<li v-for="(item,index) in tableData"
:key="index"
@click="open(item)"
>
<span>{{item.deviceCode}}</span>
<span>{{item.eventText}}</span>
<span>{{item.eventTimeFormate}}</span>
</li>
</ul>
</div>
</div>
</div>
</el-col>-->
</el-row>
</div>
</template>
@ -79,6 +148,17 @@ const realData = ref({
attributeMap: {},
})
const attributeList = ref({
attributesList:[
'windfarmactivepower',
'windfarmreactivepower',
'windfarmavgwindspeed',
'windfarmdayprodenergy',
'windfarmmonthprodenergy',
'windfarmyearprodenergy',
]
})
const formatAttributeValue = (value: any) => {
if (value === undefined) {
return '-'
@ -89,27 +169,23 @@ const formatAttributeValue = (value: any) => {
return value % 1 === 0 ? value : value.toFixed(2)
}
const overviewList = () => {
getWindFarmRealData().then((res) => {
getWindFarmRealData(attributeList.value).then((res) => {
if (res.code == 200) {
res.data.attributeMap.windfarmactivepower = formatAttributeValue(res.data.attributeMap.windfarmactivepower)
res.data.attributeMap.windfarmreactivepower = formatAttributeValue(res.data.attributeMap.windfarmreactivepower)
res.data.attributeMap.windfarmavgwindspeed = formatAttributeValue(res.data.attributeMap.windfarmavgwindspeed)
res.data.attributeMap.windfarmdayprodenergy = formatAttributeValue(res.data.attributeMap.windfarmdayprodenergy)
res.data.attributeMap.windfarmmonthprodenergy = formatAttributeValue(res.data.attributeMap.windfarmmonthprodenergy)
res.data.attributeMap.windfarmactivepower = formatAttributeValue(res.data.attributeMap.windfarmactivepower)
res.data.attributeMap.windfarmavgwindspeed = formatAttributeValue(res.data.attributeMap.windfarmavgwindspeed)
res.data.attributeMap.windfarmdayoperationhours = formatAttributeValue(res.data.attributeMap.windfarmdayoperationhours)
res.data.attributeMap.windfarmmonthoperationhours = formatAttributeValue(res.data.attributeMap.windfarmmonthoperationhours)
res.data.attributeMap.windfarmyearprodenergy = formatAttributeValue(res.data.attributeMap.windfarmyearprodenergy)
res.data.attributeMap.windfarmtotalprodenergy = formatAttributeValue(res.data.attributeMap.windfarmtotalprodenergy)
const data: any = {
windFarmId: res.data.windFarmId,
attributeMap: {
windfarmactivepower: res.data.attributeMap.windfarmactivepower,
windfarmreactivepower: res.data.attributeMap.windfarmreactivepower,
windfarmavgwindspeed: res.data.attributeMap.windfarmavgwindspeed,
windfarmdayprodenergy: res.data.attributeMap.windfarmdayprodenergy,
windfarmmonthprodenergy: res.data.attributeMap.windfarmmonthprodenergy,
windfarmactivepower: res.data.attributeMap.windfarmactivepower,
windfarmavgwindspeed: res.data.attributeMap.windfarmavgwindspeed,
windfarmdayoperationhours: res.data.attributeMap.windfarmdayoperationhours,
windfarmmonthoperationhours: res.data.attributeMap.windfarmmonthoperationhours,
windfarmyearprodenergy: res.data.attributeMap.windfarmyearprodenergy,
windfarmtotalprodenergy: res.data.attributeMap.windfarmtotalprodenergy,
windfarmyearprodenergy: res.data.attributeMap.windfarmyearprodenergy
},
}
@ -266,17 +342,13 @@ const timestampToTime = (timestamp: any) => {
const tableData = ref()
const getTableData = (deviceCode) => {
const today = new Date()
const threeDaysAgo = new Date(today)
threeDaysAgo.setDate(today.getDate() - 3)
const startTime = threeDaysAgo.getTime()
const data: any = {
startTime: startTime,
startTime: new Date(new Date().toLocaleDateString()).getTime(),
endTime: Date.now(),
deviceCode: deviceCode,
limit: 100,
eventLevel:2
}
console.log(JSON.stringify(data))
getAlarmListReq(data).then((res) => {
if (res.code == 200) {
//tableData.value = res.rows
@ -332,6 +404,13 @@ const okSubmit = (val: any) => {
}
const scrollRef=ref()
const showConfirmButton = ref(false)
const showButton = () => {
showConfirmButton.value = true;
}
const hideButton = () => {
showConfirmButton.value = false;
}
const clearScroll = () => {
clearInterval(timer)
}
@ -374,12 +453,12 @@ const computedHeight = reactive({
const sizeChange = () => {
const rect = HomeHight.value?.getBoundingClientRect()
if (!rect) return
computedHeight.powerHeight = rect.height - 630 + 'px'
computedHeight.alarmHeight = rect.height - 5 + 'px'
computedHeight.centerHeight = rect.height - 0 + 'px'
computedHeight.centerHeight = rect.height - 190 + 'px'
if (window.screen.width < 1360) {
computedHeight.alarmHeight = '300px'
computedHeight.powerHeight = '200px'
computedHeight.centerHeight = rect.height - 0 + 'px'
}
if (rect.width < 1360) {
computedHeight.centerHeight = rect.height - 0 + 'px'
}
}
@ -388,7 +467,7 @@ onMounted(() => {
sizeChange()
//getAllChartData()
createScroll()
// overviewList()
overviewList()
StatusListData()
autoUpdate()
@ -448,7 +527,7 @@ $labelHeight: 30px;
}
.content-number {
color: #333333;
font-size: 20px;
font-size: 28px;
}
.homelabel {
font-family: PingFangSC-Semibold;
@ -460,6 +539,54 @@ $labelHeight: 30px;
margin-bottom: 10px;
display: block;
}
.overview {
width: calc(100% - 10px);
height: 100%;
.overviewItem{
height: 100px;
display: flex;
background: #FFFFFF;
border-radius: 6px;
margin: 5px;
align-items: center;
color: #4E5969;
.small-panel-pic{
width: 80px;
height: 80px;
}
}
}
.AlertPart{
width: calc(100% - 10px);
height: 60px;
margin: 10px 0;
background-image: linear-gradient(90deg, #FFE3E3 0%, #FBFDFF 100%);
border: 2px solid #FFFFFF;
border-radius: 6px;
display: flex;
align-items: center;
.AlertPic{
width: 50px;
text-align: center;
img{
width: 24px;
height: 24px;
}
}
.realAlert{
overflow: hidden;
white-space: nowrap;
cursor: pointer;
font-size: 20px;
color: #333333;
width: 100%;
p{
padding-right: 30px;
display: inline-block;
}
}
}
.grid-content {
/* overflow-x: hidden;*/
width: 100%;
@ -470,83 +597,11 @@ $labelHeight: 30px;
border-radius: 5px;
margin-bottom: 10px;
}
.overview {
/* @include cardDefaultStyle;
@include cardlabel;*/
min-height: 216px;
.small-panel {
display: flex;
border: 1px solid #e1edf6;
border-radius: 10px;
padding: 10px;
.small-panel-pic {
width: 36px;
height: 36px;
}
.small-base {
word-break: keep-all;
margin-left: 10px;
color: #2c3f5d;
}
}
}
.status {
/* @include cardDefaultStyle;
@include cardlabel;*/
min-height: 374px;
.statusrow {
margin-bottom: 10px;
}
.status-con {
padding-left: 20px !important;
background: #f0f6ff;
border-radius: 10px;
}
.status-panel {
display: flex;
padding: 10px;
font-size: 12px;
.status-panel-pic {
width: 60px;
height: 60px;
}
.status-base-main {
word-break: keep-all;
margin-left: 10px;
line-height: 23px;
padding-top: 6px;
}
.status-base {
margin-left: 10px;
line-height: 23px;
padding: 6px 10px 0 10px;
display: flex;
justify-content: space-between;
width: 100%;
}
.status-panel-piczt {
width: 24px;
height: 24px;
}
}
}
.power {
@include cardDefaultStyle;
@include cardlabel;
width: 100%;
min-height: 290px;
height: v-bind('computedHeight.powerHeight');
.chartBox {
height: calc(100% - $labelHeight);
.power-chart {
width: 100%;
height: 100%;
}
}
}
.matrix {
@include cardlabel;
background: url('/@/assets/dashboard/bg1.png') no-repeat #ffffff;
background: url('/@/assets/dashboard/bg2.png') no-repeat #ffffff;
background-size: 100% 100%;
/* min-height: 900px;*/
width: 100%;
@ -561,170 +616,23 @@ $labelHeight: 30px;
width: 100px;
}
}
.realAlert{
overflow: hidden;
white-space: nowrap;
cursor: pointer;
line-height: 30px;
width: 100%;
font-size: 16px;
p{
padding-right: 30px;
display: inline-block;
}
}
}
.summarize {
padding: 10px;
border-radius: 10px;
background-color: #fff;
margin-bottom: 20px;
word-break: keep-all;
@include cardlabel;
min-height: 224px;
.summarize-panel-list {
width: 100%;
display: flex;
justify-content: space-between;
}
.summarize-panel {
margin: 5px;
width: 25%;
display: flex;
padding: 20px 0;
flex-direction: column;
align-items: center;
background-color: #f0f6ff;
border-radius: 10px;
.summarize-panel-base {
width: 100%;
flex-direction: column;
align-items: center;
div {
display: flex;
justify-content: center;
font-size: 14px;
color: rgb(78, 89, 105);
.content-number {
color: #333333;
font-size: 20px;
}
}
}
}
}
.trend {
min-height: 300px;
height: 335px;
overflow: hidden;
.trend-tabs {
:deep(.el-tabs__item) {
border: none;
text-align: center;
width: 40px;
padding: 0;
line-height: 24px;
height: 24px;
}
:deep(.el-tabs__header .el-tabs__nav) {
border-radius: 0;
border: none;
}
:deep(.el-tabs__header) {
border-bottom: 0;
float: right;
margin-top: -43px;
}
:deep(.el-tabs__content) {
clear: both;
}
:deep(.el-tabs__item.is-active) {
background: rgba(2, 119, 179, 0.2);
border-radius: 4px;
border: none;
}
:deep(.el-tabs__nav-wrap:after) {
background: none;
}
:deep(.el-tabs__active-bar) {
background: none;
}
}
.trend-chart {
width: 100%;
height: 260px;
}
}
.realPart {
height: v-bind('computedHeight.alarmHeight');
.realAlert{
height: calc(100% - 20px);
overflow: hidden;
ul li{
list-style: none;
line-height: 30px;
border-bottom: 1px #dddddd dashed;
cursor: pointer;
}
}
}
}
}
@media screen and (max-width: 1920px) {
.default-main {
.trend {
height: 315px !important;
}
}
}
@media screen and (max-width: 1280px) {
.default-main {
/*height: auto !important;*/
.windtitle {
margin-bottom: 10px;
}
.summarize {
.summarize-panel {
margin: 2px !important;
.summarize-panel-base {
white-space: normal !important;
}
}
}
}
}
@media screen and (max-width: 1360px) {
.default-main {
font-size: 11px !important;
.summarize {
word-break: break-all !important;
}
.overview {
.small-panel {
.small-base {
margin-left: 0px !important;
font-size: 11px !important;
}
}
}
}
}
@media screen and (max-width: 1480px) {
.default-main {
font-size: 12px !important;
.overview {
.small-panel {
padding: 13px 0px !important;
}
}
.status {
.status-panel {
.status-base-main {
margin-left: 5px !important;
}
}
.content-number {
font-size: 16px !important;
}
}
}
@ -732,7 +640,7 @@ $labelHeight: 30px;
.default-main {
/*font-size: 12px !important;*/
.content-number {
font-size: 16px !important;
font-size: 18px !important;
}
.homelabel {
@ -747,26 +655,6 @@ $labelHeight: 30px;
/* padding: 10px !important;*/
margin-bottom: 10px !important;
}
.summarize {
margin-bottom: 10px !important;
}
}
.toal-panel {
padding: 0 !important;
padding-bottom: 10px !important;
}
// .matrix {
// height: 900px !important;
// }
:deep(.el-tabs__header) {
margin-top: -33px !important;
}
.overview {
.small-panel {
.small-base {
margin-left: 5px !important;
}
}
}
}
}

View File

@ -1,7 +1,7 @@
<template>
<div class="FanList-content">
<el-row :gutter="10">
<el-col :xs="24" :sm="12" :md="12" :lg="4" v-for="(item, index) in props.parentData" style="margin-bottom: 5px">
<el-col :xs="12" :sm="8" :md="8" :lg="4" :xl="3" v-for="(item, index) in props.parentData" style="margin-bottom: 5px">
<div class="grid-content ep-bg-purple" @dblclick="handleDoubleClick(item)">
<div class="FanList-panel" :class="item.standard == true ? 'wind-mark' : 'wind-default'">
<div class="fanlist-top">
@ -42,9 +42,6 @@
<div class="leaf_3"><img src="~assets/dashboard/leaf1.png" alt="" /></div>
</div>
</div>
<!-- <img src="~assets/dashboard/fanlist1.png" alt="">-->
<!-- <img class="fc" src="~assets/dashboard/fanlist1.png" alt=""></img>-->
<!-- <img :style="{ transform: `rotate(${rotationDegrees}deg)` }" src="~assets/dashboard/fanlist1.png" alt="">-->
</div>
<div class="fanlist-pic">
<img src="~assets/dashboard/fanlist2.png" alt="" />
@ -52,27 +49,22 @@
</el-col>
</el-row>
<el-row class="fanlist-data">
<el-col :span="8">
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.iwindspeed }}</span
><span>风速m/s</span>
</div>
</el-col>
<el-col :span="8">
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.igenpower }}</span
><span>功率MW</span>
</div>
</el-col>
<el-col :span="8">
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.ikwhthisday }}</span
><span>日发电量kWh</span>
</div>
</el-col>
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.iwindspeed }}</span>
<span>m/s</span>
</div>
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.igenpower }}</span>
<span>kW</span>
</div>
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.ikwhthisday }}</span>
<span>kWh</span>
</div>
</el-row>
</div>
<div class="fanlist-bottom">
<!-- <el-tag class="tag-panel is-danger">已锁定</el-tag>-->
<el-tag v-if="item.attributeMap.locked === 1" class="tag-panel is-danger">已锁定</el-tag>
</div>
</div>
@ -97,13 +89,20 @@ const props = defineProps({
const getAnimationStyle = (item) => {
const irotorspeed = item.attributeMap?.irotorspeed ?? 0
const animationDuration = (1 / irotorspeed) * 10
const animationDuration = 60 / irotorspeed
return {
'animation-duration': `${animationDuration}s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
//'animation-fill-mode': 'forwards'
}
/* const animationDuration = 60 / irotorspeed
const iterationCount = Math.floor(10) //
return {
'animation': `leafRotate ${animationDuration}s ${iterationCount}`
}*/
}
const handleDoubleClick = (row) => {
@ -234,8 +233,8 @@ const handleDoubleClick = (row) => {
.fanlist-main {
width: 100%;
display: flex;
/*padding: 10px;*/
padding: 10px 10px 0 10px;
justify-content: space-between;
padding: 5px 10px 0 10px;
text-align: center;
.fanlist-pic {
display: flex;
@ -293,12 +292,13 @@ const handleDoubleClick = (row) => {
}
}
.fanlist-text {
margin-top: 15px;
display: flex;
flex-direction: column;
margin-top: 5px;
width: 100%;
text-align: right;
.content-number {
color: #333333;
font-size: 20px;
padding-right: 5px;
}
}
.fanlist-text span {
@ -309,7 +309,6 @@ const handleDoubleClick = (row) => {
display: flex;
justify-content: end;
height: 24px;
margin-top: -7px;
.tag-panel {
border-radius: 0 0 8px 0;
line-height: 20px;

View File

@ -12,7 +12,7 @@
<el-col
v-if="!itemChild.data.showKey || formData[itemChild.data.showKey] === itemChild.data.showValue"
:offset="1"
:span="11"
:span="itemChild.data.singleRow ? 23 : 11"
>
<el-form-item :label="itemChild.data.label" :prop="itemChild.key">
<el-input
@ -98,7 +98,7 @@ const emits = defineEmits(['update:visible', 'submit'])
const formRef = ref<FormInstance>()
const formData = ref<any>({})
// const formData = ref<protocolFormType>({})
// const formData = ref<protocolFormType>({})
// #region
// const cardTitle: ['', ''] = ['', '']
// const netWorkOption = {
@ -959,6 +959,7 @@ const formColumnList: formColumnType[] = [
value: '',
showKey: 'ftpMode',
showValue: '1',
singleRow: true,
},
},
{
@ -1077,6 +1078,7 @@ const formColumnList: formColumnType[] = [
value: '',
showKey: 'ftpMode',
showValue: '1',
singleRow: true,
},
},
{

View File

@ -122,6 +122,7 @@ type paramsType = {
showKey?: string
showValue?: string | number
isSeconds?: boolean
singleRow?: boolean
list?: { label: string; value: string | number }[]
cardTitle?: ['网络设置', '超时设置']
}

View File

@ -424,7 +424,11 @@ const saveMappingList = (data: any[]) => {
if (res.success) {
ElMessage.success('保存成功!')
resetExcel()
}else{
ElMessage.warning(res.msg ?? '保存失败!')
}
}).catch(()=>{
ElMessage.error('保存失败!')
})
}
const uploadRef = ref<UploadInstance>()

View File

@ -706,6 +706,7 @@ export const createUpLoadExcelData = (workbookData: any) => {
sheetData.linkId = workbookData.name
sheetData[sheetkeyMap[fieldKey]] = sheets[item].cellData[key][fieldKey]?.v ?? ''
sheetData.type = sheets[item].cellData[key][fieldKey].custom.type
sheetData.protocol = sheets[item].cellData[key][fieldKey].custom.protocol
continue
}
if (fieldKey === '1') {
@ -723,9 +724,7 @@ export const createUpLoadExcelData = (workbookData: any) => {
}
export const createSheetData = (data: any, protocol: string | number) => {
console.log('createSheetData')
if (!protocol) return {}
const excelCellDataMap: any = {}
const headerData = createHeaderData(protocol)
const resultData: any = {}
@ -747,6 +746,7 @@ export const createSheetData = (data: any, protocol: string | number) => {
if (col === '0') {
custom = {}
custom.type = item
custom.protocol = Number(protocol)
custom.otherData = obj
}
result[row][col] = { v: obj[field], s: '1', custom }
@ -755,7 +755,6 @@ export const createSheetData = (data: any, protocol: string | number) => {
})
resultData[item] = result
})
return resultData
}

View File

@ -234,10 +234,10 @@ const tableItem1: any = [
{
label: '限电原因',
unit: ' ',
prop: '',
prop: 'powerlimitsource',
align: 'center',
custom: 'header',
name:'',
name:'PowerLimitSource',
title: '限电原因'
},
{
@ -317,7 +317,7 @@ const defaultdeviceQuery = () => {
if(attributeCodeLower!='name'){
if (attributeCodeLower) {
const value=tsnapshotVoItem[attributeCodeLower];
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(3)) : '-';
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(1)) : '-';
if (enumStore.keys.includes(item1.name)) {
formattedValue = enumStore.data[item1.name][formattedValue]?enumStore.data[item1.name][formattedValue]:'-'
}
@ -575,7 +575,7 @@ const getTableData = () => {
if (item.id === itemKey) {
const attributeCodeLower = item1.attributeCode?.toLowerCase();
const value = tsnapshotVoObject[itemKey]?.[attributeCodeLower];
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(3)) : '-';
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(1)) : '-';
if (enumStore.keys.includes(item1.attributeCode)) {
formattedValue = enumStore.data[item1.attributeCode][formattedValue]?enumStore.data[item1.attributeCode][formattedValue]:'-'
}
@ -608,22 +608,17 @@ const downFun=(tableColumn,tableData)=>{
}
const columnSet = new Set(tableColumn.map(item => item.prop));
const result = [];
try {
itemsWithoutAge.forEach((item) => {
const newItem = {};
for (const itemKey in item) {
if (columnSet.has(itemKey)) {
newItem[itemKey] = item[itemKey];
}
itemsWithoutAge.forEach((item) => {
const newItem = {};
for (const itemKey in item) {
if (columnSet.has(itemKey)) {
newItem[itemKey] = item[itemKey];
}
if (Object.keys(newItem).length > 0) {
result.push(newItem);
}
});
} catch (error) {
console.error('Error in code execution:', error);
return [];
}
}
if (Object.keys(newItem).length > 0) {
result.push(newItem);
}
});
let addobj = {}
tableColumn.map((v, i) => {
addobj['rowData' + i] = v.label