From 6c4d4b494ef9c8fb134ece79e3993038a0358639 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 14 四月 2023 18:29:03 +0800
Subject: [PATCH] 对象建模更新

---
 Source/UBCS-WEB/src/views/modeling/cycle.vue |  233 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 184 insertions(+), 49 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/cycle.vue b/Source/UBCS-WEB/src/views/modeling/cycle.vue
index 4e3a4d6..0e86d37 100644
--- a/Source/UBCS-WEB/src/views/modeling/cycle.vue
+++ b/Source/UBCS-WEB/src/views/modeling/cycle.vue
@@ -1,66 +1,201 @@
 <template>
-  <div>
-  <p>鐢熷懡鍛ㄦ湡妯″瀷</p>
-  <el-button @click="tabs=!tabs">杞寲</el-button><br /><br />
-  <avue-form @tab-click="handleTabClick" :option="option" v-model="form" @submit="handleSubmit">
-    <template slot="group1Header">
-      <h4>鑷畾涔夎〃澶�</h4>
-    </template>
-  </avue-form>
-  </div>
+  <el-container>
+  <el-aside width="240px">
+    <basic-container style="margin-top: 10px">
+      <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick"  >
+      </avue-tree>
+    </basic-container>
+  </el-aside>
+  <basic-container >
+    <el-button type="primary" @click="dialogTableVisible=true" size="small">鍒涘缓妯℃澘</el-button>
+    <el-button type="primary"  size="small">缂栬緫妯℃澘</el-button>
+    <el-button type="primary" size="small" @click="$refs.flow.addNode('娴嬭瘯鑺傜偣')">娣诲姞鑺傜偣</el-button>
+    <br/><br/>
+    <avue-flow ref="flow" v-model="form" :height="703" :option="option" :width="1500">
+      <template slot="header" slot-scope="scope">
+        <i class="el-icon-delete" @click="$refs.flow.deleteNode(scope.node.id)" style="margin-top: 8px"></i>
+      </template>
+      <div slot-scope="{node}">
+        <span>鑷畾涔墈{ (node || {}).name }}</span>
+      </div>
+    </avue-flow>
+    <!--    鍒涘缓瀵硅瘽妗�-->
+    <el-dialog title="鍒涘缓妯℃澘" :visible.sync="dialogTableVisible" append-to-body>
+      <avue-form :data="addData" :option="addoption" v-model="forms">
+
+        <template slot="filetype">
+          <el-select v-model="forms.select" slot="prepend" placeholder="璇烽�夋嫨" style="max-width: 300px">
+            <el-option label="娴嬭瘯1" value="1"></el-option>
+            <el-option label="娴嬭瘯2" value="2"></el-option>
+            <el-option label="娴嬭瘯3" value="3"></el-option>
+          </el-select>
+          <el-button  type="primary" @click="handelLife" style="display: inline-block;margin-left: 5px">
+            娣诲姞璧峰鐘舵��
+          </el-button>
+        </template>
+      </avue-form>
+    </el-dialog>
+  </basic-container>
+
+
+  </el-container>
+
 </template>
 
 <script>
 export default {
   name: "cycle.vue",
-  data(){
-    return{
-      tabs:true,
-      form:{
-        text:'鏂囨湰',
-        text1:'鏂囨湰1',
-        text2:'鏂囨湰2',
-        text3:'鏂囨湰3',
+  data() {
+    return {
+      //妯℃澘瀵硅瘽妗�
+      dialogTableVisible:false,
+      forms:{
+        select:""
       },
-    }
-  },
-  computed:{
-    option(){
-      return{
-        tabs:this.tabs,
-        tabsActive:2,
-        column: [{
-          label: '鍐呭1',
-          prop: 'text1',
-        }],
-        group:[
+      addData:[],
+      addoption:{
+        formslot:true,
+        column:[
           {
-            icon:'el-icon-info',
-            label: '鍒嗙粍1',
-            prop: 'group1',
-            column: [{
-              label: '鍐呭1',
-              prop: 'text1',
-            }]
-          },{
-            icon:'el-icon-info',
-            label: '鍒嗙粍2',
-            prop: 'group2',
-            column: [{
-              label: '閫夐」鍗�2',
-              prop: 'text2',
-            }, {
-              label: '閫夐」鍗�3',
-              prop: 'text3',
-            }]
+            label:"鍚嶇О",
+            prop:"name"
+          },
+          {
+            label:"鏍囩",
+            prop:"tag"
+          },
+          {
+            label:"璧峰鐘舵��",
+            prop:"filetype",
+            formslot: true,
+            span:24
+            // type:"select",
+            // dicData:[
+            //   {
+            //     label:"娴嬭瘯1",
+            //     value:0
+            //   },
+            //   {
+            //     label:"娴嬭瘯2",
+            //     value:1
+            //   },
+            //   {
+            //     label:"娴嬭瘯3",
+            //     value:2
+            //   },
+            // ]
+          },
+          {
+            label: "鎻忚堪",
+            prop:"desc",
+            type:"textarea",
+            span:13
           }
         ]
+      },
+      count: 0,
+      form: {},
+      treeData: [{
+        value: 0,
+        label: '鐢熷懡鍛ㄦ湡妯℃澘鍒楄〃',
+        children: [
+          {
+            value: 1,
+            label: 'A',
+          },
+          {
+            value: 2,
+            label: 'B',
+          },
+          {
+            value: 3,
+            label: 'C',
+          },
+          {
+            value: 4,
+            label: 'D',
+          },
+          {
+            value: 5,
+            label: 'E',
+          }
+        ]
+      }],
+      treeOption: {
+        defaultExpandAll: true,
+      },
+      option: {
+        "nodeList": [
+          {
+            "id": "nodeA",
+            "name": "娴佺▼A-鑺傜偣A",
+            "left": 39,
+            "top": 110,
+          },
+          {
+            "id": "nodeB",
+            "name": "娴佺▼A-鑺傜偣B",
+            "left": 340,
+            "top": 161,
+          },
+          {
+            "id": "nodeC",
+            "name": "娴佺▼A-鑺傜偣C",
+            "left": 739,
+            "top": 161,
+          },
+          {
+            "id": "nodeD",
+            "name": "鑺傜偣D",
+            "left": 739,
+            "top": 20,
+          }
+        ],
+        "lineList": [
+          {
+            "from": "nodeA",
+            "to": "nodeB"
+          },
+          {
+            "from": "nodeB",
+            "to": "nodeC"
+          },
+          {
+            "from": "nodeC",
+            "to": "nodeD"
+          }
+        ]
+      },
+      computed: {
+        nodeList() {
+          return this.option.nodeList
+        }
+      },
+      mounted() {
+        this.form = this.nodeList[this.count].id;
+      },
+      methods: {
+        handleClick(node) {
+          this.$message.success(JSON.stringify(node))
+          console.log(node)
+        },
+        addHandler(){
+          this.dialogTableVisible=true
+          console.log(1)
+
+        },
+        deleteNode(id){
+          console.log(id)
+        }
       }
     }
   }
 }
 </script>
 
-<style scoped>
-
+<style lang="scss">
+#basic {
+  height: 761px;
+  border-radius: 10px;
+}
 </style>

--
Gitblit v1.9.3