| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { getMark } from '@/utils/utils.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Encrypts from '@/components/encrypts' |
| | | import './index.scss' |
| | | |
| | |
| | | openNewView = (e, card) => { |
| | | const { cardCell, data, cards } = this.props |
| | | |
| | | if (data.$disabled) return |
| | | e.stopPropagation() |
| | | |
| | | if (card.anchors && card.anchors.length > 0) { |
| | | if (card.anchors) { |
| | | let id = card.anchors[card.anchors.length - 1] |
| | | let node = document.getElementById('anchor' + id) |
| | | node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'}) |
| | | } |
| | | |
| | | if (!card.link || (card.linkType === 'qywx' || card.linkType === 'linkmenu')) return |
| | | e.stopPropagation() |
| | | if (card.linkType === 'qywx') return |
| | | if (card.linkType === 'linkmenu') { |
| | | if (card.linkThdMenu) { |
| | | let __param = { |
| | | $BID: data.$$uuid |
| | | } |
| | | |
| | | if (card.field) { |
| | | __param.$searchkey = card.field |
| | | __param.$searchval = data[card.field] || '' |
| | | } |
| | | |
| | | if (card.joint === 'true' && card.linkThdMenu.urlFields) { |
| | | let lower = {} |
| | | Object.keys(data).forEach(key => { |
| | | lower[key.toLowerCase()] = data[key] |
| | | }) |
| | | |
| | | card.linkThdMenu.urlFields.split(',').forEach(field => { |
| | | __param[field] = lower[field.toLowerCase()] || '' |
| | | }) |
| | | } |
| | | |
| | | let tabmenu = card.linkThdMenu |
| | | |
| | | tabmenu.param = __param |
| | | |
| | | MKEmitter.emit('modifyTabs', tabmenu, true) |
| | | } |
| | | return |
| | | } |
| | | |
| | | let url = '' |
| | | |
| | |
| | | } |
| | | |
| | | if (card.copyable === 'true') { |
| | | if (card.link || (card.anchors && card.anchors.length > 0)) { |
| | | if (card.link || card.anchors) { |
| | | let url = orival |
| | | |
| | | if (card.link === 'static') { |
| | |
| | | className = mark.signType |
| | | } |
| | | |
| | | if (card.link || (card.anchors && card.anchors.length > 0)) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | if (card.bgImage && data[card.bgImage]) { |
| | | _style.backgroundImage = `url('${data[card.bgImage]}')` |
| | | } |
| | | |
| | | if (!data.$disabled && (card.link || card.anchors)) { |
| | | _style.cursor = 'pointer' |
| | | contents.push( |
| | | <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | contents.push( |
| | | <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={_style}> |
| | | {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> : |
| | | <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>} |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } else if (card.eleType === 'number') { |
| | | let val = '' |
| | | let _style = {...card.style} |
| | |
| | | _imagestyle.backgroundPosition = _style.backgroundPosition || 'center' |
| | | _imagestyle.backgroundRepeat = _style.backgroundRepeat || 'no-repeat' |
| | | |
| | | if (card.link) { |
| | | _style.cursor = 'pointer' |
| | | } |
| | | |
| | | if (_style.position === 'absolute') { |
| | | _style.width = '100%' |
| | | } |
| | |
| | | let scale = url && card.scale === 'true' |
| | | let urls = url ? url.split(',').filter(Boolean) : [''] |
| | | |
| | | if (card.link && !data.$disabled) { |
| | | _style.cursor = 'pointer' |
| | | urls.forEach((u, i) => { |
| | | contents.push(<div className={'ant-col ant-col-' + card.width} key={card.uuid + i} style={_style_} span={card.width}> |
| | | <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> |
| | |
| | | </div> |
| | | </div>) |
| | | }) |
| | | } else { |
| | | urls.forEach((u, i) => { |
| | | contents.push(<div className={'ant-col ant-col-' + card.width} key={card.uuid + i} style={_style_} span={card.width}> |
| | | <div style={_style}> |
| | | <MkPicture style={_imagestyle} lostTip={card.lostTip !== 'false'} scale={scale} url={u} urls={urls}/> |
| | | </div> |
| | | </div>) |
| | | }) |
| | | } |
| | | } else if (card.eleType === 'splitline') { |
| | | let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth |
| | | _style_ = _style_ || {} |