| | |
| | | |
| | | state = { |
| | | selectIcon: '', |
| | | allowClear: false, |
| | | icons: [...minkeIconSystem.normal, ...minkeIconSystem.trademark, ...minkeIconSystem.data, ...minkeIconSystem.edit, ...minkeIconSystem.hint, ...minkeIconSystem.direction], |
| | | visible: false |
| | | } |
| | |
| | | if (this.props['data-__meta']) { |
| | | val = this.props['data-__meta'].initialValue || '' |
| | | } |
| | | this.setState({selectIcon: val}) |
| | | |
| | | this.setState({selectIcon: val, allowClear: this.props.allowClear === true}) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { selectIcon, visible, icons } = this.state |
| | | const { selectIcon, visible, icons, allowClear } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-icon-box"> |
| | | {selectIcon ? <Icon type={selectIcon}/> : null} |
| | | <Icon onClick={() => this.setState({visible: true})} type="appstore"/> |
| | | {selectIcon ? <Icon type={selectIcon}/> : <Icon style={{opacity: 0}} type="plus"/>} |
| | | <Icon className="trigger" onClick={() => this.setState({visible: true})} type="swap"/> |
| | | {allowClear ? <Icon className="close" onClick={() => this.checkIcon('')} type="close"/> : null} |
| | | <Modal |
| | | wrapClassName="popview-modal mk-icon-wrap" |
| | | title={'图标选择'} |
| | |
| | | line-height: 32px; |
| | | padding: 0px 0px 0px 10px; |
| | | |
| | | .anticon:last-child { |
| | | .anticon.trigger { |
| | | float: right; |
| | | line-height: 32px; |
| | | padding: 0 10px; |
| | | border-left: 1px solid #d9d9d9; |
| | | } |
| | | .close.anticon { |
| | | float: right; |
| | | margin-top: 6px; |
| | | margin-right: 5px; |
| | | background: #efefef; |
| | | border-radius: 50%; |
| | | color: #757575; |
| | | padding: 2px; |
| | | font-size: 13px; |
| | | opacity: 0; |
| | | transition: opacity 0.3s; |
| | | } |
| | | } |
| | | .mk-icon-box:hover { |
| | | border-color: #1890ff; |
| | | .close.anticon { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | .mk-icon-box::after { |
| | | content: ' '; |
| | | display: block; |
| | | clear: both; |
| | | } |
| | | .mk-icon-wrap { |
| | | .ant-col { |
| | |
| | | <Icon className="copy" title="复制" type="copy" onClick={() => copyCard(id)} /> |
| | | <Icon className="close" title="删除" type="close" onClick={() => delCard(id)} /> |
| | | <Icon className="style" title="调整样式" onClick={() => changeStyle(id)} type="font-colors" /> |
| | | {['text', 'number', 'slider'].includes(card.eleType) ? <MarkColumn columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } |
| | | {['text', 'number', 'slider', 'sequence'].includes(card.eleType) ? <MarkColumn 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}> |
| | |
| | | if (line) { |
| | | _card.innerHeight = fontSize * lineHeight * line |
| | | } |
| | | } else if (_card.eleType === 'sequence') { |
| | | _card.style = style |
| | | |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (_card.style.fontSize) { |
| | | fontSize = parseInt(_card.style.fontSize) |
| | | } |
| | | |
| | | _card.innerHeight = fontSize * lineHeight |
| | | } else if (_card.eleType === 'barcode') { |
| | | _card.style = style |
| | | |
| | |
| | | resetMark = () => { |
| | | const { marks, columns, type } = this.props |
| | | let markColumns = fromJS(this.state.markColumns).toJS() |
| | | let _columns = fromJS(columns).toJS() |
| | | |
| | | let options = columns.map(col => { |
| | | _columns.unshift({field: '$Index', label: '序号'}) |
| | | |
| | | let options = _columns.map(col => { |
| | | return { |
| | | value: col.field, |
| | | label: col.label, |
| | |
| | | { |
| | | value: 'dynamic', |
| | | label: '动态值', |
| | | children: columns.map(cell => { |
| | | children: _columns.map(cell => { |
| | | return { |
| | | value: cell.field, |
| | | label: cell.label |
| | |
| | | } |
| | | ] |
| | | |
| | | if (type === 'line') { |
| | | if (type === 'line' || type === 'sequence') { |
| | | signs.pop() |
| | | } else if (type === 'slider') { |
| | | markColumns = markColumns.filter(col => { |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, Icon, Select } from 'antd' |
| | | |
| | | import { minkeIconSystem } from '@/utils/option.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const MkIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | |
| | | {getFieldDecorator('icon', { |
| | | initialValue: menu.icon || '' |
| | | })( |
| | | <Select showSearch allowClear> |
| | | {minkeIconSystem.normal.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {minkeIconSystem.trademark.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {minkeIconSystem.data.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {minkeIconSystem.edit.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {minkeIconSystem.hint.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | {minkeIconSystem.direction.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} |
| | | </Select> |
| | | <MkIcon allowClear /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index |
| | | item.$Index = start + index + '' |
| | | |
| | | return item |
| | | }), |
| | |
| | | const { data, cards } = this.props |
| | | |
| | | if (card.eleType === 'sequence') { |
| | | let _style = {} |
| | | if (card.marks) { |
| | | _style.width = card.innerHeight |
| | | _style.height = card.innerHeight |
| | | _style.lineHeight = card.innerHeight + 'px' |
| | | this.getMark(card.marks, _style) |
| | | } |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className={'ant-mk-text'}>{data.$Index || ''}</div> |
| | | <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | .sequence-wrap { |
| | | display: inline-block; |
| | | width: 22px; |
| | | height: 22px; |
| | | line-height: 22px; |
| | | white-space: nowrap; |
| | | border-radius: 50%; |
| | | overflow: visible; |
| | | } |
| | | } |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | | word-break: break-word; |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | } |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | this.loadData(btn) // 数据刷新 |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) // 同级标签刷新 |
| | |
| | | } else if (position === 'popclose') { // 标签关闭刷新 |
| | | config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty')) |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | reloadData = (btn) => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadmaindata(true, 'true') |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } else { |
| | | this.loadmaindata(true, 'false') |
| | | this.getStatFieldsValue() |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + start |
| | | item.$Index = index + start + '' |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | } |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | |
| | |
| | | |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (id !== this.state.BID) { |
| | | this.setState({ BID: id }, () => { |
| | | this.setState({ BID: id, pageIndex: 1 }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + start |
| | | item.$Index = index + start + '' |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | } |
| | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index |
| | | item.$Index = start + index + '' |
| | | return item |
| | | }), |
| | | selectedData: [], |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | | |
| | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index |
| | | item.$Index = start + index + '' |
| | | |
| | | return item |
| | | }), |
| | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index |
| | | item.$Index = start + index + '' |
| | | |
| | | return item |
| | | }), |
| | |
| | | data && data.forEach((item, index) => { |
| | | let _row = {} |
| | | |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | |
| | | btn.verify.columns.forEach((col, i) => { |
| | | if (item[col.Column] && col.abs === 'true') { |
| | |
| | | data && data.forEach((item, index) => { |
| | | let _row = {} |
| | | |
| | | item.$Index = index + 1 |
| | | item.$Index = index + 1 + '' |
| | | |
| | | _header.forEach(field => { |
| | | if (item[field] && abses.includes(field)) { |