From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十一月 2022 16:11:55 +0800 Subject: [PATCH] 2022-11-21 --- src/tabviews/commontable/index.jsx | 86 +++++++++++++++++++++++++----------------- 1 files changed, 51 insertions(+), 35 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 940775d..f224e98 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Tabs, Switch, Row, Col } from 'antd' +import { notification, Spin, Tabs, Switch, Row, Col, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -36,7 +36,8 @@ param: PropTypes.any, // 鍏朵粬椤甸潰浼犻�掔殑鎼滅储鏉′欢绛夊弬鏁� MenuID: PropTypes.string, // 鑿滃崟Id MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuName: PropTypes.string // 鑿滃崟鍚嶇О + MenuName: PropTypes.string, // 鑿滃崟鍚嶇О + changeTemp: PropTypes.func } state = { @@ -91,13 +92,34 @@ try { // 閰嶇疆淇℃伅瑙f瀽 config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) - config.MenuID = MenuID - config.MenuName = MenuName - config.setting.MenuName = MenuName - config.setting.$name = MenuName } catch (e) { console.warn('Parse Failure') config = '' + } + + // 椤甸潰閰嶇疆瑙f瀽閿欒鏃舵彁绀� + if (!config) { + this.setState({ + loadingview: false, + viewlost: true + }) + return + } + + // 椤甸潰鏈惎鐢ㄦ椂锛屾樉绀烘湭鍚敤椤甸潰 + if (!config.enabled) { + this.setState({ + loadingview: false, + viewlost: true, + lostmsg: this.state.dict['main.view.unenabled'] + }) + return + } + + // 妯℃澘閿欒 + if (config.Template === 'BaseTable' || config.Template === 'CustomPage') { + this.props.changeTemp(MenuID, config.Template) + return } // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆 @@ -136,24 +158,11 @@ } } - // 椤甸潰閰嶇疆瑙f瀽閿欒鏃舵彁绀� - if (!config) { - this.setState({ - loadingview: false, - viewlost: true - }) - return - } - - // 椤甸潰鏈惎鐢ㄦ椂锛屾樉绀烘湭鍚敤椤甸潰 - if (!config.enabled) { - this.setState({ - loadingview: false, - viewlost: true, - lostmsg: this.state.dict['main.view.unenabled'] - }) - return - } + // 淇℃伅鍒濆鍖栬祴鍊� + config.MenuID = MenuID + config.MenuName = MenuName + config.setting.MenuName = MenuName + config.setting.$name = MenuName // 鐗堟湰鍏煎 config = updateCommonTable(config) @@ -166,6 +175,8 @@ if (tab.supMenu === 'mainTable') { tab.supMenu = MenuID } + tab.ContainerId = this.state.ContainerId + return window.GLOB.mkActions[tab.linkTab] }) }) @@ -176,6 +187,8 @@ if (tab.supMenu === 'mainTable') { tab.supMenu = MenuID } + tab.ContainerId = this.state.ContainerId + return tab }) }) @@ -228,6 +241,7 @@ // 鏍囪涓婚〉闈紝鐢ㄤ簬鎸夐挳鍥哄畾鍙婅〃鍗曟寕杞借缃� config.setting.tabType = 'main' + config.setting.ContainerId = this.state.ContainerId // 鏁版嵁婧愪俊鎭澶勭悊 config.setting.laypage = config.setting.laypage !== 'false' // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡 @@ -305,6 +319,7 @@ config.action.forEach(item => { item.logLabel = MenuName + '-' + item.label // 鐢ㄤ簬sPC_TableData_InUpDe璁板綍鎿嶄綔鎸夐挳 item.$menuId = this.props.MenuID + item.ContainerId = this.state.ContainerId if (item.OpenType === 'funcbutton' && item.funcType === 'print' && item.verify) { // 鎵撳嵃鏈鸿缃� let _item = window.GLOB.UserCacheMap.get(this.props.MenuID + item.uuid) @@ -785,11 +800,18 @@ if (autoMatic) { MKEmitter.emit('autoMaticError', this.props.MenuID) } - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } @@ -1169,7 +1191,6 @@ dict={this.state.dict} MenuID={MenuID} selectedData={selectedData} - ContainerId={this.state.ContainerId} /> </div> <div className="main-table-box"> @@ -1188,7 +1209,6 @@ total={this.state.total} loading={this.state.loading} statFValue={this.state.statFValue} - ContainerId={this.state.ContainerId} refreshdata={this.refreshbytable} chgSelectData={this.changeSelectedData} /> @@ -1207,7 +1227,6 @@ columns={columns} data={this.state.data} loading={this.state.loading} - ContainerId={this.state.ContainerId} /> </Col> ) @@ -1236,7 +1255,6 @@ dict={this.state.dict} MenuID={MenuID} selectedData={selectedData} - ContainerId={this.state.ContainerId} /> </div> <div className="main-table-box"> @@ -1255,7 +1273,6 @@ total={this.state.total} loading={this.state.loading} statFValue={this.state.statFValue} - ContainerId={this.state.ContainerId} refreshdata={this.refreshbytable} chgSelectData={this.changeSelectedData} /> @@ -1276,7 +1293,6 @@ SupMenuID={MenuID} MenuID={_tab.linkTab} mainSearch={_tab.searchPass === 'true' ? search : null} - ContainerId={this.state.ContainerId} BID={this.state.BIDs[_tab.supMenu] || ''} BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} /> -- Gitblit v1.8.0