| | |
| | | } |
| | | |
| | | state = { |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | columnlist: null, // 显示列 |
| | | loading: false, // 查询显示列关联菜单 |
| | | loading: false, // 查询显示列联动菜单 |
| | | showField: false, // 显示列字段 |
| | | modaltype: '', // 模态框控制 |
| | | card: null // 编辑中元素 |
| | |
| | | * @description 监听到显示列复制时,触发显示列编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.props |
| | | const { columnlist } = this.state |
| | | |
| | | if ( |
| | | nextProps.pasteContent && |
| | | columnlist.length === 0 && |
| | | nextProps.pasteContent.columns && |
| | | nextProps.pasteContent.copyType === 'columns' && |
| | | nextProps.pasteContent.columns.length > 0 |
| | | ) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}) |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(this.props.config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | if (columnlist.filter(col => !col.origin).length === 0) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}, () => { |
| | | this.props.updatecolumn({...config, columns: nextProps.pasteContent.columns}) |
| | | }) |
| | | } |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | this.setState({columnlist: fromJS(nextProps.config.columns).toJS()}) |
| | | } |
| | | } |
| | |
| | | let _param = { |
| | | func: 'sPC_Get_FunMenu', |
| | | ParentID: card.linkmenu[0], |
| | | systemType: options.systemType, |
| | | systemType: options.sysType, |
| | | debug: 'Y' |
| | | } |
| | | |
| | |
| | | confirm({ |
| | | content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} ?`, |
| | | okText: dict['model.confirm'], |
| | | cancelText: this.state.dict['header.cancel'], |
| | | cancelText: this.state.dict['model.cancel'], |
| | | onOk() { |
| | | let _columnlist = fromJS(_this.state.columnlist).toJS() |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | {columnlist && columnlist.length > 0 ? |
| | | <Icon className="column-copy" title="copy" type="copy" onClick={this.copycolumn} /> : null |
| | | } |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={this.onFieldChange} /> |
| | | <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={columnlist} |
| | | setting={config.setting} |
| | |
| | | <Modal |
| | | title={dict['header.modal.column.edit']} |
| | | visible={modaltype === 'columns'} |
| | | width={750} |
| | | width={800} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | </Modal> |
| | | {/* 合并列编辑 */} |
| | | <Modal |
| | | title={dict['header.modal.colspan.edit']} |
| | | title={dict['model.modal.colspan'] + '-' + dict['model.edit']} |
| | | visible={modaltype === 'colspan'} |
| | | width={750} |
| | | width={800} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | <Modal |
| | | title={dict['header.modal.gridbtn.edit']} |
| | | visible={modaltype === 'gridbtn'} |
| | | width={700} |
| | | width={800} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={dict['header.submit']} |
| | | okText={dict['model.submit']} |
| | | onOk={this.markSubmit} |
| | | onCancel={() => { this.setState({ modaltype: '' }) }} |
| | | destroyOnClose |