| | |
| | | |
| | | window.GLOB.CacheMap = new Map() // 缓存配置信息 |
| | | window.GLOB.UserCacheMap = new Map() // 缓存用户自定义设置 |
| | | window.GLOB.CacheData = new Map() // 存储选中数据 |
| | | |
| | | render(Route) |
| | | }) |
| | |
| | | width: card.width || 12, |
| | | name: '凭证', |
| | | subtype: card.subtype, |
| | | // setting: { interType: 'system' }, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: '凭证', title: '', width: card.width || 12, type: 'edit' }, |
| | | style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, |
| | | headerStyle: {}, |
| | |
| | | |
| | | class BalconyComponent extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, |
| | | data: PropTypes.array, |
| | | config: PropTypes.object, |
| | | } |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, initdata } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = { $$empty: true } |
| | | let _sync = false |
| | | |
| | | if (_config.setting && _config.wrap.datatype !== 'static') { |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.wrap.datatype !== 'static') { |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_sync && data) { |
| | |
| | | |
| | | class DataCard extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | let _card = null |
| | | let precards = [] |
| | | let nextcards = [] |
| | |
| | | |
| | | class PropCard extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | | let _data = { $$empty: true } |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.wrap.datatype !== 'static') { |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | |
| | | |
| | | class TableCard extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.setting.sync === 'true' && data) { |
| | | _data = data[_config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class DataCard extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _card = _config.subcards[0] |
| | | let _cols = new Map() |
| | |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.setting.sync === 'true' && data) { |
| | | _data = data[_config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class PropCard extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | | let _data = {$$empty: true} |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.setting && _config.wrap.datatype !== 'static') { |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | |
| | | |
| | | class LineChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | let _data = null |
| | | let _sync = config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.setting.sync === 'true' && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class DashboardChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_sync && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class PieChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.setting.sync === 'true' && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class ScatterChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | let _data = null |
| | | let _sync = config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.setting.sync === 'true' && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class CustomChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | let _data = null |
| | | let _sync = config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.setting.sync === 'true' && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | |
| | | class SandBoxComponent extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = {} |
| | | let _sync = false |
| | | |
| | | if (_config.setting && _config.wrap.datatype !== 'static') { |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.wrap.datatype !== 'static') { |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_sync && data) { |
| | |
| | | |
| | | class BraftEditorContent extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = {} |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.setting && _config.wrap.datatype !== 'static') { |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | |
| | | |
| | | class SimpleForm extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, BData } = this.props |
| | | const { data } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | |
| | | |
| | | class StepForm extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, BData } = this.props |
| | | const { data } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | |
| | | |
| | | class TabForm extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID, BData } = this.props |
| | | const { data } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | |
| | | const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card')) |
| | | const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) |
| | | const SandBox = asyncComponent(() => import('@/tabviews/custom/components/code/sand-box')) |
| | | const SimpleForm = asyncComponent(() => import('@/tabviews/custom/components/form/simple-form')) |
| | | const NormalForm = asyncComponent(() => import('@/tabviews/custom/components/form/step-form')) |
| | | const TabForm = asyncComponent(() => import('@/tabviews/custom/components/form/tab-form')) |
| | | 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')) |
| | | const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) |
| | | const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | bids: PropTypes.any, // 父级Id集 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 全局搜索条件 |
| | | } |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | loadmaindata = (params) => { |
| | | let param = getStructuredParams(params, this.props.config, this.props.BID || '') |
| | | let BID = '' |
| | | let BData = window.GLOB.CacheData.get(this.props.config.$pageId) |
| | | |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | let param = getStructuredParams(params, this.props.config, BID) |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | |
| | | } |
| | | |
| | | getComponents = () => { |
| | | const { BID, bids, config } = this.props |
| | | const { config } = this.props |
| | | const { mainSearch, data } = this.state |
| | | |
| | | if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) |
| | | |
| | | return config.components.map(item => { |
| | | let _bid = BID || '' |
| | | let BData = '' |
| | | if (item.setting && item.setting.supModule) { |
| | | _bid = bids ? bids[item.setting.supModule] || '' : '' |
| | | BData = bids ? bids[item.setting.supModule + '_data'] || '' : '' |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvBarAndLine data={data} config={item} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvBarAndLine data={data} config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'pie') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvPie data={data} config={item} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvPie data={data} config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'dashboard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvDashboard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvDashboard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'simpleform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SimpleForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'stepform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalForm config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <NormalForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'tabform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TabForm config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <TabForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'scatter') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvScatter config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvScatter config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselDataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <CarouselDataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselPropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <CarouselPropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <DataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <PropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TableCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <TableCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTable config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <NormalTable config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'editable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <EditTable config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch}/> |
| | | <EditTable config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tree') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTree config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <NormalTree config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'editor') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <BraftEditor config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <BraftEditor config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'code') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <SandBox config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony config={item} data={data} BID={_bid}/> |
| | | <Balcony config={item} data={data}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'timeline') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TimeLine config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'chart') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <CustomChart config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | |
| | | |
| | | class VoucherModule extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | config: PropTypes.object, // 组件配置信息 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, BID } = this.props |
| | | const { config } = this.props |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | config: fromJS(config).toJS(), |
| | |
| | | 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')) |
| | | const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) |
| | | const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | | bids: PropTypes.any, // 父级Id集 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 全局搜索条件 |
| | | } |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | loadmaindata = (params) => { |
| | | let param = getStructuredParams(params, this.props.config, this.props.BID || '') |
| | | let BID = '' |
| | | let BData = window.GLOB.CacheData.get(this.props.config.$pageId) |
| | | |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | let param = getStructuredParams(params, this.props.config, BID) |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | |
| | | } |
| | | |
| | | getComponents = () => { |
| | | const { bids, config } = this.props |
| | | const { config } = this.props |
| | | const { mainSearch, data } = this.state |
| | | |
| | | if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) |
| | | |
| | | return config.components.map(item => { |
| | | let BID = this.props.BID || '' |
| | | let BData = '' |
| | | if (item.setting && item.setting.supModule) { |
| | | BID = bids[item.setting.supModule] || '' |
| | | BData = bids[item.setting.supModule + '_data'] || '' |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvBarAndLine data={data} config={item} BID={BID} mainSearch={mainSearch}/> |
| | | <AntvBarAndLine data={data} config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'pie') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvPie data={data} config={item} BID={BID} mainSearch={mainSearch}/> |
| | | <AntvPie data={data} config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'dashboard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvDashboard config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <AntvDashboard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'scatter') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvScatter config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <AntvScatter config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'search') { |
| | | let BID = '' |
| | | let BData = window.GLOB.CacheData.get(item.$pageId) |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <MainSearch config={item} BID={BID} refreshdata={this.resetSearch} /> |
| | |
| | | } else if (item.type === 'tabs') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvTabs config={item} BID={BID} bids={bids} mainSearch={mainSearch}/> |
| | | <AntvTabs config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <DataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <PropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselDataCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <CarouselDataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselPropCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <CarouselPropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TableCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <TableCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTable config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <NormalTable config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'editable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <EditTable config={item} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <EditTable config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'group' && item.subtype === 'normalgroup') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalGroup config={item} BID={BID} bids={bids} mainSearch={mainSearch}/> |
| | | <NormalGroup config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'simpleform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SimpleForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <SimpleForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'stepform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <StepForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <StepForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'tabform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TabForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch}/> |
| | | <TabForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tree') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTree config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <NormalTree config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'editor') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <BraftEditor config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <BraftEditor config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'code') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SandBox config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <SandBox config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony config={item} data={data} BID={BID}/> |
| | | <Balcony config={item} data={data}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'timeline') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TimeLine config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'chart') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CustomChart config={item} data={data} BID={BID} mainSearch={mainSearch}/> |
| | | <CustomChart config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | |
| | | |
| | | class EditableTable extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | | } |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | let setting = {..._config.setting, ..._config.wrap} |
| | | setting.tableId = Utils.getuuid() |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | _config.submit.style = _config.submit.style || {} |
| | | _config.submit.wrapStyle = {} |
| | | _config.submit.hasAction = _config.action.length > 0 |
| | |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.wrap.controlField) { |
| | | if (_config.wrap.controlVal) { |
| | | _config.wrap.controlVal = _config.wrap.controlVal.split(',') |
| | |
| | | |
| | | class antvTabs extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 页面BID |
| | | bids: PropTypes.any, // 父级Id集 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | | } |
| | | |
| | | state = { |
| | | tabs: null, |
| | | parentIds: [], |
| | | bids: {}, |
| | | activeIndex: 1 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, bids } = this.props |
| | | const { config } = this.props |
| | | |
| | | let _tabs = fromJS(config).toJS() |
| | | |
| | | if (_tabs.setting.supModule) { |
| | | _tabs.subtabs = [] |
| | | |
| | | let data = window.GLOB.CacheData.get(_tabs.setting.supModule) |
| | | |
| | | if (data) { |
| | | let val = '' |
| | | Object.keys(data).forEach(key => { |
| | | if (key.toLowerCase() === _tabs.setting.controlField) { |
| | | val = data[key] |
| | | } |
| | | }) |
| | | _tabs.subtabs = config.subtabs.filter(tab => { |
| | | if (tab.controlVal === val) { |
| | | return false |
| | | } else if (/,/ig.test(tab.controlVal)) { |
| | | return !tab.controlVal.split(',').includes(val) |
| | | } |
| | | return true |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | tabs: _tabs, |
| | | parentIds: config.parentIds || [], |
| | | bids: bids ? bids : {} |
| | | tabs: _tabs |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | | const { parentIds, bids, tabs } = this.state |
| | | |
| | | if (parentIds.includes(MenuID)) { |
| | | this.setState({ |
| | | bids: {...bids, [MenuID]: id, [MenuID + '_data']: data} |
| | | }) |
| | | } |
| | | const { tabs } = this.state |
| | | |
| | | if (tabs.setting.supModule === MenuID) { |
| | | if (!data) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { mainSearch, BID } = this.props |
| | | const { tabs, bids } = this.state |
| | | const { mainSearch } = this.props |
| | | const { tabs } = this.state |
| | | |
| | | if (!tabs.subtabs.length) return null |
| | | |
| | |
| | | <Tabs defaultActiveKey="1" tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}> |
| | | <TabTransfer BID={BID} config={tab} bids={bids} mainSearch={mainSearch}/> |
| | | <TabTransfer config={tab} mainSearch={mainSearch}/> |
| | | </TabPane> |
| | | ))} |
| | | </Tabs> |
| | |
| | | |
| | | class NormalTimeline extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID, BData } = this.props |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | | let _data = null |
| | | let card = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (_config.setting.sync === 'true' && data) { |
| | | _data = data[_config.dataName] || [] |
| | |
| | | return |
| | | } |
| | | |
| | | // if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { |
| | | // this.getExpress() |
| | | // return |
| | | // } |
| | | if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { |
| | | this.getExpress() |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | |
| | | } |
| | | |
| | | getExpress = () => { |
| | | const { BData } = this.state |
| | | |
| | | let code = '' |
| | | let order = '' |
| | | if (BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (key.toLowerCase() === 'expresscode') { |
| | | code = BData[key] |
| | | } else if (key.toLowerCase() === 'expressno') { |
| | | order = BData[key] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (!code || !order) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到快递' + (!code ? '公司编码。' : '单号。'), |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.wxNginxRequest(`express/yuantong/YT6590674317601`, 'get').then(res => { |
| | | Api.wxNginxRequest(`express/${code}/${order}`, 'get').then(res => { |
| | | if (!res || typeof(res) !== 'string') { |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | |
| | | class NormalTree extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | data: PropTypes.array, // 统一查询数据 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 外层搜索条件 |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, data, initdata, BID } = this.props |
| | | const { config, data, initdata } = this.props |
| | | let _config = fromJS(config).toJS() |
| | | let _data = null |
| | | let _sync = config.setting.sync === 'true' |
| | | |
| | | let BID = '' |
| | | let BData = '' |
| | | |
| | | if (_config.setting.supModule) { |
| | | BData = window.GLOB.CacheData.get(_config.setting.supModule) |
| | | } else { |
| | | BData = window.GLOB.CacheData.get(_config.$pageId) |
| | | } |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | if (config.setting.sync === 'true' && data) { |
| | | _data = data[config.dataName] || [] |
| | | _sync = false |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction } = this.props |
| | | const { permAction, MenuID } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: this.props.MenuID |
| | | MenuID: MenuID |
| | | } |
| | | let result = await Api.getCacheConfig(_param) |
| | | |
| | |
| | | let skip = config.permission === 'false' || window.GLOB.mkHS |
| | | let param = this.props.param || {} // url参数 |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip, param) |
| | | window.GLOB.CacheData.set(MenuID, param) |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip, param, MenuID) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam) => { |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId) => { |
| | | return components.filter(item => { |
| | | item.$pageId = pageId |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | | delete item.style.hShadow |
| | |
| | | } |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam) |
| | | tab.$pageId = pageId |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId) |
| | | return tab |
| | | }) |
| | | |
| | | let supIds = [] |
| | | item.subtabs.forEach(tab => { |
| | | tab.components.forEach(comp => { |
| | | if (comp.type === 'tabs' && comp.parentIds) { |
| | | supIds.push(...comp.parentIds) |
| | | } else if (comp.setting && comp.setting.supModule) { |
| | | supIds.push(comp.setting.supModule) |
| | | } |
| | | }) |
| | | }) |
| | | item.parentIds = supIds |
| | | |
| | | return true |
| | | } else if (item.type === 'group') { |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | |
| | | } |
| | | MKEmitter.removeListener('reloadMenuView', this.reloadMenuView) |
| | | MKEmitter.removeListener('resetActiveMenu', this.resetActiveMenu) |
| | | |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | this.deleteCache(this.state.config.components) |
| | | } |
| | | |
| | | deleteCache = (components) => { |
| | | components.forEach(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | this.deleteCache(tab.components) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | this.deleteCache(item.components) |
| | | } else { |
| | | window.GLOB.CacheData.delete(item.uuid) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | reloadview = () => { |
| | |
| | | if (!config || !config.components) return |
| | | |
| | | return config.components.map(item => { |
| | | let _bid = BID |
| | | if (item.setting && item.setting.supModule) { |
| | | _bid = '' |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvBarAndLine config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvBarAndLine config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'pie') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvPie config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvPie config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'scatter') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvScatter config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvScatter config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'dashboard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvDashboard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <AntvDashboard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'simpleform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SimpleForm config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <SimpleForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'stepform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <StepForm config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <StepForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'tabform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TabForm config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <TabForm config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'search') { |
| | |
| | | } else if (item.type === 'tabs') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvTabs config={item} BID={BID} mainSearch={mainSearch} /> |
| | | <AntvTabs config={item} mainSearch={mainSearch} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <DataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <PropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'balcony') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Balcony config={item} data={data} BID={_bid}/> |
| | | <Balcony config={item} data={data}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'timeline') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TimeLine config={item} data={data} BID={_bid}/> |
| | | <TimeLine config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselDataCard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <CarouselDataCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselPropCard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <CarouselPropCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TableCard config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <TableCard config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <NormalTable config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'editable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <EditTable config={item} BID={_bid} mainSearch={mainSearch}/> |
| | | <EditTable config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'group' && item.subtype === 'normalgroup') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalGroup config={item} BID={_bid} mainSearch={mainSearch}/> |
| | | <NormalGroup config={item} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'editor') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <BraftEditor config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <BraftEditor config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tree') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTree config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <NormalTree config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'code') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <SandBox config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'chart') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch}/> |
| | | <CustomChart config={item} data={data} mainSearch={mainSearch}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'module' && item.subtype === 'voucher') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <Voucher config={item} BID={_bid} /> |
| | | <Voucher config={item}/> |
| | | </Col> |
| | | ) |
| | | } else { |
| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Header from '@/components/header' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Sidemenu from '@/components/sidemenu' |
| | | import QueryLog from '@/components/querylog' |
| | | import ImgScale from '@/components/imgScale' |
| | |
| | | navBar: window.GLOB.navBar |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | | window.GLOB.CacheData.set(MenuID, {...data, $BID: id}) |
| | | } |
| | | |
| | | render () { |
| | | const { navBar } = this.state |
| | | const isSideMenu = !['linkage_navigation', 'linkage', 'menu_board'].includes(navBar) |