diff --git a/business-css/frontend/package.json b/business-css/frontend/package.json index 7b20367..00fd84e 100644 --- a/business-css/frontend/package.json +++ b/business-css/frontend/package.json @@ -10,6 +10,8 @@ "prettier": "prettier --write ." }, "dependencies": { + "@antv/g6": "^5.0.51", + "@antv/x6": "^3.1.4", "@element-plus/icons-vue": "^2.0.10", "@types/js-cookie": "^3.0.2", "@vueuse/core": "^9.1.1", @@ -20,6 +22,7 @@ "default-passive-events": "^2.0.0", "echarts": "^5.2.2", "element-plus": "^2.2.27", + "insert-css": "^2.0.0", "js-base64": "^3.7.5", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", diff --git a/business-css/frontend/src/assets/x6/add.png b/business-css/frontend/src/assets/x6/add.png new file mode 100644 index 0000000..6de722d Binary files /dev/null and b/business-css/frontend/src/assets/x6/add.png differ diff --git a/business-css/frontend/src/assets/x6/change.png b/business-css/frontend/src/assets/x6/change.png new file mode 100644 index 0000000..0e9e23d Binary files /dev/null and b/business-css/frontend/src/assets/x6/change.png differ diff --git a/business-css/frontend/src/assets/x6/copy.png b/business-css/frontend/src/assets/x6/copy.png new file mode 100644 index 0000000..f7e2c46 Binary files /dev/null and b/business-css/frontend/src/assets/x6/copy.png differ diff --git a/business-css/frontend/src/assets/x6/del.png b/business-css/frontend/src/assets/x6/del.png new file mode 100644 index 0000000..ce41118 Binary files /dev/null and b/business-css/frontend/src/assets/x6/del.png differ diff --git a/business-css/frontend/src/assets/x6/display.png b/business-css/frontend/src/assets/x6/display.png new file mode 100644 index 0000000..a3aac24 Binary files /dev/null and b/business-css/frontend/src/assets/x6/display.png differ diff --git a/business-css/frontend/src/assets/x6/hide.png b/business-css/frontend/src/assets/x6/hide.png new file mode 100644 index 0000000..fb4d6df Binary files /dev/null and b/business-css/frontend/src/assets/x6/hide.png differ diff --git a/business-css/frontend/src/assets/x6/history.png b/business-css/frontend/src/assets/x6/history.png new file mode 100644 index 0000000..58e7ab6 Binary files /dev/null and b/business-css/frontend/src/assets/x6/history.png differ diff --git a/business-css/frontend/src/assets/x6/info.png b/business-css/frontend/src/assets/x6/info.png new file mode 100644 index 0000000..6167cd1 Binary files /dev/null and b/business-css/frontend/src/assets/x6/info.png differ diff --git a/business-css/frontend/src/assets/x6/magnify.png b/business-css/frontend/src/assets/x6/magnify.png new file mode 100644 index 0000000..b808189 Binary files /dev/null and b/business-css/frontend/src/assets/x6/magnify.png differ diff --git a/business-css/frontend/src/assets/x6/material.png b/business-css/frontend/src/assets/x6/material.png new file mode 100644 index 0000000..143f817 Binary files /dev/null and b/business-css/frontend/src/assets/x6/material.png differ diff --git a/business-css/frontend/src/assets/x6/redo.png b/business-css/frontend/src/assets/x6/redo.png new file mode 100644 index 0000000..efda01e Binary files /dev/null and b/business-css/frontend/src/assets/x6/redo.png differ diff --git a/business-css/frontend/src/assets/x6/reduce.png b/business-css/frontend/src/assets/x6/reduce.png new file mode 100644 index 0000000..ddf1681 Binary files /dev/null and b/business-css/frontend/src/assets/x6/reduce.png differ diff --git a/business-css/frontend/src/assets/x6/return.png b/business-css/frontend/src/assets/x6/return.png new file mode 100644 index 0000000..ba35be4 Binary files /dev/null and b/business-css/frontend/src/assets/x6/return.png differ diff --git a/business-css/frontend/src/assets/x6/revoke.png b/business-css/frontend/src/assets/x6/revoke.png new file mode 100644 index 0000000..875c119 Binary files /dev/null and b/business-css/frontend/src/assets/x6/revoke.png differ diff --git a/business-css/frontend/src/assets/x6/save.png b/business-css/frontend/src/assets/x6/save.png new file mode 100644 index 0000000..40a3bc1 Binary files /dev/null and b/business-css/frontend/src/assets/x6/save.png differ diff --git a/business-css/frontend/src/components/antvg6/GraphCanvas.vue b/business-css/frontend/src/components/antvg6/GraphCanvas.vue new file mode 100644 index 0000000..200c4b9 --- /dev/null +++ b/business-css/frontend/src/components/antvg6/GraphCanvas.vue @@ -0,0 +1,244 @@ + + + + + + + + \ No newline at end of file diff --git a/business-css/frontend/src/components/antvg6/LeftPanel.vue b/business-css/frontend/src/components/antvg6/LeftPanel.vue new file mode 100644 index 0000000..ea26b44 --- /dev/null +++ b/business-css/frontend/src/components/antvg6/LeftPanel.vue @@ -0,0 +1,101 @@ + + + + + + 图形元件库 + + + ⚙️ + {{ node.label }} + + + + + + \ No newline at end of file diff --git a/business-css/frontend/src/components/antvg6/index.vue b/business-css/frontend/src/components/antvg6/index.vue new file mode 100644 index 0000000..19c6fb6 --- /dev/null +++ b/business-css/frontend/src/components/antvg6/index.vue @@ -0,0 +1,414 @@ + + + + + + + + + 设备 + + + + + {{ device.name }} + + + + + 链接 + + + ↔️ + 移动 + + + ↔️ + 不移动 + + + ↔️ + 实线 + + + ↔️ + 单箭头实线 + + + ⇄ + 双箭头实线 + + + ↔️ + 虚线 + + + ↔️ + 单箭头虚线 + + + ⇄ + 双箭头虚线 + + + + + + + + + + \ No newline at end of file diff --git a/business-css/frontend/src/components/antvx6/index.vue b/business-css/frontend/src/components/antvx6/index.vue new file mode 100644 index 0000000..9196d6e --- /dev/null +++ b/business-css/frontend/src/components/antvx6/index.vue @@ -0,0 +1,1086 @@ + + + + + + + + + + + + {{ projectInfo.name }} + + + + + + + + + + + 撤销 + + + + 重做 + + + + 放大 + + + + 缩小 + + + + + 显示 + + + + 保存 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/business-css/frontend/src/types/graph.ts b/business-css/frontend/src/types/graph.ts new file mode 100644 index 0000000..2eecf41 --- /dev/null +++ b/business-css/frontend/src/types/graph.ts @@ -0,0 +1,15 @@ +// types/graph.ts +export type NodeType = + | 'cylinder_slot' + | 'flat_slot' + | 'ring_slot' + | 'tube_slot' + | 'bar_stock' + | 'tapered_head' + | 'monk_ring_slot'; + +export interface NodeItem { + type: NodeType; + label: string; + icon?: string; // 可选图标字符或SVG路径 +} \ No newline at end of file diff --git a/business-css/frontend/src/views/business/project/index.vue b/business-css/frontend/src/views/business/project/index.vue index 7f0291e..cb7350f 100644 --- a/business-css/frontend/src/views/business/project/index.vue +++ b/business-css/frontend/src/views/business/project/index.vue @@ -10,6 +10,8 @@ import { ElForm, ElMessage, ElMessageBox } from "element-plus"; import { searchProjectsLsit,addProjects,updateProjects,deleteProjects,deleteBatchProjects} from "@/api/business/project"; import Page from '@/components/Pagination/page.vue' import ScenarioModel from '@/views/component/scenario/index.vue' +import Antvx6 from '@/components/antvx6/index.vue' +const isShowAntvx6 = ref(false); // 是否展示分析设计弹窗 const isScenario = ref(false) //是否展示历史模拟场景 // 搜索框 const queryParams = ref({ @@ -111,12 +113,16 @@ const rules = ref({ code: [{ required: true, message: "请输入项目编码", trigger: "blur" }], }); //修改项目 -function editClick(row: any) { +function editClick(row: any) { // 打开修改项目弹窗 title.value = "修改项目"; info.value = JSON.parse(JSON.stringify(row)); dialogVisible.value = true; } -function simulationClick(row: any) { +function designClick(row: any) { // 打开分析设计 + info.value = JSON.parse(JSON.stringify(row)); + isShowAntvx6.value = true; +} +function simulationClick(row: any) { // 打开模拟分析 info.value = JSON.parse(JSON.stringify(row)); isScenario.value = true; } @@ -185,6 +191,12 @@ function dateFormat(row: any) { onMounted(() => { gettableData(); }); + +// 关闭分析设计弹窗 +function closeAntvx6() { + gettableData(); + isShowAntvx6.value = false; +} @@ -224,7 +236,7 @@ onMounted(() => { + style="cursor: pointer; " @click="designClick(scope.row)"> @@ -237,9 +249,7 @@ onMounted(() => { - - @@ -267,7 +277,9 @@ onMounted(() => { - + + + diff --git a/business-css/frontend/types/graph.ts b/business-css/frontend/types/graph.ts new file mode 100644 index 0000000..2eecf41 --- /dev/null +++ b/business-css/frontend/types/graph.ts @@ -0,0 +1,15 @@ +// types/graph.ts +export type NodeType = + | 'cylinder_slot' + | 'flat_slot' + | 'ring_slot' + | 'tube_slot' + | 'bar_stock' + | 'tapered_head' + | 'monk_ring_slot'; + +export interface NodeItem { + type: NodeType; + label: string; + icon?: string; // 可选图标字符或SVG路径 +} \ No newline at end of file