| | |
| | | "esprima": "^4.0.0" |
| | | } |
| | | }, |
| | | "jsbarcode": { |
| | | "version": "3.11.3", |
| | | "resolved": "https://registry.npmjs.org/jsbarcode/-/jsbarcode-3.11.3.tgz", |
| | | "integrity": "sha512-TsoeHL/0ASvKE3+sbLuTkT2cGvDV/MsQAQVuGf/1EWKe7SXNYlyzW/3TFeAmqJg/Fhz6pPgrci8o5hR+Ej59Jw==" |
| | | }, |
| | | "jsbn": { |
| | | "version": "0.1.1", |
| | | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", |
| | |
| | | "jest-environment-jsdom-fourteen": "0.1.0", |
| | | "jest-resolve": "24.8.0", |
| | | "jest-watch-typeahead": "0.3.1", |
| | | "jsbarcode": "^3.11.3", |
| | | "md5": "^2.2.1", |
| | | "mini-css-extract-plugin": "0.5.0", |
| | | "moment": "^2.24.0", |
| | |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| | | <meta name="theme-color" content="#000000" /> |
| | | <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import JsBarcode from 'jsbarcode' |
| | | |
| | | import './index.scss' |
| | | |
| | | class BarCode extends Component { |
| | | static propTpyes = { |
| | | card: PropTypes.object, // 条码设置 |
| | | value: PropTypes.any, // 条码值 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.resetBarcode() |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | if ((nextProps.value && this.props.value !== nextProps.value) || !is(fromJS(nextProps.card), fromJS(this.props.card))) { |
| | | this.setState({}, () => { |
| | | this.resetBarcode() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | resetBarcode = () => { |
| | | const { value, card } = this.props |
| | | |
| | | let style = card.style || {} |
| | | |
| | | JsBarcode(this.barcode, value, { |
| | | displayValue: card.displayValue === 'true', |
| | | width: card.interval || 1, |
| | | height: card.barHeight || 25, |
| | | margin: 0, |
| | | fontOptions: `${style.fontWeight || ''} ${style.fontStyle || ''}`, |
| | | textAlign: style.textAlign || 'left', |
| | | fontSize: (style.fontSize || 14) + 'px', |
| | | lineColor: style.color || '#000000' |
| | | }) |
| | | |
| | | } |
| | | |
| | | render() { |
| | | return ( |
| | | <div className="barcode-box"> |
| | | <svg ref={(ref) => { this.barcode = ref }}/> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default BarCode |
New file |
| | |
| | | .barcode-box { |
| | | svg { |
| | | vertical-align: top; |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import * as QrCode from 'qrcode.react' |
| | | |
| | | import './index.scss' |
| | | |
| | | class BarCode extends Component { |
| | | static propTpyes = { |
| | | card: PropTypes.object, // 条码设置 |
| | | value: PropTypes.any, // 条码值 |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) |
| | | } |
| | | |
| | | hexify = (color) => { |
| | | let values = color.replace(/rgba?\(/, '').replace(/\)/, '').replace(/[\s+]/g, '').split(',') |
| | | let a = parseFloat(values[3] || 1) |
| | | let r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255) |
| | | let g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255) |
| | | let b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255) |
| | | |
| | | return '#' + ('0' + r.toString(16)).slice(-2) + ('0' + g.toString(16)).slice(-2) + ('0' + b.toString(16)).slice(-2) |
| | | } |
| | | |
| | | render() { |
| | | const { value, card } = this.props |
| | | let color = card.color |
| | | |
| | | if (/rgb/ig.test(color)) { |
| | | color = this.hexify(color) |
| | | } |
| | | |
| | | return ( |
| | | <div className="qrcode-box"> |
| | | <QrCode |
| | | value={value} |
| | | size={card.qrWidth || 50} |
| | | fgColor={color} |
| | | imageSettings={card.url ? { |
| | | src: card.url, |
| | | height: (card.qrWidth || 50) / 4, |
| | | width: (card.qrWidth || 50) / 4, |
| | | excavate: true |
| | | } : null}/> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default BarCode |
New file |
| | |
| | | .qrcode-box { |
| | | canvas { |
| | | vertical-align: top; |
| | | } |
| | | } |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Popover } from 'antd' |
| | | import './index.scss' |
| | | import moment from 'moment' |
| | | |
| | | import demo1 from '@/assets/img/demo1.jpg' |
| | | import demo2 from '@/assets/img/demo2.jpg' |
| | | import demo3 from '@/assets/img/demo3.jpg' |
| | | import demo4 from '@/assets/img/demo4.jpg' |
| | | import demo5 from '@/assets/img/demo5.jpg' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import './index.scss' |
| | | |
| | | const BarCode = asyncComponent(() => import('@/components/barcode')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | | |
| | | const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle }) => { |
| | | const originalIndex = findCard(id).index |
| | |
| | | <div className="ant-mk-picture" style={_imagestyle}></div> |
| | | ) |
| | | } else if (card.eleType === 'splitline') { |
| | | let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth |
| | | return ( |
| | | <div style={{paddingTop: '1px'}}> |
| | | <div className="ant-mk-splitline" style={{borderColor: card.color}}></div> |
| | | <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'barcode') { |
| | | return ( |
| | | <div style={{height: card.innerHeight || 25}}> |
| | | <BarCode card={card} value={card.value || 'mksoft'}/> |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'qrcode') { |
| | | return ( |
| | | <div style={{minHeight: card.qrWidth || 50}}> |
| | | <QrCode card={card} value={card.value || 'mksoft'}/> |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'currentDate') { |
| | | return ( |
| | | <div className="ant-mk-date"> |
| | | {`${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}`} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | border-left: 0; |
| | | border-right: 0; |
| | | } |
| | | .ant-mk-date { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | text-overflow: ellipsis; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | } |
| | | .ant-mk-picture { |
| | | background-size: cover; |
| | | background-position: center center; |
| | |
| | | icon: ['eleType', 'icon', 'datatype', 'width'], |
| | | link: ['eleType', 'datatype', 'label', 'width', 'height', 'joint'], |
| | | slider: ['eleType', 'datatype', 'width', 'color', 'maxValue'], |
| | | splitline: ['eleType', 'color', 'width'], |
| | | splitline: ['eleType', 'color', 'width', 'borderWidth'], |
| | | barcode: ['eleType', 'datatype', 'width', 'barHeight', 'displayValue', 'interval'], |
| | | qrcode: ['eleType', 'datatype', 'width', 'qrWidth', 'color', 'url'], |
| | | currentDate: ['eleType', 'width', 'dateFormat', 'prefix', 'postfix'], |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | getOptions = (eleType, datatype) => { |
| | | let _options = fromJS(cardTypeOptions[eleType]).toJS() // 选项列表 |
| | | |
| | | if (['text', 'number', 'picture', 'link', 'slider'].includes(eleType)) { |
| | | if (['text', 'number', 'picture', 'link', 'slider', 'barcode', 'qrcode'].includes(eleType)) { |
| | | if (datatype === 'dynamic') { |
| | | _options.push('field') |
| | | } else if (eleType !== 'picture') { |
| | |
| | | { value: 'link', text: '链接'}, |
| | | { value: 'slider', text: '进度条'}, |
| | | { value: 'splitline', text: '分割线'}, |
| | | { value: 'barcode', text: '条形码'}, |
| | | { value: 'qrcode', text: '二维码'}, |
| | | { value: 'currentDate', text: '当前时间'}, |
| | | ] |
| | | |
| | | if (type === 'table') { |
| | |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'file', |
| | | key: 'url', |
| | | label: '图片', |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: '显示信息', |
| | | initVal: card.label || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: '格式化', |
| | | initVal: card.format || '', |
| | | tooltip: '注:百分数、千分位对于数值类型有效,YYYY-MM-DD对于时间类型的文本有效。', |
| | | required: false, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'dateFormat', |
| | | label: '格式化', |
| | | initVal: card.dateFormat || 'YYYY-MM-DD', |
| | | required: true, |
| | | options: [ |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }, |
| | | { value: 'YYYY', text: 'YYYY' }, |
| | | { value: 'YYYY-MM', text: 'YYYY-MM' }, |
| | | { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, |
| | | { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: '格式化', |
| | | initVal: card.format || '', |
| | | tooltip: '注:百分数、千分位对于数值类型有效,YYYY-MM-DD对于时间类型的文本有效。', |
| | | required: false, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '颜色', |
| | | initVal: card.color, |
| | | initVal: card.color || 'rgba(0, 0, 0, 0.85)', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '宽度', |
| | | label: '元素宽度', |
| | | initVal: card.width || 12, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | required: true |
| | |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'barHeight', |
| | | min: 5, |
| | | max: 50, |
| | | label: '高度', |
| | | initVal: card.barHeight || 25, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'qrWidth', |
| | | min: 5, |
| | | max: 500, |
| | | label: '宽度', |
| | | initVal: card.qrWidth || 50, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'interval', |
| | | min: 0.1, |
| | | max: 10, |
| | | precision: 1, |
| | | label: '线条间隔', |
| | | initVal: card.interval || 1, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'displayValue', |
| | | label: '显示值', |
| | | initVal: card.displayValue || 'false', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'borderWidth', |
| | | min: 0, |
| | | max: 50, |
| | | label: '线宽', |
| | | initVal: card.borderWidth || 1, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'lenWidRadio', |
| | | label: '长宽比', |
| | |
| | | } |
| | | |
| | | _card.innerHeight = fontSize * lineHeight * line |
| | | } else if (_card.eleType === 'barcode') { |
| | | _card.style = style |
| | | |
| | | let fontSize = 14 |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | | } |
| | | |
| | | _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } else if (_card.eleType === 'button') { // 拆分style |
| | | let _style = fromJS(style).toJS() |
| | | _card.style = {} |
| | |
| | | if (res.eleType === 'link' && !res.style.color) { |
| | | res.style.color = 'rgba(24, 144, 255, 1)' |
| | | } |
| | | } else if (res.eleType === 'barcode') { |
| | | let fontSize = 14 |
| | | |
| | | if (res.style && res.style.fontSize) { |
| | | fontSize = parseInt(res.style.fontSize) |
| | | } |
| | | |
| | | res.innerHeight = res.barHeight + (res.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } |
| | | |
| | | return res |
| | |
| | | initialValue: setting.varMark || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '变量标识!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z_]*$/ig, |
| | | message: '请使用字母或_' |
| | | }, |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Col, Tooltip, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import asyncComponent from './asyncButtonComponent' |
| | | import asyncElementComponent from '@/utils/asyncComponent' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const ChangeUserButton = asyncComponent(() => import('@/tabviews/zshare/actionList/changeuserbutton')) |
| | | const PrintButton = asyncComponent(() => import('@/tabviews/zshare/actionList/printbutton')) |
| | | const BarCode = asyncElementComponent(() => import('@/components/barcode')) |
| | | const QrCode = asyncElementComponent(() => import('@/components/qrcode')) |
| | | |
| | | class CardCellComponent extends Component { |
| | | static propTpyes = { |
| | |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'splitline') { |
| | | let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className="ant-mk-splitline" style={{borderColor: card.color}}></div> |
| | | <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'barcode') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div style={{height: card.innerHeight || 25}}> |
| | | {val ? <BarCode card={card} value={val}/> : null} |
| | | </div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'qrcode') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div style={{minHeight: card.qrWidth || 50}}> |
| | | {val ? <QrCode card={card} value={val}/> : null} |
| | | </div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'currentDate') { |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div className="ant-mk-date" style={card.style}> |
| | | {card.dateFormat ? `${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}` : null} |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | border-left: 0; |
| | | border-right: 0; |
| | | } |
| | | .ant-mk-date { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .ant-slider { |
| | | margin: 0px; |
| | | } |
| | |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_config.setting.sync === 'true' && data) { |
| | | _data = data[_config.dataName] || [] |
| | | _data = data[_config.dataName] |
| | | if (_data && Array.isArray(_data)) { |
| | | _data = _data[0] |
| | | } |
| | | _sync = false |
| | | } |
| | | } else { |
| | |
| | | const { sync, config } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | | let _data = {} |
| | | if (nextProps.data && nextProps.data[config.dataName]) { |
| | | _data = nextProps.data[config.dataName] || [] |
| | | _data = nextProps.data[config.dataName] |
| | | if (_data && Array.isArray(_data)) { |
| | | _data = _data[0] |
| | | } |
| | | } |
| | | |
| | | this.setState({sync: false, loading: false, data: _data}) |
| | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | loading: false, |
| | | data: [] |
| | | data: {} |
| | | }) |
| | | return |
| | | } else { |
| | |
| | | if (result.status) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | data: result.data, |
| | | data: result.data && result.data[0] ? result.data[0] : {}, |
| | | loading: false |
| | | }) |
| | | } else { |
| | |
| | | {data ? <div className="card-row-list"> |
| | | {config.subcards.map((item, index) => ( |
| | | <Col className={activeKey === index ? 'active' : ''} key={index} span={item.setting.width || 6} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem BID={BID} card={item} cards={config} data={data[0] || {}} updateStatus={this.updateStatus}/> |
| | | <CardItem BID={BID} card={item} cards={config} data={data} updateStatus={this.updateStatus}/> |
| | | </Col> |
| | | ))} |
| | | </div> : null} |
| | |
| | | } |
| | | _sql = `/* 系统生成 */ |
| | | Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields} |
| | | |
| | | |
| | | select @UserName='',@FullName='' |
| | | select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@ |
| | | ` |
| | | |