| | |
| | | modules: [], |
| | | innerRules: [], |
| | | innertip: '', |
| | | MenuType: '', |
| | | ismain: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, setting } = this.props |
| | | |
| | | let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid, window.GLOB.customMenu.interfaces) |
| | | let menu = window.GLOB.customMenu |
| | | let MenuType = '' |
| | | |
| | | if (menu.parentId === 'BillPrintTemp') { |
| | | MenuType = 'billPrint' |
| | | } |
| | | |
| | | let modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) |
| | | let ismain = false |
| | | |
| | | if (window.GLOB.customMenu.Template === 'BaseTable') { |
| | | if (menu.Template === 'BaseTable') { |
| | | ismain = config.name === '主表' |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | this.setState({modules, innerRules, innertip, setting: _setting, ismain}) |
| | | this.setState({modules, innerRules, innertip, setting: _setting, ismain, MenuType}) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | |
| | | if (['navbar', 'balcony', 'menubar', 'interface'].includes(config.type)) { |
| | | values.onload = 'true' |
| | | } |
| | | |
| | | if (values.interType === 'system' && values.onload === 'false') { |
| | | values.sync = 'false' |
| | | } |
| | | |
| | | // 数据源前端验证 |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中,不可出现字符 -- ,注释请用 /*内容*/', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } else if (/,,/ig.test(values.dataresource)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据源中,不可出现连续的英文逗号(,,)', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | |
| | | render() { |
| | | const { columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { setting, modules, innerRules, innertip } = this.state |
| | | const { setting, modules, innerRules, innertip, MenuType } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | </Col> : null} |
| | | {setting.interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> |
| | | <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={ |
| | | <Tooltip placement="topLeft" title={`使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 ''、 @$ -> */ 或 '';查询替换符 $select@ -> /* 或 ''、 @select$ -> */ 或 '';统计替换符 $sum@ -> /* 或 ''、 @sum$ -> */ 或 ''。`}> |
| | | <Tooltip placement="topLeft" title={`使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 ''、 @$ -> */ 或 ''。`}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 数据源 |
| | | </Tooltip> |
| | |
| | | </Col> |
| | | {/* 数组数据,需设置排序规则 */} |
| | | {config.format === 'array' ? <Col span={8}> |
| | | <Form.Item label="默认排序"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="如果在自定义脚本中使用了@pageSize@或@orderBy@,请在数据源中单独写排序语句。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 默认排序 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('order', { |
| | | initialValue: setting.order || 'ID desc', |
| | | rules: [ |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') ? <Col span={8}> |
| | | {!['navbar', 'balcony', 'menubar'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') && MenuType !== 'billPrint' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'该组件如果受其他组件控制,请选项相应的组件,没有时选“无”。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* 1、不分页且不存在上级模块 */} |
| | | {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}> |
| | | {!['navbar', 'interface', 'calendar'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:仅在使用系统函数,且初始化加载数据时有效,分页请求时无效。'}> |
| | | <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:如菜单未使用后端缓存,则查询语句大于8000字符时无效。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 同步查询 |
| | | </Tooltip> |
| | |
| | | {getFieldDecorator('onload', { |
| | | initialValue: setting.onload || 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}> |
| | | <Radio value="true">加载</Radio> |
| | | <Radio value="false">不加载</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.type === 'interface' ? <Col span={8}> |
| | | {config.type === 'interface' && ((setting.supModule && setting.supModule[0] === 'empty') || MenuType === 'billPrint') ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="初始化加载将在页面加载前执行。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 加载方式 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('loadlevel', { |
| | | initialValue: setting.loadlevel || 'default' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'loadlevel')}}> |
| | | <Radio value="default">默认</Radio> |
| | | <Radio value="init">初始化</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.type === 'interface' && MenuType !== 'billPrint' ? <Col span={8}> |
| | | <Form.Item label="定时器"> |
| | | {getFieldDecorator('timer', { |
| | | initialValue: setting.timer || '' |