From 9e100b8804d43d9f7559cdf41b67ed7475a809b8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 18:30:58 +0800 Subject: [PATCH] 2021-04-07 --- src/menu/components/card/table-card/index.jsx | 13 - src/menu/components/share/searchcomponent/index.jsx | 13 - src/mob/modulesource/option.jsx | 8 src/menu/components/form/normal-form/index.jsx | 15 - src/menu/datasource/index.jsx | 25 -- src/menu/components/chart/antv-bar/index.jsx | 15 - src/menu/components/code/sandbox/index.jsx | 15 - src/menu/components/form/formaction/index.jsx | 24 -- src/store/action.js | 8 - src/views/mobdesign/index.jsx | 20 +- src/menu/components/carousel/data-card/index.jsx | 15 - src/views/menudesign/index.jsx | 25 -- public/index.html | 1 src/menu/components/card/cardcellcomponent/index.jsx | 17 - src/views/pcdesign/index.jsx | 21 +- src/store/reducer.js | 8 - src/menu/components/carousel/prop-card/index.jsx | 15 - src/store/action-type.js | 3 src/menu/components/card/data-card/index.jsx | 18 - src/menu/components/share/actioncomponent/index.jsx | 19 - src/menu/components/chart/antv-pie/index.jsx | 15 - src/menu/components/search/main-search/index.jsx | 12 - src/menu/components/editor/braft-editor/index.jsx | 15 - src/menu/modalconfig/index.jsx | 14 - src/menu/components/card/prop-card/index.jsx | 18 - src/menu/components/table/normal-table/index.jsx | 15 - src/menu/components/tabs/antv-tabs/index.jsx | 13 - src/menu/components/group/normal-group/index.jsx | 13 - src/menu/popview/index.jsx | 22 -- 29 files changed, 80 insertions(+), 355 deletions(-) diff --git a/public/index.html b/public/index.html index d0f220c..2e1c8b4 100644 --- a/public/index.html +++ b/public/index.html @@ -3,6 +3,7 @@ <head> <meta charset="utf-8" /> <meta name="renderer" content="webkit"> + <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> --> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> <link rel="shortcut icon" href="#"> diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 2c40550..58deb61 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import {connect} from 'react-redux' import { Modal, Button } from 'antd' import zhCN from '@/locales/zh-CN/model.js' @@ -277,7 +276,7 @@ * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { - const { menu, cards } = this.props + const { cards } = this.props let usefulFields = sessionStorage.getItem('permFuncField') if (usefulFields) { @@ -306,7 +305,7 @@ menulist = [] } - let modules = MenuUtils.getSubModules(menu.components, cards.uuid) + let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid) this.setState({ actvisible: true, @@ -707,14 +706,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(CardCellComponent) \ No newline at end of file +export default CardCellComponent \ No newline at end of file diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 1ce4fff..7b12967 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, Pagination, notification } from 'antd' @@ -42,6 +41,7 @@ const { card } = this.props if (card.isNew) { + let ismob = sessionStorage.getItem('appType') === 'mob' let _card = { uuid: card.uuid, type: card.type, @@ -66,7 +66,7 @@ btnlog: [], subcards: [{ uuid: Utils.getuuid(), - setting: { width: 6, type: 'simple'}, + setting: { width: ismob ? 24 : 6, type: 'simple'}, style: { borderWidth: '1px', borderColor: '#e8e8e8', paddingTop: '15px', paddingBottom: '15px', paddingLeft: '15px', paddingRight: '15px', @@ -129,7 +129,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -424,14 +424,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(DataCardEditComponent) \ No newline at end of file +export default DataCardEditComponent \ No newline at end of file diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx index 655f7e9..8cac50c 100644 --- a/src/menu/components/card/prop-card/index.jsx +++ b/src/menu/components/card/prop-card/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, notification } from 'antd' @@ -42,6 +41,7 @@ const { card } = this.props if (card.isNew) { + let ismob = sessionStorage.getItem('appType') === 'mob' let _card = { uuid: card.uuid, type: card.type, @@ -63,7 +63,7 @@ scripts: [], subcards: [{ uuid: Utils.getuuid(), - setting: { width: 6, type: 'simple'}, + setting: { width: ismob ? 24 : 6, type: 'simple'}, style: { borderWidth: '1px', borderColor: '#e8e8e8', paddingTop: '15px', paddingBottom: '15px', paddingLeft: '15px', paddingRight: '15px', @@ -115,7 +115,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -399,14 +399,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(PropCardEditComponent) \ No newline at end of file +export default PropCardEditComponent \ No newline at end of file diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 3e7f786..540f163 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, Pagination, notification } from 'antd' @@ -353,14 +352,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(TableCardEditComponent) \ No newline at end of file +export default TableCardEditComponent \ No newline at end of file diff --git a/src/menu/components/carousel/data-card/index.jsx b/src/menu/components/carousel/data-card/index.jsx index b96cfe1..df2cf25 100644 --- a/src/menu/components/carousel/data-card/index.jsx +++ b/src/menu/components/carousel/data-card/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, notification } from 'antd' @@ -102,7 +101,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -274,14 +273,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(DataCardEditComponent) \ No newline at end of file +export default DataCardEditComponent \ No newline at end of file diff --git a/src/menu/components/carousel/prop-card/index.jsx b/src/menu/components/carousel/prop-card/index.jsx index 2bdb7d0..b1f7abf 100644 --- a/src/menu/components/carousel/prop-card/index.jsx +++ b/src/menu/components/carousel/prop-card/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, notification, Carousel } from 'antd' @@ -101,7 +100,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -356,14 +355,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(PropCardEditComponent) \ No newline at end of file +export default PropCardEditComponent \ No newline at end of file diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index c20c65a..40cfcf1 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, notification } from 'antd' import { Chart } from '@antv/g2' @@ -128,7 +127,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -909,14 +908,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(antvBarLineChart) \ No newline at end of file +export default antvBarLineChart \ No newline at end of file diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index 98d0d70..374720a 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, notification } from 'antd' import { Chart } from '@antv/g2' @@ -112,7 +111,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -472,14 +471,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(antvBarLineChart) \ No newline at end of file +export default antvBarLineChart \ No newline at end of file diff --git a/src/menu/components/code/sandbox/index.jsx b/src/menu/components/code/sandbox/index.jsx index 33bb103..7e1fb66 100644 --- a/src/menu/components/code/sandbox/index.jsx +++ b/src/menu/components/code/sandbox/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover } from 'antd' @@ -87,7 +86,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -175,14 +174,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(CodeSandBox) \ No newline at end of file +export default CodeSandBox \ No newline at end of file diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 5774650..cf83121 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover } from 'antd' @@ -86,7 +85,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -183,14 +182,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(BraftEditorComponent) \ No newline at end of file +export default BraftEditorComponent \ No newline at end of file diff --git a/src/menu/components/form/formaction/index.jsx b/src/menu/components/form/formaction/index.jsx index ba84729..fcbdb30 100644 --- a/src/menu/components/form/formaction/index.jsx +++ b/src/menu/components/form/formaction/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { connect } from 'react-redux' import { Modal, Button, Popover, Icon } from 'antd' import zhCN from '@/locales/zh-CN/model.js' @@ -28,13 +27,6 @@ formlist: null, // 琛ㄥ崟淇℃伅 visible: false, // 妯℃�佹鎺у埗 profVisible: false, // 楠岃瘉淇℃伅缂栬緫 - } - - /** - * @description 鎼滅储鏉′欢鍒濆鍖� - */ - UNSAFE_componentWillMount () { - } componentDidMount () { @@ -88,7 +80,7 @@ * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { - const { menu, config } = this.props + const { config } = this.props let usefulFields = sessionStorage.getItem('permFuncField') if (usefulFields) { @@ -106,7 +98,7 @@ <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> </div> - let modules = MenuUtils.getSubModules(menu.components, config.uuid) + let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) this.setState({ visible: true, @@ -258,14 +250,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(CardCellComponent) \ No newline at end of file +export default CardCellComponent \ No newline at end of file diff --git a/src/menu/components/form/normal-form/index.jsx b/src/menu/components/form/normal-form/index.jsx index 07a76d1..1610711 100644 --- a/src/menu/components/form/normal-form/index.jsx +++ b/src/menu/components/form/normal-form/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, Button, Switch, notification } from 'antd' import moment from 'moment' @@ -119,7 +118,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -702,14 +701,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(PropCardEditComponent) \ No newline at end of file +export default PropCardEditComponent \ No newline at end of file diff --git a/src/menu/components/group/normal-group/index.jsx b/src/menu/components/group/normal-group/index.jsx index a10a4b0..c6021fa 100644 --- a/src/menu/components/group/normal-group/index.jsx +++ b/src/menu/components/group/normal-group/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Button } from 'antd' @@ -183,14 +182,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(NormalGroup) \ No newline at end of file +export default NormalGroup \ No newline at end of file diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index bb226a6..0ab9015 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -1,6 +1,5 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Modal, notification, Popover, Icon } from 'antd' import moment from 'moment' @@ -394,14 +393,5 @@ ) } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(MainSearchComponent) \ No newline at end of file +export default MainSearchComponent \ No newline at end of file diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 1891e05..c6964ec 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Modal, notification, Button } from 'antd' @@ -142,7 +141,7 @@ * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { - const { menu, config } = this.props + const { config } = this.props let usefulFields = sessionStorage.getItem('permFuncField') if (usefulFields) { @@ -171,7 +170,7 @@ menulist = [] } - let modules = MenuUtils.getSubModules(menu.components, config.uuid) + let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) this.setState({ visible: true, @@ -333,7 +332,7 @@ * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ */ creatFunc = () => { - const { menu } = this.props + const menu = window.GLOB.customMenu let _config = fromJS(this.props.config).toJS() this.actionFormRef.handleConfirm().then(res => { @@ -529,14 +528,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(ActionComponent) \ No newline at end of file +export default ActionComponent \ No newline at end of file diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index 49c1b19..c123995 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import {connect} from 'react-redux' import { Modal, notification } from 'antd' import moment from 'moment' @@ -319,14 +318,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(SearchComponent) \ No newline at end of file +export default SearchComponent \ No newline at end of file diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 3b8cb9b..cd1a336 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Popover, Modal, notification } from 'antd' @@ -134,7 +133,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -409,14 +408,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(TableCardEditComponent) \ No newline at end of file +export default TableCardEditComponent \ No newline at end of file diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index 01c055b..3879bea 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Tabs, Icon, Popover, Modal } from 'antd' @@ -354,14 +353,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(antvTabs) \ No newline at end of file +export default antvTabs \ No newline at end of file diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx index da1829a..9732b5a 100644 --- a/src/menu/datasource/index.jsx +++ b/src/menu/datasource/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { Icon, Modal } from 'antd' @@ -35,7 +34,7 @@ } editDataSource = () => { - const { config, menu } = this.props + const { config } = this.props let search = [] let parents = [] @@ -50,7 +49,7 @@ _conf = item if (_conf.parentId && _conf.tabId) { - getParents(menu) + getParents(tab) } } else { getParents(tab) @@ -60,10 +59,10 @@ } if (config.parentId && config.tabId) { - getParents(menu) + getParents(window.GLOB.customMenu) } - parents.unshift(menu) + parents.unshift(window.GLOB.customMenu) parents.forEach(parent => { parent.components.forEach(item => { @@ -110,7 +109,7 @@ } render () { - const { config, menu } = this.props + const { config } = this.props const { visible, dict, loading, mainSearch } = this.state return ( @@ -130,7 +129,7 @@ > <VerifyCard dict={dict} - menu={menu} + menu={window.GLOB.customMenu} mainSearch={mainSearch} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} @@ -141,14 +140,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(DataSource) \ No newline at end of file +export default DataSource \ No newline at end of file diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index ed4bc4e..6f3cd48 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { DndProvider } from 'react-dnd' import HTML5Backend from 'react-dnd-html5-backend' @@ -35,7 +34,6 @@ } state = { - menu: null, // 涓婄骇鑿滃崟锛屼笁绾ц彍鍗曟垨鏍囩 dict: CommonDict, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛� visible: false, // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒� @@ -522,14 +520,4 @@ } } -const mapStateToProps = (state) => { - return { - menu: state.customMenu - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(ComModalConfig) \ No newline at end of file +export default ComModalConfig \ No newline at end of file diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx index 58cf8cb..59da6e1 100644 --- a/src/menu/popview/index.jsx +++ b/src/menu/popview/index.jsx @@ -1,6 +1,5 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { connect } from 'react-redux' import { DndProvider } from 'react-dnd' import { is, fromJS } from 'immutable' import moment from 'moment' @@ -13,7 +12,6 @@ import enUS from '@/locales/en-US/mob.js' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' -import { modifyCustomMenu } from '@/store/action' import './index.scss' @@ -217,7 +215,7 @@ config: fromJS(config).toJS() }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } else { notification.warning({ top: 92, @@ -526,7 +524,7 @@ config: config }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } /** @@ -535,7 +533,7 @@ updatetable = (config) => { this.setState({ config }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } insert = (item) => { @@ -544,7 +542,7 @@ config.components.push(item) this.setState({config}) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } render () { @@ -599,14 +597,4 @@ } } -const mapStateToProps = () => { - return {} -} - -const mapDispatchToProps = (dispatch) => { - return { - modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign) \ No newline at end of file +export default MenuDesign \ No newline at end of file diff --git a/src/mob/modulesource/option.jsx b/src/mob/modulesource/option.jsx index 7fa85b7..6260773 100644 --- a/src/mob/modulesource/option.jsx +++ b/src/mob/modulesource/option.jsx @@ -29,14 +29,14 @@ { type: 'menu', url: Carousel, component: 'carousel', subtype: 'datacard', title: '杞挱-鍔ㄦ�佹暟鎹�', width: 24 }, { type: 'menu', url: Carousel1, component: 'carousel', subtype: 'propcard', title: '杞挱-闈欐�佹暟鎹�', width: 24 }, { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 }, - { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '琛ㄦ牸', width: 12 }, + { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '琛ㄦ牸', width: 24 }, { type: 'menu', url: line, component: 'line', subtype: 'line', title: '鎶樼嚎鍥�', width: 24 }, { type: 'menu', url: line1, component: 'line', subtype: 'line1', title: '闃舵鎶樼嚎鍥�', width: 24 }, { type: 'menu', url: bar, component: 'bar', subtype: 'bar', title: '鏌辩姸鍥�', width: 24 }, { type: 'menu', url: bar1, component: 'bar', subtype: 'bar1', title: '鏉″舰鍥�', width: 24 }, - { type: 'menu', url: Pie, component: 'pie', subtype: 'pie', title: '楗煎浘', width: 12 }, - { type: 'menu', url: Pie1, component: 'pie', subtype: 'ring', title: '鐜浘', width: 12 }, + { type: 'menu', url: Pie, component: 'pie', subtype: 'pie', title: '楗煎浘', width: 24 }, + { type: 'menu', url: Pie1, component: 'pie', subtype: 'ring', title: '鐜浘', width: 24 }, { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 }, - { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '鍗椾竵鏍煎皵鍥�', width: 12 }, + { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '鍗椾竵鏍煎皵鍥�', width: 24 }, { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '鍒嗙粍', width: 24 }, ] diff --git a/src/store/action-type.js b/src/store/action-type.js index 6db6bc7..a63129f 100644 --- a/src/store/action-type.js +++ b/src/store/action-type.js @@ -28,8 +28,5 @@ // 淇敼浼氬憳绛夌骇 export const MODIFY_MEMBERLEVEL = 'MODIFY_MEMBERLEVEL' -// 淇敼鑷畾涔夎彍鍗� -export const MODIFY_CUSTOMMENU = 'MODIFY_CUSTOMMENU' - // 閫�鍑� export const LOGOUT = 'LOGOUT' \ No newline at end of file diff --git a/src/store/action.js b/src/store/action.js index c72bc06..37d29d0 100644 --- a/src/store/action.js +++ b/src/store/action.js @@ -72,14 +72,6 @@ } } -// 淇敼鑷畾涔夎彍鍗� -export const modifyCustomMenu = (customMenu) => { - return { - type: user.MODIFY_CUSTOMMENU, - customMenu: customMenu - } -} - // 閫�鍑洪噸缃� export const logout = () => { return { diff --git a/src/store/reducer.js b/src/store/reducer.js index 59c15ec..40d35ee 100644 --- a/src/store/reducer.js +++ b/src/store/reducer.js @@ -31,7 +31,6 @@ permAction: {}, // 鐢ㄦ埛鎸夐挳鏉冮檺 permMenus: [], // 鐢ㄦ埛涓夌骇鑿滃崟鍒楄〃 memberLevel: _level, // 浼氬憳绛夌骇 - customMenu: null // 缂栬緫涓殑鑿滃崟锛堣嚜瀹氫箟椤甸潰锛� } // 鐢ㄦ埛娑堟伅 @@ -91,12 +90,6 @@ ...state, memberLevel: action.memberLevel } - case Type.MODIFY_CUSTOMMENU: - // 淇敼鑷畾涔夎彍鍗曚俊鎭� - return { - ...state, - customMenu: action.customMenu - } case Type.LOGOUT: return { menuTree: null, @@ -107,7 +100,6 @@ editLevel: null, permAction: {}, permMenus: [], - customMenu: null } default: return state diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 9324a82..84cee4d 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -1,5 +1,4 @@ import React, { Component } from 'react' -import { connect } from 'react-redux' import { DndProvider } from 'react-dnd' import { is, fromJS } from 'immutable' import moment from 'moment' @@ -17,7 +16,6 @@ import MKEmitter from '@/utils/events.js' import MenuUtils from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' -import { modifyCustomMenu } from '@/store/action' import './index.scss' @@ -49,6 +47,7 @@ document.body.className = '' window.GLOB.UserComponentMap = new Map() // 缂撳瓨鐢ㄦ埛鑷畾涔夌粍浠� window.GLOB.urlFields = [] // url鍙橀噺 +window.GLOB.customMenu = null // 淇濆瓨鑿滃崟淇℃伅 class MenuDesign extends Component { state = { @@ -248,7 +247,7 @@ handleBack = () => { this.setState({popBtn: null, delButtons: [], copyButtons: []}, () => { sessionStorage.setItem('editMenuType', 'menu') - this.props.modifyCustomMenu(this.state.config) + window.GLOB.customMenu = this.state.config this.setState({visible: false}) }) } @@ -342,8 +341,7 @@ oriConfig: config, config: fromJS(config).toJS() }) - - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } else { notification.warning({ top: 92, @@ -868,8 +866,7 @@ this.setState({ config: config }) - - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } insert = (item) => { @@ -878,7 +875,7 @@ config.components.push(item) this.setState({config}) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } render () { @@ -965,14 +962,4 @@ } } -const mapStateToProps = () => { - return {} -} - -const mapDispatchToProps = (dispatch) => { - return { - modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign) \ No newline at end of file +export default MenuDesign \ No newline at end of file diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 63d48bd..677496a 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -16,7 +16,6 @@ import MKEmitter from '@/utils/events.js' import MenuUtils from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' -import { modifyCustomMenu } from '@/store/action' import './index.scss' @@ -46,6 +45,7 @@ window.GLOB.UserComponentMap = new Map() // 缂撳瓨鐢ㄦ埛鑷畾涔夌粍浠� window.GLOB.CacheIndependent = new Map() window.GLOB.urlFields = [] // url鍙橀噺 +window.GLOB.customMenu = null // 淇濆瓨鑿滃崟淇℃伅 class MobDesign extends Component { state = { @@ -445,8 +445,7 @@ config: fromJS(config).toJS(), loading: false }) - - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } else { this.jointComponents(config, indeComs, isCreate) } @@ -561,7 +560,7 @@ loading: false }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } else { this.jointComponents(config, indeComs, true) } @@ -636,8 +635,7 @@ config: config, loading: false }) - - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config }) } @@ -1280,7 +1278,7 @@ config: config }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } insert = (item) => { @@ -1289,7 +1287,7 @@ config.components.push(item) this.setState({config}) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } refreshView = () => { @@ -1448,10 +1446,8 @@ } } -const mapDispatchToProps = (dispatch) => { - return { - modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) - } +const mapDispatchToProps = () => { + return {} } export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MobDesign)) \ No newline at end of file diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index c814a3f..29818ec 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -16,7 +16,6 @@ import MKEmitter from '@/utils/events.js' import MenuUtils from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' -import { modifyCustomMenu } from '@/store/action' import './index.scss' @@ -45,6 +44,7 @@ window.GLOB.UserComponentMap = new Map() // 缂撳瓨鐢ㄦ埛鑷畾涔夌粍浠� window.GLOB.CacheIndependent = new Map() window.GLOB.urlFields = [] // url鍙橀噺 +window.GLOB.customMenu = null // 淇濆瓨鑿滃崟淇℃伅 class MenuDesign extends Component { state = { @@ -469,8 +469,8 @@ config: fromJS(config).toJS(), loading: false }) - - this.props.modifyCustomMenu(config) + + window.GLOB.customMenu = config } else { this.jointComponents(config, indeComs, isCreate) } @@ -584,8 +584,7 @@ config: fromJS(config).toJS(), loading: false }) - - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } else { this.jointComponents(config, indeComs, true) } @@ -661,7 +660,7 @@ loading: false }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config }) } @@ -1306,7 +1305,7 @@ config: config }) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } insert = (item) => { @@ -1315,7 +1314,7 @@ config.components.push(item) this.setState({config}) - this.props.modifyCustomMenu(config) + window.GLOB.customMenu = config } refreshView = () => { @@ -1479,10 +1478,8 @@ } } -const mapDispatchToProps = (dispatch) => { - return { - modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) - } +const mapDispatchToProps = () => { + return {} } export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MenuDesign)) \ No newline at end of file -- Gitblit v1.8.0