408249787 před 2 roky
rodič
revize
a4c46ceb91
1 změnil soubory, kde provedl 15 přidání a 9 odebrání
  1. 15 9
      src/views/opc/Opc.vue

+ 15 - 9
src/views/opc/Opc.vue

@@ -18,6 +18,9 @@
         :isDraggable="item.isActive"
         :isResizable="item.isActive"
         :stickSize="5"
+        @resizing="handleOpt(item)"
+        @dragging="handleOpt(item)"
+        @resizestop="resize"
         @dragstop="resize">
         <a-tooltip>
           <template slot="title">
@@ -57,9 +60,9 @@
         :scroll="{ y: 650 }"
       >
         <span slot="action" slot-scope="text, record,index">
-          <a @click="disposition(record,index)">配置</a>
-          <a-button style="color:#ccc" v-show="record.positionFlag" type="link" icon="eye-invisible" @click="handleShow(index,0)" />
-          <a-button v-show="!record.positionFlag" type="link" icon="eye" @click="handleShow(index,1)" />
+          <a @click="disposition(record)">配置</a>
+          <a-button style="color:#ccc" v-show="record.positionFlag" type="link" icon="eye-invisible" @click="handleShow(record,0)" />
+          <a-button v-show="!record.positionFlag" type="link" icon="eye" @click="handleShow(record,1)" />
         </span>
       </a-table>
     </a-drawer>
@@ -114,7 +117,7 @@ export default {
     resize (newRect) {
       console.log(newRect)
       const params = {
-        ...this.dotList[this.optDot],
+        ...this.optDot,
         height: newRect.height,
         width: newRect.width,
         xposition: newRect.left,
@@ -124,21 +127,24 @@ export default {
       if (params.id != null) {
         updateRemoteOpc(params).then(res => {
           console.log(res)
-          this.dotList[this.optDot].isActive = true
+          this.optDot.isActive = true
         })
       }
     },
     onCloseRight () {
       this.visibleRight = false
     },
-    disposition (val, i) {
-      val.isActive = true
+    disposition (val) {
       val.positionFlag = 1
-      this.optDot = i
+      this.optDot = val
       this.visibleRight = false
     },
+    handleOpt (val) {
+      console.log(val)
+      this.optDot = val
+    },
     handleShow (val, key) {
-      this.dotList[val].positionFlag = key
+      val.positionFlag = key
     },
     getOpcInfo () {
       fetchSbPosition({ id: this.positionId }).then(res => {