ttk-app-core
Version:
enterprise develop framework
56 lines (50 loc) • 1.93 kB
JavaScript
import React from 'react'
import { action as MetaAction, AppLoader } from 'edf-meta-engine'
import { List, fromJS } from 'immutable'
import moment from 'moment'
import config from './config'
import { consts } from 'edf-consts'
import { fetch } from 'edf-utils'
import { LoadingMask, Upload, FormDecorator } from 'edf-component'
import classNames from 'classnames'
import blank from './images/blank.png'
class action {
constructor(option) {
this.metaAction = option.metaAction
this.voucherAction = option.voucherAction
this.config = config.current
this.webapi = this.config.webapi
}
onInit = ({ component, injections }) => {
this.voucherAction.onInit({ component, injections })
this.component = component
this.injections = injections
injections.reduce('init')
this.load()
}
load = async () => {
}
getPhoto = () => {
return blank
}
close = () =>{
this.component.props.tabEdit('关闭当前财务期初', 'remove')
}
//初始化
initAccountClick = async () => {
this.component.props.tabEdit('关闭当前财务期初', 'remove')
//app-account-beginbalance ttk-gl-app-finance-periodbegin
setTimeout(() => {
this.component.props.setPortalContent &&
this.component.props.setPortalContent('科目期初', 'ttk-gl-app-finance-periodbegin', { key:'beginbalance'})
}, 20)
}
}
export default function creator(option) {
const metaAction = new MetaAction(option),
voucherAction = FormDecorator.actionCreator({ ...option, metaAction }),
o = new action({ ...option, metaAction, voucherAction }),
ret = { ...metaAction, ...voucherAction, ...o }
metaAction.config({ metaHandlers: ret })
return ret
}