|
@@ -1883,6 +1883,9 @@ export default {
|
|
|
if (script) {
|
|
if (script) {
|
|
|
script.parentNode.removeChild(script)
|
|
script.parentNode.removeChild(script)
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log('1886 this.template',this.template)
|
|
|
|
|
+ console.log('1886 this.dataTemplate',this.dataTemplate)
|
|
|
|
|
+
|
|
|
if (this.dataTemplate.attrs && this.dataTemplate.attrs.script) {
|
|
if (this.dataTemplate.attrs && this.dataTemplate.attrs.script) {
|
|
|
const codeScript = this.dataTemplate.attrs.script
|
|
const codeScript = this.dataTemplate.attrs.script
|
|
|
script = document.createElement('script')
|
|
script = document.createElement('script')
|
|
@@ -1913,12 +1916,15 @@ export default {
|
|
|
* 数据模板脚本里打开的对话框列表,不需要执行本模块代码,否则会执行到底层列表的onload脚本:洗眼器
|
|
* 数据模板脚本里打开的对话框列表,不需要执行本模块代码,否则会执行到底层列表的onload脚本:洗眼器
|
|
|
* 但是在表单页面打开对话框的时候需要执行本模块代码:考试管理对话框
|
|
* 但是在表单页面打开对话框的时候需要执行本模块代码:考试管理对话框
|
|
|
*/
|
|
*/
|
|
|
- // if (this.dataTemplate.type === 'default' || (this.dataTemplate.type === 'dialog' && !this.tempSearch) || this.tempSearch) {
|
|
|
|
|
- // JTemplate._onLoad(this)
|
|
|
|
|
- // }
|
|
|
|
|
- // 判断是否是列表页面,如果是则执行onload逻辑;主列表上打开的对话框跟表单里打开的对话框不需要执行下面的逻辑
|
|
|
|
|
- if (this.dataTemplate.type === 'default') {
|
|
|
|
|
- // 主列表onload执行逻辑
|
|
|
|
|
|
|
+ console.log('1916 this.dataTemplate', this.dataTemplate)
|
|
|
|
|
+ if (this.dataTemplate.type === 'default' || (this.dataTemplate.type === 'dialog' && !this.tempSearch) || this.tempSearch) {
|
|
|
|
|
+ // 判断对话框模板脚本是否存在onload,如果存在就执行,如果不存在就不执行JTemplate._onLoad(this)
|
|
|
|
|
+ // 对话框模板脚本里的onload如果不想要就删掉,禁止注释,否则对话框模板脚本里的onload注释掉的时候系统逻辑会默认使用主列表上的onload
|
|
|
|
|
+ if (this.dataTemplate.type === 'dialog' &&
|
|
|
|
|
+ (!this.dataTemplate.attrs || !this.dataTemplate.attrs.script || this.dataTemplate.attrs.script.indexOf('onload') < 0)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 模板脚本 执行逻辑
|
|
|
JTemplate._onLoad(this)
|
|
JTemplate._onLoad(this)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|