Commit 6d4c5df2 authored by 李纪文's avatar 李纪文

feat: 组态修复绑定数据干扰

parent 0a2f81f1
...@@ -67,7 +67,6 @@ let modalWidth = 520; ...@@ -67,7 +67,6 @@ let modalWidth = 520;
let historyInfoParams = []; let historyInfoParams = [];
let statisticalInfoParams = {}; let statisticalInfoParams = {};
let nodeData = null; // 选中节点的数据 let nodeData = null; // 选中节点的数据
let bindData = [];
let twoID = ''; let twoID = '';
const waterFlow = new WaterFlowControlView(); const waterFlow = new WaterFlowControlView();
...@@ -79,6 +78,7 @@ const ConfigurationView = (props) => { ...@@ -79,6 +78,7 @@ const ConfigurationView = (props) => {
// 入场动画 // 入场动画
let entryAnim = ''; let entryAnim = '';
const guidAggre = {}; const guidAggre = {};
let bindData = [];
const stationList = []; const stationList = [];
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-configuration-view'); const prefixCls = getPrefixCls('ec-configuration-view');
...@@ -110,6 +110,7 @@ const ConfigurationView = (props) => { ...@@ -110,6 +110,7 @@ const ConfigurationView = (props) => {
const DomRef = useRef(); const DomRef = useRef();
const TwoRef = useRef(); const TwoRef = useRef();
const loginTimer = useRef(); const loginTimer = useRef();
const bindDatas = useRef([]);
const ConfigurationViewRef = useCallback((dom) => { const ConfigurationViewRef = useCallback((dom) => {
if (DomRef) DomRef.current = !!dom; if (DomRef) DomRef.current = !!dom;
setDomFlag(!!dom); setDomFlag(!!dom);
...@@ -167,6 +168,11 @@ const ConfigurationView = (props) => { ...@@ -167,6 +168,11 @@ const ConfigurationView = (props) => {
name, name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '', type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
}); });
bindDatas.current.push({
code: deviceList,
name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
});
devicesCode.push(deviceList); devicesCode.push(deviceList);
}); });
await getPublicInfo(); await getPublicInfo();
...@@ -1653,7 +1659,7 @@ const ConfigurationView = (props) => { ...@@ -1653,7 +1659,7 @@ const ConfigurationView = (props) => {
// 控制日志内容渲染 // 控制日志内容渲染
const renderControlLogContent = () => { const renderControlLogContent = () => {
const list = bindData.find((item) => { const list = bindDatas.current.find((item) => {
return item.name === nodeData.stationName; return item.name === nodeData.stationName;
}); });
return list ? ( return list ? (
......
...@@ -66,7 +66,6 @@ let modalWidth = 520; ...@@ -66,7 +66,6 @@ let modalWidth = 520;
let historyInfoParams = []; let historyInfoParams = [];
let statisticalInfoParams = {}; let statisticalInfoParams = {};
let nodeData = null; // 选中节点的数据 let nodeData = null; // 选中节点的数据
let bindData = [];
let twoID = ''; let twoID = '';
const waterFlow = new WaterFlowControlView(); const waterFlow = new WaterFlowControlView();
...@@ -76,6 +75,7 @@ const ConfigurationView = (props) => { ...@@ -76,6 +75,7 @@ const ConfigurationView = (props) => {
let editionArr = []; let editionArr = [];
let globalControl = false; let globalControl = false;
const guidAggre = {}; const guidAggre = {};
let bindData = [];
const stationList = []; const stationList = [];
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-configuration-view'); const prefixCls = getPrefixCls('ec-configuration-view');
...@@ -107,6 +107,7 @@ const ConfigurationView = (props) => { ...@@ -107,6 +107,7 @@ const ConfigurationView = (props) => {
const DomRef = useRef(); const DomRef = useRef();
const TwoRef = useRef(); const TwoRef = useRef();
const loginTimer = useRef(); const loginTimer = useRef();
const bindDatas = useRef([]);
const ConfigurationViewRef = useCallback((dom) => { const ConfigurationViewRef = useCallback((dom) => {
if (DomRef) DomRef.current = !!dom; if (DomRef) DomRef.current = !!dom;
setDomFlag(!!dom); setDomFlag(!!dom);
...@@ -165,6 +166,11 @@ const ConfigurationView = (props) => { ...@@ -165,6 +166,11 @@ const ConfigurationView = (props) => {
name, name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '', type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
}); });
bindDatas.current.push({
code: deviceList,
name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
});
devicesCode.push(deviceList); devicesCode.push(deviceList);
}); });
await getPublicInfo(); await getPublicInfo();
...@@ -1590,7 +1596,7 @@ const ConfigurationView = (props) => { ...@@ -1590,7 +1596,7 @@ const ConfigurationView = (props) => {
// 控制日志内容渲染 // 控制日志内容渲染
const renderControlLogContent = () => { const renderControlLogContent = () => {
const list = bindData.find((item) => { const list = bindDatas.current.find((item) => {
return item.name === nodeData.stationName; return item.name === nodeData.stationName;
}); });
return list ? ( return list ? (
......
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