import dva from 'dva';
import { history } from './utils/history'
import createLoading from 'dva-loading';
import * as BizCharts from 'bizcharts';
import { message } from 'antd'
import './index.css';
import './styles/feui/index.less'
BizCharts.track(false);

// 1. Initialize
const app = dva({
  history,
  onError (e) {
    message.error(e.message)
  }
});

// 2. Plugins
app.use(createLoading());

// 3. Model
app.model(require('./models/login').default);
app.model(require('./models/app').default);
app.model(require('./models/listPage').default);
app.model(require('./models/editPage').default);
app.model(require('./models/treePage').default);
app.model(require('./models/custom').default);
app.model(require('./models/customPage').default);
app.model(require('./models/import').default);
app.model(require('./models/picturePage').default);
app.model(require('./models/search').default);
app.model(require('./models/chartPage').default);
app.model(require('./models/FM/base').default);
app.model(require('./models/FM/userEdit').default);
app.model(require('./models/FM/userGroupEdit').default);
app.model(require('./models/FM/roleGroupEdit').default);
app.model(require('./models/FM/syncData').default);
app.model(require('./models/FM/roleEdit').default);
app.model(require('./models/FM/workStageCalendar').default);
app.model(require('./models/FM/wareHouse').default);
app.model(require('./models/SO/mrp').default);
app.model(require('./models/SO/mrpEdit').default);
app.model(require('./models/EM/engineeringPlanEdit').default);
app.model(require('./models/PF/flowPermitEdit').default);
app.model(require('./models/PF/codeRule').default);
app.model(require('./models/PO/orderPermit').default);
app.model(require('./models/PF/flow').default);
app.model(require('./models/PO/applyOrder').default);
app.model(require('./models/PO/applyOrderToOrder').default);
app.model(require('./models/WO/WOOrderQuery').default);
app.model(require('./models/WH/InMaterialSendInspect').default);
app.model(require('./models/WH/selectInventory').default);
app.model(require('./models/WH/packageProduct').default);
app.model(require('./models/WH/WHLocation').default);
app.model(require('./models/WH/pickingstock').default);
app.model(require('./models/QC/specialReceive').default);
app.model(require('./models/EM/emProposalEdit').default);
app.model(require('./models/WO/orderFlowCard').default);
app.model(require('./models/WO/bomWorkTaskRelation').default);
app.model(require('./models/SO/orderImport').default);
app.model(require('./models/FM/process').default);
app.model(require('./models/WH/showInventory').default);
app.model(require('./models/SO/order').default);
app.model(require('./models/EM/feedProposal').default);
app.model(require('./models/PF/form').default);
app.model(require('./models/WO/pdtOrder').default);
app.model(require('./models/EM/emOrder').default);
app.model(require('./models/FM/product').default);
app.model(require('./models/WH/InStockImport').default);
app.model(require('./models/FM/productProcess').default);
app.model(require('./models/WO/JobFrozen').default);
app.model(require('./models/MM/reworkPdtOrder').default);
app.model(require('./models/MM/snSearch').default);
app.model(require('./models/QC/batch').default);
app.model(require('./models/PF/lastVersion').default);
app.model(require('./models/MM/stackMaterial').default);

// 4. Router
app.router(require('./router').default);

// 5. Start
app.start('#root');

window.g_app = app;