Просмотр исходного кода

表单和模板初始化common通用函数及常用接口

shenqilong 1 год назад
Родитель
Сommit
27d0fae2f6

+ 77 - 75
src/business/platform/data/templaterender/utils/JComposeTemplate.js

@@ -13,97 +13,99 @@ import _ from 'lodash'
 import Vue from 'vue'
 import Vue from 'vue'
 import request from '@/utils/request'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import dialog from '@/utils/dialog'
+import common from '@/utils/common'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import getserial from '../../../form/utils/custom/serialNumber' //编码规则
-import pintText from '../../../form/utils/custom/pintText.js' //打印规则
-import repostCurd from '../../../form/utils/custom/joinCURD.js' //增删改查规则
-import getDate from '../../../form/utils/custom/getDateRule.js' //获取年月日
+import getserial from '../../../form/utils/custom/serialNumber' // 编码规则
+import pintText from '../../../form/utils/custom/pintText.js' // 打印规则
+import repostCurd from '../../../form/utils/custom/joinCURD.js' // 增删改查规则
+import getDate from '../../../form/utils/custom/getDateRule.js' // 获取年月日
 
 
 // 定义全局
 // 定义全局
 var JComposeTemplate
 var JComposeTemplate
 if (!window.JComposeTemplate) {
 if (!window.JComposeTemplate) {
-  JComposeTemplate = window.JComposeTemplate = {}
+    JComposeTemplate = window.JComposeTemplate = {}
 } else {
 } else {
-  JComposeTemplate = window.JComposeTemplate
+    JComposeTemplate = window.JComposeTemplate
 }
 }
 /**
 /**
    * 封装自定义代码扩展接口
    * 封装自定义代码扩展接口
    */
    */
 _.extend(JComposeTemplate, {
 _.extend(JComposeTemplate, {
-  // 已经初始化
-  _isInitialization: false,
-  _isLoadJavaScriptFile: false,
-  // 初始化表单
-  _init: function(template) {
-    if (this._isInitialization) return
-    this.$template = template
-    this.$vue = Vue
-    this.$request = request
-    this.$dialog = dialog
-    this.$import = _import
-    this._ = _
-    this.$getDate = getDate //获取封装好的年月日
-    this.$getNumBer = getserial //封装获取流水号
-    this.$getPint =  pintText //封装打开报表
-    this.$curdPost = repostCurd //封装通用增删改查
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$import = _import
+        this._ = _
+        this.$getDate = getDate // 获取封装好的年月日
+        this.$getNumBer = getserial // 封装获取流水号
+        this.$getPint = pintText // 封装打开报表
+        this.$curdPost = repostCurd // 封装通用增删改查
 
 
-    this._isInitialization = true
-  },
+        this._isInitialization = true
+    },
 
 
-  // 页面加载
-  _onLoad: function(template) {
-    this._init(template)
-    if (_.isFunction(this.onLoad)) {
-      this.onLoad(template)
-    }
-  },
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
 
 
-  // 加载按钮
-  _onLoadActions: function(template) {
-    if (_.isFunction(this.onLoadActions)) {
-      this.onLoadActions(template)
-    }
-  },
-  // 按钮提交前事件
-  _beforeSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.beforeSubmit)) {
-      return this.beforeSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
 
 
-  // 按钮提交后事件
-  _afterSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.afterSubmit)) {
-      return this.afterSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
-  // 单元格自定义格式
-  _customFormatter: function(template, name, value, rowData, column) {
-    if (_.isFunction(this.customFormatter)) {
-      return this.customFormatter(template, name, value, rowData, column)
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
     }
     }
-  },
-  // 清理所有自定义事件
-  cleanEvents: function() {
-    this.onLoad = null
-    this.onLoadActions = null
-    this.onValidate = null
-    this.afterSubButton = null
-    this.beforeSubButton = null
-    this.summaryMethod = null
-    this.afterSubmit = null
-    this.beforeSubmit = null
-    this.customFormatter = null
-    this._isInitialization = false
-  }
 })
 })
 
 
 export default JComposeTemplate
 export default JComposeTemplate

+ 77 - 75
src/business/platform/data/templaterender/utils/JDialogTemplate.js

@@ -13,96 +13,98 @@ import _ from 'lodash'
 import Vue from 'vue'
 import Vue from 'vue'
 import request from '@/utils/request'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import dialog from '@/utils/dialog'
+import common from '@/utils/common'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import getserial from '../../../form/utils/custom/serialNumber' //编码规则
-import pintText from '../../../form/utils/custom/pintText.js' //打印规则
-import repostCurd from '../../../form/utils/custom/joinCURD.js' //增删改查规则
-import getDate from '../../../form/utils/custom/getDateRule.js' //获取年月日
+import getserial from '../../../form/utils/custom/serialNumber' // 编码规则
+import pintText from '../../../form/utils/custom/pintText.js' // 打印规则
+import repostCurd from '../../../form/utils/custom/joinCURD.js' // 增删改查规则
+import getDate from '../../../form/utils/custom/getDateRule.js' // 获取年月日
 
 
 // 定义全局
 // 定义全局
 var JDialog
 var JDialog
 if (!window.JDialog) {
 if (!window.JDialog) {
-  JDialog = window.JDialog = {}
+    JDialog = window.JDialog = {}
 } else {
 } else {
-  JDialog = window.JDialog
+    JDialog = window.JDialog
 }
 }
 /**
 /**
    * 封装自定义代码扩展接口
    * 封装自定义代码扩展接口
    */
    */
 _.extend(JDialog, {
 _.extend(JDialog, {
-  // 已经初始化
-  _isInitialization: false,
-  _isLoadJavaScriptFile: false,
-  // 初始化表单
-  _init: function(template) {
-    if (this._isInitialization) return
-    this.$template = template
-    this.$vue = Vue
-    this.$request = request
-    this.$dialog = dialog
-    this.$import = _import
-    this.$getDate = getDate //获取封装好的年月日
-    this.$getNumBer = getserial //封装获取流水号
-    this.$getPint =  pintText //封装打开报表
-    this.$curdPost = repostCurd //封装通用增删改查
-    this._ = _
-    this._isInitialization = true
-  },
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$import = _import
+        this.$getDate = getDate // 获取封装好的年月日
+        this.$getNumBer = getserial // 封装获取流水号
+        this.$getPint = pintText // 封装打开报表
+        this.$curdPost = repostCurd // 封装通用增删改查
+        this._ = _
+        this._isInitialization = true
+    },
 
 
-  // 页面加载
-  _onLoad: function(template) {
-    this._init(template)
-    if (_.isFunction(this.onLoad)) {
-      this.onLoad(template)
-    }
-  },
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
 
 
-  // 加载按钮
-  _onLoadActions: function(template) {
-    if (_.isFunction(this.onLoadActions)) {
-      this.onLoadActions(template)
-    }
-  },
-  // 按钮提交前事件
-  _beforeSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.beforeSubmit)) {
-      return this.beforeSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
 
 
-  // 按钮提交后事件
-  _afterSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.afterSubmit)) {
-      return this.afterSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
-  // 单元格自定义格式
-  _customFormatter: function(template, name, value, rowData, column) {
-    if (_.isFunction(this.customFormatter)) {
-      return this.customFormatter(template, name, value, rowData, column)
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
     }
     }
-  },
-  // 清理所有自定义事件
-  cleanEvents: function() {
-    this.onLoad = null
-    this.onLoadActions = null
-    this.onValidate = null
-    this.afterSubButton = null
-    this.beforeSubButton = null
-    this.summaryMethod = null
-    this.afterSubmit = null
-    this.beforeSubmit = null
-    this.customFormatter = null
-    this._isInitialization = false
-  }
 })
 })
 
 
 export default JDialog
 export default JDialog

+ 78 - 76
src/business/platform/data/templaterender/utils/JTemplate.js

@@ -13,98 +13,100 @@ import _ from 'lodash'
 import Vue from 'vue'
 import Vue from 'vue'
 import request from '@/utils/request'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import dialog from '@/utils/dialog'
+import common from '@/utils/common'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import getserial from '../../../form/utils/custom/serialNumber' //编码规则
-import pintText from '../../../form/utils/custom/pintText.js' //打印规则
-import repostCurd from '../../../form/utils/custom/joinCURD.js' //增删改查规则
-import getDate from '../../../form/utils/custom/getDateRule.js' //获取年月日
+import getserial from '../../../form/utils/custom/serialNumber' // 编码规则
+import pintText from '../../../form/utils/custom/pintText.js' // 打印规则
+import repostCurd from '../../../form/utils/custom/joinCURD.js' // 增删改查规则
+import getDate from '../../../form/utils/custom/getDateRule.js' // 获取年月日
 import store from '@/store'
 import store from '@/store'
 
 
 // 定义全局
 // 定义全局
 var JTemplate
 var JTemplate
 if (!window.JTemplate) {
 if (!window.JTemplate) {
-  JTemplate = window.JTemplate = {}
+    JTemplate = window.JTemplate = {}
 } else {
 } else {
-  JTemplate = window.JTemplate
+    JTemplate = window.JTemplate
 }
 }
 /**
 /**
    * 封装自定义代码扩展接口
    * 封装自定义代码扩展接口
    */
    */
 _.extend(JTemplate, {
 _.extend(JTemplate, {
-  // 已经初始化
-  _isInitialization: false,
-  _isLoadJavaScriptFile: false,
-  // 初始化表单
-  _init: function(template) {
-    if (this._isInitialization) return
-    this.$template = template
-    this.$vue = Vue
-    this.$request = request
-    this.$dialog = dialog
-    this.$import = _import
-    this.$getDate = getDate //获取封装好的年月日
-    this.$getNumBer = getserial //封装获取流水号
-    this.$getPint =  pintText //封装打开报表
-    this.$curdPost = repostCurd //封装通用增删改查
-    this._ = _
-    this._isInitialization = true
-    this.$store = store
-  },
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$import = _import
+        this.$getDate = getDate // 获取封装好的年月日
+        this.$getNumBer = getserial // 封装获取流水号
+        this.$getPint = pintText // 封装打开报表
+        this.$curdPost = repostCurd // 封装通用增删改查
+        this._ = _
+        this._isInitialization = true
+        this.$store = store
+    },
 
 
-  // 页面加载
-  _onLoad: function(template) {
-    this._init(template)
-    if (_.isFunction(this.onLoad)) {
-      this.onLoad(template)
-    }
-  },
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
 
 
-  // 加载按钮
-  _onLoadActions: function(template, action, button, type, row) {
-    if (_.isFunction(this.onLoadActions)) {
-      return this.onLoadActions(template, action, button, type, row)
-    }
-  },
-  // 按钮提交前事件
-  _beforeSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.beforeSubmit)) {
-      return this.beforeSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
+    // 加载按钮
+    _onLoadActions: function (template, action, button, type, row) {
+        if (_.isFunction(this.onLoadActions)) {
+            return this.onLoadActions(template, action, button, type, row)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
 
 
-  // 按钮提交后事件
-  _afterSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.afterSubmit)) {
-      return this.afterSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
-  // 单元格自定义格式
-  _customFormatter: function(template, name, value, rowData, column) {
-    if (_.isFunction(this.customFormatter)) {
-      return this.customFormatter(template, name, value, rowData, column)
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
     }
     }
-  },
-  // 清理所有自定义事件
-  cleanEvents: function() {
-    this.onLoad = null
-    this.onLoadActions = null
-    this.onValidate = null
-    this.afterSubButton = null
-    this.beforeSubButton = null
-    this.summaryMethod = null
-    this.afterSubmit = null
-    this.beforeSubmit = null
-    this.customFormatter = null
-    this._isInitialization = false
-  }
 })
 })
 
 
 export default JTemplate
 export default JTemplate

+ 77 - 75
src/business/platform/data/templaterender/utils/JTreeTemplate.js

@@ -13,96 +13,98 @@ import _ from 'lodash'
 import Vue from 'vue'
 import Vue from 'vue'
 import request from '@/utils/request'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import dialog from '@/utils/dialog'
+import common from '@/utils/common'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import getserial from '../../../form/utils/custom/serialNumber' //编码规则
-import pintText from '../../../form/utils/custom/pintText.js' //打印规则
-import repostCurd from '../../../form/utils/custom/joinCURD.js' //增删改查规则
-import getDate from '../../../form/utils/custom/getDateRule.js' //获取年月日
+import getserial from '../../../form/utils/custom/serialNumber' // 编码规则
+import pintText from '../../../form/utils/custom/pintText.js' // 打印规则
+import repostCurd from '../../../form/utils/custom/joinCURD.js' // 增删改查规则
+import getDate from '../../../form/utils/custom/getDateRule.js' // 获取年月日
 
 
 // 定义全局
 // 定义全局
 var JTreeTemplate
 var JTreeTemplate
 if (!window.JTreeTemplate) {
 if (!window.JTreeTemplate) {
-  JTreeTemplate = window.JTreeTemplate = {}
+    JTreeTemplate = window.JTreeTemplate = {}
 } else {
 } else {
-  JTreeTemplate = window.JTreeTemplate
+    JTreeTemplate = window.JTreeTemplate
 }
 }
 /**
 /**
    * 封装自定义代码扩展接口
    * 封装自定义代码扩展接口
   */
   */
 _.extend(JTreeTemplate, {
 _.extend(JTreeTemplate, {
-  // 已经初始化
-  _isInitialization: false,
-  _isLoadJavaScriptFile: false,
-  // 初始化表单
-  _init: function(template) {
-    if (this._isInitialization) return
-    this.$template = template
-    this.$vue = Vue
-    this.$request = request
-    this.$dialog = dialog
-    this.$import = _import
-    this.$getDate = getDate //获取封装好的年月日
-    this.$getNumBer = getserial //封装获取流水号
-    this.$getPint =  pintText //封装打开报表
-    this.$curdPost = repostCurd //封装通用增删改查
-    this._ = _
-    this._isInitialization = true
-  },
+    // 已经初始化
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function (template) {
+        if (this._isInitialization) return
+        this.$template = template
+        this.$vue = Vue
+        this.$request = request
+        this.$dialog = dialog
+        this.$common = common
+        this.$import = _import
+        this.$getDate = getDate // 获取封装好的年月日
+        this.$getNumBer = getserial // 封装获取流水号
+        this.$getPint = pintText // 封装打开报表
+        this.$curdPost = repostCurd // 封装通用增删改查
+        this._ = _
+        this._isInitialization = true
+    },
 
 
-  // 页面加载
-  _onLoad: function(template) {
-    this._init(template)
-    if (_.isFunction(this.onLoad)) {
-      this.onLoad(template)
-    }
-  },
+    // 页面加载
+    _onLoad: function (template) {
+        this._init(template)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(template)
+        }
+    },
 
 
-  // 加载按钮
-  _onLoadActions: function(template) {
-    if (_.isFunction(this.onLoadActions)) {
-      this.onLoadActions(template)
-    }
-  },
-  // 按钮提交前事件
-  _beforeSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.beforeSubmit)) {
-      return this.beforeSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
+    // 加载按钮
+    _onLoadActions: function (template) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(template)
+        }
+    },
+    // 按钮提交前事件
+    _beforeSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            return this.beforeSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
 
 
-  // 按钮提交后事件
-  _afterSubmit: function(template, action, position, selection, data, callback) {
-    if (_.isFunction(this.afterSubmit)) {
-      return this.afterSubmit(template, action, position, selection, data, callback)
-    }
-    if (_.isFunction(callback)) {
-      const flag = true
-      callback(flag)
-    }
-  },
-  // 单元格自定义格式
-  _customFormatter: function(template, name, value, rowData, column) {
-    if (_.isFunction(this.customFormatter)) {
-      return this.customFormatter(template, name, value, rowData, column)
+    // 按钮提交后事件
+    _afterSubmit: function (template, action, position, selection, data, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(template, action, position, selection, data, callback)
+        }
+        if (_.isFunction(callback)) {
+            const flag = true
+            callback(flag)
+        }
+    },
+    // 单元格自定义格式
+    _customFormatter: function (template, name, value, rowData, column) {
+        if (_.isFunction(this.customFormatter)) {
+            return this.customFormatter(template, name, value, rowData, column)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function () {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this.customFormatter = null
+        this._isInitialization = false
     }
     }
-  },
-  // 清理所有自定义事件
-  cleanEvents: function() {
-    this.onLoad = null
-    this.onLoadActions = null
-    this.onValidate = null
-    this.afterSubButton = null
-    this.beforeSubButton = null
-    this.summaryMethod = null
-    this.afterSubmit = null
-    this.beforeSubmit = null
-    this.customFormatter = null
-    this._isInitialization = false
-  }
 })
 })
 
 
 export default JTreeTemplate
 export default JTreeTemplate

+ 20 - 19
src/business/platform/form/utils/JForm.js

@@ -12,28 +12,28 @@ import _ from 'lodash'
 import Vue from 'vue'
 import Vue from 'vue'
 import request from '@/utils/request'
 import request from '@/utils/request'
 import dialog from '@/utils/dialog'
 import dialog from '@/utils/dialog'
-import getserial from './custom/serialNumber' //编码规则
-import pintText from './custom/pintText.js' //打印规则
-import repostCurd from './custom/joinCURD.js' //增删改查规则
-import getDate from './custom/getDateRule.js' //获取年月日
+import common from '@/utils/common'
+import getserial from './custom/serialNumber' // 编码规则
+import pintText from './custom/pintText.js' // 打印规则
+import repostCurd from './custom/joinCURD.js' // 增删改查规则
+import getDate from './custom/getDateRule.js' // 获取年月日
 import {
 import {
     snapshoot,
     snapshoot,
     generateUUID,
     generateUUID,
     getFileByte,
     getFileByte,
     uploadFile
     uploadFile
-} from '@/api/platform/file/attachment' //印章,快照
+} from '@/api/platform/file/attachment' // 印章,快照
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import pinyin4js from 'pinyin4js';
+import pinyin4js from 'pinyin4js'
 import store from '@/store'
 import store from '@/store'
 import router from '@/router'
 import router from '@/router'
 import { save } from '@/api/platform/message/innerMessage'
 import { save } from '@/api/platform/message/innerMessage'
 import { get as getUserById } from '@/api/platform/org/user'
 import { get as getUserById } from '@/api/platform/org/user'
 
 
 import {
 import {
-    goSeal, wordToPdf, sealByKeywords, docxToPdfAndSign,transferPDF
+    goSeal, wordToPdf, sealByKeywords, docxToPdfAndSign, transferPDF
 } from '@/api/platform/form/seal' // ca电子签章接口
 } from '@/api/platform/form/seal' // ca电子签章接口
 
 
-
 // 定义全局
 // 定义全局
 var JForm
 var JForm
 if (!window.JForm) {
 if (!window.JForm) {
@@ -55,22 +55,23 @@ _.extend(JForm, {
         this.$vue = Vue
         this.$vue = Vue
         this.$request = request
         this.$request = request
         this.$dialog = dialog
         this.$dialog = dialog
+        this.$common = common
         this.$import = _import
         this.$import = _import
         this.$pyjs = pinyin4js
         this.$pyjs = pinyin4js
-        this.$getDate = getDate //获取封装好的年月日
-        this.$getNumBer = getserial //封装获取流水号
-        this.$getPint = pintText //封装打开报表
-        this.$curdPost = repostCurd //封装通用增删改查
-        this.$snapshoot = snapshoot //报表快照(经过润乾)
+        this.$getDate = getDate // 获取封装好的年月日
+        this.$getNumBer = getserial // 封装获取流水号
+        this.$getPint = pintText // 封装打开报表
+        this.$curdPost = repostCurd // 封装通用增删改查
+        this.$snapshoot = snapshoot // 报表快照(经过润乾)
         this.$generateUUID = generateUUID // 自定义规则自动生成uuid
         this.$generateUUID = generateUUID // 自定义规则自动生成uuid
-        this.$router = router //添加router对象
-        this.$save = save   // 文件发放通知
-        this.$goSeal = goSeal  // ca电子签章接口
-        this.$wordToPdf = wordToPdf  // word转pdf
-        this.$transferPDF = transferPDF  // 转pdf,文件新增修订
+        this.$router = router // 添加router对象
+        this.$save = save // 文件发放通知
+        this.$goSeal = goSeal // ca电子签章接口
+        this.$wordToPdf = wordToPdf // word转pdf
+        this.$transferPDF = transferPDF // 转pdf,文件新增修订
         this.$sealByKeywords = sealByKeywords // 关键字盖章
         this.$sealByKeywords = sealByKeywords // 关键字盖章
         this.$getFileByte = getFileByte // 获取文件流
         this.$getFileByte = getFileByte // 获取文件流
-        this.$uploadFile = uploadFile   // 文件上传接口
+        this.$uploadFile = uploadFile // 文件上传接口
         this.$sign = docxToPdfAndSign
         this.$sign = docxToPdfAndSign
         this.$getUserById = getUserById
         this.$getUserById = getUserById
         this._ = _
         this._ = _