Commit 871cc321 authored by 李纪文's avatar 李纪文

fix: 组态优化

parent 3b73669f
...@@ -13,7 +13,7 @@ import TopRotatingTool from './js/RotatingTool'; ...@@ -13,7 +13,7 @@ import TopRotatingTool from './js/RotatingTool';
import BarLink from './js/BarLink'; import BarLink from './js/BarLink';
import WaterFlowControlView from './js/WaterFlowControlView'; import WaterFlowControlView from './js/WaterFlowControlView';
import { getSketchPadList, getSketchPadContent, getPointAddress, getHistoryInfo } from './apis'; import { getSketchPadList, getSketchPadContent, getPointAddress, getHistoryInfo } from './apis';
import { deepCopy, hexToRgba, textStyle, querySkipUrl, isJson } from './js/utils'; import { deepCopy, hexToRgba, textStyle, querySkipUrl, isJson, stationData } from './js/utils';
import './index.less'; import './index.less';
const goJS = go.GraphObject.make; const goJS = go.GraphObject.make;
...@@ -37,35 +37,6 @@ let historyParams = {}; ...@@ -37,35 +37,6 @@ let historyParams = {};
const waterFlow = new WaterFlowControlView(); const waterFlow = new WaterFlowControlView();
const StationList = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
const ConfigurationView = (props) => { const ConfigurationView = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-configuration-view'); const prefixCls = getPrefixCls('ec-configuration-view');
...@@ -108,9 +79,9 @@ const ConfigurationView = (props) => { ...@@ -108,9 +79,9 @@ const ConfigurationView = (props) => {
const round = parseInt(i / 26); const round = parseInt(i / 26);
const remain = i % 26; const remain = i % 26;
if (round) { if (round) {
stationList.push(StationList[remain] + round); stationList.push(stationData[remain] + round);
} else { } else {
stationList.push(StationList[remain]); stationList.push(stationData[remain]);
} }
} }
getDiagramJson(data[0], siteInfo); getDiagramJson(data[0], siteInfo);
......
...@@ -34,6 +34,7 @@ import { ...@@ -34,6 +34,7 @@ import {
textStyle, textStyle,
querySkipUrl, querySkipUrl,
isJson, isJson,
stationData,
} from './js/utils'; } from './js/utils';
import './index.less'; import './index.less';
...@@ -52,35 +53,6 @@ let twoID = ''; ...@@ -52,35 +53,6 @@ let twoID = '';
const waterFlow = new WaterFlowControlView(); const waterFlow = new WaterFlowControlView();
const StationList = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
const ConfigurationView = (props) => { const ConfigurationView = (props) => {
let myDiagram = null; let myDiagram = null;
let mqttView = null; let mqttView = null;
...@@ -136,9 +108,9 @@ const ConfigurationView = (props) => { ...@@ -136,9 +108,9 @@ const ConfigurationView = (props) => {
const round = parseInt(i / 26); const round = parseInt(i / 26);
const remain = i % 26; const remain = i % 26;
if (round) { if (round) {
stationList.push(StationList[remain] + round); stationList.push(stationData[remain] + round);
} else { } else {
stationList.push(StationList[remain]); stationList.push(stationData[remain]);
} }
} }
getDiagramJson(data[0], siteInfo); getDiagramJson(data[0], siteInfo);
......
...@@ -119,3 +119,33 @@ export const isJson = (text) => { ...@@ -119,3 +119,33 @@ export const isJson = (text) => {
return false; return false;
} }
}; };
// 站点字母
export const stationData = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment