From 5d41cbe3722ff40b65bfa4de82d62a79f171f5a5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 八月 2022 17:41:55 +0800 Subject: [PATCH] 2022-08-15 --- src/tabviews/custom/components/chart/antv-scatter/index.jsx | 15 + src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 15 + src/tabviews/custom/components/code/sand-box/index.jsx | 17 + src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 15 + src/tabviews/custom/components/editor/braft-editor/index.jsx | 15 + src/tabviews/custom/components/tree/antd-tree/index.jsx | 15 + src/tabviews/custom/components/tabs/antv-tabs/index.jsx | 43 ++- src/views/main/index.jsx | 13 + src/menu/components/module/voucher/index.jsx | 2 src/tabviews/custom/components/carousel/data-card/index.jsx | 15 + src/tabviews/custom/components/table/edit-table/index.jsx | 14 + src/tabviews/custom/components/form/simple-form/index.jsx | 15 + src/tabviews/custom/components/chart/custom-chart/index.jsx | 15 + src/tabviews/custom/components/card/data-card/index.jsx | 15 + src/index.js | 1 src/tabviews/custom/components/form/tab-form/index.jsx | 15 + src/tabviews/custom/components/card/table-card/index.jsx | 15 + src/tabviews/custom/components/card/prop-card/index.jsx | 15 + src/tabviews/custom/components/module/voucher/index.jsx | 15 + src/tabviews/custom/components/share/tabtransfer/index.jsx | 73 +++-- src/tabviews/custom/components/group/normal-group/index.jsx | 70 +++-- src/tabviews/custom/components/table/normal-table/index.jsx | 15 + src/tabviews/custom/components/chart/antv-pie/index.jsx | 15 + src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 48 +++ src/tabviews/custom/components/carousel/prop-card/index.jsx | 15 + src/tabviews/custom/components/form/step-form/index.jsx | 15 + src/tabviews/custom/index.jsx | 97 ++++---- src/tabviews/custom/components/card/balcony/index.jsx | 17 + 28 files changed, 476 insertions(+), 174 deletions(-) diff --git a/src/index.js b/src/index.js index 215706f..93197e6 100644 --- a/src/index.js +++ b/src/index.js @@ -271,6 +271,7 @@ window.GLOB.CacheMap = new Map() // 缂撳瓨閰嶇疆淇℃伅 window.GLOB.UserCacheMap = new Map() // 缂撳瓨鐢ㄦ埛鑷畾涔夎缃� + window.GLOB.CacheData = new Map() // 瀛樺偍閫変腑鏁版嵁 render(Route) }) diff --git a/src/menu/components/module/voucher/index.jsx b/src/menu/components/module/voucher/index.jsx index 30d250f..c3167d2 100644 --- a/src/menu/components/module/voucher/index.jsx +++ b/src/menu/components/module/voucher/index.jsx @@ -42,7 +42,7 @@ 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: {}, diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index 43ec2d1..9384194 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -15,7 +15,6 @@ class BalconyComponent extends Component { static propTpyes = { - BID: PropTypes.any, data: PropTypes.array, config: PropTypes.object, } @@ -34,13 +33,25 @@ } 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 + + 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') { + if (_config.wrap.datatype !== 'static') { _sync = _config.setting.sync === 'true' if (_sync && data) { diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index ff124ec..5859198 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -18,7 +18,6 @@ class DataCard extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -46,9 +45,21 @@ } 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 = [] diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 2c72190..a7fea22 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -16,7 +16,6 @@ class PropCard extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -35,12 +34,24 @@ } 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' diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index 314f10b..a4a9de0 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -16,7 +16,6 @@ class TableCard extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -39,13 +38,25 @@ * 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 diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 5765bce..bc28a9e 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -13,7 +13,6 @@ class DataCard extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -30,7 +29,7 @@ } 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() @@ -38,6 +37,18 @@ 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 diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 554226a..91f9eaf 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -13,7 +13,6 @@ class PropCard extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -29,12 +28,24 @@ } 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' diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index b2449054..db163a7 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -22,7 +22,6 @@ class LineChart extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -45,11 +44,23 @@ } 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 diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index a20be1e..29dba2e 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -52,7 +52,6 @@ class DashboardChart extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -71,12 +70,24 @@ } 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 diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 448b85b..94798e8 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -18,7 +18,6 @@ class PieChart extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -39,12 +38,24 @@ } 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 diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index bad1040..27ca874 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -19,7 +19,6 @@ class ScatterChart extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -39,11 +38,23 @@ } 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 diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx index 310c1ea..d0aae5e 100644 --- a/src/tabviews/custom/components/chart/custom-chart/index.jsx +++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx @@ -16,7 +16,6 @@ class CustomChart extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -34,11 +33,23 @@ } 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 diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index 5eb969e..66338af 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -10,7 +10,6 @@ class SandBoxComponent extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -26,13 +25,25 @@ } 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') { + if (_config.wrap.datatype !== 'static') { _sync = _config.setting.sync === 'true' if (_sync && data) { diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index 2f9c508..e8f4f4b 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx @@ -14,7 +14,6 @@ class BraftEditorContent extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -29,11 +28,23 @@ } 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' diff --git a/src/tabviews/custom/components/form/simple-form/index.jsx b/src/tabviews/custom/components/form/simple-form/index.jsx index 35fd004..5ea76fc 100644 --- a/src/tabviews/custom/components/form/simple-form/index.jsx +++ b/src/tabviews/custom/components/form/simple-form/index.jsx @@ -19,7 +19,6 @@ class SimpleForm extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -38,12 +37,24 @@ } 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' diff --git a/src/tabviews/custom/components/form/step-form/index.jsx b/src/tabviews/custom/components/form/step-form/index.jsx index 91eb195..0b3580c 100644 --- a/src/tabviews/custom/components/form/step-form/index.jsx +++ b/src/tabviews/custom/components/form/step-form/index.jsx @@ -18,7 +18,6 @@ class StepForm extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -37,12 +36,24 @@ } 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' diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx index fc90e76..65cb0b3 100644 --- a/src/tabviews/custom/components/form/tab-form/index.jsx +++ b/src/tabviews/custom/components/form/tab-form/index.jsx @@ -18,7 +18,6 @@ class TabForm extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -36,12 +35,24 @@ } 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' diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 7874b04..3a2fc09 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -24,18 +24,18 @@ 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, // 鍏ㄥ眬鎼滅储鏉′欢 } @@ -102,7 +102,14 @@ * @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) { @@ -128,125 +135,130 @@ } 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 { diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index b36187e..bd053ab 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -12,7 +12,6 @@ class VoucherModule extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 } @@ -29,7 +28,19 @@ } 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(), diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 1fbd303..a4b2f94 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -34,11 +34,11 @@ 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, // 鍏ㄥ眬鎼滅储鏉′欢 } @@ -122,7 +122,14 @@ * @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) { @@ -154,44 +161,42 @@ } 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} /> @@ -200,103 +205,109 @@ } 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 { diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 36170d3..893c5c0 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -18,7 +18,6 @@ class EditableTable extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 } @@ -48,12 +47,23 @@ * 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 diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 62cefcd..cf98e01 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -20,7 +20,6 @@ class NormalTable extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -50,12 +49,24 @@ * 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(',') diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx index a5159a1..483549b 100644 --- a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx +++ b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx @@ -13,32 +13,45 @@ 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 }) } @@ -72,13 +85,7 @@ } 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) { @@ -131,8 +138,8 @@ } 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 @@ -141,7 +148,7 @@ <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> diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index c4a13c7..51dcbef 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -15,7 +15,6 @@ class NormalTimeline extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -36,13 +35,25 @@ * 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] || [] @@ -240,10 +251,10 @@ 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 @@ -278,10 +289,33 @@ } 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, diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 9aaf9a1..6b82284 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -16,7 +16,6 @@ class NormalTree extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -37,11 +36,23 @@ } 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 diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 5b729ce..8391658 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -73,11 +73,11 @@ * @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) @@ -140,7 +140,9 @@ 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 = [] @@ -443,8 +445,9 @@ }) } - 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 @@ -526,21 +529,11 @@ } 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') { @@ -551,7 +544,7 @@ 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)) { @@ -1183,6 +1176,23 @@ } 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 = () => { @@ -1211,51 +1221,46 @@ 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') { @@ -1267,97 +1272,97 @@ } 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 { diff --git a/src/views/main/index.jsx b/src/views/main/index.jsx index 926696f..257b4b8 100644 --- a/src/views/main/index.jsx +++ b/src/views/main/index.jsx @@ -5,6 +5,7 @@ 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' @@ -20,6 +21,18 @@ 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) -- Gitblit v1.8.0