| | |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: card.name, width: card.width || 24, linkType: 'static', position: 'relative', datatype: 'static' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '0px', marginBottom: '0px' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '0px', marginBottom: '0px', position: 'unset' }, |
| | | columns: [], |
| | | scripts: [], |
| | | elements: [], |
| | |
| | | |
| | | this.updateComponent(_card) |
| | | } else { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (!_card.style.position) { // 兼容 |
| | | if (_card.wrap.position === 'fixed' || _card.wrap.position === 'absolute') { |
| | | _card.style.position = _card.wrap.position |
| | | _card.style.zIndex = _card.wrap.position === 'fixed' ? 3 : 2 |
| | | _card.style.left = _card.wrap.left || '' |
| | | _card.style.right = _card.wrap.right || '' |
| | | _card.style.top = _card.wrap.top || '' |
| | | _card.style.bottom = _card.wrap.bottom || '' |
| | | _card.style.transform = _card.wrap.transform || '' |
| | | _card.style.width = _card.wrap.realwidth || '' |
| | | } else if (_card.wrap.left || _card.wrap.right || _card.wrap.top || _card.wrap.bottom) { |
| | | _card.style.position = 'relative' |
| | | _card.style.zIndex = 1 |
| | | _card.style.left = _card.wrap.left || '' |
| | | _card.style.right = _card.wrap.right || '' |
| | | _card.style.top = _card.wrap.top || '' |
| | | _card.style.bottom = _card.wrap.bottom || '' |
| | | } else { |
| | | _card.style.position = 'unset' |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | card: fromJS(card).toJS() |
| | | card: _card |
| | | }) |
| | | } |
| | | } |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'], card.style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | |
| | | .menu-balcony-edit-box { |
| | | position: relative; |
| | | position: unset!important; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | | background-position: center center; |
| | |
| | | min-height: 30px; |
| | | display: flex; |
| | | overflow: hidden; |
| | | max-width: 100%; |
| | | transform: none!important; |
| | | |
| | | .check-all { |
| | | width: 70px; |
| | |
| | | {value: 'show', label: '显示'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'position', |
| | | label: '位置', |
| | | initval: wrap.position || 'relative', |
| | | tooltip: '相对定位是相对其正常位置的偏移;绝对定位是相对于原组件的偏移,原组件高度可视为0;固定定位是相对于窗口的位置,定位效果测试环境中查看。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'relative', label: '相对定位'}, |
| | | {value: 'absolute', label: '绝对定位'}, |
| | | {value: 'fixed', label: '固定定位'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'quick', values: ['fixed']}, |
| | | {field: 'realwidth', values: ['fixed', 'absolute']}, |
| | | {field: 'transform', values: ['fixed', 'absolute']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'quick', |
| | | label: '快捷选择', |
| | | initval: '', |
| | | required: false, |
| | | subFields: ['top', 'left', 'right', 'bottom', 'transform'], |
| | | options: [ |
| | | {value: 'top', label: '上', top: '0px', left: '0px', right: '0px', bottom: '', transform: ''}, |
| | | {value: 'top-left', label: '左上', top: '0px', left: '0px', right: '', bottom: '', transform: ''}, |
| | | {value: 'top-right', label: '右上', top: '0px', left: '', right: '0px', bottom: '', transform: ''}, |
| | | {value: 'left-middle', label: '左中', top: '50%', left: '0px', right: '', bottom: '', transform: 'translateY(-50%)'}, |
| | | {value: 'right-middle', label: '右中', top: '50%', left: '', right: '0px', bottom: '', transform: 'translateY(-50%)'}, |
| | | {value: 'bottom-left', label: '左下', top: '', left: '0px', right: '', bottom: '0px', transform: ''}, |
| | | {value: 'bottom-right', label: '右下', top: '', left: '', right: '0px', bottom: '0px', transform: ''}, |
| | | {value: 'bottom', label: '下', top: '', left: '0px', right: '0px', bottom: '0px', transform: ''}, |
| | | {value: 'middle', label: '中间', top: '50%', left: '50%', right: '', bottom: '', transform: 'translate(-50%, -50%)'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'top', |
| | | label: '距上', |
| | | initval: wrap.top || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'right', |
| | | label: '距右', |
| | | initval: wrap.right || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'bottom', |
| | | label: '距下', |
| | | initval: wrap.bottom || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'left', |
| | | label: '距左', |
| | | initval: wrap.left || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'realwidth', |
| | | label: '实际宽度', |
| | | initval: wrap.realwidth || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'transform', |
| | | label: '变换', |
| | | initval: wrap.transform || '', |
| | | required: false, |
| | | options: [ |
| | | {value: 'translateY(-50%)', label: '上移50%'}, |
| | | {value: 'translateY(50%)', label: '下移50%'}, |
| | | {value: 'translateX(-50%)', label: '左移50%'}, |
| | | {value: 'translateX(50%)', label: '右移50%'}, |
| | | {value: 'translate(-50%, -50%)', label: '左上移50%'}, |
| | | {value: 'translate(-50%, 50%)', label: '左下移50%'}, |
| | | {value: 'translate(50%, -50%)', label: '右上移50%'}, |
| | | {value: 'translate(50%, 50%)', label: '右下移50%'}, |
| | | ] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'position', |
| | | // label: '位置', |
| | | // initval: wrap.position || 'relative', |
| | | // tooltip: '相对定位是相对其正常位置的偏移;绝对定位是相对于原组件的偏移,原组件高度可视为0;固定定位是相对于窗口的位置,定位效果测试环境中查看。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'relative', label: '相对定位'}, |
| | | // {value: 'absolute', label: '绝对定位'}, |
| | | // {value: 'fixed', label: '固定定位'}, |
| | | // ], |
| | | // controlFields: [ |
| | | // {field: 'quick', values: ['fixed']}, |
| | | // {field: 'realwidth', values: ['fixed', 'absolute']}, |
| | | // {field: 'transform', values: ['fixed', 'absolute']}, |
| | | // ] |
| | | // }, |
| | | // { |
| | | // type: 'select', |
| | | // field: 'quick', |
| | | // label: '快捷选择', |
| | | // initval: '', |
| | | // required: false, |
| | | // subFields: ['top', 'left', 'right', 'bottom', 'transform'], |
| | | // options: [ |
| | | // {value: 'top', label: '上', top: '0px', left: '0px', right: '0px', bottom: '', transform: ''}, |
| | | // {value: 'top-left', label: '左上', top: '0px', left: '0px', right: '', bottom: '', transform: ''}, |
| | | // {value: 'top-right', label: '右上', top: '0px', left: '', right: '0px', bottom: '', transform: ''}, |
| | | // {value: 'left-middle', label: '左中', top: '50%', left: '0px', right: '', bottom: '', transform: 'translateY(-50%)'}, |
| | | // {value: 'right-middle', label: '右中', top: '50%', left: '', right: '0px', bottom: '', transform: 'translateY(-50%)'}, |
| | | // {value: 'bottom-left', label: '左下', top: '', left: '0px', right: '', bottom: '0px', transform: ''}, |
| | | // {value: 'bottom-right', label: '右下', top: '', left: '', right: '0px', bottom: '0px', transform: ''}, |
| | | // {value: 'bottom', label: '下', top: '', left: '0px', right: '0px', bottom: '0px', transform: ''}, |
| | | // {value: 'middle', label: '中间', top: '50%', left: '50%', right: '', bottom: '', transform: 'translate(-50%, -50%)'} |
| | | // ] |
| | | // }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'top', |
| | | // label: '距上', |
| | | // initval: wrap.top || '', |
| | | // required: false |
| | | // }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'right', |
| | | // label: '距右', |
| | | // initval: wrap.right || '', |
| | | // required: false |
| | | // }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'bottom', |
| | | // label: '距下', |
| | | // initval: wrap.bottom || '', |
| | | // required: false |
| | | // }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'left', |
| | | // label: '距左', |
| | | // initval: wrap.left || '', |
| | | // required: false |
| | | // }, |
| | | // { |
| | | // type: 'styleInput', |
| | | // field: 'realwidth', |
| | | // label: '实际宽度', |
| | | // initval: wrap.realwidth || '', |
| | | // required: false |
| | | // }, |
| | | // { |
| | | // type: 'select', |
| | | // field: 'transform', |
| | | // label: '变换', |
| | | // initval: wrap.transform || '', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'translateY(-50%)', label: '上移50%'}, |
| | | // {value: 'translateY(50%)', label: '下移50%'}, |
| | | // {value: 'translateX(-50%)', label: '左移50%'}, |
| | | // {value: 'translateX(50%)', label: '右移50%'}, |
| | | // {value: 'translate(-50%, -50%)', label: '左上移50%'}, |
| | | // {value: 'translate(-50%, 50%)', label: '左下移50%'}, |
| | | // {value: 'translate(50%, -50%)', label: '右上移50%'}, |
| | | // {value: 'translate(50%, 50%)', label: '右下移50%'}, |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | |
| | | display: none; |
| | | width: 16px; |
| | | height: 16px; |
| | | min-width: 16px; |
| | | border: 1px solid #cccccc; |
| | | border-radius: 50%; |
| | | box-sizing: content-box; |
| | |
| | | display: none; |
| | | width: 16px; |
| | | height: 16px; |
| | | min-width: 16px; |
| | | border: 1px solid #cccccc; |
| | | border-radius: 50%; |
| | | box-sizing: content-box; |
| | |
| | | } |
| | | |
| | | getTabForms = (tab) => { |
| | | const { tabs } = this.state |
| | | |
| | | if (!tab) { |
| | | tab = { |
| | | uuid: '', |
| | |
| | | editab: tab |
| | | }) |
| | | |
| | | return getTabForm(tab, tabs.setting) |
| | | return getTabForm(tab) |
| | | } |
| | | |
| | | updateTab = (res) => { |
| | |
| | | /** |
| | | * @description tab表单配置信息 |
| | | */ |
| | | export function getTabForm(tab, setting) { |
| | | export function getTabForm(tab) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | if (_style.position === 'relative' || _style.position === 'absolute') { |
| | | if (_style.position === 'relative') { |
| | | _style.zIndex = 1 |
| | | } else if (_style.position === 'absolute') { |
| | | _style.zIndex = 2 |
| | | } else if (_style.position === 'fixed') { |
| | | _style.zIndex = 3 |
| | | } else { |
| | | delete _style.zIndex |
| | | } |
| | |
| | | this.updateStyle({textIndent: `${value}px`}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改字体粗细 |
| | | */ |
| | | boldChange = (val) => { |
| | | this.updateStyle({fontWeight: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 自动换行 |
| | | */ |
| | | wordBreakChange = (val) => { |
| | | this.updateStyle({wordBreak: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改字体颜色 ,颜色控件 |
| | | */ |
| | | changeFontColor = (val) => { |
| | | this.updateStyle({color: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 字体对齐 |
| | | */ |
| | | changeTextAlign = (e) => { |
| | | this.updateStyle({textAlign: e.target.value}) |
| | | } |
| | | |
| | | /** |
| | | * @description 字体样式,倾斜 |
| | | */ |
| | | changeFontStyle = (e) => { |
| | | this.updateStyle({fontStyle: e.target.value}) |
| | | } |
| | | |
| | | /** |
| | | * @description 字体装饰,下划线、贯穿线、上划线 |
| | | */ |
| | | changeTextDecoration = (e) => { |
| | | this.updateStyle({textDecoration: e.target.value}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改背景颜色 ,颜色控件 |
| | | */ |
| | | changeBackgroundColor = (val) => { |
| | | this.updateStyle({backgroundColor: val}) |
| | | } |
| | | |
| | | changeBackground = (val) => { |
| | | const { card } = this.state |
| | | |
| | |
| | | if (!val || /(^linear-gradient|^radial-gradient)\(.*\)$/.test(val)) { |
| | | this.callback && this.callback(_style) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 修改背景大小 |
| | | */ |
| | | changeBackgroundSize = (val) => { |
| | | this.updateStyle({backgroundSize: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改背景位置 |
| | | */ |
| | | changeBackgroundPositon= (val) => { |
| | | this.updateStyle({backgroundPosition: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改背景重复设置 |
| | | */ |
| | | changeBackgroundRepeat = (val) => { |
| | | this.updateStyle({backgroundRepeat: val}) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | this.updateStyle(_style) |
| | | } |
| | | |
| | | changeWidth = (val) => { |
| | | this.updateStyle({width: val}) |
| | | } |
| | | |
| | | changeHeight = (val) => { |
| | | this.updateStyle({height: val}) |
| | | } |
| | | |
| | | changeNormalStyle = (val, type) => { |
| | |
| | | label={<ColumnWidthOutlined title="宽度"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={this.changeWidth}/> |
| | | <StyleInput clear={true} defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={(val) => this.changeNormalStyle(val, 'width')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | |
| | | label={<ColumnHeightOutlined title="高度"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.height || ''} options={['px', 'vh', 'vw']} onChange={this.changeHeight}/> |
| | | <StyleInput clear={true} defaultValue={card.height || ''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'height')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | |
| | | </Col> : null} |
| | | {fonts.includes('fontWeight') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<BoldOutlined title="字体粗细"/>}> |
| | | <Select defaultValue={card.fontWeight || 'normal'} onChange={this.boldChange}> |
| | | <Select defaultValue={card.fontWeight || 'normal'} onChange={(val) => this.changeNormalStyle(val, 'fontWeight')}> |
| | | <Option value="normal">normal</Option> |
| | | <Option value="bold">bold</Option> |
| | | <Option value="bolder">bolder</Option> |
| | |
| | | </Col> : null} |
| | | {fonts.includes('wordBreak') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<EnterOutlined title="自动换行"/>}> |
| | | <Select defaultValue={card.wordBreak || 'normal'} onChange={this.wordBreakChange}> |
| | | <Select defaultValue={card.wordBreak || 'normal'} onChange={(val) => this.changeNormalStyle(val, 'wordBreak')}> |
| | | <Option value="normal">normal</Option> |
| | | <Option value="break-all">break-all</Option> |
| | | </Select> |
| | |
| | | label={<FontColorsOutlined title="字体颜色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <ColorSketch value={card.color || ''} onChange={this.changeFontColor} /> |
| | | <ColorSketch value={card.color || ''} onChange={(val) => this.changeNormalStyle(val, 'color')} /> |
| | | </Form.Item> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<BgColorsOutlined title="系统色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <SysColorSketch onChange={this.changeFontColor} /> |
| | | <SysColorSketch onChange={(val) => this.changeNormalStyle(val, 'color')} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {fonts.includes('fontStyle') ? <Col span={24}> |
| | |
| | | label={' '} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group defaultValue={card.fontStyle || 'normal'} onChange={this.changeFontStyle}> |
| | | <Radio.Group defaultValue={card.fontStyle || 'normal'} onChange={(e) => this.changeNormalStyle(e.target.value, 'fontStyle')}> |
| | | <Radio.Button value="normal"><span title="标准">N</span></Radio.Button> |
| | | <Radio.Button value="italic"><ItalicOutlined title="斜体"/></Radio.Button> |
| | | <Radio.Button value="oblique" style={{fontStyle: 'oblique'}}><span title="倾斜">B</span></Radio.Button> |
| | |
| | | label={' '} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group className="text-align" defaultValue={card.textAlign || 'left'} onChange={this.changeTextAlign}> |
| | | <Radio.Group className="text-align" defaultValue={card.textAlign || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'textAlign')}> |
| | | <Radio.Button value="left"><AlignLeftOutlined title="左对齐"/></Radio.Button> |
| | | <Radio.Button value="center"><AlignCenterOutlined title="居中对齐"/></Radio.Button> |
| | | <Radio.Button value="right"><AlignRightOutlined title="右对齐"/></Radio.Button> |
| | |
| | | label={' '} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group className="text-decoration" defaultValue={card.textDecoration || 'none'} onChange={this.changeTextDecoration}> |
| | | <Radio.Group className="text-decoration" defaultValue={card.textDecoration || 'none'} onChange={(e) => this.changeNormalStyle(e.target.value, 'textDecoration')}> |
| | | <Radio.Button value="none"><span title="标准">N</span></Radio.Button> |
| | | <Radio.Button value="underline"><UnderlineOutlined title="下划线"/></Radio.Button> |
| | | <Radio.Button value="line-through"><StrikethroughOutlined title="中划线"/></Radio.Button> |
| | |
| | | label={<BgColorsOutlined title="背景颜色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <ColorSketch allowClear={true} value={card.backgroundColor || ''} onChange={this.changeBackgroundColor} /> |
| | | <ColorSketch allowClear={true} value={card.backgroundColor || ''} onChange={(val) => this.changeNormalStyle(val, 'backgroundColor')} /> |
| | | </Form.Item> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<BgColorsOutlined title="系统色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <SysColorSketch onChange={this.changeBackgroundColor} /> |
| | | <SysColorSketch onChange={(val) => this.changeNormalStyle(val, 'backgroundColor')} /> |
| | | </Form.Item> |
| | | </Col> |
| | | {window.develop === true ? <Col span={24}> |
| | |
| | | label="比例" |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Select defaultValue={card.backgroundSize || 'cover'} onChange={this.changeBackgroundSize}> |
| | | <Select defaultValue={card.backgroundSize || 'cover'} onChange={(val) => this.changeNormalStyle(val, 'backgroundSize')}> |
| | | <Option value="100%">100%</Option> |
| | | <Option value="100% 100%">100% 100%</Option> |
| | | <Option value="auto 100%">auto 100%</Option> |
| | |
| | | label="重复" |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Select defaultValue={card.backgroundRepeat || 'no-repeat'} onChange={this.changeBackgroundRepeat}> |
| | | <Select defaultValue={card.backgroundRepeat || 'no-repeat'} onChange={(val) => this.changeNormalStyle(val, 'backgroundRepeat')}> |
| | | <Option value="repeat">repeat</Option> |
| | | <Option value="no-repeat">no-repeat</Option> |
| | | <Option value="repeat-x">repeat-x</Option> |
| | |
| | | label="位置" |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Select defaultValue={card.backgroundPosition || 'center'} onChange={this.changeBackgroundPositon}> |
| | | <Select defaultValue={card.backgroundPosition || 'center'} onChange={(val) => this.changeNormalStyle(val, 'backgroundPosition')}> |
| | | <Option value="center">center</Option> |
| | | <Option value="center top">center top</Option> |
| | | <Option value="center bottom">center bottom</Option> |
| | |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('position') ? <Panel header="定位" key="position"> |
| | | <div style={{paddingLeft: '35px', fontSize: '12px'}}>注:定位效果请在运行环境中查看。</div> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<SwapOutlined title="定位"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | labelCol={{xs: { span: 24 }, sm: { span: 3 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 21 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.position || 'unset'} onChange={(e) => this.changeNormalStyle(e.target.value, 'position')}> |
| | | <Radio value="unset">无</Radio> |
| | | <Radio value="relative">相对定位</Radio> |
| | | <Radio value="absolute">绝对定位</Radio> |
| | | <Radio value="relative">相对</Radio> |
| | | <Radio value="absolute">绝对</Radio> |
| | | <Radio value="fixed">固定</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | <Form.Item |
| | | colon={false} |
| | | label={<ArrowUpOutlined title="上"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | labelCol={{xs: { span: 24 }, sm: { span: 3 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 21 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.top || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'top')}/> |
| | | </Form.Item> |
| | |
| | | <Form.Item |
| | | colon={false} |
| | | label={<ArrowDownOutlined title="下"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | labelCol={{xs: { span: 24 }, sm: { span: 3 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 21 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.bottom || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'bottom')}/> |
| | | </Form.Item> |
| | |
| | | <Form.Item |
| | | colon={false} |
| | | label={<ArrowLeftOutlined title="左"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | labelCol={{xs: { span: 24 }, sm: { span: 3 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 21 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.left || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'left')}/> |
| | | </Form.Item> |
| | |
| | | <Form.Item |
| | | colon={false} |
| | | label={<ArrowRightOutlined title="右"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | labelCol={{xs: { span: 24 }, sm: { span: 3 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 21 }} } |
| | | > |
| | | <StyleInput clear={true} defaultValue={card.right || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'right')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('transform') ? <Panel header="位置变换" key="transform"> |
| | | <div style={{paddingLeft: '50px', fontSize: '12px'}}>注:变换效果请在运行环境中查看。</div> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<BorderOuterOutlined title="变换"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Select defaultValue={card.transform || ''} onChange={(val) => this.changeNormalStyle(val, 'transform')}> |
| | | <Option value="">无</Option> |
| | | <Option value="translateY(-50%)">上移50%</Option> |
| | | <Option value="translateY(50%)">下移50%</Option> |
| | | <Option value="translateX(-50%)">左移50%</Option> |
| | | <Option value="translateX(50%)">右移50%</Option> |
| | | <Option value="translate(-50%, -50%)">左上移50%</Option> |
| | | <Option value="translate(-50%, 50%)">左下移50%</Option> |
| | | <Option value="translate(50%, -50%)">右上移50%</Option> |
| | | <Option value="translate(50%, 50%)">右下移50%</Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | </Collapse> : null} |
| | | </Form> |
| | | <div style={{textAlign: 'right', lineHeight: '60px', marginBottom: '30px'}}> |
| | |
| | | options: null |
| | | } |
| | | |
| | | timer = null |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { defaultValue, value, options } = this.props |
| | | let val = '' |
| | |
| | | value: _val, |
| | | }) |
| | | |
| | | if (this.props.onChange) { |
| | | if (!_val) { |
| | | this.props.onChange(clear ? '' : '0px') |
| | | } else { |
| | | this.props.onChange(`${_val}${unit}`) |
| | | clearTimeout(this.timer) |
| | | |
| | | this.timer = setTimeout(() => { |
| | | if (this.props.onChange) { |
| | | if (_val === '') { |
| | | this.props.onChange(clear ? '' : '0px') |
| | | } else { |
| | | this.props.onChange(`${_val}${unit}`) |
| | | } |
| | | } |
| | | } |
| | | }, 100) |
| | | } |
| | | |
| | | changeUnit = (val) => { |
| | | const { value } = this.state |
| | | |
| | | this.setState({unit: val}) |
| | | |
| | | if (val === 'auto') { |
| | | this.setState({value: ''}) |
| | | this.props.onChange('auto') |
| | | } else { |
| | | if (value && this.props.onChange) { |
| | | this.props.onChange(`${value}${val}`) |
| | | this.setState({unit: val}, () => { |
| | | if (val === 'auto') { |
| | | this.setState({value: ''}) |
| | | this.props.onChange('auto') |
| | | } else { |
| | | if (value && this.props.onChange) { |
| | | this.props.onChange(`${value}${val}`) |
| | | } else { |
| | | this.props.onChange('') |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | |
| | | } |
| | | |
| | | getTabForms = (tab) => { |
| | | const { tabs } = this.state |
| | | |
| | | if (!tab) { |
| | | tab = { |
| | | uuid: '', |
| | |
| | | editab: tab |
| | | }) |
| | | |
| | | return getTabForm(tab, tabs.setting) |
| | | return getTabForm(tab) |
| | | } |
| | | |
| | | updateTab = (res) => { |
| | |
| | | editab.icon = res.icon |
| | | editab.hide = res.hide || 'false' |
| | | editab.backgroundColor = res.backgroundColor |
| | | editab.controlVal = res.controlVal || '' |
| | | // editab.controlVal = res.controlVal || '' |
| | | editab.selectVal = res.selectVal || '' |
| | | editab.blacklist = res.blacklist |
| | | |
| | |
| | | getTabsForms = () => { |
| | | const { tabs } = this.state |
| | | |
| | | return getTabsSetForm(tabs.setting, tabs.uuid) |
| | | return getTabsSetForm(tabs.setting, tabs.uuid, tabs.subtabs) |
| | | } |
| | | |
| | | updateTabs = (res) => { |
| | | this.updateComponent({...this.state.tabs, setting: res}) |
| | | let tabs = fromJS(this.state.tabs).toJS() |
| | | |
| | | if (res.controlVals) { |
| | | let values = {} |
| | | res.controlVals.forEach(item => { |
| | | values[item.uuid] = item.value |
| | | }) |
| | | tabs.subtabs.forEach(tab => { |
| | | tab.controlVal = values[tab.uuid] |
| | | }) |
| | | |
| | | delete res.controlVals |
| | | } |
| | | |
| | | tabs.setting = res |
| | | |
| | | this.updateComponent(tabs) |
| | | } |
| | | |
| | | onChange = (key) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export function getTabForm(tab, setting) { |
| | | // let appType = sessionStorage.getItem('appType') |
| | | export function getTabForm(tab) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | |
| | | if (roleList) { |
| | |
| | | required: false, |
| | | allowClear: true, |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '隐藏标记', |
| | | initval: tab.controlVal || '', |
| | | tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。注:多个值请用逗号分隔。', |
| | | required: false |
| | | }, |
| | | // { |
| | | // type: 'text', |
| | | // field: 'controlVal', |
| | | // label: '隐藏标记', |
| | | // initval: tab.controlVal || '', |
| | | // tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。注:多个值请用逗号分隔。', |
| | | // required: false |
| | | // }, |
| | | { |
| | | type: 'text', |
| | | field: 'selectVal', |
| | |
| | | {value: 'false', label: '否'}, |
| | | {value: 'true', label: '是'}, |
| | | ], |
| | | }, |
| | | // { |
| | | // type: 'multiselect', |
| | | // field: 'blacklist', |
| | | // label: '黑名单', |
| | | // initval: tab.blacklist || [], |
| | | // required: false, |
| | | // options: roleList, |
| | | // forbid: !!appType, |
| | | // }, |
| | | } |
| | | ] |
| | | |
| | | return tabForm |
| | |
| | | /** |
| | | * @description tabs表单配置信息 |
| | | */ |
| | | export function getTabsSetForm(setting, uuid) { |
| | | export function getTabsSetForm(setting, uuid, subtabs) { |
| | | let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid, window.GLOB.customMenu.interfaces) |
| | | modules.push({ |
| | | value: 'preview', |
| | | label: '上一页(url参数)' |
| | | }) |
| | | |
| | | let controlVals = subtabs.map(item => ({uuid: item.uuid, label: item.label, value: item.controlVal})) |
| | | |
| | | const tabForm = [ |
| | | { |
| | |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | // { |
| | | // type: 'select', |
| | | // field: 'position', |
| | | // label: '标签位置', |
| | | // initval: setting.position || 'top', |
| | | // required: true, |
| | | // options: [ |
| | | // {value: 'top', label: 'top'}, |
| | | // {value: 'bottom', label: 'bottom'}, |
| | | // {value: 'left', label: 'left'}, |
| | | // {value: 'right', label: 'right'}, |
| | | // ], |
| | | // controlFields: [ |
| | | // {field: 'display', values: ['top', 'bottom']}, |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'display', |
| | |
| | | options: modules, |
| | | controlFields: [ |
| | | {field: 'controlField', notNull: true}, |
| | | {field: 'controlVals', notNull: true}, |
| | | {field: 'swiper', values: ['']}, |
| | | ], |
| | | }, |
| | |
| | | ], |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'table', |
| | | field: 'controlVals', |
| | | label: '标签组', |
| | | initval: controlVals, |
| | | tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。注:1、多个值请用逗号分隔,2、@pass@值表示忽略此设置(始终显示),2、@pass_empty@值表示忽略空值,即未获取上级组件信息时显示(可与其他值拼接)。', |
| | | required: false, |
| | | fixed: true, |
| | | span: 24, |
| | | columns: [ |
| | | { |
| | | title: '标签名称', |
| | | dataIndex: 'label', |
| | | editable: false, |
| | | required: false, |
| | | width: '30%' |
| | | }, |
| | | { |
| | | title: '隐藏标记', |
| | | dataIndex: 'value', |
| | | inputType: 'input', |
| | | editable: true, |
| | | required: false, |
| | | width: '50%' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | return tabForm |
| | |
| | | _data.$$uuid = _data[_config.setting.primaryKey] || '' |
| | | } |
| | | |
| | | if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') { |
| | | _config.style.position = _config.wrap.position |
| | | _config.style.zIndex = _config.wrap.position === 'fixed' ? 3 : 2 |
| | | _config.style.left = _config.wrap.left || '' |
| | | _config.style.right = _config.wrap.right || '' |
| | | _config.style.top = _config.wrap.top || '' |
| | | _config.style.bottom = _config.wrap.bottom || '' |
| | | _config.style.transform = _config.wrap.transform || '' |
| | | _config.style.width = _config.wrap.realwidth || '' |
| | | } else { |
| | | _config.style.zIndex = 1 |
| | | _config.style.left = _config.wrap.left || '' |
| | | _config.style.right = _config.wrap.right || '' |
| | | _config.style.top = _config.wrap.top || '' |
| | | _config.style.bottom = _config.wrap.bottom || '' |
| | | if (!_config.style.position) { |
| | | if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') { |
| | | _config.style.position = _config.wrap.position |
| | | _config.style.zIndex = _config.wrap.position === 'fixed' ? 3 : 2 |
| | | _config.style.left = _config.wrap.left || '' |
| | | _config.style.right = _config.wrap.right || '' |
| | | _config.style.top = _config.wrap.top || '' |
| | | _config.style.bottom = _config.wrap.bottom || '' |
| | | _config.style.transform = _config.wrap.transform || '' |
| | | _config.style.width = _config.wrap.realwidth || '' |
| | | } else { |
| | | _config.style.zIndex = 1 |
| | | _config.style.left = _config.wrap.left || '' |
| | | _config.style.right = _config.wrap.right || '' |
| | | _config.style.top = _config.wrap.top || '' |
| | | _config.style.bottom = _config.wrap.bottom || '' |
| | | } |
| | | } |
| | | |
| | | let show = true |
| | |
| | | display: none; |
| | | width: 16px; |
| | | height: 16px; |
| | | min-width: 16px; |
| | | border: 1px solid #cccccc; |
| | | border-radius: 50%; |
| | | box-sizing: content-box; |
| | |
| | | display: none; |
| | | width: 16px; |
| | | height: 16px; |
| | | min-width: 16px; |
| | | border: 1px solid #cccccc; |
| | | border-radius: 50%; |
| | | box-sizing: content-box; |