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 (
{ this.tabDom = dom }}> setEditTable(editTable, 'fieldDef')} {...tableEditConfig['fieldDef']} /> {/* 新增分组 */} setDialogVisible('editGroupInfo', false)} buttons={getDialogOpButtons()} moreBtn={{ datas: editorDialogRightMenu }} > {/* 新增类型 */} setDialogVisible('editTypeInfo', false)} buttons={getDialogOpButtons()} moreBtn={{ datas: editorDialogRightMenu }} > setDialogVisible('groupInfoSetting', false, '')} buttons={getDialogOpButtons()} moreBtn={{ datas: editorDialogRightMenu }} > setEditTable(editTable, 'groupSetting')} tableProps={{ scroll: { y: 360 } }} {...tableEditConfig['groupSetting']} /> setDialogVisible('createChildInfo', false)} buttons={getDialogOpButtons()} moreBtn={{ datas: editorDialogRightMenu }} > setDialogVisible('childInfoSetting', false, '')} buttons={getDialogOpButtons()} moreBtn={{ datas: editorDialogRightMenu }} > setEditTable(editTable, 'childInfoSetting')} tableProps={{ scroll: { y: 360 } }} {...tableEditConfig['childInfoSetting']} />
) }; }