浏览代码

变量回收问题导致的bug

xiaohaizhao 1 年之前
父节点
当前提交
ee28521f10

+ 1 - 3
control/components/prodnum-06/modules/basics.vue

@@ -16,7 +16,6 @@
     </view>
 </template>
 <script>
-let model = null;
 export default {
     name: "basics",
     data() {
@@ -27,8 +26,7 @@ export default {
     },
     methods: {
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }

+ 1 - 3
control/components/prodnum-06/modules/division.vue

@@ -34,7 +34,6 @@
 </template>
 
 <script>
-let model = null;
 export default {
     name: "division",
     data() {
@@ -73,8 +72,7 @@ export default {
             this.list = list;
         },
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }

+ 1 - 5
control/components/prodnum-06/modules/mpattern.vue

@@ -30,14 +30,11 @@
             </view>
             <view class="dot" v-if="preview.tar.isfeedback" />
         </view>
-
         <My_input ref="MyInput" />
-
     </view>
 </template>
 
 <script>
-let model = null;
 export default {
     name: "mpattern",
     data() {
@@ -48,8 +45,7 @@ export default {
     },
     methods: {
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }

+ 1 - 3
control/components/prodnum-MT02/modules/basics.vue

@@ -39,7 +39,6 @@
     </view>
 </template>
 <script>
-let model = null;
 export default {
     name: "basics",
     data() {
@@ -51,8 +50,7 @@ export default {
     },
     methods: {
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }

+ 1 - 3
control/components/prodnum-MT02/modules/division.vue

@@ -86,7 +86,6 @@
 </template>
 
 <script>
-let model = null;
 export default {
     name: "division",
     data() {
@@ -140,8 +139,7 @@ export default {
             this.timeControl = this.__proto__.getControlItem(["TimeCon"], newVal)[0]
         },
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item, true)
+            this.$refs.MyInput.openInput(item)
             if (this.changeItem.funcname != item.funcname) this.changeItem = JSON.parse(JSON.stringify(item));
             let toBeUpdated = [];
             if (item.paramValue.begin) toBeUpdated.push(`开始时间:${item.paramValue.begin}`);

+ 1 - 3
control/components/prodnum-MT03/modules/division.vue

@@ -76,7 +76,6 @@
 </template>
 
 <script>
-let model = null;
 export default {
     name: "division",
     data() {
@@ -129,8 +128,7 @@ export default {
             this.list = list;
         },
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item, true)
+            this.$refs.MyInput.openInput(item)
             if (this.changeItem.funcname != item.funcname) this.changeItem = JSON.parse(JSON.stringify(item));
             let toBeUpdated = [];
             if (item.paramValue.begin) toBeUpdated.push(`开始时间:${item.paramValue.begin}`);

+ 1 - 3
control/components/prodnum-MT03/modules/mpattern.vue

@@ -15,7 +15,6 @@
 </template>
 
 <script>
-let model = null;
 export default {
     name: "mpattern",
     props: {
@@ -31,8 +30,7 @@ export default {
     },
     methods: {
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }

+ 1 - 3
control/components/prodnum-MT03/modules/tabs.vue

@@ -47,7 +47,6 @@
 </template>
 
 <script>
-let model = null;
 import mpattern from "./mpattern";
 import { formatTime } from "../../../../utils/getTime";
 
@@ -116,8 +115,7 @@ export default {
             this.showPage = e.name;
         },
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         },
         onCancel(e) {
             this.datetimeShow = false;

+ 1 - 3
control/components/prodnum-YK01/modules/controlPanel.vue

@@ -16,7 +16,6 @@
     </view>
 </template>
 <script>
-let model = null;
 export default {
     name: "controlPanel",
     data() {
@@ -27,8 +26,7 @@ export default {
     },
     methods: {
         onClick(item) {
-            if (!model) model = this.$refs.MyInput;
-            model.openInput(item)
+            this.$refs.MyInput.openInput(item)
         }
     }
 }