From d441fa1e1cc80f4ea462a750a42a2b25c1f2b202 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 04 十二月 2020 15:17:51 +0800 Subject: [PATCH] 2020-12-04 --- src/tabviews/calendar/index.jsx | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index 0689eea..4c964cd 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -50,7 +50,8 @@ visible: false, // 鏍囩椤垫帶鍒� triggerTime: '', // 鐐瑰嚮鏃堕棿 treevisible: false, // 鑿滃崟缁撴瀯鏍戝脊妗嗘樉绀洪殣钘忔帶鍒� - calendarYear: moment().format('YYYY') // 鏃ュ巻骞翠唤 + calendarYear: moment().format('YYYY'), // 鏃ュ巻骞翠唤 + debug: sessionStorage.getItem('debug') === 'true' } /** @@ -121,6 +122,7 @@ // 瀛楁鏉冮檺榛戝悕鍗曘�佸繀濉�佸瓧娈甸�忚 let valid = true + let roleId = sessionStorage.getItem('role_id') || '' config.search = config.search.map(item => { item.oriInitval = item.initval if (['text', 'select', 'link'].includes(item.type) && param) { @@ -138,12 +140,7 @@ } if (!item.blacklist || item.blacklist.length === 0) return item - - let _black = item.blacklist.filter(v => { - return this.props.permRoles.indexOf(v) !== -1 - }) - - if (_black.length > 0) { + if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { item.Hide = 'true' } @@ -170,7 +167,7 @@ config.setting.dataresource = '(' + config.setting.dataresource + ') tb' } - if (this.props.dataManager) { // 鏁版嵁鏉冮檺 + if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*') config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/') _customScript = _customScript.replace(/\$@/ig, '/*') @@ -244,7 +241,7 @@ param.BID = BID } // 鏁版嵁绠$悊鏉冮檺 - if (this.props.dataManager) { + if (sessionStorage.getItem('dataM') === 'true') { param.dataM = 'Y' } @@ -584,7 +581,7 @@ render() { const { menuType } = this.props - const { BID, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state + const { debug, BID, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state return ( <div className="calendar-page" id={this.state.ContainerId}> @@ -595,12 +592,11 @@ dict={this.state.dict} searchlist={searchlist} menuType={menuType} - dataManager={this.props.dataManager} refreshdata={this.refreshbysearch} /> : null } {config && config.calendar ? <CalendarComponent calendar={config.calendar} loading={loading} data={data} triggerDate={this.triggerDate} changeDate={this.changeDate}/> : null} - {options.sysType !== 'cloud' && menuType !== 'HS' ? <Button + {debug && options.sysType !== 'cloud' && menuType !== 'HS' ? <Button icon="copy" shape="circle" className="common-table-copy" @@ -656,9 +652,7 @@ const mapStateToProps = (state) => { return { menuType: state.editLevel, - permAction: state.permAction, - permRoles: state.permRoles, - dataManager: state.dataManager + permAction: state.permAction } } -- Gitblit v1.8.0