日志:图表显示修改

故障:图表显示修改
链路:协议修改
This commit is contained in:
高云鹏 2024-11-20 14:58:21 +08:00
parent 4cdf63fa44
commit 11b07f6546
5 changed files with 146 additions and 92 deletions

View File

@ -469,15 +469,18 @@ const getRandomDarkColor = () => {
return color
}
const createSeriesData = () => {
console.log(curSeries)
const seriesData: any = []
const curAttr = curSeries.map((item: any) => item.name)
const curAttr = curSeries.map((item: any) => item.id)
selectPreviewTree.forEach((item: string) => {
if (curAttr.includes(item)) {
const seriesItem = curSeries.find((cur: any) => cur.name === item)
const seriesItem = curSeries.find((cur: any) => cur.id === item)
seriesData.push(seriesItem)
} else {
const color = getRandomDarkColor()
const data = {
id: item,
name: fileKeyEnums?.[item] ?? item,
type: 'line',
barWidth: 20,

View File

@ -143,6 +143,7 @@ import { getMalFunctionListReq, setConfigReq, previewFileReq, downloadFileReq, g
import { equipList } from '/@/api/backend/temperature/request'
import * as echarts from 'echarts'
import { tableItemData } from './type'
import { id } from 'element-plus/es/locales.mjs'
const defaultProps = {
children: 'children',
@ -475,14 +476,15 @@ const getRandomDarkColor = () => {
}
const createSeriresData = () => {
const seriesData: any = []
const curAttr = curSeries.map((item: any) => item.name)
const curAttr = curSeries.map((item: any) => item.id)
selectPreviewTree.forEach((item: string) => {
if (curAttr.includes(item)) {
const seriesItem = curSeries.find((cur: any) => cur.name === item)
const seriesItem = curSeries.find((cur: any) => cur.id === item)
seriesData.push(seriesItem)
} else {
const color = getRandomDarkColor()
const data = {
id: item,
name: fileKeyEnums[item],
type: 'line',
barWidth: 20,

View File

@ -525,12 +525,13 @@ const getLinkData = (nodeId: string, linkName?: string) => {
const protocolList = [
// *
{ label: 'IEC104主 *', value: 8 },
// { label: 'IEC104 *', value: 8 },
{ label: 'IEC104从 *', value: 9 },
{ label: 'MODBUSRTU主 *', value: 12 },
{ label: 'MODBUSTCP主 *', value: 16 },
{ label: '倍福MODBUS', value: 11111 },
{ label: '倍福ADS', value: 11112 },
// { label: 'MODBUSRTU *', value: 12 },
// { label: 'MODBUSTCP *', value: 16 },
{ label: 'MODBUSTCP从 *', value: 17 },
{ label: 'MODBUS', value: 80 },
{ label: 'ADS', value: 81 },
]

View File

@ -9,7 +9,11 @@
>
<el-row>
<template v-for="itemChild in currentFormColumn.params[item as formColumnKeyType]">
<el-col :offset="1" :span="11">
<el-col
v-if="!itemChild.data.showKey || formData[itemChild.data.showKey] === itemChild.data.showValue"
:offset="1"
:span="11"
>
<el-form-item :label="itemChild.data.label" :prop="itemChild.key">
<el-input
v-if="itemChild.data.type === 'input'"
@ -85,7 +89,8 @@ watch(
const emits = defineEmits(['update:visible', 'submit'])
const formRef = ref<FormInstance>()
const formData = ref<protocolFormType>({})
const formData = ref<any>({})
// const formData = ref<protocolFormType>({})
// #region
// const cardTitle: ['', ''] = ['', '']
// const netWorkOption = {
@ -829,8 +834,8 @@ const formColumnList: formColumnType[] = [
},
},
{
protocol: 11111,
label: '倍福MODBUS',
protocol: 17,
label: 'MODBUSRTU从 *',
cardTitle: ['网络设置', '超时设置'],
params: {
netWorkOption: [
@ -850,91 +855,14 @@ const formColumnList: formColumnType[] = [
value: '',
},
},
{
key: 'targetAddr',
data: {
label: '目标地址',
type: 'input',
value: '1.1.1.1',
},
},
{
key: 'targetPort',
data: {
label: '目标端口',
type: 'input',
value: '',
},
},
{
key: 'socketType',
data: {
label: '网络类型',
type: 'select',
value: '0',
list: [
{
label: 'TCP',
value: '0',
},
{
label: 'UDP',
value: '1',
},
],
},
},
{
key: 'ignoredSource',
data: {
label: '忽略地址来源',
type: 'check',
cardTitle: ['网络设置', '超时设置'],
value: true,
},
},
{
key: 'ftpMode',
data: {
label: 'FTP模式',
type: 'select',
value: '1',
list: [
{
label: '启用',
value: '1',
},
{
label: '禁用',
value: '0',
},
],
},
},
{
key: 'ftpUser',
data: {
label: 'FTP账号',
type: 'input',
value: '',
},
},
{
key: 'ftpPassword',
data: {
label: 'FTP密码',
type: 'input',
value: '',
},
},
],
timeOutOption: [],
otherOption: [],
},
},
{
protocol: 11112,
label: '倍福ADS',
protocol: 80,
label: 'MODBUS',
cardTitle: ['网络设置', '超时设置'],
params: {
netWorkOption: [
@ -1021,6 +949,8 @@ const formColumnList: formColumnType[] = [
label: 'FTP账号',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
{
@ -1029,6 +959,116 @@ const formColumnList: formColumnType[] = [
label: 'FTP密码',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
],
timeOutOption: [],
otherOption: [],
},
},
{
protocol: 81,
label: 'ADS',
cardTitle: ['网络设置', '超时设置'],
params: {
netWorkOption: [
{
key: 'bindAddr',
data: {
label: '绑定地址',
type: 'input',
value: '1.1.1.1',
},
},
{
key: 'bindPort',
data: {
label: '绑定端口',
type: 'input',
value: '',
},
},
{
key: 'targetAddr',
data: {
label: '目标地址',
type: 'input',
value: '1.1.1.1',
},
},
{
key: 'targetPort',
data: {
label: '目标端口',
type: 'input',
value: '',
},
},
{
key: 'socketType',
data: {
label: '网络类型',
type: 'select',
value: '0',
list: [
{
label: 'TCP',
value: '0',
},
{
label: 'UDP',
value: '1',
},
],
},
},
{
key: 'ignoredSource',
data: {
label: '忽略地址来源',
type: 'check',
cardTitle: ['网络设置', '超时设置'],
value: true,
},
},
{
key: 'ftpMode',
data: {
label: 'FTP模式',
type: 'select',
value: '1',
list: [
{
label: '启用',
value: '1',
},
{
label: '禁用',
value: '0',
},
],
},
},
{
key: 'ftpUser',
data: {
label: 'FTP账号',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
{
key: 'ftpPassword',
data: {
label: 'FTP密码',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
{
@ -1037,6 +1077,8 @@ const formColumnList: formColumnType[] = [
label: 'ADS账号',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
{
@ -1045,6 +1087,8 @@ const formColumnList: formColumnType[] = [
label: 'ADS密码',
type: 'input',
value: '',
showKey: 'ftpMode',
showValue: '1',
},
},
],
@ -1061,6 +1105,8 @@ const currentFormColumn = computed(() => {
currentFormKeyObj[item.key] = parseParams.value?.[item.key] as any
})
})
console.log(data)
formData.value = currentFormKeyObj
return data
})

View File

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