Browse Source

组网页面

dev
wenlele 1 year ago
parent
commit
f7f60b455c
  1. 9
      web-network/client/src/sections/network/components/device-tree/zuwang-main.js
  2. 2
      web-network/client/src/sections/network/containers/device-monitor.js
  3. 31
      web/client/src/sections/analysis/containers/network.jsx

9
web-network/client/src/sections/network/components/device-tree/zuwang-main.js

@ -300,7 +300,7 @@ export default function ({ ...props }) {
}); });
const { links } = deviceInfos; const { links } = deviceInfos;
function getLeaf(parentId) { function getLeaf (parentId) {
const fromStructs = nodes.get(parentId); const fromStructs = nodes.get(parentId);
let tempTreeData = []; let tempTreeData = [];
links.forEach((m) => { links.forEach((m) => {
@ -347,9 +347,8 @@ export default function ({ ...props }) {
checkable checkable
onCheck={(checkedKeys, e) => onTreeNodeSelect(checkedKeys, e, treeData.treeData)} onCheck={(checkedKeys, e) => onTreeNodeSelect(checkedKeys, e, treeData.treeData)}
onSelect={(checkedKeys, e) => { onSelect={(checkedKeys, e) => {
console.log(3213,checkedKeys, e);
onTreeNodeClick(checkedKeys, e) onTreeNodeClick(checkedKeys, e)
} } }}
defaultCheckedKeys={treeData.defaultTreeNodesCheckedKeys} defaultCheckedKeys={treeData.defaultTreeNodesCheckedKeys}
checkStrictly checkStrictly
// checkedKeys={checkedKeys} // checkedKeys={checkedKeys}
@ -364,8 +363,8 @@ export default function ({ ...props }) {
emitChange={emitChange} emitChange={emitChange}
changeFinish={_finishDataChange} changeFinish={_finishDataChange}
emitDataChange_={emitDataChange_} emitDataChange_={emitDataChange_}
width={width} width={width + 100}
height={height} height={height + 75}
targetNode={targetNode} targetNode={targetNode}
handelNodeClick={_handelNodeClick} handelNodeClick={_handelNodeClick}
onCollapse={onCollapse} onCollapse={onCollapse}

2
web-network/client/src/sections/network/containers/device-monitor.js

@ -20,7 +20,7 @@ function DeviceMonitor ({ ...props }) {
dispatch, actions, user, clientWidth, clientHeight, loading, dispatch, actions, user, clientWidth, clientHeight, loading,
myStructList, deviceMetasWithFollow, devices, dimensions, deviceListAlarms, factorStations, myStructList, deviceMetasWithFollow, devices, dimensions, deviceListAlarms, factorStations,
} = props; } = props;
console.log(3213,actions);
const { analysis } = actions const { analysis } = actions
const [params, setParams] = useState({}); const [params, setParams] = useState({});

31
web/client/src/sections/analysis/containers/network.jsx

@ -18,7 +18,7 @@ const Network = ({
const [projectList, setProjectList] = useState([]) // const [projectList, setProjectList] = useState([]) //
const [projectValue, setProjectValue] = useState() // const [projectValue, setProjectValue] = useState() //
const [thingId, setThingId] = useState() //thingId const [thingId, setThingId] = useState() //thingId
const [spinning, setSpinning] = useState(true)
const form = useRef();// const form = useRef();//
@ -59,6 +59,21 @@ const Network = ({
} }
}, [organizationsStruc]) }, [organizationsStruc])
useEffect(() => {
// iframe
const iframe = document.getElementById('myIframe');
console.log(4324, iframe);
if (iframe) {
// iframeload
iframe.addEventListener('load', function () {
console.log('IFrame is loaded');
setSpinning(false)
// iframe
});
}
}, [])
return ( return (
<> <>
<div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px', height: clientHeight - 72, display: 'flex', flexDirection: 'column' }}> <div style={{ background: '#FFFFFF', margin: '8px 12px', padding: '20px 20px 0px 20px', height: clientHeight - 72, display: 'flex', flexDirection: 'column' }}>
@ -87,6 +102,7 @@ const Network = ({
optionList={projectList || []} optionList={projectList || []}
onSelect={v => { onSelect={v => {
setProjectValue(v) setProjectValue(v)
setSpinning(true)
form.current.setValue('projectId', v) form.current.setValue('projectId', v)
}} }}
/> />
@ -100,6 +116,7 @@ const Network = ({
showClear showClear
optionList={organizationsStruc?.map(d => ({ value: d.thingId, label: d.strucName })) || []} optionList={organizationsStruc?.map(d => ({ value: d.thingId, label: d.strucName })) || []}
onSelect={v => { onSelect={v => {
setSpinning(true)
setThingId(v) setThingId(v)
form.current.setValue('thingId', v) form.current.setValue('thingId', v)
}} }}
@ -109,8 +126,14 @@ const Network = ({
</div> </div>
<div id='show' style={{ width: "100%", height: "calc(100% - 106px)" }}>
<Spin
// style={{ }}
childStyle={{ width: "100%", height: clientHeight - 188 }}
spinning={spinning}>
<div id='show' style={{ width: "100%", height: "100%" }}>
<iframe <iframe
id="myIframe"
style={{ style={{
width: '100%', width: '100%',
height: '100%', height: '100%',
@ -121,9 +144,11 @@ const Network = ({
> >
<p>你的浏览器不支持 iframe </p> <p>你的浏览器不支持 iframe </p>
</iframe> </iframe>
</div>
</div>
</Spin>
{/* <div id='show' style={{ width: "100%", height: "calc(100% - 106px)" }}> {/* <div id='show' style={{ width: "100%", height: "calc(100% - 106px)" }}>
<div style={{ <div style={{
display: "flex", alignItems: 'center', justifyContent: "space-between", display: "flex", alignItems: 'center', justifyContent: "space-between",

Loading…
Cancel
Save