From 6def3330d1d1cf4036916ed04c8bbc4128e1e5d0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 03 五月 2020 19:42:17 +0800 Subject: [PATCH] 2020-05-03 --- src/tabviews/commontable/index.jsx | 562 +++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 419 insertions(+), 143 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index f214488..b80a1da 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -9,28 +9,30 @@ import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' import Utils from '@/utils/utils.js' -import asyncComponent from '@/utils/asyncLoadComponent' +import asyncLoadComponent from '@/utils/asyncLoadComponent' import {refreshTabView, modifyTabview} from '@/store/action' -import MainTable from './mainTable' -import VerifyCard from '@/tabviews/tableshare/verifycard' -import MainAction from '@/tabviews/tableshare/actionList' -import MainSearch from '@/tabviews/tableshare/topSearch' -import SubTable from '@/tabviews/subtable' +import MainTable from '@/tabviews/zshare/normalTable' +import MainSearch from '@/tabviews/zshare/topSearch' import NotFount from '@/components/404' import './index.scss' -const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) -const FormTab = asyncComponent(() => import('@/tabviews/formtab')) +const VerifyCard = asyncLoadComponent(() => import('@/tabviews/zshare/verifycard')) +const MainAction = asyncLoadComponent(() => import('@/tabviews/zshare/actionList')) +const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable')) +const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) +const FormTab = asyncLoadComponent(() => import('@/tabviews/formtab')) + const { TabPane } = Tabs const { TreeNode } = Tree const { Paragraph } = Typography class NormalTable extends Component { static propTpyes = { + param: PropTypes.any, // 鍏朵粬椤甸潰浼犻�掔殑鎼滅储鏉′欢绛夊弬鏁� + MenuID: PropTypes.string, // 鑿滃崟Id MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuName: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuID: PropTypes.string // 鑿滃崟Id + MenuName: PropTypes.string // 鑿滃崟鍚嶇О } state = { @@ -41,6 +43,8 @@ viewlost: false, // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤 lostmsg: '', // 椤甸潰涓㈠け鏃剁殑鎻愮ず淇℃伅 config: {}, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 + userConfig: null, // 鐢ㄦ埛鑷畾涔夎缃� + userParam: null, // 淇濆瓨鐢ㄦ埛缂栬緫涓殑閰嶇疆 searchlist: null, // 鎼滅储鏉′欢 actions: null, // 鎸夐挳闆� columns: null, // 鏄剧ず鍒� @@ -64,23 +68,28 @@ tabParam: null, // 琛ㄥ崟鏍囩鍙傛暟 refreshtabs: null, // 闇�瑕佸埛鏂扮殑鏍囩闆� confirmLoading: false,// 鑷畾涔夎缃ā鎬佹鍔犺浇涓� - settingVisible: false // 鑷畾涔夎缃ā鎬佹 + revertLoading: false, // 鎭㈠榛樿璁剧疆 + settingVisible: false,// 鑷畾涔夎缃ā鎬佹 + triggerBtn: null, // 鐐瑰嚮琛ㄦ牸涓垨蹇嵎閿Е鍙戠殑鎸夐挳 + tabActive: null // 鏍囩椤靛睍寮�鎺у埗 } /** * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { permAction } = this.props + const { permAction, permMenus, param } = this.props - let param = { + let _param = { func: 'sPC_Get_LongParam', MenuID: this.props.MenuID } - let result = await Api.getSystemCacheConfig(param) + let result = await Api.getSystemCacheConfig(_param) + if (result.status) { let config = '' - let userConfig = '' + let userConfig = null + let _curUserConfig = '' try { // 閰嶇疆淇℃伅瑙f瀽 config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) @@ -89,11 +98,14 @@ config = '' } - try { // 閰嶇疆淇℃伅瑙f瀽 - userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) - } catch (e) { - console.warn('Parse Failure') - userConfig = '' + if (result.LongParamUser) { + try { // 閰嶇疆淇℃伅瑙f瀽 + userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) + _curUserConfig = userConfig[this.props.MenuID] + } catch (e) { + console.warn('Parse Failure') + userConfig = null + } } // 椤甸潰閰嶇疆瑙f瀽閿欒鏃舵彁绀� @@ -117,26 +129,76 @@ // 鏉冮檺杩囨护 config.action = config.action.filter(item => permAction[item.uuid]) - // config.tabgroups.forEach(group => { - // if (!config[group]) return - // config[group] = config[group].filter(tab => permAction[tab.uuid]) - // }) + config.tabgroups.forEach(group => { + if (!config[group]) return - if (userConfig) { - config.setting = {...config.setting, ...userConfig.setting} - let _actions = {} - userConfig.action.forEach(item => { - _actions[item.uuid] = item + config[group] = config[group].filter(tab => permAction[tab.linkTab]) + }) + + // 瀛楁鏉冮檺榛戝悕鍗� + config.search = config.search.filter(item => { + if (!item.blacklist || item.blacklist.length === 0) return true + + let _black = item.blacklist.filter(v => { + return this.props.permRoles.indexOf(v) !== -1 }) + if (_black.length > 0) { + return false + } else { + return true + } + }) + + config.columns = config.columns.filter(col => { + if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return true + + let _black = col.blacklist.filter(v => { + return this.props.permRoles.indexOf(v) !== -1 + }) + + if (_black.length > 0) { + return false + } else { + return true + } + }) + + if (_curUserConfig) { + config.setting = {...config.setting, ..._curUserConfig.setting} + config.easyCode = _curUserConfig.easyCode || config.easyCode || '' + config.action = config.action.map(item => { - if (_actions[item.uuid]) { - item = {...item, ..._actions[item.uuid]} + if (item.execMode) { + item.OpenType = 'funcbutton' + } + + if (_curUserConfig.action[item.uuid]) { + delete _curUserConfig.action[item.uuid].label + item = {...item, ..._curUserConfig.action[item.uuid]} + } + + if (item.OpenType === 'funcbutton' && item.funcType === 'print' && item.verify && item.printer) { + item.verify.defaultPrinter = item.printer.defaultPrinter || '' + if (item.verify.printerTypeList && item.printer.printerList) { + item.verify.printerTypeList = item.verify.printerTypeList.map(cell => { + cell.printer = item.printer.printerList[cell.Value] || '' + + return cell + }) + } } return item }) } + + let _tabActive = {} // 绛涢�夊睍寮�鐨則ab椤� + + config.tabgroups.forEach(groupId => { + if (!config[groupId] || config[groupId].length === 0) return + _tabActive[groupId] = config[groupId][0].uuid + }) let _arrField = [] // 瀛楁闆� let _columns = [] // 鏄剧ず鍒� @@ -144,8 +206,8 @@ let _hideCol = [] // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆� let colMap = new Map() // 鐢ㄤ簬瀛楁杩囨护 - let _actions = [] // 宸ュ叿鏍忔寜閽� - let _operations = [] // 鎿嶄綔鍒楁寜閽紙瀛樺湪鏃讹級 + let _actions = [] // 宸ュ叿鏍忔寜閽� + let _operations = [] // 鎿嶄綔鍒楁寜閽紙瀛樺湪鏃讹級 config.action.forEach(item => { if (item.execMode) { @@ -159,22 +221,10 @@ } }) - if (config.gridBtn && config.gridBtn.display && _operations.length > 0) { - _columns.push({ - ...config.gridBtn, - operations: _operations - }) - } - - // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid config.columns.forEach(col => { if (col.field) { _arrField.push(col.field) - - // if () { // 鏉冮檺榛戝悕鍗� - // col.Hide = 'true' - // } _logcolumns.push(col) } @@ -187,8 +237,14 @@ }) // 鐢熸垚鏄剧ず鍒楋紝澶勭悊鍚堝苟鍒椾腑鐨勫瓧娈� - config.columns.forEach(col => { + config.columns.forEach((col, index) => { if (_hideCol.includes(col.uuid)) return + + if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { + col.linkThdMenu = '' + } + + col.sort = index if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) @@ -205,22 +261,56 @@ } }) + if (config.gridBtn && config.gridBtn.display && _operations.length > 0) { + _columns.push({ + ...config.gridBtn, + operations: _operations + }) + } + + let valid = true // 鎼滅储鏉′欢蹇呭~楠岃瘉, 鍒濆鎼滅储鏉′欢 + let initSearch = config.search.map(item => { + let _item = JSON.parse(JSON.stringify(item)) + if (_item.type === 'text' && param && param.searchkey === _item.field) { + _item.initval = param.searchval + } + + if (_item.required === 'true' && !_item.initval) { + valid = false + } + return _item + }) + + if (_curUserConfig) { + _columns = _columns.map(item => { + if (_curUserConfig.columns[item.uuid]) { + delete _curUserConfig.columns[item.uuid].label + item = {...item, ..._curUserConfig.columns[item.uuid]} + } + + return item + }) + + _columns.sort((pre, next) => { + return pre.sort - next.sort + }) + } + this.setState({ loadingview: false, config: config, + tabActive: _tabActive, + userConfig: userConfig, setting: config.setting, searchlist: config.search, actions: _actions, columns: _columns, logcolumns: _logcolumns, arr_field: _arrField.join(','), - search: Utils.initMainSearch(config.search) // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級 + search: Utils.initMainSearch(initSearch) // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級 }, () => { this.improveSearch() - if (config.setting.onload !== 'false') { // 鍒濆鍖栧彲鍔犺浇 - this.setState({ - loading: true - }) + if (config.setting.onload !== 'false' && valid) { // 鍒濆鍖栧彲鍔犺浇 this.loadmaindata() } this.setShortcut() @@ -233,14 +323,14 @@ notification.warning({ top: 92, message: result.message, - duration: 10 + duration: 5 }) } } setShortcut = () => { - const { actions } = this.state - if (!actions) return + const { actions, userConfig, config } = this.state + if (!userConfig) return document.onkeydown = (event) => { let e = event || window.event @@ -254,16 +344,82 @@ } else if (e.altKey) { preKey = 'alt' } - - let istrigger = false - actions.forEach(item => { - if (!item.shortcut || istrigger) return - if (preKey === item.shortcut && keyCode === item.shortcutkey) { + if (!preKey) return + + let istrigger = false + + actions.forEach(item => { + if (!item.shortcut || typeof(item.shortcut) !== 'object' || item.shortcut.length === 0 || istrigger) return + + if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) { e.preventDefault() istrigger = true - this.refs.mainButton.actionTrigger(item) + + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: this.props.MenuID, + button: item, + data: null + } + }) } + }) + + if (istrigger) return + + Object.keys(userConfig).forEach(key => { + if (key === this.props.MenuID || !userConfig[key].action || istrigger) return + + let _actions = userConfig[key].action + + Object.keys(_actions).forEach(btnkey => { + let item = _actions[btnkey] + + if (!item.shortcut || typeof(item.shortcut) !== 'object' || item.shortcut.length === 0 || istrigger) return + + if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) { + e.preventDefault() + istrigger = true + + let _groupId = '' + let _ActiveTabId = '' + config.tabgroups.forEach(groupId => { + if (!config[groupId] || config[groupId].length === 0) return + + let _tab = config[groupId].filter(tab => tab.uuid === key)[0] + if (_tab) { + _groupId = groupId + _ActiveTabId = _tab.uuid + } + }) + + if (this.state.tabActive[_groupId] === _ActiveTabId) { + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: key, + button: {...item, uuid: btnkey}, + data: null + } + }) + } else { + this.setState({ + tabActive: {...this.state.tabActive, [_groupId]: _ActiveTabId} + }, () => { + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: key, + button: {...item, uuid: btnkey}, + data: null + } + }) + }) + } + } + }) }) } } @@ -310,7 +466,7 @@ notification.warning({ top: 92, message: item.label + ': ' + this.state.dict['main.datasource.settingerror'], - duration: 10 + duration: 5 }) } }) @@ -345,7 +501,7 @@ notification.warning({ top: 92, message: res.search.label + ':' + res.message, - duration: 10 + duration: 5 }) } }) @@ -358,18 +514,29 @@ * @description 涓昏〃鏁版嵁鍔犺浇 */ async loadmaindata () { - const { setting, BIDs } = this.state + const { setting, BIDs, search } = this.state let param = '' + + let requireFields = search.filter(item => item.required && !item.value) + + if (requireFields.length > 0) { + notification.warning({ + top: 92, + message: this.state.dict['form.required.input'] + requireFields.map(item => item.label).join('銆�') + ' !', + duration: 3 + }) + return + } + + this.setState({ + loading: true + }) if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { param = this.getCustomParam() } else { param = this.getDefaultParam() } - - this.setState({ - pickup: false - }) this.handleTableId('mainTable', '', '') @@ -386,6 +553,7 @@ }), total: result.total, loading: false, + pickup: false, BIDs: { ...BIDs, mainTable: '' @@ -398,7 +566,7 @@ notification.error({ top: 92, message: result.message, - duration: 15 + duration: 10 }) } } @@ -421,13 +589,11 @@ if (setting.interType === 'inner') { param.func = setting.innerFunc } else { - if (setting.sysInterface === 'true') { - param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi - } else { + if (setting.sysInterface === 'true' && window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi + } else if (setting.sysInterface !== 'true') { param.rduri = setting.interface } - - param.appkey = window.GLOB.appkey || '' // 璋冪敤澶栭儴鎺ュ彛澧炲姞appkey if (setting.outerFunc) { param.func = setting.outerFunc @@ -447,7 +613,7 @@ notification.warning({ top: 92, message: '鏈缃樉绀哄垪锛�', - duration: 10 + duration: 5 }) return null } @@ -459,8 +625,7 @@ let param = { func: 'sPC_Get_TableData', obj_name: 'data', - arr_field: arr_field, - appkey: window.GLOB.appkey || '' + arr_field: arr_field } let _orderBy = orderBy || setting.order @@ -471,23 +636,14 @@ } if (setting.queryType === 'statistics') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲 - let fieldmap = new Map() - let options = search.map(item => { - let _field = item.key + let allSearch = Utils.getAllSearchOptions(search) - if (fieldmap.has(_field)) { - _field = _field + '1' - } - - fieldmap.set(item.key, true) - + let options = allSearch.map(item => { return { - reg: new RegExp('@' + _field, 'ig'), + reg: new RegExp('@' + item.key + '@', 'ig'), value: item.value } }) - - options.reverse() options.forEach(item => { _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) @@ -516,7 +672,6 @@ if (setting.onload === 'false') { this.setState({ - loading: true, pageIndex: 1, search: searches, setting: {...setting, onload: 'true'} @@ -527,7 +682,6 @@ this.refs.mainTable.resetTable() this.setState({ - loading: true, pageIndex: 1, search: searches }, () => { @@ -549,7 +703,6 @@ } this.setState({ - loading: true, pageIndex: pagination.current, pageSize: pagination.pageSize, orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : '' @@ -564,7 +717,6 @@ reloadtable = () => { this.refs.mainTable.resetTable() this.setState({ - loading: true, pageIndex: 1 }, () => { this.loadmaindata() @@ -581,6 +733,8 @@ viewlost: false, lostmsg: '', config: {}, + userConfig: null, + userParam: null, searchlist: null, actions: null, columns: null, @@ -691,7 +845,14 @@ * @description 琛ㄦ牸涓紝鎸夐挳瑙﹀彂浜嬩欢浼犻�� */ buttonTrigger = (btn, record) => { - this.refs.mainButton.actionTrigger(btn, record) + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: this.props.MenuID, + button: btn, + data: record + } + }) } /** @@ -859,40 +1020,120 @@ controlCustomSetting = () => { this.setState({ settingVisible: true, - confirmLoading: false + confirmLoading: false, + revertLoading: false + }) + } + + changeMenuParam = (param) => { + this.setState({userParam: param}) + } + + linkTrigger = (menu) => { + const { tabviews, MenuID } = this.props + + menu.selected = true + + let index = 0 + let isexit = false + let tabs = tabviews.map((tab, i) => { + tab.selected = false + + if (tab.MenuID === MenuID) { + index = i + } else if (tab.MenuID === menu.MenuID) { + tab.param = menu.param + tab.selected = true + isexit = true + } + + return tab + }) + + if (!isexit) { + tabs.splice(index + 1, 0, menu) + } + + this.props.modifyTabview(tabs) + } + + settingRevert = () => { + let param = { + func: 's_TrdMenu_UserParam_del', + MenuID: this.props.MenuID + } + this.setState({ + revertLoading: true + }) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + this.setState({ + revertLoading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + return + } + this.setState({ + settingVisible: false, + revertLoading: false + }, () => { + window.GLOB.CacheMap = new Map() + this.reloadview() + }) }) } settingSubmit = () => { - this.verifyRef.handleConfirm().then(res => { - let _LongParam = '' + const { userParam } = this.state + let _LongParam = '' - try { - _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(res))) - } catch (e) { + try { + _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(userParam))) + } catch (e) { + notification.warning({ + top: 92, + message: '缂栬瘧閿欒', + duration: 5 + }) + return + } + + let easyCode = userParam[this.props.MenuID] ? userParam[this.props.MenuID].easyCode : '' + + let param = { + func: 'sPC_TrdMenu_UserParam', + MenuID: this.props.MenuID, + EasyCode: easyCode || '', + LongParam: _LongParam + } + + this.setState({ + confirmLoading: true + }) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + this.setState({ + confirmLoading: false + }) notification.warning({ top: 92, - message: '缂栬瘧閿欒', - duration: 10 + message: result.message, + duration: 5 }) return } - - let param = { - func: 'sPC_TrdMenu_UserParam', - MenuID: this.props.MenuID, - LongParam: _LongParam - } - this.setState({ - confirmLoading: true - }) - - Api.getSystemConfig(param).then(result => { - this.setState({ - settingVisible: false, - confirmLoading: false - }) + settingVisible: false, + confirmLoading: false + }, () => { + window.GLOB.CacheMap = new Map() + this.reloadview() }) }) } @@ -910,6 +1151,20 @@ this.reloadview() } this.props.refreshTabView('') + } else if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { + let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] + if (selectTab && selectTab.MenuID === this.props.MenuID) { + this.setShortcut() + } + } else if (nextProps.param && !is(fromJS(this.props.param), fromJS(nextProps.param))) { + let search = this.state.search.map(item => { + if (item.type === 'text' && item.key === nextProps.param.searchkey) { + item.value = nextProps.param.searchval + } + + return item + }) + this.refreshbysearch(search) } } @@ -918,16 +1173,17 @@ } /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 */ componentWillUnmount () { this.setState = () => { return } + document.onkeydown = () => {} } render() { - const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config } = this.state + const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, search } = this.state return ( <div> @@ -935,28 +1191,32 @@ {loadingview && <Spin size="large" />} {searchlist && searchlist.length > 0 ? <MainSearch + ref="mainSearch" dict={this.state.dict} searchlist={searchlist} refreshdata={this.refreshbysearch} /> : null } {actions && setting.onload !== 'false' ? - <MainAction - ref="mainButton" - BID="" - type="main" - menuType="main" - setting={setting} - actions={actions} - dict={this.state.dict} - MenuID={this.props.MenuID} - logcolumns={this.state.logcolumns} - ContainerId={this.state.ContainerId} - refreshdata={this.refreshbyaction} - triggerPopview={this.triggerPopview} - getexceloutparam={this.getexceloutparam} - gettableselected={this.gettableselected} - /> : null + <div style={{minHeight: '25px'}}> + <MainAction + BID="" + type="main" + menuType="main" + setting={setting} + actions={actions} + triggerBtn={triggerBtn} + dict={this.state.dict} + MenuID={this.props.MenuID} + permRoles={this.props.permRoles} + logcolumns={this.state.logcolumns} + ContainerId={this.state.ContainerId} + refreshdata={this.refreshbyaction} + triggerPopview={this.triggerPopview} + getexceloutparam={this.getexceloutparam} + gettableselected={this.gettableselected} + /> + </div> : null } {columns && setting.onload !== 'false' ? <div className="main-table-box"> @@ -966,6 +1226,7 @@ } <MainTable ref="mainTable" + tableId="mainTable" pickup={pickup} setting={setting} columns={columns} @@ -976,6 +1237,7 @@ loading={this.state.loading} refreshdata={this.refreshbytable} buttonTrigger={this.buttonTrigger} + linkTrigger={this.linkTrigger} handleTableId={this.handleTableId} /> </div> : null @@ -985,20 +1247,23 @@ if (config[group].length === 0) return null return ( - <Tabs defaultActiveKey="0" key={group}> - {config[group].map((_tab, index) => { + <Tabs activeKey={tabActive[group]} key={group} onChange={(key) => this.setState({tabActive: {...tabActive, [group]: key}})}> + {config[group].map(_tab => { return ( <TabPane tab={ <span> {_tab.icon ? <Icon type={_tab.icon} /> : null} {_tab.label} </span> - } key={`${index}`}> + } key={_tab.uuid}> {_tab.type === 'SubTable' ? <SubTable Tab={_tab} menuType="main" MenuID={_tab.linkTab} + mainSearch={_tab.searchPass === 'true' ? search : null} + userConfig={userConfig ? userConfig[_tab.uuid] : null} + triggerBtn={triggerBtn} SupMenuID={this.props.MenuID} refreshtabs={this.state.refreshtabs} ContainerId={this.state.ContainerId} @@ -1068,17 +1333,26 @@ wrapClassName="common-table-custom-modal" title={'鑷畾涔夎缃�'} maskClosable={false} - width={850} + width={950} visible={this.state.settingVisible} - onOk={this.settingSubmit} onCancel={() => { this.setState({ settingVisible: false }) }} - confirmLoading={this.state.confirmLoading} + footer={[ + <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.state.dict['main.revert.default']}</Button>, + <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['main.cancel']}</Button>, + <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.state.dict['main.submit']}</Button> + ]} destroyOnClose > - {this.state.config ? + {this.state.settingVisible ? <VerifyCard + MenuID={this.props.MenuID} + MenuName={this.props.MenuName} + permAction={this.props.permAction} + permRoles={this.props.permRoles} config={this.state.config} - wrappedComponentRef={(inst) => this.verifyRef = inst} + userConfig={this.state.userConfig} + columns={this.state.columns} + handleParam={this.changeMenuParam} /> : null } </Modal> @@ -1094,7 +1368,9 @@ return { tabviews: state.tabviews, refreshTab: state.refreshTab, - permAction: state.permAction + permAction: state.permAction, + permMenus: state.permMenus, + permRoles: state.permRoles } } -- Gitblit v1.8.0