From ed3a11e7b68568ee7790d977bd362a3cf82caa69 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 25 May 2022 15:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=89=8D=E7=AB=AF=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/common.js | 25 ++++++ pc4mobx/organization/components/Home.js | 78 +++++++++++++++++++ .../components/staff/StaffScheme.js | 8 ++ pc4mobx/organization/index.js | 42 +++++++++- 4 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 pc4mobx/organization/apis/common.js create mode 100644 pc4mobx/organization/components/Home.js diff --git a/pc4mobx/organization/apis/common.js b/pc4mobx/organization/apis/common.js new file mode 100644 index 0000000..34af337 --- /dev/null +++ b/pc4mobx/organization/apis/common.js @@ -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) \ No newline at end of file diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js new file mode 100644 index 0000000..244ed50 --- /dev/null +++ b/pc4mobx/organization/components/Home.js @@ -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 ( +