Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
58210dbbeb
@ -1,33 +0,0 @@
|
||||
package com.das.common.log;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* @author chenhaojie
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class MdcExecutor implements Executor {
|
||||
|
||||
private final Executor executor;
|
||||
|
||||
public MdcExecutor(Executor executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Runnable command) {
|
||||
final String requestId = MDC.get("REQUEST_ID");
|
||||
executor.execute(() -> {
|
||||
MDC.put("REQUEST_ID", requestId);
|
||||
try {
|
||||
command.run();
|
||||
} finally {
|
||||
MDC.remove("REQUEST_ID");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package com.das.common.log;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author chenhaojie
|
||||
*
|
||||
*/
|
||||
public class RequestIdUtils {
|
||||
|
||||
private static final ThreadLocal<UUID> requestIdHolder = new ThreadLocal<>();
|
||||
|
||||
private RequestIdUtils() {
|
||||
}
|
||||
|
||||
public static void generateRequestId() {
|
||||
requestIdHolder.set(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public static void generateRequestId(UUID uuid) {
|
||||
requestIdHolder.set(uuid);
|
||||
}
|
||||
|
||||
public static UUID getRequestId() {
|
||||
return requestIdHolder.get();
|
||||
}
|
||||
|
||||
public static void removeRequestId() {
|
||||
requestIdHolder.remove();
|
||||
}
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package com.das.common.log;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author chenhaojie
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class RequestLogInterceptor implements HandlerInterceptor {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
|
||||
String servletPath = request.getServletPath();
|
||||
|
||||
log.info("preHandle 后置处理----------");
|
||||
log.info("servletPath:{}", servletPath);
|
||||
RequestIdUtils.removeRequestId();
|
||||
MDC.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取RequestId
|
||||
* 优先从header头获取,如果没有则自己生成
|
||||
* @return RequestId
|
||||
*/
|
||||
private String getRequestId(){
|
||||
// 因为如果有网关,则一般会从网关传递过来,所以优先从header头获取
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if(attributes != null && StringUtils.hasText(attributes.getRequest().getHeader("x-request-id"))) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String requestId = request.getHeader("x-request-id");
|
||||
UUID uuid = UUID.fromString(requestId);
|
||||
RequestIdUtils.generateRequestId(uuid);
|
||||
return requestId;
|
||||
}
|
||||
UUID existUUID = RequestIdUtils.getRequestId();
|
||||
if(existUUID != null){
|
||||
return existUUID.toString();
|
||||
}
|
||||
RequestIdUtils.generateRequestId();
|
||||
return RequestIdUtils.getRequestId().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
String servletPath = request.getServletPath();
|
||||
// 生成RequestId
|
||||
String requestId = this.getRequestId();
|
||||
// 配置日志文件打印 REQUEST_ID
|
||||
MDC.put("REQUEST_ID", requestId);
|
||||
|
||||
log.info("servletPath:{}", servletPath);
|
||||
log.info("preHandle 前置处理----------");
|
||||
return true;
|
||||
}
|
||||
}
|
@ -45,7 +45,8 @@ public class IotModelCacheImpl implements IotModelCache {
|
||||
|
||||
@PreDestroy
|
||||
public void destroy(){
|
||||
|
||||
iotFieldsMap.clear();
|
||||
iotModelInfoIdMap.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ public class CalcModule {
|
||||
private Date updateTime;
|
||||
private String cron;
|
||||
|
||||
public static final CalcModule of(String content){
|
||||
public final CalcModule of(String content){
|
||||
CalcModule calcModule = new CalcModule();
|
||||
calcModule.setScript(content);
|
||||
try(BufferedReader reader = new BufferedReader(new StringReader(content))){
|
||||
|
@ -23,12 +23,10 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class FunctionWindSpeedFactor extends AbstractFunction {
|
||||
|
||||
private DataService dataService = null;
|
||||
private CacheService cacheService = null;
|
||||
|
||||
|
||||
public FunctionWindSpeedFactor(DataService dataService, CacheService cacheService) {
|
||||
this.dataService = dataService;
|
||||
public FunctionWindSpeedFactor(CacheService cacheService) {
|
||||
this.cacheService = cacheService;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ public class CalcService {
|
||||
FunctionOffsetDate offsetDate = new FunctionOffsetDate();
|
||||
aviator.addFunction(offsetDate);
|
||||
|
||||
FunctionWindSpeedFactor windSpeedFactor = new FunctionWindSpeedFactor(dataService,cacheService);
|
||||
FunctionWindSpeedFactor windSpeedFactor = new FunctionWindSpeedFactor(cacheService);
|
||||
aviator.addFunction(windSpeedFactor);
|
||||
|
||||
FunctionIsOnline isOnline = new FunctionIsOnline(adminRedisTemplate, cacheService);
|
||||
|
@ -38,6 +38,7 @@ public class DataController {
|
||||
public R<Map<String,Map<String,Object>>> querySnapshotValues(@RequestBody @Valid List<SnapshotValueQueryParam> param) {
|
||||
if (log.isDebugEnabled()){
|
||||
log.debug("/api/rtdbsvr/snapshot is calling");
|
||||
log.debug("request params: {}", param);
|
||||
}
|
||||
return R.success(dataService.querySnapshotValues(param));
|
||||
}
|
||||
@ -50,7 +51,8 @@ public class DataController {
|
||||
@PostMapping("/history")
|
||||
public R<Map<String, Map<String, Map<String, Object>>>> queryTimeSeriesValues(@RequestBody @Valid TSValueQueryParam param) {
|
||||
if (log.isDebugEnabled()){
|
||||
log.debug("/api/rtdbsvr/timeseries is calling");
|
||||
log.debug("/api/rtdbsvr/history is calling");
|
||||
log.debug("request params: {}", param);
|
||||
}
|
||||
return R.success(dataService.queryTimeSeriesValues(param));
|
||||
}
|
||||
@ -63,7 +65,8 @@ public class DataController {
|
||||
@PostMapping("/windows")
|
||||
public R<Map<String, Map<String, Map<String, Object>>>> queryWindowsValues(@RequestBody @Valid WindowValueQueryParam param) {
|
||||
if (log.isDebugEnabled()){
|
||||
log.debug("/api/rtdbsvr/timeseries is calling");
|
||||
log.debug("/api/rtdbsvr/windows is calling");
|
||||
log.debug("request params: {}", param);
|
||||
}
|
||||
return R.success(dataService.queryWindowsValues(param));
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class TDEngineService {
|
||||
log.info(sb.toString());
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("创建超级表失败,失败原因{}", e);
|
||||
log.error("创建超级表失败", e);
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
@ -114,7 +114,7 @@ public class TDEngineService {
|
||||
log.info(sb.toString());
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("创建超级表失败,失败原因{}", e);
|
||||
log.error("创建[计算量]超级表失败", e);
|
||||
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
@ -141,7 +141,7 @@ public class TDEngineService {
|
||||
try {
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("新增超级表列失败:{},失败原因{}", sb, e);
|
||||
log.error(String.format("新增超级表列失败:%s", sb.toString()), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class TDEngineService {
|
||||
try {
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("删除超级表列失败:{},失败原因{}", sb, e);
|
||||
log.error(String.format("删除超级表列失败:%s", sb.toString()), e);
|
||||
}
|
||||
|
||||
} catch (Exception ignored) {
|
||||
@ -189,7 +189,7 @@ public class TDEngineService {
|
||||
try {
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("删除超级表失败:{},失败原因{}", sb, e);
|
||||
log.error(String.format("删除超级表失败:%s", sb.toString()), e);
|
||||
}
|
||||
|
||||
} catch (Exception ignored) {
|
||||
@ -963,7 +963,7 @@ public class TDEngineService {
|
||||
Statement pstmt = conn.createStatement()) {
|
||||
pstmt.executeUpdate(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("新增超级表列失败:{},失败原因{}", sb, e);
|
||||
log.error(String.format("新增超级表列失败:%s", sb.toString()), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class DataServiceImpl implements DataService {
|
||||
}
|
||||
});
|
||||
long end = System.currentTimeMillis();
|
||||
log.debug("读取快照{}个,耗时: {}秒", paramList.size(), (end - start) / 1000.0);
|
||||
log.debug("querySnapshotValues {}个,耗时: {}秒", paramList.size(), (end - start) / 1000.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ public class DataServiceImpl implements DataService {
|
||||
result.putAll(values);
|
||||
}
|
||||
Long end = System.currentTimeMillis();
|
||||
log.debug("读取快照{}个,耗时: {}秒", param.getDevices().size(), (end-start)/ 1000.0);
|
||||
log.debug("queryTimeSeriesValues {}个,耗时: {}秒", param.getDevices().size(), (end-start)/ 1000.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ public class DataServiceImpl implements DataService {
|
||||
result.putAll(values);
|
||||
}
|
||||
Long end = System.currentTimeMillis();
|
||||
log.debug("读取快照{}个,耗时: {}秒", param.getDevices().size(), (end-start)/ 1000.0);
|
||||
log.debug("queryTimeSeriesValues {}个,耗时: {}秒", param.getDevices().size(), (end-start)/ 1000.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class MinioViewsServcie {
|
||||
.stream(inputStream, inputStream.available(), -1)
|
||||
.build());
|
||||
}catch (Exception e){
|
||||
log.error("minio文件上传失败{}", e);
|
||||
log.error("minio文件上传失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
queryWrapper.eq("madeinfactory",madeinfactory);
|
||||
queryWrapper.eq("MODEL",model);
|
||||
TheoreticalPowerCurveEntity theoreticalPowerCurveEntity = theoreticalPowerCurveMapper.selectOne(queryWrapper);
|
||||
if (theoreticalPowerCurveEntity == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
QueryWrapper<SysFaultCodeDict> sysFaultCodeDictQueryWrapper = new QueryWrapper<>();
|
||||
sysFaultCodeDictQueryWrapper.eq("parent",theoreticalPowerCurveEntity.getId());
|
||||
sysFaultCodeDictQueryWrapper.orderByAsc("code");
|
||||
@ -191,7 +194,7 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("文件解析异常:{}",e);
|
||||
log.error("文件解析异常",e);
|
||||
throw new ServiceException("文件解析异常,请检查配置");
|
||||
}
|
||||
return resultMap;
|
||||
@ -235,7 +238,7 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
}
|
||||
stringListMap = parseDataCurve(result, timeFormat);
|
||||
} catch (Exception e) {
|
||||
log.error("文件解析失败{}", e);
|
||||
log.error("文件解析失败", e);
|
||||
throw new ServiceException("文件解析失败");
|
||||
}
|
||||
return stringListMap;
|
||||
|
@ -407,7 +407,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
||||
try {
|
||||
tdEngineService.updateDeviceEventValues(valueList);
|
||||
} catch (Exception e) {
|
||||
log.error("事件信息存入Td失败,失败原因{}", e);
|
||||
log.error("事件信息存入Td失败,失败原因", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ public class SysNodeServiceImpl implements SysNodeService {
|
||||
})
|
||||
.anyMatch(order -> !orderSet.add(order));
|
||||
}catch (Exception e){
|
||||
log.error("校验order不重复失败:{}",e);
|
||||
log.error("校验order不重复失败",e);
|
||||
}
|
||||
return orderRepeated;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class PlcLogsServiceImpl implements PlcLogService {
|
||||
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("文件解析异常:{}",e);
|
||||
log.error("文件解析异常",e);
|
||||
throw new ServiceException("文件解析异常,请检查配置");
|
||||
}
|
||||
return resultMap;
|
||||
@ -162,7 +162,7 @@ public class PlcLogsServiceImpl implements PlcLogService {
|
||||
}
|
||||
stringListMap = parseDataCurve(result, timeFormat);
|
||||
} catch (Exception e) {
|
||||
log.error("文件解析失败{}", e);
|
||||
log.error("文件解析失败", e);
|
||||
throw new ServiceException("文件解析失败");
|
||||
}
|
||||
return stringListMap;
|
||||
|
18
ui/dasadmin/src/stores/faults.ts
Normal file
18
ui/dasadmin/src/stores/faults.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import type { Faults } from '/@/stores/interface'
|
||||
export const useFaultsStore = defineStore('faults', {
|
||||
state: (): Faults => ({
|
||||
data: {},
|
||||
keys: []
|
||||
}),
|
||||
actions: {
|
||||
setData(data: Faults['data']) {
|
||||
this.data = data
|
||||
},
|
||||
setKeys(keys: string[]) {
|
||||
this.keys = keys
|
||||
}
|
||||
},
|
||||
persist: true
|
||||
})
|
@ -135,3 +135,9 @@ export interface Enums {
|
||||
}
|
||||
keys: string[]
|
||||
}
|
||||
export interface Faults {
|
||||
data: {
|
||||
[key: string]: { [k: string]: string }
|
||||
}
|
||||
keys: string[]
|
||||
}
|
||||
|
@ -59,11 +59,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--功率趋势-->
|
||||
<div class="power">
|
||||
<div class="cardLabel">功率趋势</div>
|
||||
<div class="chartBox">
|
||||
<div class="power-chart" ref="powerChartRef"></div>
|
||||
<!--温度-->
|
||||
<div class="temperatureList">
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef1"></div>
|
||||
</div>
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef2"></div>
|
||||
</div>
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -137,16 +142,12 @@
|
||||
<div @click="openSubSystem(11)" class="dot index-12"></div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<!-- 温度 -->
|
||||
<!-- 功率趋势 -->
|
||||
<div class="chartPart">
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef1"></div>
|
||||
</div>
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef2"></div>
|
||||
</div>
|
||||
<div class="chartPart-item" @click="openTemperature">
|
||||
<div class="chartParm" ref="temperatureChartRef3"></div>
|
||||
<div class="power">
|
||||
<div class="chartBox">
|
||||
<div class="power-chart" ref="powerChartRef"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chartPart-item item_bar">
|
||||
<div class="frequencyChart" ref="frequencyChartRef"></div>
|
||||
@ -237,12 +238,12 @@
|
||||
<el-scrollbar>
|
||||
<div class="PitchPart">
|
||||
<!-- <el-row > -->
|
||||
<!-- <el-col :span="12"> -->
|
||||
<div class="Pitchitem" v-for="item in subSystemDataList" :key="item.name">
|
||||
<span class="PitchitemLeft">{{ item.name }}</span>
|
||||
<span class="PitchitemRight">{{ item.value }}</span>
|
||||
</div>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="12"> -->
|
||||
<div class="Pitchitem" v-for="item in subSystemDataList" :key="item.name">
|
||||
<span class="PitchitemLeft">{{ item.name }}</span>
|
||||
<span class="PitchitemRight">{{ item.value }}</span>
|
||||
</div>
|
||||
<!-- </el-col> -->
|
||||
<!-- </el-row> -->
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
@ -382,8 +383,18 @@ const initpowerChart = () => {
|
||||
const powerChart = state.charts.powerChart ?? echarts.init(powerChartRef.value as unknown as HTMLElement)
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
show: true,
|
||||
text: '功率趋势',
|
||||
textStyle: {
|
||||
color: '#4E5969',
|
||||
fontSize: 14,
|
||||
fontFamily: 'PingFangSC-Semibold',
|
||||
},
|
||||
padding: 10,
|
||||
},
|
||||
grid: {
|
||||
top: 50,
|
||||
top: 70,
|
||||
right: 23,
|
||||
bottom: 10,
|
||||
left: 18,
|
||||
@ -485,6 +496,7 @@ const initpowerChart = () => {
|
||||
textStyle: {
|
||||
color: '#73767a',
|
||||
},
|
||||
top: 20,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@ -715,17 +727,21 @@ const initTemperatureChart = () => {
|
||||
const option = {
|
||||
grid: {
|
||||
top: 30,
|
||||
//right: 100,
|
||||
right: 5,
|
||||
bottom: 0,
|
||||
left: -100,
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
// type: 'category',
|
||||
type: 'value',
|
||||
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
// type: 'value',
|
||||
type: 'category',
|
||||
|
||||
show: false,
|
||||
},
|
||||
series: [
|
||||
@ -735,8 +751,9 @@ const initTemperatureChart = () => {
|
||||
type: 'bar',
|
||||
label: {
|
||||
show: true,
|
||||
align: 'center',
|
||||
formatter: `{a|{c}}\n{b|{a}}`,
|
||||
align: 'left',
|
||||
// verticalAlign:'top',
|
||||
formatter: `{b|{a}} {a|{c}}`,
|
||||
rich: {
|
||||
a: {
|
||||
color: '#333333',
|
||||
@ -747,12 +764,14 @@ const initTemperatureChart = () => {
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
position: 'insideBottom',
|
||||
offset: [62, 0],
|
||||
width: 100,
|
||||
height: 22,
|
||||
position: 'insideLeft',
|
||||
offset: [85, -22],
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#048bd2',
|
||||
borderRadius: [0, 0, 4, 4],
|
||||
borderRadius: [0, 4, 4, 0],
|
||||
},
|
||||
barWidth: 20,
|
||||
},
|
||||
@ -835,7 +854,7 @@ const initFrequencyChart = () => {
|
||||
fontSize: 14,
|
||||
fontFamily: 'PingFangSC-Semibold',
|
||||
},
|
||||
padding: 15,
|
||||
padding: 10,
|
||||
},
|
||||
],
|
||||
polar: {
|
||||
@ -1241,8 +1260,9 @@ const getThisDayChartDataForMinute = () => {
|
||||
const getAllChartData = (type: ('power' | 'trend' | 'frequency')[] = ['power', 'trend', 'frequency']) => {
|
||||
if (type.includes('power')) {
|
||||
getThisDayChartData().then(() => {
|
||||
initpowerChart()
|
||||
// initTemperatureChart()
|
||||
nextTick(() => {
|
||||
initpowerChart()
|
||||
})
|
||||
})
|
||||
}
|
||||
// if (type.includes('trend')) {
|
||||
@ -1254,7 +1274,9 @@ const getAllChartData = (type: ('power' | 'trend' | 'frequency')[] = ['power', '
|
||||
// }
|
||||
if (type.includes('frequency')) {
|
||||
getThisDayChartDataForMinute().then((res) => {
|
||||
initFrequencyChart()
|
||||
nextTick(() => {
|
||||
initFrequencyChart()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -1609,23 +1631,50 @@ $labelHeight: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.power {
|
||||
.temperatureList {
|
||||
@include cardDefaultStyle;
|
||||
@include cardlabel;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
margin: 10px 0;
|
||||
width: 100%;
|
||||
height: calc(40% - 20px);
|
||||
// min-height: 285px;
|
||||
// height: v-bind('computedHeight.powerHeight');
|
||||
.chartBox {
|
||||
.chartPart-item {
|
||||
// margin: 5px 0;
|
||||
width: 100%;
|
||||
height: calc(100% - $labelHeight);
|
||||
.power-chart {
|
||||
height: calc(33.3% - 10px);
|
||||
background: #f0f6ff;
|
||||
border-radius: 8px;
|
||||
// text-align: center;
|
||||
color: #4e5969;
|
||||
.chartParm {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.frequencyChart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .power {
|
||||
// @include cardDefaultStyle;
|
||||
// @include cardlabel;
|
||||
// margin: 10px 0;
|
||||
// width: 100%;
|
||||
// height: calc(40% - 20px);
|
||||
// // min-height: 285px;
|
||||
// // height: v-bind('computedHeight.powerHeight');
|
||||
// .chartBox {
|
||||
// width: 100%;
|
||||
// height: calc(100% - $labelHeight);
|
||||
// .power-chart {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
.cardContentCenter {
|
||||
@include cardDefaultStyle;
|
||||
@ -1846,18 +1895,29 @@ $labelHeight: 24px;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.power {
|
||||
margin-bottom: 5px;
|
||||
width: 60%;
|
||||
height: 100%;
|
||||
background-color: #f0f6ff;
|
||||
border-radius: 8px;
|
||||
.chartBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.power-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chartPart-item {
|
||||
margin: 5px;
|
||||
width: 25%;
|
||||
margin: 0 0 5px 5px;
|
||||
// width: 25%;
|
||||
height: 100%;
|
||||
background: #f0f6ff;
|
||||
border-radius: 8px;
|
||||
// text-align: center;
|
||||
color: #4e5969;
|
||||
.chartParm {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.frequencyChart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -23,14 +23,14 @@
|
||||
<div class="small-base">实时无功:<span>{{ realData.attributeMap.windfarmreactivepower}}kVar</span></div>
|
||||
<div class="small-base">日发电量:<span>{{ realData.attributeMap.windfarmdayprodenergy}}万kWh</span></div>
|
||||
<div class="small-base">月发电量:<span>{{ realData.attributeMap.windfarmmonthprodenergy}}万kWh</span></div>
|
||||
<div class="small-base">年发电量:<span>{{ realData.attributeMap.windfarmyearprodenergy}}万kWh</span></div>
|
||||
<div style="padding: 0;" class="small-base">年发电量:<span>{{ realData.attributeMap.windfarmyearprodenergy}}万kWh</span></div>
|
||||
</div>
|
||||
<div class="overviewItem" style="border: none;">
|
||||
<div class="small-base">并网:<span>{{ realData.attributeMap.turbinecountpowerprod}}台</span></div>
|
||||
<div class="small-base">停机/待机:<span>{{ realData.attributeMap.turbinecountidle}}台</span></div>
|
||||
<div class="small-base">故障:<span>{{ realData.attributeMap.turbinecountfaulted}}台</span></div>
|
||||
<div class="small-base">维护:<span>{{ realData.attributeMap.turbinecountservice}}台</span></div>
|
||||
<div style="padding: 0;" class="small-base">无通讯:<span>{{ realData.attributeMap.turbinecountdisconnected}}台</span></div>
|
||||
<div class="small-base"><i class="powerprod"></i>并网:<span>{{ realData.attributeMap.turbinecountpowerprod}}台</span></div>
|
||||
<div class="small-base"><i class="idle"></i>停机/待机:<span>{{ realData.attributeMap.turbinecountidle}}台</span></div>
|
||||
<div class="small-base"><i class="faulted"></i>故障:<span>{{ realData.attributeMap.turbinecountfaulted}}台</span></div>
|
||||
<div class="small-base"><i class="service"></i>维护:<span>{{ realData.attributeMap.turbinecountservice}}台</span></div>
|
||||
<div style="padding: 0;" class="small-base"><i class="disconnected"></i>无通讯:<span>{{ realData.attributeMap.turbinecountdisconnected}}台</span></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -58,16 +58,18 @@ import { useRoute } from 'vue-router'
|
||||
import { getParamList } from '/@/api/backend/SystemParam/request'
|
||||
import { queryfaultCodeDict } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import { useEnumStore } from '/@/stores/enums'
|
||||
import { useFaultsStore } from '/@/stores/faults'
|
||||
import {equipList} from "/@/api/backend/realData/request";
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const enumStore = useEnumStore()
|
||||
const faultCodeDict = useFaultsStore()
|
||||
const d = new Date()
|
||||
const { t } = useI18n()
|
||||
let timer: any = null
|
||||
let myTable = ref<TableInstance>()
|
||||
const windList=ref([])
|
||||
|
||||
|
||||
const overviewSlotData= ref('')
|
||||
|
||||
@ -235,13 +237,17 @@ const StatusListData = () => {
|
||||
let color:any=''
|
||||
const state = getRealTimeState(item.attributeMap)
|
||||
let firsttriggeredcode=item.attributeMap.firsttriggeredcode
|
||||
const key = `${item.madeinFactory}-${item.model}`;
|
||||
if (enumStore.keys.includes('FirstTriggeredCode')) {
|
||||
firsttriggeredcode = enumStore.data['FirstTriggeredCode'][firsttriggeredcode]
|
||||
}
|
||||
/*if (malFunctionKeys.includes('FirstTriggeredCode')) {
|
||||
firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode
|
||||
if (faultCodeDict.keys.includes(key)) {
|
||||
if (firsttriggeredcode == 0) {
|
||||
firsttriggeredcode = '';
|
||||
} else {
|
||||
firsttriggeredcode = faultCodeDict.data[key][firsttriggeredcode] ?? '';
|
||||
}
|
||||
}
|
||||
*/
|
||||
paramColorData.value.forEach((item, index) => {
|
||||
if (item.state == state) {
|
||||
color = item.color
|
||||
@ -345,7 +351,6 @@ const StatusListData = () => {
|
||||
locked: item.attributeMap.locked,
|
||||
irotorspeed: item.attributeMap.irotorspeed,
|
||||
firsttriggeredcode:firsttriggeredcode,
|
||||
//firsttriggeredcode:item.attributeMap.firsttriggeredcode,
|
||||
},
|
||||
}
|
||||
})
|
||||
@ -358,53 +363,34 @@ const StatusListData = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
let malFunctionEnums: any = {}
|
||||
/*const getMalfunctionEnums = () => {
|
||||
windList.value.forEach((item)=> {
|
||||
console.log({madeinfactory: item.madeinfactory, model: item.model })
|
||||
queryfaultCodeDict({madeinfactory: item.madeinfactory, model: item.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const data: any = {}
|
||||
res.data.forEach((item: any) => {
|
||||
data[item.code] = item.description
|
||||
})
|
||||
malFunctionEnums = data
|
||||
} else {
|
||||
console.warn('查询故障代码字典失败:', res.message);
|
||||
}
|
||||
})
|
||||
})
|
||||
// 添加响应式属性以存储故障代码字典
|
||||
/*const malFunctionEnums = ref<{ [key: string]: { [code: string]: string } }>({});
|
||||
|
||||
}*/
|
||||
|
||||
/*const requestedParams = new Set<string>();
|
||||
const requestedParams = new Set<string>();
|
||||
const failedRequests = new Set<string>();
|
||||
|
||||
const fetchData = async (item: any) => {
|
||||
// 创建一个唯一的键来标识参数组合
|
||||
const key = `${item.madeinFactory}-${item.model}`;
|
||||
|
||||
// 检查这个键是否已经在 Set 中
|
||||
if (requestedParams.has(key)) {
|
||||
console.log('Duplicate request detected, skipping...');
|
||||
return;
|
||||
}
|
||||
// 将键添加到 Set 中
|
||||
requestedParams.add(key);
|
||||
|
||||
try {
|
||||
console.log({ madeinfactory: item.madeinFactory, model: item.model })
|
||||
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
|
||||
if (response.code === 200) {
|
||||
const data: any = {};
|
||||
response.data.forEach((item: any) => {
|
||||
data[item.code] = item.description;
|
||||
});
|
||||
malFunctionEnums = data;
|
||||
malFunctionEnums.value[key] = data;
|
||||
} else {
|
||||
console.warn('查询故障代码字典失败:', response.message);
|
||||
failedRequests.add(key);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求出错:', error);
|
||||
failedRequests.add(key);
|
||||
}
|
||||
};*/
|
||||
|
||||
@ -445,14 +431,6 @@ onMounted(() => {
|
||||
res.data.map((item: any) => {
|
||||
deviceCode.value.push(item.code)
|
||||
})
|
||||
windList.value=res.data.map((item: any) => {
|
||||
//fetchData(item)
|
||||
return {
|
||||
madeinfactory:item.madeinFactory,
|
||||
model: item.model ?? '-',
|
||||
}
|
||||
})
|
||||
//getMalfunctionEnums()
|
||||
})
|
||||
|
||||
overviewList()
|
||||
@ -535,40 +513,69 @@ $labelHeight: 30px;
|
||||
height: v-bind('computedHeight.centerHeight');
|
||||
margin-bottom: 0;
|
||||
.el-scrollbar {
|
||||
height: calc(100% - 20px);
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
.homeHeader{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-start;
|
||||
/*justify-content: space-between;*/
|
||||
.cardLabel{
|
||||
margin-right: 10px;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
vertical-align: middle
|
||||
}
|
||||
.cardBtn{
|
||||
white-space: nowrap;
|
||||
:deep(.el-radio-group){
|
||||
flex-wrap: nowrap;
|
||||
|
||||
}
|
||||
:deep(.el-radio){
|
||||
margin-right: 12px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.headerRight{
|
||||
width: 100%;
|
||||
/*width: 100%;*/
|
||||
margin-left: auto;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
background: #F0F6FF;
|
||||
border-radius: 8px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
.overviewItem{
|
||||
display: inline-block;
|
||||
.small-base{
|
||||
display: inline-block;
|
||||
padding-right: 8px;
|
||||
padding-right: 15px;
|
||||
color: #4E5969;
|
||||
i{
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
aspect-ratio: 1 / 1;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.powerprod{
|
||||
background-color: #0277B3;
|
||||
}
|
||||
.idle{
|
||||
background-color: #FFB600;
|
||||
}
|
||||
.faulted{
|
||||
background-color: #FE3731;
|
||||
}
|
||||
.service{
|
||||
background-color: #00A096;
|
||||
}
|
||||
.disconnected{
|
||||
background-color: #999999;
|
||||
}
|
||||
span{
|
||||
color: #000000;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<div class="FanList-content">
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="12" :sm="8" :md="8" :lg="4" :xl="3" v-for="item in props.parentData" style="margin-bottom: 5px">
|
||||
<div class="grid-content ep-bg-purple"
|
||||
@click="handleClick(item)"
|
||||
@contextmenu.prevent="windContextMenu($event,item)"
|
||||
<!-- <el-row :gutter="10">
|
||||
<el-col :xs="12" :sm="8" :md="8" :lg="4" :xl="3" v-for="item in props.parentData" style="margin-bottom: 5px">-->
|
||||
<div class="overviewPart" v-for="item in props.parentData">
|
||||
<div class="grid-content"
|
||||
@click="handleClick(item)"
|
||||
@contextmenu.prevent="windContextMenu($event,item)"
|
||||
>
|
||||
<div class="FanList-panel wind-default" :class="{
|
||||
'': item.standard==1,
|
||||
@ -37,9 +38,40 @@
|
||||
>通讯中断</el-tag>
|
||||
</div>
|
||||
<div class="fanlist-main">
|
||||
<WindContentleft :item="item" v-if="item.layout==='风格1'"></WindContentleft>
|
||||
<WindContentright :item="item" v-else-if="item.layout==='风格2'"></WindContentright>
|
||||
<WindContentcenter :item="item" v-else-if="item.layout==='风格3'"></WindContentcenter>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="fanlist-pic">
|
||||
<div class="mask">
|
||||
<div class="heart"><img :src="getSafeImagePath(item, 'heart')" alt="" /></div>
|
||||
<div class="leafs" :style="getAnimationStyle(item)">
|
||||
<div class="leaf_1"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
|
||||
<div class="leaf_2"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
|
||||
<div class="leaf_3"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fanlist-pic">
|
||||
<img :src="getSafeImagePath(item, 'fan')" alt="" />
|
||||
</div>
|
||||
<!-- <div class="fanlist-pic" style="margin: 0;">
|
||||
<img src="~assets/dashboard/fannew/base.png" alt="" />
|
||||
</div>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="fanlist-data">
|
||||
<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>-->
|
||||
@ -48,8 +80,9 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- </el-col>
|
||||
</el-row>-->
|
||||
|
||||
<ContextMenu :pos="contextMenuPos" v-model:visible="OperateVisible">
|
||||
<template #default>
|
||||
@ -105,6 +138,31 @@ const props = defineProps({
|
||||
default: () => [],
|
||||
},
|
||||
})
|
||||
const getAnimationStyle = (item) => {
|
||||
const irotorspeed = item.attributeMap?.irotorspeed ?? 0
|
||||
let animationDuration;
|
||||
animationDuration = 60 / irotorspeed / 3
|
||||
const processedoperationmode = item.attributeMap?.processedoperationmode ?? 0
|
||||
if(processedoperationmode==33){
|
||||
return {
|
||||
'animation-duration': `0s`,
|
||||
'animation-timing-function': 'linear',
|
||||
'animation-iteration-count': 'infinite',
|
||||
'animation-direction': 'normaL',
|
||||
}
|
||||
}else{
|
||||
|
||||
return {
|
||||
'animation-duration': `${animationDuration}s`,
|
||||
'animation-timing-function': 'linear',
|
||||
'animation-iteration-count': 'infinite',
|
||||
'animation-direction': 'normaL',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
const handleClick = (row) => {
|
||||
if (!router.hasRoute('windTurbine')) {
|
||||
router.addRoute('admin', {
|
||||
@ -264,6 +322,92 @@ const hexToRgba = (hex, alpha) => {
|
||||
}
|
||||
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
||||
}
|
||||
const imagePathMap = {
|
||||
'#9C27B0': {
|
||||
heart: 'heart1.png',
|
||||
leaf: 'leaf1.png',
|
||||
fan: 'fan1.png',
|
||||
},
|
||||
'#673AB7': {
|
||||
heart: 'heart2.png',
|
||||
leaf: 'leaf2.png',
|
||||
fan: 'fan2.png',
|
||||
},
|
||||
'#3F51B5': {
|
||||
heart: 'heart3.png',
|
||||
leaf: 'leaf3.png',
|
||||
fan: 'fan3.png',
|
||||
},
|
||||
'#3059EC': {
|
||||
heart: 'heart4.png',
|
||||
leaf: 'leaf4.png',
|
||||
fan: 'fan4.png',
|
||||
},
|
||||
'#0277B3': {
|
||||
heart: 'heart5.png',
|
||||
leaf: 'leaf5.png',
|
||||
fan: 'fan5.png',
|
||||
},
|
||||
'#00A096': {
|
||||
heart: 'heart6.png',
|
||||
leaf: 'leaf6.png',
|
||||
fan: 'fan6.png',
|
||||
},
|
||||
'#06B429': {
|
||||
heart: 'heart7.png',
|
||||
leaf: 'leaf7.png',
|
||||
fan: 'fan7.png',
|
||||
},
|
||||
'#64DD17': {
|
||||
heart: 'heart8.png',
|
||||
leaf: 'leaf8.png',
|
||||
fan: 'fan8.png',
|
||||
},
|
||||
'#EEFF41': {
|
||||
heart: 'heart9.png',
|
||||
leaf: 'leaf9.png',
|
||||
fan: 'fan9.png',
|
||||
},
|
||||
'#FFB600': {
|
||||
heart: 'heart10.png',
|
||||
leaf: 'leaf10.png',
|
||||
fan: 'fan10.png',
|
||||
},
|
||||
'#FF7E00': {
|
||||
heart: 'heart11.png',
|
||||
leaf: 'leaf11.png',
|
||||
fan: 'fan11.png',
|
||||
},
|
||||
'#FE3731': {
|
||||
heart: 'heart12.png',
|
||||
leaf: 'leaf12.png',
|
||||
fan: 'fan12.png',
|
||||
},
|
||||
'#999999': {
|
||||
heart: 'heart13.png',
|
||||
leaf: 'leaf13.png',
|
||||
fan: 'fan13.png',
|
||||
}
|
||||
};
|
||||
|
||||
const getImagePath = (item, type) => {
|
||||
const color = item.attributeMap.color;
|
||||
return imagePathMap[color]?.[type];
|
||||
};
|
||||
|
||||
const getSafeImagePath = (item, type) => {
|
||||
const path = getImagePath(item, type);
|
||||
if (!getSafeImagePath.cache) {
|
||||
getSafeImagePath.cache = {};
|
||||
}
|
||||
if (getSafeImagePath.cache[path]) {
|
||||
return getSafeImagePath.cache[path];
|
||||
}
|
||||
const imagePath = new URL(`/src/assets/dashboard/fan/${path}`, import.meta.url).href;
|
||||
getSafeImagePath.cache[path] = imagePath;
|
||||
return imagePath;
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -312,146 +456,157 @@ const hexToRgba = (hex, alpha) => {
|
||||
}
|
||||
.FanList-content {
|
||||
overflow-x: hidden;
|
||||
.FanList-panel {
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
.fanlist-top {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
.fanlist-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.fanlist-name {
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.tag-panel {
|
||||
border-radius: 0 8px 0 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
.is-primary {
|
||||
background: rgba(2, 119, 179, 0.2);
|
||||
border: 1px solid #0277b3;
|
||||
color: #0277b3;
|
||||
}
|
||||
.is-success {
|
||||
background: rgba(6, 180, 41, 0.2);
|
||||
border: 1px solid #06b429;
|
||||
color: #06b429;
|
||||
}
|
||||
.is-info {
|
||||
background: rgba(48, 89, 236, 0.2);
|
||||
border: 1px solid #3059ec;
|
||||
color: #3059ec;
|
||||
}
|
||||
.is-warning {
|
||||
background: rgba(255, 126, 0, 0.2);
|
||||
border: 1px solid #ff7e00;
|
||||
color: #ff7e00;
|
||||
}
|
||||
.is-danger {
|
||||
background: rgba(254, 55, 49, 0.2);
|
||||
border: 1px solid #fe3731;
|
||||
color: #fe3731;
|
||||
}
|
||||
.is-offline {
|
||||
background: rgba(153, 153, 153, 0.2);
|
||||
border: 1px solid #999999;
|
||||
color: #999999;
|
||||
}
|
||||
.is-maintenance {
|
||||
background: rgba(0, 160, 150, 0.2);
|
||||
border: 1px solid #00a096;
|
||||
color: #00a096;
|
||||
}
|
||||
.fanlist-main {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 5px 10px 0 10px;
|
||||
text-align: center;
|
||||
.fanlist-pic {
|
||||
display: grid;
|
||||
justify-content: space-between;
|
||||
grid-template-columns: repeat(auto-fill, 170px);
|
||||
.overviewPart{
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 170px;
|
||||
height: 140px;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
.FanList-panel {
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
.fanlist-top {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
.fanlist-icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: -10px;
|
||||
.mask {
|
||||
width: 43px;
|
||||
height: 38px;
|
||||
.heart {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 5px;
|
||||
left: 17px;
|
||||
/* z-index: 3;*/
|
||||
}
|
||||
.leafs {
|
||||
/* z-index: 1;*/
|
||||
position: absolute;
|
||||
/* animation: leafRotate 1s infinite linear;*/
|
||||
transform-origin: center center;
|
||||
width: 44px;
|
||||
height: 46px;
|
||||
/*animation-duration: 1s;*/
|
||||
animation-name: leafRotate;
|
||||
/*animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;*/
|
||||
.leaf_1 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 17px;
|
||||
top: -1px;
|
||||
/* transform-origin: left top;*/
|
||||
}
|
||||
.leaf_2 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 31px;
|
||||
top: 20px;
|
||||
/* transform-origin: left top;*/
|
||||
transform: rotate(120deg);
|
||||
}
|
||||
.leaf_3 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 22px;
|
||||
/*transform-origin: left top;*/
|
||||
transform: rotate(240deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.fanlist-text {
|
||||
margin-top: 5px;
|
||||
.fanlist-name {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
.content-number {
|
||||
color: #333333;
|
||||
font-size: 20px;
|
||||
padding-right: 5px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.tag-panel {
|
||||
border-radius: 0 8px 0 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
.is-primary {
|
||||
background: rgba(2, 119, 179, 0.2);
|
||||
border: 1px solid #0277b3;
|
||||
color: #0277b3;
|
||||
}
|
||||
.is-success {
|
||||
background: rgba(6, 180, 41, 0.2);
|
||||
border: 1px solid #06b429;
|
||||
color: #06b429;
|
||||
}
|
||||
.is-info {
|
||||
background: rgba(48, 89, 236, 0.2);
|
||||
border: 1px solid #3059ec;
|
||||
color: #3059ec;
|
||||
}
|
||||
.is-warning {
|
||||
background: rgba(255, 126, 0, 0.2);
|
||||
border: 1px solid #ff7e00;
|
||||
color: #ff7e00;
|
||||
}
|
||||
.is-danger {
|
||||
background: rgba(254, 55, 49, 0.2);
|
||||
border: 1px solid #fe3731;
|
||||
color: #fe3731;
|
||||
}
|
||||
.is-offline {
|
||||
background: rgba(153, 153, 153, 0.2);
|
||||
border: 1px solid #999999;
|
||||
color: #999999;
|
||||
}
|
||||
.is-maintenance {
|
||||
background: rgba(0, 160, 150, 0.2);
|
||||
border: 1px solid #00a096;
|
||||
color: #00a096;
|
||||
}
|
||||
.fanlist-main {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 5px 10px 0 10px;
|
||||
text-align: center;
|
||||
.fanlist-pic {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: -10px;
|
||||
.mask {
|
||||
width: 43px;
|
||||
height: 38px;
|
||||
.heart {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 5px;
|
||||
left: 17px;
|
||||
/* z-index: 3;*/
|
||||
}
|
||||
.leafs {
|
||||
/* z-index: 1;*/
|
||||
position: absolute;
|
||||
/* animation: leafRotate 1s infinite linear;*/
|
||||
transform-origin: center center;
|
||||
width: 44px;
|
||||
height: 46px;
|
||||
/*animation-duration: 1s;*/
|
||||
animation-name: leafRotate;
|
||||
/*animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;*/
|
||||
.leaf_1 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 17px;
|
||||
top: -1px;
|
||||
/* transform-origin: left top;*/
|
||||
}
|
||||
.leaf_2 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 31px;
|
||||
top: 20px;
|
||||
/* transform-origin: left top;*/
|
||||
transform: rotate(120deg);
|
||||
}
|
||||
.leaf_3 {
|
||||
width: 9px;
|
||||
height: 19px;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 22px;
|
||||
/*transform-origin: left top;*/
|
||||
transform: rotate(240deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fanlist-text {
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
.content-number {
|
||||
color: #333333;
|
||||
font-size: 20px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
}
|
||||
.fanlist-text span {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.fanlist-text span {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.fanlist-bottom {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 24px;
|
||||
.tag-panel {
|
||||
border-radius: 0 0 8px 0;
|
||||
line-height: 20px;
|
||||
.fanlist-bottom {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 24px;
|
||||
.tag-panel {
|
||||
border-radius: 0 0 8px 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
'': item.standard==0,
|
||||
'wind-offline': item.attributeMap.processedoperationmode == 33
|
||||
}">
|
||||
|
||||
<div class="fanlist-top">
|
||||
<span :class="item.standard == 1 ? 'wind-mark-icon' : 'fanlist-icon'">
|
||||
<img :class="item.standard == 1 ? '' : 'wind-picture'" src="~assets/dashboard/biaogan.png" alt="" />
|
||||
@ -69,12 +68,12 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="fanlist-bottom">
|
||||
<!-- <span :style="item.attributeMap.locked == 1 ? 'max-width:120px;' : 'max-width:150px;'">
|
||||
{{ item.attributeMap.firsttriggeredcode }}
|
||||
</span>-->
|
||||
<span :style="item.attributeMap.locked == 1 ? 'max-width:120px;' : 'max-width:150px;'">
|
||||
{{ getFaultDescription(item) }}
|
||||
{{ item.attributeMap.firsttriggeredcode }}
|
||||
</span>
|
||||
<!-- <span :style="item.attributeMap.locked == 1 ? 'max-width:120px;' : 'max-width:150px;'">
|
||||
{{ getFaultDescription(item) }}
|
||||
</span>-->
|
||||
<!-- <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>
|
||||
@ -411,59 +410,58 @@ const getSafeImagePath = (item, type) => {
|
||||
return imagePath;
|
||||
|
||||
};
|
||||
const getFaultDescription=(item)=>{
|
||||
//getMalfunctionEnums(item)
|
||||
fetchData(item)
|
||||
let firsttriggeredcode=item.attributeMap.firsttriggeredcode
|
||||
if (malFunctionKeys.includes('FirstTriggeredCode')) {
|
||||
firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode
|
||||
|
||||
/*const getFaultDescription=(item)=>{
|
||||
const key = `${item.madeinFactory}-${item.model}`;
|
||||
if (failedRequests.has(key)) {
|
||||
return '';
|
||||
}
|
||||
return firsttriggeredcode
|
||||
|
||||
if (!malFunctionEnums[key]) {
|
||||
fetchData(item); // 如果还没有请求过,则发起请求
|
||||
// return item.attributeMap.firsttriggeredcode;
|
||||
}
|
||||
|
||||
let firsttriggeredcode = item.attributeMap.firsttriggeredcode;
|
||||
if (malFunctionKeys.includes('FirstTriggeredCode') && malFunctionEnums[key]) {
|
||||
if(firsttriggeredcode==0){
|
||||
return ''
|
||||
}else{
|
||||
firsttriggeredcode = malFunctionEnums[key][firsttriggeredcode] ?? '';
|
||||
}
|
||||
}
|
||||
return firsttriggeredcode;
|
||||
}
|
||||
|
||||
let malFunctionEnums: any = {}
|
||||
/*const getMalfunctionEnums = (item) => {
|
||||
/!*queryfaultCodeDict({ madeinfactory: item!.madeinFactory, model: item!.model }).then((res) => {*!/
|
||||
queryfaultCodeDict({ madeinfactory: '广东明阳风电', model: 'MY1.5/89' }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const data: any = {}
|
||||
res.data.forEach((item: any) => {
|
||||
data[item.code] = item.description
|
||||
})
|
||||
malFunctionEnums = data
|
||||
} else {
|
||||
console.warn('查询故障代码字典失败:', res.message);
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
let malFunctionEnums: { [key: string]: { [code: string]: string } } = {};
|
||||
const requestedParams = new Set<string>();
|
||||
const failedRequests = new Set<string>();
|
||||
|
||||
const fetchData = async (item: any) => {
|
||||
const key = `${item.madeinFactory}-${item.model}`;
|
||||
|
||||
if (requestedParams.has(key)) {
|
||||
console.log('Duplicate request detected, skipping...');
|
||||
return;
|
||||
}
|
||||
requestedParams.add(key);
|
||||
|
||||
try {
|
||||
malFunctionEnums={}
|
||||
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
|
||||
if (response.code === 200) {
|
||||
const data: any = {};
|
||||
response.data.forEach((item: any) => {
|
||||
data[item.code] = item.description;
|
||||
});
|
||||
malFunctionEnums = data;
|
||||
malFunctionEnums[key] = data;
|
||||
} else {
|
||||
console.warn('查询故障代码字典失败:', response.message);
|
||||
failedRequests.add(key);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求出错:', error);
|
||||
failedRequests.add(key);
|
||||
}
|
||||
};
|
||||
};*/
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -92,6 +92,7 @@ import { editDefaultLang } from '/@/lang/index'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
import { useAdminInfo } from '/@/stores/adminInfo'
|
||||
import { useEnumStore } from '/@/stores/enums'
|
||||
import {useFaultsStore} from "/@/stores/faults"
|
||||
import { login } from '/@/api/backend'
|
||||
import { buildValidatorData } from '/@/utils/validate'
|
||||
import router from '/@/router'
|
||||
@ -100,11 +101,15 @@ import toggleDark from '/@/utils/useDark'
|
||||
import { fullUrl } from '/@/utils/common'
|
||||
import { adminBaseRoutePath } from '/@/router/static/adminBase'
|
||||
import { getAllEnumData } from '/@/api/backend/Enumeration/request'
|
||||
import {equipList} from "/@/api/backend/realData/request";
|
||||
import { queryfaultCodeDict } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
|
||||
let timer: number
|
||||
|
||||
const config = useConfig()
|
||||
const adminInfo = useAdminInfo()
|
||||
const enumsStore = useEnumStore()
|
||||
const FaultsStore = useFaultsStore()
|
||||
|
||||
const isSmall = ref(window.screen.width < 620 ? true : false)
|
||||
|
||||
@ -192,7 +197,6 @@ const load = () => {
|
||||
state.captcha = 'data:image\/png;base64,' + res.data.img
|
||||
})
|
||||
}
|
||||
|
||||
const getEnumsData = () => {
|
||||
getAllEnumData().then((res) => {
|
||||
if (res.success) {
|
||||
@ -213,6 +217,49 @@ const getEnumsData = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
equipList({ objectType: 10002 }).then((res) => {
|
||||
res.data.map((item: any) => {
|
||||
fetchData(item)
|
||||
return {
|
||||
madeinfactory:item.madeinFactory,
|
||||
model: item.model ?? '-',
|
||||
}
|
||||
})
|
||||
})
|
||||
const malFunctionEnums = ref<{ [key: string]: { [code: string]: string } }>({});
|
||||
|
||||
const requestedParams = new Set<string>();
|
||||
const failedRequests = new Set<string>();
|
||||
const fetchData = async (item: any) => {
|
||||
const key = `${item.madeinFactory}-${item.model}`;
|
||||
if (requestedParams.has(key)) {
|
||||
return;
|
||||
}
|
||||
requestedParams.add(key);
|
||||
const keys = requestedParams;
|
||||
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
|
||||
if (response.code === 200) {
|
||||
const data: any = {};
|
||||
response.data.forEach((item: any) => {
|
||||
data[item.code] = item.description;
|
||||
});
|
||||
malFunctionEnums.value[key] = data;
|
||||
const datas=malFunctionEnums.value
|
||||
sessionStorage.setItem(
|
||||
'faultCodeDict',
|
||||
JSON.stringify({
|
||||
datas,
|
||||
keys:Array.from(requestedParams),
|
||||
})
|
||||
)
|
||||
FaultsStore.setKeys(Array.from(requestedParams))
|
||||
FaultsStore.setData(datas)
|
||||
} else {
|
||||
console.warn('查询故障代码字典失败:', response.message);
|
||||
failedRequests.add(key);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const onSubmit = () => {
|
||||
state.submitLoading = true
|
||||
|
Loading…
Reference in New Issue
Block a user