diff --git a/module-form/src/main/resources/static/form/js/app-oa-form-util.js b/module-form/src/main/resources/static/form/js/app-oa-form-util.js new file mode 100644 index 00000000..c600154b --- /dev/null +++ b/module-form/src/main/resources/static/form/js/app-oa-form-util.js @@ -0,0 +1,49 @@ +(function () { + + var u = navigator.userAgent; + var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; + var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); + + function AppOaFormUtil() { + this.confirmAssignees = null; + this.fields = null; + this.formButton = null; + this.currentUser = null; + + /** + * 初始化APP数据 + * @param dataObj + */ + this.initAppFormData = function (dataObj) { + this.confirmAssignees = dataObj.confirmAssignees; + this.fields = dataObj.fields; + this.formButton = dataObj.formButton; + this.currentUser = dataObj.currentUser; + + if (isAndroid) { + window.android.invokeNative('initFormData', JSON.stringify(dataObj)) + } + } + + this.getConfirmAssignees = function () { + alert(JSON.stringify(this.confirmAssignees)) + return this.confirmAssignees; + } + + this.getFields = function () { + return this.fields; + } + + this.getFormButton = function () { + return this.formButton; + } + + this.getCurrentUser = function () { + return this.currentUser; + } + + } + + window.appOaFormUtil = new AppOaFormUtil(); + +})(); \ No newline at end of file