日志前端渲染
This commit is contained in:
parent
3c8f0cbfaf
commit
ed3a11e7b6
|
|
@ -0,0 +1,25 @@
|
||||||
|
import {
|
||||||
|
WeaTools
|
||||||
|
} from 'ecCom'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取权限
|
||||||
|
* @param {[type]} moduleName [模块名]
|
||||||
|
* @param {Object} params [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
export const authorized = (moduleName, params = {}, apiMethod = 'getHasRight') => WeaTools.callApi(`/api/hrm/${moduleName}/${apiMethod}`, 'POST', params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用分权
|
||||||
|
*/
|
||||||
|
export const detachable = (params = {}) => WeaTools.callApi('/api/hrm/common/getDetachable', 'GET', params);
|
||||||
|
export const getDetachableAll = (params = {}) => WeaTools.callApi('/api/hrm/common/getDetachableAll', 'GET', params);
|
||||||
|
|
||||||
|
export const checkAuthAndDetach = (moduleName, params = {}, apiMethod = 'getHasRight') => Promise.all([authorized(moduleName, params = {}, apiMethod || 'getHasRight'), detachable()])
|
||||||
|
|
||||||
|
export const exportExcel = (params = {}) => WeaTools.callApi('/api/ec/dev/table/export', 'POST', params)
|
||||||
|
|
||||||
|
export const isEnableMultiLang = (params = {}) => WeaTools.callApi('/api/hrm/common/isEnableMultiLang', 'GET', params)
|
||||||
|
|
||||||
|
export const getPinYin = (params = {}) => WeaTools.callApi('/api/workflow/formSetting/fieldSet/getPinYin', 'POST', params)
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import {
|
||||||
|
WeaPopoverHrm,
|
||||||
|
WeaLocaleProvider
|
||||||
|
} from 'ecCom';
|
||||||
|
import {
|
||||||
|
WeaLogView
|
||||||
|
} from 'comsMobx';
|
||||||
|
import {
|
||||||
|
isEnableMultiLang
|
||||||
|
} from '../apis/common';
|
||||||
|
const WeaLogViewComp = WeaLogView.Component;
|
||||||
|
const {
|
||||||
|
LogStore
|
||||||
|
} = WeaLogView;
|
||||||
|
|
||||||
|
class Home extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
key: new Date().getTime(),
|
||||||
|
visible: false,
|
||||||
|
logStore: new LogStore(),
|
||||||
|
logType: '4',
|
||||||
|
logSmallType: ''
|
||||||
|
}
|
||||||
|
window.setLogViewProps = this.setLogViewProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount(){
|
||||||
|
isEnableMultiLang().then(data => {
|
||||||
|
window.inputType = {
|
||||||
|
inputType: 'NORMAL'
|
||||||
|
}
|
||||||
|
if (data.status === '1') {
|
||||||
|
if (data.isEnableMultiLang) {
|
||||||
|
window.inputType = {
|
||||||
|
inputType: 'MULTILANG',
|
||||||
|
isBase64: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, error => {
|
||||||
|
window.inputType = {
|
||||||
|
inputType: 'NORMAL'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setLogViewProps = (props) => {
|
||||||
|
this.setState({
|
||||||
|
key: new Date().getTime(),
|
||||||
|
targetId: '',
|
||||||
|
visible: true,
|
||||||
|
logType: '4',
|
||||||
|
logStore: new LogStore(),
|
||||||
|
...props
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onCancel = () => {
|
||||||
|
this.setState({
|
||||||
|
visible: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
//const isSingle = window.location.pathname.indexOf('/spa/hrm/engine') > -1;
|
||||||
|
return (
|
||||||
|
<div style={{height:"100%"}}>
|
||||||
|
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@jp3tsb`} />
|
||||||
|
<WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@mc1954`} {...this.state} onCancel={this.onCancel}/>
|
||||||
|
<WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@3on3aj`}>
|
||||||
|
{this.props.children}
|
||||||
|
</WeaLocaleProvider>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Home
|
||||||
|
|
@ -253,6 +253,12 @@ export default class StaffScheme extends React.Component {
|
||||||
staffScheme.getForm();
|
staffScheme.getForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log = () => {
|
||||||
|
window.setLogViewProps({
|
||||||
|
logSmallType: '3010',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
custom = () => {
|
custom = () => {
|
||||||
const {
|
const {
|
||||||
|
|
@ -266,6 +272,8 @@ export default class StaffScheme extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
doDel(id) {
|
doDel(id) {
|
||||||
const {
|
const {
|
||||||
staffScheme
|
staffScheme
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Route from "react-router/lib/Route";
|
import Route from "react-router/lib/Route";
|
||||||
import { WeaLocaleProvider } from "ecCom";
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
|
import Home from './components/Home';
|
||||||
import SimpleOrg from "./components/tree/index";
|
import SimpleOrg from "./components/tree/index";
|
||||||
import StandardOrg from "./components/tree/standard_org";
|
import StandardOrg from "./components/tree/standard_org";
|
||||||
import RankScheme from "./components/postionrank/RankScheme";
|
import RankScheme from "./components/postionrank/RankScheme";
|
||||||
|
|
@ -29,7 +30,7 @@ getLocaleLabel = function (nextState, replace, callback) {
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
const Home = (props) => props.children;
|
//const Home = (props) => props.children;
|
||||||
|
|
||||||
const Routes = (
|
const Routes = (
|
||||||
<Route
|
<Route
|
||||||
|
|
@ -54,7 +55,44 @@ const Routes = (
|
||||||
</Route>
|
</Route>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const OutSignAppSettingProvider = (props) => (
|
||||||
|
<Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@tqobex`} outSignAppSetting={stores.outSignAppSetting}><OutSignAppSetting ecId={`${this && this.props && this.props.ecId || ''}_OutSignAppSetting@cli4xv`} {...props} /></Provider>
|
||||||
|
);
|
||||||
|
|
||||||
|
class NetworkStrategy extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
reRender: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
// 多语言加载之后,已经 mount 的组件,需要重新 render 一次,刷新多语言配置。
|
||||||
|
// getLocaleLabelByCode('hrm').then(() => this.setState({
|
||||||
|
// reRender: true
|
||||||
|
// }));
|
||||||
|
}
|
||||||
|
|
||||||
|
render = () => (
|
||||||
|
<Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@is207z`} {...stores}>
|
||||||
|
<Home ecId={`${this && this.props && this.props.ecId || ''}_Home@6rat5p`}>
|
||||||
|
<SecuritySetting ecId={`${this && this.props && this.props.ecId || ''}_SecuritySetting@d7jz8e`} single="1" type="network" {...this.props} />
|
||||||
|
</Home>
|
||||||
|
</Provider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Route: Routes,
|
Route: Routes,
|
||||||
store: stores,
|
store: stores,
|
||||||
};
|
com: {
|
||||||
|
OutSignAppSettingProvider: OutSignAppSettingProvider,
|
||||||
|
NetworkStrategy,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// module.exports = {
|
||||||
|
// Route: Routes,
|
||||||
|
// store: stores,
|
||||||
|
// };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue