!21 日志操作

Merge pull request !21 from reset/feature/cl
This commit is contained in:
reset 2022-05-25 07:42:53 +00:00 committed by Gitee
commit c195435037
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 151 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -253,6 +253,12 @@ export default class StaffScheme extends React.Component {
staffScheme.getForm();
}
log = () => {
window.setLogViewProps({
logSmallType: '3010',
});
}
custom = () => {
const {
@ -265,6 +271,8 @@ export default class StaffScheme extends React.Component {
tableStore.tableColSet(true);
}
doDel(id) {
const {

View File

@ -1,6 +1,7 @@
import React from "react";
import Route from "react-router/lib/Route";
import { WeaLocaleProvider } from "ecCom";
import Home from './components/Home';
import SimpleOrg from "./components/tree/index";
import StandardOrg from "./components/tree/standard_org";
import RankScheme from "./components/postionrank/RankScheme";
@ -29,7 +30,7 @@ getLocaleLabel = function (nextState, replace, callback) {
callback();
};
const Home = (props) => props.children;
//const Home = (props) => props.children;
const Routes = (
<Route
@ -54,7 +55,44 @@ const Routes = (
</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 = {
Route: Routes,
store: stores,
};
com: {
OutSignAppSettingProvider: OutSignAppSettingProvider,
NetworkStrategy,
}
}
// module.exports = {
// Route: Routes,
// store: stores,
// };