class Theme { constructor(code) { this._code = '02'; this._mapMenu = { '02': 'fuzhou_01', '03': 'beijing_01', '04': 'chengdou_03', '05': 'batong_01' }; } // 加载菜单组件 loadMenuComponent(code) { return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/index`).default); } // 加载运行图计划表组件 loadPlanComponent(code) { return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/planSchedule/index`).default); } // 加载运行图解析和转化函数 loadPlanConvert(code) { return require(`./${this._mapMenu[code || this._code]}/planConvert`).default; } // 共有字段转换 loadPropConvert(code) { var convert = require(`./${this._mapMenu[code || this._code]}/model`) || {}; if (!convert.hasOwnProperty('initPublicProps')) { convert.initPublicProps = (model) => { return model; }; } if (!convert.hasOwnProperty('initPrivateProps')) { convert.initPrivateProps = (model) => { return model; }; } return convert; } } export default Theme;