| | |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: true // v5 不支持垂直显示 |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | const EditColumn = asyncIconComponent(() => import('./editColumn')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) |
| | | const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) |
| | | const MobPagination = asyncIconComponent(() => import('@/menu/components/share/mobPagination')) |
| | | |
| | | class HeaderCol extends Component { |
| | | deleteCol = () => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { fields, card, lineMarks, dict, tableId } = this.state |
| | | const { fields, card, lineMarks, dict, tableId, appType } = this.state |
| | | const components = { |
| | | header: { |
| | | cell: DragableHeaderCol |
| | |
| | | dataSource={this.state.data} |
| | | rowSelection={config.wrap.tableType ? { type: 'radio' } : null} |
| | | columns={columns} |
| | | pagination={{ |
| | | pagination={appType !== 'mob' ? { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '25', '50', '100', '500', '1000'], |
| | | showSizeChanger: true, |
| | | total: 58, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | } : false} |
| | | /> |
| | | {appType === 'mob' && config.setting.laypage !== 'fasle' ? <MobPagination /> : null} |
| | | </DndProvider> |
| | | <EditColumn column={card} dict={dict} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> |
| | | </div> |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | const { appType } = this.state |
| | | |
| | | if (card.isNew) { |
| | | let _card = { |
| | |
| | | } |
| | | } |
| | | |
| | | if (appType === 'mob') { |
| | | _card.search = [] |
| | | _card.action = _card.action.filter(a => !a.origin) |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _card |
| | | }) |
| | | |
| | | this.filterOrigin(_card) |
| | | } else { |
| | | let _card = fromJS(card).toJS() |
| | | if (appType === 'mob') { |
| | | _card.search = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | card: fromJS(card).toJS() |
| | | card: _card |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { card, appType } = this.state |
| | | let options = ['action', 'search', 'form', 'cols'] |
| | | let _style = resetStyle(card.style) |
| | | |
| | | if (appType === 'mob') { |
| | | options = ['action', 'cols'] |
| | | } |
| | | |
| | | return ( |
| | | <div className="menu-normal-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> |
| | |
| | | <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="normaltable" card={card}/> |
| | | <PasteComponent config={card} options={['action', 'search', 'form', 'cols']} updateConfig={this.updateComponent} /> |
| | | <PasteComponent config={card} options={options} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <UserComponent config={card}/> |
| | |
| | | if (item.status === 'false') return |
| | | |
| | | if (/exec\s/ig.test(item.sql)) { |
| | | maxScript = 100 |
| | | maxScript = 1000 |
| | | } else if (item.sql.length > maxScript) { |
| | | maxScript = item.sql.length |
| | | } |
| | |
| | | <div className="am-list-line"> |
| | | <div className="am-input-label">{card.label}</div> |
| | | <div className="am-input-control" style={{textAlign: 'left'}}> |
| | | {card.fileType !== 'picture-card' ? <Icon type="upload" style={{position: 'absolute', right: '10px', top: '10px'}} /> : null} |
| | | {card.fileType === 'picture-card' ? <Button style={{width: '100px', marginBottom: '10px', height: '100px', fontSize: '50px', color: '#d9d9d9'}}><Icon type="plus" /></Button> : null} |
| | | {/* {card.fileType !== 'picture-card' ? <Icon type="upload" style={{position: 'absolute', right: '10px', top: '10px'}} /> : null} */} |
| | | {/* {card.fileType === 'picture-card' ? <Button style={{width: '100px', marginBottom: '10px', height: '100px', fontSize: '50px', color: '#d9d9d9'}}><Icon type="plus" /></Button> : null} */} |
| | | <Button style={{width: '100px', marginBottom: '10px', height: '100px', fontSize: '50px', color: '#d9d9d9'}}><Icon type="plus" /></Button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | handleForm={this.handleForm} |
| | | closeForm={this.closeForm} |
| | | /> |
| | | {config.setting.btnPosition !== 'top' ? <div className="modal-btns"> |
| | | <Button className="modal-reset" type="default">重置</Button> |
| | | <Button className="modal-submit" type="primary">{config.setting.btnName || '确定'}</Button> |
| | | </div> : null} |
| | | {config.setting.btnPosition !== 'top' ? |
| | | <Button className="modal-submit" type="primary">{config.setting.btnName || '确定'}</Button> : null} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | .modal-btns { |
| | | display: flex; |
| | | .modal-reset { |
| | | display: inline-block; |
| | | height: 50px; |
| | | width: 30%; |
| | | font-size: 20px; |
| | | border-radius: 0; |
| | | opacity: 0.5; |
| | | cursor: default; |
| | | } |
| | | .modal-submit { |
| | | display: inline-block; |
| | | width: 70%; |
| | | border-radius: 0; |
| | | display: block; |
| | | width: calc(100% - 30px); |
| | | opacity: 0.5; |
| | | cursor: default; |
| | | font-size: 20px; |
| | | height: 50px; |
| | | } |
| | | margin: 15px 15px; |
| | | border-radius: 25px; |
| | | } |
| | | |
| | | .modal-fields-row { |
| | |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | } else if (card.type === 'daterange') { |
| | | let value = '请选择' |
| | | if (card.initval === 'week') { |
| | | value = [moment().startOf('week').format('YYYY-MM-DD'), moment().endOf('week').format('YYYY-MM-DD')].join(' ~ ') |
| | | } else if (card.initval === 'month') { |
| | | value = [moment().startOf('month').format('YYYY-MM-DD'), moment().endOf('month').format('YYYY-MM-DD')].join(' ~ ') |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | | value = [moment().subtract(_initval[0], 'days').format('YYYY-MM-DD'), moment().subtract(_initval[1], 'days').format('YYYY-MM-DD')].join(' ~ ') |
| | | } catch (e) { |
| | | value = '请选择' |
| | | } |
| | | } |
| | | formItem = (<div className="am-list-item"> |
| | | <div className="am-list-line"> |
| | | {card.labelShow !== 'false' ? <div className="am-input-label">{card.label}</div> : null} |
| | | <div className="am-input-control">{value}</div> |
| | | <div className="am-list-extra"><Icon type="right" /></div> |
| | | </div> |
| | | </div>) |
| | | // } else if (card.type === 'daterange') { |
| | | // let value = '请选择' |
| | | // if (card.initval === 'week') { |
| | | // value = [moment().startOf('week').format('YYYY-MM-DD'), moment().endOf('week').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } else if (card.initval === 'month') { |
| | | // value = [moment().startOf('month').format('YYYY-MM-DD'), moment().endOf('month').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } else if (card.initval) { |
| | | // try { |
| | | // let _initval = JSON.parse(card.initval) |
| | | // value = [moment().subtract(_initval[0], 'days').format('YYYY-MM-DD'), moment().subtract(_initval[1], 'days').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } catch (e) { |
| | | // value = '请选择' |
| | | // } |
| | | // } |
| | | // formItem = (<div className="am-list-item"> |
| | | // <div className="am-list-line"> |
| | | // {card.labelShow !== 'false' ? <div className="am-input-label">{card.label}</div> : null} |
| | | // <div className="am-input-control">{value}</div> |
| | | // <div className="am-list-extra"><Icon type="right" /></div> |
| | | // </div> |
| | | // </div>) |
| | | } else if (card.type === 'checkcard') { |
| | | formItem = (<div className="am-list-item check-card"> |
| | | <div className="am-list-line"> |
| | |
| | | subType: 'datemonth', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: '日期(区间)', |
| | | subType: 'daterange', |
| | | url: '' |
| | | }, |
| | | // { |
| | | // type: 'search', |
| | | // label: '日期(区间)', |
| | | // subType: 'daterange', |
| | | // url: '' |
| | | // }, |
| | | ] |
| | | |
| | |
| | | if (item.status === 'false') return |
| | | |
| | | if (/exec\s/ig.test(item.sql)) { |
| | | maxScript = 100 |
| | | maxScript = 1000 |
| | | } else if (item.sql.length > maxScript) { |
| | | maxScript = item.sql.length |
| | | } |
| | |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'daterange', |
| | | text: Formdict['model.form.daterange'] |
| | | // }, { |
| | | // value: 'daterange', |
| | | // text: Formdict['model.form.daterange'] |
| | | }] |
| | | } else { |
| | | typeOptions = [{ |
| | |
| | | type: 'select', |
| | | key: 'fileType', |
| | | label: '显示方式', |
| | | initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'), |
| | | initVal: card.fileType || 'text', |
| | | options: [{ |
| | | value: 'text', |
| | | text: '文件' |
| | | }, { |
| | | }, |
| | | { |
| | | value: 'picture', |
| | | text: '图文信息' |
| | | }, { |
| | | }, |
| | | { |
| | | value: 'picture-card', |
| | | text: '图片卡' |
| | | }] |
| | | }], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | text: 'nvarchar(50)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'mode', |
| | | label: '模式', |
| | | initVal: card.mode || 'picker', |
| | | options: [{ |
| | | value: 'picker', |
| | | text: '选择器' |
| | | }, { |
| | | value: 'calendar', |
| | | text: '日历' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'mode', |
| | | // label: '模式', |
| | | // initVal: card.mode || 'picker', |
| | | // options: [{ |
| | | // value: 'picker', |
| | | // text: '选择器' |
| | | // }, { |
| | | // value: 'calendar', |
| | | // text: '日历' |
| | | // }], |
| | | // forbid: appType !== 'mob' |
| | | // }, |
| | | { |
| | | type: 'number', |
| | | key: 'span', |