From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/tabviews/calendar/index.jsx | 81 ++++++++++++++++++---------------------- 1 files changed, 37 insertions(+), 44 deletions(-) diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index d78d54d..7dec056 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -1,6 +1,5 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' import { is, fromJS } from 'immutable' import { notification, Spin, Modal, Button } from 'antd' import moment from 'moment' @@ -22,7 +21,7 @@ const SubTabTable = asyncSpinComponent(() => import('@/tabviews/subtabtable')) const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) -class NormalTable extends Component { +class MkCalendar extends Component { static propTpyes = { param: PropTypes.any, // 鍏朵粬椤甸潰浼犻�掔殑鍙傛暟 MenuID: PropTypes.string, // 鑿滃崟Id @@ -32,7 +31,6 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id BID: null, // 椤甸潰璺宠浆鏃舵惡甯D loadingview: true, // 椤甸潰鍔犺浇涓� viewlost: false, // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤 @@ -40,7 +38,7 @@ config: {}, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 userConfig: null, // 鐢ㄦ埛鑷畾涔夎缃� searchlist: null, // 鎼滅储鏉′欢 - arr_field: '', // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆� + arr_field: '', // 鏌ヨ瀛楁闆� setting: null, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 data: null, // 鍒楄〃鏁版嵁闆� loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� @@ -55,7 +53,7 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { permAction, param } = this.props + const { param } = this.props let _param = { func: 'sPC_Get_LongParam', @@ -76,7 +74,7 @@ } // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆 - if (result.LongParamUser && this.props.menuType !== 'HS') { + if (result.LongParamUser && !window.GLOB.mkHS) { try { // 閰嶇疆淇℃伅瑙f瀽 userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) _curUserConfig = userConfig[this.props.MenuID] @@ -106,11 +104,6 @@ } // 鏉冮檺杩囨护 - if (this.props.menuType !== 'HS') { - if (config.tab && !permAction[config.tab.linkTab]) { - config.tab = null - } - } if (config.tab) { config.tab.uuid = Utils.getuuid() } @@ -125,7 +118,7 @@ // 瀛楁閫忚 let hasReqFields = false config.search = config.search.map(item => { - if (['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) { + if (param && ['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) { item.initval = param.$searchval } @@ -168,7 +161,6 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - let city = sessionStorage.getItem('city') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -177,8 +169,7 @@ let regs = [ { reg: /@userName@/ig, value: `'${userName}'` }, - { reg: /@fullName@/ig, value: `'${fullName}'` }, - { reg: /@login_city@/ig, value: `'${city}'` } + { reg: /@fullName@/ig, value: `'${fullName}'` } ] regs.forEach(cell => { @@ -273,11 +264,17 @@ this.setState({ loading: false }) - 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 + }) + } } } @@ -300,9 +297,11 @@ if (setting.interType === 'inner') { param.func = setting.innerFunc } else { - if (this.props.menuType === 'HS') { + if (window.GLOB.mkHS) { if (setting.sysInterface === 'true' && options.cloudServiceApi) { param.rduri = options.cloudServiceApi + param.userid = sessionStorage.getItem('CloudUserID') || '' + param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' } else if (setting.sysInterface !== 'true') { param.rduri = setting.interface } @@ -323,7 +322,7 @@ } /** - * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁� + * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼鐨勫弬鏁� */ getDefaultParam = () => { const { arr_field, search, setting, config, calendarYear } = this.state @@ -347,7 +346,12 @@ let RoleID = sessionStorage.getItem('role_id') || '' let departmentcode = sessionStorage.getItem('departmentcode') || '' let organization = sessionStorage.getItem('organization') || '' + let mk_user_type = sessionStorage.getItem('mk_user_type') || '' + let nation = sessionStorage.getItem('nation') || '' + let province = sessionStorage.getItem('province') || '' let city = sessionStorage.getItem('city') || '' + let district = sessionStorage.getItem('district') || '' + let address = sessionStorage.getItem('address') || '' if (sessionStorage.getItem('isEditState') === 'true') { userName = sessionStorage.getItem('CloudUserName') || '' @@ -363,9 +367,6 @@ } }) regoptions.push({ - reg: new RegExp('@login_city@', 'ig'), - value: city - }, { reg: new RegExp('@userName@', 'ig'), value: userName }, { @@ -403,8 +404,8 @@ param.custom_script = param.custom_script.replace(item.reg, item.value) }) - param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50) - Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @login_city='${city}' + param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) + Select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' ${param.custom_script} ` @@ -435,7 +436,11 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) param.DateCount = '' - if (this.props.menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉 + if (window.GLOB.probation) { + param.s_debug_type = 'Y' + } + + if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) } @@ -538,17 +543,16 @@ } render() { - const { menuType } = this.props const { BID, setting, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state return ( - <div className="calendar-page" id={this.state.ContainerId}> + <div className="calendar-page"> {loadingview && <Spin size="large" />} {searchlist && searchlist.length > 0 ? - <MainSearch BID={BID} searchlist={searchlist} setting={setting} menuType={menuType} refreshdata={this.refreshbysearch}/> : null + <MainSearch BID={BID} searchlist={searchlist} setting={setting} refreshdata={this.refreshbysearch}/> : null } {config && config.calendar ? <CalendarComponent calendar={config.calendar} loading={loading} data={data} triggerDate={this.triggerDate} changeDate={this.changeDate}/> : null} - {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} + {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} <Modal title={config.tab ? config.tab.label : ''} width={'80vw'} @@ -573,15 +577,4 @@ } } -const mapStateToProps = (state) => { - return { - menuType: state.editLevel, - permAction: state.permAction - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default connect(mapStateToProps, mapDispatchToProps)(NormalTable) \ No newline at end of file +export default MkCalendar \ No newline at end of file -- Gitblit v1.8.0