| | |
| | | const TableCard = asyncComponent(() => import('./components/card/table-card')) |
| | | const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) |
| | | const NormalTable = asyncComponent(() => import('./components/table/normal-table')) |
| | | const EditTable = asyncComponent(() => import('./components/table/edit-table')) |
| | | const NormalGroup = asyncComponent(() => import('./components/group/normal-group')) |
| | | const BraftEditor = asyncComponent(() => import('./components/editor/braft-editor')) |
| | | const SandBox = asyncComponent(() => import('./components/code/sand-box')) |
| | |
| | | const Balcony = asyncComponent(() => import('./components/card/balcony')) |
| | | const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent')) |
| | | const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) |
| | | const CustomChart = asyncComponent(() => import('./components/chart/custom-chart')) |
| | | |
| | | class CustomPage extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip) |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) { |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |
| | | item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0 |
| | |
| | | item.search = Utils.initSearchVal(item.search) |
| | | } |
| | | |
| | | if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) { |
| | | let statFields = [] |
| | | let getCols = (cols) => { |
| | | return cols.filter(col => { |
| | | if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | return false |
| | | } else if (col.Hide === 'true') { |
| | | return false |
| | | if (item.subtype !== 'editable') { |
| | | if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | return false |
| | | } else if (col.Hide === 'true') { |
| | | return false |
| | | } |
| | | } 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) |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | if (card.btnstyle) { // 兼容 |
| | | card.style = card.style || {} |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | if (card.btnstyle) { // 兼容 |
| | | card.style = card.style || {} |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (card.btnstyle) { // 兼容 |
| | | card.style = card.style || {} |
| | | card.style = {...card.style, ...card.btnstyle} |
| | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) { |
| | | item.cols = item.cols.filter(col => { |
| | | if (col.type !== 'action') return true |
| | | col.elements = col.elements.filter(cell => { |
| | |
| | | cell.ContainerId = this.state.ContainerId |
| | | cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' |
| | | cell.$menuId = item.uuid |
| | | cell.$MenuID = this.props.MenuID |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置 |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id |
| | | cell.$menuId = this.props.MenuID |
| | | } |
| | | |
| | | if (cell.btnstyle) { // 兼容 |
| | |
| | | }) |
| | | return col.elements.length !== 0 |
| | | }) |
| | | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | item.submit.$menuId = item.uuid |
| | | } |
| | | } |
| | | |
| | | if (item.setting && item.setting.supModule) { |
| | |
| | | <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'editable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <EditTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'group' && item.subtype === 'normalgroup') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | |
| | | <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'chart') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}> |
| | | {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row>{this.getComponents()}</Row> |
| | | {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} |
| | | {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} |
| | | {menuType !== 'HS' && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> |