UNPKG

ttk-app-core

Version:
49 lines (40 loc) 1.48 kB
import React from 'react' import { action as MetaAction, AppLoader } from 'edf-meta-engine' import {Icon, Tree, Form, Select, Switch} from 'edf-component' import config from './config' import renderColumns from './utils/renderColumns' import extend from './extend' import { fromJS } from 'immutable' const Option = Select.Option const FormItem = Form.Item class action { constructor(option) { this.metaAction = option.metaAction this.extendAction = option.extendAction this.config = config.current this.webapi = this.config.webapi } onInit = ({ component, injections }) => { this.extendAction.gridAction.onInit({ component, injections }) this.component = component this.injections = injections if (this.component.props.setOkListener) { this.component.props.setOkListener(this.onOk) } let addEventListener = this.component.props.addEventListener if (addEventListener) { addEventListener('onTabFocus', :: this.onTabFocus) } injections.reduce('init') } onTabFocus=()=>{ } } export default function creator(option) { const metaAction = new MetaAction(option), extendAction = extend.actionCreator({ ...option, metaAction }), o = new action({ ...option, metaAction, extendAction }), ret = { ...metaAction, ...extendAction.gridAction, ...o } metaAction.config({ metaHandlers: ret }) return ret }