| | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | type: PropTypes.any, // type为"card"时,只可选单行或不选行 |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | |
| | | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | const { card, type } = this.props |
| | | |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | let _opentype = card.OpenType // 打开方式 |
| | |
| | | } else if (item.key === 'icon') { |
| | | item.options = btnIcons |
| | | } else if (item.key === 'Ot') { |
| | | if (card.pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (card.pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (['innerpage', 'blank', 'tab', 'popview', 'excelIn'].includes(_opentype)) { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | |
| | | * 3、切换标签类型,重置可选标签 |
| | | */ |
| | | openTypeChange = (key, value) => { |
| | | const { card } = this.props |
| | | const { card, type } = this.props |
| | | |
| | | if (key === 'OpenType') { |
| | | let _options = this.getOptions(value, this.state.interType, this.state.funcType, card.pageTemplate) |
| | |
| | | if (item.key === 'intertype') { |
| | | _fieldval.intertype = this.state.interType |
| | | } else if (item.key === 'Ot') { |
| | | if (['innerpage', 'blank', 'tab', 'popview'].includes(value)) { |
| | | if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (['innerpage', 'blank', 'tab', 'popview'].includes(value)) { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } else if (value === 'excelIn') { |
| | |
| | | if (item.key === 'intertype') { |
| | | _fieldval.intertype = this.state.interType |
| | | } else if (item.key === 'Ot' && value === 'print') { |
| | | item.options = this.state.requireOptions |
| | | if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | let _fieldval = {} |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'Ot' && value === 'insert') { |
| | | if (item.key === 'Ot' && type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (item.key === 'Ot' && value === 'insert') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value)) |
| | | } else if (item.key === 'Ot') { |
| | | item.options = this.state.requireOptions |
| | |
| | | if (value === 'pay') { |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } else if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } |
| | |
| | | } |
| | | |
| | | onChange = (e, key) => { |
| | | const { type } = this.props |
| | | const { openType } = this.state |
| | | let value = e.target.value |
| | | |
| | |
| | | } else if (item.key === 'sysInterface') { |
| | | item.initVal = 'false' |
| | | } else if (item.key === 'Ot') { |
| | | item.options = this.state.requireOptions |
| | | if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else { |
| | | item.options = this.state.requireOptions |
| | | } |
| | | } |
| | | return item |
| | | }) |