From 2fef10f07e65ce6f703c8043085e5728bd311d1e Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 02 八月 2024 17:16:40 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/basicInfo/XhProductModel.vue        |    9 ++-
 web/src/views/modules/taskReliability/TimeDiagramTemp.vue |   30 ----------
 web/src/views/modules/taskReliability/TimeDiagram.vue     |  124 +++++++++++++++++++++++++++++++++++++---
 web/src/views/modules/basicInfo/ParamData.vue             |    6 +
 web/src/views/modules/basicInfo/ProductImport.vue         |    4 -
 5 files changed, 124 insertions(+), 49 deletions(-)

diff --git a/web/src/views/modules/basicInfo/ParamData.vue b/web/src/views/modules/basicInfo/ParamData.vue
index eb245a4..4a9a33d 100644
--- a/web/src/views/modules/basicInfo/ParamData.vue
+++ b/web/src/views/modules/basicInfo/ParamData.vue
@@ -449,9 +449,11 @@
       },
       onDefault(defaultId) {
         this.dataForm.srcId = defaultId
-        this.dataForm.productType = 2
+        this.dataForm.productType = '1'
         this.activeName = 'first'
-        this.$refs.tableObj.query()
+        this.$nextTick(() => {
+          this.$refs.tableObj.query()
+        })
       },
       dataLoaded(data) {
         this.dataList = data
diff --git a/web/src/views/modules/basicInfo/ProductImport.vue b/web/src/views/modules/basicInfo/ProductImport.vue
index 6397668..4f7a586 100644
--- a/web/src/views/modules/basicInfo/ProductImport.vue
+++ b/web/src/views/modules/basicInfo/ProductImport.vue
@@ -31,9 +31,6 @@
         <el-table-column prop="lineNumber" label="閿欒琛屾暟"/>
       </el-table>
     </el-form>
-    <!--<template slot="footer">-->
-    <!--<zt-button type="primary" style="float:left" @click="exportExcelModel()">瀵煎嚭Excel瀵煎叆妯℃澘</zt-button>-->
-    <!--</template>-->
   </zt-dialog>
 </template>
 
@@ -157,6 +154,7 @@
             }
           )
         } else {
+          clearInterval(this.timer)
         }
       }
     }
diff --git a/web/src/views/modules/basicInfo/XhProductModel.vue b/web/src/views/modules/basicInfo/XhProductModel.vue
index 418481b..af4db4d 100644
--- a/web/src/views/modules/basicInfo/XhProductModel.vue
+++ b/web/src/views/modules/basicInfo/XhProductModel.vue
@@ -72,6 +72,7 @@
         url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
         productType: '',
         shipId: '',
+        namePath:'',
         dataForm: {
           name: '',
           type: '',
@@ -97,7 +98,8 @@
           this.$refs.SelectTyModel.$refs.dialog.init(null, {
             type: this.dataForm.type,
             id: this.dataForm.pid,
-            shipId: this.shipId
+            shipId: this.shipId,
+            namePath: this.namePath
           })
         } else {
           this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid})
@@ -129,6 +131,7 @@
         this.dataForm.pid = data.id
         this.dataForm.type = data.productType
         this.productType = data.productType
+        this.namePath = data.namePath
         if (data.productType !== '10') {
           this.$refs.tableObj.query()
         }
@@ -143,8 +146,8 @@
       },
       onDefault(defaultId) {
         this.dataForm.pid = defaultId
-        this.dataForm.type = 2
-        this.productType = 2
+        this.dataForm.type = 1
+        this.productType = 1
         this.$refs.tableObj.query()
       },
     }
diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue
index 5806178..34b9656 100644
--- a/web/src/views/modules/taskReliability/TimeDiagram.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -118,6 +118,7 @@
     },
     mounted() {
       this.getProductList()
+
     },
     components: {
       ProductModelTree,
@@ -159,6 +160,9 @@
           },
           autoResize: true,
           history: true,
+          // panning: {
+          //   enabled: true,
+          // },
           scroller: {
             enabled: true,
             pageVisible: true,
@@ -187,7 +191,6 @@
             },
             // anchor: 'center',
             connectionPoint: 'anchor',
-            allowBlank: false,
             snap: {
               radius: 20,
             },
@@ -217,6 +220,9 @@
                 zIndex: 0,
               })
             },
+            // validateConnection({targetMagnet}) {
+            //   return !!targetMagnet
+            // },
           },
           highlighting: {
             magnetAdsorbed: {
@@ -264,6 +270,7 @@
             rowHeight: 100,
           },
         })
+        document.getElementById('stencil').appendChild(stencil.container)
         Graph.registerNode(
           'custom-rect',
           {
@@ -324,7 +331,101 @@
             },
             ports: {
               ...this.ports
+              // items: [
+              //   {
+              //     group: 'top',
+              //   },
+              //   {
+              //     group: 'bottom',
+              //   },
+              // ],
             },
+          },
+          true,
+        )
+        //
+        Graph.registerNode(
+          'custom-circle',
+          {
+            inherit: 'ellipse',
+            width: 120,
+            height: 120,
+            data: {
+              dataId: '',
+              finishDate: ''
+            },
+            attrs: {
+              body: {
+                strokeWidth: 1,
+                stroke: '#5F95FF',
+                fill: '#EFF4FF',
+              },
+              //鏃ユ湡
+              title: {
+                text: '',
+                fontSize: 12,
+                fill: '#262626',
+                refX: 0.5,
+                refY: '100%',
+                refY2: -10,
+                textAnchor: 'middle',
+                textVerticalAnchor: 'bottom',
+              },
+              // 鍚嶇О
+              text: {
+                // fontFamily: '浠垮畫',
+                fontSize: 20,
+                fill: '#262626',
+                textWrap: {
+                  width: 80,      // 瀹藉害涓� 80px鎹㈣
+                  ellipsis: false,  // 鏂囨湰瓒呭嚭鏄剧ず鑼冨洿鏃讹紝鑷姩娣诲姞鐪佺暐鍙�
+                  breakWord: true, // 鏄惁鎴柇鍗曡瘝
+                }
+              },
+            },
+            markup: [
+              {
+                tagName: 'ellipse',
+                selector: 'body',
+              },
+              {
+                tagName: 'text',
+                selector: 'title',
+              },
+              {
+                tagName: 'text',
+                selector: 'text',
+              },
+            ],
+            ports: {...this.ports},
+          },
+          true,
+        )
+        Graph.registerNode(
+          'custom-circle1',
+          {
+            inherit: 'ellipse',
+            width: 65,
+            height: 65,
+            data: {
+              dataId: '',
+              finishDate: ''
+            },
+            attrs: {
+              body: {
+                strokeWidth: 1,
+                stroke: '#5F95FF',
+                fill: '#EFF4FF',
+              },
+              //鏃ユ湡
+              text: {
+                // fontFamily: '浠垮畫',
+                fontSize: 12,
+                text: '鏃ユ湡鑺傜偣',
+                fill: '#262626',
+              },
+            },
+            ports: {...this.ports},
           },
           true,
         )
@@ -539,7 +640,10 @@
         })
 
         this.graph.on('blank:click', ({cell}) => {
+          // this.reset()
+          // this.type.value = "grid"
           this.type = 'grid'
+          // this.id = cell.id
         })
 
         this.graph.on('cell:click', ({cell}) => {
@@ -566,16 +670,14 @@
         // 鍗曞嚮node鑺傜偣
         this.graph.on('node:click', ({node}) => {
           // this.reset()
-          if (node.getData().dataId) {
-            this.dialogVisible2 = true
-            let param = {
-              id: node.getData().dataId,
-              modelName: node.attr('label/textWrap/text'),
-            }
-            this.$nextTick(() => {
-              this.$refs.rbdEditImg.init(param)
-            })
-          }
+          node.attr('line/stroke', '#5F95FF')
+          node.prop('labels/0', {
+            attrs: {
+              body: {
+                stroke: '#5F95FF',
+              },
+            },
+          })
         })
         // 鎺у埗杩炴帴妗╂樉绀�/闅愯棌
         this.graph.on('node:delete', ({view, e}) => {
diff --git a/web/src/views/modules/taskReliability/TimeDiagramTemp.vue b/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
index f5fa205..8deee7a 100644
--- a/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
@@ -372,20 +372,11 @@
         if (res.data !== null && res.data.content != null) {
           this.dataForm = res.data
           this.diagramJson = JSON.parse(this.dataForm.content)
-          // console.log(this.dataForm.content,'this.Diagram content')
           console.log(this.diagramJson, 'this.Diagram json')
           this.graph.fromJSON(this.diagramJson)
-          // this.graph.centerContent()
-          // this.graph.zoomToFit()
         } else {
           this.dataForm.id = null
-          // await this.$alert('璇ラ」鐩繕鏈紪鍒剁綉缁滃浘', '鎻愮ず', {
-          //   confirmButtonText: '纭畾'
-          // })
           this.graph.fromJSON(this.emptyJson)
-          // this.graph.centerContent()
-          // this.graph.zoomToFit()
-          // this.graph.freeze()
         }
       },
       init() {
@@ -414,19 +405,6 @@
               })
             }
           },
-          // translating: {
-          //   restrict(view) {
-          //     const cell = view.cell
-          //     if (cell.isNode()) {
-          //       const parent = cell.getParent()
-          //       if (parent) {
-          //         return parent.getBBox()
-          //       }
-          //     }
-          //
-          //     return null
-          //   },
-          // },
           onToolItemCreated({tool}) {
             const handle = tool
             const options = handle.options
@@ -492,14 +470,6 @@
                       text: ''
                     }
                   },
-                  // position: {
-                  //   distance: 0.5,
-                  //   angle: 180,
-                  //   options: {
-                  //     keepGradient: true,
-                  //     ensureLegibility: true
-                  //   }
-                  // }
                 }],
                 zIndex: 0,
               })

--
Gitblit v1.9.1