From 051981a2211bb86f88a6d68f2e29816f8caeac20 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 04 八月 2023 09:18:10 +0800 Subject: [PATCH] 2023-08-04 --- src/components/tabview/index.jsx | 67 ++++++------- src/tabviews/treepage/index.jsx | 2 src/views/design/index.jsx | 20 ++- src/utils/utils-datamanage.js | 6 src/views/design/header/index.jsx | 1 src/components/header/index.jsx | 4 src/templates/comtableconfig/index.jsx | 14 -- src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx | 2 src/templates/treepageconfig/index.jsx | 9 - src/menu/components/share/searchcomponent/dragsearch/card.jsx | 2 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 2 src/tabviews/custom/popview/index.jsx | 2 src/tabviews/basetable/index.jsx | 2 src/api/index.js | 2 src/tabviews/subtable/index.jsx | 2 src/tabviews/subtabtable/index.jsx | 2 src/tabviews/commontable/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 2 src/utils/utils.js | 8 + src/index.js | 19 --- src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 21 ---- src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx | 21 ---- src/mob/searchconfig/searchdragelement/card.jsx | 21 ---- src/menu/components/search/main-search/dragsearch/card.jsx | 2 src/store/options.js | 11 +- src/tabviews/custom/index.jsx | 2 src/views/systemproc/index.jsx | 2 src/utils/option.js | 2 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 1 29 files changed, 84 insertions(+), 169 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index c30b55b..78eaa0d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -839,7 +839,7 @@ } if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug', 'sPC_Get_structured_data'].includes(param.func)) { - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { param.username = sessionStorage.getItem('CloudUserName') || '' param.fullname = sessionStorage.getItem('CloudFullName') || '' } else { diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 6157a99..5fac2c3 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -314,8 +314,6 @@ loginVisible: true }) } else { - sessionStorage.setItem('isEditState', 'true') - this.props.modifyMainMenu(null) this.props.history.replace('/design') @@ -355,8 +353,6 @@ sessionStorage.setItem('CloudAvatar', res.icon) sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '') sessionStorage.setItem('cloudRole_id', res.role_id || '') - - sessionStorage.setItem('isEditState', 'true') let _url = window.location.href.split('#')[0] + 'cloud' if (param.remember) { diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 1c79abe..1d2e3da 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -31,8 +31,37 @@ state = { activeId: '', - tabviews: null, // 鏍囩闆� + tabviews: [], iFrameHeight: 0, + } + + UNSAFE_componentWillMount () { + if (!window.GLOB.mkHS) { + this.setState({ + activeId: 'home_page_id', + tabviews: [{ + MenuID: 'home_page_id', + MenuName: '棣栭〉', + type: 'Home' + }] + }) + } + } + + componentDidMount () { + MKEmitter.addListener('modifyTabs', this.modifyTabs) + MKEmitter.addListener('closeTabView', this.closeTabView) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 + */ + componentWillUnmount () { + this.setState = () => { + return + } + MKEmitter.removeListener('modifyTabs', this.modifyTabs) + MKEmitter.removeListener('closeTabView', this.closeTabView) } // 鍏抽棴tab椤碉紝閲嶆柊閫夋嫨鏄剧ず椤� @@ -213,47 +242,13 @@ } } - UNSAFE_componentWillMount () { - if (sessionStorage.getItem('isEditState') !== 'true') { - this.setState({ - activeId: 'home_page_id', - tabviews: [{ - MenuID: 'home_page_id', - MenuName: '棣栭〉', - type: 'Home' - }] - }) - } else { - this.setState({ - activeId: '', - tabviews: [] - }) - } - } - - componentDidMount () { - MKEmitter.addListener('modifyTabs', this.modifyTabs) - MKEmitter.addListener('closeTabView', this.closeTabView) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - MKEmitter.removeListener('modifyTabs', this.modifyTabs) - MKEmitter.removeListener('closeTabView', this.closeTabView) - } - render () { const { tabviews, activeId } = this.state return ( <section id="mk-tabgroup-wrap" className={'mk-tabview-wrap' + (this.props.collapse ? ' collapsed' : '')}> <div className="content-header"> - {tabviews && tabviews.length > 0 && + {tabviews.length > 0 && <Tabs activeKey={activeId}> {tabviews.map(view => { return ( diff --git a/src/index.js b/src/index.js index e9c4830..af0d183 100644 --- a/src/index.js +++ b/src/index.js @@ -10,19 +10,6 @@ import '@/assets/css/action.scss' import '@/assets/css/viewstyle.scss' -if (window.location.href.indexOf('#/design') > -1) { // 缂栬緫椤甸潰鍒锋柊鏃讹紝璺宠浆鑷充富椤� - window.location.replace(window.location.href.replace(/design/ig, 'main')) -} - -options.sysType = window.atob(options.sysType.replace('$mk', '')) -options.caId = window.atob(options.caId.replace('$mk', '')) -options.cakey = window.atob(options.cakey.replace('$mk', '')) -options.cdomain = window.atob(options.cdomain.replace('$mk', '')) - -if (options.cdomain && options.sysType !== 'cloud') { - options.cloudServiceApi = options.cdomain + '/webapi/dostars' -} - if (!localStorage.getItem('SessionUid')) { localStorage.setItem('SessionUid', (() => { let uuid = [] @@ -43,8 +30,6 @@ ) } -sessionStorage.removeItem('isEditState') - fetch('../options.json') .then(response => response.json()) .catch(() => { @@ -60,6 +45,10 @@ } } + if (options.cdomain && options.sysType !== 'cloud') { + options.cloudServiceApi = options.cdomain + '/webapi/dostars' + } + let GLOB = {} GLOB.appId = config.appId || '' GLOB.lineColor = config.lineColor || '' diff --git a/src/menu/components/search/main-search/dragsearch/card.jsx b/src/menu/components/search/main-search/dragsearch/card.jsx index 666ac3f..4e3ae1e 100644 --- a/src/menu/components/search/main-search/dragsearch/card.jsx +++ b/src/menu/components/search/main-search/dragsearch/card.jsx @@ -55,6 +55,8 @@ _defaultValue = [moment().startOf('week'), moment().endOf('week')] } else if (card.initval === 'month') { _defaultValue = [moment().startOf('month'), moment().endOf('month')] + } else if (card.initval === 'lastMonth') { + _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] } else if (card.initval) { try { let _initval = JSON.parse(card.initval) diff --git a/src/menu/components/share/searchcomponent/dragsearch/card.jsx b/src/menu/components/share/searchcomponent/dragsearch/card.jsx index 7c6754f..07df0ae 100644 --- a/src/menu/components/share/searchcomponent/dragsearch/card.jsx +++ b/src/menu/components/share/searchcomponent/dragsearch/card.jsx @@ -54,6 +54,8 @@ _defaultValue = [moment().startOf('week'), moment().endOf('week')] } else if (card.initval === 'month') { _defaultValue = [moment().startOf('month'), moment().endOf('month')] + } else if (card.initval === 'lastMonth') { + _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] } else if (card.initval) { try { let _initval = JSON.parse(card.initval) diff --git a/src/mob/searchconfig/searchdragelement/card.jsx b/src/mob/searchconfig/searchdragelement/card.jsx index 13080ed..1a469a8 100644 --- a/src/mob/searchconfig/searchdragelement/card.jsx +++ b/src/mob/searchconfig/searchdragelement/card.jsx @@ -91,27 +91,6 @@ </div> </div> </div>) - // } else if (card.type === 'daterange') { - // let value = '璇烽�夋嫨' - // if (card.initval === 'week') { - // value = [moment().startOf('week').format('YYYY-MM-DD'), moment().endOf('week').format('YYYY-MM-DD')].join(' ~ ') - // } else if (card.initval === 'month') { - // value = [moment().startOf('month').format('YYYY-MM-DD'), moment().endOf('month').format('YYYY-MM-DD')].join(' ~ ') - // } else if (card.initval) { - // try { - // let _initval = JSON.parse(card.initval) - // value = [moment().subtract(_initval[0], 'days').format('YYYY-MM-DD'), moment().subtract(_initval[1], 'days').format('YYYY-MM-DD')].join(' ~ ') - // } catch (e) { - // value = '璇烽�夋嫨' - // } - // } - // formItem = (<div className="am-list-item"> - // <div className="am-list-line"> - // {card.labelShow !== 'false' ? <div className="am-input-label">{card.label}</div> : null} - // <div className="am-input-control">{value}</div> - // <div className="am-list-extra"><RightOutlined /></div> - // </div> - // </div>) } else if (card.type === 'checkcard') { formItem = (<div className="am-list-item check-card"> <div className="am-list-line"> diff --git a/src/store/options.js b/src/store/options.js index f3492e0..3dc04f2 100644 --- a/src/store/options.js +++ b/src/store/options.js @@ -2,14 +2,13 @@ * @description 绯荤粺淇℃伅 * 1銆亂un ( Y2xv$mkdWQ= ) 銆� dandian ( U1$mkNP ) 銆� yewu ( bG9j$mkYWw= ) * 2銆亀indow.btoa('') 鍩熷悕 涓嶅甫 / - * 3銆乥aoshide old ( aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA== ) - * 4銆乸ositecgroup ( aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t ) + * 3銆乸ositecgroup ( aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t ) */ export default { - sysType: 'bG9j$mkYWw=', - caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==', - cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==', - cdomain: 'aHR0cHM6Ly9jbG91$mkZC5tazloLmNu' + sysType: window.atob('bG9j$mkYWw='.replace('$mk', '')), + caId: window.atob('MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg=='.replace('$mk', '')), + cakey: window.atob('MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ=='.replace('$mk', '')), + cdomain: window.atob('aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'.replace('$mk', '')) } /** diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index cb0262b..a541e97 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -127,7 +127,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 362273d..8243ce9 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -264,7 +264,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 136d9d5..561fc5d 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -168,7 +168,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 260b28f..8271533 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -111,7 +111,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index d23475a..67a647d 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -303,7 +303,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 50fe403..f47a63d 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -258,7 +258,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/treepage/index.jsx b/src/tabviews/treepage/index.jsx index d21411c..9e4536f 100644 --- a/src/tabviews/treepage/index.jsx +++ b/src/tabviews/treepage/index.jsx @@ -175,7 +175,7 @@ let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 20c7c41..bebb155 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -988,7 +988,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 26625f1..b8182df 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -979,7 +979,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 44a0274..a58bff3 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -552,7 +552,6 @@ } }).then(resp => { if (resp === false) return - let localParam = fromJS(param).toJS() Api.getSystemConfig(param).then(response => { if (response.status) { this.setState({ @@ -561,15 +560,7 @@ originMenu: fromJS(_config).toJS() }) - localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' - delete localParam.LongParam - delete localParam.PageParam - delete localParam.Template - delete localParam.Sort - delete localParam.EasyCode - delete localParam.open_edition - - this.submitAction(btnParam, localParam) + this.submitAction(btnParam) } else { this.setState({ menuloading: false, @@ -589,7 +580,7 @@ /** * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽泦 */ - submitAction = (btnParam, localParam) => { + submitAction = (btnParam) => { const { config } = this.state new Promise(resolve => { @@ -685,7 +676,6 @@ }) } this.props.reloadmenu() - Api.genericInterface(localParam) } else { this.setState({ menuloading: false, diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx index f65bb50..b5bd01f 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx @@ -55,6 +55,8 @@ _defaultValue = [moment().startOf('week'), moment().endOf('week')] } else if (card.initval === 'month') { _defaultValue = [moment().startOf('month'), moment().endOf('month')] + } else if (card.initval === 'lastMonth') { + _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] } else if (card.initval) { try { let _initval = JSON.parse(card.initval) diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 41a27a1..8bac6a7 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -84,6 +84,7 @@ {value: '[3, 0]', label: '杩戜笁澶�'}, {value: '[7, 0]', label: '杩戜竷澶�'}, {value: '[30, 0]', label: '杩�30澶�'}, + {value: '[90, 0]', label: '杩�90澶�'}, {value: '[7, -7]', label: '鍓嶅悗涓冨ぉ'}, {value: '[30, -30]', label: '鍓嶅悗30澶�'}, {value: '[90, -90]', label: '鍓嶅悗90澶�'}, diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 29f51db..a86f41a 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -2,9 +2,7 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Input, Radio, Tooltip, notification, Select, InputNumber } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import moment from 'moment' -import Api from '@/api' import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' @@ -72,7 +70,6 @@ } handleConfirm = () => { - const { setting } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { @@ -140,24 +137,6 @@ reject() return } - } - - // 鏁版嵁婧愪繚瀛� - if ( - values.interType === 'system' && values.default !== 'false' && - /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource - ) { - let param = { - func: 's_DataSrc_Save', - LText: values.dataresource, - MenuID: this.props.menu.MenuID - } - - param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - Api.genericInterface(param) } resolve(values) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx index 0a21e7d..6ac9645 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx @@ -2,9 +2,7 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import moment from 'moment' -import Api from '@/api' import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' import CodeMirror from '@/templates/zshare/codemirror' @@ -61,7 +59,6 @@ } handleConfirm = () => { - const { setting } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { @@ -129,24 +126,6 @@ reject() return } - } - - // 鏁版嵁婧愪繚瀛� - if ( - values.interType === 'system' && values.default !== 'false' && - /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource - ) { - let param = { - func: 's_DataSrc_Save', - LText: values.dataresource, - MenuID: this.props.menu.MenuID - } - - param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - Api.genericInterface(param) } resolve(values) diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx index 2847f1f..7448caf 100644 --- a/src/templates/treepageconfig/index.jsx +++ b/src/templates/treepageconfig/index.jsx @@ -403,14 +403,6 @@ } }).then(resp => { if (resp === false) return - let localParam = fromJS(param).toJS() - localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' - delete localParam.LongParam - delete localParam.PageParam - delete localParam.Template - delete localParam.Sort - delete localParam.EasyCode - delete localParam.open_edition Api.getSystemConfig(param).then(response => { if (response.status) { @@ -429,7 +421,6 @@ }) this.props.reloadmenu() - Api.genericInterface(localParam) if (this.state.closeVisible) { this.props.handleView() diff --git a/src/utils/option.js b/src/utils/option.js index f001d84..f876513 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -146,6 +146,7 @@ {value: '[3, 0]', text: '杩戜笁澶�'}, {value: '[7, 0]', text: '杩戜竷澶�'}, {value: '[30, 0]', text: '杩�30澶�'}, + {value: '[90, 0]', text: '杩�90澶�'}, {value: '[7, -7]', text: '鍓嶅悗涓冨ぉ'}, {value: '[30, -30]', text: '鍓嶅悗30澶�'}, {value: '[90, -90]', text: '鍓嶅悗90澶�'}, @@ -155,6 +156,7 @@ {value: '[-2, -2]', text: '鍚庡ぉ'}, {value: 'week', text: '鏈懆'}, {value: 'month', text: '鏈湀'}, + {value: 'lastMonth', text: '涓婃湀'}, ], datetime: [ {value: '', text: '绌�'}, diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 6550fe8..86c4751 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -125,7 +125,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } @@ -334,7 +334,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } @@ -505,7 +505,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/utils/utils.js b/src/utils/utils.js index 967ae7e..b9878c6 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -335,6 +335,8 @@ item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',') } else if (item.initval === 'month') { item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',') + } else if (item.initval === 'lastMonth') { + item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',') } else if (item.initval) { try { let _initval = JSON.parse(item.initval) @@ -896,7 +898,7 @@ let address = sessionStorage.getItem('address') || '' let _sheet = item.sheet - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } @@ -1206,7 +1208,7 @@ let _sheet = btn.sheet let BID = data[0].$$BID || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } @@ -1598,7 +1600,7 @@ let district = sessionStorage.getItem('district') || '' let address = sessionStorage.getItem('address') || '' - if (sessionStorage.getItem('isEditState') === 'true') { + if (window.GLOB.mkHS) { userName = sessionStorage.getItem('CloudUserName') || '' fullName = sessionStorage.getItem('CloudFullName') || '' } diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx index 2155478..7396c9a 100644 --- a/src/views/design/header/index.jsx +++ b/src/views/design/header/index.jsx @@ -189,6 +189,7 @@ } changeEditState = () => { + sessionStorage.removeItem('isEditState') this.props.history.replace('/main') window.location.reload() } diff --git a/src/views/design/index.jsx b/src/views/design/index.jsx index 5cd309f..4417706 100644 --- a/src/views/design/index.jsx +++ b/src/views/design/index.jsx @@ -1,4 +1,5 @@ import React, {Component} from 'react' +import { withRouter } from 'react-router-dom' import { ConfigProvider } from 'antd' import enUS from 'antd/es/locale/en_US' import zhCN from 'antd/es/locale/zh_CN' @@ -14,11 +15,18 @@ class Design extends Component { componentDidMount() { - window.debugger = false - window.GLOB.breakpoint = false - window.GLOB.designView = true - sessionStorage.removeItem('breakpoint') - setGLOBFuncs() + if (sessionStorage.getItem('isEditState') === 'true') { + sessionStorage.removeItem('isEditState') + this.props.history.replace('/main') + window.location.reload() + } else { + sessionStorage.setItem('isEditState', 'true') + window.debugger = false + window.GLOB.breakpoint = false + window.GLOB.designView = true + sessionStorage.removeItem('breakpoint') + setGLOBFuncs() + } } render () { @@ -33,4 +41,4 @@ } } -export default Design \ No newline at end of file +export default withRouter(Design) \ No newline at end of file diff --git a/src/views/systemproc/index.jsx b/src/views/systemproc/index.jsx index 7aab3b5..6d48c4c 100644 --- a/src/views/systemproc/index.jsx +++ b/src/views/systemproc/index.jsx @@ -2,8 +2,6 @@ import { ConfigProvider } from 'antd' import zhCN from 'antd/es/locale/zh_CN' -// import Api from '@/api' -// import Utils from '@/utils/utils.js' import Header from '../systemfunc/header' import Proc from './proc' import './index.scss' -- Gitblit v1.8.0