|
|
@@ -87,8 +87,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<TopoButtonBar
|
|
|
- @run-button-click="btnfunc"
|
|
|
- @open-simulationData-dialog="handleOpenSimulationDataDialog"/>
|
|
|
+ @run-button-click="btnfunc"
|
|
|
+ @open-simulationData-dialog="handleOpenSimulationDataDialog"
|
|
|
+ @button-click="handleTopoButtonClick"
|
|
|
+ @mode-switch="handleTopoModeSwitch"
|
|
|
+ />
|
|
|
</div>
|
|
|
<!-- <div class="main-header">
|
|
|
<div class="topologyStyle">Topology</div> -->
|
|
|
@@ -180,7 +183,13 @@
|
|
|
</el-tabs> -->
|
|
|
<!-- </div> -->
|
|
|
<div class="flow-content">
|
|
|
- <vueflow ref="vueflowref" :jobId="jobId" />
|
|
|
+ <vueflow
|
|
|
+ ref="vueflowref"
|
|
|
+ :jobId="jobId"
|
|
|
+ :showGrid="buttonStates.showGrid"
|
|
|
+ :fixedGrid="buttonStates.fixedGrid"
|
|
|
+ :isSelectMode="modeSwitch"
|
|
|
+ />
|
|
|
</div>
|
|
|
</pane>
|
|
|
<pane min-size="0" size="25" max-size="50">
|
|
|
@@ -340,6 +349,11 @@ const jobId = ref()
|
|
|
|
|
|
const SLdatadialogref = ref(null)
|
|
|
const RunDialogRef = ref(null)
|
|
|
+const modeSwitch = ref(false) // 连接模式开关
|
|
|
+const buttonStates = ref({ // 拓扑按钮状态
|
|
|
+ showGrid: false,
|
|
|
+ fixedGrid: false
|
|
|
+})
|
|
|
|
|
|
const headerbuttons = ref([
|
|
|
{ type: "button", img: "newproject.png", name: "temp" },
|
|
|
@@ -535,6 +549,19 @@ const handleTimelineItemClick = (index) => {
|
|
|
vueflowref.value?.asideDataref?.getresultData(jobId.value)
|
|
|
}
|
|
|
|
|
|
+// 处理 topoButtonBar 触发的 button-click 事件
|
|
|
+const handleTopoButtonClick = ({ action, isActive }) => {
|
|
|
+ buttonStates.value[action] = isActive !== undefined ? isActive : buttonStates.value[action]
|
|
|
+ console.log(`Button clicked: ${action}, isActive: ${buttonStates.value[action]}`)
|
|
|
+}
|
|
|
+
|
|
|
+// 处理 topoButtonBar 触发的 mode-switch 事件
|
|
|
+const handleTopoModeSwitch = (value) => {
|
|
|
+ modeSwitch.value = value
|
|
|
+ console.log(value ? "切换到选择模式" : "切换到连接模式")
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//websockct的连接
|
|
|
function initWebSocket() {
|
|
|
//初始化weosocket
|