This commit is contained in:
zhouhuang 2024-12-17 13:39:09 +08:00
commit 9b6cc13e00
23 changed files with 561 additions and 90 deletions

View File

@ -93,6 +93,10 @@ public class SysIotModelController {
/** 获取物模型属性列表 */ /** 获取物模型属性列表 */
@PostMapping("/attribute/list") @PostMapping("/attribute/list")
public PageDataInfo<SysIotModelFieldVo> querySysIotModelField(@RequestBody SysIotModelFieldDto sysIotModelFieldDto) { public PageDataInfo<SysIotModelFieldVo> querySysIotModelField(@RequestBody SysIotModelFieldDto sysIotModelFieldDto) {
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_VIEW_CONFIDENTIAL_DATA.toString());
if (!hasPermission){
sysIotModelFieldDto.setConfidential(0);
}
if (sysIotModelFieldDto.getPageNum() == null && sysIotModelFieldDto.getPageSize() == null){ if (sysIotModelFieldDto.getPageNum() == null && sysIotModelFieldDto.getPageSize() == null){
List<SysIotModelFieldVo> sysIotModelFieldVos = sysIotModelService.queryAllModelField(sysIotModelFieldDto); List<SysIotModelFieldVo> sysIotModelFieldVos = sysIotModelService.queryAllModelField(sysIotModelFieldDto);
return PageDataInfo.build(sysIotModelFieldVos,sysIotModelFieldVos.size()); return PageDataInfo.build(sysIotModelFieldVos,sysIotModelFieldVos.size());

View File

@ -19,7 +19,7 @@ public interface FaultRecorderService {
void download(String path, HttpServletResponse httpServletResponse) throws IOException; void download(String path, HttpServletResponse httpServletResponse) throws IOException;
Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException; Map<String, List<Object>> getDataCurve(String url, String deviceCode);
void updateFdrConfig(SysEquipment sysEquipment); void updateFdrConfig(SysEquipment sysEquipment);

View File

@ -168,9 +168,8 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
} }
@Override @Override
public Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException { public Map<String, List<Object>> getDataCurve(String url, String deviceCode) {
Map<String, List<Object>> resultMap = null; Map<String, List<Object>> resultMap = null;
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
//根据device Code查询故障录波格式 //根据device Code查询故障录波格式
QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CODE", deviceCode); queryWrapper.eq("CODE", deviceCode);
@ -187,11 +186,13 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
if (fdrFormatVo == null){ if (fdrFormatVo == null){
throw new ServiceException("请添加故障录波配置"); throw new ServiceException("请添加故障录波配置");
} }
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
// 解析文件内容 // 解析文件内容
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine()); resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new ServiceException("配置解析异常");
} }
return resultMap; return resultMap;
} }

View File

@ -14,7 +14,7 @@ public interface PlcLogService {
List<FileNode> getDirOrFileList(String fileType, String name, String startTime, String endTime); List<FileNode> getDirOrFileList(String fileType, String name, String startTime, String endTime);
Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException; Map<String, List<Object>> getDataCurve(String url, String deviceCode);
void updatePlcConfig(SysEquipment sysEquipment); void updatePlcConfig(SysEquipment sysEquipment);

View File

@ -63,9 +63,8 @@ public class PlcLogsServiceImpl implements PlcLogService {
} }
@Override @Override
public Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException { public Map<String, List<Object>> getDataCurve(String url, String deviceCode){
Map<String, List<Object>> resultMap = null; Map<String, List<Object>> resultMap = null;
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
//根据device Code查询故障录波格式 //根据device Code查询故障录波格式
QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CODE", deviceCode); queryWrapper.eq("CODE", deviceCode);
@ -82,11 +81,13 @@ public class PlcLogsServiceImpl implements PlcLogService {
if (fdrFormatVo == null){ if (fdrFormatVo == null){
throw new ServiceException("请添加plclog配置"); throw new ServiceException("请添加plclog配置");
} }
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
// 解析文件内容 // 解析文件内容
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine()); resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new ServiceException("配置解析异常");
} }
return resultMap; return resultMap;
} }

View File

@ -31,6 +31,9 @@
<if test="info.subSystem != null and info.subSystem != ''"> <if test="info.subSystem != null and info.subSystem != ''">
and t.subsystem = #{info.subSystem} and t.subsystem = #{info.subSystem}
</if> </if>
<if test="info.subSystem != null and info.subSystem != ''">
and t.confidential = #{info.confidential}
</if>
</where> </where>
<if test="info.orderColumn != null and info.orderType != ''"> <if test="info.orderColumn != null and info.orderType != ''">
order by ${info.orderColumn} ${info.orderType} order by ${info.orderColumn} ${info.orderType}

View File

@ -179,3 +179,10 @@ export function queryfaultCodeDict(params: object = {}) {
showErrorMessage: false showErrorMessage: false
}) })
} }
export function getAllSubSystemReq() {
return createAxios({
url: '/api/equipment/model/attribute/getAllSubsystem',
method: 'post'
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -12,9 +12,10 @@ export const useAdminInfo = defineStore('adminInfo', {
last_login_time: '', last_login_time: '',
token: '', token: '',
refresh_token: '', refresh_token: '',
authorities: [],
// 是否是superAdmin用于判定是否显示终端按钮等不做任何权限判断 // 是否是superAdmin用于判定是否显示终端按钮等不做任何权限判断
super: false, super: false,
orgid:0 orgid: 0,
} }
}, },
actions: { actions: {

View File

@ -51,6 +51,7 @@ export interface AdminInfo {
username: string username: string
nickname: string nickname: string
avatar: string avatar: string
authorities: Number[]
last_login_time: string last_login_time: string
token: string token: string
refresh_token: string refresh_token: string

View File

@ -0,0 +1,298 @@
<template>
<div class="SystemParam">
<el-container class="mainContainer">
<div class="mainHeader">
<el-text class="mx-1 title">风机矩阵设置</el-text>
</div>
<el-main class="defaultMain">
<el-row>
<el-col :span="24">
<div class="tablePart">
<el-table :data="paramData" style="width: 100%">
<el-table-column prop="paramNmae" label="参数名称" />
<el-table-column prop="namedes" label="中文" />
<!-- <el-table-column prop="paramValue" label="参数值" />-->
<el-table-column label="操作" width="100">
<template #default="scope">
<span style="color: #0064aa; cursor: pointer"
v-if="scope.row.paramNmae=='ParamColor'"
@click="Editcolor(scope)"
>编辑</span>
<span style="color: #0064aa; cursor: pointer"
v-else
@click="EditLayout(scope)"
>编辑</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-main>
</el-container>
<el-dialog v-model="visibleColor" title="状态颜色" width="1000" :before-close="handleClose" class="ColorPart">
<div class="tablePart">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="porder" label="状态" />
<el-table-column prop="attributeCode" label="颜色">
<template #default="scope">
<div class="color-box" :style="{ backgroundColor: scope.row.attributeCode }"></div>
<!-- <el-color-picker v-model="scope.row.attributeCode" show-alpha></el-color-picker>-->
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<span style="color: #0064aa; cursor: pointer" @click="selectColor(scope)">选择颜色</span>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="onSubmitType">保存</el-button>
<el-button @click="visibleColor = false">取消</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="visibleselectColor" title="颜色选择" width="500" :before-close="handleCloselayout" class="selectColorPart">
<div class="layoutmain">
<el-row :gutter="10">
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(2, 119, 179);">
<div class="value" text="xs">#0277B3</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(255, 126, 0)">
<div class="value" text="xs">#FF7E00</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(6, 180, 41)">
<div class="value" text="xs">#FE3731</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(0, 160, 150);">
<div class="value" text="xs">#00A096</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(153, 153, 153);">
<div class="value" text="xs">#999999</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(48, 89, 236);">
<div class="value" text="xs">#67C23A</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(254, 55, 49);">
<div class="value" text="xs">#67C23A</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(48, 89, 236);">
<div class="value" text="xs">#67C23A</div>
</div>
</el-col>
<el-col :span="4">
<div class="demo-color-box" style="background: rgb(48, 89, 236);">
<div class="value" text="xs">#67C23A</div>
</div>
</el-col>
</el-row>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="onSubmitType">确定</el-button>
<el-button @click="visibleselectColor = false">取消</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="visibleLayout" title="选择布局" width="765" :before-close="handleCloselayout" class="LayoutPart">
<div class="layoutmain">
<el-row :gutter="20">
<el-col :span="8">
<div class="demo-color-box">
<div class="style01 selected"><img src="~assets/SystemParam/style01.png" alt="" /></div>
<div>风格1</div>
</div>
</el-col>
<el-col :span="8">
<div class="demo-color-box">
<div class="style01"><img src="~assets/SystemParam/style02.png" alt="" /></div>
<div>风格2</div>
</div>
</el-col>
<el-col :span="8">
<div class="demo-color-box">
<div class="style01"><img src="~assets/SystemParam/style03.png" alt="" /></div>
<div>风格3</div>
</div>
</el-col>
</el-row>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="onSubmitType">保存</el-button>
<el-button @click="visibleLayout = false">取消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref} from 'vue'
const paramData=ref([
{paramNmae:'ParamColor',namedes:'颜色',paramValue:'0.5'},
{paramNmae:'ParamLayout',namedes:'布局',paramValue:'0.5'}
])
const tableData = ref([
{ porder: '并网', attributeCode: 'rgb(2, 119, 179)' },
{ porder: '待机', attributeCode: 'rgb(255, 126, 0)' },
{ porder: '启动', attributeCode: 'rgb(6, 180, 41)' },
{ porder: '维护', attributeCode: 'rgb(0, 160, 150)' },
{ porder: '离线', attributeCode: 'rgb(153, 153, 153)' },
{ porder: '限功率运行', attributeCode: 'rgb(48, 89, 236)' },
{ porder: '正常停机', attributeCode: 'rgb(254, 55, 49)' },
{ porder: '通讯中断', attributeCode: 'rgb(153, 153, 153)' },
{ porder: '停机', attributeCode: 'rgb(153, 153, 153)' },
{ porder: '解缆状态', attributeCode: 'rgb(48, 89, 236)' },
{ porder: '电网故障停机', attributeCode: 'rgb(254, 55, 49)' },
{ porder: '安全链停机', attributeCode: 'rgb(254, 55, 49)' },
])
const selectLayout=ref([
{value:'0',label:'风格1'},
{value:'1',label:'风格2'},
{value:'2',label:'风格3'},
])
const visibleColor=ref(false)
const Editcolor = (data: any) => {
debugger
visibleColor.value=true
}
const handleClose = () => {
debugger
visibleColor.value=false
}
const visibleLayout=ref(false)
const EditLayout = (data: any) => {
debugger
visibleLayout.value=true
}
const handleCloselayout = () => {
debugger
visibleLayout.value=false
}
const visibleselectColor=ref(false)
const selectColor = () => {
visibleselectColor.value=true
}
</script>
<style lang="scss" scoped>
$headerHeight: 60px;
.SystemParam{
width: 100%;
height: 100%;
.mainContainer {
display: flex;
flex-direction: column;
width: 100%;
padding: 20px;
.mainHeader {
display: flex;
justify-content: space-between;
align-items: center;
height: $headerHeight;
.title {
border-left: 4px solid rgb(77, 147, 196);
border-bottom: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid transparent;
padding: 4px;
}
}
.defaultMain{
width: 100%;
height: 100%;
padding: 0;
}
}
.ColorPart{
.header{
padding: 10px 0;
}
.color-box{
width: 100px;
height: 20px;
}
}
.selectColorPart{
.demo-color-box{
div{
width: 100%;
height: 30px;
line-height: 30px;
margin-top: 10px;
text-align: center;
color: #FFFFFF;
cursor: pointer;
}
}
}
.LayoutPart{
.demo-color-box{
text-align: center;
.style01.selected:before {
opacity: 1;
}
.style01.selected img {
box-shadow: 0 0 0 4px #00c09e;
animation: selected 0.3s cubic-bezier(0.250, 0.100, 0.250, 1.000);
-o-animation:selected 0.3s cubic-bezier(0.250, 0.100, 0.250, 1.000);
-ms-animation:selected 0.3s cubic-bezier(0.250, 0.100, 0.250, 1.000);
-moz-animation:selected 0.3s cubic-bezier(0.250, 0.100, 0.250, 1.000);
-webkit-animation:selected 0.3s cubic-bezier(0.250, 0.100, 0.250, 1.000);
}
.style01.selected:before {
content: "2714";
display: block;
position: absolute;
margin: auto;
top: 0; left: 0; bottom: 0; right: 0;
width: 40px;
height: 40px;
line-height: 40px;
background: #00c09e;
border-radius: 50px;
color: #fff;
text-align: center;
font-size: 16px;
z-index: 10;
opacity: 0;
transition: 0.3s linear;
-o-transition: 0.3s linear;
-ms-transition: 0.3s linear;
-moz-transition: 0.3s linear;
-webkit-transition: 0.3s linear;
-o-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
cursor: pointer;
}
}
}
}
@keyframes selected {
0% { border-color: #fff; }
50% { transform: scale(0.5); opacity: 0.8; box-shadow: 0 0 0 4px #00c09e; }
80%,100% { width: 100%; height: 100%; box-shadow: 0 0 0 4px #00c09e; }
}
</style>

View File

@ -277,6 +277,9 @@
<el-form-item :label="ModelAttributeFieldsEnums['visible']" prop="visible"> <el-form-item :label="ModelAttributeFieldsEnums['visible']" prop="visible">
<el-checkbox v-model="attributeForm.visible"></el-checkbox> <el-checkbox v-model="attributeForm.visible"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item :label="ModelAttributeFieldsEnums['confidential']" prop="confidential">
<el-checkbox v-model="attributeForm.confidential"></el-checkbox>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button type="primary" @click="submitAttributeForm">保存</el-button> <el-button type="primary" @click="submitAttributeForm">保存</el-button>
@ -692,6 +695,7 @@ const getAttributeList = ({
: item.attributeType!, : item.attributeType!,
highSpeed: item.highSpeed === 1, highSpeed: item.highSpeed === 1,
visible: item.visible === 1, visible: item.visible === 1,
confidential: item.confidential === 1,
} }
}) })
pageTotal.value = res.total pageTotal.value = res.total
@ -807,6 +811,7 @@ const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
unit: '', unit: '',
stateDesc: '', stateDesc: '',
level: undefined, level: undefined,
confidential: false,
revision: 1, revision: 1,
createdBy: undefined, createdBy: undefined,
createdTime: undefined, createdTime: undefined,
@ -835,6 +840,7 @@ const submitAttributeForm = () => {
const copyFormData = JSON.parse(JSON.stringify(attributeForm.value)) const copyFormData = JSON.parse(JSON.stringify(attributeForm.value))
copyFormData.highSpeed = copyFormData.highSpeed ? 1 : 0 copyFormData.highSpeed = copyFormData.highSpeed ? 1 : 0
copyFormData.visible = copyFormData.visible ? 1 : 0 copyFormData.visible = copyFormData.visible ? 1 : 0
copyFormData.confidential = copyFormData.confidential ? 1 : 0
if (copyFormData.stateDesc0 || copyFormData.stateDesc1) { if (copyFormData.stateDesc0 || copyFormData.stateDesc1) {
copyFormData.stateDesc = (copyFormData?.stateDesc0 ?? '') + '|' + (copyFormData?.stateDesc1 ?? '') copyFormData.stateDesc = (copyFormData?.stateDesc0 ?? '') + '|' + (copyFormData?.stateDesc1 ?? '')
} }

View File

@ -73,7 +73,8 @@ export enum ModelAttributeFieldsEnums {
'createdTime' = '创建时间', 'createdTime' = '创建时间',
'updatedBy' = '更新人', 'updatedBy' = '更新人',
'updatedTime' = '更新时间', 'updatedTime' = '更新时间',
'stateDesc' = '状态描述' 'stateDesc' = '状态描述',
'confidential'='敏感数据'
} }
export enum ModelServiceFieldsEnums { export enum ModelServiceFieldsEnums {
@ -115,6 +116,7 @@ export type AddModelAttributeType = {
unit: string unit: string
level?: 0 | 1 | 2 level?: 0 | 1 | 2
visible: 0 | 1 | boolean visible: 0 | 1 | boolean
confidential:0 | 1 | boolean
stateDesc:string stateDesc:string
stateDesc0?:string stateDesc0?:string
stateDesc1?:string stateDesc1?:string

View File

@ -192,7 +192,7 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart" width="1000"> <el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart" width="1200">
<RealDataChart <RealDataChart
ref="realDataChartRef" ref="realDataChartRef"
:visible="realDataLineChartVisible" :visible="realDataLineChartVisible"
@ -432,28 +432,28 @@ const dynamicColumn: TableColumnType[] = [
width: 100, width: 100,
}, },
{ {
label: '有功功率 (KW)', label: '有功功率 (kW)',
prop: 'igenpower', prop: 'igenpower',
align: 'center', align: 'center',
custom: 'header', custom: 'header',
width: 100, width: 100,
}, },
{ {
label: '有功给定 (KW)', label: '有功给定 (kW)',
prop: 'iactivepowersetpointvalue', prop: 'iactivepowersetpointvalue',
align: 'center', align: 'center',
custom: 'header', custom: 'header',
width: 100, width: 100,
}, },
{ {
label: '无功功率 (KVar)', label: '无功功率 (kVar)',
prop: 'ireactivepower', prop: 'ireactivepower',
align: 'center', align: 'center',
custom: 'header', custom: 'header',
width: 100, width: 100,
}, },
{ {
label: '无功给定 (KVar)', label: '无功给定 (kVar)',
prop: 'ireactivepowersetpointvalue', prop: 'ireactivepowersetpointvalue',
align: 'center', align: 'center',
custom: 'header', custom: 'header',

View File

@ -13,7 +13,7 @@
</div> </div>
<div class="leftMain"> <div class="leftMain">
<el-scrollbar> <el-scrollbar>
<el-checkbox-group v-model="selectList" @change="changeCheck"> <el-checkbox-group v-model="selectList" @change="changeCheck" :max="selectPointNum">
<el-checkbox <el-checkbox
v-for="item in realDataList" v-for="item in realDataList"
:key="item.prop" :key="item.prop"
@ -146,8 +146,10 @@ const getRealData = () => {
}) })
return [] return []
} }
const selectPointNum = ref(10)
let realDataXAxis: any = [] let realDataXAxis: any = []
let realDataSeries: any = [] let realDataSeries: any = []
let realDataYAxis: any = []
const getRandomDarkColor = () => { const getRandomDarkColor = () => {
let r = Math.floor(Math.random() * 200) // 0127 let r = Math.floor(Math.random() * 200) // 0127
let g = Math.floor(Math.random() * 200) let g = Math.floor(Math.random() * 200)
@ -171,8 +173,9 @@ const createChartData = (data: { [k: string]: number }, time: string) => {
let clearState = null let clearState = null
lastSeriesId.forEach((item: any) => { lastSeriesId.forEach((item: any) => {
if (!attrCode.includes(item)) { if (!attrCode.includes(item)) {
const cur = realDataSeries.find((val: any) => val.id === item) const cur = realDataSeries.findIndex((val: any) => val.id === item)
delete cur.id // delete cur.id
realDataSeries.splice(cur, 1)
clearState = true clearState = true
} }
}) })
@ -201,7 +204,7 @@ const createChartData = (data: { [k: string]: number }, time: string) => {
fillData.push(curVal) fillData.push(curVal)
return { return {
id: item, id: item,
name: info.name + info.unit, name: info.name +' '+ (info?.unit ?? ''),
type: 'line', type: 'line',
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
@ -221,19 +224,82 @@ const createChart = () => {
const chart = chartInstance ?? echarts.init(chartRef.value) const chart = chartInstance ?? echarts.init(chartRef.value)
let option = null let option = null
if (chartInstance && realDataXAxis.length > 1) { if (chartInstance && realDataXAxis.length > 1) {
const nameMap: any = {}
realDataSeries.forEach((item: any) => {
const yAxisName = item.name.split(' ')[1]
if (nameMap[yAxisName] || nameMap[yAxisName]===0) {
item.yAxisIndex = nameMap[yAxisName]
} else {
const len = Object.keys(nameMap).length
item.yAxisIndex = len
nameMap[yAxisName] = len
}
})
const nameMapKeys = Object.keys(nameMap)
if (realDataSeries.length >= 4 && nameMapKeys.length === 4) {
selectPointNum.value = realDataSeries.length
}
const yAxisData = nameMapKeys.map((item, index) => {
const offset = Math.floor(index / 2) * 50
const position = index % 2 == 0 ? 'left' : 'right'
const yAxisName = item
const cacheYAxis = realDataYAxis.find((item: any) => item.name === yAxisName)
if (cacheYAxis) {
return {
...cacheYAxis,
offset,
position,
}
} else {
return {
type: 'value',
name: item,
nameTextStyle: {
color: '#4E5969',
},
axisLine: {
show: false,
onZero: false,
lineStyle: {
color: '#dadada',
width: 0,
type: 'solid',
},
},
axisLabel: {
//x
show: true,
color: '#4E5969',
},
axisTick: { show: false },
splitLine: {
interval: 50,
lineStyle: {
type: 'dashed',
color: '#dadada',
},
},
offset,
position,
}
}
})
realDataYAxis = yAxisData
option = { option = {
xAxis: { xAxis: {
data: realDataXAxis, data: realDataXAxis,
}, },
yAxis: realDataYAxis,
series: realDataSeries, series: realDataSeries,
} }
} else { } else {
option = { option = {
grid: { grid: {
top: 50, top: 50,
right: 23, right: 60,
bottom: 50, bottom: 50,
left: 18, left: 60,
containLabel: true, containLabel: true,
}, },
tooltip: { tooltip: {
@ -280,6 +346,7 @@ const createChart = () => {
}, },
axisLine: { axisLine: {
show: false, show: false,
onZero: false,
lineStyle: { lineStyle: {
color: '#dadada', color: '#dadada',
width: 0, width: 0,
@ -321,7 +388,7 @@ const createChart = () => {
series: realDataSeries, series: realDataSeries,
} }
} }
chart.setOption(option, { replaceMerge: 'series' }) chart.setOption(option, { replaceMerge: ['series', 'yAxis'] })
chartInstance = chart chartInstance = chart
} }
@ -338,6 +405,19 @@ const selectPointAttr = computed(() => {
const addPoint = () => { const addPoint = () => {
selectPointVisible.value = true selectPointVisible.value = true
} }
const checkShowChart = (data: any) => {
console.log(realDataSeries)
const curCode = data.map((item: any) => item.prop)
console.log(curCode, 'curCode')
for (let i = selectList.value.length - 1; i >= 0; i--) {
if (!curCode.includes(selectList.value[i])) {
selectList.value.splice(i, 1)
realDataSeries.splice(i, 1)
changeCheck()
}
}
}
const saveSelectPoint = () => { const saveSelectPoint = () => {
const data = selectPointRef.value?.getSelectList() const data = selectPointRef.value?.getSelectList()
if (data) { if (data) {
@ -348,9 +428,10 @@ const saveSelectPoint = () => {
unit: item.unit, unit: item.unit,
} }
}) })
checkShowChart(selectList)
realDataList.value = selectList realDataList.value = selectList
selectPointVisible.value = false selectPointVisible.value = false
ElMessage.success('添加成功') ElMessage.success('修改成功')
} }
} }
let timer: any = null let timer: any = null
@ -364,6 +445,7 @@ const clearTimer = () => {
timer = null timer = null
realDataSeries = [] realDataSeries = []
realDataXAxis = [] realDataXAxis = []
realDataYAxis = []
pauseState.value = false pauseState.value = false
emits('clearChart') emits('clearChart')
} }

View File

@ -4,12 +4,23 @@
<el-col :span="14"> <el-col :span="14">
<div class="transferLeft"> <div class="transferLeft">
<div class="transferHeader"> <div class="transferHeader">
<span class="transferTitle">可添加的测点</span> <div class="searchPart">
<el-radio-group v-model="searchType" class="radio">
<el-radio value="attributeName">名称</el-radio>
<el-radio value="attributeCode">编码</el-radio>
</el-radio-group>
</div>
<el-input clearable class="searchInput" placeholder="请输入测点信息" v-model="searchInfo" @change="search"></el-input>
<!-- <el-button type="primary" @click="search">查询</el-button> -->
<el-select v-model="subSystemVal" placeholder="请选择子系统" @change="search">
<el-option v-for="item in subSystemList" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
<!-- <span class="transferTitle">可添加的测点</span>
<el-radio-group v-model="radioActiveName" @change="typeChange"> <el-radio-group v-model="radioActiveName" @change="typeChange">
<el-radio :value="138">模拟量</el-radio> <el-radio :value="138">模拟量</el-radio>
<el-radio :value="199">计算量</el-radio> <el-radio :value="199">计算量</el-radio>
<el-radio :value="140">状态量</el-radio> <el-radio :value="140">状态量</el-radio>
</el-radio-group> </el-radio-group> -->
</div> </div>
<el-main class="mainPart"> <el-main class="mainPart">
<el-table <el-table
@ -42,7 +53,7 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<div class="transferRight"> <div class="transferRight">
<div class="transferHeader"> <div class="transferHeader transferHeaderRight">
<span class="transferTitle" <span class="transferTitle"
>已选择<span>{{ Statistic }}</span >已选择<span>{{ Statistic }}</span
></span ></span
@ -70,7 +81,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed, watch, nextTick, onMounted } from 'vue' import { ref, reactive, computed, watch, nextTick, onMounted } from 'vue'
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request' import { getModelAttributeListReq, getAllSubSystemReq } from '/@/api/backend/deviceModel/request'
import { ElMessage, TableInstance } from 'element-plus' import { ElMessage, TableInstance } from 'element-plus'
import { Top, Bottom, Close } from '@element-plus/icons-vue' import { Top, Bottom, Close } from '@element-plus/icons-vue'
@ -85,9 +96,30 @@ const props = withDefaults(
} }
) )
const radioActiveName = ref<138 | 139 | 140 | 199>(138) const searchType = ref('attributeName')
const typeChange = () => {
getTableData() const searchInfo = ref('')
// const radioActiveName = ref<138 | 139 | 140 | 199>(138)
const search = () => {
getTableData({ pageNum: 1 })
}
const subSystemVal = ref('')
const subSystemList = ref()
const getAllSubSystem = () => {
getAllSubSystemReq().then((res) => {
const data = res.data
.filter((item: any) => item)
.map((item:any) => {
return {
label: item,
value: item,
}
})
subSystemList.value = [...data, { label: '全部', value: ' ' }]
})
} }
const attributeTableData = ref<{ attributeName: string; attributeCode: string }[]>([]) const attributeTableData = ref<{ attributeName: string; attributeCode: string }[]>([])
@ -95,7 +127,7 @@ const selectTable = (section: any) => {
const defaultCode = props.defaultAttr.map((item: any) => item.attributeCode) const defaultCode = props.defaultAttr.map((item: any) => item.attributeCode)
const addSection = section const addSection = section
.filter((item: any) => !defaultCode.includes(item.attributeCode.toLowerCase())) .filter((item: any) => !defaultCode.includes(item.attributeCode.toLowerCase()))
.map((item:any) => { .map((item: any) => {
return { return {
attributeName: item.attributeName, attributeName: item.attributeName,
attributeCode: item.attributeCode.toLowerCase(), attributeCode: item.attributeCode.toLowerCase(),
@ -108,7 +140,7 @@ const selectAllTable = (section: any) => {
const defaultCode = props.defaultAttr.map((item: any) => item.attributeCode) const defaultCode = props.defaultAttr.map((item: any) => item.attributeCode)
const addSection = section const addSection = section
.filter((item: any) => !defaultCode.includes(item.attributeCode.toLowerCase())) .filter((item: any) => !defaultCode.includes(item.attributeCode.toLowerCase()))
.map((item:any) => { .map((item: any) => {
return { return {
attributeName: item.attributeName, attributeName: item.attributeName,
attributeCode: item.attributeCode.toLowerCase(), attributeCode: item.attributeCode.toLowerCase(),
@ -158,12 +190,18 @@ const moveRemove = (index: number, item: any) => {
}) })
} }
const getTableData = () => { const getTableData = (customData = {}) => {
const inputVal: any = {}
inputVal[searchType.value] = searchInfo.value
getModelAttributeListReq({ getModelAttributeListReq({
iotModelId: '', iotModelId: '',
attributeType: radioActiveName.value, // attributeType: radioActiveName.value,
pageNum: pageSetting.current, pageNum: pageSetting.current,
pageSize: pageSetting.pageSize, pageSize: pageSetting.pageSize,
subSystem: (!subSystemVal.value || subSystemVal.value === ' ') ? null : subSystemVal.value,
...inputVal,
...customData,
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -207,6 +245,7 @@ defineExpose({
onMounted(() => { onMounted(() => {
getTableData() getTableData()
getAllSubSystem()
}) })
</script> </script>
@ -217,13 +256,35 @@ onMounted(() => {
.transferHeader { .transferHeader {
height: 40px; height: 40px;
display: flex; display: flex;
justify-content: space-between; // justify-content: space-between;
align-items: center; align-items: center;
padding: 0 10px; padding: 0 10px;
color: #333333; color: #333333;
background: #f7f9fc; background: #f7f9fc;
border-bottom: 1px solid #e1edf6; border-bottom: 1px solid #e1edf6;
border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0;
.searchPart {
.radio {
width: 110px;
.el-radio {
margin-right: 5px;
width: 50px;
}
}
}
.searchInput {
width: 200px;
margin: 0 20px;
}
.el-select {
width: 200px;
}
:deep(.el-input__wrapper) {
width: 200px;
}
}
.transferHeaderRight {
justify-content: space-between;
} }
.transferLeft { .transferLeft {
width: 550px; width: 550px;

View File

@ -23,7 +23,7 @@
<el-tag v-if="item.attributeMap.processedoperationmode === 10" class="tag-panel is-maintenance" type="primary" <el-tag v-if="item.attributeMap.processedoperationmode === 10" class="tag-panel is-maintenance" type="primary"
>维护</el-tag> >维护</el-tag>
<el-tag v-if="item.attributeMap.processedoperationmode === 0" class="tag-panel is-offline" type="primary">离线</el-tag> <el-tag v-if="item.attributeMap.processedoperationmode === 0" class="tag-panel is-offline" type="primary">离线</el-tag>
<el-tag v-if="item.attributeMap.processedoperationmode === 8" class="tag-panel info" type="primary">限功率运行</el-tag> <el-tag v-if="item.attributeMap.processedoperationmode === 8" class="tag-panel is-info" type="primary">限功率运行</el-tag>
<el-tag v-if="item.attributeMap.processedoperationmode === 6" class="tag-panel is-danger" type="primary">正常停机</el-tag> <el-tag v-if="item.attributeMap.processedoperationmode === 6" class="tag-panel is-danger" type="primary">正常停机</el-tag>
<el-tag v-if="item.attributeMap.processedoperationmode === 1" class="tag-panel is-danger" type="primary" <el-tag v-if="item.attributeMap.processedoperationmode === 1" class="tag-panel is-danger" type="primary"
>外部因素导致停机</el-tag> >外部因素导致停机</el-tag>
@ -114,7 +114,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {defineProps, defineEmits, onMounted, onUnmounted, ref} from 'vue' import {defineProps, ref} from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { adminBaseRoutePath } from '/@/router/static/adminBase' import { adminBaseRoutePath } from '/@/router/static/adminBase'
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue' import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'

View File

@ -225,6 +225,7 @@ const onSubmit = () => {
username: res.data.sysUser.account, username: res.data.sysUser.account,
nickname: res.data.sysUser.userName, nickname: res.data.sysUser.userName,
orgid: res.data.sysUser.orgId, orgid: res.data.sysUser.orgId,
authorities: res.data.sysUser.authorities,
avatar: res.data.sysUser.headImage, avatar: res.data.sysUser.headImage,
last_login_time: '', last_login_time: '',
token: res.data.token, token: res.data.token,

View File

@ -130,8 +130,8 @@ export const excelDefaultConfig: any = {
code: 'limit2Low' code: 'limit2Low'
}, },
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
R0C4: ['03', '04'], R0C4: ['03', '04'],
@ -247,8 +247,8 @@ export const excelDefaultConfig: any = {
code: 'col3', code: 'col3',
}, },
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
R0C4: ['03', '04'], R0C4: ['03', '04'],
@ -280,8 +280,8 @@ export const excelDefaultConfig: any = {
code: 'col3', code: 'col3',
}, },
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
R0C4: ['01', '02', '03', '04'], R0C4: ['01', '02', '03', '04'],
@ -358,8 +358,8 @@ export const excelDefaultConfig: any = {
code: 'limit2Low' code: 'limit2Low'
}, },
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
R0C4: [ R0C4: [
@ -374,7 +374,7 @@ export const excelDefaultConfig: any = {
"8. 16位BCD数据", "8. 16位BCD数据",
"9. 8位归一化值" "9. 8位归一化值"
], // 数据类型的提示 ], // 数据类型的提示
R0C7:[ R0C7: [
"0. 不启用", "0. 不启用",
"1. 启用" "1. 启用"
] ]
@ -420,8 +420,8 @@ export const excelDefaultConfig: any = {
name: '累计量', name: '累计量',
head: [ head: [
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
}, },
@ -442,8 +442,8 @@ export const excelDefaultConfig: any = {
code: 'registerAddr', code: 'registerAddr',
}, },
{ {
label:'强制归档', label: '强制归档',
code:'forceArchive', code: 'forceArchive',
} }
], ],
R0C4: [ R0C4: [
@ -684,7 +684,7 @@ export const createUpLoadExcelData = (workbookData: any) => {
sheetData.protocol = sheets[item].cellData[key][fieldKey].custom.protocol sheetData.protocol = sheets[item].cellData[key][fieldKey].custom.protocol
continue continue
} }
if (fieldKey === '1') { if (['1','2','3'].includes(fieldKey)) {
sheetData[sheetkeyMap[fieldKey]] = sheets[item].cellData[key][fieldKey]?.v ?? '' sheetData[sheetkeyMap[fieldKey]] = sheets[item].cellData[key][fieldKey]?.v ?? ''
continue continue
} }
@ -692,8 +692,6 @@ export const createUpLoadExcelData = (workbookData: any) => {
} }
sheetData.params = JSON.stringify(params) sheetData.params = JSON.stringify(params)
data.push(sheetData) data.push(sheetData)
console.log(data);
} }
}) })
}) })

View File

@ -8,7 +8,7 @@
<el-option v-for="v in statAnalysisSelectOptions.deviceId" :key="v.value" :label="v.label" :value="v.value"></el-option> <el-option v-for="v in statAnalysisSelectOptions.deviceId" :key="v.value" :label="v.label" :value="v.value"></el-option>
</el-select> </el-select>
</div> </div>
<div class="selectPart"> <div v-if="hasAuthority" class="selectPart">
<span>风速来源</span> <span>风速来源</span>
<el-select v-model="statAnalysisSpeedSource" placeholder="请选择风速来源" class="statAnalysisSelect"> <el-select v-model="statAnalysisSpeedSource" placeholder="请选择风速来源" class="statAnalysisSelect">
<el-option v-for="v in statAnalysisSelectOptions.speedSource" :key="v.value" :label="v.label" :value="v.value"></el-option> <el-option v-for="v in statAnalysisSelectOptions.speedSource" :key="v.value" :label="v.label" :value="v.value"></el-option>
@ -79,8 +79,14 @@ const AvgWindSpeedSwitch = ref(false)
const chartType = ref('scatter') // const chartType = ref('scatter') //
const statAnalysisFatory = ref('') const statAnalysisFatory = ref('')
const statAnalysisFatoryList: any = ref([]) const statAnalysisFatoryList: any = ref([])
const hasAuthority = ref(false)
const statAnalysisSpeedSource = ref('AvgWindSpeed_10min') const statAnalysisSpeedSource = ref('AvgWindSpeed_10min')
const statAnalysisDeviceId = ref('') const statAnalysisDeviceId = ref('')
import { useAdminInfo } from '/@/stores/adminInfo'
const adminInfo = useAdminInfo()
hasAuthority.value = Object.values(adminInfo.authorities).includes(105)
const statAnalysisSelectOptions: any = reactive({ const statAnalysisSelectOptions: any = reactive({
speedSource: [ speedSource: [
{ label: '原始风速', value: 'AvgWindSpeed_10min' }, { label: '原始风速', value: 'AvgWindSpeed_10min' },
@ -100,13 +106,13 @@ const updateChart = () => {
const series = { const series = {
type: chartType.value, type: chartType.value,
data: chartType.value === 'scatter' ? seriesDataInit.value : calculateData.value, data: chartType.value === 'scatter' ? seriesDataInit.value : calculateData.value,
name: '实际', name: '实际功率',
symbolSize: 5, symbolSize: 5,
symbol: 'circle', symbol: 'circle',
} }
option.series[0] = series option.series[0] = series
if (!option.legend.data.includes('实际')) { if (!option.legend.data.includes('实际功率')) {
option.legend.data.push('实际') option.legend.data.push('实际功率')
} }
chart.value.setOption(option) chart.value.setOption(option)
} }
@ -348,7 +354,7 @@ const statAnalysisOperate = () => {
const iGenPower = resData0['AvgActivePower_10min']['values'] const iGenPower = resData0['AvgActivePower_10min']['values']
const iWindSpeed = resData0[statAnalysisSpeedSource.value]['values'] const iWindSpeed = resData0[statAnalysisSpeedSource.value]['values']
if (!iWindSpeed.length) { if (!iWindSpeed.length) {
ElMessage.info(`时值数据为空`) ElMessage.info(`际功率数据为空`)
} else { } else {
const seriesData = iGenPower.map((item: any, index: number) => { const seriesData = iGenPower.map((item: any, index: number) => {
return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)] return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)]
@ -368,15 +374,14 @@ const statAnalysisOperate = () => {
const series = { const series = {
type: 'line', type: 'line',
data: seriesData, data: seriesData,
name: '理论', name: '理论功率',
smooth: true, smooth: true,
symbolSize: 0.1, symbolSize: 0.1,
symbol: 'circle', symbol: 'circle',
} }
option.series.push(series) option.series.push(series)
option.legend.data.push('理论') option.legend.data.push('理论功率')
} }
console.log('🚀 ~ .then ~ option.legend.data:', option.legend.data)
chart.value.setOption(option) chart.value.setOption(option)
}) })
.catch((error) => { .catch((error) => {

View File

@ -727,7 +727,7 @@ $paginationHeight: 32px;
.theoreticalpowerCurve { .theoreticalpowerCurve {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; background-color: #f2f3f5;
// background: transparent; // background: transparent;
.mainContainer { .mainContainer {
display: flex; display: flex;