Skip to content
This repository was archived by the owner on Mar 1, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"presets": [["env", {"modules": false}], "stage-0", "react"],
"plugins": ["external-helpers", ["import", { "libraryName": "antd"}]]
"plugins": ["external-helpers", ["import", {
"libraryName": "antd",
"libraryDirectory": "es",
"style": true // `style: true` 会加载 less 文件
}]]
}
2 changes: 1 addition & 1 deletion components/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
import { createBrowserHistory } from 'history';

const currentUfecApp = window.CURRENT_UFEC_APP || 'dashboard';
const currentUfecApp = window.CURRENT_UFEC_APP || HALO.application.current_application || 'dashboard';

const getPathList = () => window.location.pathname.split('/').filter(m => !!m && m !== currentUfecApp);

Expand Down
77 changes: 46 additions & 31 deletions lib/ufec.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
import { createBrowserHistory } from 'history';
import _Spin from 'antd/lib/spin';
import _Icon from 'antd/lib/icon';
import _Tabs from 'antd/lib/tabs';
import 'antd/es/spin/style';
import _Spin from 'antd/es/spin';
import 'antd/es/icon/style';
import _Icon from 'antd/es/icon';
import 'antd/es/tabs/style';
import _Tabs from 'antd/es/tabs';
import React, { Component } from 'react';
import _Dropdown from 'antd/lib/dropdown';
import _Button from 'antd/lib/button';
import _Menu from 'antd/lib/menu';
import _Select from 'antd/lib/select';
import _Table from 'antd/lib/table';
import _Alert from 'antd/lib/alert';
import _Input from 'antd/lib/input';
import _AutoComplete from 'antd/lib/auto-complete';
import _Form from 'antd/lib/form';
import _Tooltip from 'antd/lib/tooltip';
import _InputNumber from 'antd/lib/input-number';
import _Radio from 'antd/lib/radio';
import _Slider from 'antd/lib/slider';
import _Switch from 'antd/lib/switch';
import _Checkbox from 'antd/lib/checkbox';
import _TreeSelect from 'antd/lib/tree-select';
import _DatePicker from 'antd/lib/date-picker';
import _Modal from 'antd/lib/modal';
import 'antd/es/dropdown/style';
import _Dropdown from 'antd/es/dropdown';
import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/menu/style';
import _Menu from 'antd/es/menu';
import 'antd/es/select/style';
import _Select from 'antd/es/select';
import 'antd/es/table/style';
import _Table from 'antd/es/table';
import 'antd/es/alert/style';
import _Alert from 'antd/es/alert';
import 'antd/es/input/style';
import _Input from 'antd/es/input';
import 'antd/es/auto-complete/style';
import _AutoComplete from 'antd/es/auto-complete';
import 'antd/es/form/style';
import _Form from 'antd/es/form';
import 'antd/es/tooltip/style';
import _Tooltip from 'antd/es/tooltip';
import 'antd/es/input-number/style';
import _InputNumber from 'antd/es/input-number';
import 'antd/es/radio/style';
import _Radio from 'antd/es/radio';
import 'antd/es/slider/style';
import _Slider from 'antd/es/slider';
import 'antd/es/switch/style';
import _Switch from 'antd/es/switch';
import 'antd/es/checkbox/style';
import _Checkbox from 'antd/es/checkbox';
import 'antd/es/tree-select/style';
import _TreeSelect from 'antd/es/tree-select';
import 'antd/es/date-picker/style';
import _DatePicker from 'antd/es/date-picker';
import 'antd/es/modal/style';
import _Modal from 'antd/es/modal';
import ReactDOM from 'react-dom';
import { Link } from 'react-router-dom';
import _Steps from 'antd/lib/steps';
import 'antd/es/steps/style';
import _Steps from 'antd/es/steps';
import RSVP from 'rsvp';

/**
Expand All @@ -38,7 +60,7 @@ import RSVP from 'rsvp';
* history.getPathList() // return pathlist array
*/

var currentUfecApp = window.CURRENT_UFEC_APP || 'dashboard';
var currentUfecApp = window.CURRENT_UFEC_APP || HALO.application.current_application || 'dashboard';

var getPathList = function getPathList() {
return window.location.pathname.split('/').filter(function (m) {
Expand Down Expand Up @@ -3138,20 +3160,13 @@ Emitry.prototype.once = function once(name, callback) {
});
};

Emitry.prototype.off = function off(names, callback) {
Emitry.prototype.off = function off(names) {
var this$1 = this;

if (this.isArray(names)) {
names.forEach(function (name) {
return delete this$1.list[name];
});
} else if (typeof names === 'string' && typeof callback === 'function') {
if (this.has(names)) {
var removedOne = this.list[names].findIndex(function (item) {
return item.callback === callback;
});
~removedOne && this.list[names].splice(removedOne, 1);
}
} else {
this.list = Object.create(null);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"babel-core": "^6.1.12",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-loader": "^7.1.5",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-import": "^1.8.0",
"babel-plugin-transform-runtime": "^6.23.0",
Expand Down