| | |
| | | {val} |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'color') { |
| | | _style.overflow = 'hidden' |
| | | let _bgstyle = {backgroundColor: card.value || '#1890ff'} |
| | | |
| | | if (PicRadio[card.lenWidRadio]) { |
| | | _bgstyle.paddingTop = PicRadio[card.lenWidRadio] |
| | | } else { |
| | | _bgstyle.paddingTop = '100%' |
| | | } |
| | | |
| | | return ( |
| | | <div style={_bgstyle}></div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | qrcode: ['eleType', 'datatype', 'width', 'qrWidth', 'color', 'url', 'noValue'], |
| | | currentDate: ['eleType', 'width', 'dateFormat', 'prefix', 'postfix', 'fixStyle'], |
| | | formula: ['eleType', 'width', 'height', 'prefix', 'postfix', 'eval', 'formula', 'noValue', 'fixStyle'], |
| | | color: ['eleType', 'datatype', 'width', 'lenWidRadio', 'noValue', 'copyable'], |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | getOptions = (eleType, datatype, link, showType, showInfo, fixStyle, posterType) => { |
| | | let _options = fromJS(cardTypeOptions[eleType]).toJS() // 选项列表 |
| | | |
| | | if (['text', 'number', 'picture', 'slider', 'barcode', 'qrcode', 'video'].includes(eleType)) { |
| | | if (['text', 'number', 'picture', 'slider', 'barcode', 'qrcode', 'video', 'color'].includes(eleType)) { |
| | | if (datatype === 'dynamic') { |
| | | _options.push('field') |
| | | if (eleType === 'number') { |
| | |
| | | { value: 'qrcode', text: '二维码'}, |
| | | { value: 'currentDate', text: '当前时间'}, |
| | | { value: 'formula', text: '公式'}, |
| | | { value: 'color', text: '颜色'}, |
| | | ] |
| | | |
| | | let anchors = [] |
| | |
| | | } |
| | | } else if (element.eleType === 'picture') { |
| | | options = ['border', 'margin'] |
| | | } else if (element.eleType === 'color') { |
| | | options = ['border', 'margin', 'padding'] |
| | | } else if (element.eleType === 'text') { |
| | | options[0] = 'font2' |
| | | options.push('display') |
| | |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | if (this.record.execMode === 'pop' || this.record.execMode === 'prompt') { |
| | | shows.push('position') |
| | | } |
| | | } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { |
| | | shows.push('execSuccess', 'execError') |
| | | } else if (_funcType === 'closetab') { |
| | |
| | | if (appType === 'mob') { |
| | | opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'excelOut', 'innerpage', 'funcbutton'].includes(item.value)) |
| | | funTypes = [ |
| | | { value: 'print', text: '标签打印' }, |
| | | { value: 'scan', text: '扫码' }, |
| | | { value: 'pay', text: '支付' }, |
| | | { value: 'refund', text: '退款' }, |
| | |
| | | } else if (appType === 'pc') { |
| | | opentypes = opentypes.filter(item => item.value !== 'tab') |
| | | funTypes = [ |
| | | { value: 'print', text: '标签打印' }, |
| | | { value: 'changeuser', text: '切换用户' }, |
| | | ] |
| | | pageTemps = [ |
| | |
| | | { value: 'qrcode', text: '二维码', type: 'action', class: 'element', $init: true}, |
| | | { value: 'currentDate', text: '当前时间', type: 'action', class: 'element', $init: true}, |
| | | { value: 'formula', text: '公式', type: 'action', class: 'element', $init: true}, |
| | | { value: 'color', text: '颜色', type: 'action', class: 'element', $init: true}, |
| | | { value: 'sequence', text: '序号', type: 'action', class: 'element', $init: true } |
| | | ] |
| | | }, |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Col, Tooltip, notification, Typography } from 'antd' |
| | | import { Col, Tooltip, notification, Typography, message } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | // import Api from '@/api' |
| | |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'color') { |
| | | let color = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | color = card.value |
| | | } else { |
| | | color = data[card.field] || '' |
| | | } |
| | | |
| | | if (color === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | let _bgstyle = {backgroundColor: color} |
| | | |
| | | if (PicRadio[card.lenWidRadio]) { |
| | | _bgstyle.paddingTop = PicRadio[card.lenWidRadio] |
| | | } else { |
| | | _bgstyle.paddingTop = '100%' |
| | | } |
| | | |
| | | if (card.copyable === 'true') { |
| | | _bgstyle.cursor = 'pointer' |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div className="ant-mk-color" style={card.style}> |
| | | <div style={_bgstyle} onClick={(e) => { |
| | | if (card.copyable === 'true') { |
| | | e.stopPropagation() |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = color |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | |
| | | message.success('复制成功。') |
| | | } |
| | | }}></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'button') { |
| | | let _disabled = data.$disabled |
| | | if (card.control === 'hidden') { |
| | |
| | | vertical-align: top; |
| | | line-height: inherit; |
| | | } |
| | | .ant-mk-color { |
| | | overflow: hidden; |
| | | } |
| | | .ant-switch-large { |
| | | min-width: 60px; |
| | | height: 30px; |
| | |
| | | // 系统打印数据,校验data字段 |
| | | if (!cell.data || cell.data.length === 0) return |
| | | |
| | | Object.keys(cell).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | cell[_key] = cell[key] |
| | | } |
| | | }) |
| | | |
| | | cell.data.forEach(item => { |
| | | let _item = {...formdata} |
| | | |
| | |
| | | } |
| | | }) |
| | | if (!errorMsg) { |
| | | resolve({next: true, list: result.map(res => { |
| | | Object.keys(res).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | res[_key] = res[key] |
| | | } |
| | | }) |
| | | |
| | | return res |
| | | })}) |
| | | resolve({next: true, list: result}) |
| | | } else { |
| | | this.execError(errorMsg) |
| | | resolve({next: false, list: []}) |
| | |
| | | |
| | | return Api.genericInterface(_callbackparam) |
| | | } else if (response.status) { |
| | | Object.keys(response).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | response[_key] = response[key] |
| | | } |
| | | }) |
| | | |
| | | _list.push(response) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | |
| | | if (!response) return |
| | | |
| | | if (response.status) { |
| | | Object.keys(response).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | response[_key] = response[key] |
| | | } |
| | | }) |
| | | |
| | | _list.push(response) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | Object.keys(res).forEach(key => { |
| | | let _key = key.toLowerCase() |
| | | if (['templateid', 'printtype', 'printcount'].includes(_key)) { |
| | | res[_key] = res[key] |
| | | } |
| | | }) |
| | | _list.push(res) |
| | | |
| | | if (params.length === 0) { |
| | |
| | | 字段集 |
| | | {verify.columns.length ? <span className="count-tip">{verify.columns.length}</span> : null} |
| | | </span> |
| | | } key="columns"> |
| | | } disabled={dataType !== 'custom'} key="columns"> |
| | | <ColForm columnChange={this.columnChange}/> |
| | | <FieldsComponent |
| | | config={verify} |