| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mk", |
| | | "defaultApp": "mkindustry", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXminiAppID": "", |
| | |
| | | "probation": "", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} /> |
| | | <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/> |
| | | {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } |
| | | {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}> |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | if (_val.control) { |
| | | _val.control = '' |
| | | |
| | | delete _val.controlField |
| | | delete _val.controlVal |
| | | } |
| | |
| | | const cardTypeOptions = { |
| | | sequence: ['eleType', 'width'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable'], |
| | | number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'], |
| | | number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'], |
| | | video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop', 'startTime', 'noValue', 'posterType'], |
| | | icon: ['eleType', 'icon', 'datatype', 'width'], |
| | |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | let label = col.label |
| | | if (label !== col.field) { |
| | | if (label.toLowerCase() !== col.field.toLowerCase()) { |
| | | label = col.field + ' ' + col.label |
| | | } |
| | | if (/^(Int|Decimal)/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) { |
| | |
| | | if (datatype === 'dynamic') { |
| | | _options.push('field') |
| | | if (eleType === 'number') { |
| | | _options.push('decimal') |
| | | _options.push('decimal', 'format') |
| | | } |
| | | } else if (eleType === 'picture' || eleType === 'video') { |
| | | _options.push('url') |
| | |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | let label = col.label |
| | | if (label !== col.field) { |
| | | if (label.toLowerCase() !== col.field.toLowerCase()) { |
| | | label = col.field + ' ' + col.label |
| | | } |
| | | |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal === undefined ? '' : card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: '格式化', |
| | |
| | | { 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: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal === undefined ? '' : card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | max: 10, |
| | | label: '高度(行)', |
| | | initVal: card.height !== undefined ? card.height : 1, |
| | | tooltip: '内容显示行数,值为空时高度自适应,注:自适应高度仅在设置卡片高度后有效。', |
| | | tooltip: '内容显示行数,值为空时高度自适应。', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | res.eleType = cell.eleType || null |
| | | res.style = cell.style || null |
| | | res.modal = cell.modal || null |
| | | res.wrapStyle = cell.wrapStyle || null |
| | | // res = {...cell, ...res} |
| | | |
| | | // if (!res.control) { |
| | |
| | | } |
| | | .ant-tag-checkable-checked { |
| | | border-color: #1890ff; |
| | | background: #1890ff; |
| | | } |
| | | } |
| | | |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | if (_val.control) { |
| | | _val.control = '' |
| | | |
| | | delete _val.controlField |
| | | delete _val.controlVal |
| | | } |
| | |
| | | type: 'radio', |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | | initVal: card.procMode || 'system', |
| | | initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), |
| | | required: true, |
| | | options: [{ |
| | | value: 'system', |
| | |
| | | type: 'radio', |
| | | key: 'callbackType', |
| | | label: '回调方式', |
| | | initVal: card.callbackType || 'script', |
| | | initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), |
| | | tooltip: '使用后台脚本执行时,需要配合计划任务。', |
| | | required: true, |
| | | options: [{ |
| | |
| | | |
| | | class MarkColumn extends Component { |
| | | static propTpyes = { |
| | | field: PropTypes.any, |
| | | columns: PropTypes.array, // 显示列 |
| | | marks: PropTypes.object, |
| | | onSubmit: PropTypes.func |
| | |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <MarkForm dict={dict} signs={signs} columns={options} markChange={this.markChange}/> |
| | | <MarkForm field={this.props.field} dict={dict} signs={signs} columns={options} markChange={this.markChange}/> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:从上到下,匹配第一个符合条件的标记。</Col> |
| | | <EditTable actions={['edit', 'move', 'del']} data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/> |
| | | </Modal> |
| | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | field: PropTypes.any, |
| | | columns: PropTypes.array, // 列名集合 |
| | | signs: PropTypes.array, // 标记类型 |
| | | markChange: PropTypes.func // 修改函数 |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { columns, signs } = this.props |
| | | const { columns, signs, field } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | |
| | | let initVal = [] |
| | | if (field) { |
| | | initVal = [field, 'static'] |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="normal-table-mark-form"> |
| | | <Row gutter={24}> |
| | | <Col span={6}> |
| | | <Form.Item label={'对比字段'}> |
| | | {getFieldDecorator('field', { |
| | | initialValue: [], |
| | | initialValue: initVal, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '图片宽度', |
| | | initVal: card.span || 24, |
| | | tooltip: '栅格布局,等分为24份。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'lenWidRadio', |
| | | label: '长宽比', |
| | |
| | | { value: '2:3', text: '2:3' }, |
| | | { value: '9:16', text: '9:16' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'picSort', |
| | | label: '图片排列', |
| | | initVal: card.picSort || '1', |
| | | tooltip: '同一单元格内,含有多张图片时的列数。', |
| | | required: false, |
| | | options: [{ |
| | | value: '1', |
| | | text: '1' |
| | | }, { |
| | | value: '2', |
| | | text: '2' |
| | | }, { |
| | | value: '3', |
| | | text: '3' |
| | | }, { |
| | | value: '4', |
| | | text: '4' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'span'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], |
| | | action: ['label', 'type', 'Align', 'Width'], |
| | |
| | | <Modal |
| | | title="显示列编辑" |
| | | visible={visible} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | {column && column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column && column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | |
| | | precision: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | {column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | |
| | | decimal: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '图片宽度', |
| | | initVal: card.span || 24, |
| | | tooltip: '栅格布局,等分为24份。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'lenWidRadio', |
| | | label: '长宽比', |
| | |
| | | { value: '2:3', text: '2:3' }, |
| | | { value: '9:16', text: '9:16' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'picSort', |
| | | label: '图片排列', |
| | | initVal: card.picSort || '1', |
| | | tooltip: '同一单元格内,含有多张图片时的列数。', |
| | | required: false, |
| | | options: [{ |
| | | value: '1', |
| | | text: '1' |
| | | }, { |
| | | value: '2', |
| | | text: '2' |
| | | }, { |
| | | value: '3', |
| | | text: '3' |
| | | }, { |
| | | value: '4', |
| | | text: '4' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'span'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], |
| | | action: ['label', 'type', 'Align', 'Width'], |
| | |
| | | <Modal |
| | | title="显示列编辑" |
| | | visible={visible} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | {column && column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | {column && column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | | if (col.type === 'number') { |
| | | col.decimal = col.decimal || 0 |
| | | col.round = Math.pow(10, col.decimal) |
| | | |
| | | if (col.format === 'percent') { |
| | | col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 |
| | | } |
| | | } |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | |
| | | let menu = null |
| | | |
| | | if (card.setting.MenuID) { |
| | | let _menu = this.props.permMenus.filter(m => m.MenuID === card.setting.MenuID)[0] || '' |
| | | menu = { |
| | | MenuID: card.setting.MenuID, |
| | | MenuName: card.setting.MenuName, |
| | | MenuName: _menu ? _menu.MenuName : card.setting.MenuName, |
| | | MenuNo: card.setting.MenuNo, |
| | | type: card.setting.tabType |
| | | type: _menu ? _menu.type : card.setting.tabType |
| | | } |
| | | } else if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | |
| | | elements: PropTypes.array, // 元素集 |
| | | } |
| | | |
| | | state = { |
| | | card: null, // 编辑中元素 |
| | | elements: null, // 按钮组 |
| | | } |
| | | |
| | | /** |
| | | * @description 搜索条件初始化 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { elements } = this.props |
| | | |
| | | this.setState({ |
| | | elements: fromJS(elements).toJS() |
| | | }) |
| | | } |
| | | state = {} |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps)) |
| | |
| | | return color |
| | | } |
| | | |
| | | getContent = (card) => { |
| | | const { data, cards } = this.props |
| | | getContent = () => { |
| | | const { data, cards, elements } = this.props |
| | | |
| | | if (card.eleType === 'sequence') { |
| | | let _style = {} |
| | | if (card.marks) { |
| | | _style.width = card.innerHeight |
| | | _style.height = card.innerHeight |
| | | _style.lineHeight = card.innerHeight + 'px' |
| | | let contents = [] |
| | | |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | } |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'text') { |
| | | let val = '' |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value || '' |
| | | if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) { |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let bid = data.$$BID || '' |
| | | val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) |
| | | elements.forEach(card => { |
| | | if (card.eleType === 'sequence') { |
| | | let _style = {} |
| | | if (card.marks) { |
| | | _style.width = card.innerHeight |
| | | _style.height = card.innerHeight |
| | | _style.lineHeight = card.innerHeight + 'px' |
| | | |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | } |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (val !== '' && card.format) { |
| | | let _val = null |
| | | |
| | | if (card.format === 'calendar1') { |
| | | _val = moment(val).calendar(null, { |
| | | sameDay: '[今天] ahh:mm', |
| | | nextDay: '[明天] ahh:mm', |
| | | nextWeek: 'MM月DD日 ahh:mm', |
| | | lastDay: '[昨天] ahh:mm', |
| | | lastWeek: 'dddd ahh:mm', |
| | | sameElse: 'MM月DD日 ahh:mm' |
| | | }) |
| | | } else if (card.format === 'calendar2') { |
| | | let time = new Date(val).getTime() |
| | | if (!isNaN(time)) { |
| | | time = parseInt(time / 60000) // 时间值 |
| | | let now = parseInt(new Date().getTime() / 60000) // 当前时间值 |
| | | let start = new Date(new Date().toDateString()).getTime() / 60000 // 今天零点时间值 |
| | | let split = now - time |
| | | |
| | | if (split < 0) { // 时间值在当前时间之后 |
| | | _val = moment(val).format('MM月DD日 HH:mm') |
| | | } else if (split < 3) { |
| | | _val = '刚刚' |
| | | } else if (split < 5) { |
| | | _val = '3分钟前' |
| | | } else if (split < 10) { |
| | | _val = '5分钟前' |
| | | } else if (split < 20) { |
| | | _val = '10分钟前' |
| | | } else if (split < 30) { |
| | | _val = '20分钟前' |
| | | } else if (split < 60) { |
| | | _val = '30分钟前' |
| | | } else if (split < 420 || time > start) { // 7小时内或时间值在今天零点后 |
| | | _val = parseInt(split / 60) + '小时前' |
| | | } else { // 时间值在今天零点之前 |
| | | let _day = parseInt((start - time) / (24 * 60)) + 1 |
| | | if (_day === 1) { |
| | | _val = '昨天' |
| | | } else if (_day <= 30) { |
| | | _val = _day + '天前' |
| | | } else { |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'text') { |
| | | let val = '' |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value || '' |
| | | if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) { |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let bid = data.$$BID || '' |
| | | val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) |
| | | } |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (val !== '' && card.format) { |
| | | let _val = null |
| | | |
| | | if (card.format === 'calendar1') { |
| | | _val = moment(val).calendar(null, { |
| | | sameDay: '[今天] ahh:mm', |
| | | nextDay: '[明天] ahh:mm', |
| | | nextWeek: 'MM月DD日 ahh:mm', |
| | | lastDay: '[昨天] ahh:mm', |
| | | lastWeek: 'dddd ahh:mm', |
| | | sameElse: 'MM月DD日 ahh:mm' |
| | | }) |
| | | } else if (card.format === 'calendar2') { |
| | | let time = new Date(val).getTime() |
| | | if (!isNaN(time)) { |
| | | time = parseInt(time / 60000) // 时间值 |
| | | let now = parseInt(new Date().getTime() / 60000) // 当前时间值 |
| | | let start = new Date(new Date().toDateString()).getTime() / 60000 // 今天零点时间值 |
| | | let split = now - time |
| | | |
| | | if (split < 0) { // 时间值在当前时间之后 |
| | | _val = moment(val).format('MM月DD日 HH:mm') |
| | | } else if (split < 3) { |
| | | _val = '刚刚' |
| | | } else if (split < 5) { |
| | | _val = '3分钟前' |
| | | } else if (split < 10) { |
| | | _val = '5分钟前' |
| | | } else if (split < 20) { |
| | | _val = '10分钟前' |
| | | } else if (split < 30) { |
| | | _val = '20分钟前' |
| | | } else if (split < 60) { |
| | | _val = '30分钟前' |
| | | } else if (split < 420 || time > start) { // 7小时内或时间值在今天零点后 |
| | | _val = parseInt(split / 60) + '小时前' |
| | | } else { // 时间值在今天零点之前 |
| | | let _day = parseInt((start - time) / (24 * 60)) + 1 |
| | | if (_day === 1) { |
| | | _val = '昨天' |
| | | } else if (_day <= 30) { |
| | | _val = _day + '天前' |
| | | } else { |
| | | _val = moment(val).format('MM月DD日 HH:mm') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | _val = moment(val).format(card.format) |
| | | } |
| | | |
| | | // if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { |
| | | // val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` |
| | | // } |
| | | if (_val && _val !== 'Invalid date') { |
| | | val = _val |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | let orival = val |
| | | if (card.format === 'encryption') { |
| | | val = <Encrypts value={val} /> |
| | | } |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = <span>{card.prefix || ''}{val}{card.postfix || ''}</span> |
| | | } |
| | | if (card.copyable === 'true') { |
| | | val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph> |
| | | } |
| | | } |
| | | |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (card.link || (card.anchors && card.anchors.length > 0)) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | if (card.bgImage && data[card.bgImage]) { |
| | | _style.backgroundImage = `url('${data[card.bgImage]}')` |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'number') { |
| | | let val = '' |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (!val && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (typeof(val) === 'number') { |
| | | if (card.format === 'percent') { |
| | | val = val * 100 |
| | | } else if (card.format === 'abs') { |
| | | val = Math.abs(val) |
| | | } |
| | | |
| | | if (typeof(card.decimal) === 'number') { |
| | | let decimal = card.decimal |
| | | |
| | | if (card.format === 'percent') { |
| | | decimal = decimal - 2 |
| | | } |
| | | if (decimal < 0) { |
| | | decimal = 0 |
| | | _val = moment(val).format(card.format) |
| | | } |
| | | |
| | | val = val.toFixed(decimal) |
| | | } else { |
| | | val = '' + val |
| | | // if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { |
| | | // val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` |
| | | // } |
| | | if (_val && _val !== 'Invalid date') { |
| | | val = _val |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | let orival = val |
| | | if (card.format === 'encryption') { |
| | | val = <Encrypts value={val} /> |
| | | } |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = <span>{card.prefix || ''}{val}{card.postfix || ''}</span> |
| | | } |
| | | if (card.copyable === 'true') { |
| | | val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph> |
| | | } |
| | | } |
| | | |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (card.link || (card.anchors && card.anchors.length > 0)) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | if (card.bgImage && data[card.bgImage]) { |
| | | _style.backgroundImage = `url('${data[card.bgImage]}')` |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'number') { |
| | | let val = '' |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (!val && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (typeof(val) === 'number') { |
| | | if (card.round) { |
| | | val = Math.round(val * card.round) / card.round |
| | | } |
| | | if (card.format === 'percent') { |
| | | val = val * 100 |
| | | } else if (card.format === 'abs') { |
| | | val = Math.abs(val) |
| | | } |
| | | |
| | | if (card.round) { |
| | | val = val.toFixed(card.decimal) |
| | | } else { |
| | | val = '' + val |
| | | } |
| | | |
| | | if (card.format === 'percent' && (!card.postfix || card.postfix.indexOf('%') === -1)) { |
| | | val = val + '%' |
| | | } else if (card.format === 'thdSeparator') { |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | } |
| | | |
| | | if (card.format === 'percent' && (!card.postfix || card.postfix.indexOf('%') === -1)) { |
| | | val = val + '%' |
| | | } else if (card.format === 'thdSeparator') { |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.tooltip |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | {val ? <Tooltip title={val}> |
| | | <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'slider') { |
| | | let val = 0 |
| | | let color = card.color |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = parseFloat(data[card.field]) |
| | | if (isNaN(val)) { |
| | | val = 0 |
| | | } |
| | | } |
| | | |
| | | val = val / card.maxValue * 100 |
| | | val = parseInt(val * 100) / 100 |
| | | |
| | | if (card.marks) { |
| | | let _color = this.getColor(card.marks) |
| | | color = _color ? _color : color |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <MkProgress value={val} config={card} color={color}/> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'picture') { |
| | | let _imagestyle = {} |
| | | let _style = card.style ? {margin: '0 auto', ...card.style} : {} |
| | | let url = '' |
| | | if (card.maxWidth) { |
| | | _style.maxWidth = card.maxWidth |
| | | if (_style.marginLeft === '0px') { |
| | | delete _style.marginLeft |
| | | } |
| | | if (_style.marginRight === '0px') { |
| | | delete _style.marginRight |
| | | } |
| | | } |
| | | |
| | | if (card.datatype === 'static') { |
| | | url = card.url || '' |
| | | if (url === '@icon@') { |
| | | url = sessionStorage.getItem('avatar') || '' |
| | | } |
| | | } else { |
| | | url = data[card.field] || '' |
| | | } |
| | | |
| | | if (url === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (val !== '') { |
| | | if (_style.borderRadius) { |
| | | _imagestyle.borderRadius = _style.borderRadius |
| | | } |
| | | |
| | | if (PicRadio[card.lenWidRadio]) { |
| | | _imagestyle.paddingTop = PicRadio[card.lenWidRadio] |
| | | } else { |
| | | _imagestyle.paddingTop = '100%' |
| | | } |
| | | |
| | | if (card.link) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | let scale = url && card.scale === 'true' |
| | | let urls = url ? url.split(',').filter(Boolean) : [LostPng] |
| | | |
| | | if (!url) { |
| | | _imagestyle = {backgroundSize: 'contain'} |
| | | } |
| | | |
| | | urls.forEach((u, i) => { |
| | | contents.push(<Col key={card.uuid + i} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div |
| | | className={'ant-mk-picture' + (scale ? ' scale' : '')} |
| | | onClick={(e) => { |
| | | if (!scale) return |
| | | |
| | | e.stopPropagation() |
| | | |
| | | MKEmitter.emit('mkImageScale', url, urls) |
| | | }} |
| | | style={{..._imagestyle, backgroundImage: `url('${u}')`}} |
| | | ></div> |
| | | </div> |
| | | </Col>) |
| | | }) |
| | | } else if (card.eleType === 'splitline') { |
| | | let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width} style={{minHeight: _borderWidth}}> |
| | | <div style={card.style}> |
| | | <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] || '' |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | contents.push( |
| | | <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 === 'video') { |
| | | let url = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | url = card.url |
| | | } else { |
| | | url = data[card.field] || '' |
| | | } |
| | | |
| | | if (url === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | let poster = '' |
| | | |
| | | if (card.posterType === 'dynamic') { |
| | | poster = data[card.posterField] || '' |
| | | } else { |
| | | poster = card.posterUrl || '' |
| | | } |
| | | |
| | | let urls = url.split(',').filter(Boolean) |
| | | |
| | | urls.forEach((u, i) => { |
| | | contents.push( |
| | | <Col key={card.uuid + i} span={card.width}> |
| | | <div className="video-wrap" style={card.style}> |
| | | <Video card={card} poster={poster} value={u}/> |
| | | </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] || '' |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | contents.push( |
| | | <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') { |
| | | let val = moment().format(card.dateFormat || 'YYYY-MM-DD') |
| | | |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | } |
| | | |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div className="ant-mk-date" style={card.style}> |
| | | {val} |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'formula') { |
| | | let val = 0 |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.$sync) { |
| | | if (card.eval === 'false') { |
| | | val = '' |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.tooltip |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | {val ? <Tooltip title={val}> |
| | | <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'slider') { |
| | | let val = 0 |
| | | let color = card.color |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = parseFloat(data[card.field]) |
| | | if (isNaN(val)) { |
| | | val = 0 |
| | | } |
| | | } |
| | | |
| | | val = val / card.maxValue * 100 |
| | | val = parseInt(val * 100) / 100 |
| | | |
| | | if (card.marks) { |
| | | let _color = this.getColor(card.marks) |
| | | color = _color ? _color : color |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <MkProgress value={val} config={card} color={color}/> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'picture') { |
| | | let _imagestyle = {} |
| | | let _style = card.style ? {margin: '0 auto', ...card.style} : {} |
| | | let url = '' |
| | | if (card.maxWidth) { |
| | | _style.maxWidth = card.maxWidth |
| | | if (_style.marginLeft === '0px') { |
| | | delete _style.marginLeft |
| | | } |
| | | if (_style.marginRight === '0px') { |
| | | delete _style.marginRight |
| | | } |
| | | } |
| | | |
| | | if (card.datatype === 'static') { |
| | | url = card.url || '' |
| | | if (url === '@icon@') { |
| | | url = sessionStorage.getItem('avatar') || '' |
| | | } |
| | | } else { |
| | | url = data[card.field] || '' |
| | | } |
| | | |
| | | if (url === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (url) { |
| | | _imagestyle = {backgroundImage: `url('${url}')`} |
| | | } else { |
| | | _imagestyle = {backgroundImage: `url(${LostPng})`, backgroundSize: 'contain'} |
| | | } |
| | | |
| | | if (_style.borderRadius) { |
| | | _imagestyle.borderRadius = _style.borderRadius |
| | | } |
| | | |
| | | if (PicRadio[card.lenWidRadio]) { |
| | | _imagestyle.paddingTop = PicRadio[card.lenWidRadio] |
| | | } else { |
| | | _imagestyle.paddingTop = '100%' |
| | | } |
| | | |
| | | if (card.link) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | let scale = url && card.scale === 'true' |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | | <div |
| | | className={'ant-mk-picture' + (scale ? ' scale' : '')} |
| | | onClick={(e) => { |
| | | if (scale) { |
| | | e.stopPropagation() |
| | | } else { |
| | | return |
| | | } |
| | | |
| | | MKEmitter.emit('mkImageScale', url) |
| | | }} |
| | | style={_imagestyle} |
| | | ></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'splitline') { |
| | | let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth |
| | | return ( |
| | | <Col key={card.uuid} span={card.width} style={{minHeight: _borderWidth}}> |
| | | <div style={card.style}> |
| | | <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] || '' |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | 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 === 'video') { |
| | | let url = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | url = card.url |
| | | } else { |
| | | url = data[card.field] || '' |
| | | } |
| | | |
| | | if (url === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | let poster = '' |
| | | |
| | | if (card.posterType === 'dynamic') { |
| | | poster = data[card.posterField] || '' |
| | | } else { |
| | | poster = card.posterUrl || '' |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div className="video-wrap" style={card.style}> |
| | | <Video card={card} poster={poster} value={url}/> |
| | | </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] || '' |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | 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') { |
| | | let val = moment().format(card.dateFormat || 'YYYY-MM-DD') |
| | | |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div className="ant-mk-date" style={card.style}> |
| | | {val} |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'formula') { |
| | | let val = 0 |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.$sync) { |
| | | if (card.eval === 'false') { |
| | | val = '' |
| | | } |
| | | this.props.syncData.forEach(item => { |
| | | let _val = card.formula |
| | | Object.keys(item).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _val = _val.replace(reg, item[key]) |
| | | this.props.syncData.forEach(item => { |
| | | let _val = card.formula |
| | | Object.keys(item).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _val = _val.replace(reg, item[key]) |
| | | }) |
| | | if (card.eval !== 'false') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | _val = 0 |
| | | } |
| | | } |
| | | |
| | | // if (!val) return |
| | | |
| | | val += _val |
| | | }) |
| | | } else if (data) { |
| | | let _val = card.formula |
| | | Object.keys(data).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _val = _val.replace(reg, data[key]) |
| | | }) |
| | | |
| | | if (card.eval !== 'false') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | _val = 0 |
| | | _val = '' |
| | | } |
| | | } |
| | | |
| | | // if (!val) return |
| | | |
| | | val += _val |
| | | }) |
| | | } else if (data) { |
| | | let _val = card.formula |
| | | Object.keys(data).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _val = _val.replace(reg, data[key]) |
| | | }) |
| | | |
| | | if (card.eval !== 'false') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | _val = '' |
| | | } |
| | | |
| | | val = _val === undefined ? '' : _val |
| | | } |
| | | |
| | | val = _val === undefined ? '' : _val |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (val !== '') { |
| | | if (val && typeof(val) === 'string') { |
| | | val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') |
| | | val = <span dangerouslySetInnerHTML={{__html: val}}></span> |
| | | } |
| | | |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | } |
| | | |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'button') { |
| | | let _disabled = data.$disabled |
| | | if (card.control === 'hidden') { |
| | | let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' |
| | | if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | } else if (card.control === 'disabled') { |
| | | let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' |
| | | if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { |
| | | _disabled = true |
| | | |
| | | if (val !== '') { |
| | | if (val && typeof(val) === 'string') { |
| | | val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') |
| | | val = <span dangerouslySetInnerHTML={{__html: val}}></span> |
| | | } |
| | | |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | } |
| | | } |
| | | |
| | | let _data = [data] |
| | | |
| | | if (data.$$type === 'extendCard') { |
| | | _data = data.$$selectedData || [] |
| | | } else if (card.$sync) { |
| | | _data = this.props.syncData |
| | | } else if (data.$$empty) { |
| | | _data = [] |
| | | } |
| | | |
| | | if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <NormalButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | columns={cards.columns} |
| | | selectedData={_data} |
| | | /> |
| | | |
| | | if (card.marks) { |
| | | let mark = getMark(card.marks, data, _style) |
| | | |
| | | _style = mark.style |
| | | |
| | | if (mark.icon) { |
| | | if (mark.position === 'front') { |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={_style}> |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'excelIn') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ExcelInButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'excelOut') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ExcelOutButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'popview') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <PopupButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'tab') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <TabButton |
| | | btn={card} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'innerpage') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <NewPageButton |
| | | btn={card} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'funcbutton') { |
| | | if (card.funcType === 'changeuser' || card.funcType === 'closetab') { |
| | | return ( |
| | | } else if (card.eleType === 'button') { |
| | | let _disabled = data.$disabled |
| | | if (card.control === 'hidden') { |
| | | let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' |
| | | if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { |
| | | return null |
| | | } |
| | | } else if (card.control === 'disabled') { |
| | | let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' |
| | | if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { |
| | | _disabled = true |
| | | } |
| | | } |
| | | |
| | | let _data = [data] |
| | | |
| | | if (data.$$type === 'extendCard') { |
| | | _data = data.$$selectedData || [] |
| | | } else if (card.$sync) { |
| | | _data = this.props.syncData |
| | | } else if (data.$$empty) { |
| | | _data = [] |
| | | } |
| | | |
| | | if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ChangeUserButton |
| | | <NormalButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | columns={cards.columns} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'excelIn') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ExcelInButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'print') { |
| | | return ( |
| | | } else if (card.OpenType === 'excelOut') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <PrintButton |
| | | <ExcelOutButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'megvii') { |
| | | return ( |
| | | } else if (card.OpenType === 'popview') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <FuncMegvii |
| | | <PopupButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'filezip') { |
| | | return ( |
| | | } else if (card.OpenType === 'tab') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <FuncZip |
| | | <TabButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'innerpage') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <NewPageButton |
| | | btn={card} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.OpenType === 'funcbutton') { |
| | | if (card.funcType === 'changeuser' || card.funcType === 'closetab') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ChangeUserButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'print') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <PrintButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'megvii') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <FuncMegvii |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } else if (card.funcType === 'filezip') { |
| | | contents.push( |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <FuncZip |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | return null |
| | | return contents |
| | | } |
| | | |
| | | render() { |
| | | const { elements } = this.state |
| | | |
| | | return ( |
| | | <div className="card-cell-list"> |
| | | {elements.map(item => this.getContent(item))} |
| | | {this.getContent()} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | let menu = null |
| | | |
| | | if (card.setting.MenuID) { |
| | | let _menu = this.props.permMenus.filter(m => m.MenuID === card.setting.MenuID)[0] || '' |
| | | menu = { |
| | | MenuID: card.setting.MenuID, |
| | | MenuName: card.setting.MenuName, |
| | | MenuName: _menu ? _menu.MenuName : card.setting.MenuName, |
| | | MenuNo: card.setting.MenuNo, |
| | | type: card.setting.tabType |
| | | type: _menu ? _menu.type : card.setting.tabType |
| | | } |
| | | } else if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | photos = photos.split(',').filter(Boolean) |
| | | } |
| | | |
| | | let cols = 24 / (col.picSort || 1) |
| | | let paddingTop = '100%' |
| | | let scale = col.scale === 'true' |
| | | |
| | |
| | | |
| | | resProps.children = ( |
| | | <div> |
| | | {photos && photos.map((url, i) => ( |
| | | <Col key={i} span={cols}> |
| | | {photos.map((url, i) => ( |
| | | <Col key={i} span={col.span || 24}> |
| | | <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { |
| | | if (!scale) return |
| | | MKEmitter.emit('mkImageScale', url, photos) |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | } else if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | col.Hide = 'true' |
| | | } |
| | | if (col.type === 'number' && col.sum === 'true' && !statFields.includes(col.field)) { |
| | | statFields.push(col) |
| | | if (col.type === 'number') { |
| | | if (col.sum === 'true' && !statFields.includes(col.field)) { |
| | | statFields.push(col) |
| | | } |
| | | if (typeof(col.decimal) === 'number') { |
| | | col.round = Math.pow(10, col.decimal) |
| | | if (col.format === 'percent') { |
| | | col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols = getCols(col.subcols || []) |
| | | if (col.subcols.length === 0) { |
| | |
| | | } |
| | | } else if (col.type === 'custom') { |
| | | col.elements = col.elements.map(cell => { |
| | | if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | |
| | | |
| | | if (item.type === 'card') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | | let _hasheight = card.style.height && card.style.height !== 'auto' |
| | | |
| | | if (card.style.boxShadow) { |
| | | delete card.style.hShadow |
| | | delete card.style.vShadow |
| | |
| | | card.style = card.style || {} |
| | | card.style = {...card.style, ...card.btnstyle} |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | |
| | | card.style = card.style || {} |
| | | card.style = {...card.style, ...card.btnstyle} |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | |
| | | }) |
| | | } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel' || item.type === 'timeline') { |
| | | item.subcards && item.subcards.forEach(card => { |
| | | let _hasheight = card.style.height && card.style.height !== 'auto' |
| | | card.elements = card.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.hidden === 'true') return false |
| | |
| | | card.style = card.style || {} |
| | | card.style = {...card.style, ...card.btnstyle} |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | if (!cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*') |
| | | component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@datam@/ig, 'Y') |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@\$/ig, '*/') |
| | | _customScript = _customScript.replace(/\$@/ig, '/*') |
| | | _customScript = _customScript.replace(/\$@/ig, '/*').replace(/@datam@/ig, 'Y') |
| | | _customScript = _customScript.replace(/@\$/ig, '*/') |
| | | } else { |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '') |
| | | } |
| | | |
| | | regs.forEach(cell => { |
| | |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | | if (col.type === 'number') { |
| | | col.decimal = col.decimal || 0 |
| | | col.round = Math.pow(10, col.decimal) |
| | | |
| | | if (col.format === 'percent') { |
| | | col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 |
| | | } |
| | | } |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | if (col.type === 'number') { |
| | | col.decimal = col.decimal || 0 |
| | | col.round = Math.pow(10, col.decimal) |
| | | |
| | | if (col.format === 'percent') { |
| | | col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 |
| | | } |
| | | } |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { |
| | | statFields.push(col) |
| | |
| | | exportExcel = (data) => { |
| | | const { btn } = this.props |
| | | |
| | | let columns = btn.verify.columns.filter(col => col.output !== 'false') |
| | | let imgCol = false |
| | | let columns = btn.verify.columns.filter(col => { |
| | | if (col.output === 'false') return false |
| | | |
| | | if (col.type === 'image') { |
| | | imgCol = true |
| | | } |
| | | |
| | | if (col.type === 'number' && (col.decimal || col.decimal === 0) ) { |
| | | col.round = Math.pow(10, col.decimal) |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | |
| | | try { |
| | | let imgCol = columns.filter(col => col.type === 'image')[0] |
| | | |
| | | if (imgCol) { |
| | | const column = columns.map(item => { |
| | | let col = { |
| | |
| | | item.$Index = index + 1 + '' |
| | | |
| | | columns.forEach((col, i) => { |
| | | if (item[col.Column] && col.abs === 'true') { |
| | | _row[col.Column] = Math.abs(item[col.Column]) |
| | | } else { |
| | | _row[col.Column] = item[col.Column] |
| | | let val = item[col.Column] |
| | | if (typeof(val) === 'number') { |
| | | if (col.abs === 'true') { |
| | | val = Math.abs(val) |
| | | } |
| | | if (col.round) { |
| | | val = Math.round(val * col.round) / col.round |
| | | val = val.toFixed(col.decimal) |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | | }) |
| | | |
| | | table.push(_row) |
| | |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ErrMesg: '导出成功!'}) |
| | | } |
| | | |
| | | } else { |
| | | let _header = [] |
| | | let _topRow = {} |
| | | let colwidth = [] |
| | | let abses = [] |
| | | |
| | | columns.forEach(col => { |
| | | if (_topRow[col.Column]) return |
| | | |
| | | _header.push(col.Column) |
| | | _topRow[col.Column] = col.Text |
| | | |
| | | if (col.abs === 'true') { |
| | | abses.push(col.Column) |
| | | } |
| | | |
| | | colwidth.push({width: col.Width || 20}) |
| | | }) |
| | | |
| | |
| | | |
| | | item.$Index = index + 1 + '' |
| | | |
| | | _header.forEach(field => { |
| | | if (item[field] && abses.includes(field)) { |
| | | _row[field] = Math.abs(item[field]) |
| | | } else { |
| | | _row[field] = item[field] |
| | | columns.forEach((col, i) => { |
| | | let val = item[col.Column] |
| | | |
| | | if (typeof(val) === 'number') { |
| | | if (col.abs === 'true') { |
| | | val = Math.abs(val) |
| | | } |
| | | if (col.round) { |
| | | val = Math.round(val * col.round) / col.round |
| | | val = val.toFixed(col.decimal) |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | | }) |
| | | |
| | | table.push(_row) |
| | |
| | | let menu = null |
| | | |
| | | if (btn.MenuID) { |
| | | let _menu = this.props.permMenus.filter(m => m.MenuID === btn.MenuID)[0] || '' |
| | | menu = { |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | | MenuName: _menu ? _menu.MenuName : btn.MenuName, |
| | | MenuNo: btn.MenuNo, |
| | | type: btn.tabType |
| | | type: _menu ? _menu.type : btn.tabType |
| | | } |
| | | } else if (btn.linkmenu && btn.linkmenu.length > 0) { |
| | | let menu_id = btn.linkmenu.slice(-1)[0] |
| | |
| | | } else if (item.type === 'textarea') { |
| | | content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>) |
| | | } else if (item.type === 'rate') { |
| | | content = (<Rate count={item.rateCount} disabled={item.readonly} onChange={(val) => this.recordChange({[item.field]: val})} character={item.character ? <MkIcon type={item.character}/> : <StarFilled />} allowHalf={item.allowHalf}/>) |
| | | content = (<Rate count={item.rateCount} disabled={item.readonly} style={{color: item.color || '#fadb14'}} onChange={(val) => this.recordChange({[item.field]: val})} character={item.character ? <MkIcon type={item.character}/> : <StarFilled />} allowHalf={item.allowHalf}/>) |
| | | } else if (item.type === 'brafteditor') { |
| | | content = (<MKEditor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) |
| | | label = item.hidelabel !== 'true' ? label : '' |
| | |
| | | |
| | | handleChange = (e) => { |
| | | let val = e.target.value |
| | | let submit = /\n/ig.test(val) |
| | | let submit = /\n/g.test(val) |
| | | |
| | | val = val.replace(/\n/ig, '') |
| | | val = val.replace(/\n/g, '') |
| | | |
| | | if (submit && /^\s+$/.test(val)) { |
| | | submit = false |
| | | } |
| | | |
| | | let _val = val |
| | | |
| | |
| | | import PropTypes from 'prop-types' |
| | | import md5 from 'md5' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Affix, Typography } from 'antd' |
| | | import { Table, Affix, Typography, Col } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const Video = asyncComponent(() => import('@/components/video')) |
| | | |
| | | const PicRadio = { |
| | | '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', |
| | | '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', |
| | | '10:1': '10%', '3:4': '133.33%', '2:3': '150%', '9:16': '177.78%' |
| | | } |
| | | |
| | | class BodyRow extends React.Component { |
| | | shouldComponentUpdate (nextProps) { |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = item.decimal || 0 |
| | | content = Math.round(content * item.round) / item.round |
| | | |
| | | if (item.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | |
| | | content = content.toFixed(item.decimal) |
| | | |
| | | if (item.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | } |
| | | } else if (item.type === 'picture') { |
| | | let photos = '' |
| | | let style = {borderRadius: '2px'} |
| | | if (item.field && record.hasOwnProperty(item.field)) { |
| | | photos = record[item.field] + '' |
| | | } |
| | |
| | | photos = photos.split(',').filter(Boolean) |
| | | } |
| | | |
| | | let maxHeight = item.maxHeight || 128 |
| | | if (PicRadio[item.lenWidRadio]) { |
| | | style.paddingTop = PicRadio[item.lenWidRadio] |
| | | } else { |
| | | style.paddingTop = '100%' |
| | | } |
| | | |
| | | let scale = item.scale === 'true' |
| | | |
| | | return ( |
| | | <div className="picture-col"> |
| | | {photos && photos.map((url, i) => { |
| | | if (item.scale === 'true') { |
| | | return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={(e) => { |
| | | {photos.map((url, i) => (<Col key={i} span={item.span || 24}> |
| | | <div |
| | | className={'mk-picture' + (scale ? ' image-scale' : '')} |
| | | onClick={(e) => { |
| | | if (!scale) return |
| | | |
| | | e.stopPropagation() |
| | | |
| | | MKEmitter.emit('mkImageScale', url, photos) |
| | | }} key={`${i}`} src={url} alt=""/> |
| | | } else { |
| | | return <img style={{maxHeight: maxHeight}} key={`${i}`} src={url} alt=""/> |
| | | } |
| | | })} |
| | | }} |
| | | style={{...style, backgroundImage: `url('${url}')`}} |
| | | ></div> |
| | | </Col>))} |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'video') { |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | content = Math.round(content * col.round) / col.round |
| | | |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | content = content.toFixed(col.decimal) |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | } |
| | | |
| | | photos.forEach(photo => { |
| | | images.push({url: photo, align: col.Align, scale: col.scale === 'true', maxHeight: col.maxHeight || 128}) |
| | | images.push({url: photo, align: col.Align, scale: col.scale === 'true'}) |
| | | }) |
| | | } else if (col.type === 'text') { |
| | | let content = record[col.field] |
| | |
| | | <div className="content-fence-top" style={images[0] ? {textAlign: images[0].align} : null}> |
| | | {images.map((_img, index) => { |
| | | if (_img.scale) { |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={(e) => { |
| | | return <img className="image-scale" onClick={(e) => { |
| | | e.stopPropagation() |
| | | MKEmitter.emit('mkImageScale', _img.url, images.map(g => g.url)) |
| | | }} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | return (<img key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | | })} |
| | | </div> |
| | |
| | | <div className="content-fence-left" style={images[0] ? {textAlign: images[0].align} : null}> |
| | | {images.map((_img, index) => { |
| | | if (_img.scale) { |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => { |
| | | return <img className="image-scale" onClick={() => { |
| | | MKEmitter.emit('mkImageScale', _img.url, images.map(g => g.url)) |
| | | }} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | return (<img key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | | })} |
| | | </div> |
| | |
| | | |
| | | img { |
| | | max-width: 100%; |
| | | max-height: 128px; |
| | | display: block; |
| | | } |
| | | img + img { |
| | |
| | | |
| | | img { |
| | | max-width: 100%; |
| | | max-height: 128px; |
| | | display: block; |
| | | float: right; |
| | | } |
| | |
| | | } |
| | | } |
| | | .picture-col { |
| | | img { |
| | | max-width: 100%; |
| | | display: inline-block; |
| | | margin-left: -5px; |
| | | margin-right: -5px; |
| | | >.ant-col { |
| | | padding: 5px; |
| | | } |
| | | img + img { |
| | | margin-top: 10px; |
| | | .mk-picture { |
| | | background-color: #d9d9d9; |
| | | background-position: center center; |
| | | background-size: cover; |
| | | } |
| | | .image-scale { |
| | | cursor: zoom-in; |
| | |
| | | background-color: #ffffff; |
| | | } |
| | | .ant-tag-checkable-checked { |
| | | border-color: #1890ff; |
| | | border-color: var(--mk-sys-color); |
| | | background: var(--mk-sys-color); |
| | | } |
| | | .table-search-date-group-value { |
| | | position: absolute; |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '多行文本', |
| | | subType: 'textarea', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.multiselect'], |
| | | subType: 'multiselect', |
| | | }, |
| | |
| | | type: 'form', |
| | | label: CommonDict['model.form.datemonth'], |
| | | subType: 'datemonth', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.textarea'], |
| | | subType: 'textarea', |
| | | }, |
| | | { |
| | | type: 'form', |
| | |
| | | let _val = fromJS(copycard).toJS() |
| | | |
| | | try { |
| | | if (_val.control) { |
| | | delete _val.controlField |
| | | delete _val.controlVal |
| | | } |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | |
| | | })(<InputNumber min={5} max={200} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={5}> |
| | | <Col span={6}> |
| | | <Form.Item label="类型"> |
| | | {getFieldDecorator('type', { |
| | | initialValue: 'text' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="text">文本</Radio> |
| | | <Radio value="number">数值</Radio> |
| | | <Radio value="image">图片</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="mk-green"> |
| | | 添加 |
| | | </Button> |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | width: '20%' |
| | | width: '17%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.name'], |
| | | dataIndex: 'Text', |
| | | inputType: 'input', |
| | | editable: true, |
| | | width: '20%' |
| | | unique: true, |
| | | width: '17%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.form.columnWidth'], |
| | |
| | | min: 5, |
| | | max: 200, |
| | | editable: true, |
| | | width: '14%', |
| | | width: '12%', |
| | | render: (text) => text || 20 |
| | | }, |
| | | { |
| | | title: '类型', |
| | | dataIndex: 'type', |
| | | inputType: 'radio', |
| | | inputType: 'select', |
| | | editable: true, |
| | | required: false, |
| | | width: '18%', |
| | | width: '14%', |
| | | render: (text) => { |
| | | if (text === 'image') { |
| | | return '图片' |
| | | } else if (text === 'number') { |
| | | return '数值' |
| | | } else { |
| | | return '文本' |
| | | } |
| | | }, |
| | | options: [ |
| | | {value: 'text', text: '文本'}, |
| | | {value: 'number', text: '数值'}, |
| | | {value: 'image', text: '图片'} |
| | | ] |
| | | }, |
| | |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'} |
| | | ] |
| | | }, |
| | | { |
| | | title: '小数位', |
| | | dataIndex: 'decimal', |
| | | inputType: 'number', |
| | | min: 0, |
| | | max: 18, |
| | | editable: true, |
| | | required: false, |
| | | width: '12%' |
| | | }, |
| | | { |
| | | title: '导出', |
| | |
| | | if (fields.includes(item.field) || !item.field) return |
| | | fields.push(item.field) |
| | | |
| | | columns.push({ |
| | | let cell = { |
| | | Column: item.field, |
| | | Text: item.label, |
| | | Width: 20, |
| | |
| | | output: 'true', |
| | | type: 'text', |
| | | uuid: Utils.getuuid() |
| | | }) |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.type = 'number' |
| | | cell.decimal = item.decimal |
| | | } |
| | | |
| | | columns.push(cell) |
| | | }) |
| | | |
| | | this.setState({ |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text')) { |
| | | if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text' && columns[0].type !== 'number')) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | <Button className="excel-col-add mk-red" title="清空Excel列" onClick={this.clearField}> |
| | | 清空Excel列 |
| | | </Button> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index。</div> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index;数值类型导出时可进行数据处理(取绝对值、保留小数位)。</div> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" wrappedComponentRef={(inst) => this.columnRef = inst} data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'fieldlength', 'blacklist', 'scale', 'lenWidRadio', 'span'], |
| | | video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'fieldlength', 'blacklist', 'aspectRatio'], |
| | | index: ['label', 'type', 'Align', 'Width'] |
| | | } |
| | |
| | | <Modal |
| | | title="显示列-编辑" |
| | | visible={modaltype === 'columns'} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | <Modal |
| | | title={dict['model.form.colspan'] + '-' + dict['model.edit']} |
| | | visible={modaltype === 'colspan'} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | <Modal |
| | | title="操作列-编辑" |
| | | visible={modaltype === 'gridbtn'} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | |
| | | } |
| | | .ant-tag-checkable-checked { |
| | | border-color: #1890ff; |
| | | background: #1890ff; |
| | | } |
| | | } |
| | | |
| | |
| | | type: 'radio', |
| | | key: 'callbackType', |
| | | label: '回调方式', |
| | | initVal: card.callbackType || (card.callbackFunc ? 'func' : 'script'), |
| | | initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), |
| | | tooltip: '使用后台脚本执行时,需要配合计划任务。', |
| | | required: true, |
| | | options: [{ |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxHeight', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 1000, |
| | | decimal: 0, |
| | | label: '最大高度', |
| | | tooltip: '图片在表格中显示的最大高度', |
| | | tooltipClass: 'middle', |
| | | initVal: card.maxHeight || 128, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '图片宽度', |
| | | initVal: card.span || 24, |
| | | tooltip: '栅格布局,等分为24份。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'lenWidRadio', |
| | | label: '长宽比', |
| | | initVal: card.lenWidRadio || '1:1', |
| | | required: true, |
| | | options: [ |
| | | { value: '1:1', text: '1:1' }, |
| | | { value: '4:3', text: '4:3' }, |
| | | { value: '3:2', text: '3:2' }, |
| | | { value: '16:9', text: '16:9' }, |
| | | { value: '2:1', text: '2:1' }, |
| | | { value: '3:1', text: '3:1' }, |
| | | { value: '4:1', text: '4:1' }, |
| | | { value: '5:1', text: '5:1' }, |
| | | { value: '6:1', text: '6:1' }, |
| | | { value: '7:1', text: '7:1' }, |
| | | { value: '8:1', text: '8:1' }, |
| | | { value: '9:1', text: '9:1' }, |
| | | { value: '10:1', text: '10:1' }, |
| | | { value: '3:4', text: '3:4' }, |
| | | { value: '2:3', text: '2:3' }, |
| | | { value: '9:16', text: '9:16' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | }, { |
| | |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '支持' |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: "隐藏", |
| | | initVal: card.hidden || 'false', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '支持' |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '颜色', |
| | | initVal: card.color || '#fadb14', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | min: 1, |
| | | max: 100, |
| | |
| | | textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], |
| | | cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator'], |
| | | color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], |
| | | rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'rateCount', 'character', 'place'], |
| | | rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'color', 'rateCount', 'character', 'place'], |
| | | hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline'], |
| | | formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], |