micro.js 21.6 KB
Newer Older
杨思琦's avatar
杨思琦 committed
1 2
/* eslint-disable no-useless-escape */
/* eslint-disable prettier/prettier */
3
import '@wisdom-utils/utils/lib/logger';
邓晓峰's avatar
邓晓峰 committed
4
import _ from 'lodash';
邓晓峰's avatar
邓晓峰 committed
5
import {
lihonglin's avatar
lihonglin committed
6 7
  addGlobalUncaughtErrorHandler,
  runAfterFirstMounted,
杨思琦's avatar
杨思琦 committed
8
  registerMicroApps,
lihonglin's avatar
lihonglin committed
9
  setDefaultMountApp,
杨思琦's avatar
杨思琦 committed
10 11
  loadMicroApp,
  prefetchApps,
lihonglin's avatar
lihonglin committed
12
  start,
邓晓峰's avatar
邓晓峰 committed
13
} from 'qiankun';
邓晓峰's avatar
邓晓峰 committed
14
import { event, store as microStore } from '@wisdom-utils/utils';
邓晓峰's avatar
邓晓峰 committed
15
import { string } from '@wisdom-utils/utils/lib/helpers';
16
import micorConfig, { genActiveRule } from '../config/micor';
17
import { actionCreators } from './containers/App/store';
18 19
import loader from './render';
import store from './stores';
20
import actions from './actions';
邓晓峰's avatar
邓晓峰 committed
21
const xss = require('xss');
邓晓峰's avatar
邓晓峰 committed
22 23
// eslint-disable-next-line import/named
const { processComponentName } = string;
邓晓峰's avatar
邓晓峰 committed
24 25
// eslint-disable-next-line no-undef
const Logger = logger('micro');
杨思琦's avatar
杨思琦 committed
26 27 28 29 30 31 32 33 34
let micorManager = [];
let web4Load = false;
export const Configuration = {
  sandbox: {
    experimentalStyleIsolation: false,
    loose: true,
  },
  singular: false,
  scopedCSS: true,
杨思琦's avatar
杨思琦 committed
35
  prefetch: true,
杨思琦's avatar
杨思琦 committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
  getTemplate(tpl) {
    return tpl.replace(
      '<script language="javascript">setURL("18.10.10.253");supFlash(getVersion("td_cookie"));</script>',
      '',
    );
  },
  async fetch(url, ...args) {
    if (url.indexOf('cookie/flash.js') > -1) {
      return {
        async text() {
          return '';
        },
      };
    }
    return window.fetch(url, ...args);
  },
  // eslint-disable-next-line no-underscore-dangle
  excludeAssetFilter: url =>
    url.indexOf('framework/highcharts') !== -1 ||
    // url.indexOf('framework/amap/AMap.UI') !== -1 ||
    // url.indexOf('framework/4.9/init.js') !== -1 ||
    url.indexOf('DataPresentation.js') !== -1 ||
    url.indexOf('jquery-mousewheel-easyui-qrcode-cookie-resize-filesaver-fisheye-dateFormat-gridify.js') !== -1 ||
    url.indexOf('jquery') !== -1 ||
    url.indexOf('components/filetools/xlsx.core.min') !== -1 ||
    url.indexOf('managers/MapManager.js') !== -1 ||
    url.indexOf('jquery.mCustomScrollbar.js') !== -1 ||
    url.indexOf('QIAN_KUN_Platform.js') !== -1 ||
    url.indexOf('configuration/js') !== -1 ||
    url.indexOf('framework/three.js') !== -1 ||
    url.indexOf('threedimensional/frameworkthree') !== -1 ||
    url.indexOf('iframe/Civ3DLLab/js') !== -1 ||
    url.indexOf('framework/jquery/gridify-min.js') !== -1 ||
    url.indexOf('framework/jquery/gridify.qrcode.js') !== -1 ||
    url.indexOf('framework/application/Platform.js') !== -1 ||
    url.indexOf('webgisPanda/AMapTool') !== -1 ||
    url.indexOf('framework/underscore') !== -1 ||
    url.indexOf('echarts') !== -1 ||
    url.indexOf('lbs.amap.com') !== -1 ||
    url.indexOf('restapi.amap.com') !== -1 ||
    url.indexOf('webapi.amap.com') !== -1 ||
    url.indexOf('webapi.amap.com/count') !== -1 ||
    url.indexOf('webapi.amap.com/maps') !== -1 ||
    url.indexOf('restapi.amap.com/v3') !== -1 ||
    url.indexOf('api.map.baidu.com') !== -1 ||
    url.indexOf('map.baidu.com') !== -1 ||
    url.indexOf('pv.sohu.com') !== -1 ||
    url.indexOf('mt0.google.cn') !== -1 ||
    url.indexOf('mt1.google.cn') !== -1 ||
    url.indexOf('mt2.google.cn') !== -1 ||
    url.indexOf('mt3.google.cn') !== -1 ||
    url.indexOf('hm.baidu.com') !== -1 ||
    url.indexOf('framework/antv/antvL7.min.js') !== -1 ||
    url.indexOf('https://maponline0.bdimg.com') !== -1 ||
    url.indexOf('https://maponline1.bdimg.com') !== -1 ||
    url.indexOf('https://maponline2.bdimg.com') !== -1 ||
    url.indexOf('https://maponline3.bdimg.com') !== -1 ||
    url.indexOf('https://api.map.baidu.com/getscript') !== -1 ||
    url.indexOf('dlswbr.baidu.com') !== -1 ||
    url.indexOf('maponline0.bdimg.com') !== -1 ||
杨思琦's avatar
杨思琦 committed
96
    url.indexOf('miao.baidu.com') !== -1 ||
杨思琦's avatar
杨思琦 committed
97 98
    url.indexOf('build.loader.js') !== -1 ||
    url.indexOf('blob:') !== -1,
杨思琦's avatar
杨思琦 committed
99
};
100

杨思琦's avatar
杨思琦 committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
export const LifeCycle = {
  beforeLoad: [
    app => {
      store.dispatch(actionCreators.updateMicroMounted(true));
      Logger.info('[LifeCycle] before load %c%s', app);
    },
  ],
  beforeMount: [
    app => {
      microStore.off('event:globalConfig', () => {});
      Logger.info(`[LifeCycle] before mount %c%s ${app.name}`, app);
    },
  ],
  afterMount: [
    app => {
      store.dispatch(actionCreators.updateMicroMounted(false));
      Logger.info(`[LifeCycle] after mount %c%s ${app.name}`, app);
    },
  ],
  beforeUnmount: [
    app => {
      window.share.event.removeAllListeners('changeRoute');
      Logger.info(`[LifeCycle]  beforeUnmount %c%s ${app.name}`, app);
      // window.globalConfig = {}
      // createStoreage.remove(`__PANDA_STORE__${location.hostname}`)
    },
  ],
  afterUnmount: [
    app => {
      actions.offGlobalStateChange();
      Logger.info(`[LifeCycle] after unmount %c%s ${app.name}`, app);
    },
  ],
};
135

杨思琦's avatar
杨思琦 committed
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
const microPackage = {
  civ_water:['react-file-viewer', 'ezuikit-js'],
  civ_webgis: ['react-file-viewer', 'xlsx'],
  civ_ai: ['react-file-viewer', 'ezuikit-js'],
  civ_monitor: ['react-file-viewer', 'ezuikit-js', 'xlsx'],
  civ_drainage: ['react-file-viewer', 'ezuikit-js', 'xlsx'],
  civ_workflow: ['react-file-viewer', 'xlsx'],
  civ_3d: ['react-file-viewer', 'ezuikit-js', 'xlsx'],
  civ_iot: ['xlsx'],
  civ_wisdomfactory: ['ezuikit-js'],
  civ_vms: ['ezuikit-js'],
  civ_customize: ['react-file-viewer', 'xlsx'],
  civ_assetmanage: [],
  civ_middleground: [],
  civ_energy: [],
杨思琦's avatar
杨思琦 committed
151
  civ_hydrology: ['react-file-viewer', 'ezuikit-js', 'xlsx']
杨思琦's avatar
杨思琦 committed
152 153 154 155 156 157 158 159
}

const extraPackage = {
  'react-file-viewer': { require: require.context('../node_modules/react-file-viewer/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), entry: 'index.js' },
  'ezuikit-js': { require: require.context('../node_modules/ezuikit-js', true, /^.\/ezuikit\.js$/), entry: 'ezuikit.js' },
  'xlsx': { require: require.context('../node_modules/xlsx', true, /^.\/xlsx\.js$/), entry: 'xlsx.js' },
}

杨思琦's avatar
杨思琦 committed
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
export const application = global => {
  const config = global || window.globalConfig || {};
  const applications = (config && config.products) || [];
  const products = [];
  applications &&
    Array.isArray(applications) &&
    applications.length > 0 &&
    applications.map(item => {
      if (item.PackageName === 'report') {
        products.push({
          name: item.PackageName,
          entry: item.RouteUrl,
          container: '#micro-container',
          activeRule: genActiveRule(`/civbase/${item.PackageName}`),
          props: {
            ...item.DefaultSetting,
            routerBase: item.PackageName,
            event,
            store: microStore,
          },
        });
      } else {
        products.push({
          name: item.PackageName,
          entry: `${window.location.protocol}//${window.location.host}/${item.PackageName}`,
          container: '#micro-container',
          activeRule: genActiveRule(`/civbase/${item.PackageName}`),
          props: {
            ...item.DefaultSetting,
            routerBase: item.PackageName,
            event,
            store: microStore,
          },
        });
      }
    });
杨思琦's avatar
杨思琦 committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
  const workflow = products.filter(item => item.name === 'civ_workflow');
  if (workflow.length === 0) {
    products.push({
      name: 'civ_workflow',
      noPrefetch: true,
      entry: `${window.location.protocol}//${window.location.host}/civ_workflow`,
      container: '#micro-container',
      activeRule: genActiveRule('/civbase/civ_workflow'),
      props: {
        routerBase: 'civ_workflow',
        event,
        store: microStore,
      },
    });
  }
杨思琦's avatar
杨思琦 committed
211
  const entrys = process.env.NODE_ENV !== 'production' ? micorConfig.dev : products;
212

杨思琦's avatar
杨思琦 committed
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
  const apps = entrys.map(item => ({
    ...item,
    props: {
      emitter: window.share.event,
      baseRoot: item.name,
      event,
      store: microStore,
      // eslint-disable-next-line prettier/prettier
      globalConfig: /civweb4/.test(item.name) ? Object.assign({}, config, {homepage: config.homepage ? config.homepage.replace(/civweb\//, '') : config.homepage,}) : config,
      // createStoreage.get('globalConfig'),
      XMLHttpRequest: window.XMLHttpRequest,
      // offGlobalStateChange: actions.offGlobalStateChange
    },
    loader,
  }));
228

杨思琦's avatar
杨思琦 committed
229 230
  return apps;
};
231

杨思琦's avatar
杨思琦 committed
232 233
export const initSaveMicroApps = (pathName = '', global) => {
  /* eslint-disable */
234
  event.emit('loading', false);
杨思琦's avatar
杨思琦 committed
235 236 237 238 239 240
  const microApps = application(global);
  microApps.map(app => {
    if(pathName.indexOf(app.name) > -1 && microPackage[app.name] && microPackage[app.name].map) {
      loadMicroPackage(app.name);
    }
  });
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
  setTimeout(() => {
    pathName.indexOf('civbase/civ_base') > -1 && event.emit('loading', false)
    const micro = microApps.filter(app => !/civweb4/.test(app.name)) ?? [];
    if(/civweb4/.test(pathName) && !web4Load) {
      event.emit("initweb", true);
      loadMicroApps(micro, pathName);
      web4Load = true;
    } else {
      const target = micorManager.slice(-1)[0] ?? null;
      if(!target || pathName.indexOf(target.name) == -1) {
        const microApp = microApps.filter(app => pathName.indexOf(app.name) > -1)[0] ?? null;
        if(microApp) micorManager.push({
          ...loadMicroApp(microApp, Configuration, LifeCycle), 
          name: microApp?.name, 
          store: microApp?.props?.store
        })
257
      }
258 259
    }
  })
杨思琦's avatar
杨思琦 committed
260
};
261

杨思琦's avatar
杨思琦 committed
262 263 264 265 266 267 268 269
export const loadMicroApps = (apps, pathName) => {
  const micro = apps.shift();
  const filter = micorManager.filter(mic => typeof(micro.name) === 'string' && micro.name.indexOf(mic.name) >= 0) ?? []
  if(filter.length === 0) {
    micorManager.push({
      ...loadMicroApp(micro, Configuration, LifeCycle).mountPromise.then(() => {
        if(apps.length > 0) {
          loadMicroApps(apps, pathName);
杨思琦's avatar
杨思琦 committed
270 271 272 273 274 275
        } else {
          event.emit("finishInitWeb", pathName);
        }
      }).catch(error => {
        if(apps.length > 0) {
          loadMicroApps(apps, pathName);
杨思琦's avatar
杨思琦 committed
276 277 278 279 280 281 282 283 284 285 286 287
        } else {
          event.emit("finishInitWeb", pathName);
        }
      }), 
      name: micro?.name, 
      store: micro?.props?.store
    })
  } else if(apps.length === 0) {
    event.emit("finishInitWeb", pathName);
  } else {
    loadMicroApps(apps, pathName);
  }
杨思琦's avatar
杨思琦 committed
288 289 290 291 292 293 294 295 296 297 298 299 300
}

const loadMicroPackage = (name) => {
  require.ensure([], () => {
    microPackage[name].map((item) => {
      const microPkg = extraPackage[item];
      if(microPkg) {
        window.app.define(item, microPkg.require, microPkg.entry);
        delete extraPackage[item];
      }
    })
  })
}
杨思琦's avatar
杨思琦 committed
301

杨思琦's avatar
杨思琦 committed
302 303 304
export const initMicroApps = (url) => {
  if(!window.qiankunStarted) {
    // /* eslint-disable */
邓晓峰's avatar
邓晓峰 committed
305
    const globalStore = store.getState().toJS();
邓晓峰's avatar
邓晓峰 committed
306
    const globalConfig = window.globalConfig;
邓晓峰's avatar
邓晓峰 committed
307
    microStore.set("event:globalConfig", {
杨思琦's avatar
杨思琦 committed
308 309
      globalConfig: globalConfig,
      global: globalStore.globalf
邓晓峰's avatar
邓晓峰 committed
310
    });
杨思琦's avatar
杨思琦 committed
311
    const microApps = application();
杨思琦's avatar
杨思琦 committed
312 313 314 315
    const micro = microApps.filter(app => {
      if(url.indexOf(app.name) > -1 && microPackage[app.name] && microPackage[app.name].map) {
        loadMicroPackage(app.name);
      }
张瑶's avatar
张瑶 committed
316
      return !/civweb4/.test(app.name) && url.indexOf(app.name) < 0 && ['civ_water', 'civ_webgis', 'civ_monitor', 'civ_workflow', 'civ_customize'].indexOf(app.name) > -1 && !app.noPrefetch
杨思琦's avatar
杨思琦 committed
317
    }) ?? [];
杨思琦's avatar
杨思琦 committed
318 319
    if(window?.qiankunIsCache){
      microStore.on("event:dropCache", (() => {
周宏民's avatar
周宏民 committed
320
        micorManager &&  micorManager.map((micro) => {
321
          micro.unmount && micro.unmount();
杨思琦's avatar
杨思琦 committed
322
          micro = null;
杨思琦's avatar
杨思琦 committed
323
        })
杨思琦's avatar
杨思琦 committed
324
        micorManager = null;
杨思琦's avatar
杨思琦 committed
325 326
      }));
      window.qiankunStarted = true;
杨思琦's avatar
杨思琦 committed
327
      initSaveMicroApps(url);
杨思琦's avatar
杨思琦 committed
328
      start(Configuration);
杨思琦's avatar
杨思琦 committed
329
      const initAfterMounted = () => {
330
        window.parent && window.parent.postMessage({ type: 'runAfterFirstMounted' }, '*');
杨思琦's avatar
杨思琦 committed
331
        event.emit('loading', false);
邓晓峰's avatar
邓晓峰 committed
332
        Logger.info('[MainApp] first app mounted');
杨思琦's avatar
杨思琦 committed
333 334 335 336 337 338 339 340 341 342 343 344
      }
      if(url.indexOf('civbase/civ_base') > -1) {
        initAfterMounted();
        prefetchApps(micro);
      } else {
        runAfterFirstMounted(() => {
          initAfterMounted();
          setTimeout(() => {
            prefetchApps(micro);
          }, 5000)
        });
      }
杨思琦's avatar
杨思琦 committed
345
      addGlobalUncaughtErrorHandler(event => {
邓晓峰's avatar
邓晓峰 committed
346
        console.log(event);
杨思琦's avatar
杨思琦 committed
347 348 349 350 351
      });
    } else {
      window.qiankunStarted = true;
      registerMicroApps(microApps, LifeCycle);
      start(Configuration);
杨思琦's avatar
杨思琦 committed
352
      const initAfterMounted = () => {
杨思琦's avatar
杨思琦 committed
353 354 355 356 357
        micro.forEach((app) => {
          if(microPackage[app.name] && microPackage[app.name].map) {
            loadMicroPackage(app.name);
          }
        })
358 359
        window.parent && window.parent.postMessage({ type: 'runAfterFirstMounted' }, '*');
        event.emit('loading', false);
杨思琦's avatar
杨思琦 committed
360 361 362 363 364 365 366 367 368 369 370
        Logger.info('[MainApp]first app mounted');
      }
      if(url.indexOf('civbase/civ_base') > -1) {
        setTimeout(() => {
          initAfterMounted();
        })
      } else {
        runAfterFirstMounted(() => {
          initAfterMounted();
        });
      }
杨思琦's avatar
杨思琦 committed
371 372 373 374 375
      addGlobalUncaughtErrorHandler(event => {
        console.log(event);
      });
    }
  }
邓晓峰's avatar
邓晓峰 committed
376 377
};

杨思琦's avatar
杨思琦 committed
378 379 380 381 382 383 384 385 386 387 388 389
export const findMenuPath = widgets => {
  if (widgets && widgets.length > 0) {
    return widgets.map(item => {
      if (item.url && item.product) {
        return `${item.product}/${item.url}`;
      }
      return findMenuPath(item.widgets);
    })[0];
  }
  return '';
};

390
export const defaultApp = (setUrl) => {
邓晓峰's avatar
邓晓峰 committed
391
    // eslint-disable-next-line no-undef
邓晓峰's avatar
邓晓峰 committed
392
    const config = window.globalConfig;
邓晓峰's avatar
邓晓峰 committed
393
    if (config && config.token) {
394
        let url = !config.home ?
395
        ((!config.homepage || _.isNull(config.homepage)) ? `/civbase/civweb4`: (`/civbase/${config.homepage.replace(/^\//, '')}`)) :  `/civbase/${config.homepage.replace(/^\//, '')}`;
杨思琦's avatar
杨思琦 committed
396 397 398 399
        if(/civweb4/.test(setUrl || url)) {
          window.qiankunIsCache = false;
          console.log("请升级首页功能");
        }
杨思琦's avatar
杨思琦 committed
400
        initMicroApps(setUrl || url);
401
        setDefaultMountApp(setUrl || url);
杨思琦's avatar
杨思琦 committed
402
        micorManager = [];
403
        window.share.event.emit('visible', setUrl || url);
邓晓峰's avatar
邓晓峰 committed
404
    }
邓晓峰's avatar
邓晓峰 committed
405
};
406 407 408 409 410 411 412 413 414 415

/**
 * window.app主要功能:
   define 定义项目的公共库,主要用来解决JS公共库的管理问题
   require 引用自己的定义的基础库,配合define来使用
   routes 用于存放全局的路由,子项目路由添加到window.app.routes,用于完成路由的注册
   init 注册入口,为子项目添加上namesapce标识,注册上子项目管理数据流的reducers
 */

window.app = {
416

邓晓峰's avatar
邓晓峰 committed
417
    modules: {},
418
    require: function (request, method) {
419

420 421
        if (request !== '.' && this.modules[request]) {
            return _.isFunction(this.modules[request]) ? this.modules[request]() : _.isFunction(this.modules[request][method]) && this.modules[request][method]();
邓晓峰's avatar
邓晓峰 committed
422
        }
423 424
        if (request === '.') {
            return
邓晓峰's avatar
邓晓峰 committed
425
        }
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
        /**
         * 特殊处理antd
         */
        if(request.indexOf('antd') > -1) {
            const modules = this.modules['antd']();
            const r = request.split('/');
            const pkg = r[2];
            if(r.length >3) {
                const m = request.split('/')
                const styles = this.modules[m.join('-')];
                if(styles) {
                    if(r[3] === 'style') {
                        return styles['index.js'] && styles['index.js']();
                    }
                    return styles[r[3]] && styles[r[3]]();
                }
                return
            }
            const componentName = processComponentName(pkg, {
                firstUpperCase: pkg === 'message' || pkg === 'notification' ? false: true
            });

            return modules[componentName];
        }

        if(request.indexOf(method) > -1) {
            request = request.replace(method, '').replace(/\//, '')
            return _.isFunction(this.modules[request]) && this.modules[request]();
        }
455
        return _.isFunction(this.modules[request]) && this.modules[request]();
邓晓峰's avatar
邓晓峰 committed
456
    },
457
    define: function (name, context, index) {
458

邓晓峰's avatar
邓晓峰 committed
459 460
        let keys = context.keys();
        for (let key of keys) {
461
            let parts = name.indexOf('@') > -1 || name == 'react/jsx-runtime' ? [name, ...(key.slice(1).split('/'))] : (name + key.slice(1)).split('/');
邓晓峰's avatar
邓晓峰 committed
462 463 464 465 466 467 468 469 470 471
            parts = parts.filter(item => item !== "");
            let dir = this.modules;
            for (let i = 0; i < parts.length - 1; i++) {
                let part = parts[i];
                if (!dir.hasOwnProperty(part)) {
                    dir[part] = {};
                }
                dir = dir[part];
            }
            dir[parts[parts.length - 1]] = context.bind(context, key);
472
        }
邓晓峰's avatar
邓晓峰 committed
473
        if (index && index !== null) {
474

邓晓峰's avatar
邓晓峰 committed
475 476 477
            this.modules[name] = this.modules[name][index];
        }
    },
478
    init: function (namespace, reducers) {
邓晓峰's avatar
邓晓峰 committed
479
        [namespace] = reducers;
480
    }
杨思琦's avatar
杨思琦 committed
481 482 483 484 485 486
};

window.app.define('react', require.context('react', true, /^.\/index\.js$/), 'index.js');
window.app.define('react/jsx-runtime', require.context('../node_modules/react', true, /^.\/jsx-runtime\.js$/), 'jsx-runtime.js');
window.app.define('react-dom', require.context('react-dom', true, /^.\/index\.js$/), 'index.js');
window.app.define('react-router', require.context('react-router', true, /^.\/index\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
487
window.app.define('lodash', require.context('lodash', true, /^.\/index\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
488 489 490
window.app.define('connected-react-router', require.context('../node_modules/connected-react-router/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('react-helmet', require.context('../node_modules/react-helmet/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'Helmet.js');
window.app.define('qrcode.react', require.context('../node_modules/qrcode.react/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
491 492
window.app.define('qr.js', require.context('qr.js', true, /^.\/index\.js$/), 'index.js');
window.app.define('query-string', require.context('query-string', true, /^.\/index\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
493 494 495 496 497 498
window.app.define('react-helmet-async', require.context('../node_modules/react-helmet-async/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('immutable', require.context('../node_modules/immutable/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), 'immutable.min.js');
window.app.define('redux-immutable', require.context('../node_modules/redux-immutable/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), 'index.js');
window.app.define('redux-logger', require.context('../node_modules/redux-logger/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), 'redux-logger.js');
window.app.define('react-router-dom', require.context('react-router-dom', true, /^.\/index\.js$/), 'index.js');
window.app.define('react-redux', require.context('../node_modules/react-redux/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), 'react-redux.min.js');
杨思琦's avatar
杨思琦 committed
499 500 501 502 503
window.app.define('redux', require.context('../node_modules/redux/dist', true, /^.\/(dist\/)?[^\/]+\.js$/), 'redux.min.js');
window.app.define('mqtt-client', require.context('../node_modules/mqtt-client/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('kit_logger', require.context('../node_modules/kit_logger/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('kit_utils', require.context('../node_modules/kit_utils/lib', true, /^.\/(lib\/)?[^\/]+\.js$/));
window.app.define('kit_global_config', require.context('../node_modules/kit_global_config/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
504
window.app.define('axios', require.context('../node_modules/axios/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'axios.js');
杨思琦's avatar
杨思琦 committed
505 506 507 508 509 510 511 512
window.app.define('js-base64', require.context('../node_modules/js-base64', true, /[^\/]+\.js$/), 'base64.js');
window.app.define('@wisdom-utils/utils', require.context('../node_modules/@wisdom-utils/utils/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-utils/runtime', require.context('../node_modules/@wisdom-utils/runtime/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');

window.app.define('@wisdom-map/amap', require.context('../node_modules/@wisdom-map/amap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-map/basemap', require.context('../node_modules/@wisdom-map/basemap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');

杨思琦's avatar
杨思琦 committed
513
window.app.define('@ant-design/pro-list', require.context('../node_modules/@ant-design/pro-list/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
514
window.app.define('classnames', require.context('classnames', true, /^.\/index\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
515 516 517 518 519 520 521 522
window.app.define('@ant-design/icons', require.context('../node_modules/@ant-design/icons/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@ant-design/pro-utils', require.context('../node_modules/@ant-design/pro-utils/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@ant-design/pro-layout', require.context('../node_modules/@ant-design/pro-layout/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@ant-design/pro-table', require.context('../node_modules/@ant-design/pro-table/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@ant-design/pro-form', require.context('../node_modules/@ant-design/pro-form/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@ant-design/pro-provider', require.context('../node_modules/@ant-design/pro-provider/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('pinyin-match', require.context('../node_modules/pinyin-match/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'main.js');
window.app.define('react-intl', require.context('../node_modules/react-intl/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
杨思琦's avatar
杨思琦 committed
523
window.app.define('echarts', require.context('../node_modules/echarts/dist', true, /^.\/echarts.min\.js$/), 'echarts.min.js');
524 525 526 527
window.app.define('moment', require.context('moment', true, /^.\/moment\.js$/), 'moment.js');

window.app.define('@wisdom-map/pd-map', require.context('../node_modules/@wisdom-map/pd-map/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-map/gis-utils', require.context('../node_modules/@wisdom-map/gis-utils/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');