| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, |
| | | card: PropTypes.any |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | tabs: PropTypes.array // 所有标签页 |
| | | } |
| | | |
| | | state = { |
| | |
| | | interType: null, |
| | | position: null, |
| | | reqOptionSgl: [{ |
| | | MenuID: 'requiredSgl', |
| | | value: 'requiredSgl', |
| | | text: this.props.dict['header.form.requiredSgl'] |
| | | }], |
| | | reqOptionsMutil: [{ |
| | | MenuID: 'notRequired', |
| | | value: 'notRequired', |
| | | text: this.props.dict['header.form.notRequired'] |
| | | }, { |
| | | MenuID: 'requiredSgl', |
| | | value: 'requiredSgl', |
| | | text: this.props.dict['header.form.requiredSgl'] |
| | | }, { |
| | | MenuID: 'required', |
| | | value: 'required', |
| | | text: this.props.dict['header.form.required'] |
| | | }, { |
| | | MenuID: 'requiredOnce', |
| | | value: 'requiredOnce', |
| | | text: this.props.dict['header.form.requiredOnce'] |
| | | }], |
| | | insertUpdateOptions: [{ |
| | | MenuID: '', |
| | | value: '', |
| | | text: this.props.dict['header.form.empty'] |
| | | }, { |
| | | MenuID: 'insert', |
| | | value: 'insert', |
| | | text: this.props.dict['header.form.action.insert'] |
| | | }, { |
| | | MenuID: 'update', |
| | | value: 'update', |
| | | text: this.props.dict['header.form.action.update'] |
| | | }], |
| | | deleteOptions: [{ |
| | | MenuID: '', |
| | | value: '', |
| | | text: this.props.dict['header.form.empty'] |
| | | }, { |
| | | MenuID: 'LogicDelete', |
| | | value: 'LogicDelete', |
| | | text: this.props.dict['header.form.action.LogicDelete'] |
| | | }, { |
| | | MenuID: 'delete', |
| | | value: 'delete', |
| | | text: this.props.dict['header.form.action.delete'] |
| | | }] |
| | | } |
| | |
| | | let _intertype = '' |
| | | let _position = '' |
| | | let _errorType = '' |
| | | let _tabType = '' |
| | | let _linkTab = '' |
| | | let _options = null |
| | | |
| | | this.props.formlist.forEach(form => { |
| | |
| | | _position = form.initVal |
| | | } else if (form.key === 'errorTip') { |
| | | _errorType = form.initVal |
| | | } else if (form.key === 'tabType') { |
| | | _tabType = form.initVal |
| | | } else if (form.key === 'linkTab') { |
| | | _linkTab = form.initVal |
| | | } |
| | | }) |
| | | |
| | | if (_opentype === 'excelIn' || _opentype === 'excelOut') { |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === _tabType) |
| | | let initTab = _tabs.filter(tab => tab.uuid === _linkTab)[0] |
| | | |
| | | if (_opentype === 'popview') { |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (_opentype === 'excelIn' || _opentype === 'excelOut') { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] |
| | | } else { |
| | |
| | | } else { |
| | | item.options = this.state.insertUpdateOptions |
| | | } |
| | | } else if (item.key === 'linkTab') { |
| | | item.options = [ |
| | | { |
| | | value: '', |
| | | text: '新建' |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | if (!initTab) { |
| | | item.initVal = '' |
| | | } |
| | | } |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | |
| | | openTypeChange = (key, value) => { |
| | | if (key === 'OpenType') { |
| | | let _options = null |
| | | if (value === 'excelIn' || value === 'excelOut') { |
| | | |
| | | if (value === 'popview') { |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (value === 'excelIn' || value === 'excelOut') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] |
| | | } else { |
| | |
| | | _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method'] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | openType: value, |
| | | formlist: this.state.formlist.map(item => { |
| | |
| | | } else if (key === 'errorTip') { |
| | | this.setState({ |
| | | errorType: value |
| | | }) |
| | | } else if (key === 'tabType') { |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === value) |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.options = [ |
| | | { |
| | | value: '', |
| | | text: '新建' |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | item.initVal = '' |
| | | item.hidden = true |
| | | } |
| | | return item |
| | | }) |
| | | }, () => { |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.hidden = false |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | |
| | | onChange={(value) => {this.openTypeChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> |
| | | {item.key === 'icon' && option.MenuID && <Icon type={option.MenuID} />} {option.text} |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}> |
| | | {item.key === 'icon' && option.value && <Icon type={option.value} />} {option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | { |
| | | item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio> |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | }) |
| | | } |