From f497f734966504bd8a7e98bf602da582a53d91e5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 12 九月 2021 02:55:59 +0800 Subject: [PATCH] 2021-09-12 --- src/mob/components/navbar/normal-navbar/index.jsx | 2 src/menu/components/card/table-card/index.jsx | 68 ++++ src/tabviews/zshare/actionList/popupbutton/index.jsx | 6 src/tabviews/custom/components/card/cardItem/index.jsx | 94 ++++++ src/views/menudesign/homeform/index.jsx | 14 src/tabviews/zshare/actionList/excelInbutton/index.jsx | 6 src/views/menudesign/menuform/index.jsx | 15 + src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 6 src/menu/components/card/cardsimplecomponent/options.jsx | 98 ++++++ src/tabviews/custom/components/carousel/data-card/index.jsx | 15 src/tabviews/zshare/actionList/newpagebutton/index.jsx | 6 src/tabviews/zshare/actionList/normalbutton/index.jsx | 8 src/tabviews/custom/components/card/data-card/index.scss | 24 - src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 8 src/tabviews/custom/components/card/data-card/index.jsx | 113 ------ src/mob/searchconfig/groupdragelement/index.scss | 1 src/tabviews/custom/components/card/prop-card/index.scss | 24 - src/tabviews/custom/components/card/table-card/index.jsx | 90 +++++ src/tabviews/custom/components/card/prop-card/index.jsx | 110 ------ src/tabviews/zshare/actionList/tabbutton/index.jsx | 6 src/menu/components/share/actioncomponent/formconfig.jsx | 25 + src/menu/components/card/cardcomponent/index.jsx | 49 +++ src/tabviews/zshare/actionList/printbutton/index.jsx | 6 src/menu/components/card/cardsimplecomponent/index.jsx | 17 src/menu/components/share/actioncomponent/actionform/index.jsx | 20 + src/tabviews/custom/components/carousel/prop-card/index.jsx | 15 src/tabviews/custom/index.jsx | 19 src/menu/components/card/cardcomponent/options.jsx | 11 28 files changed, 518 insertions(+), 358 deletions(-) diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index e2adfc7..f2db083 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -30,7 +30,8 @@ card: null, // 鍗$墖淇℃伅锛屽寘鎷鍙嶉潰 formlist: null, // 璁剧疆琛ㄥ崟淇℃伅 elements: null, // 缂栬緫缁� - side: 'front' + side: 'front', + appType: sessionStorage.getItem('appType') } /** @@ -170,13 +171,53 @@ getSettingForms = () => { const { cards } = this.props - const { setting } = this.state.card + const { card, appType } = this.state - return getSettingForm(setting, cards.subtype === 'propcard') + let buttons = [] + card.elements && card.elements.forEach(item => { + if (item.eleType === 'button') { + buttons.push({ + value: item.uuid, + label: item.label + }) + } + }) + if (appType !== 'mob' && card.backElements) { + card.backElements.forEach(item => { + if (item.eleType === 'button') { + buttons.push({ + value: item.uuid, + label: item.label + }) + } + }) + } + + return getSettingForm(card.setting, cards.subtype === 'propcard', buttons) } updateSetting = (res) => { - const { card, side } = this.state + const { card, side, appType } = this.state + + if (appType === '' && res.menu) { + let list = null + try { + list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] + } catch (e) { + list = [] + } + + let id = res.menu[res.menu.length - 1] + + list.forEach(item => { + if (item.MenuID === id) { + res.MenuID = id + res.MenuName = item.MenuName + res.MenuNo = item.MenuNo + res.tabType = item.type + } + }) + } this.setState({ card: {...card, setting: res} diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx index ec3a3ce..c59147a 100644 --- a/src/menu/components/card/cardcomponent/options.jsx +++ b/src/menu/components/card/cardcomponent/options.jsx @@ -1,7 +1,7 @@ /** * @description Setting琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (setting, hasPrimaryKey) { +export default function (setting, hasPrimaryKey, buttons = []) { let appType = sessionStorage.getItem('appType') let menulist = [] @@ -104,6 +104,7 @@ {field: 'linkurl', values: ['link']}, {field: 'open', values: ['menu', 'link']}, {field: 'joint', values: ['menu', 'link']}, + {field: 'linkbtn', values: ['button']}, ] }, { @@ -146,6 +147,14 @@ {value: 'false', label: '鍚�'}, ], }, + { + type: 'select', + field: 'linkbtn', + label: '鍏宠仈鎸夐挳', + initval: setting.linkbtn || '', + required: true, + options: buttons + } ] return cardSettingForm diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx index cdda53a..ab3fc00 100644 --- a/src/menu/components/card/cardsimplecomponent/index.jsx +++ b/src/menu/components/card/cardsimplecomponent/index.jsx @@ -134,12 +134,21 @@ getSettingForms = () => { const { cards } = this.props - const { setting } = this.state.card + const { card } = this.state if (cards.type !== 'carousel') { - return getTableSetting(setting, cards.columns) + let buttons = [] + card.elements && card.elements.forEach(item => { + if (item.eleType === 'button') { + buttons.push({ + value: item.uuid, + label: item.label + }) + } + }) + return getTableSetting(card.setting, cards.columns, buttons) } else { - return getCarouselSetting(setting, cards.subtype === 'propcard') + return getCarouselSetting(card.setting, cards.subtype === 'propcard') } } @@ -173,7 +182,7 @@ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} type="plus" /> <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> - <NormalForm title="鍗$墖璁剧疆" width={700} update={this.updateSetting} getForms={this.getSettingForms}> + <NormalForm title="鍗$墖璁剧疆" width={800} update={this.updateSetting} getForms={this.getSettingForms}> <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="cardcell" card={card}/> diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx index 3337cc2..6c649dd 100644 --- a/src/menu/components/card/cardsimplecomponent/options.jsx +++ b/src/menu/components/card/cardsimplecomponent/options.jsx @@ -1,9 +1,36 @@ /** * @description tablecard setting琛ㄥ崟閰嶇疆淇℃伅 */ -export function getTableSetting (setting, columns) { +export function getTableSetting (setting, columns, buttons = []) { let _columns = columns.map(item => ({value: item.field, label: item.label})) _columns.push({value: '$Index', label: '搴忓彿锛堝墠绔級'}) + let appType = sessionStorage.getItem('appType') + let menulist = [] + let appmenulist = [] + + if (appType) { + appmenulist = sessionStorage.getItem('appMenus') + if (appmenulist) { + try { + appmenulist = JSON.parse(appmenulist) + } catch (e) { + appmenulist = [] + } + } else { + appmenulist = [] + } + } else { + menulist = sessionStorage.getItem('fstMenuList') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] + } + } else { + menulist = [] + } + } const settingForm = [ { @@ -50,6 +77,75 @@ label: '瀵规瘮鍊�', initval: setting.controlValue || '', required: false + }, + { + type: 'radio', + field: 'click', + label: '鐐瑰嚮浜嬩欢', + initval: setting.click || '', + tooltip: '褰撻�夋嫨瑙﹀彂鎸夐挳鏃讹紝鍙湁褰撳崱鐗囦腑鍙瓨鍦ㄤ竴涓寜閽椂鏈夋晥銆�', + required: false, + options: [ + {value: '', label: '鏃�'}, + {value: 'menu', label: '鑿滃崟'}, + {value: 'link', label: '閾炬帴'}, + {value: 'button', label: '鎸夐挳'}, + ], + controlFields: [ + {field: 'menu', values: ['menu']}, + {field: 'linkurl', values: ['link']}, + {field: 'open', values: ['menu', 'link']}, + {field: 'joint', values: ['menu', 'link']}, + {field: 'linkbtn', values: ['button']}, + ] + }, + { + type: 'radio', + field: 'joint', + label: '鍙傛暟鎷兼帴', + initval: setting.joint || 'true', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + }, + { + type: appType ? 'select' : 'cascader', + field: 'menu', + label: '鍏宠仈鑿滃崟', + initval: setting.menu || (appType ? '' : []), + required: true, + options: appType ? appmenulist : menulist, + }, + { + type: 'textarea', + field: 'linkurl', + label: '閾炬帴', + initval: setting.linkurl || '', + required: true, + options: [], + span: 24 + }, + { + type: 'radio', + field: 'open', + label: '鎵撳紑鏂瑰紡', + initval: setting.open || 'blank', + required: false, + options: [ + {value: 'blank', label: '鏂扮獥鍙�'}, + {value: 'self', label: '褰撳墠绐楀彛'}, + ], + forbid: appType !== 'pc' + }, + { + type: 'select', + field: 'linkbtn', + label: '鍏宠仈鎸夐挳', + initval: setting.linkbtn || '', + required: true, + options: buttons } ] diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 8f41080..4c49738 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -22,6 +22,7 @@ const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) +const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) const { confirm } = Modal @@ -71,6 +72,7 @@ }, elements: [] }], + action: [], btnlog: [], } @@ -94,14 +96,24 @@ col.uuid = Utils.getuuid() return col }) + if (config.action) { + _card.action = config.action.map(col => { + col.uuid = Utils.getuuid() + return col + }) + } } this.setState({ card: _card }) this.props.updateConfig(_card) } else { + let _card = fromJS(card).toJS() + if (!_card.action) { + _card.action = [] + } this.setState({ - card: fromJS(card).toJS() + card: _card }) } } @@ -443,6 +455,58 @@ } } + addButton = (copy) => { + const { card } = this.state + + let newcard = {} + + if (copy) { + newcard = copy + newcard.focus = true + } else { + newcard.uuid = Utils.getuuid() + newcard.focus = true + + newcard.label = 'label' + newcard.Ot = 'requiredSgl' + newcard.OpenType = 'pop' + newcard.icon = '' + newcard.class = 'green' + newcard.intertype = card.setting.interType || 'system' + newcard.innerFunc = card.setting.innerFunc || '' + newcard.sysInterface = card.setting.sysInterface || '' + newcard.outerFunc = card.setting.outerFunc || '' + newcard.interface = card.setting.interface || '' + newcard.execSuccess = 'grid' + newcard.execError = 'never' + newcard.verify = null + newcard.show = 'button' + newcard.style = {marginRight: '15px'} + } + + // 娉ㄥ唽浜嬩欢-娣诲姞鎸夐挳 + MKEmitter.emit('addButton', card.uuid, newcard) + } + + setSubConfig = (item) => { + const { card, appType } = this.state + let btn = fromJS(item).toJS() + + if (btn.OpenType === 'pop' || btn.execMode === 'pop') { + if (!btn.modal) { + btn.modal = { + setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, + tables: [], + groups: [], + fields: [] + } + } + MKEmitter.emit('changeModal', card, btn) + } else if (btn.OpenType === 'popview' && appType !== 'mob') { + MKEmitter.emit('changePopview', card, btn) + } + } + clickComponent = (e) => { if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { e.stopPropagation() @@ -461,6 +525,7 @@ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鍗$墖" onClick={() => this.addCard()} type="plus" /> {appType !== 'mob' ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={() => this.addSearch()} type="plus-circle" /> : null} + <Icon className="plus" title="娣诲姞鎸夐挳" onClick={() => this.addButton()} type="plus-square" /> <NormalForm title="琛ㄦ牸璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> @@ -475,6 +540,7 @@ } trigger="hover"> <Icon type="tool" /> </Popover> + <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> <div style={{minHeight: 'calc(100% - 90px)'}}> {card.subcards.map(subcard => (<CardSimpleComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))} </div> diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index c5ebebb..45c9cec 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -10,9 +10,9 @@ const { TextArea } = Input const MkIcon = asyncComponent(() => import('@/components/mkIcon')) const actionTypeOptions = { - pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], - prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], - exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output'], + pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], + prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], + exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'], excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'], excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'], popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'], @@ -620,7 +620,12 @@ } else if (item.type === 'cascader') { // 澶氶�� fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> {getFieldDecorator(item.key, { initialValue: item.initVal || [], rules: [ @@ -656,7 +661,12 @@ } else if (item.type === 'mcascader') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> {getFieldDecorator(item.key, { initialValue: item.initVal })( diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index d55d7ec..59cc710 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -341,15 +341,6 @@ options: menulist }, { - type: 'cascader', - key: 'refreshTab', - label: '鍒锋柊鏍囩', - initVal: card.refreshTab || [], - required: false, - forbid: isApp, - options: menulist - }, - { type: 'select', key: 'execSuccess', label: Formdict['model.form.afterSuccess'], @@ -365,6 +356,9 @@ }, { value: 'mainline', text: '鍒锋柊涓婄骇缁勪欢 - 琛�' + }, { + value: 'closetab', + text: '鍏抽棴鏍囩' }, ...refresh] }, @@ -534,12 +528,23 @@ { type: 'mcascader', key: 'syncComponent', - label: '鍚屾鍒锋柊', + label: '鍒锋柊缁勪欢', initVal: card.syncComponent || [], + tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢', required: false, options: modules }, { + type: 'cascader', + key: 'refreshTab', + label: '鍒锋柊鏍囩', + initVal: card.refreshTab || [], + tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鏍囩', + required: false, + forbid: isApp, + options: menulist + }, + { type: 'select', key: 'controlField', label: '鎺у埗瀛楁', diff --git a/src/mob/components/navbar/normal-navbar/index.jsx b/src/mob/components/navbar/normal-navbar/index.jsx index 38a8d71..21cf498 100644 --- a/src/mob/components/navbar/normal-navbar/index.jsx +++ b/src/mob/components/navbar/normal-navbar/index.jsx @@ -44,7 +44,7 @@ subtype: card.subtype, setting: { interType: 'system' }, wrap: { name: card.name, datatype: 'static', height: 50 }, - style: {borderTopColor: '#bcbcbc', borderTopWidth: '1px', paddingTop: '5px', fontSize: '13px' }, + style: {boxShadow: '0 0 3px #D9D9D9', shadowColor: '#D9D9D9', shadowBlur: '3px', paddingTop: '5px', fontSize: '13px' }, menus: [], columns: [], scripts: [], diff --git a/src/mob/searchconfig/groupdragelement/index.scss b/src/mob/searchconfig/groupdragelement/index.scss index 068d8d6..bf9d07a 100644 --- a/src/mob/searchconfig/groupdragelement/index.scss +++ b/src/mob/searchconfig/groupdragelement/index.scss @@ -2,6 +2,7 @@ .modal-search-groups-row { min-height: 20px!important; padding-right: 30px; + padding-left: 20px; margin-bottom: 15px; .page-card { float: left; diff --git a/src/tabviews/custom/components/card/cardItem/index.jsx b/src/tabviews/custom/components/card/cardItem/index.jsx index 044bc4e..f4d35ad 100644 --- a/src/tabviews/custom/components/card/cardItem/index.jsx +++ b/src/tabviews/custom/components/card/cardItem/index.jsx @@ -1,8 +1,12 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' +import { connect } from 'react-redux' import { is, fromJS } from 'immutable' +import { notification } from 'antd' import asyncComponent from '@/utils/asyncComponent' +import { modifyTabview } from '@/store/action' +import MKEmitter from '@/utils/events.js' import './index.scss' const CardCellComponent = asyncComponent(() => import('../cardcellList')) @@ -38,11 +42,84 @@ } } + openView = () => { + const { card, data } = this.props + + if (card.setting.click === 'menu') { + let menu = null + + if (card.setting.MenuID) { + menu = { + MenuID: card.setting.MenuID, + MenuName: card.setting.MenuName, + MenuNo: card.setting.MenuNo, + type: card.setting.tabType + } + } else if (card.setting.menu && card.setting.menu.length > 0) { + let menu_id = card.setting.menu.slice(-1)[0] + menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' + + if (!menu) { + notification.warning({ + top: 92, + message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', + duration: 5 + }) + return + } + } + + let newtab = { + ...menu, + selected: true, + param: {} + } + + if (card.setting.joint === 'true') { + newtab.param.$BID = data.$$uuid || '' + } + + if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { + this.props.modifyTabview([newtab]) + } else { + let tabs = this.props.tabviews.filter((tab, i) => { + tab.selected = false + return tab.MenuID !== newtab.MenuID + }) + + if (this.props.tabviews.length > tabs.length) { + this.props.modifyTabview(fromJS(tabs).toJS()) + } + + this.setState({}, () => { + tabs.push(newtab) + this.props.modifyTabview(tabs) + }) + } + } else if (card.setting.click === 'link') { + let src = card.setting.linkurl + + if (card.setting.joint === 'true') { + let con = '?' + + if (/\?/ig.test(src)) { + con = '&' + } + + src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` + } + + window.open(src) + } else if (card.setting.click === 'button' && card.setting.linkbtn) { + MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data]) + } + } + render() { const { card, data, cards } = this.props return ( - <div className="card-item-box" style={card.style}> + <div className="card-item-box" style={card.style} onClick={this.openView}> <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements}/> {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements}/> @@ -52,4 +129,17 @@ } } -export default CardBoxComponent \ No newline at end of file +const mapStateToProps = (state) => { + return { + permMenus: state.permMenus, + tabviews: state.tabviews, + } +} + +const mapDispatchToProps = (dispatch) => { + return { + modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) + } +} + +export default connect(mapStateToProps, mapDispatchToProps)(CardBoxComponent) \ No newline at end of file diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 704d0d3..33aaad5 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/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 { Spin, Empty, notification, message, Row, Col, Pagination } from 'antd' import Api from '@/api' @@ -11,7 +10,6 @@ import nextImg from '@/assets/img/next.png' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' -import { modifyTabview } from '@/store/action' import './index.scss' const CardItem = asyncComponent(() => import('../cardItem')) @@ -55,12 +53,15 @@ let nextcards = [] _config.subcards.forEach(item => { - item.setting.$click = '' - if (item.setting.click === 'button') { - if (item.elements.filter(ele => ele.eleType === 'button').length < 2) { - item.setting.$click = ' trigger-button' + if (item.setting.click === 'button' && !item.setting.linkbtn) { + item.elements.forEach(ele => { + if (ele.eleType === 'button') { + item.setting.linkbtn = ele.uuid + } + }) + if (!item.setting.linkbtn) { + item.setting.click = '' } - item.setting.click = '' } if (item.$cardType !== 'extendCard') { @@ -546,8 +547,6 @@ changeCard = (index, item) => { const { config, selectKeys, selectedData, activeKey, data } = this.state - this.openView(item) - if (!config.wrap.cardType) return let _selectKeys = [] @@ -586,83 +585,6 @@ MKEmitter.emit('resetSelectLine', config.uuid, (_item ? _item.$$uuid : ''), _item) if (config.setting.$hasSyncModule) { MKEmitter.emit('syncBalconyData', config.uuid, _selectedData, data.length === _selectedData.length) - } - } - - openView = (item) => { - const { card } = this.state - - if (card.setting.click === 'menu') { - let menu = null - - if (card.setting.menu && card.setting.menu.length > 0) { - let menu_id = card.setting.menu.slice(-1)[0] - menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' - } - - if (!menu) { - notification.warning({ - top: 92, - message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', - duration: 5 - }) - return - } - - let newtab = { - ...menu, - selected: true, - param: {} - } - - if (card.setting.joint === 'true') { - newtab.param.$BID = item.$$uuid - } - - if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { - this.props.modifyTabview([newtab]) - } else { - let tabs = this.props.tabviews.filter((tab, i) => { - tab.selected = false - return tab.MenuID !== newtab.MenuID - }) - - if (this.props.tabviews.length > tabs.length) { - this.props.modifyTabview(fromJS(tabs).toJS()) - } - - this.setState({}, () => { - tabs.push(newtab) - this.props.modifyTabview(tabs) - }) - } - } else if (card.setting.click === 'link') { - let src = card.setting.linkurl - - if (src.indexOf('paramsmain/') > -1) { - try { - let _url = src.split('paramsmain/')[0] + 'paramsmain/' - let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) - - _param.UserID = sessionStorage.getItem('UserID') - _param.LoginUID = sessionStorage.getItem('LoginUID') - _param.User_Name = sessionStorage.getItem('User_Name') - _param.param = { BID: item.$$uuid } - src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - } catch (e) { - console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�') - } - } else if (card.setting.joint === 'true') { - let con = '?' - - if (/\?/ig.test(src)) { - con = '&' - } - - src = src + `${con}id=${item.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` - } - - window.open(src) } } @@ -711,17 +633,17 @@ <Row className="card-row-list"> {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null} {precards.map((item, index) => ( - <Col key={'pre' + index} className={'extend-card ' + item.setting.$click} span={item.setting.width || 6}> + <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> </Col> ))} {data && data.map((item, index) => ( - <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> + <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.click ? ' pointer' : '')} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> <CardItem card={card} cards={config} data={item}/> </Col> ))} {nextcards.map((item, index) => ( - <Col key={'next' + index} className={'extend-card ' + item.setting.$click} span={item.setting.width || 6}> + <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> </Col> ))} @@ -735,17 +657,6 @@ } } -const mapStateToProps = (state) => { - return { - permMenus: state.permMenus, - tabviews: state.tabviews, - } -} -const mapDispatchToProps = (dispatch) => { - return { - modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) - } -} -export default connect(mapStateToProps, mapDispatchToProps)(DataCard) \ No newline at end of file +export default DataCard \ No newline at end of file diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss index e01ac8d..ade4d8b 100644 --- a/src/tabviews/custom/components/card/data-card/index.scss +++ b/src/tabviews/custom/components/card/data-card/index.scss @@ -127,30 +127,6 @@ padding: 10px; text-align: right; } - .trigger-button { - .card-item-box { - .card-cell-list { - position: unset; - .mk-cell-btn { - position: unset; - .ant-btn { - position: unset; - } - .ant-btn::after { - content: ' '; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 2; - opacity: 0; - cursor: pointer; - } - } - } - } - } } .custom-card-box::after { diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index db60d7e..804c540 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/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 { Spin, notification, Col, Row } from 'antd' import moment from 'moment' @@ -10,7 +9,6 @@ import UtilsDM from '@/utils/utils-datamanage.js' import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' -import { modifyTabview } from '@/store/action' import './index.scss' const CardItem = asyncComponent(() => import('../cardItem')) @@ -74,12 +72,15 @@ let _width = 0 _config.subcards.forEach(card => { - card.setting.$click = '' - if (card.setting.click === 'button') { - if (card.elements.filter(ele => ele.eleType === 'button').length < 2) { - card.setting.$click = ' trigger-button' + if (card.setting.click === 'button' && !card.setting.linkbtn) { + card.elements.forEach(ele => { + if (ele.eleType === 'button') { + card.setting.linkbtn = ele.uuid + } + }) + if (!card.setting.linkbtn) { + card.setting.click = '' } - card.setting.click = '' } _width += card.setting.width card.elements = card.elements.map(item => { @@ -334,8 +335,6 @@ changeCard = (index, item) => { const { config, data, activeKey } = this.state - this.openView(item) - if (!config.wrap.cardType || activeKey === index) return this.setState({ @@ -344,82 +343,6 @@ MKEmitter.emit('resetSelectLine', config.uuid, (item.setting.primaryId || ''), data) } - - openView = (item) => { - if (item.setting.click === 'menu') { - let menu = null - - if (item.setting.menu && item.setting.menu.length > 0) { - let menu_id = item.setting.menu.slice(-1)[0] - menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' - } - - if (!menu) { - notification.warning({ - top: 92, - message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', - duration: 5 - }) - return - } - - let newtab = { - ...menu, - selected: true, - param: {} - } - - if (item.setting.joint === 'true') { - newtab.param.$BID = item.setting.primaryId || '' - } - - if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { - this.props.modifyTabview([newtab]) - } else { - let tabs = this.props.tabviews.filter((tab, i) => { - tab.selected = false - return tab.MenuID !== newtab.MenuID - }) - - if (this.props.tabviews.length > tabs.length) { - this.props.modifyTabview(fromJS(tabs).toJS()) - } - - this.setState({}, () => { - tabs.push(newtab) - this.props.modifyTabview(tabs) - }) - } - } else if (item.setting.click === 'link') { - let src = item.setting.linkurl - - if (src.indexOf('paramsmain/') > -1) { - try { - let _url = src.split('paramsmain/')[0] + 'paramsmain/' - let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) - - _param.UserID = sessionStorage.getItem('UserID') - _param.LoginUID = sessionStorage.getItem('LoginUID') - _param.User_Name = sessionStorage.getItem('User_Name') - _param.param = { BID: item.setting.primaryId } - src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - } catch (e) { - console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�') - } - } else if (item.setting.joint === 'true') { - let con = '?' - - if (/\?/ig.test(src)) { - con = '&' - } - - src = src + `${con}id=${item.setting.primaryId}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` - } - - window.open(src) - } - } - render() { const { config, loading, data, activeKey } = this.state @@ -435,7 +358,7 @@ <NormalHeader config={config}/> <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> {config.subcards.map((item, index) => ( - <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '') + item.setting.$click} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> + <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> <CardItem card={item} cards={config} data={data}/> </Col> ))} @@ -445,17 +368,4 @@ } } -const mapStateToProps = (state) => { - return { - permMenus: state.permMenus, - tabviews: state.tabviews, - } -} - -const mapDispatchToProps = (dispatch) => { - return { - modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(PropCard) \ No newline at end of file +export default PropCard \ No newline at end of file diff --git a/src/tabviews/custom/components/card/prop-card/index.scss b/src/tabviews/custom/components/card/prop-card/index.scss index d1d8f34..12c5e88 100644 --- a/src/tabviews/custom/components/card/prop-card/index.scss +++ b/src/tabviews/custom/components/card/prop-card/index.scss @@ -70,30 +70,6 @@ background: #ffffff; } } - .trigger-button { - .card-item-box { - .card-cell-list { - position: unset; - .mk-cell-btn { - position: unset; - .ant-btn { - position: unset; - } - .ant-btn::after { - content: ' '; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 2; - opacity: 0; - cursor: pointer; - } - } - } - } - } } .custom-card-box::after { diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index bf19684..8008410 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -1,5 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' +import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Spin, notification, Row, Col, Empty, Pagination } from 'antd' @@ -7,6 +8,7 @@ import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' import UtilsDM from '@/utils/utils-datamanage.js' +import { modifyTabview } from '@/store/action' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -295,6 +297,77 @@ }) } + openView = (card, data) => { + if (card.setting.click === 'menu') { + let menu = null + + if (card.setting.MenuID) { + menu = { + MenuID: card.setting.MenuID, + MenuName: card.setting.MenuName, + MenuNo: card.setting.MenuNo, + type: card.setting.tabType + } + } else if (card.setting.menu && card.setting.menu.length > 0) { + let menu_id = card.setting.menu.slice(-1)[0] + menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' + + if (!menu) { + notification.warning({ + top: 92, + message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', + duration: 5 + }) + return + } + } + + let newtab = { + ...menu, + selected: true, + param: {} + } + + if (card.setting.joint === 'true') { + newtab.param.$BID = data.$$uuid || '' + } + + if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { + this.props.modifyTabview([newtab]) + } else { + let tabs = this.props.tabviews.filter((tab, i) => { + tab.selected = false + return tab.MenuID !== newtab.MenuID + }) + + if (this.props.tabviews.length > tabs.length) { + this.props.modifyTabview(fromJS(tabs).toJS()) + } + + this.setState({}, () => { + tabs.push(newtab) + this.props.modifyTabview(tabs) + }) + } + } else if (card.setting.click === 'link') { + let src = card.setting.linkurl + + if (card.setting.joint === 'true') { + let con = '?' + + if (/\?/ig.test(src)) { + con = '&' + } + + src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` + } + + window.open(src) + } else if (card.setting.click === 'button' && card.setting.linkbtn) { + MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data]) + } + } + getLines = (data) => { const { config } = this.state @@ -325,7 +398,7 @@ line.push( <Col key={index} span={24}> - <div className="card-item-box" style={item.style}> + <div className="card-item-box" style={item.style} onClick={() => {this.openView(item, data)}}> <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/> </div> </Col> @@ -368,4 +441,17 @@ } } -export default TableCard \ No newline at end of file +const mapStateToProps = (state) => { + return { + permMenus: state.permMenus, + tabviews: state.tabviews, + } +} + +const mapDispatchToProps = (dispatch) => { + return { + modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) + } +} + +export default connect(mapStateToProps, mapDispatchToProps)(TableCard) \ No newline at end of file diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 1999138..e976dcc 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -288,20 +288,7 @@ } else if (card.setting.click === 'link') { let src = card.setting.linkurl - if (src.indexOf('paramsmain/') > -1) { - try { - let _url = src.split('paramsmain/')[0] + 'paramsmain/' - let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) - - _param.UserID = sessionStorage.getItem('UserID') - _param.LoginUID = sessionStorage.getItem('LoginUID') - _param.User_Name = sessionStorage.getItem('User_Name') - _param.param = { BID: item.$$uuid } - src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - } catch (e) { - console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�') - } - } else if (card.setting.joint === 'true') { + if (card.setting.joint === 'true') { let con = '?' if (/\?/ig.test(src)) { diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 73c44cb..4020b61 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -285,20 +285,7 @@ } else if (item.setting.click === 'link') { let src = item.setting.linkurl - if (src.indexOf('paramsmain/') > -1) { - try { - let _url = src.split('paramsmain/')[0] + 'paramsmain/' - let _param = JSON.parse(window.decodeURIComponent(window.atob(src.split('paramsmain/')[1]))) - - _param.UserID = sessionStorage.getItem('UserID') - _param.LoginUID = sessionStorage.getItem('LoginUID') - _param.User_Name = sessionStorage.getItem('User_Name') - _param.param = { BID: item.setting.primaryId } - src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - } catch (e) { - console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�') - } - } else if (item.setting.joint === 'true') { + if (item.setting.joint === 'true') { let con = '?' if (/\?/ig.test(src)) { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 521c756..06c8835 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -570,13 +570,12 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } if (cell.btnstyle) { // 鍏煎 @@ -606,13 +605,12 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } if (card.btnstyle) { // 鍏煎 card.style = card.style || {} @@ -631,13 +629,12 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } if (card.btnstyle) { // 鍏煎 card.style = card.style || {} @@ -660,13 +657,12 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { cell.innerHeight = 'auto' @@ -684,15 +680,13 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } - if (card.btnstyle) { // 鍏煎 card.style = card.style || {} card.style = {...card.style, ...card.btnstyle} @@ -712,13 +706,12 @@ cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = this.props.MenuID cell.$tabId = tabId cell.$view = 'CustomPage' if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) - } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 鏍囩鍏抽棴鎸夐挳锛岄噸缃彍鍗旾d - cell.$menuId = this.props.MenuID } if (cell.btnstyle) { // 鍏煎 diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 91d7660..8125f6d 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -48,11 +48,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) } UNSAFE_componentWillReceiveProps (nextProps) { @@ -90,7 +86,7 @@ if ((triggerId && btn.uuid !== triggerId) || loading) return if (btn.funcType === 'closetab') { - MKEmitter.emit('closeTabView', MenuID || btn.$menuId) + MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) if (btn.refreshTab && btn.refreshTab.length > 0) { MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index e943949..c8d0368 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -52,11 +52,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) } UNSAFE_componentWillReceiveProps (nextProps) { diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 0143fc7..bb5ac9f 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -37,11 +37,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) MKEmitter.addListener('returnModuleParam', this.triggerExcelout) } diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index 6ce5e9b..eae9ac6 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -45,11 +45,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) } UNSAFE_componentWillReceiveProps (nextProps) { diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index acf6876..7b512f5 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1300,9 +1300,15 @@ id = res.mk_b_id || res[btn.output] || '' } - if (btn.execSuccess !== 'never') { + if (btn.execSuccess === 'closetab') { + MKEmitter.emit('closeTabView', btn.$MenuID) + } else if (btn.execSuccess !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id) } + + if (btn.refreshTab && btn.refreshTab.length > 0) { + MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') + } } sendMessage = () => { diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index a0429e7..bb03fd4 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -55,11 +55,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) MKEmitter.addListener('openNewTab', this.openNewTab) MKEmitter.addListener('refreshPopButton', this.refreshPopButton) } diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 95a955f..56c55ba 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -64,11 +64,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) } UNSAFE_componentWillReceiveProps (nextProps) { diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index db9b04b..d59c2d5 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -46,11 +46,7 @@ } componentDidMount () { - const { position } = this.props - - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } + MKEmitter.addListener('triggerBtnId', this.actionTrigger) } UNSAFE_componentWillReceiveProps (nextProps) { diff --git a/src/views/menudesign/homeform/index.jsx b/src/views/menudesign/homeform/index.jsx index ba1e5d7..121644e 100644 --- a/src/views/menudesign/homeform/index.jsx +++ b/src/views/menudesign/homeform/index.jsx @@ -23,6 +23,7 @@ Api.getSystemConfig(_param).then(result => { if (result.status) { + let thdMenuList = [] let menulist = result.fst_menu.map(fst => { let fstItem = { MenuID: fst.MenuID, @@ -55,8 +56,20 @@ EasyCode: trd.EasyCode, value: trd.MenuID, label: trd.MenuName, + type: 'CommonTable', disabled: false } + + if (trd.PageParam) { + try { + trd.PageParam = JSON.parse(trd.PageParam) + trdItem.type = trd.PageParam.Template || 'CommonTable' + } catch (e) { + + } + } + + thdMenuList.push(trdItem) return trdItem }) @@ -68,6 +81,7 @@ }) sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) + sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) } else { notification.warning({ top: 92, diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index b1bab0a..09643fe 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -31,6 +31,7 @@ Api.getSystemConfig(_param).then(result => { if (result.status) { let thdMenu = null + let thdMenuList = [] let menulist = result.fst_menu.map(fst => { let fstItem = { MenuID: fst.MenuID, @@ -63,12 +64,25 @@ EasyCode: trd.EasyCode, value: trd.MenuID, label: trd.MenuName, + type: 'CommonTable', disabled: trd.MenuID === MenuId } if (MenuId === trd.MenuID) { thdMenu = trdItem } + + if (trd.PageParam) { + try { + trd.PageParam = JSON.parse(trd.PageParam) + trdItem.type = trd.PageParam.Template || 'CommonTable' + } catch (e) { + + } + } + + thdMenuList.push(trdItem) + return trdItem }) } @@ -85,6 +99,7 @@ } }) sessionStorage.setItem('fstMenuList', JSON.stringify(menulist)) + sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''}) this.setState({ -- Gitblit v1.8.0