|
@@ -18,6 +18,22 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
<template #default></template>
|
|
|
+ </el-tab-pane>
|
|
|
+ <!-- 新增开关 tab -->
|
|
|
+ <el-tab-pane name="modeSwitch" key="modeSwitch">
|
|
|
+ <template #label>
|
|
|
+ <span @click.stop>
|
|
|
+ <el-switch
|
|
|
+ v-model="modeSwitch"
|
|
|
+ :active-text="$t('buttons.selectMode')"
|
|
|
+ :inactive-text="$t('buttons.connectMode')"
|
|
|
+ inline-prompt
|
|
|
+ class="mode-switch"
|
|
|
+ @change="handleModeSwitch"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #default></template>
|
|
|
</el-tab-pane>
|
|
|
<!-- 普通标签页 -->
|
|
|
<el-tab-pane v-for="tab in tabs" :key="tab.name" :name="tab.name">
|
|
@@ -32,15 +48,14 @@
|
|
|
v-for="button in tab.buttons"
|
|
|
:key="button.action"
|
|
|
:content="button.label"
|
|
|
- placement="top"
|
|
|
+ placement="bottom"
|
|
|
>
|
|
|
- <el-button
|
|
|
- type=""
|
|
|
- @click="emitButtonClick(button.action)"
|
|
|
+<el-button
|
|
|
+ :class="{ 'is-active': buttonStates[button.action] }"
|
|
|
+ @click="handleButtonClick(button)"
|
|
|
class="icon-text-button"
|
|
|
>
|
|
|
<img :src="button.icon" alt="icon" class="button-icon" />
|
|
|
- <!-- {{ button.label }} -->
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
@@ -56,35 +71,62 @@ const { t } = useI18n()
|
|
|
|
|
|
import libraryIcon from "@/assets/icons/library.png" // 图层
|
|
|
import addLayerIcon from "@/assets/icons/addLayer.png" // 新建图层
|
|
|
-import editIcon from "@/assets/icons/edit.png" // 编辑
|
|
|
-import importProIcon from "@/assets/icons/importPro.png" // 导入
|
|
|
-import tutorialIcon from "@/assets/icons/tutorial.png" // 配置
|
|
|
-import copyIcon from "@/assets/icons/copy.png" // 复制
|
|
|
-import cutIcon from "@/assets/icons/cut.png" // 剪切
|
|
|
-import pasteIcon from "@/assets/icons/paste.png" // 粘贴
|
|
|
+// 显示
|
|
|
+import gridIcon from "@/assets/icons/grid.png" // 显示网格
|
|
|
+import fixedGridIcon from "@/assets/icons/fixedGrid.png" // 固定到网格
|
|
|
+import rulerIcon from "@/assets/icons/ruler.png" // 显示标尺
|
|
|
+import textIcon from "@/assets/icons/text.png" // 显示文本
|
|
|
+import numberIcon from "@/assets/icons/number.png" // 显示节点编号
|
|
|
+import nodeNameIcon from "@/assets/icons/nodeName.png" // 显示节点名称
|
|
|
+import nodeIdIcon from "@/assets/icons/nodeId.png" // 显示节点ID
|
|
|
+import renumberIcon from "@/assets/icons/renumber.png" // 重新编号
|
|
|
+import previewWindowIcon from "@/assets/icons/previewWindow.png" // 预览窗口
|
|
|
+import displayConfigIcon from "@/assets/icons/displayConfiguration.png" // 显示配置
|
|
|
+// 视图
|
|
|
+import zoomInIcon from "@/assets/icons/zoomIn.png" // 放大
|
|
|
+import zoomOutIcon from "@/assets/icons/zoomOut.png" // 缩小
|
|
|
+import adaptiveIcon from "@/assets/icons/adaptive.png" // 适应窗口
|
|
|
+import actualSizeIcon from "@/assets/icons/actualSize.png" // 实际大小
|
|
|
+import dragIcon from "@/assets/icons/drag.png" // 拖拽
|
|
|
+// 排列
|
|
|
import alignLeftIcon from "@/assets/icons/alignLeft.png" // 左对齐
|
|
|
import alignRightIcon from "@/assets/icons/alignRight.png" // 右对齐
|
|
|
import topToItIcon from "@/assets/icons/topToIt.png" // 顶部对齐
|
|
|
-import bottomToItIcon from "@/assets/icons/bottomToIt.png" // 底部
|
|
|
-import horizontalDistributionIcon from "@/assets/icons/horizontalDistribution.png" // 水平分布
|
|
|
-import verticalDistributionIcon from "@/assets/icons/vertical.png" // 垂直分布
|
|
|
-import rotateRightIcon from "@/assets/icons/rotateRight.png" // 右旋转
|
|
|
+import bottomToItIcon from "@/assets/icons/bottomToIt.png" // 底部对齐
|
|
|
+import centerToItIcon from "@/assets/icons/centerToIt.png" // 垂直居中
|
|
|
+import horizontalCenterToItIcon from "@/assets/icons/horizontalCenterToIt.png" // 水平居中
|
|
|
+import distributeVerticalIcon from "@/assets/icons/distributeVertical.png" // 垂直分布
|
|
|
+import distributeHorizontalIcon from "@/assets/icons/distributeHorizontal.png" // 水平分布
|
|
|
import rotateLeftIcon from "@/assets/icons/rotateLeft.png" // 左旋转
|
|
|
+import rotateRightIcon from "@/assets/icons/rotateRight.png" // 右旋转
|
|
|
import horizontalFlipIcon from "@/assets/icons/horizontalFlip.png" // 水平翻转
|
|
|
-import verticalFlipIcon from "@/assets/icons вертикReverse.png" // 垂直翻转
|
|
|
-import imageIcon from "@/assets/icons/image.png" // 图片
|
|
|
+import verticalFlipIcon from "@/assets/icons/verticalFlip.png" // 垂直翻转
|
|
|
+// 插入
|
|
|
import graphicIcon from "@/assets/icons/graphic.png" // 图形
|
|
|
+import imageIcon from "@/assets/icons/image.png" // 图片
|
|
|
import documentIcon from "@/assets/icons/document.png" // 文档
|
|
|
import commentIcon from "@/assets/icons/comment.png" // 注释
|
|
|
+// 仿真
|
|
|
+import runIcon from "@/assets/icons/run.png" // 运行
|
|
|
+import preprocessingIcon from "@/assets/icons/preprocessing.png" // 预处理
|
|
|
+import stopIcon from "@/assets/icons/stop.png" // 停止
|
|
|
+// 结果
|
|
|
+import dashboardIcon from "@/assets/icons/dashboard.png" // 仪表盘
|
|
|
+import resultDisplayIcon from "@/assets/icons/resultDisplay.png" // 结果显示
|
|
|
+import resultValidationIcon from "@/assets/icons/resultValidation.png" // 结果校验
|
|
|
+import sensorsIcon from "@/assets/icons/sensors.png" // 传感器
|
|
|
+import tagsIcon from "@/assets/icons/tags.png" // 标签
|
|
|
+import thermodynamicsChartIcon from "@/assets/icons/thermodynamicsChart.png" // 热力学图表
|
|
|
+import hydraulicDiagramIcon from "@/assets/icons/hydraulicDiagram.png" // 水力图
|
|
|
+import resultReportIcon from "@/assets/icons/resultReport.png" // 结果报告
|
|
|
+import InputReportIcon from "@/assets/icons/inputReport.png" // 输入报告
|
|
|
+// 工具
|
|
|
import toolIcon from "@/assets/icons/tool.png" // 工具
|
|
|
-import undoIcon from "@/assets/icons/withDrawing.png" // 撤销
|
|
|
-import redoIcon from "@/assets/icons/redo.png" // 重做
|
|
|
-import configIcon from "@/assets/icons/tutorial.png" // 配置
|
|
|
-import navigationIcon from "@/assets/icons/navigation.png" // 导航
|
|
|
-import parameterAssistantIcon from "@/assets/icons/parameterAssistant.png" // 参数助手
|
|
|
+import visualizationIcon from "@/assets/icons/visualization.png" // 可视化
|
|
|
+import splitIcon from "@/assets/icons/split.png" // 切分
|
|
|
|
|
|
const emit = defineEmits(["button-click"])
|
|
|
-
|
|
|
+const modeSwitch = ref(false) // 开关状态,默认关闭(连接模式)
|
|
|
const fakeTabs = [
|
|
|
{
|
|
|
name: "layer",
|
|
@@ -112,11 +154,16 @@ const tabs = [
|
|
|
label: t("tabs.show"),
|
|
|
icon: "",
|
|
|
buttons: [
|
|
|
- { action: "cut", label: t("buttons.cut"), icon: cutIcon },
|
|
|
- { action: "copy", label: t("buttons.copy"), icon: copyIcon },
|
|
|
- { action: "paste", label: t("buttons.paste"), icon: pasteIcon },
|
|
|
- { action: "undo", label: t("buttons.undo"), icon: undoIcon },
|
|
|
- { action: "redo", label: t("buttons.redo"), icon: redoIcon }
|
|
|
+ { action: "showGrid", label: t("buttons.showGrid"), icon: gridIcon, isToggle: true },
|
|
|
+ { action: "fixedGrid", label: t("buttons.fixedGrid"), icon: fixedGridIcon, isToggle: true },
|
|
|
+ { action: "showRuler", label: t("buttons.showRuler"), icon: rulerIcon, isToggle: true },
|
|
|
+ { action: "showText", label: t("buttons.showText"), icon: textIcon, isToggle: true },
|
|
|
+ { action: "showNumber", label: t("buttons.showNumber"), icon: numberIcon, isToggle: true },
|
|
|
+ { action: "showNodeName", label: t("buttons.showNodeName"), icon: nodeNameIcon, isToggle: true },
|
|
|
+ { action: "showNodeId", label: t("buttons.showNodeId"), icon: nodeIdIcon, isToggle: true },
|
|
|
+ { action: "renumber", label: t("buttons.renumber"), icon: renumberIcon },
|
|
|
+ { action: "previewWindow", label: t("buttons.previewWindow"), icon: previewWindowIcon },
|
|
|
+ { action: "displayConfig", label: t("buttons.displayConfig"), icon: displayConfigIcon }
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -124,47 +171,67 @@ const tabs = [
|
|
|
label: t("tabs.view"),
|
|
|
icon: "",
|
|
|
buttons: [
|
|
|
- { action: "importProject", label: t("buttons.importProject"), icon: "" },
|
|
|
- {action: "importFMU",label: t("buttons.importFMU"),icon: ""},
|
|
|
- {action: "importCAD",label: t("buttons.importCAD"),icon: ""},
|
|
|
- {action: "exportXML",label: t("buttons.exportXML"),icon: ""},
|
|
|
- {action: "exportFMU",label: t("buttons.exportFMU"),icon: ""}
|
|
|
+ { action: "zoomOut", label: t("buttons.zoomOut"), icon: zoomOutIcon },
|
|
|
+ {action: "zoomIn",label: t("buttons.zoomIn"),icon: zoomInIcon},
|
|
|
+ {action: "fitView",label: t("buttons.fitView"),icon: adaptiveIcon},
|
|
|
+ {action: "actualSize",label: t("buttons.actualSize"),icon: actualSizeIcon},
|
|
|
+ {action: "grag",label: t("buttons.grag"),icon: dragIcon}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
name: "arrange",
|
|
|
label: t("tabs.arrange"),
|
|
|
- icon: configIcon,
|
|
|
+ icon: "",
|
|
|
buttons: [
|
|
|
- {action: "unitManagement",label: t("buttons.unitManagement"),icon: ""},
|
|
|
- {action: "preference",label: t("buttons.preference"),icon: ""}
|
|
|
+ {action: "alignLeft",label: t("buttons.alignLeft"),icon: alignLeftIcon},
|
|
|
+ {action: "alignRight",label: t("buttons.alignRight"),icon: alignRightIcon},
|
|
|
+ {action: "alignTop",label: t("buttons.alignTop"),icon: topToItIcon},
|
|
|
+ {action: "alignBottom",label: t("buttons.alignBottom"),icon: bottomToItIcon},
|
|
|
+ {action: "alignMiddle",label: t("buttons.alignMiddle"),icon: centerToItIcon},
|
|
|
+ {action: "alignCenter",label: t("buttons.alignCenter"),icon: horizontalCenterToItIcon},
|
|
|
+ {action: "distributeVertical",label: t("buttons.distributeVertical"),icon: distributeVerticalIcon},
|
|
|
+ {action: "distributeHorizontal",label: t("buttons.distributeHorizontal"),icon: distributeHorizontalIcon},
|
|
|
+ {action: "rotateLeft",label: t("buttons.rotateLeft"),icon: rotateLeftIcon},
|
|
|
+ {action: "rotateRight",label: t("buttons.rotateRight"),icon: rotateRightIcon},
|
|
|
+ {action: "horizontalFlip",label: t("buttons.horizontalFlip"),icon: horizontalFlipIcon},
|
|
|
+ {action: "verticalFlip",label: t("buttons.verticalFlip"),icon: verticalFlipIcon}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
name: "insert",
|
|
|
label: t("tabs.insert"),
|
|
|
- icon: configIcon,
|
|
|
+ icon: "",
|
|
|
buttons: [
|
|
|
- {action: "unitManagement",label: t("buttons.unitManagement"),icon: ""},
|
|
|
- {action: "preference",label: t("buttons.preference"),icon: ""}
|
|
|
+ {action: "graphic",label: t("buttons.graphic"),icon: graphicIcon},
|
|
|
+ {action: "image",label: t("buttons.image"),icon: imageIcon},
|
|
|
+ {action: "document",label: t("buttons.document"),icon: documentIcon},
|
|
|
+ {action: "comment",label: t("buttons.comment"),icon: commentIcon}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
name: "simulation",
|
|
|
label: t("tabs.simulation"),
|
|
|
- icon: configIcon,
|
|
|
+ icon: "",
|
|
|
buttons: [
|
|
|
- {action: "unitManagement",label: t("buttons.unitManagement"),icon: ""},
|
|
|
- {action: "preference",label: t("buttons.preference"),icon: ""}
|
|
|
+ {action: "run", label: t("buttons.run"), icon: runIcon},
|
|
|
+ {action: "preprocess", label: t("buttons.preprocess"), icon: preprocessingIcon},
|
|
|
+ {action: "stop", label: t("buttons.stop"), icon: stopIcon}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
name: "result",
|
|
|
label: t("tabs.result"),
|
|
|
- icon: configIcon,
|
|
|
+ icon: "",
|
|
|
buttons: [
|
|
|
- {action: "unitManagement",label: t("buttons.unitManagement"),icon: ""},
|
|
|
- {action: "preference",label: t("buttons.preference"),icon: ""}
|
|
|
+ {action: "dashboard", label: t("buttons.dashboard"), icon: dashboardIcon},
|
|
|
+ {action: "resultDisplay", label: t("buttons.resultDisplay"), icon: resultDisplayIcon},
|
|
|
+ {action: "resultValidation", label: t("buttons.resultValidation"), icon: resultValidationIcon},
|
|
|
+ {action: "sensors", label: t("buttons.sensors"), icon: sensorsIcon},
|
|
|
+ {action: "tags", label: t("buttons.tags"), icon: tagsIcon},
|
|
|
+ {action: "thermodynamicsChart", label: t("buttons.thermodynamicsChart"), icon: thermodynamicsChartIcon},
|
|
|
+ {action: "hydraulicDiagram", label: t("buttons.hydraulicDiagram"), icon: hydraulicDiagramIcon},
|
|
|
+ {action: "resultReport", label: t("buttons.resultReport"), icon: resultReportIcon},
|
|
|
+ {action: "inputReport", label: t("buttons.inputReport"), icon: InputReportIcon}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -172,21 +239,41 @@ const tabs = [
|
|
|
label: t("tabs.tools"),
|
|
|
icon: toolIcon,
|
|
|
buttons: [
|
|
|
- { action: "wizard", label: t("buttons.wizard"), icon: navigationIcon },
|
|
|
- {action: "parameterAssisant",label: t("buttons.parameterAssistant"),icon: parameterAssistantIcon}
|
|
|
+ { action: "visualization", label: t("buttons.visualization"), icon: visualizationIcon },
|
|
|
+ {action: "split", label: t("buttons.split"), icon: splitIcon}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
|
|
|
const activeTab = ref(tabs[0].name)
|
|
|
|
|
|
-const emitButtonClick = (action) => {
|
|
|
- emit("button-click", action)
|
|
|
+const buttonStates = ref({
|
|
|
+ showGrid: false,
|
|
|
+ fixedGrid: false,
|
|
|
+ showRuler: false,
|
|
|
+ showText: false,
|
|
|
+ showNumber: false,
|
|
|
+ showNodeName: false,
|
|
|
+ showNodeId: false
|
|
|
+})
|
|
|
+
|
|
|
+const handleButtonClick = (button) => {
|
|
|
+ if (button.isToggle) {
|
|
|
+ buttonStates.value[button.action] = !buttonStates.value[button.action]
|
|
|
+ emit("button-click", { action: button.action, isActive: buttonStates.value[button.action] })
|
|
|
+ } else {
|
|
|
+ emit("button-click", { action: button.action })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const handleTabClick = (tab) => {
|
|
|
console.log("Tab switched to:", tab.name)
|
|
|
}
|
|
|
+
|
|
|
+const handleModeSwitch = (value) => {
|
|
|
+ console.log(value ? '切换到选择模式' : '切换到连接模式');
|
|
|
+ // 在这里添加切换模式的逻辑
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -325,6 +412,12 @@ const handleTabClick = (tab) => {
|
|
|
padding: 0 !important;
|
|
|
}
|
|
|
|
|
|
+:deep(#tab-modeSwitch) {
|
|
|
+ padding: 0 !important;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
.open-page-header-icons {
|
|
|
width: 150px;
|
|
|
display: flex;
|
|
@@ -337,4 +430,10 @@ const handleTabClick = (tab) => {
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
}
|
|
|
+
|
|
|
+.icon-text-button.is-active {
|
|
|
+ background-color: #409eff;
|
|
|
+ color: #fff;
|
|
|
+ border-color: #409eff;
|
|
|
+}
|
|
|
</style>
|