| | |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 组件配置 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | modules: PropTypes.array, // 可绑定的上级组件 |
| | | columns: PropTypes.array, // 列设置 |
| | | scripts: PropTypes.array, // 自定义脚本 |
| | | } |
| | |
| | | modules: [], |
| | | innerRules: [], |
| | | innertip: '', |
| | | appType: sessionStorage.getItem('appType') |
| | | ismain: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, setting } = this.props |
| | | |
| | | let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid) || [] |
| | | let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid, window.GLOB.customMenu.interfaces) |
| | | let ismain = false |
| | | |
| | | if (window.GLOB.customMenu.Template === 'BaseTable') { |
| | | ismain = config.name === '主表' |
| | | } |
| | | |
| | | modules.unshift({ |
| | | value: 'empty', |
| | |
| | | _setting.supModule = setting.supModule || [] |
| | | _setting.execute = setting.execute || 'true' |
| | | |
| | | this.setState({modules, innerRules, innertip, setting: _setting}) |
| | | if (_setting.supModule.length > 0 && _setting.supModule[0] !== 'empty') { |
| | | let has = MenuUtils.checkSupModules(modules, _setting.supModule.slice(-1)[0]) |
| | | if (!has) { |
| | | _setting.supModule = [] |
| | | } |
| | | } |
| | | |
| | | this.setState({modules, innerRules, innertip, setting: _setting, ismain}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { appType } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.sync = values.sync || 'false' |
| | | |
| | | if (appType === 'mob' && values.useMSearch === 'true') { |
| | | values.syncRefresh = 'true' |
| | | } |
| | | |
| | | // 数据源前端验证 |
| | | if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { |
| | |
| | | render() { |
| | | const { columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { setting, modules, innerRules, appType, innertip } = this.state |
| | | const { setting, modules, innerRules, innertip } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | message: '表名最长为50个字符!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z_]+$/, |
| | | pattern: /^[a-zA-Z@_]+$/, |
| | | message: '表名只可使用字母以及_' |
| | | } |
| | | ] |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface, |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* 1、不分页且不存在上级模块 */} |
| | | {!['navbar', 'interface'].includes(config.type) && !['editable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}> |
| | | {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:仅在使用系统函数,且初始化加载数据时有效,分页请求时无效。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && !['basetable'].includes(config.subtype) ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'优先使用同级的搜索条件组件,同级搜索不存在时,依次向上选取,与当前组件的搜索条件一同用作数据过滤(当前组件的搜索条件优先)。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && setting.useMSearch === 'true' && appType !== 'mob' ? <Col span={8}> |
| | | {config.subtype === 'basetable' && !this.state.ismain ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'外层搜索条件改变时,是否刷新当前组件数据。'}> |
| | | <Tooltip placement="topLeft" title="是否使用主表的搜索条件"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 同步刷新 |
| | | 主表搜索 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('syncRefresh', { |
| | | initialValue: setting.syncRefresh || 'true' |
| | | {getFieldDecorator('useMSearch', { |
| | | initialValue: setting.useMSearch || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> */} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> |
| | | <Form.Item label="初始化数据"> |
| | | {getFieldDecorator('onload', { |