Przeglądaj źródła

fix:处理表单打开对话框没有onload时会调用主列表里的onload问题

liujiayin 2 lat temu
rodzic
commit
0a765f6d64

+ 7 - 2
src/business/platform/data/templaterender/templates/list.vue

@@ -1908,12 +1908,17 @@ export default {
             }
             /**
              * type:default,那么表示是一般的列表
-             * type:dialog,表示对话框列表
+             * type:dialog表示对话框列表
              * tempSearch为true的时候是列表搜索框点击打开的对话框
              * 数据模板脚本里打开的对话框列表,不需要执行本模块代码,否则会执行到底层列表的onload脚本:洗眼器
              * 但是在表单页面打开对话框的时候需要执行本模块代码:考试管理对话框
              */
-            if (this.dataTemplate.type === 'default' || (this.dataTemplate.type === 'dialog' && !this.tempSearch) || this.tempSearch) {
+            // if (this.dataTemplate.type === 'default' || (this.dataTemplate.type === 'dialog' && !this.tempSearch) || this.tempSearch) {
+            //     JTemplate._onLoad(this)
+            // }
+            // 判断是否是列表页面,如果是则执行onload逻辑;主列表上打开的对话框跟表单里打开的对话框不需要执行下面的逻辑
+            if (this.dataTemplate.type === 'default') {
+                // 主列表onload执行逻辑
                 JTemplate._onLoad(this)
             }
         },