| | |
| | | key: 'field', |
| | | label: this.state.dict['header.form.field'], |
| | | initVal: card.field, |
| | | tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效', |
| | | tooltipClass: 'middle', |
| | | required: true, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_]*$/ig, |
| | | message: '字段名只允许包含数字、字母、汉字以及_' |
| | | }, { |
| | | max: 50, |
| | | message: '字段名最多50个字符!' |
| | | }], |
| | | readonly: false |
| | | }, |
| | | { |
| | |
| | | }, { |
| | | value: 'select', |
| | | text: this.state.dict['header.form.select'] |
| | | }, { |
| | | value: 'multiselect', |
| | | text: this.state.dict['header.form.multiselect'] |
| | | }, { |
| | | value: 'link', |
| | | text: this.state.dict['header.form.link'] |
| | |
| | | label: this.state.dict['header.form.field'], |
| | | initVal: card.field, |
| | | required: true, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | | message: '字段名只允许包含数字、字母、汉字以及_' |
| | | }, { |
| | | max: 50, |
| | | message: '字段名最多50个字符!' |
| | | }], |
| | | readonly: false |
| | | }, |
| | | { |
| | |
| | | |
| | | if (res.type === 'search') { |
| | | if ((res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') { |
| | | let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + res.values.dataSource |
| | | let _datasource = res.values.dataSource |
| | | |
| | | if (/\s/.test(_datasource)) { |
| | | _datasource = '(' + _datasource + ') tb' |
| | | } |
| | | |
| | | let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + _datasource |
| | | if (res.values.type === 'link') { |
| | | sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + res.values.dataSource |
| | | sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + _datasource |
| | | } |
| | | if (res.values.orderBy) { |
| | | sql = sql + ' order by ' + res.values.orderBy + ' ' + res.values.orderType |
| | |
| | | onEnabledChange = () => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({ |
| | | config: {...config, enabled: !config.enabled} |
| | | }) |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单尚未设置数据源,不可启用!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | config: {...config, enabled: !config.enabled} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | onColumnNameChange = () => { |
| | |
| | | <Button |
| | | icon={item.icon} |
| | | style={{marginBottom: '10px'}} |
| | | className={'mk-btn mk-' + item.class} |
| | | className={'config-button mk-btn mk-' + item.class} |
| | | onClick={() => this.setSubConfig(item)} |
| | | >{item.label}</Button> |
| | | </div> |
| | |
| | | <div className="setting"> |
| | | <Card title={'标签(子表)页面配置'} bordered={false} extra={ |
| | | <div> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" defaultChecked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | {/* <Button type="primary" onClick={this.changeTemplate}>{this.state.dict['header.menu.template.change']}</Button> */} |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button> |