Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
e3b12266cd
@ -0,0 +1,52 @@
|
||||
package com.das.modules.calc.functions;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.googlecode.aviator.runtime.function.AbstractFunction;
|
||||
import com.googlecode.aviator.runtime.type.AviatorObject;
|
||||
import com.googlecode.aviator.runtime.type.AviatorRuntimeJavaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Aviator扩展函数 - 获取时间维度的起始时间
|
||||
* 函数格式: beginOf(Date, TimeDim)
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class FunctionBeginOfDate extends AbstractFunction {
|
||||
|
||||
public FunctionBeginOfDate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "beginOfDate";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AviatorObject call(Map<String, Object> env, AviatorObject dateData, AviatorObject dimData) {
|
||||
Date date = (Date) dateData.getValue(env);
|
||||
String dim = (String) dimData.getValue(env);
|
||||
|
||||
Date result = null;
|
||||
switch (dim) {
|
||||
case "day":
|
||||
result = DateUtil.beginOfDay(date);
|
||||
break;
|
||||
case "week":
|
||||
result = DateUtil.beginOfWeek(date);
|
||||
break;
|
||||
case "month":
|
||||
result = DateUtil.beginOfMonth(date);
|
||||
break;
|
||||
case "year":
|
||||
result = DateUtil.beginOfYear(date);
|
||||
break;
|
||||
default:
|
||||
log.error("不支持的维度: {}", dim);
|
||||
}
|
||||
return AviatorRuntimeJavaType.valueOf(result);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.das.modules.calc.functions;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.googlecode.aviator.runtime.function.AbstractFunction;
|
||||
import com.googlecode.aviator.runtime.type.AviatorObject;
|
||||
import com.googlecode.aviator.runtime.type.AviatorRuntimeJavaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Aviator扩展函数 - 获取时间维度的起始时间
|
||||
* 函数格式: beginOf(Date, TimeDim)
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class FunctionEndOfDate extends AbstractFunction {
|
||||
|
||||
public FunctionEndOfDate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "endOfDate";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AviatorObject call(Map<String, Object> env, AviatorObject dateData, AviatorObject dimData) {
|
||||
Date date = (Date) dateData.getValue(env);
|
||||
String dim = (String) dimData.getValue(env);
|
||||
|
||||
Date result = null;
|
||||
switch (dim) {
|
||||
case "day":
|
||||
result = DateUtil.endOfDay(date);
|
||||
break;
|
||||
case "week":
|
||||
result = DateUtil.endOfWeek(date);
|
||||
break;
|
||||
case "month":
|
||||
result = DateUtil.endOfMonth(date);
|
||||
break;
|
||||
case "year":
|
||||
result = DateUtil.endOfYear(date);
|
||||
break;
|
||||
default:
|
||||
log.error("不支持的维度: {}", dim);
|
||||
}
|
||||
return AviatorRuntimeJavaType.valueOf(result);
|
||||
}
|
||||
}
|
@ -6,10 +6,7 @@ import com.das.common.utils.AdminRedisTemplate;
|
||||
import com.das.modules.cache.service.CacheService;
|
||||
import com.das.modules.calc.domain.entity.CalcModule;
|
||||
import com.das.modules.calc.domain.vo.CalcModuleVo;
|
||||
import com.das.modules.calc.functions.FunctionCacheValue;
|
||||
import com.das.modules.calc.functions.FunctionRealData;
|
||||
import com.das.modules.calc.functions.FunctionSaveCalcData;
|
||||
import com.das.modules.calc.functions.FunctionSumValue;
|
||||
import com.das.modules.calc.functions.*;
|
||||
import com.das.modules.calc.mapper.CalcModuleMapper;
|
||||
import com.das.modules.data.service.DataService;
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
@ -125,6 +122,12 @@ public class CalcService {
|
||||
|
||||
FunctionSumValue sumv = new FunctionSumValue(dataService, cacheService);
|
||||
aviator.addFunction(sumv);
|
||||
|
||||
FunctionBeginOfDate beginOfDate = new FunctionBeginOfDate();
|
||||
aviator.addFunction(beginOfDate);
|
||||
|
||||
FunctionEndOfDate endOfDate = new FunctionEndOfDate();
|
||||
aviator.addFunction(endOfDate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -363,14 +363,13 @@ public class SysNodeServiceImpl implements SysNodeService {
|
||||
List<SysTabMappingVo> discrete = impList.stream().filter(item -> collect.get(item.getId()) == 140).collect(Collectors.toList());
|
||||
List<SysTabMappingVo> setPoint = impList.stream().filter(item -> collect.get(item.getId()) == 146).collect(Collectors.toList());
|
||||
List<SysTabMappingVo> control = impList.stream().filter(item -> collect.get(item.getId()) == 147).collect(Collectors.toList());
|
||||
//校验param里面order不重复
|
||||
if (checkOrderRepeated(analogList) || checkOrderRepeated(accumulator) || checkOrderRepeated(discrete) || checkOrderRepeated(setPoint) || checkOrderRepeated(control)){
|
||||
throw new ServiceException("检查顺序,排序不能重复");
|
||||
}
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
for (SysTabMappingVo imp : impList) {
|
||||
//校验param里面order不重复
|
||||
|
||||
SysTabMapping rec = sysImptabmappingMapper.selectById(imp.getId());
|
||||
rec.setUpdatedTime(new Date());
|
||||
rec.setUpdatedBy(sysUserVo.getAccount());
|
||||
|
@ -78,9 +78,6 @@ public class StatisticalAnalysisServiceImpl implements StatisticalAnalysisServic
|
||||
*/
|
||||
@Override
|
||||
public void trendAnalyseExport(List<TrendAnalyseDto> param, HttpServletRequest request, HttpServletResponse response) {
|
||||
if (param == null || param.isEmpty()) {
|
||||
throw new ServiceException("参数列表不能为空");
|
||||
}
|
||||
//根据条件获取历史数据
|
||||
List<Map<String, Map<String, Map<String, Object>>>> mapsList = new ArrayList<>();
|
||||
for (TrendAnalyseDto trendAnalyseDto : param) {
|
||||
@ -271,12 +268,22 @@ public class StatisticalAnalysisServiceImpl implements StatisticalAnalysisServic
|
||||
*/
|
||||
private void setTrendContrastExcelValue(Map<String, Map<String, Map<String, Object>>> maps,
|
||||
List<Map<String, Object>> dataList) {
|
||||
Map<String,Integer> mapKey = new HashMap<>();
|
||||
int num =1;
|
||||
int flagNum = 0;
|
||||
for (Map.Entry<String, Map<String, Map<String, Object>>> stringMapEntry : maps.entrySet()) {
|
||||
int flagNum = 0;
|
||||
for (Map.Entry<String, Map<String, Object>> mapEntry : stringMapEntry.getValue().entrySet()) {
|
||||
List<String> timesListstr = new ArrayList<>();
|
||||
List<Double> valuesList = new ArrayList<>();
|
||||
String key = mapEntry.getKey();
|
||||
if (mapKey.containsKey(key)){
|
||||
num++;
|
||||
String str = key + num;
|
||||
mapKey.put(str, num );
|
||||
key=str;
|
||||
}else {
|
||||
mapKey.put(key, num);
|
||||
}
|
||||
for (Map.Entry<String, Object> stringObjectEntry : mapEntry.getValue().entrySet()) {
|
||||
String key1 = stringObjectEntry.getKey();
|
||||
if (key1.equals("times")) {
|
||||
@ -345,12 +352,21 @@ public class StatisticalAnalysisServiceImpl implements StatisticalAnalysisServic
|
||||
for (SnapshotValueQueryParam device : param.getDevices()) {
|
||||
strList.addAll(device.getAttributes());
|
||||
}
|
||||
QueryWrapper<SysIotModelField> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("attribute_code", strList);
|
||||
List<SysIotModelField> sysIotModelFields = sysIotModelFieldMapper.selectVoList(queryWrapper);
|
||||
for (SysIotModelField sysIotModelField : sysIotModelFields) {
|
||||
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getAttributeName());
|
||||
int num =1;
|
||||
for (String code : strList) {
|
||||
QueryWrapper<SysIotModelField> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("attribute_code", code);
|
||||
List<SysIotModelField> sysIotModelFields = sysIotModelFieldMapper.selectVoList(queryWrapper);
|
||||
for (SysIotModelField sysIotModelField : sysIotModelFields) {
|
||||
if (map.containsKey(sysIotModelField.getAttributeCode())){
|
||||
num++;
|
||||
map.put(sysIotModelField.getAttributeCode()+num, sysIotModelField.getAttributeName()+num );
|
||||
}else {
|
||||
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getAttributeName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,8 @@ public class TemperatureDashboardServiceImpl implements TemperatureDashboardServ
|
||||
String params = mapping.getParams();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
JSONObject json = JSONObject.parseObject(params);
|
||||
String code = json.getString("measPointCode");
|
||||
String name = json.getString("measPointName");
|
||||
String code = mapping.getMeasPointCode();
|
||||
String name = mapping.getMeasPointName();
|
||||
Double limit1High=0.0;
|
||||
Double limit1Low=0.0;
|
||||
Double limit2High=0.0;
|
||||
|
@ -28,13 +28,13 @@
|
||||
<if test="info.attributeType != null and info.attributeType != ''">
|
||||
and t.attribute_type = #{info.attributeType}
|
||||
</if>
|
||||
<if test="info.orderColumn != null and info.orderType != ''">
|
||||
order by ${info.orderColumn} ${info.orderType}
|
||||
</if>
|
||||
<if test="info.orderColumn == null or info.orderColumn == '' or info.orderType == null or info.orderType == ''">
|
||||
order by t.porder asc
|
||||
</if>
|
||||
</where>
|
||||
<if test="info.orderColumn != null and info.orderType != ''">
|
||||
order by ${info.orderColumn} ${info.orderType}
|
||||
</if>
|
||||
<if test="info.orderColumn == null or info.orderColumn == '' or info.orderType == null or info.orderType == ''">
|
||||
order by t.porder asc
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="querySysIotModelFieldByModelId" resultType="java.lang.Long">
|
||||
|
@ -8,6 +8,7 @@ export const getAirBlowerListReq = () => {
|
||||
belongLine: string
|
||||
irn: string
|
||||
madeinfactory: string
|
||||
deviceCode: string
|
||||
model: string
|
||||
modelId: string
|
||||
name: string
|
||||
|
@ -35,7 +35,9 @@
|
||||
<div class="cardContentLeft">
|
||||
<!--实时预览-->
|
||||
<div class="overview">
|
||||
<div class="cardLabel">实时预览</div>
|
||||
<div class="cardLabel">
|
||||
{{ '名称:' + route.query.name + ' ' + '型号:' + route.query.model }}
|
||||
</div>
|
||||
<div class="overviewDataSection" ref="listContainer">
|
||||
<div class="overviewDataSectionItem">
|
||||
<span class="realLeft">机组运行状态:</span>
|
||||
@ -101,6 +103,14 @@
|
||||
<div class="cardContentCenter">
|
||||
<!--风机控制-->
|
||||
<div class="controlBackgroundImg">
|
||||
<div class="switchWindBlower">
|
||||
<el-tooltip :content="beforeAirBlower.name">
|
||||
<el-icon color="#fff" size="30" @click="switchAirblower(0)"><ArrowLeftBold /></el-icon>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="afterAirBlower.name">
|
||||
<el-icon color="#fff" size="30" @click="switchAirblower(1)"><ArrowRightBold /></el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="control-type">
|
||||
<el-tag v-if="realTimeData.locked === 1" class="control-tag control-tag-left" type="primary">已锁定</el-tag>
|
||||
<el-tag class="control-tag" type="primary">{{ realTimeDataState }}</el-tag>
|
||||
@ -305,25 +315,27 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onActivated, onMounted, reactive, ref, computed, onBeforeMount, onUnmounted, VNode, VNodeRef } from 'vue'
|
||||
import { nextTick, onActivated, onMounted, reactive, ref, computed, watch, onBeforeMount, onUnmounted, VNode, VNodeRef } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { DArrowRight } from '@element-plus/icons-vue'
|
||||
import { DArrowRight, ArrowLeftBold, ArrowRightBold } from '@element-plus/icons-vue'
|
||||
import { getRealValueListReq, getRealValueRangeReq } from '/@/api/backend/deviceModel/request'
|
||||
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { getAirBlowerListReq } from '/@/api/backend/airBlower/request'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import Overview from './overview.vue'
|
||||
import { TableInstance } from 'element-plus'
|
||||
import { dayjs, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getRealTimeState, getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
import { sendCommandReq, sendManualCommandReq } from '/@/api/backend/control/request'
|
||||
import { getAlarmListReq } from '/@/api/backend/alarms/request'
|
||||
import { queryfaultCodeDict } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import { useEnumStore } from '/@/stores/enums'
|
||||
const enumStore = useEnumStore()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const router = useRouter()
|
||||
const { t } = useI18n()
|
||||
|
||||
const windBlower = ref()
|
||||
@ -400,8 +412,9 @@ const initpowerChart = () => {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
type: 'line',
|
||||
},
|
||||
show: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@ -602,7 +615,7 @@ const initTrendChart = (type: 'day' | 'month') => {
|
||||
top: 30,
|
||||
right: 10,
|
||||
bottom: 20,
|
||||
left: 45,
|
||||
left: 100,
|
||||
borderColor: '#dadada',
|
||||
},
|
||||
tooltip: {
|
||||
@ -1025,6 +1038,9 @@ const createRealTimeData = async () => {
|
||||
if (enumStore.keys.includes(item.attributeCode)) {
|
||||
val = enumStore.data[item.attributeCode][val]
|
||||
}
|
||||
if (malFunctionKeys.includes(item.attributeCode)) {
|
||||
val = malFunctionEnums?.[item.attributeCode] ?? val
|
||||
}
|
||||
if (sigleDataKeys.includes(item.attributeCode.toLowerCase())) {
|
||||
realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val
|
||||
}
|
||||
@ -1054,7 +1070,7 @@ const createRealTimeData = async () => {
|
||||
realDataForSub[index].type138.push(showData)
|
||||
} else if (item.attributeType === 140) {
|
||||
const copyData = {
|
||||
name: item.attributeName +' '+ item.attributeCode,
|
||||
name: item.attributeCode + ' ' + item.attributeName,
|
||||
value: showData.value,
|
||||
}
|
||||
realDataForSub[index].type140.push(copyData)
|
||||
@ -1150,6 +1166,7 @@ const getChartData = <T extends string = any>(params: {
|
||||
getRealValueRangeReq(data).then((res) => {
|
||||
if (res.success) {
|
||||
const data = res.data[route.query.irn as string]
|
||||
if (!data) return
|
||||
const rangeKeys = Object.keys(data)
|
||||
const times: any = {}
|
||||
const val: any = {}
|
||||
@ -1338,7 +1355,91 @@ const getAlarmList = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
getAlarmList()
|
||||
|
||||
const malFunctionKeys = [
|
||||
'ActiveStatusCode01',
|
||||
'ActiveStatusCode02',
|
||||
'ActiveStatusCode03',
|
||||
'ActiveStatusCode04',
|
||||
'ActiveStatusCode05',
|
||||
'ActiveStatusCode06',
|
||||
'ActiveStatusCode07',
|
||||
'ActiveStatusCode08',
|
||||
'FirstTriggeredCode',
|
||||
]
|
||||
|
||||
const malFunctionEnums: any = {}
|
||||
const getMalfunctionEnums = () => {
|
||||
const curWindBlower = airBlowerList.value.find((item) => item.irn === route.query.irn)
|
||||
console.log(curWindBlower)
|
||||
|
||||
queryfaultCodeDict({ madeinfactory: curWindBlower!.madeinfactory, model: curWindBlower!.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const data: any = {}
|
||||
res.data.forEach((item: any) => {
|
||||
data[item.code] = item.description
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const airBlowerList = ref<
|
||||
{
|
||||
irn: string
|
||||
model: string
|
||||
name: string
|
||||
deviceCode: string
|
||||
iotModelId: string
|
||||
madeinfactory: string
|
||||
}[]
|
||||
>([])
|
||||
|
||||
const getAirBlowerList = () => {
|
||||
return getAirBlowerListReq().then((res) => {
|
||||
if (res.success) {
|
||||
airBlowerList.value = res.data.map((item) => {
|
||||
return {
|
||||
irn: item.irn,
|
||||
model: item.model,
|
||||
name: item.name,
|
||||
deviceCode: item.deviceCode,
|
||||
iotModelId: item.modelId,
|
||||
madeinfactory: item.madeinfactory,
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const beforeAirBlower = computed(() => {
|
||||
const len = airBlowerList.value.length
|
||||
if (len === 0) return { irn: '', model: '', name: '', deviceCode: '', iotModelId: '' }
|
||||
const curIndex = airBlowerList.value.findIndex((item) => item.irn === route.query.irn)
|
||||
if (curIndex === 0) return airBlowerList.value[len - 1]
|
||||
return airBlowerList.value[curIndex - 1]
|
||||
})
|
||||
const afterAirBlower = computed(() => {
|
||||
const len = airBlowerList.value.length
|
||||
if (len === 0) return { irn: '', model: '', name: '', deviceCode: '', iotModelId: '' }
|
||||
const curIndex = airBlowerList.value.findIndex((item) => item.irn === route.query.irn)
|
||||
if (curIndex === len - 1) return airBlowerList.value[0]
|
||||
return airBlowerList.value[curIndex + 1]
|
||||
})
|
||||
const switchAirblower = (type: 0 | 1) => {
|
||||
const data = type === 0 ? beforeAirBlower.value : afterAirBlower.value
|
||||
const query = {
|
||||
irn: data.irn,
|
||||
iotModelId: data.iotModelId,
|
||||
deviceCode: data.deviceCode,
|
||||
model: data.model,
|
||||
name: data.name,
|
||||
}
|
||||
router.push({
|
||||
name: 'windTurbine',
|
||||
query,
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', sizeChange)
|
||||
sizeChange()
|
||||
@ -1346,6 +1447,10 @@ onMounted(() => {
|
||||
createScroll()
|
||||
useEventListener(window, 'resize', echartsResize)
|
||||
autoUpdate()
|
||||
getAlarmList()
|
||||
getAirBlowerList().then(() => {
|
||||
getMalfunctionEnums()
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@ -1356,8 +1461,32 @@ onUnmounted(() => {
|
||||
const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
|
||||
chartKeys.forEach((key) => {
|
||||
state.charts[key] && state.charts[key].dispose()
|
||||
state.charts[key] = null
|
||||
})
|
||||
})
|
||||
|
||||
watch(
|
||||
() => route.query.irn,
|
||||
() => {
|
||||
autoUpdateForSecondTimer && clearInterval(autoUpdateForSecondTimer)
|
||||
autoUpdateForSecondTimer = null
|
||||
autoUpdateTimerForHourTimer && clearInterval(autoUpdateTimerForHourTimer)
|
||||
autoUpdateTimerForHourTimer = null
|
||||
autoUpdateTimerForMinuteTimer && clearInterval(autoUpdateTimerForMinuteTimer)
|
||||
autoUpdateTimerForMinuteTimer = null
|
||||
const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
|
||||
chartKeys.forEach((key) => {
|
||||
state.charts[key] && state.charts[key].dispose()
|
||||
state.charts[key] = null
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
autoUpdate()
|
||||
getAlarmList()
|
||||
getAllChartData()
|
||||
})
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -1515,6 +1644,28 @@ $labelHeight: 38px;
|
||||
aspect-ratio: 43 / 24;
|
||||
background: url('/@/assets/WindBlower/bg.png') no-repeat;
|
||||
background-size: contain;
|
||||
&:hover {
|
||||
.switchWindBlower {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.switchWindBlower {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 5%;
|
||||
transform: translateX(-50%);
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
// background-color: red;
|
||||
opacity: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
transition: opacity 0.4s;
|
||||
.el-icon:hover {
|
||||
cursor: pointer;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
}
|
||||
.control-type {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
@ -1,16 +1,18 @@
|
||||
<template>
|
||||
<div class="overviewWrap">
|
||||
<div class="dialogContent">
|
||||
<div class="PitchPart">
|
||||
<el-row>
|
||||
<el-col :span="12" v-for="item in showData" :key="item.name">
|
||||
<div class="Pitchitem">
|
||||
<span class="PitchitemLeft">{{ item.name }}</span>
|
||||
<span class="PitchitemRight">{{ item.value }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<div class="PitchPart">
|
||||
<el-row>
|
||||
<el-col :span="12" v-for="item in showData" :key="item.name">
|
||||
<div class="Pitchitem">
|
||||
<span class="PitchitemLeft">{{ item.name }}</span>
|
||||
<span class="PitchitemRight">{{ item.value }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<el-pagination
|
||||
@ -71,15 +73,13 @@ onMounted(() => {
|
||||
<style scoped lang="scss">
|
||||
.dialogContent {
|
||||
width: 100%;
|
||||
max-height: 540px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
height: 540px;
|
||||
.PitchPart {
|
||||
.Pitchitem {
|
||||
border: 1px solid #e1edf6;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-left: 15px;
|
||||
// margin-left: 15px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.PitchitemLeft {
|
||||
|
@ -655,6 +655,8 @@ const openWindTurbine = (row: TableDataObjType) => {
|
||||
irn: row.irn,
|
||||
iotModelId: row.iotModelId,
|
||||
deviceCode: row.deviceCode,
|
||||
model: row.model,
|
||||
name:row.name
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -117,8 +117,6 @@ const defaultList = [
|
||||
//#endregion
|
||||
const selectList = ref([])
|
||||
const changeCheck = () => {
|
||||
console.log('-----------------------------------', timer, selectList.value)
|
||||
|
||||
if (!timer && selectList.value[0]) {
|
||||
createTimer()
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export type TableColumnType = {
|
||||
align?: 'left' | 'right' | 'center'
|
||||
custom?: 'header' | 'default'
|
||||
type?: 'default' | 'selection' | 'index' | 'expand'
|
||||
sortable?:boolean
|
||||
}
|
||||
|
||||
export type CommandReqType = {
|
||||
|
@ -126,6 +126,8 @@ const handleDoubleClick = (row) => {
|
||||
irn: row.irn,
|
||||
iotModelId: row.modelId,
|
||||
name: row.name,
|
||||
deviceCode: row.deviceCode,
|
||||
model: row.model,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -125,6 +125,8 @@ const handleClick = (row) => {
|
||||
irn: row.irn,
|
||||
iotModelId: row.modelId,
|
||||
deviceCode: row.deviceCode,
|
||||
name: row.name,
|
||||
model: row.model,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -466,11 +466,11 @@ const readFile = (data: tableItemData) => {
|
||||
attrName.forEach((item) => {
|
||||
if (item === 'TimeStamp') {
|
||||
previewChartData.TimeStamp = previewChartData.TimeStamp.map((item: any) => {
|
||||
return dayjs(item).format('YYYY-MM-DD HH:mm:ss')
|
||||
return dayjs(item).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||
})
|
||||
} else if (item === 'TimeStampUTC') {
|
||||
previewChartData.TimeStamp = previewChartData.TimeStampUTC.map((item: any) => {
|
||||
return dayjs(item).format('YYYY-MM-DD HH:mm:ss')
|
||||
return dayjs(item).format('YYYY-MM-DD HH:mm:ss.SSS')
|
||||
})
|
||||
} else {
|
||||
data.push({
|
||||
@ -625,7 +625,7 @@ const initPreviewChart = () => {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
type: 'line',
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
|
@ -286,16 +286,16 @@ export const excelDefaultConfig: any = {
|
||||
},
|
||||
],
|
||||
R0C4: [
|
||||
"32位浮点数(高位在第一个寄存器)",
|
||||
"32位浮点数(高位在第二个寄存器)",
|
||||
"16位归一化值",
|
||||
"32位归一化值(高位在第一个寄存器)",
|
||||
"32位归一化值(高位在第二个寄存器)",
|
||||
"32位浮点数(小端系统模式)",
|
||||
"32位BCD数据(*高位在第一个寄存器*)",
|
||||
"32位BCD数据(*高位在第二个寄存器*)",
|
||||
"16位BCD数据",
|
||||
"8位归一化值"
|
||||
"1、32位浮点数(高位在第一个寄存器)",
|
||||
"2、32位浮点数(高位在第二个寄存器)",
|
||||
"2、16位归一化值",
|
||||
"4、32位归一化值(高位在第一个寄存器)",
|
||||
"5、32位归一化值(高位在第二个寄存器)",
|
||||
"6、32位浮点数(小端系统模式)",
|
||||
"7、32位BCD数据(*高位在第一个寄存器*)",
|
||||
"8、32位BCD数据(*高位在第二个寄存器*)",
|
||||
"9、16位BCD数据",
|
||||
"10、8位归一化值"
|
||||
], // 数据类型的提示
|
||||
},
|
||||
//遥控147 CONTROL
|
||||
@ -603,6 +603,8 @@ export const createUpLoadExcelData = (workbookData: any) => {
|
||||
}
|
||||
sheetData.params = JSON.stringify(params)
|
||||
data.push(sheetData)
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -622,10 +624,10 @@ export const createSheetData = (data: any, protocol: string | number) => {
|
||||
const result: any = {}
|
||||
data[item].forEach((obj: any, index: number) => {
|
||||
const params = obj.params && obj.params !== '' ? JSON.parse(obj.params) : {}
|
||||
obj = { ...obj, ...params }
|
||||
const newObj = { ...obj, ...params }
|
||||
const row = index + 1
|
||||
result[row] = {}
|
||||
Object.keys(obj).forEach((field) => {
|
||||
Object.keys(newObj).forEach((field) => {
|
||||
const col = excelCellDataMap[field]
|
||||
if (col) {
|
||||
let custom: any
|
||||
@ -635,7 +637,7 @@ export const createSheetData = (data: any, protocol: string | number) => {
|
||||
custom.protocol = Number(protocol)
|
||||
custom.otherData = obj
|
||||
}
|
||||
result[row][col] = { v: obj[field], s: '1', custom }
|
||||
result[row][col] = { v: newObj[field], s: '1', custom }
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -17,18 +17,18 @@
|
||||
:row-key="getRowKey"
|
||||
:span-method="objectSpanMethod"
|
||||
class="tablePart">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<!-- <el-table-column type="selection" width="55"/>-->
|
||||
<el-table-column prop="name" label="风机名称" align="center"> </el-table-column>
|
||||
<el-table-column prop="windspeedvalue" label="风速" align="center"> </el-table-column>
|
||||
<el-table-column prop="factorK" label="系数K" align="center"> </el-table-column>
|
||||
<el-table-column prop="factorB" label="系数B" align="center"> </el-table-column>
|
||||
<el-table-column label="操作" width="400" align="center">
|
||||
<!-- <el-table-column label="操作" width="400" align="center">
|
||||
<template #default="scope">
|
||||
<div class="tableOperate">
|
||||
<a @click="viewDetails(scope.row)">查看</a>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
<div style="display: flex; justify-content: right">
|
||||
<el-pagination
|
||||
@ -45,52 +45,6 @@
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog v-model="dialogOpen" title="查看参数" width="500">
|
||||
<el-from
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
:model="fromUpDate"
|
||||
style="padding: 5px 15px; line-height: 1.5; word-wrap: break-word;">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="风机名称:">
|
||||
<el-input v-model="fromUpDate.name" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label=" 最小值:">
|
||||
<el-input v-model="fromUpDate.speedMin" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label=" 最大值:">
|
||||
<el-input v-model="fromUpDate.speedMax" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label=" 风速:">
|
||||
<el-input v-model="fromUpDate.windspeedvalue" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label=" 系数K:">
|
||||
<el-input v-model="fromUpDate.factorK" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label=" 系数B:">
|
||||
<el-input v-model="fromUpDate.factorB" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-from>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogOpen = false">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -101,8 +55,10 @@ import {powerCurveQuery,powerImport,powerExport} from "/@/api/backend/powerCurve
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||
import type { TableColumnCtx } from 'element-plus'
|
||||
import { dataMethods } from './utils'
|
||||
|
||||
/*interface User {
|
||||
|
||||
interface User {
|
||||
id:string,
|
||||
turbineId:string,
|
||||
name:string,
|
||||
@ -110,7 +66,9 @@ import type { TableColumnCtx } from 'element-plus'
|
||||
speedMin:string,
|
||||
speedMax:string,
|
||||
factorK:string,
|
||||
factorB:string
|
||||
factorB:string,
|
||||
NameIndex:string,
|
||||
count:number
|
||||
}
|
||||
|
||||
interface SpanMethodProps {
|
||||
@ -119,18 +77,28 @@ interface SpanMethodProps {
|
||||
rowIndex: number
|
||||
columnIndex: number
|
||||
}
|
||||
const objectSpanMethod = ({
|
||||
row,
|
||||
column,
|
||||
rowIndex,
|
||||
columnIndex,
|
||||
}: SpanMethodProps) => {
|
||||
|
||||
const objectSpanMethod = ({row, column, rowIndex, columnIndex,}: SpanMethodProps) => {
|
||||
/*if (columnIndex === 0) {
|
||||
if (rowIndex % 7 === 0) {
|
||||
return {
|
||||
rowspan: 7,
|
||||
colspan: 1,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
};
|
||||
}
|
||||
}*/
|
||||
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
if (row.NameIndex === 1) {
|
||||
return {
|
||||
rowspan: 2,
|
||||
rowspan: row.count,
|
||||
colspan: 1,
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowspan: 0,
|
||||
@ -138,8 +106,26 @@ const objectSpanMethod = ({
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
const tableData=ref([])
|
||||
let obj = {}
|
||||
const formatData = (list) => {
|
||||
obj = {}
|
||||
list.forEach(item => {
|
||||
let count = list.filter(listItem => listItem.name === item.name).length
|
||||
if (obj[item.name] ) {
|
||||
obj[item.name]++
|
||||
|
||||
} else {
|
||||
obj[item.name] = 1
|
||||
}
|
||||
item.NameIndex = obj[item.name]
|
||||
|
||||
item.count = count
|
||||
})
|
||||
tableData.value = list
|
||||
}
|
||||
|
||||
|
||||
const formQuery = reactive({
|
||||
pageSize: 20,
|
||||
@ -163,7 +149,7 @@ const getTableData = (formQuery) => {
|
||||
powerCurveQuery(formQuery).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
pageTotal.value = res.data.total
|
||||
tableData.value = (res.data.rows || []).map((item: { speedMin?: number | string; speedMax?: number | string }) => {
|
||||
tableData.value = res.data.rows.map((item: { speedMin?: number | string; speedMax?: number | string }) => {
|
||||
const speedMin = item.speedMin ?? '';
|
||||
const speedMax = item.speedMax ?? '';
|
||||
if(speedMax==''){
|
||||
@ -179,6 +165,7 @@ const getTableData = (formQuery) => {
|
||||
}
|
||||
|
||||
});
|
||||
formatData(tableData.value)
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
@ -256,6 +243,7 @@ const Export = () => {
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTableData(formQuery)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user