(function () { if (!window.vp) { /** * vp基础类定义 */ var vp = { _version: "2.0", _theme: "default", _loginPagePath: "", _mainPagePath: "", _mainNewPagePath: "", _isReady: false, _loadResources: [], _resources: {}, _scope: {}, _atServices: [], _rid: "1735802467324", _host: window.location.protocol + "//" + window.location.host + "/", // _host: 'http://10.1.40.152:8082/', services: {}, _loadRes: [] } /** * vp资源列表 */ // 基础资源 bootstrap、jQuery vp._resources.base = []; vp._resources.base.push("vp/base/web/libs/bootstrap/bootstrap-3.3.7/css/bootstrap.min.css"); vp._resources.base.push("vp/base/web/libs/fontawesome/font-awesome-4.7.0/css/font-awesome.min.css"); vp._resources.base.push("vp/base/web/libs/jquery/jquery-1.12.4.min.js"); vp._resources.base.push("vp/base/web/libs/bootstrap/bootstrap-3.3.7/js/bootstrap.min.js"); vp._resources.base.push("vp/base/web/libs/jsrender/jsrender-0.9.81/jsrender.min.js"); vp._resources.base.push("vp/base/web/libs/backstretch/jquery.backstretch.min.js"); if (head.browser.name === "ie" && head.browser.version < 9) { vp._resources.base.push("//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"); vp._resources.base.push("//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"); } // 服务资源列表 vp._resources.services = {}; // tmpl(自动加载) vp._resources.services.tmpl = []; vp._resources.services.tmpl.push("vp/base/web/services/tmpl.js"); vp._atServices.push("tmpl"); // page(自动加载) vp._resources.services.page = []; // vp._resources.services.page.push("vp/base/web/libs/layer/layer-2.4/skin/layer.css"); // vp._resources.services.page.push("vp/base/web/libs/layer/layer-2.4/layer.js"); vp._resources.services.page.push("vp/base/web/libs/layer/layui-v2.6.8/layui/css/layui.css"); vp._resources.services.page.push("vp/base/web/libs/layer/layui-v2.6.8/layui/layui.js"); vp._resources.services.page.push("vp/base/web/services/page.js"); vp._atServices.push("page"); // summernote(自动加载) vp._resources.services.summernote = []; // vp._resources.services.summernote.push("vp/base/web/libs/summernote/summernote.min.js"); // vp._resources.services.summernote.push("vp/base/web/libs/summernote/summernote-zh-CN.js"); // vp._resources.services.summernote.push("vp/base/web/libs/summernote/summernote.css"); vp._resources.services.summernote.push("vp/base/web/libs/summernoteUpdate/summernote.min.js"); vp._resources.services.summernote.push("vp/base/web/libs/summernoteUpdate/lang/summernote-zh-CN.min.js"); vp._resources.services.summernote.push("vp/base/web/libs/summernoteUpdate/summernote.css"); // pagination(自动加载) vp._resources.services.pagination = []; vp._resources.services.pagination.push("vp/base/web/services/pagination.js"); vp._atServices.push("pagination"); // key(自动加载) vp._resources.services.key = []; vp._resources.services.key.push("vp/base/web/services/key.js"); vp._atServices.push("key"); // api(自动加载) vp._resources.services.api = []; vp._resources.services.api.push("vp/base/web/services/api.js"); vp._resources.services.api.push("vp/base/web/services/apiLoading.css"); vp._atServices.push("api"); // msg(自动加载) vp._resources.services.msg = []; // vp._resources.services.msg.push("vp/base/web/libs/pnotify/animate.css"); // vp._resources.services.msg.push("vp/base/web/libs/pnotify/pnotify.full.min.css"); // vp._resources.services.msg.push("vp/base/web/libs/pnotify/pnotify.full.min.js"); vp._resources.services.msg.push("vp/base/web/customPlugin/message/message.js"); vp._resources.services.msg.push("vp/base/web/customPlugin/message/message.css"); vp._resources.services.msg.push("vp/base/web/services/msg.js"); vp._atServices.push("msg"); // socket(auto loading) vp._resources.services.socket = []; vp._resources.services.socket.push("vp/base/web/libs/socketio/socketio.js"); vp._atServices.push("socket"); // utils(自动加载) vp._resources.services.utils = []; vp._resources.services.key.push("vp/base/web/services/utils.js"); vp._atServices.push("utils"); // loading(自动加载) vp._resources.services.loading = []; vp._resources.services.loading.push("vp/base/web/services/loading.js"); vp._atServices.push("loading"); // cookie(手动加载) vp._resources.services.cookie = []; vp._resources.services.cookie.push("vp/base/web/services/cookie.js"); vp._resources.services.cookie.push("vp/base/web/libs/CryptoJS/aes.js"); // file(手动加载) vp._resources.services.file = []; vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/css/jquery.fileupload.css"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/js/jquery.iframe-transport.js"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/js/vendor/jquery.ui.widget.js"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/js/jquery.fileupload.js"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/js/jquery.fileupload-process.js"); vp._resources.services.file.push("vp/base/web/libs/JavaScript-Canvas-to-Blob-master/js/canvas-to-blob.min.js"); vp._resources.services.file.push("vp/base/web/libs/JavaScript-Load-Image-master/js/load-image.all.min.js"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/compressor.min.js"); vp._resources.services.file.push("vp/base/web/libs/cropper-master/cropper.min.css"); vp._resources.services.file.push("vp/base/web/libs/cropper-master/cropper.min.js"); vp._resources.services.file.push("vp/base/web/libs/cropper-master/jquery-cropper.min.js"); // vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/iscroll-zoom-min.js"); // vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/lrz.all.bundle.js"); // vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/PhotoClip.js"); vp._resources.services.file.push("vp/base/web/libs/jQueryFileUpload/jQuery-File-Upload-9.12.5/js/jquery.fileupload-image.js"); vp._resources.services.file.push("vp/base/web/services/file.js"); // editor(手动加载) vp._resources.services.editor = []; vp._resources.services.editor.push("vp/base/web/libs/simditor/simditor-2.3.6/styles/simditor.css"); vp._resources.services.editor.push("vp/base/web/libs/simditor/simditor-2.3.6/scripts/module.min.js"); vp._resources.services.editor.push("vp/base/web/libs/simditor/simditor-2.3.6/scripts/hotkeys.min.js"); vp._resources.services.editor.push("vp/base/web/libs/simditor/simditor-2.3.6/scripts/simditor.min.js"); // date(手动加载) vp._resources.services.date = []; vp._resources.services.date.push("vp/base/web/services/date.js"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-daterangepicker-master/daterangepicker.min.css"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-daterangepicker-master/moment.js"); vp._resources.services.date.push("vp/base/web/libs/bootstrap-daterangepicker-master/daterangepicker.min.js"); // sortable (手动加载) vp._resources.services.sortable = []; vp._resources.services.sortable.push("vp/base/web/libs/jQueryUI/jQueryUISortable/jquery-ui-1.12.1.custom/jquery-ui.min.css"); vp._resources.services.sortable.push("vp/base/web/libs/jQueryUI/jQueryUISortable/jquery-ui-1.12.1.custom/jquery-ui.min.js"); // newSortable (手动加载) vp._resources.services.newSortable = []; vp._resources.services.newSortable.push("vp/base/web/libs/sortableJS/Sortable.min.js"); // caret (手动加载) vp._resources.services.caret = []; vp._resources.services.caret.push("vp/base/web/libs/jQueryCaret/jquery.caret.js"); // treeview (手动加载) vp._resources.services.treeview = []; vp._resources.services.treeview.push("vp/base/web/libs/bootstrap-treeview/bootstrap-treeview.min.js"); vp._resources.services.treeview.push("vp/base/web/libs/bootstrap-treeview/bootstrap-treeview.min.css"); // slideReveal-master (手动加载) vp._resources.services.slideRevealmaster = []; vp._resources.services.slideRevealmaster.push("vp/base/web/libs/slideReveal-master/slidereveal.js"); // animatecss3 (手动加载) vp._resources.services.animate = []; vp._resources.services.animate.push("vp/base/web/libs/animatecss3/animate.min.css"); // radialIndicator (手动加载) vp._resources.services.radialIndicator = []; vp._resources.services.radialIndicator.push("vp/base/web/libs/radialIndicator/radialIndicator.min.js"); // bsPagination (手动加载) vp._resources.services.bsPagination = []; vp._resources.services.bsPagination.push("vp/base/web/services/bsPagination.js"); vp._resources.services.bsPagination.push("vp/base/web/libs/bs_pagination-master/jquery.bs_pagination.min.css"); vp._resources.services.bsPagination.push("vp/base/web/libs/bs_pagination-master/jquery.bs_pagination.min.js"); vp._resources.services.bsPagination.push("vp/base/web/libs/bs_pagination-master/localization/en.min.js"); // bootstrapPaginator (手动加载) vp._resources.services.bootstrapPaginator = []; vp._resources.services.bootstrapPaginator.push("vp/base/web/services/bootstrapPaginator.js"); vp._resources.services.bootstrapPaginator.push("vp/base/web/libs/bootstrap-paginator-master/src/bootstrap-paginator.js"); // bootstrapSwitch (手动加载) vp._resources.services.bootstrapSwitch = []; vp._resources.services.bootstrapSwitch.push("vp/base/web/libs/bootstrap-switch/bootstrap-switch-3.3.4/bootstrap-switch.min.js"); vp._resources.services.bootstrapSwitch.push("vp/base/web/libs/bootstrap-switch/bootstrap-switch-3.3.4/bootstrap-switch.min.css"); vp._atServices.push("bootstrapSwitch"); /* * // zclip (手动加载) vp._resources.services.zclip = []; * vp._resources.services.zclip.push("vp/base/web/libs/jquery-zclip-1.1.5/jquery.zclip.js"); * vp._resources.services.zclip.push("vp/base/web/libs/jquery/jquery-1.12.4.min.js"); */ // clipboard (手动加载) vp._resources.services.clipboard = []; vp._resources.services.clipboard.push("vp/base/web/libs/clipboard.js-master/dist/clipboard.min.js"); vp._resources.services.clipboard.push("vp/base/web/libs/clipboard.js-master/dist/clipboard.js"); // calendar (手动加载) vp._resources.services.calendar = []; vp._resources.services.calendar.push("vp/base/web/libs/bootstrap-calendar/bootstrap-calendar-v3/js/language/zh-CN.js"); vp._resources.services.calendar.push("vp/base/web/libs/bootstrap-calendar/bootstrap-calendar-v3/js/underscore-min.js"); vp._resources.services.calendar.push("vp/base/web/libs/bootstrap-calendar/bootstrap-calendar-v3/js/calendar.js"); vp._resources.services.calendar.push("vp/base/web/libs/bootstrap-calendar/bootstrap-calendar-v3/css/calendar.css"); // gantt (手动加载) vp._resources.services.gantt_6 = []; vp._resources.services.gantt_6.push("vp/base/web/libs/gantt/dhtmlxgantt.js"); vp._resources.services.gantt_6.push("vp/base/web/libs/gantt/dhtmlxgantt_fullscreen.js"); vp._resources.services.gantt_6.push("vp/base/web/libs/gantt/dhtmlxgantt_marker.js"); vp._resources.services.gantt_6.push("vp/base/web/libs/gantt/dhtmlxgantt_tooltip.js"); vp._resources.services.gantt_6.push("vp/base/web/libs/gantt/dhtmlxgantt.css"); // gantt_7 (手动加载) vp._resources.services.gantt = []; vp._resources.services.gantt.push("vp/base/web/libs/gantt/dhtmlxgantt.8.js"); // vp._resources.services.gantt.push("vp/base/web/libs/gantt/dhtmlxgantt_fullscreen.js"); // vp._resources.services.gantt.push("vp/base/web/libs/gantt/dhtmlxgantt_marker.js"); // vp._resources.services.gantt.push("vp/base/web/libs/gantt/dhtmlxgantt_tooltip.js"); vp._resources.services.gantt.push("vp/base/web/libs/gantt/dhtmlxgantt_material.8.css"); // dhtmlxTreeGrid (手动加载) vp._resources.services.dhtmlxTreeGrid = []; vp._resources.services.dhtmlxTreeGrid.push("vp/base/web/libs/dhtmlxTreeGrid/treegrid.js"); vp._resources.services.dhtmlxTreeGrid.push("vp/base/web/libs/dhtmlxTreeGrid/treegrid.css"); // projectMember vp._resources.services.projectMember = []; vp._resources.services.projectMember.push("vp/base/web/customPlugin/projectMemberList/projectMemberLists.js"); // taskFilterComponents (手动加载) vp._resources.services.taskFilterComponents = []; vp._resources.services.taskFilterComponents.push("vp/base/web/customPlugin/taskFilterComponent/taskFilterComponent.js"); // taskFilterComponents2 (手动加载) vp._resources.services.taskFilterComponent2 = []; vp._resources.services.taskFilterComponent2.push("vp/base/web/customPlugin/taskFilterComponent2/taskFilterComponent.js"); // taskFilterComponents2 (手动加载) vp._resources.services.FilterConditionComponent = []; vp._resources.services.FilterConditionComponent.push("vp/base/web/customPlugin/FilterConditionComponent/FilterConditionComponent.js"); // steps (手动加载) vp._resources.services.steps = []; vp._resources.services.steps.push("vp/base/web/customPlugin/stepsComponent/steps.js"); vp._resources.services.steps.push("vp/base/web/customPlugin/stepsComponent/steps.css"); // input-number (手动加载) vp._resources.services.inputNumber = []; vp._resources.services.inputNumber.push("vp/base/web/customPlugin/inputNumber/inputNumber.js"); vp._resources.services.inputNumber.push("vp/base/web/customPlugin/inputNumber/inputNumber.css"); // bootstrapTable (手动加载) vp._resources.services.bootstrapTable = []; vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/bootstrap-table.css"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/bootstrap-table.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/bootstrap-table-zh-CN.min.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/bootstrap-table-reorder-rows.css"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable//bootstraptable-treeview.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/bootstrap-table-reorder-rows.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/jquery.tablednd.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/fixed-cloumns.js"); vp._resources.services.bootstrapTable.push("vp/base/web/libs/bootstrapTable/fixed-cloumns.css"); // 内置服务 vp.services.uuid = { gen: function () { var S4 = function () { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4()); } } /** * vp资源初始化 */ vp.ready = function (p1, p2, p3) { var requireRes = []; var onReady = null; if (p2) { requireRes = ((p1 instanceof Array) ? p1 : [p1]); onReady = p2; } else if (p1) { requireRes = []; onReady = p1; } // 加载基础资源 var res = (vp._isReady ? [] : vp._resources.base); // 追加自动加载、指定加载的服务资源 if (!vp._isReady) { vp._rid = vp._rid ? vp._rid : vp.services.uuid.gen(); res = res.concat(vp.res(vp._atServices)); } res = res.concat(requireRes); for (var i = res.length - 1; i >= 0; i--) { if (vp._loadRes.indexOf(res[i]) !== -1) { //exclude repeat loading res.splice(i, 1); continue; } vp._loadRes.push(res[i]); var r = res[i]; if (r.indexOf("//") != 0) r = vp._host + r; var t = "_=" + vp._rid; r = r.indexOf("?") > 0 ? (r + "&" + t) : (r + "?" + t); res[i] = r; } head.js(res).ready(function () { if (vp._isReady === false) { $.ajaxSetup({ data: { "_": vp._rid } }); } vp._isReady = true; if ($.isFunction(onReady)) onReady(vp.services); }); } /** * 等待表达式通过后执行回调 */ vp.wait = function (evalExp, timeout, callback) { if (timeout > 0) { if (eval(evalExp)) callback(); else { setTimeout(function () { vp.wait(evalExp, timeout - 200, callback); }, 200); } } else { if (window.console && window.console.info) console.info("【vp.wait】等待表达式:\"" + evalExp + "\"超时"); } } /** * 定义、获取前台模块 */ vp.define = function (scopeId, callback) { // 如果有传callback,则为定义一个前台模块 if (callback) { var scope = vp.scope(scopeId, true); if (Object.getOwnPropertyNames(scope).length > 0) { throw new Error('this module[' + scopeId + ']Namespace already used,please rename this module!'); } callback(vp.services, scope, scopeId); } // 如果不传callback,则为获取前台模块 else { return vp.scope(scopeId); } } /** * 获取服务资源 */ vp.res = function (services) { var res = []; if (services instanceof Array) { for (var i = 0; i < services.length; i++) res = res.concat(vp._resources.services[services[i]]); } else { res = res.concat(vp._resources.services[services]); } return res; } /** * 获取、创建域 */ vp.scope = function (scope, isNamespace) { if (!vp._scope[scope] && !isNamespace) throw new Error("this scope is not define,can't be used to value:" + scope); if (!vp._scope[scope]) vp._scope[scope] = {}; return vp._scope[scope]; } /** * 显示登陆方式,可由业务模块重写 */ vp.showLogin = function () { if (vp._loginPagePath) $("body").load(vp._loginPagePath); } /** * 显示业务主页,可由业务模块重写 */ vp.showMain = function () { if (vp._mainPagePath) $("body").load(vp._mainPagePath); } /** * 显示新版vteam首页,可由业务模块重写 */ vp.showNewMain = function () { if (vp._mainNewPagePath) $("body").load(vp._mainNewPagePath); } /** * 显示微信主页,可由业务模块重写 */ vp.showWeixin = function () { if (vp._weixinPagePath) $("body").load(vp._weixinPagePath); } /** * 显示年报主页,可由业务模块重写 */ vp.showAnnualReport = function () { if (vp._annualReportPagePath) $("body").load(vp._annualReportPagePath); } /** * 显示微信主页,可由业务模块重写 */ vp.showSummary = function () { if (vp._summaryPagePath) $("body").load(vp._summaryPagePath); } vp.showDaySummary = function () { if (vp._daySummaryPagePath) $("body").load(vp._daySummaryPagePath); } vp.showAdminSummary = function () { if (vp._adminSummaryPagePath) $("body").load(vp._adminSummaryPagePath); } vp.getUrlParams = function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } window.vp = vp; } })();