From 5232d34f026f72eb90a5ba6fff33d30cf9d961aa Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 25 十二月 2020 19:11:07 +0800 Subject: [PATCH] 2020-12-25 --- src/menu/popview/menuform/index.jsx | 38 +++++++++ src/tabviews/custom/index.jsx | 7 + src/menu/components/card/cardcomponent/settingform/index.jsx | 16 ++- src/tabviews/custom/components/card/cardItem/index.scss | 55 +++++++++++++ src/tabviews/zshare/topSearch/index.jsx | 3 src/tabviews/zshare/actionList/normalbutton/index.jsx | 9 + src/tabviews/custom/components/card/cardItem/index.jsx | 3 src/menu/popview/index.jsx | 27 ++++-- src/views/menudesign/index.jsx | 1 src/menu/components/card/cardcomponent/index.jsx | 11 ++ src/tabviews/zshare/actionList/printbutton/index.jsx | 9 + src/views/login/index.jsx | 5 - 12 files changed, 156 insertions(+), 28 deletions(-) diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 891d87f..1fb88ef 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -212,9 +212,16 @@ if (_style.shadow) { _style.boxShadow = '0 0 4px ' + _style.shadow } - + if (side === 'back') { - _style = {...card.backStyle, height: card.style.height} + _style = { + ...card.backStyle, + height: card.style.height, + marginBottom: card.style.marginBottom, + marginLeft: card.style.marginLeft, + marginRight: card.style.marginRight, + marginTop: card.style.marginTop + } } return ( diff --git a/src/menu/components/card/cardcomponent/settingform/index.jsx b/src/menu/components/card/cardcomponent/settingform/index.jsx index 6e52747..4045ba3 100644 --- a/src/menu/components/card/cardcomponent/settingform/index.jsx +++ b/src/menu/components/card/cardcomponent/settingform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Radio, Tooltip, Icon, Input, InputNumber } from 'antd' +import { Form, Row, Col, Radio, Tooltip, Icon, Input, InputNumber, Select } from 'antd' import './index.scss' @@ -101,10 +101,16 @@ {getFieldDecorator('transform', { initialValue: setting.transform || 'up' })( - <Radio.Group> - <Radio value="up">鍚戜笂婊戝姩</Radio> - <Radio value="down">鍚戜笅婊戝姩</Radio> - </Radio.Group> + <Select> + <Select.Option value="up">鍚戜笂婊戝姩</Select.Option> + <Select.Option value="down">鍚戜笅婊戝姩</Select.Option> + <Select.Option value="left">鍚戝乏婊戝姩</Select.Option> + <Select.Option value="right">鍚戝彸婊戝姩</Select.Option> + <Select.Option value="scale">缂╂斁</Select.Option> + <Select.Option value="opacity">閫忔槑搴�</Select.Option> + <Select.Option value="rotateX">绾靛悜灞曞紑</Select.Option> + <Select.Option value="rotateY">妯悜灞曞紑</Select.Option> + </Select> )} </Form.Item> </Col> : null} diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx index eb19d48..f940083 100644 --- a/src/menu/popview/index.jsx +++ b/src/menu/popview/index.jsx @@ -11,6 +11,7 @@ import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/mob.js' import enUS from '@/locales/en-US/mob.js' +import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' import { modifyCustomMenu } from '@/store/action' @@ -58,6 +59,10 @@ }) } + componentDidMount () { + MKEmitter.addListener('delButtons', this.delButtons) + } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -69,6 +74,11 @@ this.setState = () => { return } + MKEmitter.removeListener('delButtons', this.delButtons) + } + + delButtons = (items) => { + this.setState({delButtons: [...this.state.delButtons, ...items]}) } closeView = () => { @@ -98,7 +108,8 @@ } getMenuParam = () => { - const { MenuId, MenuType } = this.state + const { btn } = this.props + const { MenuId } = this.state let param = { func: 'sPC_Get_LongParam', @@ -123,18 +134,19 @@ MenuID: MenuId, Template: 'CustomPage', enabled: false, + MenuName: btn.config.MenuName + '-' + btn.label, + MenuNo: '', tables: [], components: [], + viewType: 'popview', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px' }, - MenuType: MenuType } } else { config.uuid = MenuId config.MenuID = MenuId - config.MenuType = config.MenuType || MenuType } this.setState({ @@ -225,11 +237,10 @@ } submitConfig = () => { - // const { btn } = this.props const { openEdition, delButtons } = this.state let config = fromJS(this.state.config).toJS() - if (config.cacheUseful === 'true' && !config.cacheTime) { + if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) { notification.warning({ top: 92, message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', @@ -250,9 +261,9 @@ let param = { func: 'sPC_Tab_AddUpt', MenuID: _config.uuid, - MenuNo: _config.tabNo, + MenuNo: _config.MenuNo, Template: 'CustomPage', - MenuName: _config.tabName, + MenuName: _config.MenuName, Remark: '', Sort: 0, PageParam: JSON.stringify({Template: 'CustomPage'}), @@ -265,7 +276,7 @@ let btnParam = { // 娣诲姞鑿滃崟鎸夐挳 func: 'sPC_Button_AddUpt', - Type: 40, // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60 + Type: 60, // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60 ParentID: _config.uuid, MenuNo: _config.MenuNo, Template: 'CustomPage', diff --git a/src/menu/popview/menuform/index.jsx b/src/menu/popview/menuform/index.jsx index 99bb927..e25ccd0 100644 --- a/src/menu/popview/menuform/index.jsx +++ b/src/menu/popview/menuform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Radio, Icon, Tooltip, InputNumber } from 'antd' +import { Form, Row, Col, Radio, Icon, Input, Tooltip, InputNumber } from 'antd' import './index.scss' @@ -12,6 +12,16 @@ updateConfig: PropTypes.func } + // 鑿滃崟鍚嶇О + changeName = (e) => { + this.props.updateConfig({...this.props.config, MenuName: e.target.value}) + } + + // 鑿滃崟鍙傛暟 + changeNo = (e) => { + this.props.updateConfig({...this.props.config, MenuNo: e.target.value}) + } + changeCacheDay = (val) => { if (typeof(val) !== 'number') { val = '' @@ -46,6 +56,32 @@ return ( <Form {...formItemLayout} className="custom-menu-form"> <Row> + <Col span={24}> + <Form.Item label={dict['mob.menu'] + dict['mob.name']}> + {getFieldDecorator('MenuName', { + initialValue: config.MenuName, + rules: [ + { + required: true, + message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' + } + ] + })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} + </Form.Item> + </Col> + <Col span={24}> + <Form.Item label={dict['mob.menu'] + dict['mob.param']}> + {getFieldDecorator('MenuNo', { + initialValue: config.MenuNo, + rules: [ + { + required: true, + message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' + } + ] + })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} + </Form.Item> + </Col> <Col span={24}> <Form.Item label={ <Tooltip placement="topLeft" title="瀵逛簬涓嶇粡甯告�у彉鍔ㄧ殑淇℃伅锛岀紦瀛樻暟鎹湁鍔╀簬鎻愰珮鏌ヨ鏁堢巼銆�"> diff --git a/src/tabviews/custom/components/card/cardItem/index.jsx b/src/tabviews/custom/components/card/cardItem/index.jsx index 6dbb7aa..b288055 100644 --- a/src/tabviews/custom/components/card/cardItem/index.jsx +++ b/src/tabviews/custom/components/card/cardItem/index.jsx @@ -49,6 +49,9 @@ return ( <div className="card-item-box" style={card.style}> <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements} updateStatus={this.props.updateStatus}/> + {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> + <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements} updateStatus={this.props.updateStatus}/> + </div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/cardItem/index.scss b/src/tabviews/custom/components/card/cardItem/index.scss index 1748fdd..605a96b 100644 --- a/src/tabviews/custom/components/card/cardItem/index.scss +++ b/src/tabviews/custom/components/card/cardItem/index.scss @@ -1,3 +1,58 @@ .card-item-box { + position: relative; overflow: hidden; + + .back-side { + position: absolute; + top: 0px; + left: 0px; + right: 0px; + bottom: 0px; + background-color: #ffffff; + transition: all 0.3s; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + } + .back-side.up { + transform: translate(0, 100%); + } + .back-side.down { + transform: translate(0, -100%); + } + .back-side.left { + transform: translate(100%, 0); + } + .back-side.right { + transform: translate(-100%, 0); + } + .back-side.opacity { + opacity: 0; + } + .back-side.rotateX { + transform: rotateX(90deg); + } + .back-side.rotateY { + transform: rotateY(90deg); + } + .back-side.scale { + transform: scale(0, 0); + } +} +.card-item-box:hover { + .back-side.up, .back-side.down, .back-side.left, .back-side.right { + transform: translate(0, 0); + } + .back-side.opacity { + opacity: 1; + } + .back-side.rotateX { + transform: rotateX(0deg); + } + .back-side.rotateY { + transform: rotateY(0deg); + } + .back-side.scale { + transform: scale(1, 1); + } } \ No newline at end of file diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 89ed828..57a77d4 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -242,6 +242,8 @@ if (item.action && item.action.length > 0) { item.action = item.action.filter(cell => { cell.logLabel = item.name + '-' + cell.label + cell.ContainerId = this.state.ContainerId + return permAction[cell.uuid] }) } @@ -258,15 +260,18 @@ if (cell.eleType === 'button') { cell.logLabel = item.name + '-' + cell.label cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' } + return cell.eleType !== 'button' || permAction[cell.uuid] }) card.backElements = card.backElements.filter(cell => { if (cell.eleType === 'button') { cell.logLabel = item.name + '-' + cell.label cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' } @@ -280,6 +285,7 @@ if (cell.eleType === 'button') { cell.logLabel = item.name + '-' + cell.label cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' } @@ -292,6 +298,7 @@ col.elements = col.elements.filter(cell => { cell.logLabel = item.name + '-' + cell.label cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId return permAction[cell.uuid] }) return col.elements.length !== 0 diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 35ea599..58248f3 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1100,7 +1100,7 @@ * @description 鏄剧ず妯℃�佹 */ getModels = () => { - const { setting, BID } = this.props + const { setting, BID, btn } = this.props const { btnconfig } = this.state if (!this.state.visible || !btnconfig || !btnconfig.setting) return null @@ -1110,9 +1110,12 @@ let clickouter = false let container = document.body - if (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) { + if ( + (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || + (btnconfig.setting.container === 'tab' && btn.ContainerId) + ) { width = btnconfig.setting.width + '%' - container = () => document.getElementById(this.props.ContainerId) + container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) } if (btnconfig.setting.clickouter === 'close') { diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 2e13a61..0a8b2ce 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1218,7 +1218,7 @@ * @description 鏄剧ず妯℃�佹 */ getModels = () => { - const { setting, BID } = this.props + const { setting, BID, btn } = this.props const { btnconfig } = this.state if (!this.state.visible || !btnconfig || !btnconfig.setting) return null @@ -1228,9 +1228,12 @@ let clickouter = false let container = document.body - if (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) { + if ( + (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || + (btnconfig.setting.container === 'tab' && btn.ContainerId) + ) { width = btnconfig.setting.width + '%' - container = () => document.getElementById(this.props.ContainerId) + container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) } if (btnconfig.setting.clickouter === 'close') { diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 6f1400d..6254e69 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -25,6 +25,7 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + oriId: Utils.getuuid(), // 鎼滅储琛ㄥ崟Id formId: '', // 鎼滅储琛ㄥ崟Id match: null, // 鎼滅储鏉′欢鍖归厤瑙勫垯 style: null, // 鎼滅储鏉′欢绫诲瀷 @@ -813,7 +814,7 @@ } return ( - <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId}> + <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId || this.state.oriId}> <Row gutter={24}>{this.getFields()}</Row> </Form> ) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 727768a..6f87a0d 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -106,11 +106,6 @@ localStorage.removeItem(_url) } - // if (this.props.location.state && this.props.location.state.from.pathname) { - // // 鏌ョ湅鏄惁涓哄叾浠栭〉闈㈣烦杞紝璺緞瀛樺湪鏃讹紝璺冲洖鍘熼〉闈� - // this.props.history.replace(this.props.location.state.from.pathname) - // } - let _history = sessionStorage.getItem('history') if (_history) { sessionStorage.removeItem('history') diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 26150f8..ab016ad 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -187,6 +187,7 @@ MenuNo: MenuNo, tables: [], components: [], + viewType: 'menu', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px' -- Gitblit v1.8.0