From be107069b14c8d23b9d1aa50391897324dfa9f35 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 05 九月 2023 21:57:27 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/components/tabview/index.scss | 2 src/utils/utils-datamanage.js | 48 - src/tabviews/zshare/automatic/index.scss | 14 src/tabviews/zshare/topSearch/index.jsx | 10 src/tabviews/zshare/settingcomponent/index.jsx | 23 src/tabviews/zshare/actionList/excelInbutton/index.jsx | 52 - src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 184 +++----- src/tabviews/zshare/automatic/index.jsx | 11 src/tabviews/custom/popview/index.jsx | 10 src/tabviews/basetable/index.jsx | 92 +++ src/views/systemfunc/index.jsx | 4 src/api/index.js | 16 src/tabviews/custom/index.scss | 17 src/tabviews/commontable/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 101 ++-- src/index.js | 8 src/tabviews/zshare/tablenodes/index.jsx | 11 src/tabviews/basetable/index.scss | 20 src/tabviews/zshare/settingcomponent/index.scss | 25 src/tabviews/zshare/flowFloat/index.jsx | 225 ++++++++++ src/tabviews/zshare/actionList/printbutton/index.jsx | 50 - src/tabviews/zshare/mutilform/index.jsx | 13 /dev/null | 35 - src/tabviews/commontable/index.scss | 11 src/tabviews/custom/components/chart/antv-X6/index.jsx | 58 ++ src/tabviews/custom/components/module/voucher/voucherTable/index.jsx | 15 src/tabviews/custom/index.jsx | 99 ++++ src/tabviews/zshare/flowFloat/index.scss | 80 +++ src/tabviews/zshare/tablenodes/index.scss | 11 29 files changed, 801 insertions(+), 446 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 21617d1..ca423f9 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -560,11 +560,7 @@ param.appkey = param.appkey || window.GLOB.appkey let url = '/webapi/dostars' - if (window.GLOB.mkHS && window.GLOB.cloudServiceApi) { // HS涓嬶紝涓斿瓨鍦ㄤ簯绔湴鍧� - url = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (window.GLOB.mainSystemApi) { + if (window.GLOB.mainSystemApi) { if (!window.GLOB.transfer) { url = window.GLOB.mainSystemApi } else { @@ -592,13 +588,7 @@ param.appkey = param.appkey || window.GLOB.appkey || '' let url = '/webapi/dostars' - if (window.GLOB.mkHS) { // HS涓嬶紝鍗曠偣鐧诲綍鏈嶅姟鍣ㄤ负浜戠 - if (window.GLOB.cloudServiceApi) { // 瀛樺湪浜戠鍦板潃鏃讹紝浣跨敤浜戠绯荤粺鍙傛暟 - url = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } - } else if (window.GLOB.mainSystemApi) { + if (window.GLOB.mainSystemApi) { if (!window.GLOB.transfer) { url = window.GLOB.mainSystemApi } else { @@ -915,7 +905,7 @@ let time = +sessionStorage.getItem(rduri) let c_time = Math.round(new Date().getTime() / 1000) - if (time && c_time - time <= 60) { + if (time && c_time - time <= 1800) { sessionStorage.setItem(rduri, c_time) return axios({ url: `${url}${param.func ? '/' + param.func : ''}`, diff --git a/src/components/tabview/index.scss b/src/components/tabview/index.scss index 5b85043..040e6bf 100644 --- a/src/components/tabview/index.scss +++ b/src/components/tabview/index.scss @@ -67,7 +67,7 @@ >.ant-tabs-content { height: 100%; .ant-tabs-tabpane:first-child { - .page-setting-wrap, .page-message-wrap { + .user-tools { display: none; } } diff --git a/src/index.js b/src/index.js index 7d261fb..53cadc4 100644 --- a/src/index.js +++ b/src/index.js @@ -112,6 +112,14 @@ if (/#\/hs$/.test(window.location.href)) { // hs涓嬩笉鎵撳嵃鑴氭湰 GLOB.debugger = false + + if (GLOB.mainSystemApi) { + GLOB.localSystemApi = GLOB.mainSystemApi + GLOB.mainSystemApi = '' + } + if (GLOB.cloudServiceApi) { + GLOB.mainSystemApi = GLOB.cloudServiceApi + } } if (GLOB.sysType !== 'cloud') { diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 4f0028e..e6b4a31 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -13,6 +13,7 @@ // 閫氱敤缁勪欢 const AntvTabs = asyncComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs')) const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table')) +const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent')) const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) @@ -35,7 +36,6 @@ lostmsg: '', // 椤甸潰涓㈠け鏃剁殑鎻愮ず淇℃伅 config: null, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷粍浠剁瓑 userConfig: null, // 鐢ㄦ埛鑷畾涔夎缃� - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� visible: false, // 鏍囩椤垫帶鍒� shortcuts: null, // 蹇嵎閿� autoMatic: null @@ -102,8 +102,50 @@ return } + if (config.process === 'true') { + let unset = true + if (result.works_flow_code && result.works_long_param) { + try { // 娴佺▼淇℃伅瑙f瀽 + let flowConfig = JSON.parse(window.decodeURIComponent(window.atob(result.works_long_param))) + flowConfig.flow_code = result.works_flow_code + flowConfig.flow_name = result.works_flow_name + config.flow_code = result.works_flow_code + config.flow_name = result.works_flow_name + unset = false + + window.GLOB.UserCacheMap.set('flow' + MenuID, flowConfig) + } catch (e) { + unset = true + console.warn('Parse Failure') + } + } + + if (unset) { + this.setState({ + config: config, + viewlost: true, + loadingview: false, + lostmsg: '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭璁剧疆宸ヤ綔娴侊紝璇疯仈绯荤鐞嗗憳銆�' + }) + return + } + } else if (result.works_flow_code) { + Api.getSystemConfig({ + func: 's_works_flow_param_sso_menu_upt_v6', + upt_type: 'del', + works_flow_code: '', + works_flow_name: '', + long_param: '', + flow_id: '', + menuid: config.MenuID, + menuname: config.MenuName, + username: sessionStorage.getItem('User_Name') || '', + fullName: sessionStorage.getItem('Full_Name') || '' + }) + } + // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆 - if (result.LongParamUser && !window.GLOB.mkHS) { + if (result.LongParamUser) { try { // 閰嶇疆淇℃伅瑙f瀽 let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) if (userConfig) { @@ -148,7 +190,7 @@ }) } - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName) + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true') let autoMatic = null if (config.autoMatic && config.autoMatic.enable === 'true') { @@ -263,10 +305,15 @@ } } - filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName) => { + filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName, process) => { return components.filter(item => { item.$pageId = pageId item.$searchId = pageId + + if (process) { + item.$process = process + item.$flowId = 'flow' + this.props.MenuID + } item.$menuname = (MenuName || '') + '-' + (item.name || '涓昏〃') @@ -287,7 +334,7 @@ if (tab.permission !== 'true') { // 鏉冮檺鏈紑鍚笉鍋氭潈闄愭帶鍒� skip = true } - tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName) + tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName, process) return tab }) @@ -410,6 +457,11 @@ cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID cell.$view = 'popview' + + if (item.$process) { + cell.$process = true + cell.$flowId = 'flow' + this.props.MenuID + } if (cell.controlField) { if (/,/ig.test(cell.controlVal)) { @@ -640,7 +692,6 @@ loadingview: true, // 椤甸潰鍔犺浇涓� viewlost: false, // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤 config: null, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷粍浠剁瓑 - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� shortcuts: null, }, () => { this.loadconfig() @@ -670,17 +721,30 @@ } render() { - const { loadingview, viewlost, config, loading, shortcuts, autoMatic } = this.state + const { loadingview, viewlost, config, shortcuts, autoMatic } = this.state + + if (!config || viewlost) { + return ( + <div className="custom-table-wrap"> + {loadingview ? <Spin className="view-spin" size="large" /> : null} + {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} + <div className="user-tools"> + {config && config.process === 'true' ? <FlowFloat init={true} config={config}/> : null} + </div> + </div> + ) + } return ( - <div className={'custom-table-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}> - {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null} + <div className="custom-table-wrap" id={this.state.ContainerId} style={config.style}> <Row className="component-wrap">{this.getComponents()}</Row> - {config && window.GLOB.breakpoint ? <DebugTable /> : null} - {!window.GLOB.mkHS && config && autoMatic ? <AutoMatic autoMatic={autoMatic} tabId={config.MenuID} config={config.components[0]} /> : null} - {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null} - {!window.GLOB.mkHS && config ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} - {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} + {window.GLOB.breakpoint ? <DebugTable /> : null} + <div className="user-tools"> + {autoMatic ? <AutoMatic autoMatic={autoMatic} tabId={config.MenuID} config={config.components[0]} /> : null} + {config.process === 'true' ? <FlowFloat config={config}/> : null} + <SettingComponent config={config} shortcuts={shortcuts || []}/> + <TableNodes config={config} /> + </div> </div> ) } diff --git a/src/tabviews/basetable/index.scss b/src/tabviews/basetable/index.scss index 8581886..be83043 100644 --- a/src/tabviews/basetable/index.scss +++ b/src/tabviews/basetable/index.scss @@ -43,9 +43,21 @@ .ant-btn-link:hover { opacity: 0.8; } -} -.custom-table-wrap.loading { - .ant-spin-spinning:not(.view-spin) { - display: none; + + .user-tools { + position: fixed; + z-index: 2; + bottom: 55px; + right: 20px; + .tool-wrap { + margin-top: 5px; + .ant-btn { + width: 40px; + height: 40px; + } + .anticon-forward { + font-size: 20px; + } + } } } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index ab15b41..b688628 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -1134,7 +1134,7 @@ </Tabs>)) } {setting && window.GLOB.breakpoint ? <DebugTable /> : null} - {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} + {setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} </div> ) diff --git a/src/tabviews/commontable/index.scss b/src/tabviews/commontable/index.scss index 12b410e..1454435 100644 --- a/src/tabviews/commontable/index.scss +++ b/src/tabviews/commontable/index.scss @@ -137,4 +137,15 @@ clear: both; } } + + .tool-wrap { + position: fixed; + z-index: 2; + bottom: 55px; + right: 20px; + .ant-btn { + width: 40px; + height: 40px; + } + } } \ No newline at end of file diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx index 781b43c..32267f3 100644 --- a/src/tabviews/custom/components/chart/antv-X6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx @@ -387,6 +387,7 @@ loading: false, status: 0, flowname: '', + flowcode: '', orgs: [] } @@ -621,7 +622,8 @@ this.setState({ status: item.status || 0, - flowname: item.works_flow_name, + flowname: item.works_flow_name || '', + flowcode: item.works_flow_code || '', loading: false }) @@ -1535,7 +1537,7 @@ } save = () => { - const { BID, plot, status } = this.state + const { BID, plot, status, flowname, flowcode } = this.state if (!BID) { Modal.error({ @@ -1569,18 +1571,52 @@ ID: BID, BID: '' } + + let ssoParam = { + func: 's_works_flow_param_sso_upt_v6', + status: status, + ID: BID, + works_flow_code: flowcode, + works_flow_name: flowname, + long_param: window.btoa(window.encodeURIComponent(JSON.stringify(nodes))) + } Api.genericInterface(param).then(res => { if (res.status) { - notification.success({ - top: 92, - message: '淇濆瓨鎴愬姛锛�', - duration: 2 - }) - this.setState({ - loading: false, - status: _status - }) + if (plot.subtype === 'xflow') { + Api.getSystemConfig(ssoParam).then(result => { + if (result.status) { + notification.success({ + top: 92, + message: '淇濆瓨鎴愬姛锛�', + duration: 2 + }) + this.setState({ + loading: false, + status: _status + }) + } else { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + this.setState({ + loading: false + }) + } + }) + } else { + notification.success({ + top: 92, + message: '淇濆瓨鎴愬姛锛�', + duration: 2 + }) + this.setState({ + loading: false, + status: _status + }) + } } else { notification.error({ top: 92, diff --git a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx index 914d039..ff923d4 100644 --- a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx +++ b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx @@ -1136,10 +1136,23 @@ } }) + let _total = debit + if (debit === 0) { + debit = '' + } + + if (_total === '' && credit !== '') { + _total = 0 + } + + if (credit === 0) { + credit = '' + } + totalLine.debit = debit totalLine.credit = credit - totalLine.subject_voucher_text = this.changeMoneyToChinese(debit) + totalLine.subject_voucher_text = this.changeMoneyToChinese(_total) return totalLine } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 2686241..7d5f9c3 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -44,6 +44,7 @@ const Iframe = asyncComponent(() => import('./components/iframe')) const Calendar = asyncComponent(() => import('./components/calendar')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) +const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) const MkInterfaces = asyncComponent(() => import('@/tabviews/custom/components/interfaces')) @@ -132,8 +133,51 @@ return } + if (config.process === 'true') { + let unset = true + if (result.works_flow_code && result.works_long_param) { + try { // 娴佺▼淇℃伅瑙f瀽 + let flowConfig = JSON.parse(window.decodeURIComponent(window.atob(result.works_long_param))) + flowConfig.flow_code = result.works_flow_code + flowConfig.flow_name = result.works_flow_name + config.flow_code = result.works_flow_code + config.flow_name = result.works_flow_name + unset = false + + window.GLOB.UserCacheMap.set('flow' + MenuID, flowConfig) + } catch (e) { + unset = true + console.warn('Parse Failure') + } + } + + if (unset) { + config.interfaces = [] + this.setState({ + config: config, + viewlost: true, + loadingview: false, + lostmsg: '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭璁剧疆宸ヤ綔娴侊紝璇疯仈绯荤鐞嗗憳銆�' + }) + return + } + } else if (result.works_flow_code) { + Api.getSystemConfig({ + func: 's_works_flow_param_sso_menu_upt_v6', + upt_type: 'del', + works_flow_code: '', + works_flow_name: '', + long_param: '', + flow_id: '', + menuid: config.MenuID, + menuname: config.MenuName, + username: sessionStorage.getItem('User_Name') || '', + fullName: sessionStorage.getItem('Full_Name') || '' + }) + } + // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆 - if (result.LongParamUser && !window.GLOB.mkHS) { + if (result.LongParamUser) { try { // 閰嶇疆淇℃伅瑙f瀽 let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) if (userConfig) { @@ -193,7 +237,7 @@ let initInters = [] config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters) - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID) + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') let params = [] let BID = param.$BID || '' @@ -324,12 +368,17 @@ } } - filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) => { + filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process) => { return components.filter(item => { item.$pageId = pageId item.$searchId = searchId item.$syncId = syncId + if (process) { + item.$process = process + item.$flowId = 'flow' + this.props.MenuID + } + if (cache) { item.$cache = cache item.$time = time @@ -444,7 +493,7 @@ _searchId = tab.uuid } - tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid) + tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid, process) if (_searchId === tab.uuid) { tab.components.forEach(cell => { @@ -468,7 +517,7 @@ return false } - item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) + item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process) return true } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) { @@ -720,6 +769,11 @@ group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' } + if (item.$process) { + group.subButton.$process = true + group.subButton.$flowId = 'flow' + this.props.MenuID + } + if (item.$cache && item.$time) { group.$cache = item.$cache group.$time = item.$time @@ -812,6 +866,11 @@ cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID cell.$view = 'popview' + + if (item.$process) { + cell.$process = true + cell.$flowId = 'flow' + this.props.MenuID + } if (cell.btnstyle) { // 鍏煎 cell.style = cell.style || {} @@ -1572,15 +1631,29 @@ render() { const { loadingview, viewlost, config, loading, shortcuts, BID } = this.state + if (!config || viewlost) { + return ( + <div className="custom-page-wrap"> + {loadingview ? <Spin className="view-spin" size="large" /> : null} + {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} + <div className="user-tools"> + {config && config.process === 'true' ? <FlowFloat init={true} config={config}/> : null} + </div> + </div> + ) + } + return ( - <div className={`custom-page-wrap ${config && config.minWidth ? 'mk-scroll' : ''} ${loadingview || loading ? 'loading' : ''} ${config && config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config ? config.style : null}> - {(loadingview || (loading && !config.$cache)) ? <Spin className="view-spin" size="large" /> : null} - <Row id={config ? 'menu' + config.uuid : ''} style={config && config.minWidth ? {minWidth: config.minWidth} : null} className="component-wrap">{this.getComponents()}</Row> - {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null} - {config && window.GLOB.breakpoint ? <DebugTable /> : null} - {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null} - {!window.GLOB.mkHS && config ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} - {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} + <div className={`custom-page-wrap ${config.minWidth ? 'mk-scroll' : ''} ${loading ? 'loading' : ''} ${config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config.style}> + {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null} + <Row id={'menu' + config.uuid} style={{minWidth: config.minWidth || 'unset'}} className="component-wrap">{this.getComponents()}</Row> + {config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null} + {window.GLOB.breakpoint ? <DebugTable /> : null} + <div className="user-tools"> + {config.process === 'true' ? <FlowFloat config={config}/> : null} + <SettingComponent config={config} shortcuts={shortcuts || []}/> + <TableNodes config={config} /> + </div> </div> ) } diff --git a/src/tabviews/custom/index.scss b/src/tabviews/custom/index.scss index ede42fb..b2f1683 100644 --- a/src/tabviews/custom/index.scss +++ b/src/tabviews/custom/index.scss @@ -43,6 +43,23 @@ .ant-btn-link:hover { opacity: 0.8; } + + .user-tools { + position: fixed; + z-index: 2; + bottom: 55px; + right: 20px; + .tool-wrap { + margin-top: 5px; + .ant-btn { + width: 40px; + height: 40px; + } + .anticon-forward { + font-size: 20px; + } + } + } } .custom-page-wrap.loading { .ant-spin-spinning:not(.view-spin) { diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 7463f80..4555cbd 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -172,6 +172,11 @@ item.$pageId = Tab.uuid item.$searchId = searchId item.$syncId = syncId + + if (Tab.$process) { + item.$process = true + item.$flowId = Tab.$flowId + } if (item.style && item.style.boxShadow) { delete item.style.hShadow @@ -586,6 +591,11 @@ cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid + if (Tab.$process) { + cell.$process = true + cell.$flowId = Tab.$flowId + } + if (cell.btnstyle) { // 鍏煎 cell.style = cell.style || {} cell.style = {...cell.style, ...cell.btnstyle} diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index 6764de0..02b4f08 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -354,7 +354,7 @@ param.LText = Utils.formatOptions(param.LText) param.secretkey = Utils.encrypt('', param.timestamp) - if (window.GLOB.mkHS && param.timestamp) { // 浜戠楠岃瘉 + if (window.GLOB.mkHS) { // 浜戠楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) } @@ -473,40 +473,26 @@ // 澶栭儴璇锋眰 _outParam = fromJS(res).toJS() - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - param.rduri = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi } - } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - param.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - param.$token = btn.exProInterface || '' - } else { - param.$token = btn.exInterface || '' - } - ver_token = true + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + param.$token = btn.exProInterface || '' } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { - param.$login = true - } + param.$token = btn.exInterface || '' + } + ver_token = true + } else { + if (window.GLOB.systemType === 'production' && btn.proInterface) { + param.rduri = btn.proInterface + } else { + param.rduri = btn.interface + } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { + param.$login = true } } diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 0cab6e9..d1ad8dc 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -198,39 +198,25 @@ } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟 let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search) - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - param.rduri = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + param.$token = btn.exProInterface || '' + } else { + param.$token = btn.exInterface || '' } } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - param.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - param.$token = btn.exProInterface || '' - } else { - param.$token = btn.exInterface || '' - } + if (window.GLOB.systemType === 'production' && btn.proInterface) { + param.rduri = btn.proInterface } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { - param.$login = true - } + param.rduri = btn.interface + } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { + param.$login = true } } @@ -259,39 +245,25 @@ delete res.message delete res.status - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - res.rduri = window.GLOB.cloudServiceApi - res.userid = sessionStorage.getItem('CloudUserID') || '' - res.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + res.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + res.$token = btn.exProInterface || '' + } else { + res.$token = btn.exInterface || '' } } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - res.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - res.$token = btn.exProInterface || '' - } else { - res.$token = btn.exInterface || '' - } + if (window.GLOB.systemType === 'production' && btn.proInterface) { + res.rduri = btn.proInterface } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { - res.$login = true - } + res.rduri = btn.interface + } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { + res.$login = true } } @@ -345,39 +317,25 @@ delete res.message delete res.status - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - res.rduri = window.GLOB.cloudServiceApi - res.userid = sessionStorage.getItem('CloudUserID') || '' - res.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + res.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + res.$token = btn.exProInterface || '' + } else { + res.$token = btn.exInterface || '' } } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - res.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - res.$token = btn.exProInterface || '' - } else { - res.$token = btn.exInterface || '' - } + if (window.GLOB.systemType === 'production' && btn.proInterface) { + res.rduri = btn.proInterface } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { - res.$login = true - } + res.rduri = btn.interface + } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { + res.$login = true } } @@ -433,40 +391,26 @@ } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟 param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search, true, pageIndex, pageSize) - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - param.rduri = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + param.$token = btn.exProInterface || '' + } else { + param.$token = btn.exInterface || '' } } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - param.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - param.$token = btn.exProInterface || '' - } else { - param.$token = btn.exInterface || '' - } + if (window.GLOB.systemType === 'production' && btn.proInterface) { + param.rduri = btn.proInterface } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - param.rduri = btn.proInterface - } else { - param.rduri = btn.interface - } + param.rduri = btn.interface + } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { - param.$login = true - } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { + param.$login = true } } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index dcceb12..a3785f0 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1531,9 +1531,11 @@ } }) + keys = keys.join(',') + lines.push({ - table: tb, - insert: `Insert into ${pre}${tb} (${keys.join(',')},[mk_level],[mk_id],[mk_bid])`, + table: md5(tb + keys), + insert: `Insert into ${pre}${tb} (${keys},[mk_level],[mk_id],[mk_bid])`, select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` }) @@ -1617,19 +1619,17 @@ sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) sql = sql.replace(/@typename@/ig, `'admin'`) + if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 + sql = sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') + } else { + sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') + } + if (window.GLOB.debugger === true) { console.info(sql.replace(/\n\s{8}/ig, '\n')) } param.LText = sql - - if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 - param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') - } else { - param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') - } - param.LText = param.LText.replace(/\$check@|@check\$/ig, '') - param.exec_type = 'y' // 鍚庡彴瑙g爜 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) @@ -1838,52 +1838,43 @@ if (btn.outerFunc) { result.func = btn.outerFunc } - if (window.GLOB.mkHS) { - if (btn.outerFunc === 's_app_version_upt') { // special 鏇存柊鐗堟湰鍙锋椂璁块棶sso - if (window.GLOB.mainSystemApi) { - result.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - result.rduri = window.GLOB.cloudServiceApi - result.userid = sessionStorage.getItem('CloudUserID') || '' - result.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - result.rduri = btn.proInterface - } else { - result.rduri = btn.interface - } + + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + result.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + result.$token = btn.exProInterface || '' + } else { + result.$token = btn.exInterface || '' + } + ver_token = true + } else { + if (window.GLOB.systemType === 'production' && btn.proInterface) { + result.rduri = btn.proInterface + } else { + result.rduri = btn.interface } - // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 - if (result.func === 's_sDataDictb_TBBack' && result.LTextOut) { + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (result.rduri.indexOf(host) === -1 && /\/dostars/.test(result.rduri)) { + result.$login = true + } + } + + if (window.GLOB.mkHS) { + if (result.func === 's_app_version_upt') { // special 鏇存柊鐗堟湰鍙锋椂璁块棶sso + delete result.rduri + if (window.GLOB.localSystemApi) { + result.rduri = window.GLOB.localSystemApi + } + result.userid = sessionStorage.getItem('LocalUserID') || '' + result.LoginUID = sessionStorage.getItem('LocalLoginUID') || '' + } else if (result.func === 's_sDataDictb_TBBack' && result.LTextOut) { // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 result.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') result.secretkey = Utils.encrypt(result.LTextOut, result.timestamp) result.open_key = Utils.encryptOpenKey(result.secretkey, result.timestamp) - } - } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - result.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - result.$token = btn.exProInterface || '' - } else { - result.$token = btn.exInterface || '' - } - ver_token = true - } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - result.rduri = btn.proInterface - } else { - result.rduri = btn.interface - } - - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (result.rduri.indexOf(host) === -1 && /\/dostars/.test(result.rduri)) { - result.$login = true - } } } @@ -2011,10 +2002,12 @@ callParam.open_key = Utils.encryptOpenKey(callParam.secretkey, callParam.timestamp) } - if (callParam.UpType === 'SSO' && window.GLOB.mainSystemApi) { - ssoParam = fromJS(callParam).toJS() + callParam.userid = sessionStorage.getItem('LocalUserID') || '' + callParam.LoginUID = sessionStorage.getItem('LocalLoginUID') || '' - ssoParam.rduri = window.GLOB.mainSystemApi + if (callParam.UpType === 'SSO' && window.GLOB.localSystemApi) { + ssoParam = fromJS(callParam).toJS() + ssoParam.rduri = window.GLOB.localSystemApi delete ssoParam.UpType } else { diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index f861522..6691220 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1217,41 +1217,27 @@ // 澶栭儴璇锋眰 _outParam = JSON.parse(JSON.stringify(res)) - if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - res.rduri = window.GLOB.cloudServiceApi - res.userid = sessionStorage.getItem('CloudUserID') || '' - res.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } + if (btn.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + res.rduri = window.GLOB.mainSystemApi } - } else { - if (btn.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - res.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - res.$token = btn.exProInterface || '' - } else { - res.$token = btn.exInterface || '' - } - ver_token = true + } else if (btn.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + res.$token = btn.exProInterface || '' } else { - if (window.GLOB.systemType === 'production' && btn.proInterface) { - res.rduri = btn.proInterface - } else { - res.rduri = btn.interface - } + res.$token = btn.exInterface || '' + } + ver_token = true + } else { + if (window.GLOB.systemType === 'production' && btn.proInterface) { + res.rduri = btn.proInterface + } else { + res.rduri = btn.interface + } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { - res.$login = true - } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) { + res.$login = true } } diff --git a/src/tabviews/zshare/automatic/index.jsx b/src/tabviews/zshare/automatic/index.jsx index 951001a..8d3f243 100644 --- a/src/tabviews/zshare/automatic/index.jsx +++ b/src/tabviews/zshare/automatic/index.jsx @@ -4,7 +4,7 @@ import { Button, message } from 'antd' import MKEmitter from '@/utils/events.js' -import './index.scss' +// import './index.scss' class AutoMatic extends Component { static propTpyes = { @@ -223,12 +223,9 @@ const { running } = this.state return ( - <Button - icon={running ? 'pause' : 'forward'} - shape="circle" - className={'auto-matic ' + (window.GLOB.systemType === 'production' ? 'low' : '')} - onClick={this.trigger} - /> + <div className="tool-wrap"> + <Button icon={running ? 'pause' : 'forward'} shape="circle" onClick={this.trigger}/> + </div> ) } } diff --git a/src/tabviews/zshare/automatic/index.scss b/src/tabviews/zshare/automatic/index.scss index 27e2e9c..e69de29 100644 --- a/src/tabviews/zshare/automatic/index.scss +++ b/src/tabviews/zshare/automatic/index.scss @@ -1,14 +0,0 @@ -.auto-matic { - position: fixed; - z-index: 2; - bottom: 145px; - right: 20px; - width: 40px; - height: 40px; - .anticon-forward { - font-size: 20px; - } -} -.auto-matic.low { - bottom: 100px; -} diff --git a/src/tabviews/zshare/flowFloat/index.jsx b/src/tabviews/zshare/flowFloat/index.jsx new file mode 100644 index 0000000..5aab582 --- /dev/null +++ b/src/tabviews/zshare/flowFloat/index.jsx @@ -0,0 +1,225 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Button, Modal, notification, Spin, Empty } from 'antd' +import { BranchesOutlined } from '@ant-design/icons' + +import Api from '@/api' +import MKEmitter from '@/utils/events.js' +import './index.scss' + +class CustomSetting extends Component { + static propTpyes = { + config: PropTypes.object, + init: PropTypes.any + } + + state = { + debug: sessionStorage.getItem('debug') === 'true', + visible: false, + flows: null, + loading: false, + activeCode: '', + initCode: '' + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + componentDidMount() { + const { init } = this.props + + if (init) { + this.trigger() + } + } + + trigger = () => { + const { config } = this.props + const { debug } = this.state + + if (!debug) return null + + this.setState({ + visible: true, + loading: false, + initCode: config.flow_code || '', + activeCode: '' + }) + + let param = { + func: 's_get_works_flow_local_param_v6' + } + + Api.genericInterface(param).then(result => { + if (result.status) { + let flows = result.data || [] + let active = config.flow_code ? flows.filter(item => item.works_flow_code === config.flow_code)[0] : null + this.setState({ + flows: flows, + activeCode: active + }) + + if (config.flow_code && !active) { + Modal.error({ + title: '褰撳墠鑿滃崟宸ヤ綔娴佸凡澶辨晥锛岃閲嶆柊閫夋嫨銆�' + }) + } + } else { + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } + } + }) + } + + settingSubmit = () => { + const { config } = this.props + const { activeCode } = this.state + + let param = { + func: 's_works_flow_param_sso_menu_upt_v6', + upt_type: '', + works_flow_code: activeCode.works_flow_code, + works_flow_name: activeCode.works_flow_name, + long_param: activeCode.long_param, + flow_id: activeCode.id, + menuid: config.MenuID, + menuname: config.MenuName, + username: sessionStorage.getItem('User_Name') || '', + fullName: sessionStorage.getItem('Full_Name') || '' + } + + this.setState({ + loading: true + }) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + this.setState({ + loading: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + return + } + + Api.deleteMenuStorage(config.MenuID) + + setTimeout(() => { + this.setState({ + visible: false, + loading: false + }, () => { + window.GLOB.CacheMap = new Map() + MKEmitter.emit('reloadMenuView', config.MenuID) + }) + }, 100) + }) + } + + deleteFlow = () => { + const { config } = this.props + + let param = { + func: 's_works_flow_param_sso_menu_upt_v6', + upt_type: 'del', + works_flow_code: '', + works_flow_name: '', + long_param: '', + flow_id: '', + menuid: config.MenuID, + menuname: config.MenuName, + username: sessionStorage.getItem('User_Name') || '', + fullName: sessionStorage.getItem('Full_Name') || '' + } + + this.setState({ + deling: true + }) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + this.setState({ + deling: false + }) + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + return + } + + Api.deleteMenuStorage(config.MenuID) + + setTimeout(() => { + this.setState({ + visible: false, + deling: false + }, () => { + window.GLOB.CacheMap = new Map() + MKEmitter.emit('reloadMenuView', config.MenuID) + }) + }, 100) + }) + } + + changeFlow = (item) => { + this.setState({ + activeCode: item + }) + } + + render() { + const { flows, visible, initCode, loading, deling, activeCode, debug } = this.state + + if (!debug) return null + + return ( + <div className="tool-wrap"> + <Button shape="circle" onClick={this.trigger}><BranchesOutlined /></Button> + <Modal + wrapClassName="flow-setting-modal" + title="宸ヤ綔娴�" + maskClosable={false} + width={1000} + visible={visible} + onCancel={() => { this.setState({ visible: false }) }} + footer={[ + initCode ? <Button key="revert" type="danger" disabled={loading} loading={deling} onClick={this.deleteFlow}>鍒犻櫎</Button> : null, + <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>鍙栨秷</Button>, + <Button key="confirm" type="primary" disabled={deling || !activeCode} loading={loading} onClick={this.settingSubmit}>鎻愪氦</Button> + ]} + destroyOnClose + > + {!flows ? <Spin size="large" /> : <> + {flows.length === 0 ? <Empty /> : <div> + {flows.map(item => (<div className={'flow-item' + (activeCode && activeCode.works_flow_code === item.works_flow_code ? ' active' : '')} key={item.works_flow_code} onClick={() => this.changeFlow(item)}> + <div className="header">{item.works_flow_name}锛坽item.works_flow_code}锛�</div> + <div className="img" style={{backgroundImage: `url(${item.flow_image})`}}></div> + </div>))} + </div>} + </>} + {flows && flows.length === 0 ? <Empty /> : null} + {!flows ? <Spin size="large" /> : null} + </Modal> + </div> + ) + } +} + +export default CustomSetting \ No newline at end of file diff --git a/src/tabviews/zshare/flowFloat/index.scss b/src/tabviews/zshare/flowFloat/index.scss new file mode 100644 index 0000000..87dcda4 --- /dev/null +++ b/src/tabviews/zshare/flowFloat/index.scss @@ -0,0 +1,80 @@ +.flow-setting-modal { + .ant-modal { + top: 50px; + padding-bottom: 5px; + .ant-modal-footer { + .ant-btn-danger:hover { + color: #ffffff!important; + } + } + .ant-modal-body { + max-height: calc(100vh - 190px); + min-height: 250px; + overflow-y: auto; + padding-top: 0px; + position: relative; + + .flow-item { + display: inline-block; + width: calc(25% - 20px); + margin: 10px; + border: 1px solid #d8d8d8; + vertical-align: top; + cursor: pointer; + + .header { + height: 50px; + padding: 5px; + word-break: break-word; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + -webkit-line-clamp: 2; + text-align: center; + } + .img { + height: 150px; + background-size: contain; + background-position: center; + background-repeat: no-repeat; + } + } + + .flow-item.active { + border: 1px solid var(--mk-sys-color); + box-shadow: 0 0 2px var(--mk-sys-color); + } + + .ant-spin { + position: absolute; + left: calc(50% - 22px); + top: 100px; + } + .ant-empty { + margin-top: 30px; + } + + .component-title { + font-size: 16px; + display: inline-block; + margin: 20px 0px 10px 0px; + padding: 0 10px; + border-bottom: 2px solid #1890ff; + } + } + .ant-modal-body::-webkit-scrollbar { + width: 7px; + } + .ant-modal-body::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); + background: rgba(0, 0, 0, 0.13); + } + .ant-modal-body::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + } + } +} \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index e9a26ed..9f4ca38 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -751,15 +751,11 @@ mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) + if (window.GLOB.mainSystemApi) { + mainparam.rduri = window.GLOB.mainSystemApi + } if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp) - if (window.GLOB.cloudServiceApi) { - mainparam.rduri = window.GLOB.cloudServiceApi - mainparam.userid = sessionStorage.getItem('CloudUserID') || '' - mainparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } - } else if (window.GLOB.mainSystemApi) { - mainparam.rduri = window.GLOB.mainSystemApi } deffers.push( @@ -823,6 +819,9 @@ if (form.database === 'sso' && window.GLOB.mainSystemApi) { param.rduri = window.GLOB.mainSystemApi } + if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 + param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) + } return ( new Promise(resolve => { diff --git a/src/tabviews/zshare/pageMessage/index.jsx b/src/tabviews/zshare/pageMessage/index.jsx deleted file mode 100644 index 0d283a3..0000000 --- a/src/tabviews/zshare/pageMessage/index.jsx +++ /dev/null @@ -1,351 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { Button, Modal, Typography, Tree } from 'antd' - -import Api from '@/api' -import Utils from '@/utils/utils.js' - -import './index.scss' - -const { TreeNode } = Tree -const { Paragraph } = Typography - -class PageMessage extends Component { - static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id锛岀敤浜庢煡璇笅鎷夐�夋嫨椤� - } - - state = { - debug: sessionStorage.getItem('debug') === 'true', - visible: false, - key: '', // 鏇存柊鎸囬拡 - data: [] - } - - shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - } - - handleviewconfig = (e) => { - const { config } = this.props - let data = [] - e.stopPropagation() - - if (config.Template === 'CustomPage') { - data = this.getCusData(config) - } else { - data = this.getData(config) - } - - this.setState({ - visible: true, - data: data - }) - } - - getBtnCell = (cell, item) => { - let _cell = { uuid: cell.uuid, title: `鎸夐挳(${cell.label})锛歚 } - let _others = [] - let tablename = cell.OpenType === 'excelIn' ? (cell.sheet || '') : (cell.sql || '') - - if (cell.OpenType === 'excelOut' && cell.intertype === 'system') { - tablename = item.setting.tableName || '' - } - if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) { - if (tablename) { - _others.push(`${tablename}(琛ㄥ悕)`) - } - if (cell.innerFunc) { - _others.push(`${cell.innerFunc}(鍐呴儴鍑芥暟)`) - } - if (cell.outerFunc) { - _others.push(`${cell.outerFunc}(澶栭儴鍑芥暟)`) - } - } else if (cell.OpenType === 'popview') { - _cell.sublist = [] - Api.getLocalCacheConfig({ - func: 'sPC_Get_LongParam', - MenuID: cell.uuid - }).then(res => { - if (res.LongParam) { - let _config - try { // 閰嶇疆淇℃伅瑙f瀽 - _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - _config = '' - } - - if (_config) { - _cell.sublist = this.getCusData(_config) - this.setState({key: cell.uuid}) - } - } - }) - } - - _cell.title = _cell.title + _others.join('銆�') - - return _cell - } - - getCusData = (config) => { - let data = [] - config.components.forEach(item => { - let _item = { uuid: item.uuid, title: item.name, sublist: [] } - if (item.type === 'tabs') { - item.subtabs.forEach(tab => { - let cell = { uuid: tab.uuid, title: tab.label } - - cell.sublist = this.getCusData(tab) - - _item.sublist.push(cell) - }) - } else if (item.type === 'group') { - _item.sublist = this.getCusData(item) - } else if (item.type === 'search' || (item.type === 'card' && item.subtype === 'propcard' && item.wrap.datatype === 'static')) { - let cell = { uuid: Utils.getuuid(), title: '鏁版嵁婧愶細(鏃�)' } - _item.sublist.push(cell) - } else if (item.setting) { - let cell = { uuid: Utils.getuuid(), title: '鏁版嵁婧愶細' } - let _others = [] - - if (item.setting.tableName) { - _others.push(`${item.setting.tableName}(琛ㄥ悕)`) - } - if (item.setting.innerFunc) { - _others.push(`${item.setting.innerFunc}(鍐呴儴鍑芥暟)`) - } - if (item.setting.outerFunc) { - _others.push(`${item.setting.outerFunc}(澶栭儴鍑芥暟)`) - } - cell.title = cell.title + _others.join('銆�') - - _item.sublist.push(cell) - } - - if (item.action) { - item.action.forEach(cell => { - let _cell = this.getBtnCell(cell, item) - _item.sublist.push(_cell) - }) - } - - if (item.type === 'card') { - item.subcards.forEach(card => { - card.elements && card.elements.forEach(cell => { - if (cell.eleType === 'button') { - let _cell = this.getBtnCell(cell, item) - _item.sublist.push(_cell) - } - }) - card.backElements && card.backElements.forEach(cell => { - if (cell.eleType === 'button') { - let _cell = this.getBtnCell(cell, item) - _item.sublist.push(_cell) - } - }) - }) - } else if (item.type === 'table') { - item.cols.forEach(col => { - if (col.type !== 'action') return - col.elements && col.elements.forEach(cell => { - let _cell = this.getBtnCell(cell, item) - _item.sublist.push(_cell) - }) - }) - } - - data.push(_item) - }) - - return data - } - - getData = (config) => { - let data = [] - let item = {uuid: Utils.getuuid(), title: '鏁版嵁婧愶細'} - let _others = [] - - if (config.Template === 'SubTable') { - if (config.tabNo) { - _others.push(`${config.tabNo}(鑿滃崟鍙傛暟)`) - } - } - - if (config.setting.tableName) { - _others.push(`${config.setting.tableName}(琛ㄥ悕)`) - } - if (config.setting.innerFunc) { - _others.push(`${config.setting.innerFunc}(鍐呴儴鍑芥暟)`) - } - if (config.setting.outerFunc) { - _others.push(`${config.setting.outerFunc}(澶栭儴鍑芥暟)`) - } - item.title = item.title + _others.join('銆�') - data.push(item) - - // 鎸夐挳 - config.action && config.action.forEach(item => { - let _item = {uuid: Utils.getuuid(), title: `鎸夐挳(${item.label})锛歚} - let _others = [] - - let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '') - - if (item.OpenType === 'excelOut' && item.intertype === 'system') { - tablename = config.setting.tableName || '' - } - - if (item.OpenType === 'popview') { - _item.sublist = [] - Api.getLocalCacheConfig({ - func: 'sPC_Get_LongParam', - MenuID: item.linkTab - }).then(res => { - if (res.LongParam) { - let _config - try { // 閰嶇疆淇℃伅瑙f瀽 - _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - _config = '' - } - - if (_config) { - _item.sublist = this.getData(_config) - this.setState({key: item.uuid}) - } - } - }) - } else if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(item.OpenType)) { - if (tablename) { - _others.push(`${tablename}(琛ㄥ悕)`) - } - if (item.innerFunc) { - _others.push(`${item.innerFunc}(鍐呴儴鍑芥暟)`) - } - if (item.outerFunc) { - _others.push(`${item.outerFunc}(澶栭儴鍑芥暟)`) - } - } - _item.title = _item.title + _others.join('銆�') - - data.push(_item) - }) - - // 鏍囩椤� - config.tabgroups && config.tabgroups.forEach(group => { - group.sublist.forEach(tab => { - let _item = {uuid: Utils.getuuid(), title: `鏍囩(${tab.label})锛歚, sublist: []} - - Api.getLocalCacheConfig({ - func: 'sPC_Get_LongParam', - MenuID: tab.linkTab - }).then(res => { - if (res.LongParam) { - let _config - try { // 閰嶇疆淇℃伅瑙f瀽 - _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - _config = '' - } - - if (_config) { - _item.sublist = this.getData(_config) - this.setState({key: tab.uuid}) - } - } - }) - - data.push(_item) - }) - }) - - if (config.Template === 'CalendarPage' && config.tab) { - let _item = {uuid: Utils.getuuid(), title: `鏍囩(${config.tab.label})锛歚, sublist: []} - - Api.getLocalCacheConfig({ - func: 'sPC_Get_LongParam', - MenuID: config.tab.linkTab - }).then(res => { - if (res.LongParam) { - let _config - try { // 閰嶇疆淇℃伅瑙f瀽 - _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - _config = '' - } - - if (_config) { - _item.sublist = this.getData(_config) - this.setState({key: config.tab.linkTab}) - } - } - }) - - data.push(_item) - } - - return data - } - - getTreeNode = (data) => { - return data.map(item => { - if (item.sublist && item.sublist.length) { - return ( - <TreeNode title={item.title} key={item.uuid} selectable={false}> - {this.getTreeNode(item.sublist)} - </TreeNode> - ) - } - return <TreeNode key={item.uuid} title={item.title} isLeaf selectable={false} /> - }) - } - - - render() { - const { menu } = this.props - const { debug, visible, data } = this.state - - return ( - <div className={'page-message-wrap ' + (debug && window.GLOB.sysType !== 'cloud' ? 'exist' : '')}> - {debug && window.GLOB.sysType !== 'cloud' ? <Button - icon="copy" - shape="circle" - className="page-message" - onClick={this.handleviewconfig} - /> : null} - <Modal - className="menu-tree-modal" - title={'鑿滃崟淇℃伅'} - width={'850px'} - maskClosable={false} - visible={visible} - onCancel={() => this.setState({visible: false})} - footer={[ - <Button key="close" onClick={() => this.setState({visible: false})}>鍏抽棴</Button> - ]} - destroyOnClose - > - <div className="menu-header"> - <span>鑿滃崟鍚嶇О锛歿menu.MenuName}</span> - {menu.MenuNo ? <span>鑿滃崟鍙傛暟锛�<Paragraph copyable>{menu.MenuNo}</Paragraph></span> : null} - </div> - {visible ? <Tree defaultExpandAll showLine={true}> - {this.getTreeNode(data)} - </Tree> : null} - </Modal> - </div> - ) - } -} - -export default PageMessage \ No newline at end of file diff --git a/src/tabviews/zshare/pageMessage/index.scss b/src/tabviews/zshare/pageMessage/index.scss deleted file mode 100644 index 2b07659..0000000 --- a/src/tabviews/zshare/pageMessage/index.scss +++ /dev/null @@ -1,35 +0,0 @@ -.page-message-wrap { - .page-message { - position: fixed; - z-index: 2; - bottom: 55px; - right: 20px; - width: 40px; - height: 40px; - } -} -.custom-popview { - .page-message-wrap { - display: none; - } -} -.ant-modal.menu-tree-modal { - top: 60px; - .ant-modal-body { - min-height: 300px; - .menu-header { - text-align: center; - span { - font-weight: 600; - margin-right: 20px; - } - .ant-typography { - font-weight: 600; - display: inline-block; - } - } - .ant-tree li .ant-tree-node-content-wrapper { - cursor: default; - } - } -} \ No newline at end of file diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx index 76f94ae..f2488e9 100644 --- a/src/tabviews/zshare/settingcomponent/index.jsx +++ b/src/tabviews/zshare/settingcomponent/index.jsx @@ -410,7 +410,9 @@ return } - Api.deleteMenuStorage(config.MenuID).then(() => { + Api.deleteMenuStorage(config.MenuID) + + setTimeout(() => { this.setState({ visible: false, revertLoading: false @@ -418,7 +420,7 @@ window.GLOB.CacheMap = new Map() MKEmitter.emit('reloadMenuView', config.MenuID) }) - }) + }, 100) }) } @@ -486,7 +488,9 @@ return } - Api.deleteMenuStorage(config.MenuID).then(() => { + Api.deleteMenuStorage(config.MenuID) + + setTimeout(() => { this.setState({ visible: false, confirmLoading: false @@ -494,7 +498,7 @@ window.GLOB.CacheMap = new Map() MKEmitter.emit('reloadMenuView', config.MenuID) }) - }) + }, 100) }) } @@ -514,14 +518,11 @@ render() { const { components, visible } = this.state + if (window.GLOB.mkHS || window.GLOB.sysType !== 'local') return null + return ( - <div className="page-setting-wrap"> - {window.GLOB.sysType === 'local' ? <Button - icon="setting" - shape="circle" - className="page-setting" - onClick={this.trigger} - /> : null} + <div className="tool-wrap"> + <Button icon="setting" shape="circle" onClick={this.trigger}/> <Modal wrapClassName="custom-setting-modal" title={'鑷畾涔夎缃�'} diff --git a/src/tabviews/zshare/settingcomponent/index.scss b/src/tabviews/zshare/settingcomponent/index.scss index b19cb86..b58b733 100644 --- a/src/tabviews/zshare/settingcomponent/index.scss +++ b/src/tabviews/zshare/settingcomponent/index.scss @@ -1,27 +1,12 @@ -.page-setting-wrap { - .page-setting { - position: fixed; - z-index: 2; - bottom: 55px; - right: 20px; - width: 40px; - height: 40px; - } -} -.custom-popview { - .page-setting-wrap { - display: none; - } -} -.page-message-wrap.exist + .page-setting-wrap { - .page-setting { - bottom: 100px; - } -} .custom-setting-modal { .ant-modal { top: 50px; padding-bottom: 5px; + .ant-modal-footer { + .ant-btn-danger:hover { + color: #ffffff!important; + } + } .ant-modal-body { max-height: calc(100vh - 190px); min-height: 250px; diff --git a/src/tabviews/zshare/tablenodes/index.jsx b/src/tabviews/zshare/tablenodes/index.jsx index 21c1919..49f6f32 100644 --- a/src/tabviews/zshare/tablenodes/index.jsx +++ b/src/tabviews/zshare/tablenodes/index.jsx @@ -473,14 +473,11 @@ const { config } = this.props const { visible, loading, empty, debug } = this.state + if (window.GLOB.mkHS || window.GLOB.systemType === 'production' || !debug || window.GLOB.sysType === 'cloud') return null + return ( - <div className={'page-message-wrap ' + (debug && window.GLOB.sysType !== 'cloud' ? 'exist' : '')}> - {debug && window.GLOB.sysType !== 'cloud' ? <Button - icon="fork" - shape="circle" - className="page-message" - onClick={this.trigger} - /> : null} + <div className="tool-wrap"> + <Button icon="fork" shape="circle" onClick={this.trigger}/> <Modal title="" wrapClassName="view-table-modal" diff --git a/src/tabviews/zshare/tablenodes/index.scss b/src/tabviews/zshare/tablenodes/index.scss index 5458306..f982f22 100644 --- a/src/tabviews/zshare/tablenodes/index.scss +++ b/src/tabviews/zshare/tablenodes/index.scss @@ -1,14 +1,3 @@ -.page-message-wrap { - .page-message { - position: fixed; - z-index: 2; - bottom: 55px; - right: 20px; - width: 40px; - height: 40px; - } -} - .view-table-modal { .ant-modal { top: 30px; diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 9c97e94..6666d61 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -331,15 +331,11 @@ mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) + if (window.GLOB.mainSystemApi) { + mainparam.rduri = window.GLOB.mainSystemApi + } if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp) - if (window.GLOB.cloudServiceApi) { - mainparam.rduri = window.GLOB.cloudServiceApi - mainparam.userid = sessionStorage.getItem('CloudUserID') || '' - mainparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } - } else if (window.GLOB.mainSystemApi) { - mainparam.rduri = window.GLOB.mainSystemApi } deffers.push( diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index ecd38da..3bac86d 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -59,35 +59,25 @@ param.fullname = sessionStorage.getItem('Full_Name') || '' } } else { - if (window.GLOB.mkHS) { - if (setting.sysInterface === 'true' && window.GLOB.cloudServiceApi) { - param.rduri = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (setting.sysInterface !== 'true') { - param.rduri = setting.interface + if (setting.sysInterface === 'true') { + if (window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi + } + } else if (setting.sysInterface === 'external') { + if (window.GLOB.systemType === 'production') { + param.$token = setting.exProInterface || '' + } else { + param.$token = setting.exInterface || '' } } else { - if (setting.sysInterface === 'true') { - if (window.GLOB.mainSystemApi) { - param.rduri = window.GLOB.mainSystemApi - } - } else if (setting.sysInterface === 'external') { - if (window.GLOB.systemType === 'production') { - param.$token = setting.exProInterface || '' - } else { - param.$token = setting.exInterface || '' - } + if (window.GLOB.systemType === 'production' && setting.proInterface) { + param.rduri = setting.proInterface } else { - if (window.GLOB.systemType === 'production' && setting.proInterface) { - param.rduri = setting.proInterface - } else { - param.rduri = setting.interface - } - let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') - if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { - param.$login = true - } + param.rduri = setting.interface + } + let host = window.GLOB.baseurl.replace(/http(s):\/\//, '') + if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) { + param.$login = true } } @@ -290,10 +280,8 @@ param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // special HS鑷畾涔夊嚱鏁版煡璇� - if (setting.tableName === 's_custom_script' && window.GLOB.cloudServiceApi) { - param.rduri = window.GLOB.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' + if (setting.tableName === 's_custom_script' && window.GLOB.mainSystemApi) { + param.rduri = window.GLOB.mainSystemApi } } diff --git a/src/views/systemfunc/index.jsx b/src/views/systemfunc/index.jsx index 270c6ea..109d291 100644 --- a/src/views/systemfunc/index.jsx +++ b/src/views/systemfunc/index.jsx @@ -17,10 +17,14 @@ if (!sessionStorage.getItem('UserID')) { this.props.history.replace('/login') } else { + sessionStorage.setItem('LocalUserID', sessionStorage.getItem('UserID')) + sessionStorage.setItem('LocalLoginUID', sessionStorage.getItem('LoginUID')) sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id')) sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName')) sessionStorage.setItem('Full_Name', sessionStorage.getItem('CloudFullName')) + sessionStorage.setItem('UserID', sessionStorage.getItem('CloudUserID')) + sessionStorage.setItem('LoginUID', sessionStorage.getItem('CloudLoginUID')) document.body.className = 'mk-blue-black' window.GLOB.dataFormat = false // 鍘婚櫎姘村嵃 -- Gitblit v1.8.0