| | |
| | | } |
| | | |
| | | render() { |
| | | const { value, options } = this.state |
| | | const { value, options, config } = this.state |
| | | |
| | | return ( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} value={value} onChange={this.onChange}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} disabled={config.disabled} value={value} onChange={this.onChange}> |
| | | {options.map(option => <Radio key={option.value} disabled={option.disabled} value={option.value}>{option.label}</Radio>)} |
| | | </Radio.Group> |
| | | ) |
| | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes) |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes, card.setting) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = []) { |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let MenuType = '' |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | | let laypage = setting && setting.laypage !== 'false' |
| | | |
| | | if (menu.parentId === 'BillPrintTemp') { |
| | | MenuType = 'billPrint' |
| | |
| | | initval: wrap.pagestyle || 'page', |
| | | tooltip: '数据源选择分页时有效。注:滑动加载只有第一个有效', |
| | | required: false, |
| | | disabled: !laypage, |
| | | options: [ |
| | | {value: 'page', label: '页码'}, |
| | | {value: 'switch', label: '左右切换', forbid: appType === 'mob'}, |
| | |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '控制值', |
| | | label: '禁用值', |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与控制值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false, |
| | | forbid: subtype !== 'datacard' |
| | | }, |
| | |
| | | initval: wrap.slidetip || wrap.slidetip === '' ? wrap.slidetip : '没有更多了', |
| | | tooltip: '滑动加载至底部时的提示信息。', |
| | | required: false, |
| | | forbid: appType !== 'mob' || subtype === 'propcard' |
| | | forbid: !laypage || appType !== 'mob' || subtype === 'propcard' |
| | | }, |
| | | { |
| | | type: 'table', |
| | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getWrapForm(card.wrap, card.subtype) |
| | | return getWrapForm(card.wrap, card.subtype, null, null, null, card.setting) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'datatype', |
| | | label: '初始值', |
| | | label: '数据来源', |
| | | initval: wrap.datatype || 'static', |
| | | tooltip: '初始值来源于数据源或表单默认值。', |
| | | required: false, |
| | |
| | | |
| | | class CopyComponent extends Component { |
| | | static propTpyes = { |
| | | btnlog: PropTypes.array, |
| | | handlelog: PropTypes.func |
| | | type: PropTypes.string, |
| | | card: PropTypes.object |
| | | } |
| | | |
| | | trigger = () => { |
| | |
| | | _val.$srcId = srcid |
| | | } |
| | | |
| | | if (type === 'menucell') { |
| | | _val.setting.type = 'linkmenu' |
| | | _val.setting.linkMenuId = '' |
| | | _val.setting.copyMenuId = '' |
| | | } |
| | | |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) |
| | | } catch (e) { |
| | | message.warning('复制失败,请重试!') |
| | |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '控制值', |
| | | label: '禁用值', |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与控制值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | }, 200) |
| | | } |
| | | |
| | | filterComponent = (config) => { |
| | | let item = null |
| | | config.subMenus.forEach(menu => { |
| | | if (menu.setting.type === 'linkmenu' && menu.setting.linkMenuId === '') { |
| | | item = menu |
| | | } |
| | | }) |
| | | |
| | | this.updateComponent(config) |
| | | |
| | | setTimeout(() => { |
| | | let node = document.getElementById(item.uuid) |
| | | node && node.click() |
| | | }, 200) |
| | | } |
| | | |
| | | move = (item, direction) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="menubar" card={card}/> |
| | | <PasteComponent config={card} options={['menucell']} updateConfig={this.updateComponent} /> |
| | | <PasteComponent config={card} options={['menucell']} updateConfig={this.filterComponent} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle} /> |
| | | <UserComponent config={card}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | |
| | | </div>} |
| | | <div className="menu-name" style={{opacity: !card.setting.name ? 0 : 1}}>{card.setting.name || '明科'}</div> |
| | | <RightOutlined className="menu-right" /> |
| | | {!card.setting.name ? <NormalForm title="菜单编辑" width={900} update={this.updateSetting} cancel={() => this.props.deleteElement(card, 'direct')} getForms={this.getSettingForms}> |
| | | {!card.setting.name || (card.setting.type === 'linkmenu' && card.setting.linkMenuId === '') ? <NormalForm title="菜单编辑" width={900} update={this.updateSetting} cancel={() => this.props.deleteElement(card, 'direct')} getForms={this.getSettingForms}> |
| | | <span id={card.uuid}></span> |
| | | </NormalForm> : null} |
| | | </div> |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { btn } = this.props |
| | | const { config, dict, saving } = this.state |
| | | |
| | | return ( |
| | |
| | | <div className="mob-shell-inner"> |
| | | <div className="am-navbar"> |
| | | <LeftOutlined /> |
| | | <div className="am-navbar-title">{config.setting.title}</div> |
| | | <div className="am-navbar-title">{btn.label}</div> |
| | | {config.setting.btnPosition === 'top' ? <Button className="modal-submit-top">{config.setting.btnName || '确定'}</Button> : null} |
| | | </div> |
| | | <DragElement |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {val}</span> |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {val}</span> |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {val}</span> |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | if (col.blur) { |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | cursor: not-allowed; |
| | | --mk-table-color: #bcbcbc; |
| | | |
| | | span, div { |
| | | color: #bcbcbc!important; |
| | | } |
| | | |
| | | .ant-btn { |
| | | cursor: not-allowed; |
| | | } |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | children = content |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | children = content |
| | |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span> |
| | | content = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {content}</span> |
| | | } else { |
| | | content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span> |
| | | content = <span>{content} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | |
| | | if (btn.popClose !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.popClose, btn) |
| | | } |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | |
| | | getPop = () => { |
| | |
| | | */ |
| | | export function getMark (marks, record, style = {}) { |
| | | let icon = null |
| | | let color = null |
| | | let innerStyle = null |
| | | let position = null |
| | | style = JSON.parse(JSON.stringify(style)) |
| | | |
| | |
| | | |
| | | if (type === 'font') { |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | } else if (type === 'background') { |
| | | style.background = mark.color |
| | | if (mark.fontColor) { |
| | | style.color = mark.fontColor |
| | | innerStyle = {color: mark.fontColor} |
| | | } |
| | | } else if (type === 'underline') { |
| | | style.textDecoration = 'underline' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'underline'} |
| | | } else if (type === 'line-through') { |
| | | style.textDecoration = 'line-through' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'line-through'} |
| | | } else if (type.indexOf('icon') > -1) { |
| | | icon = mark.signType[mark.signType.length - 1] |
| | | color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | if (type === 'iconfront' || mark.signType[1] === 'front') { |
| | | position = 'front' |
| | | } else { |
| | |
| | | return { |
| | | style, |
| | | icon, |
| | | color, |
| | | innerStyle, |
| | | position |
| | | } |
| | | } |
| | |
| | | error = `搜索条件《${item.name}》未设置搜索字段!` |
| | | } |
| | | } |
| | | if (item.wrap && item.wrap.pagestyle === 'slide') { |
| | | if (item.wrap && item.wrap.pagestyle === 'slide' && item.pageable && item.setting.laypage !== 'false') { |
| | | swipes.push(item.name) |
| | | } |
| | | |