| | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | const columnTypeOptions = { |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist', 'linkmenu'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist', 'linkmenu'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale'] |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | |
| | | let _options = null |
| | | |
| | | if (_type === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist', 'linkmenu'] |
| | | } else if (_type === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist', 'linkmenu'] |
| | | } else if (_type === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (_type === 'picture') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale'] |
| | | } |
| | | let _options = columnTypeOptions[_type] |
| | | |
| | | this.setState({ |
| | | menulist: _menulist.options || [], |
| | |
| | | |
| | | typeChange = (key, value) => { |
| | | if (key === 'type') { |
| | | let _options = null |
| | | |
| | | if (value === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist', 'linkmenu'] |
| | | } else if (value === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist', 'linkmenu'] |
| | | } else if (value === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (value === 'picture') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale'] |
| | | } |
| | | let _options = columnTypeOptions[value] |
| | | |
| | | this.setState({ |
| | | formlist: this.props.formlist.map(item => { |
| | |
| | | MenuNo: cell.MenuNo, |
| | | Ot: cell.Ot, |
| | | PageParam: cell.PageParam, |
| | | LinkUrl: cell.LinkUrl |
| | | LinkUrl: cell.LinkUrl, |
| | | disabled: cell.MenuID === MenuID |
| | | } |
| | | }) |
| | | } |
| | | |
| | | submenu.children = submenu.children.filter(cell => cell.MenuID !== MenuID) |
| | | |
| | | return submenu |
| | | }) |