| | |
| | | const getContent = () => { |
| | | if (card.eleType === 'sequence') { |
| | | return ( |
| | | <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">1</div> |
| | | <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">{card.prefix || ''}1{card.postfix || ''}</div> |
| | | ) |
| | | } else if (card.eleType === 'text' || card.eleType === 'number') { |
| | | let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}` |
| | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const cardTypeOptions = { |
| | | sequence: ['eleType', 'width'], |
| | | sequence: ['eleType', 'width', 'prefix', 'postfix'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable', 'alignItems', 'sortField'], |
| | | number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle', 'alignItems'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'], |
| | |
| | | let config = JSON.stringify(this.props.config) |
| | | const _this = this |
| | | |
| | | if (new RegExp(field, 'ig').test(config)) { |
| | | if (new RegExp('@' + field + '@', 'ig').test(config)) { |
| | | confirm({ |
| | | title: `配置中存在@${field}@,确定删除吗?`, |
| | | content: '', |
| | |
| | | contents.push( |
| | | <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{card.prefix || ''}{data.$Index || ''}{card.postfix || ''}</span></div> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | cancelText: '支付遇到问题', |
| | | onOk() { |
| | | // 支付后刷新界面 |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn) |
| | | MKEmitter.emit('reloadMenuView', btn.$MenuID) |
| | | }, |
| | | onCancel() { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn) |
| | |
| | | verify.scripts.push(values) |
| | | } |
| | | |
| | | if (/@bvoucher(\s|\))/ig.test(values.sql)) { |
| | | if (/@bvoucher(\s|\))/ig.test(values.sql) && !/s_BVoucher_Create/ig.test(values.sql)) { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | |
| | | } else if (card.Ot !== 'notRequired' && columns) { |
| | |
| | | if (keyCode === 46 && editItemId && editItemType !== 'Template') { |
| | | this.deleteItem() |
| | | } |
| | | if (e.ctrlKey && keyCode === 81 && editItemId && editItemType !== 'Template') { |
| | | this.copyItem() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | copyItem = () => { |
| | | const { editItemId, config, fields } = this.state |
| | | |
| | | let cell = config.elements.filter(item => item.uuid === editItemId)[0] |
| | | |
| | | if (!cell) return |
| | | |
| | | let item = {...cell} |
| | | |
| | | item.left = item.left + parseInt(item.width / 4) |
| | | item.top = item.top + parseInt(item.height / 4) |
| | | item.uuid = Utils.getuuid() |
| | | |
| | | if (item.left + item.width > config.width) { |
| | | item.left = config.width - item.width |
| | | } |
| | | if (item.top + item.height > config.height) { |
| | | item.top = config.height - item.height |
| | | } |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | _config.elements.push(item) |
| | | |
| | | let _formlist = [] |
| | | if (item.type === 'text') { |
| | | _formlist = getTextForm(item, fields) |
| | | } else if (item.type === 'barcode') { |
| | | _formlist = getBarcodeForm(item, fields) |
| | | } else if (item.type === 'qrcode') { |
| | | _formlist = getQrcodeForm(item, fields) |
| | | } else if (item.type === 'image') { |
| | | _formlist = getImageForm(item, fields) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | editItemId: item.uuid, |
| | | editItemType: item.type, |
| | | formlist: _formlist |
| | | }, () => { |
| | | this.resetview() |
| | | }) |
| | | } |
| | | |
| | | deleteItem = () => { |
| | | const _this = this |
| | | const { editItemId, config } = this.state |
| | |
| | | return ( |
| | | <div className="print-template"> |
| | | <DndProvider backend={HTML5Backend}> |
| | | <header className="print-header-container ant-menu-dark">模板制作</header> |
| | | <header className="print-header-container ant-menu-dark"> |
| | | 模板制作 |
| | | <div>快捷键:Delete(删除元素)、ctrl + q(复制元素)</div> |
| | | </header> |
| | | <aside className="tools"> |
| | | <Card className="tool-bar" title="工具栏"> |
| | | {printItems.map((item, index) => { |
| | |
| | | text-align: center; |
| | | color: #fff; |
| | | background: #001529; |
| | | |
| | | div { |
| | | position: absolute; |
| | | top: 0px; |
| | | right: 30px; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | .tools { |
| | | width: 240px; |