commit
860dd0212c
|
|
@ -0,0 +1,103 @@
|
|||
import {
|
||||
WeaTools
|
||||
} from 'ecCom';
|
||||
|
||||
/**
|
||||
* 获取tab数据
|
||||
* @param {Object} params [description]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTabInfo`, 'GET', params)
|
||||
|
||||
export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getFieldDefinedInfo`, 'GET', params)
|
||||
|
||||
export const saveFieldDefinedInfo = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const removeFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/del`, 'POST', params)
|
||||
|
||||
export const saveGroupInfo = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const saveGroupSettingInfo = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveGroup`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const changeTypeInfo = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeTree`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const removeGroupInfo = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/deleteTitle`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const getTree = (moduleName,params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTree`, 'GET', params)
|
||||
|
||||
export const saveTree = (moduleName,params) => {
|
||||
return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTree`, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params)
|
||||
|
||||
export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params)
|
||||
|
||||
export const saveEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/saveEncryptFieldSettingForm`, 'POST', params)
|
||||
|
||||
//获取字段可查看范围列表
|
||||
export const getEncryptFieldScopeList = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeList', 'POST', params);
|
||||
|
||||
//获取字段可查看范围表单
|
||||
export const getEncryptFieldScopeForm = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeForm', 'GET', params);
|
||||
|
||||
//保存字段可查看范围
|
||||
export const saveEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/saveEncryptFieldScopeSetting', 'POST', params);
|
||||
|
||||
//删除字段可查看范围
|
||||
export const delEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/delEncryptFieldScopeSetting', 'POST', params);
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
import {
|
||||
Button,
|
||||
Form,
|
||||
Row,
|
||||
Col
|
||||
} from 'antd';
|
||||
import {
|
||||
WeaFormItem,
|
||||
WeaNewScroll,
|
||||
WeaSearchGroup,
|
||||
} from 'ecCom';
|
||||
import {
|
||||
WeaSwitch
|
||||
} from 'comsMobx';
|
||||
import _ from 'lodash';
|
||||
|
||||
export default class AdvanceSearchFormInfo extends Component {
|
||||
renderForm = () => {
|
||||
const {
|
||||
form,
|
||||
formFields,
|
||||
itemRender
|
||||
} = this.props;
|
||||
let arr = [];
|
||||
let formParams = form.getFormParams();
|
||||
formFields.map(c => {
|
||||
let _arr = [];
|
||||
c.items.map((field, index) => {
|
||||
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
|
||||
const itemProps = {
|
||||
ratio1to2: true,
|
||||
label: field.label,
|
||||
labelCol: {
|
||||
span: `${window.HrmEngineLabelCol}`
|
||||
},
|
||||
error: form.getError(field),
|
||||
tipPosition: 'bottom',
|
||||
wrapperCol: {
|
||||
span: `${window.HrmEngineWrapperCol}`
|
||||
}
|
||||
}
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@2tsobq@${index}`} fieldConfig={field} form={form}/>;
|
||||
} else {
|
||||
coms = customerRender(field, form, formParams);
|
||||
}
|
||||
coms != null && _arr.push(
|
||||
(
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@xgrs6h@${index}`} span={11} offset={index % 2 === 0 ? 1 : 0}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@l40w8j@${index}`}
|
||||
ratio1to2
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${window.HrmEngineLabelCol}`}}
|
||||
error={form.getError(field)}
|
||||
tipPosition={'bottom'}
|
||||
wrapperCol={{span: `${window.HrmEngineWrapperCol}`}}
|
||||
>
|
||||
{coms}
|
||||
</WeaFormItem>
|
||||
</Col>
|
||||
)
|
||||
)
|
||||
if (_arr.length === 2 || index === c.items.length - 1) {
|
||||
const clone = [..._arr];
|
||||
_arr.length = 0;
|
||||
arr.push(<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@s73jjd@${index}`} gutter={8} style={{marginTop: '10px'}}>{clone}</Row>);
|
||||
}
|
||||
})
|
||||
})
|
||||
return <Form ecId={`${this && this.props && this.props.ecId || ''}_Form@ojbzkx`}>{arr}</Form>;
|
||||
}
|
||||
|
||||
renderGroupForm = () => {
|
||||
const {
|
||||
form,
|
||||
formFields,
|
||||
itemRender
|
||||
} = this.props;
|
||||
let formParams = form.getFormParams();
|
||||
let arr = [];
|
||||
formFields.map((c, i) => {
|
||||
let _arr = [];
|
||||
c.items.map((field, index) => {
|
||||
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
|
||||
const itemProps = {
|
||||
ratio1to2: true,
|
||||
label: field.label,
|
||||
labelCol: {
|
||||
span: `${window.HrmEngineLabelCol}`
|
||||
},
|
||||
error: form.getError(field),
|
||||
tipPosition: 'bottom',
|
||||
wrapperCol: {
|
||||
span: `${window.HrmEngineWrapperCol}`
|
||||
}
|
||||
}
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@baa9pz@${index}`} fieldConfig={field} form={form}/>;
|
||||
} else {
|
||||
coms = customerRender(field, form, formParams);
|
||||
}
|
||||
coms != null && _arr.push({
|
||||
com: (
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@t6u2oa@${index}`}
|
||||
ratio1to2
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${window.HrmEngineLabelCol}`}}
|
||||
error={form.getError(field)}
|
||||
wrapperCol={{span: `${window.HrmEngineWrapperCol}`}}
|
||||
>
|
||||
{coms}
|
||||
</WeaFormItem>
|
||||
),
|
||||
col: field.colSpan || 2
|
||||
})
|
||||
})
|
||||
arr.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@w7lkbb@${i}`} showGroup={c.defaultshow} items={_arr} fontSize={13}/>);
|
||||
})
|
||||
return arr;
|
||||
}
|
||||
|
||||
renderFormComponent = () => {
|
||||
const {
|
||||
formFields
|
||||
} = this.props;
|
||||
|
||||
const com = formFields.length > 1 ? this.renderGroupForm() : this.renderForm();
|
||||
return com;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@sx3az2`} height={'100%'}>
|
||||
{this.renderGroupForm()}
|
||||
</WeaNewScroll>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import React, {Component} from 'react';
|
||||
import {observer} from 'mobx-react';
|
||||
import { WeaDialog } from "ecCom";
|
||||
import Tip from './Tip';
|
||||
import FormInfo from './FormInfo';
|
||||
|
||||
@observer
|
||||
export default class EncryptSetting extends Component{
|
||||
render(){
|
||||
const {store} = this.props;
|
||||
const {encryptDialogProps, formTarget, encryptFormItemRender} = store;
|
||||
const {
|
||||
encryptForm,
|
||||
encryptFormFields,
|
||||
} = formTarget;
|
||||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@9corpv`} {...encryptDialogProps}>
|
||||
<Tip ecId={`${this && this.props && this.props.ecId || ''}_Tip@p2simx`} />
|
||||
<div className='encryptForm' style={{width: '70%', marginLeft: '15%'}}>
|
||||
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@0dc7ac`} center={false} form={encryptForm} formFields={encryptFormFields} itemRender={encryptFormItemRender}/>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
import {
|
||||
observer
|
||||
} from 'mobx-react';
|
||||
import {
|
||||
WeaRightMenu,
|
||||
WeaTableEdit,
|
||||
WeaDialog
|
||||
} from 'ecCom';
|
||||
import classnames from 'classnames';
|
||||
import EncryptSetting from './EncryptSetting';
|
||||
import ViewRangeForm from './ViewRangeForm';
|
||||
import ViewRangeSetting from './ViewRangeSetting';
|
||||
import FormInfo from './FormInfo';
|
||||
|
||||
@observer
|
||||
export default class FieldDef extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
resize: new Date().getTime()
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener('resize', this.resizeHandle);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('resize', this.resizeHandle);
|
||||
}
|
||||
|
||||
resizeHandle = (e) => {
|
||||
this.setState({
|
||||
resize: new Date().getTime()
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
resize
|
||||
} = this.state;
|
||||
const {
|
||||
rightMenu,
|
||||
store,
|
||||
resetClass
|
||||
} = this.props;
|
||||
const {
|
||||
setEditTable,
|
||||
tableEditConfig,
|
||||
formTarget,
|
||||
dialogParams,
|
||||
setDialogVisible,
|
||||
getDialogOpButtons,
|
||||
showError,
|
||||
editorDialogRightMenu,
|
||||
refreshFeildDef,
|
||||
refreshForm,
|
||||
dropdownSelectedKey,
|
||||
|
||||
moduleName,
|
||||
isJobTreeNode
|
||||
} = store;
|
||||
const classes = classnames({
|
||||
['tabPane']: true,
|
||||
['tabPane-include']: resetClass
|
||||
})
|
||||
const {
|
||||
groupInfoFrom,
|
||||
groupInfoFromFields,
|
||||
typeInfoFrom,
|
||||
typeInfoFromFields,
|
||||
childInfoForm,
|
||||
childInfoFormFields
|
||||
} = formTarget;
|
||||
const {
|
||||
editGroupInfo,
|
||||
editTypeInfo,
|
||||
groupInfoSetting,
|
||||
createChildInfo,
|
||||
childInfoSetting
|
||||
} = dialogParams;
|
||||
|
||||
let tableProps = {};
|
||||
if (this.tabDom) {
|
||||
tableProps = {
|
||||
scroll: {
|
||||
y: this.tabDom.offsetHeight - 80,
|
||||
}
|
||||
}
|
||||
//人员卡片字段定义页面
|
||||
if (moduleName === 'resourcefielddefined') {
|
||||
if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文
|
||||
Object.assign(tableProps.scroll, {
|
||||
x: 1200
|
||||
});
|
||||
} else {
|
||||
Object.assign(tableProps.scroll, {
|
||||
x: isJobTreeNode ? 1400 : 1900
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)]
|
||||
|
||||
return (
|
||||
<div className={classes} ref={dom => { this.tabDom = dom }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@43qdk8`} datas={rMenu}>
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@5fu5eh`} tableProps={tableProps} viewAttr={3} rowKey={'fieldidrowKey'}
|
||||
ref={(editTable) => setEditTable(editTable, 'fieldDef')}
|
||||
{...tableEditConfig['fieldDef']}
|
||||
/>
|
||||
</WeaRightMenu>
|
||||
<EncryptSetting ecId={`${this && this.props && this.props.ecId || ''}_EncryptSetting@imlc4x`} store={store} />
|
||||
<ViewRangeSetting ecId={`${this && this.props && this.props.ecId || ''}_ViewRangeSetting@2vmdra`} store={store} />
|
||||
<ViewRangeForm ecId={`${this && this.props && this.props.ecId || ''}_ViewRangeForm@bg4o68`} store={store} />
|
||||
{/* 新增分组 */}
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@etbstc`}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
style={{ width: 440, height: 70 }}
|
||||
title={editGroupInfo.title}
|
||||
visible={editGroupInfo.visible}
|
||||
onCancel={() => setDialogVisible('editGroupInfo', false)}
|
||||
buttons={getDialogOpButtons()}
|
||||
moreBtn={{ datas: editorDialogRightMenu }}
|
||||
>
|
||||
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@x4akor`} center={false} form={groupInfoFrom} formFields={groupInfoFromFields} menu={editorDialogRightMenu} />
|
||||
</WeaDialog>
|
||||
{/* 新增类型 */}
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@etbstc`}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
style={{ width: 440, height: 70 }}
|
||||
title={editTypeInfo.title}
|
||||
visible={editTypeInfo.visible}
|
||||
onCancel={() => setDialogVisible('editTypeInfo', false)}
|
||||
buttons={getDialogOpButtons()}
|
||||
moreBtn={{ datas: editorDialogRightMenu }}
|
||||
>
|
||||
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@x4akor`} center={false} form={typeInfoFrom} formFields={typeInfoFromFields} menu={editorDialogRightMenu} />
|
||||
</WeaDialog>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@hxqf4v`}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
style={{ width: 620, height: 450 }}
|
||||
title={groupInfoSetting.title}
|
||||
visible={groupInfoSetting.visible}
|
||||
onCancel={() => setDialogVisible('groupInfoSetting', false, '')}
|
||||
buttons={getDialogOpButtons()}
|
||||
moreBtn={{ datas: editorDialogRightMenu }}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@u3ghz1`} datas={editorDialogRightMenu}>
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@9x9otf`}
|
||||
ref={(editTable) => setEditTable(editTable, 'groupSetting')}
|
||||
tableProps={{ scroll: { y: 360 } }}
|
||||
{...tableEditConfig['groupSetting']} />
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@dirux3`}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
style={{ width: 440, height: createChildInfo.height }}
|
||||
title={createChildInfo.title}
|
||||
visible={createChildInfo.visible}
|
||||
onCancel={() => setDialogVisible('createChildInfo', false)}
|
||||
buttons={getDialogOpButtons()}
|
||||
moreBtn={{ datas: editorDialogRightMenu }}
|
||||
>
|
||||
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@mypkxi`} center={false} form={childInfoForm} formFields={childInfoFormFields} menu={editorDialogRightMenu} />
|
||||
</WeaDialog>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@k8ta6q`}
|
||||
icon="icon-coms-hrm"
|
||||
iconBgcolor="#217346"
|
||||
style={{ width: 620, height: 450 }}
|
||||
title={childInfoSetting.title}
|
||||
visible={childInfoSetting.visible}
|
||||
onCancel={() => setDialogVisible('childInfoSetting', false, '')}
|
||||
buttons={getDialogOpButtons()}
|
||||
moreBtn={{ datas: editorDialogRightMenu }}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@i9bjcx`} datas={editorDialogRightMenu}>
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@mma0l9`}
|
||||
ref={(editTable) => setEditTable(editTable, 'childInfoSetting')}
|
||||
tableProps={{ scroll: { y: 360 } }}
|
||||
{...tableEditConfig['childInfoSetting']} />
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
</div>
|
||||
)
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
import '../../style/index.less';
|
||||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
import {
|
||||
inject,
|
||||
observer
|
||||
} from 'mobx-react';
|
||||
import {
|
||||
WeaTop,
|
||||
WeaAlertPage,
|
||||
WeaLeftTree,
|
||||
WeaLeftRightLayout,
|
||||
WeaDropdown
|
||||
} from 'ecCom';
|
||||
import { Spin } from 'antd';
|
||||
import Tabs from './Tabs';
|
||||
import FieldDef from './FieldDef';
|
||||
import {
|
||||
i18n
|
||||
} from '../../public/i18n';
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
|
||||
|
||||
@inject('fieldDefined')
|
||||
@observer
|
||||
export default class FieldDefined extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
logSmallType: ''
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.init(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.location.key !== nextProps.location.key) {
|
||||
this.init(nextProps);
|
||||
}
|
||||
}
|
||||
|
||||
init = (props) => {
|
||||
const {
|
||||
fieldDefined: store,
|
||||
params
|
||||
} = props, {
|
||||
checkAuthorized,
|
||||
initData,
|
||||
initResourceData
|
||||
} = store, {
|
||||
type: moduleType
|
||||
} = params
|
||||
let moduleName, logSmallType;
|
||||
if (moduleType === 'subCompany') {
|
||||
moduleName = 'subcompanyfielddefined';
|
||||
} else if (moduleType === 'department') {
|
||||
moduleName = 'departmentfielddefined';
|
||||
} else if(moduleType === 'job') {
|
||||
moduleName = 'jobfielddefined';
|
||||
}else {
|
||||
moduleName = 'resourcefielddefined';
|
||||
}
|
||||
// let callbackFunc = () => initData(false, true, moduleName);
|
||||
// if (moduleType === 'resource')
|
||||
//let callbackFunc = () => initResourceData(moduleName);
|
||||
//checkAuthorized(moduleName, null, callbackFunc);
|
||||
initResourceData(moduleName);
|
||||
this.setState({ logSmallType })
|
||||
}
|
||||
|
||||
tabChangeHandle = (key) => {
|
||||
const {
|
||||
fieldDefined: store
|
||||
} = this.props, {
|
||||
tabConfig
|
||||
} = store;
|
||||
store.setActiveTab(tabConfig, key);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
fieldDefined: store,
|
||||
params
|
||||
} = this.props, {
|
||||
//containerInitFinished,//权限验证
|
||||
refreshMainTabComponent,
|
||||
spinning
|
||||
} = store, {
|
||||
type: moduleType
|
||||
} = params, {
|
||||
tabConfig,
|
||||
btnsAndMenus,
|
||||
formTarget,
|
||||
activeTabInfo,
|
||||
treeConfig,
|
||||
refreshTree,
|
||||
selectedTreeNodeInfo,
|
||||
dropdownProps,
|
||||
feildDefRemoveable
|
||||
} = store, {
|
||||
btns,
|
||||
menus,
|
||||
tabBtnDef
|
||||
} = btnsAndMenus(tabConfig), {
|
||||
conditionForm: form,
|
||||
conditionFormFields: fields,
|
||||
} = formTarget, tabProps = {
|
||||
tabConfig: tabConfig,
|
||||
tabChangeHandle: this.tabChangeHandle,
|
||||
activeTabInfo,
|
||||
rightMenu: menus,
|
||||
store: store,
|
||||
conditionForm: form,
|
||||
conditionFormFields: fields,
|
||||
tabBtnDef: [
|
||||
...tabBtnDef,
|
||||
<ButtonSelect ecId={`${this && this.props && this.props.ecId || ''}_ButtonSelect@qbn2pl`}
|
||||
{...dropdownProps()}
|
||||
btnProps={{
|
||||
style: { padding: 0, background: 'transparent', border: 'none', color: feildDefRemoveable ? '#dadada' : '#34A2FF', fontSize: 20, marginTop: 2 },
|
||||
disabled: feildDefRemoveable,
|
||||
}}
|
||||
/>
|
||||
]
|
||||
}, title = moduleType === 'subCompany' ? i18n.module.subCompanyFieldDef() : moduleType === 'department' ? i18n.module.departmentFieldDef() : i18n.module.resourceFieldDef(),
|
||||
topProps = {
|
||||
title,
|
||||
icon: <i className='icon-coms-hrm' />,
|
||||
iconBgcolor: '#217346',
|
||||
showDropIcon: true,
|
||||
buttons: btns,
|
||||
dropMenuDatas: menus
|
||||
};
|
||||
let logType;
|
||||
if (selectedTreeNodeInfo) {
|
||||
if (selectedTreeNodeInfo.viewAttr == 1) {
|
||||
logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED';
|
||||
} else {
|
||||
logType = 'HRM_ENGINE_RESOURCEFIELDDEFINED_DETAIL';
|
||||
}
|
||||
}
|
||||
let children = [];
|
||||
const hasRight = true;//todo
|
||||
if (hasRight) {
|
||||
const {
|
||||
data,
|
||||
onSelectedTreeNode,
|
||||
selectedKeys,
|
||||
onExpand,
|
||||
treeExpandKeys
|
||||
} = store.toJS(treeConfig);
|
||||
const treeCom = (
|
||||
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@ifgbi1`}
|
||||
datas={data}
|
||||
onSelect={onSelectedTreeNode}
|
||||
selectedKeys={selectedKeys}
|
||||
onExpand={onExpand}
|
||||
expandedKeys={treeExpandKeys} />
|
||||
)
|
||||
children = [
|
||||
(
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@hwytf7`} spinning={spinning}>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@rdv0wt`} {...topProps}>
|
||||
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
|
||||
{
|
||||
<Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@4k4wsi`} {...tabProps}>
|
||||
<FieldDef ecId={`${this && this.props && this.props.ecId || ''}_FieldDef@pliw94`} logSmallType={logType || this.state.logSmallType} targetId={activeTabInfo.tabInfo ? activeTabInfo.tabInfo.groupid : ''} resetClass={true} />
|
||||
</Tabs>
|
||||
}
|
||||
</WeaLeftRightLayout>
|
||||
</WeaTop>
|
||||
</Spin>
|
||||
)
|
||||
]
|
||||
} else {
|
||||
children = [
|
||||
(
|
||||
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@z0f4dh`}>
|
||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="hrm_module_container fieldDef">
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
import {
|
||||
observer
|
||||
} from 'mobx-react';
|
||||
import {
|
||||
Button
|
||||
} from 'antd';
|
||||
import {
|
||||
WeaFormItem,
|
||||
WeaSearchGroup,
|
||||
WeaCheckbox
|
||||
} from 'ecCom';
|
||||
import {
|
||||
WeaSwitch
|
||||
} from 'comsMobx';
|
||||
import findIndex from 'lodash/findIndex';
|
||||
|
||||
@observer
|
||||
export default class FormInfo extends Component {
|
||||
renderForm = () => {
|
||||
const {
|
||||
formFields,
|
||||
form,
|
||||
colCount,
|
||||
itemRender,
|
||||
onSelectedChangeHandle,
|
||||
showLabel,
|
||||
multiColumn,
|
||||
custLabelCol,
|
||||
childrenComponents,
|
||||
onSwitchChange,
|
||||
} = this.props;
|
||||
|
||||
let groupArr = [];
|
||||
const formParams = form.getFormParams();
|
||||
const labelVisible = showLabel == null || showLabel == true;
|
||||
const col = colCount ? colCount : 1;
|
||||
const labelCol = labelVisible ? (custLabelCol || `${window.HrmEngineLabelCol}`) : 0;
|
||||
const itemProps = {
|
||||
ratio1to2: labelVisible && custLabelCol == null,
|
||||
style: {
|
||||
marginLeft: 0 //labelVisible ? -30 : 0
|
||||
},
|
||||
tipPosition: 'bottom',
|
||||
labelCol: {
|
||||
span: labelCol
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 24 - labelCol
|
||||
}
|
||||
}
|
||||
|
||||
const textAreaProps = {
|
||||
minRows: 4,
|
||||
maxRows: 4
|
||||
}
|
||||
|
||||
formFields.map((fields, i) => {
|
||||
let formItems = [];
|
||||
fields.items.map((field, index) => {
|
||||
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
|
||||
const showCheckbox = field.checkbox || false;
|
||||
let label = field.label;
|
||||
if (showCheckbox)
|
||||
label = <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@1id63c@${index}`} content={label} value={field.checkboxValue} onChange={(v) => {field.checkboxValue = v === '1'; onSelectedChangeHandle && onSelectedChangeHandle(field, v)}}/>
|
||||
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7zfwo9@${index}`} fieldConfig={{...field, ...textAreaProps, hasBorder: field.viewAttr === 1}} form={form} formParams={formParams} onChange={datas => onSwitchChange && onSwitchChange(datas)}/>;
|
||||
} else {
|
||||
coms = customerRender(field, textAreaProps, form, formParams);
|
||||
}
|
||||
Object.assign(itemProps, {
|
||||
label,
|
||||
error: form.getError(field)
|
||||
})
|
||||
let col = 1;
|
||||
if (multiColumn != null) { //检查有哪些字段需要一行显示多个
|
||||
const idx = findIndex(multiColumn, item => item.key === field.domkey[0]);
|
||||
if (idx > -1) {
|
||||
col = field.colSpan || 1;
|
||||
if (multiColumn[idx].labelCol != null) //检查字段是否有配置标题宽度
|
||||
Object.assign(itemProps, {
|
||||
labelCol: {
|
||||
span: multiColumn[idx].labelCol
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 24 - multiColumn[idx].labelCol
|
||||
}
|
||||
})
|
||||
} else {
|
||||
Object.assign(itemProps, {
|
||||
labelCol: {
|
||||
span: labelCol
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 24 - labelCol
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
coms != null && formItems.push({
|
||||
com: (
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@rv2s0m@${index}`} {...itemProps}>
|
||||
{coms}
|
||||
</WeaFormItem>
|
||||
),
|
||||
col
|
||||
})
|
||||
|
||||
if (childrenComponents && childrenComponents[field.domkey[0]]) {
|
||||
childrenComponents[field.domkey[0]]().map(child => formItems.push(child));
|
||||
}
|
||||
})
|
||||
|
||||
groupArr.push(
|
||||
(
|
||||
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@zglygj@${i}`}
|
||||
center={this.props.center != null ? this.props.center : true}
|
||||
needTigger={true}
|
||||
title={formFields.length < 2 ? null : fields.title}
|
||||
showGroup={true}
|
||||
items={formItems}
|
||||
col={col}
|
||||
fontSize={14}/>
|
||||
)
|
||||
)
|
||||
});
|
||||
|
||||
return groupArr;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
formFields,
|
||||
className,
|
||||
showError
|
||||
} = this.props;
|
||||
if (formFields == null)
|
||||
return (<div></div>)
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
{this.renderForm()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,220 @@
|
|||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
import {
|
||||
WeaTab
|
||||
} from 'ecCom';
|
||||
import {
|
||||
observer
|
||||
} from 'mobx-react';
|
||||
import {
|
||||
Button
|
||||
} from 'antd';
|
||||
import AdvanceSearchFormInfo from './AdvanceSearchFormInfo';
|
||||
import {
|
||||
cloneDeep
|
||||
} from 'lodash';
|
||||
import {
|
||||
calFormHeight
|
||||
} from '../../util/index';
|
||||
import {
|
||||
i18n
|
||||
} from '../../public/i18n';
|
||||
|
||||
@observer
|
||||
export default class Tabs extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showSearchAd: false,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.setState({
|
||||
showSearchAd: false,
|
||||
})
|
||||
}
|
||||
|
||||
doSearch = () => {
|
||||
const {
|
||||
conditionForm,
|
||||
tabConfig,
|
||||
activeTabInfo,
|
||||
} = this.props;
|
||||
|
||||
let tabInfo = tabConfig.tabs[activeTabInfo.activeTabIndex];
|
||||
tabInfo.doSearch(conditionForm.getFormParams());
|
||||
this.setState({
|
||||
showSearchAd: false
|
||||
});
|
||||
}
|
||||
|
||||
doReset = () => {
|
||||
const {
|
||||
conditionForm
|
||||
} = this.props;
|
||||
conditionForm.resetConditionValue();
|
||||
}
|
||||
|
||||
doCancel = () => {
|
||||
const {
|
||||
conditionForm
|
||||
} = this.props;
|
||||
this.setState({
|
||||
showSearchAd: false,
|
||||
});
|
||||
}
|
||||
|
||||
getTabButtonsAd() {
|
||||
return [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xygary`} type="primary" onClick={this.doSearch}>{i18n.button.search()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5l4fsp`} type="ghost" onClick={this.doReset}>{i18n.button.reset()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@yktxms`} type="ghost" onClick={this.doCancel}>{i18n.button.cancel()}</Button>)
|
||||
]
|
||||
}
|
||||
|
||||
renderForm = () => {
|
||||
const {
|
||||
conditionForm,
|
||||
conditionFormFields,
|
||||
itemRender
|
||||
} = this.props;
|
||||
const {
|
||||
isFormInit
|
||||
} = conditionForm;
|
||||
if (isFormInit)
|
||||
return <AdvanceSearchFormInfo ecId={`${this && this.props && this.props.ecId || ''}_AdvanceSearchFormInfo@5us8i8`} form={conditionForm} formFields={conditionFormFields} itemRender={itemRender}/>
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
initTab = (props) => {
|
||||
return React.cloneElement(<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@3x9y9h`}/>, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
|
||||
renderTabNav = () => {
|
||||
//data
|
||||
const {
|
||||
activeTabInfo,
|
||||
tabConfig,
|
||||
tabChangeHandle,
|
||||
tabBtnDef,
|
||||
conditionForm,
|
||||
conditionFormFields,
|
||||
advanceHeight,
|
||||
store,
|
||||
leftStyle,
|
||||
} = this.props;
|
||||
|
||||
let tabInfo = tabConfig.tabs[activeTabInfo.activeTabIndex];
|
||||
let tabsData = cloneDeep(tabConfig.tabs) || [];
|
||||
tabsData != null && tabsData.map(tab => {
|
||||
if (typeof(tab.title) == 'function'){
|
||||
tab.title = tab.title();
|
||||
}
|
||||
delete tab.topButtonDef;
|
||||
delete tab.tabButtonDef;
|
||||
});
|
||||
let tabProps = {
|
||||
type: 'editable-inline',
|
||||
datas: tabsData,
|
||||
keyParam: tabConfig.keyParam,
|
||||
selectedKey: tabConfig.activeTabKey,
|
||||
onChange: tabChangeHandle,
|
||||
leftStyle
|
||||
}
|
||||
tabBtnDef && Object.assign(tabProps, {
|
||||
buttons: tabBtnDef
|
||||
});
|
||||
const searchType = tabInfo.searchType || [];
|
||||
if (searchType.length > 0) {
|
||||
Object.assign(tabProps, {
|
||||
searchType: searchType,
|
||||
onSearch: (value) => {
|
||||
if (searchType.indexOf('advanced') >= 0) {
|
||||
tabInfo.doSearch(conditionForm.getFormParams());
|
||||
} else {
|
||||
tabInfo.doSearch({
|
||||
[tabInfo.searchKey]: value
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
if (searchType.indexOf('advanced') >= 0 && conditionForm != null && conditionForm.isFormInit) {
|
||||
const formParams = conditionForm.getFormParams();
|
||||
Object.assign(tabProps, {
|
||||
searchsBaseValue: formParams[tabInfo.searchKey] || '',
|
||||
showSearchAd: this.state.showSearchAd,
|
||||
setShowSearchAd: (bool) => {
|
||||
this.setState({
|
||||
showSearchAd: bool
|
||||
})
|
||||
},
|
||||
onSearchChange: (value) => conditionForm.updateFields({
|
||||
[tabInfo.searchKey]: {
|
||||
value
|
||||
}
|
||||
}, false),
|
||||
buttonsAd: this.getTabButtonsAd(),
|
||||
searchsAd: <div
|
||||
onKeyDown={(e) =>{
|
||||
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||
tabInfo.doSearch(conditionForm.getFormParams());
|
||||
this.setState({
|
||||
showSearchAd: false
|
||||
})
|
||||
}
|
||||
} }
|
||||
>{this.renderForm()}</div>
|
||||
});
|
||||
|
||||
Object.assign(tabProps, {
|
||||
//advanceHeight: calFormHeight(conditionFormFields.length, _.keys(formParams).length)
|
||||
advanceHeight: advanceHeight ? advanceHeight : calFormHeight(conditionFormFields.length, conditionForm.fieldArr)
|
||||
});
|
||||
}
|
||||
}
|
||||
tabConfig.onTabEdit && Object.assign(tabProps, {
|
||||
onEdit: tabConfig.onTabEdit
|
||||
});
|
||||
|
||||
return this.initTab(tabProps);
|
||||
}
|
||||
|
||||
renderTabContent = () => {
|
||||
const {
|
||||
children,
|
||||
activeTabInfo,
|
||||
rightMenu,
|
||||
store
|
||||
} = this.props;
|
||||
if (Array.isArray(children)) {
|
||||
return React.cloneElement(children[activeTabInfo.activeTabIndex], {
|
||||
rightMenu,
|
||||
activeTabIndex: activeTabInfo.activeTabIndex,
|
||||
store
|
||||
});
|
||||
} else {
|
||||
return React.cloneElement(children, {
|
||||
rightMenu,
|
||||
activeTabIndex: activeTabInfo.activeTabIndex,
|
||||
store
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
tabConfig
|
||||
} = this.props;
|
||||
return (
|
||||
<div style={{width: '100%', height: '100%'}}>
|
||||
{tabConfig.tabs.length > 0 && this.renderTabNav()}
|
||||
{tabConfig.tabs.length > 0 && this.renderTabContent()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import React, {Component} from 'react';
|
||||
import {WeaLocaleProvider} from 'ecCom';
|
||||
|
||||
const {getLabel} = WeaLocaleProvider;
|
||||
|
||||
export default class Tip extends Component{
|
||||
render(){
|
||||
const label = this.props.label || getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!');
|
||||
return (
|
||||
<div className={'data_security_tip_info' || this.props.className}><i className="icon-coms-Invalid" />{label}</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import React, {Component} from 'react';
|
||||
import {observer} from 'mobx-react';
|
||||
import { WeaAuth } from "ecCom";
|
||||
|
||||
@observer
|
||||
export default class ViewRangeForm extends Component{
|
||||
render(){
|
||||
const {store} = this.props;
|
||||
const {viewRangeAuthProps} = store;
|
||||
|
||||
return (
|
||||
<WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@xuisnk`} {...viewRangeAuthProps}>
|
||||
</WeaAuth>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import React, {Component} from 'react';
|
||||
import {observer} from 'mobx-react';
|
||||
import { WeaDialog, WeaTab } from "ecCom";
|
||||
import {WeaTableNew} from "comsMobx";
|
||||
|
||||
const {WeaTable} = WeaTableNew;
|
||||
|
||||
@observer
|
||||
export default class ViewRangeSetting extends Component{
|
||||
render(){
|
||||
const {store} = this.props;
|
||||
const {dialogProps, rangeViewTabProps, rangeViewTableProps} = store;
|
||||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@hsilps`} {...dialogProps}>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@36lgpj`} {...rangeViewTabProps} />
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@fjlkzk`} {...rangeViewTableProps} />
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ import Job from "./components/job/Job";
|
|||
import JobExtend from "./components/job/JobExtend";
|
||||
import Department from "./components/department/department";
|
||||
import DepartmentExtendStore from "./components/department/departmentExtend";
|
||||
import FieldDefined from "./components/fieldDefinedSet/FieldDefined";
|
||||
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
|
@ -77,6 +78,8 @@ const Routes = (
|
|||
<Route key="staff" path="staff" component={Staff} />
|
||||
<Route key="job" path="job" component={Job} />
|
||||
<Route key="jobExtend" path="jobExtend/:id" component={JobExtend} />
|
||||
<Route name="fieldDef" path="fieldDef/:type" component={FieldDefined} />
|
||||
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export const i18n = {
|
|||
newDept: () => getLabel(386246, '新建部门'),
|
||||
mergeDept:()=> getLabel(386246, '合并部门'),
|
||||
transferDept:()=> getLabel(386246, '转移部门'),
|
||||
|
||||
typeName: () => getLabel(129927, '类型名称'),
|
||||
|
||||
|
||||
authorizationGroup: () => getLabel(492, '权限组'),
|
||||
|
|
@ -842,6 +842,8 @@ export const i18n = {
|
|||
},
|
||||
button: {
|
||||
back: () => getLabel(1290, '返回'),
|
||||
createType: () => getLabel(30131, '新建类型'),
|
||||
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
||||
|
||||
batchOpen: () => getLabel(534249, '批量解锁'),
|
||||
collect: () => getLabel(28111, '收藏'),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,627 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-09 10:14:20
|
||||
* @LastEditTime: 2022-06-16 18:26:17
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/stores/baseStore.js
|
||||
*/
|
||||
import {
|
||||
observable,
|
||||
action,
|
||||
computed,
|
||||
extendObservable,
|
||||
autorun
|
||||
} from 'mobx';
|
||||
import {
|
||||
Button,
|
||||
message,
|
||||
Modal
|
||||
} from 'antd';
|
||||
import {
|
||||
WeaForm,
|
||||
WeaTableNew,
|
||||
WeaLogView
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
WeaTableEdit,
|
||||
WeaBrowser,
|
||||
WeaButtonIcon,
|
||||
WeaCascader,
|
||||
WeaLoadingGlobal
|
||||
} from 'ecCom';
|
||||
import classnames from 'classnames';
|
||||
import * as mobx from 'mobx';
|
||||
import {
|
||||
authorized,
|
||||
detachable,
|
||||
checkAuthAndDetach,
|
||||
getPinYin
|
||||
} from '../apis/common';
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
// import {
|
||||
// logTypeDef
|
||||
// } from '../public/logType';
|
||||
import has from 'lodash/has';
|
||||
import moment from 'moment';
|
||||
|
||||
const {OptionManage} = WeaCascader;
|
||||
|
||||
const confirm = Modal.confirm;
|
||||
const info = Modal.confirm;
|
||||
const {
|
||||
LogStore
|
||||
} = WeaLogView;
|
||||
|
||||
export default class HrmBaseStore {
|
||||
/********************* unobservable list *********************/
|
||||
//logTypeDef = logTypeDef;
|
||||
getPinYin = getPinYin;
|
||||
toJS = mobx.toJS;
|
||||
moment = moment;
|
||||
tabConfig = { //模块主tab组件参数,通过继承来重写
|
||||
keyParam: 'viewCondition',
|
||||
activeTabKey: ''
|
||||
};
|
||||
basicDialogParams = {
|
||||
icon: "icon-coms-hrm",
|
||||
iconBgcolor: "#217346",
|
||||
style: {
|
||||
width: 520,
|
||||
height: 300
|
||||
},
|
||||
visible: false,
|
||||
title: '',
|
||||
}
|
||||
menuIconCollection = {
|
||||
save: 'icon-coms-Preservation',
|
||||
create: 'icon-coms-New-Flow',
|
||||
modify: 'icon-coms-edit',
|
||||
remove: 'icon-coms-Batch-delete',
|
||||
copy: 'icon-coms-form-copy',
|
||||
entry: 'icon-coms-edit',
|
||||
setting: 'icon-coms-Flow-setting',
|
||||
log: 'icon-coms-Print-log',
|
||||
multiModify: 'icon-coms-BatchEditing',
|
||||
import: ' icon-coms-leading-in',
|
||||
export: 'icon-coms-export',
|
||||
search: 'icon-coms-search',
|
||||
sync: 'icon-coms-Update-synchronization',
|
||||
done: 'icon-coms-Upload-successfully',
|
||||
selectAll: 'icon-coms-batch'
|
||||
}
|
||||
getBasicMenus = (logTypeKey, targetId = null) => {
|
||||
let arr = [];
|
||||
// if(logTypeKey){
|
||||
// arr.push({
|
||||
// key: '99',
|
||||
// content: i18n.button.log(),
|
||||
// icon: <i className={this.menuIconCollection.log}/>,
|
||||
// onClick: () => this.showLog({logSmallType: this.logTypeDef[logTypeKey], targetId})
|
||||
// });
|
||||
// }
|
||||
return arr;
|
||||
}
|
||||
|
||||
generateLogMenu = (logType = '4', logTypeKey, targetId = null) => {
|
||||
let arr = [];
|
||||
if(logTypeKey){
|
||||
arr.push({
|
||||
key: '99',
|
||||
content: i18n.button.log(),
|
||||
icon: <i className={this.menuIconCollection.log}/>,
|
||||
onClick: () => this.showLog({logType, logSmallType: this.logTypeDef[logTypeKey], targetId})
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
dialogPropsDef = {
|
||||
moduleName: 'hrm',
|
||||
visible: false,
|
||||
title: '',
|
||||
moreBtn: {
|
||||
datas: []
|
||||
},
|
||||
// hasScroll: true
|
||||
}
|
||||
refsDialogPropsDef = {
|
||||
moduleName: 'hrm',
|
||||
visible: false,
|
||||
title: '',
|
||||
}
|
||||
dateSwitchTypeList = ['year', 'month', 'week', 'day'];
|
||||
formTarget = {}; //form collection
|
||||
opId = null; //数据操作对象主键ID
|
||||
authorizationInfo = {};
|
||||
|
||||
/**
|
||||
* 权限验证
|
||||
* @param {String} moduleName [模块名]
|
||||
* @param {Object} params [restful request url params]
|
||||
* @param {Function} callback [验证通过后的callback function]
|
||||
* @return {null}
|
||||
*/
|
||||
checkAuthorized = (moduleName, params, callback, apiMethod, needCheckDetachable = false) => {
|
||||
if (needCheckDetachable) {
|
||||
checkAuthAndDetach(moduleName, params, apiMethod).then(rs => {
|
||||
rs.map((result, index) => {
|
||||
if (result.status === '1') {
|
||||
switch (index) {
|
||||
case 0:
|
||||
const init = !result.hasRight;
|
||||
this.authorizationInfo = result;
|
||||
this.containerInitFinished = {
|
||||
...this.containerInitFinished,
|
||||
init,
|
||||
authorized: result.hasRight,
|
||||
userId: result.userId
|
||||
}
|
||||
this.containerInitFinished.authorized && callback && callback();
|
||||
break;
|
||||
case 1:
|
||||
this.containerInitFinished.detachable = result.detachable === '0' ? false : true
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
authorized(moduleName, params, apiMethod).then((data) => {
|
||||
if (data.status === '1') {
|
||||
const init = !data.hasRight;
|
||||
this.authorizationInfo = data;
|
||||
this.containerInitFinished = {
|
||||
init,
|
||||
authorized: data.hasRight
|
||||
}
|
||||
this.containerInitFinished.authorized && callback && callback();
|
||||
}
|
||||
}, error => {
|
||||
this.containerInitFinished = {
|
||||
init: true,
|
||||
authorized: false
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取激活的tab页下标
|
||||
* @param {Array} tabs [tabData数组]
|
||||
* @param {String} key [tabKey]
|
||||
* @return {Integer} [tab下标]
|
||||
*/
|
||||
getTabIndex(tabs, key) {
|
||||
if (tabs != null && tabs.length > 0) {
|
||||
return _.findIndex(tabs, {
|
||||
viewCondition: key
|
||||
})
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取WeaTop按钮、WeaTab按钮以及右键菜单列表
|
||||
* @param {Object} tabConfig [description]
|
||||
* @return {Object} [description]
|
||||
*/
|
||||
btnsAndMenus = (tabConfig) => {
|
||||
let topBtnDef = [], //WeaTop按钮
|
||||
menuDef = [], //右键菜单
|
||||
tabBtnDef = []; //WeaTab按钮
|
||||
|
||||
const activeTabIndex = this.getTabIndex(tabConfig.tabs, tabConfig.activeTabKey);
|
||||
if (tabConfig.activeTabKey === '' || activeTabIndex < 0) {
|
||||
return {
|
||||
btns: topBtnDef,
|
||||
menus: menuDef,
|
||||
tabBtnDef: tabBtnDef
|
||||
}
|
||||
}
|
||||
const tab = tabConfig.tabs[activeTabIndex];
|
||||
const {
|
||||
topButtonDef,
|
||||
tabButtonDef
|
||||
} = tab;
|
||||
topButtonDef && topButtonDef.map((def, idx) => { //组织WeaTop按钮
|
||||
const lbl = (typeof(def.label) == 'function' ? def.label() : def.label);
|
||||
switch (def.comType) {
|
||||
case 'button':
|
||||
let disabled = false;
|
||||
if (def.checkAction)
|
||||
disabled = this[def.checkAction];
|
||||
topBtnDef.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@rke64z@${idx}`} type={def.type} onClick={def.onClickHandle} disabled={disabled || def.disabled}>{lbl}</Button>);
|
||||
menuDef.push({ //组织右键菜单
|
||||
key: `$top-btn-${idx}`,
|
||||
content: lbl,
|
||||
icon: <i className={def.rightMenuIcon || def.icon}/>,
|
||||
onClick: def.onClickHandle,
|
||||
disabled: disabled || def.disabled || false
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
tabButtonDef && tabButtonDef.map((def, idx) => { //组织WeaTab按钮
|
||||
const lab = (typeof(def.label) == 'function' ? def.label() : def.label);
|
||||
let disabled = false;
|
||||
if (def.checkAction)
|
||||
disabled = this[def.checkAction];
|
||||
switch (def.comType) {
|
||||
case 'button':
|
||||
const classes = classnames({
|
||||
[def.icon]: true,
|
||||
'tabBtn': true,
|
||||
'tabBtn-active': !disabled,
|
||||
'tabBtn-disable': disabled
|
||||
});
|
||||
if (def.brower == null) {
|
||||
tabBtnDef.push(
|
||||
<i
|
||||
className={classes}
|
||||
title={lab}
|
||||
onClick={!disabled ? def.onClickHandle : null}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
switch (def.brower) {
|
||||
case 'authorization':
|
||||
tabBtnDef.push(
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@b3ewk2@${idx}`}
|
||||
customized
|
||||
tabs={[{name: i18n.label.byList(), key: '1', dataParams: {list: 1}},{name: i18n.label.byAuthGroup(), key: '2'}]}
|
||||
title={i18n.label.selectAuthorization()}
|
||||
icon={'icon-coms-hrm'}
|
||||
iconBgcolor={'#217346'}
|
||||
type={'hrmRoleRight'}
|
||||
inputStyle={{width: 200}}
|
||||
onChange={(ids, names, datas) => def.onClickHandle(ids, names, datas)}
|
||||
isSingle={false}
|
||||
>
|
||||
<i
|
||||
className={classes}
|
||||
title={lab}
|
||||
/>
|
||||
</WeaBrowser>
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'WeaButtonIcon':
|
||||
tabBtnDef.push(
|
||||
<WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@txomye@${idx}`} buttonType={def.icon} type='primary' disabled={disabled} onClick={!disabled ? def.onClickHandle : null} />
|
||||
);
|
||||
break;
|
||||
case 'customer':
|
||||
tabBtnDef.push(def.coms)
|
||||
break;
|
||||
default:
|
||||
tabBtnDef.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@iji04g@${idx}`} type={def.btnType || 'primary'} onClick={!disabled ? def.onClickHandle : null} disabled={disabled}>{lab}</Button>
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
// menuDef.push(...this.getBasicMenus()); //组织右键菜单
|
||||
return {
|
||||
btns: topBtnDef,
|
||||
menus: menuDef,
|
||||
tabBtnDef: tabBtnDef
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* @param {String} com [dialog's name]
|
||||
* @param {Boolean} val [visible: true or false]
|
||||
* @param {String} title [dialog's title]
|
||||
* @param {Function} callback [callback function]
|
||||
* @return {null}
|
||||
*/
|
||||
setDialogVisible = (com, val, title = '', callback) => {
|
||||
this.dialogParams[com] = {
|
||||
...this.dialogParams[com],
|
||||
visible: val,
|
||||
title: title
|
||||
};
|
||||
callback && callback();
|
||||
}
|
||||
|
||||
confirmInfo = (props) => {
|
||||
confirm({ ...props,
|
||||
title: props.title || i18n.confirm.defaultTitle(),
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel()
|
||||
});
|
||||
}
|
||||
|
||||
hint = (props) => {
|
||||
info({ ...props,
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
okText: i18n.button.ok(),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化formStore
|
||||
* @param {String} formName [form's name]
|
||||
* @param {Array} fields [form field definition]
|
||||
* @return {null}
|
||||
*/
|
||||
setFormData = (formName, fields) => {
|
||||
this.formTarget[`${formName}Fields`] = fields;
|
||||
this.formTarget[formName] = new WeaForm();
|
||||
this.formTarget[formName].initFormFields(fields);
|
||||
//this.formTarget[formName].setCondition(fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求高级搜索表单的通用方法
|
||||
* @param {String} form [form's name]
|
||||
* @param {Function} api [restful api function]
|
||||
* @param {Object} params [restful request url params]
|
||||
* @param {Function} callback [callback function]
|
||||
* @return {null}
|
||||
*/
|
||||
requestFormData = (form, api, params = {}, callback) => {
|
||||
api(params).then((data) => {
|
||||
if (data.status === '1') {
|
||||
this.setFormData(form, data.formField);
|
||||
callback && callback();
|
||||
}
|
||||
}, error => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表格数据的通用方法
|
||||
* @param {String} tableStore [tableStore's name]
|
||||
* @param {Function} api [restful api function]
|
||||
* @param {Object} params [restful request url params]
|
||||
* @return {null}
|
||||
*/
|
||||
requestTableData = (tableStore, api, params = {}, callback) => {
|
||||
api(params).then(data => {
|
||||
if (data.status === '1') {
|
||||
tableStore.getDatas(data.sessionkey, 1);
|
||||
callback && callback();
|
||||
} else
|
||||
message.error(data.message);
|
||||
}, error => {
|
||||
message.error(i18n.message.actionError());
|
||||
});
|
||||
}
|
||||
|
||||
showLog = (logTypeParams) => {
|
||||
window.setLogViewProps({
|
||||
...logTypeParams
|
||||
});
|
||||
}
|
||||
/********************* unobservable list *********************/
|
||||
|
||||
/********************* observable list *********************/
|
||||
@observable containerInitFinished = { //模块初始化状态
|
||||
init: false,
|
||||
authorized: false,
|
||||
detachable: false
|
||||
}
|
||||
@observable topTabCount = {}; //WeaTab统计值
|
||||
@observable rDate = new Date().getTime(); //状态刷新,组件引用该值监听变化重新render
|
||||
@observable showError = new Date().getTime(); //状态刷新,组件引用该值监听变化重新render
|
||||
@observable dialogParams = {}; //模态框参数
|
||||
@observable i18nLoaded = false;
|
||||
|
||||
monitorI18n = () => {
|
||||
this.i18nLoaded;
|
||||
}
|
||||
|
||||
monitor = autorun(this.monitorI18n)
|
||||
/********************* observable list *********************/
|
||||
|
||||
/********************* action list *********************/
|
||||
@action definedColumn = (table, callback) => {//显示列定义
|
||||
table.setColSetVisible(true);
|
||||
table.tableColSet(true, callback);
|
||||
}
|
||||
/********************* action list *********************/
|
||||
|
||||
/********************* tableEdit props & functions *********************/
|
||||
editTable = {}; //可编辑表格refs对象
|
||||
editTableConfig = { //WeaTableEdit参数定义,通过继承来重写
|
||||
showTitle: false,
|
||||
draggable: true,
|
||||
showAdd: false,
|
||||
showDelete: false,
|
||||
showCopy: false,
|
||||
deleteConfirm: true
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置WeaTableEdit的refs对象
|
||||
* @param {Object} refs [WeaTableEdit]
|
||||
*/
|
||||
setEditTable = (refs, name) => {
|
||||
this.editTable[name] = refs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过refs对WeaTableEdit进行添加行、删除行、复制行操作
|
||||
* @param {String} type [action]
|
||||
*/
|
||||
@action
|
||||
recordOP = (target, type, callback = null) => {
|
||||
switch (type) {
|
||||
case 'add':
|
||||
target.refs.edit.doAdd()
|
||||
break;
|
||||
case 'remove':
|
||||
target.refs.edit.doDelete()
|
||||
break;
|
||||
case 'copy':
|
||||
target.refs.edit.doCopy()
|
||||
break;
|
||||
case 'valid':
|
||||
return target.refs.edit.doRequiredCheck()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
generateTableEditRightMenuInfo = (tableConfig) => {
|
||||
let rightMenuInfo = [];
|
||||
const keys = Object.keys(tableConfig);
|
||||
keys.map((key, index) => {
|
||||
rightMenuInfo.push({
|
||||
key: `8${index + 1}`,
|
||||
disabled: tableConfig[key].disabled,
|
||||
content: tableConfig[key].content,
|
||||
icon: <i className={this.menuIconCollection[key]}/>,
|
||||
onClick: tableConfig[key].callback
|
||||
})
|
||||
})
|
||||
return rightMenuInfo;
|
||||
}
|
||||
|
||||
generateTableSelectedData = (target) => {
|
||||
let selectedData = {};
|
||||
this.tableEditConfig[target].columns.map(column => {
|
||||
column.hasOwnProperty('checkType') && column.checkType === 'checkbox' && Object.assign(selectedData, {
|
||||
[column.dataIndex]: []
|
||||
})
|
||||
})
|
||||
return selectedData;
|
||||
}
|
||||
|
||||
generateOtherParams = (componentType, used, domkey) => {
|
||||
let otherParams = {
|
||||
customProps: {
|
||||
'root': {
|
||||
viewAttr: 1
|
||||
}
|
||||
},
|
||||
optionManageProps: {
|
||||
dialogProps: {
|
||||
icon: "icon-coms-hrm",
|
||||
iconBgcolor: "#217346",
|
||||
},
|
||||
showAdd: !used,
|
||||
showCopy: !used,
|
||||
showDelete: !used,
|
||||
tableEditDraggable: !used
|
||||
}
|
||||
}
|
||||
switch (componentType) {
|
||||
case 'input':
|
||||
Object.assign(otherParams.customProps, {
|
||||
'input': {
|
||||
viewAttr: 1
|
||||
},
|
||||
'input.text': {
|
||||
viewAttr: 1
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'select':
|
||||
Object.assign(otherParams.customProps, {
|
||||
'select': {
|
||||
viewAttr: 1,
|
||||
},
|
||||
// 'select.*': {
|
||||
// parent: { type: "span", className: `${domkey}-clz` }
|
||||
// },
|
||||
});
|
||||
break;
|
||||
}
|
||||
return otherParams;
|
||||
}
|
||||
|
||||
//重新计算列
|
||||
convertData = (datas, target) => {
|
||||
let tData = [],
|
||||
selectedData = this.generateTableSelectedData(target);
|
||||
datas.map((data, index) => {
|
||||
let d = {};
|
||||
Object.assign(d, {
|
||||
...data.record,
|
||||
...data.props,
|
||||
isSysField: data.isSysField
|
||||
});
|
||||
delete d.key;
|
||||
const selectedDataKey = Object.keys(selectedData);
|
||||
selectedDataKey.map(key => {
|
||||
data.record.hasOwnProperty(key) && data.record[key] === '1' && selectedData[key].push(index);
|
||||
})
|
||||
|
||||
if (data.hasOwnProperty('com')) {
|
||||
const keys = Object.keys(data.com);
|
||||
keys.map(key => {
|
||||
if (data.com[key].length > 0) {
|
||||
let comDef = data.com[key][0];
|
||||
if (comDef.type === 'CUSTOMFIELD' && data.hasOwnProperty(comDef.key) && data[comDef.key].length > 0) {
|
||||
Object.assign(d, {
|
||||
[comDef.key]: data[comDef.key],
|
||||
});
|
||||
Object.assign(comDef, {
|
||||
viewAttr: 1,
|
||||
otherParams: this.generateOtherParams(data[comDef.key][0], d.isSysField, d.fieldname),
|
||||
})
|
||||
} else if (comDef.type === 'INPUT' && key != 'fieldname') {
|
||||
comDef.otherParams = {
|
||||
...window.inputType
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Object.assign(d, {
|
||||
com: data.com
|
||||
});
|
||||
}
|
||||
|
||||
tData.push(d);
|
||||
})
|
||||
return {
|
||||
datas: tData,
|
||||
selectedData
|
||||
}
|
||||
}
|
||||
|
||||
getLocale() {
|
||||
return {
|
||||
firstDayOfWeek: 0,
|
||||
lang: {
|
||||
format: {
|
||||
eras: [getLabel(383357, "公元前"), getLabel(383358, "公元")],
|
||||
months: [getLabel(1492, "一月"), getLabel(1493, "二月"), getLabel(383385, "三月"), getLabel(383387, "四月"), getLabel(1496, "五月"), getLabel(383392, "六月"),
|
||||
getLabel(383393, "七月"), getLabel(383394, "八月"), getLabel(383395, "九月"), getLabel(383396, "十月"), getLabel(383397, "十一月"), getLabel(383398, "十二月")
|
||||
],
|
||||
shortMonths: [getLabel(1492, "一月"), getLabel(1493, "二月"), getLabel(383385, "三月"), getLabel(383387, "四月"), getLabel(1496, "五月"), getLabel(383392, "六月"),
|
||||
getLabel(383393, "七月"), getLabel(383394, "八月"), getLabel(383395, "九月"), getLabel(383396, "十月"), getLabel(383397, "十一月"), getLabel(383398, "十二月")
|
||||
],
|
||||
weekdays: [getLabel(24626, "星期天"), getLabel(383399, "星期一"), getLabel(383400, "星期二"), getLabel(383402, "星期三"), getLabel(383403, "星期四"),
|
||||
getLabel(383404, "星期五"), getLabel(383405, "星期六")
|
||||
],
|
||||
shortWeekdays: [getLabel(16106, "周日"), getLabel(16100, "周一"), getLabel(16101, "周二"), getLabel(16102, "周三"), getLabel(16103, "周四"), getLabel(16104, "周五"),
|
||||
getLabel(16105, "周六")
|
||||
],
|
||||
veryShortWeekdays: [getLabel(16106, "周日"), getLabel(16100, "周一"), getLabel(16101, "周二"), getLabel(16102, "周三"), getLabel(16103, "周四"), getLabel(16104, "周五"), getLabel(16105, "周六")],
|
||||
ampms: [getLabel(383408, "上午"), getLabel(383409, "下午")],
|
||||
datePatterns: [`yyyy'${getLabel(383372,"年")}'M'${getLabel(383373,"月")}'d'${getLabel(383374,"日")}' EEEE`, `yyyy'${getLabel(383372,"年")}'M'${getLabel(383373,"月")}'d'${getLabel(383374,"日")}'`, "yyyy-M-d", "yy-M-d"],
|
||||
timePatterns: [`ahh'${getLabel(383411,"时")}'mm'${getLabel(383412,"分")}'ss'${getLabel(383414,"秒")}' 'GMT'Z`, `ahh'${getLabel(383411,"时")}'mm'${getLabel(383412,"分")}'ss'${getLabel(383414,"秒")}'`, "H:mm:ss", "ah:mm"],
|
||||
dateTimePattern: '{date} {time}'
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@action showWeaLoadingGlobal = (tip = '') => WeaLoadingGlobal.start({tip});
|
||||
@action hideWeaLoadingGlobal = () => {
|
||||
WeaLoadingGlobal.end(); // 停止遮罩loading
|
||||
WeaLoadingGlobal.destroy(); // 销毁遮罩loading
|
||||
}
|
||||
/********************* tableEdit props & functions *********************/
|
||||
}
|
||||
|
|
@ -56,9 +56,9 @@ export class CompanyExtendStore {
|
|||
save = () => {
|
||||
if (this.loading)
|
||||
return;
|
||||
this.loading = true;
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.loading = true;
|
||||
if (this.personalEditTables) {
|
||||
const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas,
|
||||
isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -15,6 +15,7 @@ import { StaffStore } from "./staff";
|
|||
import { JobStore } from "./job";
|
||||
import { JobExtendStore } from "./jobextend";
|
||||
import { NumberSetStore } from "./numberSet";
|
||||
import {FieldDefinedStore} from "./fieldDefined";
|
||||
|
||||
module.exports = {
|
||||
simpleOrgStore: new SimpleOrgStore(),
|
||||
|
|
@ -34,4 +35,5 @@ module.exports = {
|
|||
job: new JobStore(),
|
||||
jobExtend: new JobExtendStore(),
|
||||
numberSet: new NumberSetStore(),
|
||||
fieldDefined: new FieldDefinedStore()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,6 +35,35 @@ html {
|
|||
background-color: transparent;
|
||||
}
|
||||
|
||||
//自定义设置
|
||||
.fieldDef{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.wea-tab .wea-search-tab{
|
||||
&>span{
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.status-clz, .sex-clz, .accounttype-clz{
|
||||
a {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabBtn-active {
|
||||
color: #34a2ff;
|
||||
}
|
||||
|
||||
.tabBtn {
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
|
||||
//组织架构图
|
||||
#node {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,36 @@ import { Spin } from 'antd';
|
|||
import { WeaSwitch } from 'comsMobx';
|
||||
import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {
|
||||
indexOf
|
||||
} from 'lodash';
|
||||
import '../style/index.less'
|
||||
|
||||
const dbKeys = ["PERCENT", "PLAN", "PRECISION", "PRIMARY", "PRINT", "PROC", "PROCEDURE", "PUBLIC", "RAISERROR",
|
||||
"READ", "READTEXT", "RECONFIGURE", "REFERENCES", "REPLICATION", "RESTORE", "RESTRICT", "RETURN", "REVOKE",
|
||||
"RIGHT", "ROLLBACK", "ROWCOUNT", "ROWGUIDCOL", "RULE", "SAVE", "SCHEMA", "SELECT", "SESSION_USER", "SET",
|
||||
"SETUSER", "SHUTDOWN", "SOME", "STATISTICS", "SYSTEM_USER", "TABLE", "TEXTSIZE", "THEN", "TO", "TOP", "TRAN",
|
||||
"TRANSACTION", "TRIGGER", "TRUNCATE", "TSEQUAL", "UNION", "UNIQUE", "UPDATE", "UPDATETEXT", "USE", "USER",
|
||||
"VALUES", "VARYING", "VIEW", "WAITFOR", "WHEN", "WHERE", "WHILE", "WITH", "WRITETEXT", "EXCEPT", "EXEC", "EXECUTE",
|
||||
"EXISTS", "EXIT", "FETCH", "FILE", "FILLFACTOR", "FOR", "FOREIGN", "FREETEXT", "FREETEXTTABLE", "FROM", "FULL",
|
||||
"FUNCTION", "GOTO", "GRANT", "GROUP", "HAVING", "HOLDLOCK", "IDENTITY", "IDENTITY_INSERT", "IDENTITYCOL", "IF", "IN",
|
||||
"INDEX", "INNER", "INSERT", "INTERSECT", "INTO", "IS", "JOIN", "KEY", "KILL", "LEFT", "LIKE", "LINENO", "LOAD", "NATIONAL",
|
||||
"NOCHECK", "NONCLUSTERED", "NOT", "NULL", "NULLIF", "OF", "OFF", "OFFSETS", "ON", "OPEN", "OPENDATASOURCE", "OPENQUERY",
|
||||
"OPENROWSET", "OPENXML", "OPTION", "OR", "ORDER", "OUTER", "OVER", "ADD", "ALL", "ALTER", "AND", "ANY", "AS", "ASC", "AUTHORIZATION",
|
||||
"BACKUP", "BEGIN", "BETWEEN", "BREAK", "BROWSE", "BULK", "BY", "CASCADE", "CASE", "CHECK", "CHECKPOINT", "CLOSE", "CLUSTERED",
|
||||
"COALESCE", "COLLATE", "COLUMN", "COMMIT", "COMPUTE", "CONSTRAINT", "CONTAINS", "CONTAINSTABLE", "CONTINUE", "CONVERT", "CREATE",
|
||||
"CROSS", "CURRENT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "DATABASE", "DBCC", "DEALLOCATE",
|
||||
"DECLARE", "DEFAULT", "DELETE", "DENY", "DESC", "DISK", "DISTINCT", "DISTRIBUTED", "DOUBLE", "DROP", "DUMMY", "DUMP", "ELSE", "END", "ERRLVL",
|
||||
"ESCAPE", "ACCESS", "ADD", "ALL", "ALTER", "AND", "ANY", "AS", "ASC", "AUDIT", "BETWEEN", "BY", "CHAR", "CHECK", "CLUSTER", "COLUMN", "COMMENT",
|
||||
"COMPRESS", "CONNECT", "CREATE", "CURRENT", "DATE", "DECIMAL", "DEFAULT", "DELETE", "DESC", "DISTINCT", "DROP", "ELSE", "EXCLUSIVE", "EXISTS",
|
||||
"FILE", "FLOAT", "FOR", "FROM", "GRANT", "GROUP", "HAVING", "IDENTIFIED", "IMMEDIATE", "IN", "INCREMENT", "INDEX", "INITIAL", "INSERT", "INTEGER",
|
||||
"INTERSECT", "INTO", "IS", "LEVEL", "LIKE", "LOCK", "LONG", "MAXEXTENTS", "MINUS", "MLSLABEL", "MODE", "MODIFY", "NOAUDIT", "NOCOMPRESS", "NOT",
|
||||
"NOWAIT", "NULL", "NUMBER", "OF", "OFFLINE", "ON", "ONLINE", "OPTION", "OR", "ORDER", "PCTFREE", "PRIOR", "PRIVILEGES", "PUBLIC", "RAW", "RENAME",
|
||||
"RESOURCE", "REVOKE", "ROW", "ROWID", "ROWNUM", "ROWS", "SELECT", "SESSION", "SET", "SHARE", "SIZE", "SMALLINT", "START", "SUCCESSFUL", "SYNONYM",
|
||||
"SYSDATE", "TABLE", "THEN", "TO", "TRIGGER", "UID", "UNION", "UNIQUE", "UPDATE", "USER", "VALIDATE", "VALUES", "VARCHAR", "VARCHAR2", "VIEW", "WHENEVER",
|
||||
"WHERE", "WITH"
|
||||
]
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
export const getSearchs = (form, condition, col, isCenter) => {
|
||||
const { isFormInit } = form;
|
||||
|
|
@ -72,4 +100,35 @@ export const renderNoData = () => (
|
|||
export const isEmpty = (obj) =>{
|
||||
for(var n in obj){return false}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
export const calFormHeight = (groupLength, children) => {
|
||||
let childrenLength = 0;
|
||||
children.map(c => {
|
||||
if (c.colSpan != null) {
|
||||
childrenLength += c.colSpan == 2 ? 1 : 2;
|
||||
} else
|
||||
childrenLength += 1;
|
||||
})
|
||||
let height = (childrenLength / 2 + childrenLength % 2) * 52 + 10;
|
||||
if (groupLength > 1)
|
||||
height += groupLength * 45;
|
||||
if (height > 300)
|
||||
return 300;
|
||||
return height;
|
||||
}
|
||||
|
||||
export const validDBKeys = (value) => {
|
||||
if (indexOf(dbKeys, value.toUpperCase()) >= 0) {
|
||||
message.error("不能使用数据库保留字作为字段名!");
|
||||
return {
|
||||
isValid: false,
|
||||
value: ''
|
||||
};
|
||||
}
|
||||
return {
|
||||
isValid: true,
|
||||
value
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue