| | |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | // 重置模态框滚动条 |
| | | .ant-modal-wrap::-webkit-scrollbar { |
| | | .ant-modal-wrap::-webkit-scrollbar, .ant-drawer-wrapper-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-wrap::-webkit-scrollbar-thumb { |
| | | .ant-modal-wrap::-webkit-scrollbar-thumb, .ant-drawer-wrapper-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1); |
| | | background: rgba(0, 0, 0, 0.1); |
| | | } |
| | | .ant-modal-wrap::-webkit-scrollbar-track { |
| | | .ant-modal-wrap::-webkit-scrollbar-track, .ant-drawer-wrapper-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | setting: { }, |
| | | wrap: { name: card.name, width: card.width || 24, datatype: 'static', color: '#1890ff' }, |
| | | wrap: { name: card.name, width: card.width || 24, datatype: 'static', groupLabel: 'show', color: '#1890ff' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' }, |
| | | columns: [], |
| | | scripts: [], |
| | |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="加载时是否显示分组名称。"> |
| | | <Icon type="question-circle" /> |
| | | 分组名称 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('groupLabel', { |
| | | initialValue: wrap.groupLabel || 'show' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="show">显示</Radio> |
| | | <Radio value="hidden">隐藏</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="完成后的颜色"> |
| | | <Icon type="question-circle" /> |
| | | 颜色控制 |
| | |
| | | width: 100%; |
| | | } |
| | | .color-sketch-block { |
| | | margin-top: 6px; |
| | | position: relative; |
| | | top: 6px; |
| | | } |
| | | } |
| | |
| | | import './index.scss' |
| | | |
| | | const { MonthPicker, WeekPicker, RangePicker } = DatePicker |
| | | const { Search } = Input |
| | | const CheckCard = asyncComponent(() => import('@/templates/modalconfig/checkCard')) |
| | | |
| | | const Card = ({ id, card, showField, moveCard, copyCard, findCard, editCard, delCard }) => { |
| | |
| | | |
| | | let formItem = null |
| | | if (card.type === 'text') { |
| | | formItem = (<Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} />) |
| | | if (card.inputType === 'search') { |
| | | formItem = (<Search style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} enterButton />) |
| | | } else { |
| | | formItem = (<Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} />) |
| | | } |
| | | } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { |
| | | formItem = (<Select value={_defaultValue}></Select>) |
| | | } else if (card.type === 'date') { |
| | | formItem = (<DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} />) |
| | | formItem = (<Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} />) |
| | | } else if (card.type === 'dateweek') { |
| | | formItem = (<WeekPicker value={card.initval ? moment().subtract(card.initval * 7, 'days') : null} />) |
| | | } else if (card.type === 'datemonth') { |
| | |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-row"> |
| | | {cards.length > 0 ? <Col key="preaction" className="action pre-action" span={6}> |
| | | <div className="ant-row ant-form-item" style={{lineHeight: '40px', height: '55px', marginBottom: 0}}> |
| | | <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> |
| | | </div> |
| | | <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16"> |
| | | <Button type="primary">搜索</Button> |
| | | {appType !== 'mob' ? <Button style={{ marginLeft: 8 }}>重置</Button> : null} |
| | | <div style={{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}}></div> |
| | | </div> |
| | | </div> |
| | | </Col> : null} |
| | | {cards.map(card => ( |
| | | <Col key={card.uuid} span={card.ratio || 6}> |
| | | <Card |
| | |
| | | /> |
| | | </Col> |
| | | ))} |
| | | {cards.length > 0 ? <Col key="action" className="action" span={6}> |
| | | {cards.length > 0 ? <Col key="nextaction" className="action next-action" span={6}> |
| | | <div className="ant-row ant-form-item" style={{lineHeight: '40px', height: '55px', marginBottom: 0}}> |
| | | <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> |
| | | </div> |
| | |
| | | margin-top: 5px!important; |
| | | } |
| | | } |
| | | .main-search-edit-list:not(.right) { |
| | | .pre-action { |
| | | display: none!important; |
| | | } |
| | | } |
| | | .main-search-edit-list.right { |
| | | .next-action { |
| | | display: none!important; |
| | | } |
| | | >.ant-row { |
| | | >.ant-col { |
| | | float: right; |
| | | } |
| | | >.ant-col.action { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | state = { |
| | | float: this.props.wrap.float, |
| | | roleList: [] |
| | | } |
| | | |
| | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { float, roleList } = this.state |
| | | const { roleList } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {getFieldDecorator('float', { |
| | | initialValue: wrap.float || 'left' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({float: e.target.value})}> |
| | | <Radio.Group> |
| | | <Radio value="left">左对齐</Radio> |
| | | <Radio value="right">右对齐</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {float !== 'right' ? <Col span={12}> |
| | | <Col span={12}> |
| | | <Form.Item label="搜索按钮"> |
| | | {getFieldDecorator('show', { |
| | | initialValue: wrap.show || 'true' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="黑名单"> |
| | | {getFieldDecorator('blacklist', { |
| | |
| | | if (!item.field) return |
| | | |
| | | if (item.type === 'group') { |
| | | if (item.transfer === 'true') { |
| | | _usefulFields.push(item.field) |
| | | } |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.datefield) |
| | | _usefulFields.push(item.datefield + '1') |
| | | } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) { |
| | |
| | | if (!item.field) return |
| | | |
| | | if (item.type === 'group') { |
| | | if (item.transfer === 'true') { |
| | | _usefulFields.push(item.field) |
| | | } |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.datefield) |
| | | _usefulFields.push(item.datefield + '1') |
| | | } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) { |
| | |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id, orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{window.GLOB.urlFields ? ', ' + window.GLOB.urlFields.join(', ') : ''} |
| | | id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id, orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{window.GLOB.urlFields && window.GLOB.urlFields.length > 0 ? ', ' + window.GLOB.urlFields.join(', ') : ''} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10} style={{width: '43%'}}> |
| | |
| | | } |
| | | if (item.type === 'group') { |
| | | let copy = fromJS(item).toJS() |
| | | copy.key = search.datefield |
| | | |
| | | item.value = search.initval && search.initval[0] ? search.initval[0] : '@$@' |
| | | item.match = '=' |
| | | |
| | | copy.key = search.datefield |
| | | copy.type = 'daterange' |
| | | copy.match = 'between' |
| | | copy.value = [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')] |
| | | |
| | | if (search.transfer === 'true') { |
| | | newsearches.push(item) |
| | | } |
| | | newsearches.push(item) |
| | | newsearches.push(copy) |
| | | return |
| | | } else if (item.type === 'date') { |
| | |
| | | <Modal |
| | | title={this.state.dict['model.edit']} |
| | | visible={this.state.settingVisible} |
| | | width={700} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.settingSave} |
| | | onCancel={() => { this.setState({ settingVisible: false }) }} |
| | |
| | | bottom: 0; |
| | | right: 0; |
| | | z-index: 12; |
| | | background:rgba(0, 0, 0, 0.3); |
| | | background:rgba(0, 0, 0, 0.2); |
| | | } |
| | | .menu-body .menu-view >.ant-card >.ant-card-body { |
| | | position: relative; |
| | | z-index: 13; |
| | | background:#ffffff; |
| | | .anticon-tool { |
| | | display: none; |
| | | } |
| | | } |
| | | .mk-mob-view .mob-shell { |
| | | .anticon-tool { |
| | | display: none; |
| | | } |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | const { config, arr_field, pageIndex, search, BID } = this.state |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if ( config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | } |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = mainSearch ? fromJS(mainSearch).toJS() : [] |
| | | let searches = config.setting.useMSearch && mainSearch ? fromJS(mainSearch).toJS() : [] |
| | | |
| | | MKEmitter.emit('returnModuleParam', config.uuid, btnId, { |
| | | arr_field: arr_field, |
| | |
| | | return |
| | | } |
| | | |
| | | let searches = mainSearch ? fromJS(mainSearch).toJS() : [] |
| | | let searches = config.setting.useMSearch && mainSearch ? fromJS(mainSearch).toJS() : [] |
| | | |
| | | this.setState({ |
| | | loading: true |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | } |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = [] |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | this.setState({sync: false, data: _data, empty: !_data,}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | } |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.renderView() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | searches = mainSearch |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | searches = mainSearch |
| | | } |
| | | |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, notification, Button } from 'antd' |
| | | // import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, config } = this.props |
| | | const { data, BID } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = false |
| | |
| | | } |
| | | } else { |
| | | _data = {} |
| | | } |
| | | |
| | | if (!config.wrap.groupLabel) { |
| | | if (config.subcards.length > 1) { |
| | | config.wrap.groupLabel = 'show' |
| | | } else { |
| | | config.wrap.groupLabel = 'hidden' |
| | | } |
| | | } |
| | | |
| | | let roleId = sessionStorage.getItem('role_id') || '' |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data, group: _group, step: _group.sort - 1,}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | {config.subcards.length > 1 ? <div className="mk-normal-form-title"> |
| | | {config.wrap.groupLabel !== 'hidden' ? <div className="mk-normal-form-title"> |
| | | {config.subcards.map(card => ( |
| | | <div key={card.uuid} className={'form-title' + (card.sort <= step ? ' active' : '')}> |
| | | <span className="form-sort" style={{background: config.wrap.color}}>{card.sort}</span> |
| | |
| | | if (!item.format) return |
| | | |
| | | if (item.dataName && (!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { |
| | | if (isEmpty && item.setting.useMSearch === 'true') { |
| | | if (isEmpty && item.setting.useMSearch) { |
| | | item.setting.sync = 'false' |
| | | item.setting.onload = 'false' |
| | | } else { |
| | |
| | | item.setting.sync = 'false' |
| | | item.setting.onload = 'false' |
| | | } else { |
| | | if (item.setting.useMSearch === 'true') { |
| | | if (item.setting.useMSearch) { |
| | | let keys = searchlist.map(item => item.key) |
| | | _mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | if (!item.format) return |
| | | |
| | | if (item.dataName && (!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { |
| | | if (isEmpty && item.setting.useMSearch === 'true') { |
| | | if (isEmpty && item.setting.useMSearch) { |
| | | item.setting.sync = 'false' |
| | | item.setting.onload = 'false' |
| | | } else { |
| | |
| | | item.setting.sync = 'false' |
| | | item.setting.onload = 'false' |
| | | } else { |
| | | if (item.setting.useMSearch === 'true') { |
| | | if (item.setting.useMSearch) { |
| | | let keys = searchlist.map(item => item.key) |
| | | _mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | } |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize } = this.state |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | if (config.statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return |
| | | |
| | | let searches = fromJS(search).toJS() |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let searches = search ? fromJS(search).toJS() : [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key.toLowerCase()) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key.toLowerCase())) { |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.reloadtable() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.reloadtable() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.syncRefresh === 'true') { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let searches = [] |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | let keys = searches.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | return component |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | if (component.setting) { |
| | | component.setting.useMSearch = component.setting.useMSearch === 'true' |
| | | component.setting.syncRefresh = (component.setting.useMSearch && component.setting.syncRefresh === 'true') |
| | | } |
| | | |
| | | if (!component.setting) return component // 不使用系统函数时 |
| | | if (!component.format) return component // 没有动态数据 数据格式 array 或 object |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | component.setting = component.setting || {} |
| | | component.setting.useMSearch = false |
| | | component.setting.syncRefresh = false |
| | | } |
| | | |
| | | if (!component.setting || !component.format) return component // 1、不使用系统函数时;2、 没有动态数据 数据格式 array 或 object |
| | | if (component.setting.interType !== 'system') { // 不使用系统函数时 |
| | | component.setting.sync = 'false' |
| | | component.setting.laypage = component.setting.laypage === 'true' |
| | |
| | | // dataName 系统生成的数据源名称 |
| | | // pageable 是否分页,组件属性,不分页的组件才可以统一查询 |
| | | if (component.floor === 1 && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') { |
| | | if (isEmpty && component.setting.useMSearch === 'true') { |
| | | if (isEmpty && component.setting.useMSearch) { |
| | | component.setting.sync = 'false' |
| | | component.setting.onload = 'false' |
| | | } else { |
| | |
| | | component.setting.sync = 'false' |
| | | component.setting.onload = 'false' |
| | | } else { |
| | | if (component.setting.useMSearch === 'true') { |
| | | if (component.setting.useMSearch) { |
| | | let keys = searchlist.map(item => item.key) |
| | | mainSearch.forEach(item => { |
| | | if (!keys.includes(item.key)) { |
| | |
| | | import moment from 'moment' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | import { Button, Modal, notification, message, Drawer } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | |
| | | |
| | | let title = btnconfig.setting.title |
| | | let width = btnconfig.setting.width + 'vw' |
| | | let clickouter = false |
| | | let container = document.body |
| | | let clickouter = btnconfig.setting.clickouter === 'close' |
| | | |
| | | if ( |
| | | (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || |
| | | (btnconfig.setting.container === 'tab' && btn.ContainerId) |
| | | ) { |
| | | width = btnconfig.setting.width + '%' |
| | | container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) |
| | | if (btnconfig.setting.display === 'drawer') { |
| | | let height = '100vh' |
| | | if (btnconfig.setting.placement === 'top' || btnconfig.setting.placement === 'bottom') { |
| | | width = '100vw' |
| | | height = btnconfig.setting.width + 'vh' |
| | | } |
| | | return ( |
| | | <Drawer |
| | | title={title} |
| | | width={width} |
| | | height={height} |
| | | maskClosable={clickouter} |
| | | onClose={this.handleCancel} |
| | | visible={visible} |
| | | placement={btnconfig.setting.placement || 'right'} |
| | | bodyStyle={{ paddingBottom: 80 }} |
| | | > |
| | | <MutilForm |
| | | BID={BID} |
| | | dict={this.state.dict} |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | BData={this.props.BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | | <div style={{ position: 'absolute', right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}> |
| | | <Button onClick={this.handleCancel} style={{ marginRight: 8 }}> |
| | | 取消 |
| | | </Button> |
| | | <Button onClick={this.handleOk} loading={this.state.confirmLoading} type="primary"> |
| | | 确定 |
| | | </Button> |
| | | </div> |
| | | </Drawer> |
| | | ) |
| | | } else { |
| | | let container = document.body |
| | | |
| | | if ( |
| | | (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || |
| | | (btnconfig.setting.container === 'tab' && btn.ContainerId) |
| | | ) { |
| | | width = btnconfig.setting.width + '%' |
| | | container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) |
| | | } |
| | | return ( |
| | | <Modal |
| | | title={title} |
| | | maskClosable={clickouter} |
| | | getContainer={container} |
| | | wrapClassName='action-modal' |
| | | visible={visible} |
| | | width={width} |
| | | onOk={this.handleOk} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={this.handleCancel} |
| | | destroyOnClose |
| | | > |
| | | <MutilForm |
| | | BID={BID} |
| | | dict={this.state.dict} |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | BData={this.props.BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | | </Modal> |
| | | ) |
| | | } |
| | | |
| | | if (btnconfig.setting.clickouter === 'close') { |
| | | clickouter = true |
| | | } |
| | | |
| | | return ( |
| | | <Modal |
| | | title={title} |
| | | maskClosable={clickouter} |
| | | getContainer={container} |
| | | wrapClassName='action-modal' |
| | | visible={visible} |
| | | width={width} |
| | | onOk={this.handleOk} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={this.handleCancel} |
| | | destroyOnClose |
| | | > |
| | | <MutilForm |
| | | BID={BID} |
| | | dict={this.state.dict} |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | BData={this.props.BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | | </Modal> |
| | | ) |
| | | } |
| | | |
| | | render() { |
| | |
| | | import './index.scss' |
| | | |
| | | const { MonthPicker, WeekPicker, RangePicker } = DatePicker |
| | | const { Search } = Input |
| | | |
| | | const MutilForm = asyncSpinComponent(() => import('./advanceform')) |
| | | const CheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/checkCard')) |
| | |
| | | _searchlist = fromJS(config.search).toJS() |
| | | if (config.type === 'search' && config.subtype === 'mainsearch') { |
| | | float = config.wrap.float |
| | | showButton = config.wrap.float === 'left' && config.wrap.show === 'true' |
| | | showButton = config.wrap.show !== 'false' |
| | | searchStyle = config.style |
| | | } else { |
| | | formId = '' |
| | |
| | | item.required = item.required === 'true' |
| | | |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type)) { |
| | | if (item.setAll === 'true' && item.type !== 'multiselect') { |
| | | if (item.setAll === 'true' && ['select', 'link'].includes(item.type)) { |
| | | item.options.unshift({ |
| | | key: Utils.getuuid(), |
| | | Value: '', |
| | |
| | | |
| | | getFields() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { dict, showButton, formId, showAdvanced } = this.state |
| | | const { dict, showButton, formId, showAdvanced, float } = this.state |
| | | const fields = [] |
| | | |
| | | this.state.searchlist.forEach((item, index) => { |
| | |
| | | message: dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onPressEnter={this.handleSearch} />)} |
| | | })(item.inputType === 'search' ? |
| | | <Search placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onSearch={this.handleSearch} enterButton/> : |
| | | <Input placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onPressEnter={this.handleSearch} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'checkcard') { // 多选框 |
| | | } else if (item.type === 'checkcard') { |
| | | fields.push( |
| | | <Col span={item.ratio || 6} key={index}> |
| | | <Form.Item label={item.labelShow !== 'false' ? item.label : ''}> |
| | |
| | | }) |
| | | |
| | | if (showButton) { |
| | | fields.push( |
| | | let action = ( |
| | | <Col span={6} style={{ whiteSpace: 'nowrap' }} className="search-button" key="actions"> |
| | | <Form.Item label={' '} colon={false} style={{ minHeight: '40px' }}> |
| | | <Button type="primary" onClick={this.handleSearch}> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | if (float === 'right') { |
| | | fields.unshift(action) |
| | | } else { |
| | | fields.push(action) |
| | | } |
| | | } |
| | | |
| | | return fields |
| | |
| | | cell.match = 'between' |
| | | |
| | | search.push(cell) |
| | | if (item.transfer === 'true') { |
| | | let copy = fromJS(cell).toJS() |
| | | copy.type = 'group' |
| | | copy.key = item.field.replace(/@tail@$/, '') |
| | | copy.value = searchValues[item.field] || '' |
| | | copy.match = '=' |
| | | copy.forbid = true |
| | | search.push(copy) |
| | | } |
| | | |
| | | let copy = fromJS(cell).toJS() |
| | | copy.type = 'group' |
| | | copy.key = item.field.replace(/@tail@$/, '') |
| | | copy.value = searchValues[item.field] || '' |
| | | copy.match = '=' |
| | | copy.forbid = true |
| | | search.push(copy) |
| | | } else { |
| | | let _value = values[item.field] || cell.value || '' |
| | | if (!_value) { |
| | |
| | | <Modal |
| | | title={dict['model.edit']} |
| | | visible={this.state.settingVisible} |
| | | width={700} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.settingSave} |
| | | onCancel={() => { this.setState({ settingVisible: false }) }} |
| | |
| | | |
| | | state = { |
| | | fields: null, |
| | | display: this.props.config.setting.display, |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | |
| | | |
| | | render() { |
| | | const { config, dict } = this.props |
| | | const { fields, appType } = this.state |
| | | const { fields, appType, display } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="宽度"> |
| | | <Form.Item label="宽度(%)"> |
| | | {getFieldDecorator('width', { |
| | | initialValue: config.setting.width |
| | | })(<InputNumber min={10} max={90} precision={0} />)} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab && appType !== 'pc' ? <Col span={12}> |
| | | <Col span={12}> |
| | | <Form.Item label="显示方式"> |
| | | {getFieldDecorator('display', { |
| | | initialValue: config.setting.display || 'modal' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}> |
| | | <Radio value="modal">模态框</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio value="drawer">抽屉</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab && appType !== 'pc' && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="显示方式"> |
| | | {getFieldDecorator('display', { |
| | | initialValue: config.setting.display || 'modal' |
| | | {display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="抽屉方向"> |
| | | {getFieldDecorator('placement', { |
| | | initialValue: config.setting.placement || 'right' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="modal">模态框</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="right">右侧</Radio> |
| | | <Radio value="left">左侧</Radio> |
| | | <Radio value="top">上侧</Radio> |
| | | <Radio value="bottom">下侧</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | } |
| | | if (item.type === 'group') { |
| | | let copy = fromJS(item).toJS() |
| | | copy.key = search.datefield |
| | | |
| | | |
| | | item.value = `@${search.field}@` |
| | | item.match = '=' |
| | | |
| | | copy.key = search.datefield |
| | | copy.type = 'daterange' |
| | | copy.match = 'between' |
| | | copy.value = [`@${search.datefield}@`, `@${search.datefield}1@`] |
| | | |
| | | if (search.transfer === 'true') { |
| | | newsearches.push(item) |
| | | } |
| | | newsearches.push(item) |
| | | newsearches.push(copy) |
| | | return |
| | | } else if (item.type === 'dateweek') { |
| | |
| | | render: (text, record) => |
| | | this.state.dataSource.length >= 1 ? ( |
| | | <div> |
| | | <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> |
| | | <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title={props.dict['model.query.delete']} |
| | | onConfirm={() => this.handleDelete(record.key) |
| | | }> |
| | | <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> |
| | | <span style={{color: '#ff4d4f', cursor: 'pointer'}}><Icon type="delete" /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | ) : null, |
| | |
| | | ] |
| | | |
| | | const searchTypeOptions = { |
| | | text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], |
| | | text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'inputType', 'advanced'], |
| | | select: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll'], |
| | | multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], |
| | | link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll'], |
| | |
| | | dateweek: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], |
| | | datemonth: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], |
| | | daterange: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], |
| | | group: ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'transfer', 'labelShow'] |
| | | group: ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'labelShow'] |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | let resourceType = '' |
| | | let display = '' |
| | | let cFields = [] |
| | | let multiple = 'false' |
| | | |
| | | formlist.forEach(cell => { |
| | | if (cell.key === 'type') { |
| | |
| | | resourceType = cell.initVal |
| | | } else if (cell.key === 'fields') { |
| | | cFields = cell.initVal |
| | | } else if (cell.key === 'multiple') { |
| | | multiple = cell.initVal |
| | | } |
| | | }) |
| | | |
| | |
| | | } else if (form.key === 'match') { // 表单为匹配字段时,根据不同的类型,显示对应的匹配规则 |
| | | if (type === 'text') { |
| | | form.options = matchReg.text |
| | | } else if (type === 'multiselect') { |
| | | } else if (type === 'multiselect' || (type === 'checkcard' && multiple === 'true')) { |
| | | form.options = matchReg.multiselect |
| | | } else if (type === 'select' || type === 'link' || type === 'checkcard') { |
| | | form.options = matchReg.select |
| | |
| | | } else if (type === 'dateweek' || type === 'daterange') { |
| | | form.options = matchReg.daterange |
| | | } |
| | | } else if (form.key === 'field' && type === 'text') { |
| | | } else if (form.key === 'field' && (type === 'text' || type === 'select')) { |
| | | form.tooltip = this.state.textTooltip |
| | | } else if (form.key === 'field' && type === 'group') { |
| | | form.tooltip = '查询数据时(自定义脚本或统计数据源),类型字段将用作替换脚本中的 @字段@ ,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。' |
| | | form.label = dict['model.form.type'] + dict['model.form.field'] |
| | | } |
| | | form.hidden = !_options.includes(form.key) |
| | |
| | | } else if (form.key === 'field') { |
| | | form.tooltip = '' |
| | | form.label = dict['model.form.field'] |
| | | if (value === 'text') { |
| | | if (value === 'text' || value === 'select') { |
| | | form.tooltip = this.state.textTooltip |
| | | } else if (value === 'group') { |
| | | form.tooltip = '查询数据时(自定义脚本或统计数据源),类型字段将用作替换脚本中的 @字段@ ,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。' |
| | | form.label = dict['model.form.type'] + dict['model.form.field'] |
| | | } |
| | | } |
| | |
| | | } |
| | | if (this.props.form.getFieldValue('match') !== undefined) { |
| | | this.props.form.setFieldsValue({match: matchs[0].value}) |
| | | } |
| | | if (this.props.form.getFieldValue('multiple') !== undefined) { |
| | | this.props.form.setFieldsValue({multiple: 'false'}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | form.hidden = !_options.includes(form.key) |
| | | return form |
| | | }) |
| | | }) |
| | | } else if (key === 'multiple') { |
| | | let matchs = [] |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(form => { |
| | | if (form.key === 'match') { |
| | | if (value === 'true') { |
| | | form.options = matchReg.multiselect |
| | | } else { |
| | | form.options = matchReg.select |
| | | } |
| | | matchs = form.options |
| | | } |
| | | |
| | | return form |
| | | }) |
| | | }, () => { |
| | | if (this.props.form.getFieldValue('match') !== undefined) { |
| | | this.props.form.setFieldsValue({match: matchs[0].value}) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | let rules = [] |
| | |
| | | } |
| | | if (item.type === 'group') { |
| | | let copy = fromJS(item).toJS() |
| | | copy.key = search.datefield |
| | | |
| | | |
| | | item.value = search.initval && search.initval[0] ? search.initval[0] : '@$@' |
| | | item.match = '=' |
| | | |
| | | copy.key = search.datefield |
| | | copy.type = 'daterange' |
| | | copy.match = 'between' |
| | | copy.value = [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')] |
| | | |
| | | if (search.transfer === 'true') { |
| | | newsearches.push(item) |
| | | } |
| | | newsearches.push(item) |
| | | newsearches.push(copy) |
| | | return |
| | | } else if (item.type === 'date') { |
| | |
| | | searches.forEach(item => { |
| | | if (!item.field) return |
| | | if (item.type === 'group') { |
| | | if (item.transfer === 'true') { |
| | | _usefulFields.push(item.field) |
| | | } |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.datefield) |
| | | _usefulFields.push(item.datefield + '1') |
| | | } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) { |
| | |
| | | searches.forEach(item => { |
| | | if (!item.field) return |
| | | if (item.type === 'group') { |
| | | if (item.transfer === 'true') { |
| | | _usefulFields.push(item.field) |
| | | } |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.datefield) |
| | | _usefulFields.push(item.datefield + '1') |
| | | } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) { |
| | |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'transfer', |
| | | label: '传递', |
| | | initVal: card.transfer || 'false', |
| | | tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'transfer', |
| | | // label: '传递', |
| | | // initVal: card.transfer || 'false', |
| | | // tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。', |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: Formdict['model.true'] |
| | | // }, { |
| | | // value: 'false', |
| | | // text: Formdict['model.false'] |
| | | // }] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | key: 'labelShow', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'inputType', |
| | | label: '输入样式', |
| | | initVal: card.inputType || 'input', |
| | | required: false, |
| | | forbid: sessionStorage.getItem('appType') === null, |
| | | options: [{ |
| | | value: 'input', |
| | | text: '输入框' |
| | | }, { |
| | | value: 'search', |
| | | text: '搜索框' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'backgroundColor', |
| | | label: '背景色', |
| | |
| | | } |
| | | } |
| | | |
| | | if (search.transfer === 'true') { |
| | | newsearches.push(item) |
| | | } |
| | | newsearches.push(item) |
| | | newsearches.push(copy) |
| | | return |
| | | } else if (item.type === 'date') { |
| | |
| | | key: search.datefield + '1', |
| | | value: '0' |
| | | }) |
| | | if (search.transfer === 'true') { |
| | | options.push(item) |
| | | } |
| | | options.push(item) |
| | | } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) { |
| | | options.push(item) |
| | | options.push({ |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin } from 'antd' |
| | | import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Icon } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | |
| | | visible: false, |
| | | customComponents: [], |
| | | direction: 'vertical', |
| | | settingshow: true, |
| | | controlshow: true, |
| | | comloading: false |
| | | } |
| | | |
| | |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | settingshow: true, |
| | | activeKey: 'basedata' |
| | | }) |
| | | return |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { localedict, comloading, loading, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | const { localedict, comloading, loading, settingshow, controlshow, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={localedict}> |
| | |
| | | <Header changeView={this.changeView}/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | <div className="menu-setting"> |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <Icon onClick={() => {this.setState({settingshow: false})}} type="double-left" /> : null} |
| | | {!settingshow ? <Icon onClick={() => {this.setState({settingshow: true})}} type="double-right" /> : null} |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | |
| | | </Collapse> |
| | | </div> |
| | | </div> |
| | | <div className="menu-control"> |
| | | <div className={'menu-control ' + (!controlshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <Icon onClick={() => {this.setState({controlshow: false})}} type="double-right" /> : null} |
| | | {!controlshow ? <Icon onClick={() => {this.setState({controlshow: true})}} type="double-left" /> : null} |
| | | </div> |
| | | <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> |
| | | <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | |
| | | z-index: 10; |
| | | transition: left 0.3s; |
| | | |
| | | .draw { |
| | | position: absolute; |
| | | z-index: 1; |
| | | background: #ffffff; |
| | | right: -20px; |
| | | top: 0px; |
| | | box-shadow: 0 0 1px #959595; |
| | | border-radius: 0 2px 2px 0px; |
| | | |
| | | i { |
| | | padding: 12px 3px; |
| | | } |
| | | } |
| | | |
| | | .pc-setting-tools { |
| | | height: calc(100vh - 48px); |
| | | width: 300px; |
| | |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | .menu-setting.hidden { |
| | | left: -300px; |
| | | } |
| | | .mob-shell { |
| | | // width: 376px; |
| | | // height: 680px; |
| | | margin: 0 auto; |
| | | background: #000000; |
| | | background-size: 100% 100%; |
| | |
| | | background: #ffffff; |
| | | z-index: 10; |
| | | transition: right 0.3s; |
| | | |
| | | .draw { |
| | | position: absolute; |
| | | z-index: 1; |
| | | background: #ffffff; |
| | | left: -21px; |
| | | top: 0px; |
| | | box-shadow: 0 0 1px #959595; |
| | | border-radius: 0 2px 2px 0px; |
| | | |
| | | i { |
| | | padding: 12px 3px; |
| | | } |
| | | } |
| | | |
| | | div:not(.draw), button:not(.ant-switch) { |
| | | display: block!important; |
| | |
| | | height: 22px; |
| | | } |
| | | } |
| | | .menu-control.hidden { |
| | | right: -130px; |
| | | } |
| | | |
| | | .menu-body { |
| | | width: 100vw; |