| | |
| | | "integrity": "sha512-LrX0OGZtW+W6iLnTAqnTaoIsRelYeuLZWsrmBJFUXDALQphPsN8cE5DCsmoSlL0QYb94BQxINiuS70Ar/8BNgA==" |
| | | }, |
| | | "@ant-design/icons": { |
| | | "version": "2.1.1", |
| | | "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-2.1.1.tgz", |
| | | "integrity": "sha512-jCH+k2Vjlno4YWl6g535nHR09PwCEmTBKAG6VqF+rhkrSPRLfgpU2maagwbZPLjaHuU5Jd1DFQ2KJpQuI6uG8w==" |
| | | "version": "4.6.2", |
| | | "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-4.6.2.tgz", |
| | | "integrity": "sha512-QsBG2BxBYU/rxr2eb8b2cZ4rPKAPBpzAR+0v6rrZLp/lnyvflLH3tw1vregK+M7aJauGWjIGNdFmUfpAOtw25A==", |
| | | "requires": { |
| | | "@ant-design/colors": "^6.0.0", |
| | | "@ant-design/icons-svg": "^4.0.0", |
| | | "@babel/runtime": "^7.11.2", |
| | | "classnames": "^2.2.6", |
| | | "rc-util": "^5.9.4" |
| | | }, |
| | | "dependencies": { |
| | | "@ant-design/colors": { |
| | | "version": "6.0.0", |
| | | "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-6.0.0.tgz", |
| | | "integrity": "sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==", |
| | | "requires": { |
| | | "@ctrl/tinycolor": "^3.4.0" |
| | | } |
| | | }, |
| | | "@babel/runtime": { |
| | | "version": "7.14.8", |
| | | "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz", |
| | | "integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==", |
| | | "requires": { |
| | | "regenerator-runtime": "^0.13.4" |
| | | } |
| | | }, |
| | | "rc-util": { |
| | | "version": "5.13.2", |
| | | "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.13.2.tgz", |
| | | "integrity": "sha512-eYc71XXGlp96RMzg01Mhq/T3BL6OOVTDSS0urFEuvpi+e7slhJRhaHGCKy2hqJm18m9ff7VoRoptplKu60dYog==", |
| | | "requires": { |
| | | "@babel/runtime": "^7.12.5", |
| | | "react-is": "^16.12.0", |
| | | "shallowequal": "^1.1.0" |
| | | } |
| | | }, |
| | | "react-is": { |
| | | "version": "16.13.1", |
| | | "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", |
| | | "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" |
| | | }, |
| | | "regenerator-runtime": { |
| | | "version": "0.13.9", |
| | | "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", |
| | | "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" |
| | | } |
| | | } |
| | | }, |
| | | "@ant-design/icons-react": { |
| | | "version": "2.0.1", |
| | |
| | | "@ant-design/colors": "^3.1.0", |
| | | "babel-runtime": "^6.26.0" |
| | | } |
| | | }, |
| | | "@ant-design/icons-svg": { |
| | | "version": "4.1.0", |
| | | "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.1.0.tgz", |
| | | "integrity": "sha512-Fi03PfuUqRs76aI3UWYpP864lkrfPo0hluwGqh7NJdLhvH4iRDc3jbJqZIvRDLHKbXrvAfPPV3+zjUccfFvWOQ==" |
| | | }, |
| | | "@antv/adjust": { |
| | | "version": "0.2.3", |
| | |
| | | "version": "9.0.1", |
| | | "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-9.0.1.tgz", |
| | | "integrity": "sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA==" |
| | | }, |
| | | "@ctrl/tinycolor": { |
| | | "version": "3.4.0", |
| | | "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz", |
| | | "integrity": "sha512-JZButFdZ1+/xAfpguQHoabIXkcqRRKpMrWKBkpEZZyxfY9C1DpADFB8PEqGSTeFr135SaTRfKqGKx5xSCLI7ZQ==" |
| | | }, |
| | | "@fast-csv/format": { |
| | | "version": "4.3.5", |
| | |
| | | "warning": "~4.0.3" |
| | | }, |
| | | "dependencies": { |
| | | "@ant-design/icons": { |
| | | "version": "2.1.1", |
| | | "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-2.1.1.tgz", |
| | | "integrity": "sha512-jCH+k2Vjlno4YWl6g535nHR09PwCEmTBKAG6VqF+rhkrSPRLfgpU2maagwbZPLjaHuU5Jd1DFQ2KJpQuI6uG8w==" |
| | | }, |
| | | "rc-animate": { |
| | | "version": "2.11.1", |
| | | "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.11.1.tgz", |
| | |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "dependencies": { |
| | | "@ant-design/icons": "^4.6.2", |
| | | "@antv/data-set": "^0.11.4", |
| | | "@antv/g2": "^4.1.14", |
| | | "@antv/util": "^2.0.13", |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { |
| | | RotateLeftOutlined, |
| | | RotateRightOutlined, |
| | | CloseOutlined, |
| | | ZoomOutOutlined, |
| | | ZoomInOutlined, |
| | | LeftOutlined, |
| | | RightOutlined |
| | | } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class ImgScale extends Component { |
| | | state = { |
| | | className: 'close', |
| | | url: '', |
| | | list: [], |
| | | scale: 1, |
| | | rotate: 0, |
| | | index: 0 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('mkImageScale', this.mkImageScale) |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('mkImageScale', this.mkImageScale) |
| | | } |
| | | |
| | | mkImageScale = (src, list = []) => { |
| | | const { url } = this.state |
| | | |
| | | if (url || !src) return |
| | | |
| | | let index = 0 |
| | | |
| | | if (list.length > 0) { |
| | | index = list.indexOf(src) |
| | | } |
| | | |
| | | this.setState({url: src, className: 'opening', list, scale: 1, rotate: 0, index}) |
| | | setTimeout(() => { |
| | | this.setState({className: 'open'}) |
| | | }, 300) |
| | | } |
| | | |
| | | close = () => { |
| | | this.setState({className: 'closeing'}) |
| | | setTimeout(() => { |
| | | this.setState({className: 'close', url: ''}) |
| | | }, 300) |
| | | } |
| | | |
| | | zoomIn = () => { |
| | | this.setState({scale: this.state.scale + 1}) |
| | | } |
| | | |
| | | zoomOut = () => { |
| | | const { scale } = this.state |
| | | |
| | | if (scale === 1) return |
| | | |
| | | this.setState({scale: scale - 1}) |
| | | } |
| | | |
| | | rotateRight = () => { |
| | | this.setState({rotate: this.state.rotate + 90}) |
| | | } |
| | | |
| | | rotateLeft = () => { |
| | | this.setState({rotate: this.state.rotate - 90}) |
| | | } |
| | | |
| | | prev = () => { |
| | | const { list, index } = this.state |
| | | |
| | | this.setState({url: list[index - 1], index: index - 1}) |
| | | } |
| | | |
| | | next = () => { |
| | | const { list, index } = this.state |
| | | |
| | | this.setState({url: list[index + 1], index: index + 1}) |
| | | } |
| | | |
| | | render() { |
| | | const { index, url, scale, rotate, className, list } = this.state |
| | | |
| | | return ( |
| | | <div className={'mk-preview ' + className}> |
| | | <div className="mk-image-preview-mask"></div> |
| | | <div className="mk-image-preview-wrap"> |
| | | <div className="mk-image-preview"> |
| | | <div className="mk-image-preview-content"> |
| | | <div className="mk-image-preview-body"> |
| | | <ul className="mk-image-preview-operations"> |
| | | <li className="mk-image-preview-operations-operation" onClick={this.close}> |
| | | <CloseOutlined /> |
| | | </li> |
| | | <li className="mk-image-preview-operations-operation" onClick={this.zoomIn}> |
| | | <ZoomInOutlined /> |
| | | </li> |
| | | <li className={'mk-image-preview-operations-operation ' + (scale === 1 ? 'mk-image-preview-operations-operation-disabled' : '')} onClick={this.zoomOut}> |
| | | <ZoomOutOutlined /> |
| | | </li> |
| | | <li className="mk-image-preview-operations-operation" onClick={this.rotateRight}> |
| | | <RotateRightOutlined /> |
| | | </li> |
| | | <li className="mk-image-preview-operations-operation" onClick={this.rotateLeft}> |
| | | <RotateLeftOutlined /> |
| | | </li> |
| | | </ul> |
| | | <div className="mk-image-preview-img-wrapper" style={{transform: 'translate3d(0px, 0px, 0px)'}}> |
| | | {url ? <img className="mk-image-preview-img" alt="" src={url} style={{transform: `scale3d(${scale}, ${scale}, 1) rotate(${rotate}deg)`}}/> : null} |
| | | </div> |
| | | {index ? <LeftOutlined className="mk-image-preview-switch-left" onClick={this.prev}/> : null} |
| | | {list.length > index + 1 ? <RightOutlined className="mk-image-preview-switch-right" onClick={this.next}/> : null} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ImgScale |
New file |
| | |
| | | |
| | | .mk-image-preview { |
| | | pointer-events: none; |
| | | height: 100%; |
| | | text-align: center; |
| | | } |
| | | .mk-image-preview.zoom-enter, |
| | | .mk-image-preview.zoom-appear { |
| | | -webkit-transform: none; |
| | | transform: none; |
| | | opacity: 0; |
| | | -webkit-animation-duration: 0.3s; |
| | | animation-duration: 0.3s; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | .mk-image-preview-mask { |
| | | position: fixed; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | z-index: 1100; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | .mk-image-preview-mask-hidden { |
| | | display: none; |
| | | } |
| | | .mk-image-preview-wrap { |
| | | position: fixed; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | overflow: auto; |
| | | outline: 0; |
| | | -webkit-overflow-scrolling: touch; |
| | | } |
| | | .mk-image-preview-body { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | overflow: hidden; |
| | | } |
| | | .mk-image-preview-img { |
| | | max-width: 100%; |
| | | max-height: 100%; |
| | | vertical-align: middle; |
| | | -webkit-transform: scale3d(1, 1, 1); |
| | | transform: scale3d(1, 1, 1); |
| | | // cursor: -webkit-grab; |
| | | // cursor: grab; |
| | | -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | pointer-events: auto; |
| | | } |
| | | .mk-image-preview-img-wrapper { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; |
| | | } |
| | | .mk-image-preview-img-wrapper::before { |
| | | display: inline-block; |
| | | width: 1px; |
| | | height: 50%; |
| | | margin-right: -1px; |
| | | content: ''; |
| | | } |
| | | .mk-image-preview-moving .mk-image-preview-img { |
| | | cursor: -webkit-grabbing; |
| | | cursor: grabbing; |
| | | } |
| | | .mk-image-preview-moving .mk-image-preview-img-wrapper { |
| | | -webkit-transition-duration: 0s; |
| | | transition-duration: 0s; |
| | | } |
| | | .mk-image-preview-wrap { |
| | | z-index: 1180; |
| | | } |
| | | .mk-image-preview-operations { |
| | | -webkit-box-sizing: border-box; |
| | | box-sizing: border-box; |
| | | margin: 0; |
| | | padding: 0; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | font-size: 14px; |
| | | font-variant: tabular-nums; |
| | | line-height: 1.5715; |
| | | -webkit-font-feature-settings: 'tnum'; |
| | | font-feature-settings: 'tnum'; |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | z-index: 1; |
| | | display: -webkit-box; |
| | | display: -ms-flexbox; |
| | | display: flex; |
| | | -webkit-box-orient: horizontal; |
| | | -webkit-box-direction: reverse; |
| | | -ms-flex-direction: row-reverse; |
| | | flex-direction: row-reverse; |
| | | -webkit-box-align: center; |
| | | -ms-flex-align: center; |
| | | align-items: center; |
| | | width: 100%; |
| | | color: rgba(255, 255, 255, 0.85); |
| | | list-style: none; |
| | | background: rgba(0, 0, 0, 0.5); |
| | | pointer-events: auto; |
| | | } |
| | | .mk-image-preview-operations-operation { |
| | | margin-left: 12px; |
| | | padding: 10px 12px; |
| | | cursor: pointer; |
| | | font-size: 18px; |
| | | } |
| | | .mk-image-preview-operations-operation-disabled { |
| | | color: rgba(255, 255, 255, 0.25); |
| | | pointer-events: none; |
| | | } |
| | | .mk-image-preview-operations-operation:last-of-type { |
| | | margin-left: 0; |
| | | } |
| | | .mk-image-preview-switch-left, |
| | | .mk-image-preview-switch-right { |
| | | font-size: 20px; |
| | | position: absolute; |
| | | top: 50%; |
| | | right: 10px; |
| | | z-index: 1; |
| | | display: -webkit-box; |
| | | display: -ms-flexbox; |
| | | display: flex; |
| | | -webkit-box-align: center; |
| | | -ms-flex-align: center; |
| | | align-items: center; |
| | | -webkit-box-pack: center; |
| | | -ms-flex-pack: center; |
| | | justify-content: center; |
| | | width: 44px; |
| | | height: 44px; |
| | | margin-top: -22px; |
| | | color: rgba(255, 255, 255, 0.85); |
| | | background: rgba(0, 0, 0, 0.1); |
| | | border-radius: 50%; |
| | | cursor: pointer; |
| | | pointer-events: auto; |
| | | } |
| | | |
| | | .mk-image-preview-switch-left { |
| | | left: 10px; |
| | | } |
| | | .mk-image-preview-switch-right { |
| | | right: 10px; |
| | | } |
| | | |
| | | .mk-drawer.mk-drawer-open .mk-drawer-mask { |
| | | height: 100%; |
| | | opacity: 1; |
| | | transition: none; |
| | | -webkit-animation: antdDrawerFadeIn 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | animation: antdDrawerFadeIn 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | pointer-events: auto; |
| | | } |
| | | .mk-preview { |
| | | z-index: 1100; |
| | | opacity: 0; |
| | | } |
| | | .mk-preview.close { |
| | | display: none; |
| | | } |
| | | .mk-preview.open { |
| | | opacity: 1; |
| | | } |
| | | |
| | | .mk-preview.opening { |
| | | transition: none; |
| | | -webkit-animation: antdDrawerFadeIn 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | animation: antdDrawerFadeIn 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | pointer-events: auto; |
| | | } |
| | | .mk-preview.closeing { |
| | | opacity: 1; |
| | | transition: none; |
| | | -webkit-animation: antdDrawerFadeOut 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | animation: antdDrawerFadeOut 0.3s cubic-bezier(0.7, 0.3, 0.1, 1); |
| | | pointer-events: auto; |
| | | } |
| | | |
| | | @-webkit-keyframes antdDrawerFadeIn { |
| | | 0% { |
| | | opacity: 0; |
| | | } |
| | | 100% { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | @keyframes antdDrawerFadeIn { |
| | | 0% { |
| | | opacity: 0; |
| | | } |
| | | 100% { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | @-webkit-keyframes antdDrawerFadeOut { |
| | | 0% { |
| | | opacity: 1; |
| | | } |
| | | 100% { |
| | | opacity: 0; |
| | | } |
| | | } |
| | | @keyframes antdDrawerFadeOut { |
| | | 0% { |
| | | opacity: 1; |
| | | } |
| | | 100% { |
| | | opacity: 0; |
| | | } |
| | | } |
| | |
| | | visible={visible} |
| | | width={width} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | okText={dict['model.confirm']} |
| | | onOk={this.submit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <ModalForm |
| | | dict={dict} |
| | | formlist={formlist} |
| | | inputSubmit={this.submit} |
| | | wrappedComponentRef={(inst) => this.Ref = inst} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Popover } from 'antd' |
| | | import { Icon, Popover, Checkbox } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | {card.wrap.checkAll === 'show' ? <div className="check-all"><Checkbox>全选</Checkbox></div> : null} |
| | | <CardCellComponent cards={card} cardCell={card} elements={card.elements} updateElement={this.updateCard}/> |
| | | </div> |
| | | ) |
| | |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 30px; |
| | | display: flex; |
| | | |
| | | .check-all { |
| | | width: 70px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | .model-menu-card-cell-list { |
| | | flex: 1; |
| | | } |
| | | .card-control { |
| | | position: absolute; |
| | | top: 0px; |
| | |
| | | field: 'supModule', |
| | | label: '上级组件', |
| | | initval: wrap.supModule || '', |
| | | // tooltip: '当上级组件不存在或没有权限时,当前组件不显示。', |
| | | required: true, |
| | | options: supmodules |
| | | }, |
| | |
| | | field: 'syncModule', |
| | | label: '同步组件', |
| | | initval: wrap.syncModule || '', |
| | | tooltip: '当同步组件不存在或没有权限时,当前组件不显示。', |
| | | required: true, |
| | | options: modules |
| | | }, |
| | |
| | | {`${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}`} |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'formula') { |
| | | return ( |
| | | <div className="ant-mk-date"> |
| | | {`${card.prefix || ''}${card.formula}${card.postfix || ''}`} |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | <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', 'sequence'].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 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}> |
| | |
| | | sequence: ['eleType', 'width'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link'], |
| | | number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'scale'], |
| | | video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop'], |
| | | icon: ['eleType', 'icon', 'datatype', 'width'], |
| | | slider: ['eleType', 'datatype', 'width', 'color', 'maxValue'], |
| | |
| | | barcode: ['eleType', 'datatype', 'width', 'barHeight', 'displayValue', 'interval'], |
| | | qrcode: ['eleType', 'datatype', 'width', 'qrWidth', 'color', 'url'], |
| | | currentDate: ['eleType', 'width', 'dateFormat', 'prefix', 'postfix'], |
| | | formula: ['eleType', 'width', 'height', 'prefix', 'postfix', 'formula'], |
| | | } |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} disabled={item.readonly} />)} |
| | | })(<TextArea rows={2} disabled={item.readonly} placeholder={item.placeholder || ''} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | { value: 'barcode', text: '条形码'}, |
| | | { value: 'qrcode', text: '二维码'}, |
| | | { value: 'currentDate', text: '当前时间'}, |
| | | { value: 'formula', text: '公式'}, |
| | | ] |
| | | |
| | | if (type === 'table' || (type === 'card' && subtype === 'datacard')) { |
| | |
| | | required: false, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'scale', |
| | | label: '图片放大', |
| | | initVal: card.scale || 'false', |
| | | required: false, |
| | | options: [ |
| | | { value: 'false', text: '不可以' }, |
| | | { value: 'true', text: '可以' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'aspectRatio', |
| | | label: '长宽比', |
| | |
| | | forbid: !isApp, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | // { value: 'page', text: '菜单' }, |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | |
| | | required: true, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'formula', |
| | | label: '公式', |
| | | initVal: card.formula || '', |
| | | tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果。', |
| | | placeholder: '例如:@price@ * @number@', |
| | | required: true |
| | | }, |
| | | ] |
| | | |
| | | return forms |
| | |
| | | resetCardStyle = (card, style) => { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (_card.eleType === 'text' || _card.eleType === 'number') { |
| | | if (['text', 'number', 'formula'].includes(_card.eleType)) { |
| | | _card.style = style |
| | | |
| | | let fontSize = 14 |
| | |
| | | elements: _elements, |
| | | visible: false, |
| | | actvisible: false |
| | | }, () => { |
| | | this.props.updateElement(_elements) |
| | | }) |
| | | } |
| | | |
| | |
| | | if (res.eleType === 'splitline' && cell.eleType !== 'splitline') { |
| | | res.style.paddingTop = '5px' |
| | | res.style.paddingBottom = '5px' |
| | | } else if (res.eleType === 'text' || res.eleType === 'number') { |
| | | } else if (['text', 'number', 'formula'].includes(res.eleType)) { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | let line = res.height || null |
| | |
| | | updateSetting = (res) => { |
| | | const { card, side } = this.state |
| | | |
| | | if (res.appmenu) { |
| | | res.menu = res.appmenu |
| | | } |
| | | delete res.appmenu |
| | | |
| | | this.setState({ |
| | | card: {...card, setting: res} |
| | | }) |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'appmenu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | type: appType ? 'select' : 'cascader', |
| | | field: 'menu', |
| | | label: '菜单', |
| | | initval: setting.menu || [], |
| | | required: true, |
| | | options: menulist, |
| | | forbid: !!appType |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'appmenu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || '', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | required: true, |
| | | options: appmenulist, |
| | | forbid: !appType |
| | | options: appType ? appmenulist : menulist, |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | updateSetting = (res) => { |
| | | const { card } = this.state |
| | | |
| | | if (res.appmenu) { |
| | | res.menu = res.appmenu |
| | | } |
| | | delete res.appmenu |
| | | |
| | | let _card = {...card, setting: res} |
| | | |
| | | this.setState({ card: _card }) |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'appmenu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | type: appType ? 'select' : 'cascader', |
| | | field: 'menu', |
| | | label: '菜单', |
| | | initval: setting.menu || [], |
| | | required: true, |
| | | options: menulist, |
| | | forbid: !!appType |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'appmenu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || '', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | required: true, |
| | | options: appmenulist, |
| | | forbid: !appType |
| | | options: appType ? appmenulist : menulist, |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | const AntvDashboard = asyncComponent(() => import('@/menu/components/chart/antv-dashboard')) |
| | | const CarouselDataCard = asyncComponent(() => import('@/menu/components/carousel/data-card')) |
| | | const CarouselPropCard = asyncComponent(() => import('@/menu/components/carousel/prop-card')) |
| | | const Balcony = asyncComponent(() => import('@/menu/components/card/balcony')) |
| | | const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | |
| | | return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'balcony') { |
| | | return (<Balcony card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let name = '' |
| | | let names = { |
| | | bbar: '柱状图', |
| | | bar: '柱状图', |
| | | line: '折线图', |
| | | tabs: '标签组', |
| | | pie: '饼图', |
| | |
| | | dashboard: '仪表盘', |
| | | scatter: '散点图', |
| | | tree: '树形列表', |
| | | balcony: '浮动卡', |
| | | card: '卡片' |
| | | } |
| | | let i = 1 |
| | |
| | | const AntvDashboard = asyncComponent(() => import('@/menu/components/chart/antv-dashboard')) |
| | | const AntvScatter = asyncComponent(() => import('@/menu/components/chart/antv-scatter')) |
| | | const AntvTabs = asyncComponent(() => import('@/menu/components/tabs/antv-tabs')) |
| | | const Balcony = asyncComponent(() => import('@/menu/components/card/balcony')) |
| | | const DataCard = asyncComponent(() => import('@/menu/components/card/data-card')) |
| | | const PropCard = asyncComponent(() => import('@/menu/components/card/prop-card')) |
| | | const NormalTree = asyncComponent(() => import('@/menu/components/tree/antd-tree')) |
| | |
| | | return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'balcony') { |
| | | return (<Balcony card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let name = '' |
| | | let names = { |
| | | bbar: '柱状图', |
| | | bar: '柱状图', |
| | | line: '折线图', |
| | | tabs: '标签组', |
| | | pie: '饼图', |
| | |
| | | dashboard: '仪表盘', |
| | | scatter: '散点图', |
| | | tree: '树形列表', |
| | | balcony: '浮动卡', |
| | | card: '卡片' |
| | | } |
| | | let i = 1 |
| | |
| | | const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group')) |
| | | const BraftEditor = asyncComponent(() => import('@/menu/components/editor/braft-editor')) |
| | | const NormalMenuBar = asyncComponent(() => import('@/mob/components/menubar/normal-menubar')) |
| | | const Balcony = asyncComponent(() => import('@/menu/components/card/balcony')) |
| | | const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | |
| | | return (<NormalMenuBar card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'balcony') { |
| | | return (<Balcony card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let name = '' |
| | | let names = { |
| | | bbar: '柱状图', |
| | | bar: '柱状图', |
| | | line: '折线图', |
| | | tabs: '标签组', |
| | | pie: '饼图', |
| | |
| | | editor: '富文本', |
| | | code: '自定义', |
| | | carousel: '轮播', |
| | | form: '表单', |
| | | dashboard: '仪表盘', |
| | | scatter: '散点图', |
| | | form: '表单', |
| | | card: '卡片', |
| | | navbar: '导航栏', |
| | | menubar: '菜单栏', |
| | | tree: '树形列表', |
| | | card: '卡片' |
| | | balcony: '浮动卡', |
| | | login: '登录' |
| | | } |
| | | let i = 1 |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, notification } from 'antd' |
| | | import { Spin, notification, Checkbox } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | // import Utils from '@/utils/utils.js' |
| | |
| | | class BalconyComponent extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, |
| | | menu: PropTypes.object, |
| | | data: PropTypes.array, |
| | | config: PropTypes.object, |
| | | menuType: PropTypes.any, |
| | |
| | | loading: false, |
| | | sync: false, |
| | | data: {}, |
| | | show: true |
| | | syncData: [], |
| | | show: true, |
| | | checked: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, menu } = this.props |
| | | const { data, BID } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | |
| | | let show = true |
| | | let syncConfig = null |
| | | if (_config.wrap.linkType === 'sync') { |
| | | _config.wrap.syncModule = _config.wrap.syncModule.pop() |
| | | |
| | | let filterComponent = (components) => { |
| | | components.forEach(item => { |
| | | if (syncConfig) return |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | filterComponent(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | filterComponent(item.components) |
| | | } else if (_config.wrap.syncModule === item.uuid) { |
| | | syncConfig = { |
| | | uuid: item.uuid, |
| | | wrap: item.wrap, |
| | | setting: item.setting, |
| | | columns: item.columns |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | syncConfig = _config.syncConfig |
| | | |
| | | filterComponent(menu.components) |
| | | _config.elements = _config.elements.map(item => { |
| | | if (item.eleType === 'button') { |
| | | item.$syncModule = _config.wrap.syncModule |
| | | if (item.eleType === 'button' || item.eleType === 'formula') { |
| | | item.$sync = true |
| | | } |
| | | return item |
| | | }) |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('syncBalconyData', this.syncBalconyData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('syncBalconyData', this.syncBalconyData) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | |
| | | supModule && MKEmitter.emit('reloadData', supModule, (BID || 'empty')) |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | syncBalconyData = (menuId, data, checked) => { |
| | | const { syncConfig } = this.state |
| | | |
| | | if (!syncConfig || syncConfig.uuid !== menuId) return |
| | | |
| | | this.setState({syncData: data, checked}) |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | |
| | | } |
| | | } |
| | | |
| | | checkAll = (e) => { |
| | | const { syncConfig } = this.state |
| | | |
| | | MKEmitter.emit('mkCheckAll', syncConfig.uuid, e.target.checked) |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, show, syncConfig } = this.state |
| | | const { config, loading, data, show, syncConfig, syncData, checked } = this.state |
| | | |
| | | return ( |
| | | <div className={'custom-balcony-box' + (!show ? ' hidden' : '')} style={config.style}> |
| | |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | <CardCellComponent data={data} cards={syncConfig || config} cardCell={config} elements={config.elements}/> |
| | | {config.wrap.checkAll === 'show' ? <div className="check-all"><Checkbox checked={checked} onChange={this.checkAll}>全选</Checkbox></div> : null} |
| | | <CardCellComponent data={data} syncData={syncData || []} cards={syncConfig || config} cardCell={config} elements={config.elements}/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | position: relative; |
| | | display: flex; |
| | | |
| | | >.check-all { |
| | | width: 70px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | >.card-cell-list { |
| | | flex: 1; |
| | | } |
| | | |
| | | .card-row-list::after { |
| | | content: ' '; |
| | |
| | | import asyncComponent from './asyncButtonComponent' |
| | | import asyncElementComponent from '@/utils/asyncComponent' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import LostPng from '@/assets/img/lost.png' |
| | | import './index.scss' |
| | | |
| | |
| | | cards: PropTypes.object, // 菜单配置信息 |
| | | cardCell: PropTypes.object, |
| | | data: PropTypes.object, |
| | | syncData: PropTypes.array, |
| | | elements: PropTypes.array, // 元素集 |
| | | } |
| | | |
| | |
| | | _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" style={_imagestyle}></div> |
| | | <div |
| | | className={'ant-mk-picture' + (scale ? ' scale' : '')} |
| | | onClick={(e) => { |
| | | if (scale) { |
| | | e.stopPropagation() |
| | | } else { |
| | | return |
| | | } |
| | | |
| | | MKEmitter.emit('mkImageScale', url) |
| | | }} |
| | | style={_imagestyle} |
| | | ></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'formula') { |
| | | let val = 0 |
| | | let _style = card.style ? {...card.style} : {} |
| | | |
| | | if (card.$sync) { |
| | | 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]) |
| | | }) |
| | | try { |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch { |
| | | _val = 0 |
| | | } |
| | | |
| | | 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]) |
| | | }) |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch { |
| | | _val = 0 |
| | | } |
| | | |
| | | val = _val |
| | | } |
| | | |
| | | if (val !== '') { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | |
| | | if (card.marks) { |
| | | val = this.getMark(card.marks, _style, 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 === 'button') { |
| | | let _data = data.$$type === 'extendCard' ? [] : [data] |
| | | let _data = [data] |
| | | |
| | | if (data.$$type === 'extendCard') { |
| | | _data = [] |
| | | } else if (card.$sync) { |
| | | _data = this.props.syncData |
| | | } |
| | | |
| | | if (['exec', 'prompt', 'pop'].includes(card.OpenType)) { |
| | | return ( |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | .ant-mk-picture.scale { |
| | | cursor: zoom-in; |
| | | } |
| | | } |
| | | .card-cell-list::after { |
| | | content: ' '; |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, Empty, notification, Row, Col, Pagination } from 'antd' |
| | | import { Spin, Empty, notification, message, Row, Col, Pagination } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('getSyncData', this.getSyncData) |
| | | MKEmitter.addListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('getSyncData', this.getSyncData) |
| | | MKEmitter.removeListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | | |
| | | getSyncData = (syncModule, btnId) => { |
| | | const { config, selectedData } = this.state |
| | | |
| | | if (config.uuid !== syncModule) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', btnId, (selectedData || [])) |
| | | } |
| | | |
| | | /** |
| | |
| | | } else if (position === 'popclose') { // 标签关闭刷新 |
| | | config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty')) |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | mkCheckAll = (menuId, checked) => { |
| | | const { config, data } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | if (checked) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: data.map((item, index) => index), |
| | | selectedData: data |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | MKEmitter.emit('syncBalconyData', config.uuid, data, data.length > 0) |
| | | if (data.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: [], |
| | | selectedData: [] |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | } |
| | | |
| | |
| | | loading: false |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | loading: false |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | } |
| | | |
| | | changeCard = (index, item) => { |
| | | const { config, selectKeys, selectedData, activeKey } = this.state |
| | | const { config, selectKeys, selectedData, activeKey, data } = this.state |
| | | |
| | | this.openView(item) |
| | | |
| | |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, (_item ? _item.$$uuid : ''), _item) |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, _selectedData, data.length === _selectedData.length) |
| | | } |
| | | } |
| | | |
| | | openView = (item) => { |
| | |
| | | const NormalTree = asyncComponent(() => import('@/tabviews/custom/components/tree/antd-tree')) |
| | | const CarouselDataCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/data-card')) |
| | | const CarouselPropCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/prop-card')) |
| | | const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | |
| | | <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony config={item} data={data} BID={_bid} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | import md5 from 'md5' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Typography, Icon, Col, Switch } from 'antd' |
| | | import { Table, Typography, Icon, Col, Switch, message } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.addListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.removeListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | | mkCheckAll = (menuId, checked) => { |
| | | const { MenuID, data } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | if (checked) { |
| | | this.setState({ |
| | | activeIndex: '', |
| | | selectedRowKeys: data.map((item, index) => index) |
| | | }) |
| | | |
| | | this.props.chgSelectData(data) |
| | | |
| | | MKEmitter.emit('resetSelectLine', MenuID, '', '') |
| | | MKEmitter.emit('syncBalconyData', MenuID, data, data.length > 0) |
| | | if (data.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | activeIndex: '', |
| | | selectedRowKeys: [], |
| | | }) |
| | | |
| | | this.props.chgSelectData([]) |
| | | |
| | | MKEmitter.emit('resetSelectLine', MenuID, '', '') |
| | | MKEmitter.emit('syncBalconyData', MenuID, [], false) |
| | | } |
| | | } |
| | | |
| | | // 字段透视 |
| | |
| | | * |
| | | */ |
| | | onSelectChange = selectedRowKeys => { |
| | | const { setting } = this.props |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | let index = '' |
| | | let _activeIndex = null |
| | |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, selects, data.length === selects.length) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 点击整行,触发切换, 判断是否可选,单选或多选,进行对应操作 |
| | | */ |
| | | changeRow = (record, index) => { |
| | | const { setting } = this.props |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | if (!setting.tableType || this.state.pickup) return |
| | | |
| | |
| | | let selects = this.props.data.filter((item, _index) => newkeys.includes(_index)) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, selects, data.length === selects.length) |
| | | } |
| | | } |
| | | |
| | | changeTable = (pagination, filters, sorter) => { |
| | |
| | | const NormalTree = asyncComponent(() => import('@/tabviews/custom/components/tree/antd-tree')) |
| | | const CarouselDataCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/data-card')) |
| | | const CarouselPropCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/prop-card')) |
| | | const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | |
| | | <SandBox config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony config={item} data={data} BID={BID} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | }) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换 |
| | | reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置 |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | total: result.total, |
| | | loading: false |
| | | }) |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | } |
| | | } |
| | | |
| | | getSyncData = (syncModule, btnId) => { |
| | | const { config, selectedData } = this.state |
| | | |
| | | if (config.uuid !== syncModule) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', btnId, (selectedData || [])) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { sync, config, BID } = this.state |
| | | |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('getSyncData', this.getSyncData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | MKEmitter.removeListener('getSyncData', this.getSyncData) |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.removeListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | |
| | | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus) |
| | | let balMap = new Map() |
| | | config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs) |
| | | config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs, balMap) |
| | | |
| | | if ([...balMap.keys()].length > 0) { |
| | | config.components = this.filterBalcony(config.components, balMap) |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: BID, |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, permMenus) => { |
| | | filterComponent = (components, roleId, permAction, permMenus, balMap) => { |
| | | return components.filter(item => { |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | |
| | | }) |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | if (item.wrap.linkType === 'sync') { |
| | | item.wrap.syncModuleId = item.wrap.syncModule.pop() |
| | | balMap.set(item.wrap.syncModuleId, true) |
| | | } |
| | | item.elements = item.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | filterBalcony = (components, balMap) => { |
| | | return components.filter(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterBalcony(tab.components, balMap) |
| | | return tab |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components = this.filterBalcony(item.components, balMap) |
| | | } |
| | | |
| | | if (item.type === 'balcony' && item.wrap.linkType === 'sync') { |
| | | let conf = balMap.get(item.wrap.syncModuleId) |
| | | |
| | | if (!conf || conf === true) { |
| | | return false |
| | | } |
| | | |
| | | item.syncConfig = { |
| | | uuid: conf.uuid, |
| | | wrap: conf.wrap, |
| | | setting: conf.setting, |
| | | columns: conf.columns |
| | | } |
| | | |
| | | if (item.wrap.checkAll === 'show') { |
| | | if (conf.subtype === 'datacard' && conf.wrap.cardType !== 'checkbox') { |
| | | item.wrap.checkAll = 'hidden' |
| | | } else if (conf.subtype === 'normaltable' && conf.wrap.tableType !== 'checkbox') { |
| | | item.wrap.checkAll = 'hidden' |
| | | } |
| | | } |
| | | } |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | getPrinter = (item, parentId) => { |
| | | let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid) |
| | | |
| | |
| | | } |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, mainSearch, inherit, regs) => { |
| | | formatSetting = (components, params, mainSearch, inherit, regs, balMap) => { |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | | tab.components = this.formatSetting(tab.components, [], [], inherit, regs) |
| | | tab.components = this.formatSetting(tab.components, [], [], inherit, regs, balMap) |
| | | tab = {...tab, ...inherit} |
| | | return tab |
| | | }) |
| | | return component |
| | | } else if (component.type === 'group') { |
| | | component.components = this.formatSetting(component.components, [], [], inherit, regs) |
| | | component.components = this.formatSetting(component.components, [], [], inherit, regs, balMap) |
| | | component = {...component, ...inherit} |
| | | return component |
| | | } |
| | |
| | | } |
| | | } else if (component.floor === 1) { |
| | | component.setting.sync = 'false' |
| | | } |
| | | |
| | | if (balMap.has(component.uuid)) { |
| | | component.setting.$hasSyncModule = true |
| | | balMap.set(component.uuid, component) |
| | | } |
| | | |
| | | return component |
| | |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony menu={config} config={item} data={data} BID={_bid} menuType={menuType} /> |
| | | <Balcony config={item} data={data} BID={_bid} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | |
| | | return |
| | | } |
| | | |
| | | if (btn.$syncModule && !triggerId) { |
| | | MKEmitter.emit('getSyncData', btn.$syncModule, btn.uuid) |
| | | return |
| | | } |
| | | |
| | | let _this = this |
| | | let data = record || selectedData || [] |
| | | |
| | |
| | | import md5 from 'md5' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Affix, Typography, Modal, Icon } from 'antd' |
| | | import { Table, Affix, Typography, Icon } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | const PopupButton = asyncComponent(() => import('@/tabviews/zshare/actionList/popupbutton')) |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const ImgScale = asyncComponent(() => import('@/tabviews/zshare/imgScale')) |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | |
| | | pageIndex: 1, // 初始页面索引 |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null, // 显示列 |
| | | imgShow: false, // 图片放大模态框 |
| | | imgData: {}, // 图片集 |
| | | lineMarks: null, // 行标记 |
| | | activeIndex: null, // 标记当前选中行 |
| | | rowspans: null // 行合并字段信息 |
| | |
| | | <div className="picture-col"> |
| | | {photos && photos.map((url, i) => { |
| | | if (item.scale === 'true') { |
| | | return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={() => this.imgScale(photos, i)} key={`${i}`} src={url} alt=""/> |
| | | return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={() => { |
| | | MKEmitter.emit('mkImageScale', url, photos.length > 1 ? photos : '') |
| | | }} key={`${i}`} src={url} alt=""/> |
| | | } else { |
| | | return <img style={{maxHeight: maxHeight}} key={`${i}`} src={url} alt=""/> |
| | | } |
| | |
| | | <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={() => this.imgScale(images, index)} key={`${index}`} src={_img.url} alt=""/> |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => { |
| | | MKEmitter.emit('mkImageScale', _img.url, images.length > 1 ? images.map(g => g.url) : '') |
| | | }} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | |
| | | <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={() => this.imgScale(images, index)} key={`${index}`} src={_img.url} alt=""/> |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => { |
| | | MKEmitter.emit('mkImageScale', _img.url, images.length > 1 ? images.map(g => g.url) : '') |
| | | }} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 图片缩放 |
| | | */ |
| | | imgScale = (images, index) => { |
| | | this.setState({ |
| | | imgShow: true, |
| | | imgData: { |
| | | list: images.map(item => { |
| | | if (typeof(item) === 'string') { |
| | | return item |
| | | } |
| | | return item.url |
| | | }), |
| | | index |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | pagination={_pagination} |
| | | /> |
| | | {_footer ? <div className={'normal-table-footer ' + (_pagination ? 'pagination' : '')}>{_footer}</div> : null} |
| | | <Modal |
| | | className="image-scale-modal" |
| | | visible={this.state.imgShow} |
| | | width="70vw" |
| | | maskClosable={true} |
| | | onCancel={() => {this.setState({ imgShow: false })}} |
| | | title={this.props.dict['main.form.picture.check']} |
| | | footer={[<span key="close" onClick={() => {this.setState({ imgShow: false })}}>{this.props.dict['main.close']}</span>]} |
| | | destroyOnClose |
| | | > |
| | | <ImgScale data={this.state.imgData}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import Header from '@/components/header' |
| | | import Sidemenu from '@/components/sidemenu' |
| | | import QueryLog from '@/components/querylog' |
| | | import ImgScale from '@/components/imgScale' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | {!isSideMenu ? <Breadview key="breadview"/> : null} |
| | | <QueryLog /> |
| | | </ConfigProvider> |
| | | <ImgScale /> |
| | | </div> |
| | | ) |
| | | } |