123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- define(["require", "exports"], function (require2, exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- function mergeProps(target, sou1, excludes) {
- var names = Object.getOwnPropertyNames(sou1)
- for (var i = 0; i < names.length; i++) {
- if (typeof excludes === 'object') {
- if (excludes.includes(names[i])) {
- continue;
- }
- }
- target[names[i]] = sou1[names[i]];
- }
- }
- function onLoadFinish(callback) {
- if (typeof setupProcess === 'function') {
- setupProcess('A3');
- }
- // require(['axios', 'qs', 'lodash', 'json5', 'moment', 'jquery', 'yvan-ext', 'jszip', 'ClipboardJS'], function (axios, qs, lodash, json5, moment, jquery, YvanUI, jszip, ClipboardJS) {
- // 'lodash', 'jquery', 'axios', 'qs',
- require(['json5', 'moment', 'yvan-ext', 'jszip', 'ClipboardJS'], function (json5, moment, YvanUI, jszip, ClipboardJS) {
- window['axios'] = YvanUI.axios;
- window['qs'] = YvanUI.qs;
- window['_'] = YvanUI.lodash;
- window['lodash'] = YvanUI.lodash;
- window['json5'] = json5;
- window['moment'] = moment;
- window['$'] = YvanUI.jquery;
- window['jquery'] = YvanUI.jquery;
- window['jQuery'] = YvanUI.jquery;
- window['jszip'] = jszip;
- window['JSZip'] = jszip;
- window['ClipboardJS'] = ClipboardJS;
- window["time_offset"] = 0;
- var getServerTime = function () {
- return Number(new Date()) + window["time_offset"];
- };
- window['getServerTime'] = getServerTime;
- YvanUI['getServerTime'] = getServerTime;
- function syncTime() {
- try {
- jquery.get("/time", {t1: Number(new Date())}, function (data) {
- data = data.data;
- var t1 = Number(data.t1); // 客户端时间(请求前)
- var t2 = Number(data.t2); // 数据库时间
- var t3 = Number(data.t3); // 数据库时间 + 查询时间
- var t4 = Number(new Date()); // 客户端时间(请求后)
- window["time_offset"] = ((t2 - t1) + (t3 - t4)) / 2;
- console.log("time_offset --> ", window["time_offset"]);
- });
- } catch (e) {
- console.log("时间同步失败", e);
- }
- }
- syncTime();
- require(['yvan-ext'], function (YvanUI, Sortable) {
- if (typeof setupProcess === 'function') {
- setupProcess('A4');
- }
- window['Sortable'] = Sortable;
- window['YvanUI'] = YvanUI;
- if (window.localStorage.getItem("dark-mode") && window.location.search !== '?design=true') {
- // 黑色
- require(['css!/node_modules/yvan-ext/dist/dark.css'], function () {
- })
- }
- callback();
- })
- })
- };
- exports.onLoadFinish = onLoadFinish;
- function config(customConfig) {
- var cfg = {
- paths: {
- '@': '/dist',
- 'axios': '/assets/axios/axios.min',
- 'qs': '/assets/qs/qs.min',
- 'jquery': '/assets/jquery/jquery-1.11.1.min',
- 'lodash': '/assets/lodash/lodash.min',
- 'json5': '/assets/json5/json5.min',
- 'moment': '/assets/moment/moment.min',
- 'recast': '/assets/recast/recast',
- 'lay-excel': '/assets/layui-excel/excel',
- 'xlsx': '/assets/xlsx/xlsx.full.min',
- 'modeler': '/assets/bpmn-js/dist/bpmn-modeler.development',
- 'bpmn-js-properties-panel': '/assets/bpmn-js-properties-panel/dist/bpmn-js-properties-panel.umd',
- 'bpmn-modeler': '/assets/bpmn-js/dist/bpmn-modeler.production.min',
- 'bpmn-navigated': '/assets/bpmn-js/dist/bpmn-navigated-viewer.production.min',
- 'bpmn-viewer': '/assets/bpmn-js/dist/bpmn-viewer.production.min',
- 'viewer': '/assets/viewer/viewer',
- 'polyfill': '/assets/polyfill/polyfill.min',
- 'es6-promise': '/assets/polyfill/es6-promise.auto.min',
- 'tslib': '/assets/tslib/tslib',
- 'jqueryCookie': '/assets/jquery/jquery.cookie',
- 'jszip': '/assets/jszip/jszip.min',
- 'vs': '/assets/monaco-editor/min/vs',
- 'node-sql-parser': '/assets/sql/postgresql.umd',
- 'sql-formatter': '/assets/sql-formatter/sql-formatter.min',
- 'ClipboardJS': '/assets/clipboard/clipboard.min',
- 'localforage': '/assets/localForage/localforage.min',
- 'socket.io-client': '/assets/socket.io/socket.io',
- 'xterm': '/assets/xterm/xterm.min',
- 'xterm-addon-fit': '/assets/xterm/xterm-addon-fit',
- 'handlebars': '/assets/handlebars/handlebars.amd',
- 'sanitizer': '/assets/mxgraph-editor/sanitizer/sanitizer.min',
- 'pako': '/assets/mxgraph-editor/deflate/pako.min',
- 'mxgraphInit': '/assets/mxgraph-editor/js/Init',
- 'mxgraphBase64': '/assets/mxgraph-editor/deflate/base64',
- 'mxgraphJscolor': '/assets/mxgraph-editor/jscolor/jscolor',
- 'mxgraphClient': '/assets/mxgraph/js/mxClient',
- 'mxgraphEditorUi': '/assets/mxgraph-editor/js/EditorUi',
- 'mxgraphEditor': '/assets/mxgraph-editor/js/Editor',
- 'mxgraphSidebar': '/assets/mxgraph-editor/js/Sidebar',
- 'mxgraphGraph': '/assets/mxgraph-editor/js/Graph',
- 'mxgraphFormat': '/assets/mxgraph-editor/js/Format',
- 'mxgraphShapes': '/assets/mxgraph-editor/js/Shapes',
- 'mxgraphActions': '/assets/mxgraph-editor/js/Actions',
- 'mxgraphMenus': '/assets/mxgraph-editor/js/Menus',
- 'mxgraphToolbar': '/assets/mxgraph-editor/js/Toolbar',
- 'mxgraphDialogs': '/assets/mxgraph-editor/js/Dialogs',
- 'mxgraph': '/assets/mxgraph/fix',
- },
- map: {
- '*': {
- css: '/assets/require-css/css.min.js'
- },
- },
- shim: {
- 'yvan-ext': {
- deps: [
- 'css!/node_modules/yvan-ext/dist/yvan-ext.css',
- // 'polyfill',
- 'es6-promise',
- 'axios',
- 'qs',
- 'lodash',
- 'json5',
- 'moment',
- 'jquery',
- 'jqueryCookie'
- ]
- },
- 'jqueryCookie': {
- deps: [
- 'jquery'
- ]
- },
- 'modeler': {
- deps: [
- 'css!/assets/bpmn-js/dist/assets/diagram-js.css',
- 'css!/assets/bpmn-js/dist/assets/bpmn-font/css/bpmn.css',
- 'css!/assets/bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css',
- 'css!/assets/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css',
- 'css!/assets/bpmn-js-properties-panel/dist/assets/properties-panel.css',
- 'css!/assets/bpmn-js-properties-panel/dist/assets/element-templates.css'
- ]
- },
- 'xterm': {
- deps: [
- 'css!/assets/xterm/xterm.css'
- ]
- },
- 'mxgraphClient': {
- deps: [
- 'mxgraphInit',
- 'pako',
- 'mxgraphBase64',
- 'mxgraphJscolor',
- 'sanitizer'
- ]
- },
- 'mxgraphEditorUi': {
- deps: [
- 'mxgraphClient'
- ]
- },
- 'mxgraphEditor': {
- deps: [
- 'mxgraphEditorUi'
- ]
- },
- 'mxgraphSidebar': {
- deps: [
- 'mxgraphEditor'
- ]
- },
- 'mxgraphGraph': {
- deps: [
- 'mxgraphSidebar'
- ]
- },
- 'mxgraphFormat': {
- deps: [
- 'mxgraphGraph'
- ]
- },
- 'mxgraphShapes': {
- deps: [
- 'mxgraphFormat'
- ]
- },
- 'mxgraphActions': {
- deps: [
- 'mxgraphShapes'
- ]
- },
- 'mxgraphMenus': {
- deps: [
- 'mxgraphActions'
- ]
- },
- 'mxgraphToolbar': {
- deps: [
- 'mxgraphMenus'
- ]
- },
- 'mxgraphDialogs': {
- deps: [
- 'mxgraphToolbar'
- ]
- },
- 'mxgraph': {
- deps: [
- 'css!/assets/mxgraph-editor/styles/grapheditor.css',
- 'css!/assets/mxgraph/fix.css',
- 'mxgraphDialogs'
- ]
- },
- },
- 'vs/nls': {
- availableLanguages: {'*': 'zh-cn'}
- },
- };
- window.mxBasePath = '/assets/mxgraph/src';
- window.mxLanguage = '';
- window.IMAGE_PATH = '/assets/mxgraph/images';
- window.STENCIL_PATH = '/static/mxgraph/stencils';
- window.urlParams = (function (url) {
- var result = new Object();
- var idx = url.lastIndexOf('?');
- if (idx > 0) {
- var params = url.substring(idx + 1).split('&');
- for (var i = 0; i < params.length; i++) {
- idx = params[i].indexOf('=');
- if (idx > 0) {
- result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
- }
- }
- }
- return result;
- })(window.location.href);
- if (typeof customConfig === 'object') {
- mergeProps(cfg, customConfig, ['paths', 'map', 'shim', 'vs/nls']);
- if (typeof customConfig.paths === 'object') {
- mergeProps(cfg.paths, customConfig.paths);
- }
- if (typeof customConfig.map === 'object') {
- mergeProps(cfg.map, customConfig.map);
- }
- if (typeof customConfig.shim === 'object') {
- mergeProps(cfg.shim, customConfig.shim);
- }
- if (typeof customConfig['vs/nls'] === 'object') {
- mergeProps(cfg['vs/nls'], customConfig['vs/nls']);
- }
- }
- require.config(cfg);
- };
- exports.config = config;
- })
|