| | |
| | | render() { |
| | | const { group, dict } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { fields } = this.state |
| | | const { fields, appType } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | {appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="表单排列"> |
| | | {getFieldDecorator('align', { |
| | | initialValue: group.setting.align || 'left_right' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | * @description 表单编辑 |
| | | */ |
| | | handleForm = (_item) => { |
| | | const { card, group } = this.state |
| | | const { card, group, appType } = this.state |
| | | let _form = fromJS(_item).toJS() |
| | | let _inputfields = [] |
| | | let _tabfields = [] |
| | |
| | | _form.linkSubField = _form.linkSubField.filter(item => fields.includes(item)) |
| | | } |
| | | |
| | | if (!_form.span && standardform && standardform.span) { |
| | | if (appType !== 'mob' && !_form.span && standardform && standardform.span) { |
| | | _form.span = standardform.span |
| | | _form.labelwidth = standardform.labelwidth |
| | | } |
| | |
| | | list={group.fields} |
| | | setting={group.setting} |
| | | showField={this.state.showField} |
| | | placeholder={dict['header.form.modal.placeholder']} |
| | | handleList={this.handleList} |
| | | handleForm={this.handleForm} |
| | | closeForm={this.closeForm} |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, DatePicker, Button, Popover, Switch, Radio, Checkbox, Form } from 'antd' |
| | | import { InputItem, TextareaItem } from 'antd-mobile' |
| | | import { Icon, Button, Popover, Switch, Checkbox, Form } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { MonthPicker } = DatePicker |
| | | |
| | | const Editor = asyncComponent(() => import('@/components/editor')) |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const CheckCard = asyncComponent(() => import('@/templates/modalconfig/checkCard')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, editCard, closeCard, copyCard, showField }) => { |
| | |
| | | } |
| | | |
| | | let selectval = '' |
| | | if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { |
| | | if (card.type === 'select' || card.type === 'link') { |
| | | if (card.initval) { |
| | | let _option = card.options.filter(option => option.Value === card.initval)[0] |
| | | if (_option) { |
| | |
| | | } |
| | | |
| | | let formItem = null |
| | | if (card.type === 'text') { |
| | | formItem = (<InputItem value={card.initval}>{card.label}</InputItem>) |
| | | } else if (card.type === 'number') { |
| | | formItem = (<InputItem type="number" value={card.initval}>{card.label}</InputItem>) |
| | | } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { |
| | | formItem = (<div className="am-list-item am-list-item-middle"><div className="am-list-line"><div className="am-list-content">{card.label}</div><div className="am-list-extra">{selectval || '请选择'}</div><div className="am-list-arrow am-list-arrow-horizontal"></div></div></div>) |
| | | } else if (card.type === 'color') { |
| | | formItem = (<ColorSketch value={card.initval || 'transparent'}/>) |
| | | if (card.type === 'text' || card.type === 'number') { |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval}</div></div></div>) |
| | | } else if (card.type === 'select' || card.type === 'link') { |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{selectval || '请选择'}</div><div className="am-list-extra"><Icon type="right" /></div></div></div>) |
| | | } else if (card.type === 'date') { |
| | | formItem = (<DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} />) |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'days').format('YYYY-MM-DD') : '请选择'}</div><div className="am-list-extra"><Icon type="right" /></div></div></div>) |
| | | } else if (card.type === 'datemonth') { |
| | | formItem = (<MonthPicker value={card.initval ? moment().subtract(card.initval, 'month') : null} />) |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'month').format('YYYY-MM') : '请选择'}</div><div className="am-list-extra"><Icon type="right" /></div></div></div>) |
| | | } else if (card.type === 'datetime') { |
| | | formItem = (<DatePicker showTime value={card.initval ? moment().subtract(card.initval, 'days') : null} />) |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'days').format('YYYY-MM-DD HH:mm') : '请选择'}</div><div className="am-list-extra"><Icon type="right" /></div></div></div>) |
| | | } else if (card.type === 'textarea') { |
| | | formItem = (<TextareaItem title={card.label} autoHeight />) |
| | | } else if (card.type === 'brafteditor') { |
| | | formItem = (<Editor />) |
| | | // formItem = (<TextareaItem title={card.label} autoHeight />) |
| | | } else if (card.type === 'fileupload') { |
| | | formItem = (<Button style={{marginTop: '3px'}}><Icon type="upload" /> 点击上传 </Button>) |
| | | } else if (card.type === 'funcvar') { |
| | | formItem = (<InputItem type="number" value={card.linkfield}>{card.label}</InputItem>) |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.linkfield}</div></div></div>) |
| | | } else if (card.type === 'switch') { |
| | | formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} checked={card.initval}/>) |
| | | formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-list-switch"><Switch checked={card.initval}/></div></div></div>) |
| | | } else if (card.type === 'radio') { |
| | | formItem = card.options && card.options.length > 0 ? (<Radio.Group value={card.initval}> |
| | | {card.options.map(cell => <Radio key={cell.key} value={cell.Value}>{cell.Text}</Radio>)} |
| | | </Radio.Group>) : (<Radio.Group value={1}> |
| | | <Radio value={1}>A</Radio> |
| | | <Radio value={2}>B</Radio> |
| | | <Radio value={3}>C</Radio> |
| | | <Radio value={4}>D</Radio> |
| | | </Radio.Group>) |
| | | let options = null |
| | | if (card.options && card.options.length > 0) { |
| | | options = card.options |
| | | } else { |
| | | options = [ |
| | | {key: 'A', Value: 'A', Text: 'A'}, |
| | | {key: 'B', Value: 'B', Text: 'B'}, |
| | | {key: 'C', Value: 'C', Text: 'C'} |
| | | ] |
| | | } |
| | | |
| | | formItem = ( |
| | | <div className="am-list-item checkbox"> |
| | | <div className="am-list-line"> |
| | | <div className="am-input-label">{card.label}</div> |
| | | <div className="am-input-control"> |
| | | <div className="mk-radio-group"> |
| | | {options.map(cell => (<div key={cell.key} className="mk-radio-wrapper"> |
| | | <span className="radio-value">{cell.Text}</span> |
| | | <span className={'radio-check ' + (card.initval === cell.Value ? 'checked' : '')}></span> |
| | | </div>))} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | } else if (card.type === 'checkbox') { |
| | | let _val = card.initval ? card.initval.split(',') : [] |
| | | formItem = card.options && card.options.length > 0 ? (<Checkbox.Group value={_val}> |
| | | {card.options.map(cell => <Checkbox key={cell.key} value={cell.Value}>{cell.Text}</Checkbox>)} |
| | | </Checkbox.Group>) : (<Checkbox.Group value={['A', 'C']}> |
| | | <Checkbox value="A">A</Checkbox> |
| | | <Checkbox value="B">B</Checkbox> |
| | | <Checkbox value="C">C</Checkbox> |
| | | <Checkbox value="D">D</Checkbox> |
| | | </Checkbox.Group>) |
| | | let options = null |
| | | if (card.options && card.options.length > 0) { |
| | | options = card.options |
| | | } else { |
| | | options = [ |
| | | {key: 'A', Value: 'A', Text: 'A'}, |
| | | {key: 'B', Value: 'B', Text: 'B'}, |
| | | {key: 'C', Value: 'C', Text: 'C'} |
| | | ] |
| | | } |
| | | |
| | | formItem = ( |
| | | <div className="am-list-item checkbox"> |
| | | <div className="am-list-line"> |
| | | <div className="am-input-label">{card.label}</div> |
| | | <div className="am-input-control"> |
| | | {<Checkbox.Group value={_val}> |
| | | {options.map(cell => <Checkbox key={cell.key} value={cell.Value}>{cell.Text}</Checkbox>)} |
| | | </Checkbox.Group>} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | ) |
| | | |
| | | } else if (card.type === 'hint') { |
| | | formItem = <div style={{marginTop: '10px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '1.5'}}>{card.message}</div> |
| | | formItem = <div className="am-list-item hint"> |
| | | <div className="am-list-line"> |
| | | <div className="am-input-label">{card.label}</div> |
| | | <div className="am-input-control"> |
| | | {card.message} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | } else if (card.type === 'split') { |
| | | formItem = <div className="split-line">{card.label}</div> |
| | | } else if (card.type === 'checkcard') { |
| | | formItem = <CheckCard width={card.width} ratio={card.ratio} display={card.display} fields={card.fields} options={card.options} /> |
| | | formItem = (<div className="am-list-item check-card"> |
| | | <div className="am-list-line"> |
| | | <div className="am-input-label">{card.label}</div> |
| | | <div className="am-input-control"> |
| | | <CheckCard width={card.width} ratio={card.ratio} display={card.display} fields={card.fields} options={card.options} /> |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | } |
| | | |
| | | return ( |
| | |
| | | import Card from './card' |
| | | import './index.scss' |
| | | |
| | | const Container = ({list, setting, placeholder, handleList, handleForm, closeForm, showField }) => { |
| | | const Container = ({list, setting, handleList, handleForm, closeForm, showField }) => { |
| | | const [cards, setCards] = useState(list) |
| | | const moveCard = (id, atIndex) => { |
| | | const { card, index } = findCard(id) |
| | |
| | | }) |
| | | |
| | | return ( |
| | | <div ref={drop} className={'ant-row modal-fields-row ' + (setting.align || 'left_right')} > |
| | | <div ref={drop} className="ant-row modal-fields-row mob-form" > |
| | | {cards.map(card => { |
| | | return <Card |
| | | id={card.uuid} |
| | |
| | | padding-left: 1.2%; |
| | | padding-right: 1.2%; |
| | | } |
| | | .am-list-item.am-input-item { |
| | | padding-left: 0; |
| | | } |
| | | .am-list-item .am-input-label { |
| | | .am-list-item { |
| | | font-size: 16px; |
| | | } |
| | | .am-list-line { |
| | | border-bottom: 1PX solid #ddd; |
| | | input { |
| | | text-align: right; |
| | | padding-left: 10px; |
| | | position: relative; |
| | | display: flex; |
| | | height: 44px; |
| | | min-height: 44px; |
| | | background-color: #fff; |
| | | vertical-align: middle; |
| | | overflow: hidden; |
| | | transition: background-color 200ms; |
| | | align-items: center; |
| | | |
| | | .am-list-line { |
| | | border-bottom: 1PX solid #ddd; |
| | | align-items: center; |
| | | position: relative; |
| | | display: flex; |
| | | flex: 1 1; |
| | | align-self: stretch; |
| | | padding-right: 15px; |
| | | overflow: hidden; |
| | | .am-input-label { |
| | | width: 28%; |
| | | color: #000; |
| | | font-size: 16px; |
| | | margin-left: 0; |
| | | margin-right: 5px; |
| | | text-align: left; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | padding: 2px 0; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .am-list-switch { |
| | | flex: 1; |
| | | text-align: right; |
| | | } |
| | | .am-input-control { |
| | | font-size: 16px; |
| | | flex: 1 1; |
| | | text-align: right; |
| | | } |
| | | .am-input-control.left { |
| | | text-align: left; |
| | | } |
| | | .am-list-extra { |
| | | display: block; |
| | | width: 15px; |
| | | height: 15px; |
| | | margin-left: 8px; |
| | | i { |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .ant-form-item-children { |
| | | padding-left: 10px; |
| | | .am-list-item.check-card { |
| | | height: auto; |
| | | .am-list-line { |
| | | align-items: start; |
| | | display: block; |
| | | .check-card-edit-box { |
| | | margin-top: 0!important; |
| | | } |
| | | } |
| | | } |
| | | .am-list-item.hint { |
| | | height: auto; |
| | | .am-list-line { |
| | | align-items: start; |
| | | display: block; |
| | | .am-input-label { |
| | | line-height: 2; |
| | | } |
| | | .am-input-control { |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | text-align: left; |
| | | padding-bottom: 5px; |
| | | } |
| | | } |
| | | } |
| | | .am-list-item.checkbox { |
| | | height: auto; |
| | | .am-list-line { |
| | | align-items: start; |
| | | display: block; |
| | | } |
| | | .mk-radio-group { |
| | | padding-left: 10px; |
| | | text-align: left; |
| | | |
| | | .mk-radio-wrapper:not(:last-child) { |
| | | border-bottom: 1px solid #ddd; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | | } |
| | | .radio-value { |
| | | width: calc(100% - 50px); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | padding: 2px 0; |
| | | text-overflow: ellipsis; |
| | | vertical-align: top; |
| | | } |
| | | .radio-check { |
| | | position: relative; |
| | | width: 50px; |
| | | height: 30px; |
| | | top: 8px; |
| | | } |
| | | .radio-check.checked::after { |
| | | content: ' '; |
| | | position: absolute; |
| | | display: table; |
| | | border: 1px solid #1890ff; |
| | | border-top: 0; |
| | | border-left: 0; |
| | | top: 50%; |
| | | left: 22%; |
| | | width: 12px; |
| | | height: 20px; |
| | | transform: rotate(45deg) scale(1) translate(-50%, -50%); |
| | | } |
| | | } |
| | | .ant-checkbox-group { |
| | | display: block; |
| | | padding-left: 10px; |
| | | .ant-checkbox-wrapper { |
| | | display: flex; |
| | | text-align: left; |
| | | font-size: 16px; |
| | | .ant-checkbox { |
| | | display: block; |
| | | width: 30px; |
| | | .ant-checkbox-inner { |
| | | width: 22px; |
| | | height: 22px; |
| | | top: 12px; |
| | | } |
| | | .ant-checkbox-inner::after { |
| | | width: 9px; |
| | | height: 14px; |
| | | } |
| | | } |
| | | .ant-checkbox + span { |
| | | display: block; |
| | | flex: 1 1; |
| | | border-bottom: 1px solid #ddd; |
| | | } |
| | | } |
| | | .ant-checkbox-wrapper:last-child { |
| | | .ant-checkbox + span { |
| | | border-bottom: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .split-line { |
| | | color: #1890ff; |
| | | font-size: 15px; |
| | | font-size: 16px; |
| | | padding-left: 10px; |
| | | padding-top: 10px; |
| | | border-bottom: 1px solid #e9e9e9; |
| | | } |
| | | .check-card-edit-box .card-cell span { |
| | | line-height: 1.5; |
| | | } |
| | | .ant-form-item { |
| | | cursor: move; |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | opacity: 0; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .ant-form-item.required { |
| | | .am-input-label::before { |
| | |
| | | content: '*'; |
| | | } |
| | | } |
| | | .ant-form-item { |
| | | cursor: move; |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | .ant-form-item-label { |
| | | overflow: visible; |
| | | position: relative; |
| | | cursor: move; |
| | | height: 40px; |
| | | width: 33.3%; |
| | | label { |
| | | width: 100%; |
| | | cursor: move; |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .anticon-question-circle { |
| | | color: #c49f47; |
| | | margin-right: 3px; |
| | | line-height: 40px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | position: relative; |
| | | flex: 1; |
| | | .ant-select { |
| | | width: 100%; |
| | | margin-top: 4px; |
| | | } |
| | | .field-name { |
| | | line-height: 1.3; |
| | | float: left; |
| | | } |
| | | .ant-checkbox-group { |
| | | line-height: 40px; |
| | | .ant-checkbox-wrapper { |
| | | margin-right: 8px; |
| | | } |
| | | .ant-checkbox-wrapper + .ant-checkbox-wrapper { |
| | | margin-left: 0px; |
| | | } |
| | | } |
| | | .ant-radio-group { |
| | | line-height: 40px; |
| | | } |
| | | .ant-calendar-picker { |
| | | width: 100%; |
| | | margin-top: 4px; |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | margin-top: 4px; |
| | | } |
| | | .color-sketch-block { |
| | | margin-top: 7px; |
| | | overflow: hidden; |
| | | .color-sketch-block-box { |
| | | min-width: 100px; |
| | | } |
| | | } |
| | | .normal-braft-editor { |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | opacity: 0; |
| | | z-index: 1; |
| | | } |
| | | .ant-col-cuslabel { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-cuswrap { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .mob-form.modal-fields-row { |
| | | .page-card { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || param.custom_script) { |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | regoptions = allSearch.map(item => { |
| | | return { |
| | |
| | | } |
| | | |
| | | if (param.custom_script) { |
| | | param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}' |
| | | ${param.custom_script} |
| | | ` |
| | | regoptions.forEach(item => { |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | let _openType = [] |
| | | let _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | | }, { |
| | | value: 'checkbox', |
| | | text: '多选框' |
| | | }, { |
| | | value: 'radio', |
| | | text: '单选框' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['model.form.datetime'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'color', |
| | | text: Formdict['model.form.color'] |
| | | }, { |
| | | value: 'brafteditor', |
| | | text: '富文本' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | | }, { |
| | | value: 'split', |
| | | text: '分隔线' |
| | | }] |
| | | |
| | | let _fieldlength = 50 |
| | | |
| | | if (subtable) { |
| | | if (appType === 'mob') { |
| | | _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | }, { |
| | | value: 'select', |
| | | text: '选择器' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | | }, { |
| | | value: 'checkbox', |
| | | text: '多选框' |
| | | }, { |
| | | value: 'radio', |
| | | text: '单选框' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['model.form.datetime'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | | }, { |
| | | value: 'split', |
| | | text: '分隔线' |
| | | }] |
| | | } else if (subtable) { |
| | | _openType.push({ |
| | | value: 'linkMain', |
| | | text: Formdict['header.form.linkMain'] |
| | |
| | | label: Formdict['model.form.type'], |
| | | initVal: card.type, |
| | | required: true, |
| | | options: [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | | }, { |
| | | value: 'checkbox', |
| | | text: '多选框' |
| | | }, { |
| | | value: 'radio', |
| | | text: '单选框' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['model.form.datetime'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'color', |
| | | text: Formdict['model.form.color'] |
| | | }, { |
| | | value: 'brafteditor', |
| | | text: '富文本' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | | }, { |
| | | value: 'split', |
| | | text: '分隔线' |
| | | }, |
| | | ..._openType] |
| | | options: _openType |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | key: 'openText', |
| | | label: '开启提示', |
| | | initVal: card.openText || '', |
| | | required: false |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'closeText', |
| | | label: '关闭提示', |
| | | initVal: card.closeText || '', |
| | | required: false |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cursor', |
| | | label: '光标', |
| | | initVal: card.cursor || 'right', |
| | | options: [{ |
| | | value: 'right', |
| | | text: '右对齐' |
| | | }, { |
| | | value: 'left', |
| | | text: '左对齐' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: Formdict['header.form.readin'], |
| | | tooltip: Formdict['header.form.readin.tooltip'], |
| | |
| | | label: '表单宽度', |
| | | initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12), |
| | | tooltip: '栅格布局整行24等分。', |
| | | required: true |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | const { TextArea } = Input |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter'], |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor'], |
| | | select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter'], |
| | | checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'tooltip', 'extra'], |
| | | radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText'], |
| | |
| | | }) |
| | | } |
| | | |
| | | handleAdd = () => { |
| | | handleAdd = (e) => { |
| | | e.stopPropagation() |
| | | const { type, count, dataSource } = this.state |
| | | const newData = { |
| | | key: Utils.getuuid(), |
| | |
| | | _columns = fromJS(columns).toJS() |
| | | let hasbid = false |
| | | _columns = _columns.filter(col => { |
| | | if (col.field.toLowerCase() === 'bid') { |
| | | if (col.field && col.field.toLowerCase() === 'bid') { |
| | | hasbid = true |
| | | } |
| | | |
| | |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | if (card.sqlType !== 'custom' && verify.default === 'false' && verify.scripts.length === 0) { |
| | | if ((card.sqlType === 'custom' || verify.default === 'false') && verify.scripts.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不执行默认sql时,必须设置自定义脚本!', |