From d7ec8fbd65cd7225ce8d405a0ee0a1f166f44d7b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 九月 2021 17:23:54 +0800 Subject: [PATCH] 2021-09-16 --- src/components/tabview/index.jsx | 14 ++++ src/locales/zh-CN/main.js | 1 src/components/header/index.jsx | 2 src/menu/components/share/actioncomponent/formconfig.jsx | 29 ++++++++- src/tabviews/custom/components/tabs/antv-tabs/index.jsx | 2 src/utils/utils-custom.js | 2 src/tabviews/zshare/actionList/excelInbutton/index.jsx | 5 + src/mob/components/topbar/normal-navbar/options.jsx | 4 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 5 + src/components/breadview/index.jsx | 4 src/menu/components/share/actioncomponent/actionform/index.jsx | 31 ++-------- src/locales/en-US/main.js | 1 src/tabviews/zshare/actionList/normalbutton/index.jsx | 5 + src/views/login/index.jsx | 37 +++++++----- 14 files changed, 90 insertions(+), 52 deletions(-) diff --git a/src/components/breadview/index.jsx b/src/components/breadview/index.jsx index ff506c3..5c3a5a1 100644 --- a/src/components/breadview/index.jsx +++ b/src/components/breadview/index.jsx @@ -123,7 +123,7 @@ let home = { MenuID: 'home_page_id', - MenuName: this.state.dict['main.homepage'], + MenuName: '棣栭〉', selected: true, type: 'Home' } @@ -133,7 +133,7 @@ gotoHome = () => { let home = { MenuID: 'home_page_id', - MenuName: this.state.dict['main.homepage'], + MenuName: '棣栭〉', selected: true, type: 'Home' } diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index f58c12a..84855e4 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -224,7 +224,7 @@ let tabs = fromJS(this.props.tabviews).toJS() let menu = fromJS(response[1]).toJS() - if (this.state.navBar === 'topmenu') { + if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') { menu.selected = true this.props.modifyTabview([menu]) } else { diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index bd68ea7..d12aba8 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -44,6 +44,12 @@ state = { activeId: '', + // tabviews: [{ + // MenuID: 'home_page_id', + // MenuName: '棣栭〉', + // selected: true, + // type: 'Home' + // }], // 鏍囩闆� tabviews: null, // 鏍囩闆� iFrameHeight: 0, dict: sessionStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS, @@ -150,6 +156,10 @@ } } + // modifyTabs = (tab, type) => { + + // } + changeTab = (e, menu) => { e.stopPropagation() // 绐楀彛鍒囨崲 @@ -235,12 +245,13 @@ if (sessionStorage.getItem('isEditState') !== 'true') { let home = { MenuID: 'home_page_id', - MenuName: this.state.dict['main.homepage'], + MenuName: '棣栭〉', selected: true, type: 'Home' } this.props.modifyTabview([home]) } + // MKEmitter.addListener('modifyTabs', this.modifyTabs) MKEmitter.addListener('closeTabView', this.closeTabView) } @@ -285,6 +296,7 @@ this.setState = () => { return } + // MKEmitter.removeListener('modifyTabs', this.modifyTabs) MKEmitter.removeListener('closeTabView', this.closeTabView) } diff --git a/src/locales/en-US/main.js b/src/locales/en-US/main.js index 7a30ffe..c5f9d09 100644 --- a/src/locales/en-US/main.js +++ b/src/locales/en-US/main.js @@ -10,7 +10,6 @@ 'main.cancel': 'Cancel', 'main.logout': 'Logout', 'main.doc': '鏂囨。涓績', - 'main.homepage': '棣栭〉', 'main.logout.hint': 'Are you sure you want to log out?', 'main.verup': 'Version upgrade', 'main.password': 'Change the password', diff --git a/src/locales/zh-CN/main.js b/src/locales/zh-CN/main.js index f99de1b..600ca52 100644 --- a/src/locales/zh-CN/main.js +++ b/src/locales/zh-CN/main.js @@ -10,7 +10,6 @@ 'main.cancel': '鍙栨秷', 'main.logout': '閫�鍑�', 'main.doc': '鏂囨。涓績', - 'main.homepage': '棣栭〉', 'main.logout.hint': '鎮ㄧ‘瀹氳閫�鍑哄悧?', 'main.verup': '鐗堟湰鍗囩骇', 'main.password': '淇敼瀵嗙爜', diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 9bf061d..36f4db9 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -10,11 +10,11 @@ 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', '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'], + pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab'], + prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab'], + exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab'], + excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], + excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'], tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'], @@ -617,7 +617,7 @@ </Form.Item> </Col> ) - } else if (item.type === 'cascader') { // 澶氶�� + } else if (item.type === 'cascader') { fields.push( <Col span={12} key={index}> <Form.Item label={item.tooltip ? @@ -635,7 +635,7 @@ } ] })( - <Cascader options={item.options || []} placeholder=""/> + <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/> )} </Form.Item> </Col> @@ -654,23 +654,6 @@ ] })( <MkIcon allowClear/> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'mcascader') { - fields.push( - <Col span={12} key={index}> - <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 - })( - <Cascader options={item.options} expandTrigger="hover" placeholder="" /> )} </Form.Item> </Col> diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index fccf2a1..04804f3 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -47,6 +47,20 @@ } ] + let getTabs = (list) => { + return list.filter(item => { + if (item.type !== 'tabs') return false + + item.children = item.children.map(cell => { + cell.children = getTabs(cell.children) + return cell + }) + return item + }) + } + + let tabs = getTabs(JSON.parse(JSON.stringify(modules))) + let pageTemps = [ { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, { value: 'pay', text: Formdict['model.pay'] }, @@ -527,7 +541,7 @@ }] }, { - type: 'mcascader', + type: 'cascader', key: 'syncComponent', label: '鍒锋柊缁勪欢', initVal: card.syncComponent || [], @@ -537,10 +551,19 @@ }, { type: 'cascader', + key: 'switchTab', + label: '鍒囨崲鏍囩', + initVal: card.switchTab || [], + tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸垏鎹㈢殑鏍囩椤�', + required: false, + options: tabs + }, + { + type: 'cascader', key: 'refreshTab', - label: '鍒锋柊鏍囩', + label: '鍒锋柊鑿滃崟', initVal: card.refreshTab || [], - tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鏍囩', + tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟', required: false, forbid: isApp, options: menulist diff --git a/src/mob/components/topbar/normal-navbar/options.jsx b/src/mob/components/topbar/normal-navbar/options.jsx index 5fdef0b..bcb83ca 100644 --- a/src/mob/components/topbar/normal-navbar/options.jsx +++ b/src/mob/components/topbar/normal-navbar/options.jsx @@ -76,7 +76,7 @@ field: 'scan', label: '鎵竴鎵�', initval: wrap.scan || 'false', - tooltip: '绯荤粺鍔熻兘锛�1銆佹壂鐮佺櫥褰曪紝浜岀淮鐮佷俊鎭互鈥渓ogin鈥濆紑澶达紝2銆侀〉闈㈣烦杞紝浜岀淮鐮佷俊鎭互鈥渦rl鈥濆紑澶�', + tooltip: '绯荤粺鍔熻兘锛�1銆佹壂鐮佺櫥褰曪紝浜岀淮鐮佷互鈥渓ogin鈥濆紑澶达紝2銆侀〉闈㈣烦杞紝浜岀淮鐮佷互鈥渉ttp鈥濆紑澶达紝3銆佽彍鍗曡烦杞紝浜岀淮鐮佷互鈥渕kbid鈥濆紑澶达紝涓旇缃叧鑱旇彍鍗�', required: false, options: [ {value: 'true', label: '鏄剧ず'}, @@ -102,7 +102,7 @@ field: 'linkmenu', label: '鍏宠仈鑿滃崟', initval: wrap.linkmenu || '', - tooltip: '浣跨敤鎵爜鐧诲綍鍔熻兘鏃剁殑璺宠浆椤甸潰锛屼笉浣跨敤鎵爜鐧诲綍鍙拷鐣ャ��', + tooltip: '浣跨敤鎵爜鐧诲綍鍔熻兘鎴栬彍鍗曡烦杞姛鑳芥椂锛岄渶閫夋嫨璺宠浆鐨勮彍鍗曘��', required: false, options: menulist }, diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx index bbad0d0..61e8418 100644 --- a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx +++ b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx @@ -70,7 +70,7 @@ <div className="menu-antv-tabs-wrap" style={tabs.style}> <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> {tabs.subtabs.map(tab => ( - <TabPane tab={<span>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span>} key={tab.uuid}> + <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span>} key={tab.uuid}> <TabTransfer BID={BID} config={tab} bids={bids} mainSearch={mainSearch}/> </TabPane> ))} diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index de4aa71..4685368 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -184,6 +184,11 @@ if (btn.execSuccess !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn) } + if (btn.switchTab && btn.switchTab.length > 0) { + let id = btn.switchTab[btn.switchTab.length - 1] + let node = document.getElementById('tab' + id) + node && node.click() + } } /** diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index bb5ac9f..e52aece 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -814,6 +814,11 @@ if (btn.execSuccess !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn) } + if (btn.switchTab && btn.switchTab.length > 0) { + let id = btn.switchTab[btn.switchTab.length - 1] + let node = document.getElementById('tab' + id) + node && node.click() + } } /** diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 6991fe3..a47e588 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1313,6 +1313,11 @@ if (btn.refreshTab && btn.refreshTab.length > 0) { MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') } + if (btn.switchTab && btn.switchTab.length > 0) { + let id = btn.switchTab[btn.switchTab.length - 1] + let node = document.getElementById('tab' + id) + node && node.click() + } } sendMessage = () => { diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 7e09edf..ee48e7c 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -16,10 +16,12 @@ } } else if (item.type === 'tabs') { let _item = { + type: 'tabs', value: item.uuid, label: item.name, children: item.subtabs.map(f_tab => { let subItem = { + type: 'tab', value: f_tab.uuid, label: f_tab.label, children: this.getSubModules(f_tab.components, selfId) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 8469483..315618c 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -281,25 +281,11 @@ // }) const _addressUrl = window.location.href.split('#')[0] + 'queryAddress' - if (_addressUrl !== 'true') { + if (localStorage.getItem(_addressUrl) !== 'true') { sessionStorage.setItem('city', '') sessionStorage.setItem('ipAddress', '') } else { - window.callbackFunction = (res) => { - if (res.result && res.result.ad_info) { - sessionStorage.setItem('city', res.result.ad_info.city) - sessionStorage.setItem('ipAddress', res.result.ip) - } - } - - const JSONP = document.createElement('script') - JSONP.type = 'text/javascript' - JSONP.src = 'https://apis.map.qq.com/ws/location/v1/ip?callback=callbackFunction&key=BA7BZ-4QB65-LFCIA-QPDA6-4G6O7-MJB4Q&output=jsonp&sig=3e5ebecb324ba266bf80014dcc8380db' - document.getElementsByTagName('head')[0].appendChild(JSONP) - - setTimeout(() => { - document.getElementsByTagName('head')[0].removeChild(JSONP) - },500) + this.queryAddress() } const timeStamp = new Date().getTime() @@ -382,6 +368,7 @@ localStorage.setItem(_addressUrl, 'false') } else { localStorage.setItem(_addressUrl, 'true') + this.queryAddress() } } else if (res.ErrCode === 'N') { localStorage.removeItem(_authUrl) @@ -563,6 +550,24 @@ } } + queryAddress = () => { + window.callbackFunction = (res) => { + if (res.result && res.result.ad_info) { + sessionStorage.setItem('city', res.result.ad_info.city) + sessionStorage.setItem('ipAddress', res.result.ip) + } + } + + const JSONP = document.createElement('script') + JSONP.type = 'text/javascript' + JSONP.src = 'https://apis.map.qq.com/ws/location/v1/ip?callback=callbackFunction&key=BA7BZ-4QB65-LFCIA-QPDA6-4G6O7-MJB4Q&output=jsonp&sig=3e5ebecb324ba266bf80014dcc8380db' + document.getElementsByTagName('head')[0].appendChild(JSONP) + + setTimeout(() => { + document.getElementsByTagName('head')[0].removeChild(JSONP) + },500) + } + syncSubmit = () => { this.setState({ syncing: true -- Gitblit v1.8.0