| | |
| | | const NormalTable = asyncComponent(() => import('@/tabviews/custom/components/table/normal-table')) |
| | | const SandBox = asyncComponent(() => import('@/tabviews/custom/components/code/sand-box')) |
| | | const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) |
| | | const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) |
| | | const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) |
| | | const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) |
| | | const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) |
| | |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(params.param))) |
| | | |
| | | sessionStorage.setItem('dataM', param.dataM || '') |
| | | sessionStorage.setItem('localDataM', param.dataM || '') |
| | | this.setState({ |
| | | BID: param.id || '', |
| | | tempId: param.tempId, |
| | |
| | | |
| | | if (component.type === 'table') { |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | | return cols.filter(item => { |
| | | if (item.type === 'colspan') { |
| | | item.subcols = getColumns(item.subcols) |
| | | if (item.subcols.length === 0) { |
| | | return false |
| | | } |
| | | } else if (item.type === 'custom') { |
| | | item.elements = item.elements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | return cell |
| | | }) |
| | | if (item.elements.length === 0) { |
| | | return false |
| | | } |
| | | } else { |
| | | item.IsSort = 'false' |
| | | } |
| | | |
| | | return item |
| | | return true |
| | | }) |
| | | } |
| | | component.cols = getColumns(component.cols) |
| | | component.statFields = [] |
| | | } else if (['card', 'carousel', 'timeline'].includes(component.type)) { |
| | | component.subcards && component.subcards.forEach(card => { |
| | | if (card.style.boxShadow) { |
| | | delete card.style.hShadow |
| | | delete card.style.vShadow |
| | | delete card.style.shadowBlur |
| | | delete card.style.shadowColor |
| | | } |
| | | |
| | | card.elements = card.elements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | | |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | }) |
| | | } else if (component.type === 'balcony') { |
| | | component.elements = component.elements.filter(cell => { |
| | | if (cell.eleType === 'button') return false |
| | | |
| | | cell = this.resetElement(cell) |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | |
| | | }) |
| | | } |
| | | |
| | | resetElement = (cell) => { |
| | | cell.style = cell.style || {} |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | cell.innerHeight = cell.innerHeight || 'auto' |
| | | cell.alignItems = cell.height > 1 ? cell.alignItems : '' |
| | | |
| | | 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 |
| | | } |
| | | } |
| | | } |
| | | |
| | | return cell |
| | | } |
| | | |
| | | reload = () => { |
| | | const { tempId } = this.state |
| | | |
| | | this.setState({ |
| | | loadingview: true, |
| | | pages: null, |
| | | data: '', |
| | | config: null |
| | | }, () => { |
| | | Api.deleteMenuStorage(tempId) |
| | | setTimeout(() => { |
| | | this.getMenuParam() |
| | | }, 50) |
| | | // Api.getAppVersion(tempId).then(() => { |
| | | // this.getMenuParam() |
| | | // }, () => { |
| | | // this.getMenuParam() |
| | | // }) |
| | | }) |
| | | } |
| | | |
| | |
| | | <TimeLine config={item} initdata={item.data} mainSearch={[]}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'editor') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <BraftEditor config={item} initdata={item.data} mainSearch={[]}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvG6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |