| | |
| | | 'model.form.link': '联动菜单', |
| | | 'model.form.linkform': '关联表单', |
| | | 'model.form.dateday': '日期(天)', |
| | | 'model.form.datetime': '日期(秒)', |
| | | 'model.form.datetime': '日期(分/秒)', |
| | | 'model.form.dateweek': '日期(周)', |
| | | 'model.form.datemonth': '日期(月)', |
| | | 'model.form.daterange': '日期(区间)', |
| | |
| | | _style = {...card.style, opacity: isDragging ? 0 : 1} |
| | | _style = resetStyle(_style) |
| | | } |
| | | if (card.eleType === 'picture' && card.maxWidth) { |
| | | _style.maxWidth = card.maxWidth |
| | | let left = _style.marginLeft && _style.marginLeft !== '0px' ? _style.marginLeft : 'auto' |
| | | let right = _style.marginRight && _style.marginRight !== '0px' ? _style.marginRight : 'auto' |
| | | _style.margin = (_style.marginTop || 0) + ' ' + right + ' ' + (_style.marginBottom || 0) + ' ' + left |
| | | delete _style.marginLeft |
| | | delete _style.marginRight |
| | | delete _style.marginTop |
| | | delete _style.marginBottom |
| | | } |
| | | |
| | | const getContent = () => { |
| | | if (card.eleType === 'sequence') { |
| | |
| | | sequence: ['eleType', 'width'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link'], |
| | | number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'link'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link'], |
| | | video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop'], |
| | | icon: ['eleType', 'icon', 'datatype', 'width'], |
| | | slider: ['eleType', 'datatype', 'width', 'color', 'maxValue'], |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxWidth', |
| | | min: 10, |
| | | max: 2000, |
| | | label: '最大宽度', |
| | | initVal: card.maxWidth || '', |
| | | tooltip: '图片宽度的最大值。', |
| | | required: false, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'aspectRatio', |
| | | label: '长宽比', |
| | |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { getActionForm } from './formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | |
| | | <Icon className="style" title="调整样式" onClick={() => this.handleStyle(group.prevButton)} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className="prev" style={group.prevButton.style}>{group.prevButton.label}</Button> |
| | | <Button type="link" className="prev" style={resetStyle(group.prevButton.style)}>{group.prevButton.label}</Button> |
| | | </Popover> : null} |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | <Icon className="profile" title="setting" type="profile" onClick={() => this.profileAction()} /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className="submit mk-primary" style={group.subButton.style}>{group.subButton.label}</Button> |
| | | <Button type="link" className="submit mk-primary" style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | | </Popover> |
| | | {group.sort !== config.subcards.length ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | |
| | | <Icon className="style" title="调整样式" onClick={() => this.handleStyle(group.nextButton)} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className={'skip ' + group.nextButton.enable} style={group.nextButton.style}>{group.nextButton.label}</Button> |
| | | <Button type="link" className={'skip ' + group.nextButton.enable} style={resetStyle(group.nextButton.style)}>{group.nextButton.label}</Button> |
| | | </Popover> : null} |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import ModalForm from '@/templates/zshare/modalform' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | const { card, dict, group, appType } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-normal-form-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}> |
| | | <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="添加分组" onClick={this.addCard} type="plus" /> |
| | |
| | | } else if (card.type === 'datetime') { |
| | | 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 />) |
| | | let height = (card.maxRows || 2) * 25 |
| | | 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"> |
| | | <div style={{textAlign: 'left', position: 'relative', height, lineHeight: 1.5}}> |
| | | {card.initval ? card.initval : <span style={{color: '#bcbcbc'}}>请输入</span> } |
| | | {card.count === 'true' ? <span style={{position: 'absolute', right: 0, bottom: 0}}>0/{card.fieldlength}</span> : null} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | } else if (card.type === 'fileupload') { |
| | | formItem = (<Button style={{marginTop: '3px'}}><Icon type="upload" /> 点击上传 </Button>) |
| | | } else if (card.type === 'funcvar') { |
| | |
| | | render() { |
| | | const { card, dict } = this.state |
| | | let style = resetStyle(card.style) |
| | | if (card.wrap.maxWidth) { |
| | | style.maxWidth = card.wrap.maxWidth |
| | | let left = style.marginLeft && style.marginLeft !== '0px' ? style.marginLeft : 'auto' |
| | | let right = style.marginRight && style.marginRight !== '0px' ? style.marginRight : 'auto' |
| | | style.margin = (style.marginTop || 0) + ' ' + right + ' ' + (style.marginBottom || 0) + ' ' + left |
| | | delete style.marginLeft |
| | | delete style.marginRight |
| | | delete style.marginTop |
| | | delete style.marginBottom |
| | | } |
| | | |
| | | return ( |
| | | <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}> |
| | |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="登录框的最大宽度值。"> |
| | | <Icon type="question-circle" /> |
| | | 最大宽度 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('maxWidth', { |
| | | initialValue: wrap.maxWidth || '' |
| | | })(<InputNumber min={100} max={2000} precision={0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="组件占用的最小高度,用于页面布局。"> |
| | | <Icon type="question-circle" /> |
| | | 高度 |
| | |
| | | ) |
| | | } else if (card.eleType === 'picture') { |
| | | let _imagestyle = {} |
| | | let _style = card.style ? {...card.style} : {} |
| | | let _style = card.style ? {margin: '0 auto', ...card.style} : {} |
| | | let url = '' |
| | | if (card.maxWidth) { |
| | | _style.maxWidth = card.maxWidth |
| | | if (_style.marginLeft === '0px') { |
| | | delete _style.marginLeft |
| | | } |
| | | if (_style.marginRight === '0px') { |
| | | delete _style.marginRight |
| | | } |
| | | } |
| | | |
| | | if (card.datatype === 'static') { |
| | | url = card.url |
| | |
| | | |
| | | if (deForms.length === 0) { |
| | | return |
| | | } else if (menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) { |
| | | } else if (menuType !== 'HS' && options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | this.improveSimpleActionForm(deForms) |
| | | return |
| | | } |
| | |
| | | { |
| | | type: 'number', |
| | | key: 'maxRows', |
| | | min: 2, |
| | | min: 1, |
| | | max: 100, |
| | | precision: 0, |
| | | label: Formdict['header.form.maxRows'], |
| | | initVal: card.maxRows || 6, |
| | | label: appType === 'mob' ? '行数' : Formdict['header.form.maxRows'], |
| | | tooltip: appType === 'mob' ? '行数为空时,高度自适应' : '', |
| | | initVal: card.maxRows || (appType === 'mob' ? '' : 6), |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'count', |
| | | label: '计数功能', |
| | | initVal: card.count || 'false', |
| | | tooltip: '显示输入的字符数,设置行数时生效,注:加密传输时最大值与字段长度不等。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '开启' |
| | | }, { |
| | | value: 'false', |
| | | text: '关闭' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'supField', |
| | | label: '上级表单', |
| | |
| | | date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType'], |
| | | datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType'], |
| | | datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra'], |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra'], |
| | | hint: ['label', 'type', 'blacklist', 'message', 'span', 'labelwidth'], |
| | | split: ['label', 'type'], |
| | |
| | | title={this.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, |
| | |
| | | * @return {Object} style |
| | | */ |
| | | export function resetStyle (style) { |
| | | if (sessionStorage.getItem('appType') === 'mob' && style) { |
| | | if (!style) return {} |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | let _style = JSON.stringify(style) |
| | | |
| | | // scaleview |
| | |
| | | }) |
| | | |
| | | return JSON.parse(_style) |
| | | } else { |
| | | return style |
| | | } |
| | | |
| | | return JSON.parse(JSON.stringify(style)) |
| | | } |