Comparing version 0.0.3 to 0.0.5
{ | ||
"name": "ncchr", | ||
"version": "0.0.3", | ||
"version": "0.0.5", | ||
"description": "ncchr cli", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -1,63 +0,40 @@ | ||
import React, {Component} from 'react'; | ||
import './index.less'; | ||
class HomePage extends Component { | ||
constructor(props) { | ||
super(props); | ||
import React from 'react'; | ||
import render from '../../../../hrpub/common/frame/render'; | ||
// 示例为hrhi入职登记的appcode | ||
this.appConfig = { | ||
pagecode: '60071010p', | ||
appcode: '60071010' | ||
}; | ||
import Action1 from '../actions/action1'; | ||
this.state = { | ||
language: {}, | ||
context: {} | ||
}; | ||
import {createPage} from 'nc-lightapp-front'; | ||
this.getLanguage = this.getLanguage.bind(this) | ||
this.getTemplateData = this.getTemplateData.bind(this); | ||
} | ||
import Header from '../components/Header'; | ||
componentDidMount() { | ||
this.getLanguage(); | ||
this.getTemplateData(); | ||
} | ||
import './index.less'; | ||
getTemplateData() { | ||
const {createUIDom, dispatch, meta, button} = this.props; | ||
createUIDom(this.appConfig, (data = {}) => { | ||
this.setState({ | ||
context: data.context | ||
}); | ||
meta.setMeta(data.template || {}); | ||
button.setButtons(data.button || {}); | ||
}); | ||
const Homepage = render({ | ||
actions: { | ||
action1: Action1 | ||
}, | ||
customData: '哈哈哈', | ||
state: { | ||
name | ||
} | ||
getLanguage() { | ||
this.props.MultiInit.getMultiLang({ | ||
moduleId: 'hi6007', | ||
domainName: 'hrhi', | ||
callback: (json, status, init) => { | ||
this.setState({ | ||
language: json | ||
}); | ||
} | ||
}); | ||
} | ||
render() { | ||
return ( | ||
})(({props, action, state}, {customData}) => { | ||
return ( | ||
<div> | ||
<Header | ||
name={state.name} | ||
/> | ||
{state.name} | ||
{customData} | ||
<div> | ||
多语言 | ||
{JSON.stringify(this.props.newNode.language)} | ||
<button | ||
onClick={action.action1.alertName} | ||
> | ||
我是一点击就会alert的按钮 | ||
</button> | ||
</div> | ||
); | ||
} | ||
}; | ||
</div> | ||
) | ||
}); | ||
export default connect(HomePage); | ||
export default createPage({})(Homepage) |
@@ -1,13 +0,10 @@ | ||
import React, {Component} from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import 'src/hrpub/common/static/fonts/iconfont.css'; | ||
import { | ||
createPage | ||
} from 'nc-lightapp-front'; | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import HomePage from '../container'; | ||
const Wrapper = createPage({})(HomePage); | ||
ReactDOM.render(<Wrapper ref={ref => pageIns.ins = ref}/>, document.getElementById('app')); | ||
ReactDom.render(<HomePage/>, document.getElementById('app')); |
@@ -1,71 +0,33 @@ | ||
import React, {Component} from 'react'; | ||
import './index.less'; | ||
import render from '../../../../hrpub/common/frame/render'; | ||
import Action1 from '../actions/action1'; | ||
import {connect} from '../../../../hrpub/common/store'; | ||
import {createPage} from 'nc-lightapp-front'; | ||
class HomePage extends Component { | ||
constructor(props) { | ||
super(props); | ||
import Header from '../components/Header'; | ||
// 示例为hrhi入职登记的appcode | ||
this.appConfig = { | ||
pagecode: '60071010p', | ||
appcode: '60071010' | ||
}; | ||
import './index.less'; | ||
this.getLanguage = this.getLanguage.bind(this) | ||
this.getTemplateData = this.getTemplateData.bind(this); | ||
} | ||
componentDidMount() { | ||
this.getLanguage(); | ||
this.getTemplateData(); | ||
} | ||
getTemplateData() { | ||
const {createUIDom, dispatch, meta, button} = this.props; | ||
createUIDom(this.appConfig, (data = {}) => { | ||
dispatch({ | ||
type: 'newNode/update', | ||
payload: { | ||
context: data.context | ||
} | ||
}); | ||
meta.setMeta(data.template || {}); | ||
button.setButtons(data.button || {}); | ||
}); | ||
} | ||
getLanguage() { | ||
this.props.MultiInit.getMultiLang({ | ||
moduleId: 'hi6007', | ||
domainName: 'hrhi', | ||
callback: (json, status, init) => { | ||
this.props.dispatch({ | ||
type: 'newNode/update', | ||
payload: { | ||
language: json | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
render() { | ||
return ( | ||
const Homepage = render({ | ||
actions: { | ||
action1: Action1 | ||
}, | ||
customData: '哈哈哈' | ||
})(({props, action, state}, {customData}) => { | ||
return ( | ||
<div> | ||
<Header /> | ||
{props.exam.name} | ||
{customData} | ||
<div> | ||
我是内容 | ||
<div> | ||
多语言 | ||
{JSON.stringify(this.props.newNode.language)} | ||
</div> | ||
<button | ||
onClick={action.action1.alertName} | ||
> | ||
我是一点击就会alert的按钮 | ||
</button> | ||
</div> | ||
); | ||
} | ||
}; | ||
</div> | ||
) | ||
}); | ||
export default connect(HomePage); | ||
export default createPage({})(Homepage) |
import React from 'react'; | ||
import {start, connect} from '../../../../hrpub/common/store/index'; | ||
import HomePage from '../container'; | ||
import {createPage} from 'nc-lightapp-front'; | ||
import {start} from 'src/hrpub/common/store'; | ||
import model from '../models/model'; | ||
import model from '../store/model'; | ||
const HomePageWithData = connect(HomePage); | ||
const Wrapper = createPage({})(HomePage); | ||
start({ | ||
root: document.getElementById('app'), | ||
component: <Wrapper />, | ||
component: <HomePageWithData/>, | ||
model: model | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201896
34
553