Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
b278ba54
Commit
b278ba54
authored
Nov 01, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 集成登录配置优化,添加通用模板
parent
215c0491
Pipeline
#93597
waiting for manual action with stages
Changes
17
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
648 additions
and
72 deletions
+648
-72
base.js
src/api/service/base.js
+12
-0
index.js
src/components/IntegratedSwitch/index.js
+96
-21
index.less
src/components/IntegratedSwitch/index.less
+14
-0
BasicLayout.js
src/layouts/BasicLayout.js
+1
-1
index.js
src/pages/bootpage/index.js
+12
-2
constants.js
src/pages/bootpage/template/constants.js
+6
-0
index.less
...tpage/template/demonstration/components/Iframe/index.less
+1
-0
index.js
src/pages/bootpage/template/integrationNew/index.js
+0
-0
index.less
src/pages/bootpage/template/integrationNew/index.less
+368
-0
AddModal.js
src/pages/integratedLogin/components/AddModal.js
+0
-0
Master.js
src/pages/integratedLogin/components/Master.js
+0
-0
PreviewModal.js
src/pages/integratedLogin/components/PreviewModal.js
+50
-33
index.js
src/pages/integratedLogin/index.js
+0
-0
index.less
src/pages/integratedLogin/index.less
+13
-13
index.js
src/pages/thirdParty/index.js
+36
-2
index.less
src/pages/thirdParty/index.less
+15
-0
utils.js
src/utils/utils.js
+24
-0
No files found.
src/api/service/base.js
View file @
b278ba54
...
...
@@ -62,6 +62,8 @@ export const API = {
REFRESH_SECRET
:
'/PandaCore/GCK/IntegrationAuth/RefreshSecret'
,
// 根据APPKey生成APPSecret
CM_EVENT_LOAD_DEPARTMENT_ROLES
:
'/PandaOMS/OMS/WorkOrderCenter/CM_Event_LoadDepartmentAndRoles'
,
GET_CONFIG_FILE_JSON
:
'/PandaCore/GCK/FileCenter/ConfigJSON'
,
// 获取配置文件
GET_CONFIG_FILE_LIST
:
'/PandaOMS/OMS/FileCenter/GetFileUrls'
,
// 获取用户上传
EnableIntegrationConfig
:
'/PandaCore/GCK/IntegrationAuth/EnableIntegrationConfig'
,
// 开启或关闭集成登录
};
const
services
=
{
...
...
@@ -319,6 +321,16 @@ const services = {
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
GetFileUrls
:
{
url
:
API
.
GET_CONFIG_FILE_LIST
,
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
EnableIntegrationConfig
:
{
url
:
API
.
EnableIntegrationConfig
,
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
};
export
const
searchAutoCity
=
keywords
=>
{
...
...
src/components/IntegratedSwitch/index.js
View file @
b278ba54
...
...
@@ -7,28 +7,80 @@ import { actionCreators } from '@/containers/App/store';
import
{
store
}
from
'@wisdom-utils/utils'
;
import
LoginAction
from
'@/pages/user/login/login'
;
import
Cookies
from
'js-cookie'
;
import
{
notification
,
Tooltip
}
from
'antd'
;
import
{
notification
,
Tooltip
,
message
}
from
'antd'
;
import
homeIcon
from
'@/assets/bootPage/集成登录.png'
;
import
{
appService
}
from
'@/api'
;
import
axios
from
'axios'
;
import
{
defaultApp
}
from
'@/micro'
;
import
{
useHistory
}
from
'@wisdom-utils/runtime'
;
import
LoadPage
from
'@/components/LoadPage'
;
import
styles
from
'./index.less'
;
const
IntegratedSwitch
=
props
=>
{
const
timer
=
useRef
(
null
);
const
timer3
=
useRef
(
null
);
const
progressRef
=
useRef
(
0
);
const
history
=
useHistory
();
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
client
,
setClient
]
=
useState
(
''
);
const
clientRef
=
useRef
(
props
.
global
.
client
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
progressValue
,
setProgressValue
]
=
useState
(
0
);
const
jumpProgressEnd
=
()
=>
{
setProgressValue
(
100
);
timer
.
current
&&
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
};
const
jumpProgressStart
=
()
=>
{
if
(
timer
.
current
)
{
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
}
progressRef
.
current
=
0
;
setProgressValue
(
0
);
timer
.
current
=
setInterval
(()
=>
{
if
(
progressRef
.
current
<
97.5
)
{
progressRef
.
current
+=
2.5
;
setProgressValue
(
progressRef
.
current
);
}
else
{
setProgressValue
(
99
);
timer
.
current
&&
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
}
},
100
);
};
// 定时消除 loading
const
startTiming
=
(
time
=
2
)
=>
{
if
(
timer3
.
current
)
{
clearInterval
(
timer3
.
current
);
timer3
.
current
=
null
;
}
timer3
.
current
=
setTimeout
(()
=>
{
setJumpLoading
(
false
);
timer
.
current
&&
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
},
time
*
1000
);
};
const
handError
=
err
=>
{
if
(
err
)
{
message
.
error
(
err
);
}
setJumpLoading
(
false
);
jumpProgressEnd
();
};
useEffect
(()
=>
{
// if (!window?.globalConfig?.userInfo?.OID || (!(window?.globalConfig?.isIntegration > 1) && window?.globalConfig?.Industry !== '集成登录')) return setDataList([]);
if
(
!
window
?.
globalConfig
?.
userInfo
?.
OID
||
!
(
window
?.
globalConfig
?.
isIntegration
>
1
))
return
setDataList
([]);
appService
.
GetIntegrationConfig
({
if
(
!
window
?.
globalConfig
?.
userInfo
?.
OID
||
!
(
window
?.
globalConfig
?.
isIntegration
>=
1
))
return
setDataList
([]);
appService
.
GetIntegrationConfig
({
type
:
'集成登录'
,
userId
:
window
?.
globalConfig
?.
userInfo
?.
OID
??
null
,
isEnable
:
true
,
// client: `${client || props.global.client || ''}`,
client
:
localStorage
.
getItem
(
'integrationClient'
)
||
sessionStorage
.
getItem
(
'client'
)
||
props
?.
global
?.
client
||
''
,
})
.
then
(
res
=>
{
setDataList
(
res
?.
data
||
[]);
...
...
@@ -41,18 +93,24 @@ const IntegratedSwitch = props => {
// 子站跳转
// eslint-disable-next-line no-shadow
const
handlePage
=
useCallback
((
item
,
loginAction
)
=>
{
setJumpLoading
(
true
);
jumpProgressStart
();
startTiming
(
5
);
if
(
item
.
subType
===
'外链'
)
{
// 营收
if
(
item
.
paramValue
===
'ticket'
)
{
// 获取临时token
appService
.
getTicketByToken
({
token
:
window
.
globalConfig
?.
token
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
param
Nam
e
}
=
${
res
.
data
}
`
;
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
param
Valu
e
}
=
${
res
.
data
}
`
;
if
(
item
?.
openOpt
===
'当前页打开'
)
{
history
.
push
(
'/thirdParty'
,
{
linkUrl
:
url
});
}
else
{
window
.
open
(
url
,
'_blank'
);
}
}
else
{
setJumpLoading
(
false
);
jumpProgressEnd
();
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -61,7 +119,9 @@ const IntegratedSwitch = props => {
}
});
}
else
{
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
window
.
globalConfig
?.
token
}
`;
const
url
=
`
${
item
.
url
+
(
item
.
url
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
item
.
paramName
}
=
${
window
.
globalConfig
?.
token
}
`;
if (item?.openOpt === '当前页打开') {
history.push('/thirdParty', { linkUrl: url });
} else {
...
...
@@ -72,9 +132,7 @@ const IntegratedSwitch = props => {
if (window.qiankunIsCache) {
store.set('event:dropCache');
}
const cli = item.url?.indexOf('client=') >= 0 ? item.url.split('client=')[1] : '';
const cli = item.appKey;
Cookies.set('client', cli, {
expires: 86400000 / (24 * 60 * 60 * 1000),
path: '/',
...
...
@@ -87,7 +145,7 @@ const IntegratedSwitch = props => {
sessionStorage.setItem(currentProductNew, 0);
setClient(cli);
clientRef.current = cli;
const config = props.global;
config.uiwidgets = [];
config.widgets = [];
...
...
@@ -98,7 +156,7 @@ const IntegratedSwitch = props => {
}
// props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true
, item.type
);
loginAction && loginAction.getUserInfoAndConfig('', true);
} else {
let { url } = item;
if (url?.indexOf('{userId}') >= 0) {
...
...
@@ -122,26 +180,43 @@ const IntegratedSwitch = props => {
useEffect(() => {
const handleToggleIndustry = event => {
history.push(`
/
?
client
=
$
{
client
||
props
.
global
.
client
||
''
}
`);
setJumpLoading(false);
jumpProgressEnd();
history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
||
''
}
`);
props.updateCurrentIndex(0);
defaultApp();
};
const handleError = () => {
setJumpLoading(false);
jumpProgressEnd();
};
loginAction.events.on('toggleIndustry', handleToggleIndustry);
loginAction.events.on('loginError', handleError);
return () => {
loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
};
}, [loginAction.events, props]);
return (
dataList.length > 1 ? <div className={styles.switchPage}>
return dataList.length > 1 ? (
<div className={styles.switchPage}>
{jumpLoading ? (
<div className={styles.integrationJumpLoad} key="jumpLoading">
<div style={{ width: '285px' }}>
<LoadPage percent={progressValue / 100} text="页面加载中~" />
</div>
</div>
) : null}
<ul className={classNames(styles.switchPageCase, styles.switchPageSmall)}>
<li className={styles.switchPageLi} onClick={() => { history.push('/industry'); }}>
<li
className={styles.switchPageLi}
onClick={() => {
history.push('/industry');
}}
>
<div className={styles.switchPageList}>
<Tooltip placement="top" title="主页">
<img
src={homeIcon}
alt=""
/>
<img src={homeIcon} alt="" />
</Tooltip>
</div>
</li>
...
...
@@ -158,8 +233,8 @@ const IntegratedSwitch = props => {
</li>
))}
</ul>
</div
> : null
);
</div
>
)
: null
;
};
const mapStateToProps = state => ({
...
...
src/components/IntegratedSwitch/index.less
View file @
b278ba54
...
...
@@ -9,6 +9,20 @@
width: 100%;
height: 0px;
.integrationJumpLoad {
width: 100vw;
height: 100vh;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
top: 0;
left: 0;
z-index: 1080;
padding-bottom: 50px;
background-color: rgba(0, 0, 0, 0.5);
}
.switchPageCase {
position: absolute;
bottom: 0;
...
...
src/layouts/BasicLayout.js
View file @
b278ba54
...
...
@@ -394,7 +394,7 @@ const Layout = props => {
type
:
'集成登录'
,
userId
:
window
.
globalConfig
.
userInfo
?.
OID
??
null
,
isEnable
:
true
,
client
:
integrationClient
||
''
// 只有指定client才能获取集成登录信息
client
:
integrationClient
||
props
.
global
.
client
// 只有指定client才能获取集成登录信息
})
.
then
(
res
=>
{
setFirst
(
false
);
...
...
src/pages/bootpage/index.js
View file @
b278ba54
...
...
@@ -3,7 +3,7 @@
* @Author: hongmye
* @Date: 2023-01-10 11:18:55
*/
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useMemo
,
useState
,
useRef
}
from
'react'
;
import
{
Empty
,
Spin
,
notification
}
from
'antd'
;
import
SecurityLayout
from
'@/layouts/SecurityLayout'
;
import
{
appService
}
from
'@/api'
;
...
...
@@ -22,6 +22,7 @@ const BootPage = props => {
loading
:
true
,
error
:
false
,
});
const
integratedConfig
=
useRef
({});
const
{
clear
}
=
useAliveController
();
const
history
=
useHistory
();
const
[
template
,
setTemplate
]
=
useState
(
window
?.
globalConfig
?.
displayMode
||
'default'
);
...
...
@@ -56,6 +57,7 @@ const BootPage = props => {
setInfo
({
first
:
false
,
loading
:
false
,
error
:
true
});
return
;
}
integratedConfig
.
current
=
data
;
let
displayMode
=
data
?.
displayMode
||
'default'
;
if
(
displayMode
===
'卡片'
||
displayMode
===
'地图'
)
{
displayMode
=
'default'
;
...
...
@@ -69,7 +71,15 @@ const BootPage = props => {
},
[]);
return
(
<
SecurityLayout
>
{
info
.
loading
?
<
Spin
/>
:
info
.
error
?
<
Empty
/>
:
<
RenderComponent
{...
props
}
/>}</
SecurityLayout
>
<
SecurityLayout
>
{
info
.
loading
?
(
<
Spin
/>
)
:
info
.
error
?
(
<
Empty
/>
)
:
(
<
RenderComponent
{...{
...
props
,
...{
integratedConfig
:
integratedConfig
.
current
}
}}
/
>
)}
<
/SecurityLayout
>
);
};
const
mapStateToProps
=
state
=>
({
...
...
src/pages/bootpage/template/constants.js
View file @
b278ba54
...
...
@@ -15,12 +15,17 @@ import DanlingPage from './project/danling';
import
MilePage
from
'./project/mile'
;
import
DongyingPage
from
'./project/dongying'
;
import
QinzhouPage
from
'./project/qinzhou'
;
import
IntegrationNewPage
from
'./integrationNew'
;
export
const
guidePage
=
[
// type 为true 则需要 功能配置 isPanda 为true
{
label
:
'集成登录(默认)'
,
value
:
'default'
,
},
{
label
:
'集成登录(新)'
,
value
:
'integrationNew'
,
},
{
label
:
'集成登录演示'
,
value
:
'integration2'
,
...
...
@@ -66,6 +71,7 @@ export const guidePage = [
];
export
const
BootPageTemplate
=
{
default
:
IntegrationPage
,
integrationNew
:
IntegrationNewPage
,
panda
:
PandaBootPage
,
integration2
:
IntegrationPage2
,
demonstration
:
Demonstration
,
...
...
src/pages/bootpage/template/demonstration/components/Iframe/index.less
View file @
b278ba54
...
...
@@ -5,6 +5,7 @@
overflow: hidden;
z-index: 100;
transition: all 0.2s;
background-color: #fff;
iframe {
border: none;
...
...
src/pages/bootpage/template/integrationNew/index.js
0 → 100644
View file @
b278ba54
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/integrationNew/index.less
0 → 100644
View file @
b278ba54
.integrationNew {
width: 100%;
position: relative;
height: 100%;
overflow: hidden;
background: url('@/assets/images/integration/danling/背景.png') center/100% 100% no-repeat;
.iframeBackIcon {
position: absolute;
top: 0;
right: -45px;
display: flex;
height: 44px;
width: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius: 7px 0px 0px 7px;
flex-direction: column;
justify-content: space-around;
align-items: center;
font-size: 12px;
transition: all 0.2s;
padding: 3px 0;
img {
width: 17px;
height: 12px;
}
}
.iframeBack:hover {
.iframeBackIcon {
right: 0;
}
.iframeBackLeft {
right: -15px;
}
}
.iframeBackLeft {
position: absolute;
top: 0;
right: 0;
width: 14px;
height: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius: 7px 0 0 7px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s;
img {
width: 6px;
height: 11px;
}
}
.iframeBack {
width: 44px;
height: 44px;
position: absolute;
top: 50px;
right: 0;
color: #FFF;
cursor: pointer;
user-select: none;
position: absolute;
z-index: 110;
}
.iframeExitIcon {
position: absolute;
top: 0;
left: -45px;
display: flex;
height: 44px;
width: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius: 0 7px 7px 0;
flex-direction: column;
justify-content: space-around;
align-items: center;
font-size: 12px;
transition: all 0.2s;
padding: 3px 0;
img {
width: 17px;
height: 12px;
}
}
.iframeExit:hover {
.iframeExitIcon {
left: 0;
}
.iframeExitLeft {
left: -15px;
}
}
.iframeExitLeft {
position: absolute;
top: 0;
left: 0;
width: 14px;
height: 44px;
background: rgba(28, 94, 180, 0.95);
border-radius: 0 7px 7px 0;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s;
img {
width: 6px;
height: 11px;
}
}
.iframeExit {
width: 44px;
height: 44px;
position: absolute;
top: 4px;
left: 0;
color: #FFF;
cursor: pointer;
user-select: none;
position: absolute;
z-index: 110;
}
.integrationNew_exit {
position: absolute;
right: 10px;
top: 10px;
z-index: 100;
}
.integration_content {
display: flex;
flex-direction: column;
align-items: center;
transform-origin: left top;
position: absolute;
left: 50%;
top: 50%;
padding: 0px 20px 10px;
z-index: 10;
pointer-events: none;
}
//基础平台end
.integrationNew_title {
display: flex;
align-items: center;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
.integrationNew_icon {
margin-right: 20px;
img {
max-height: 60px;
}
}
&_text {
flex: none;
color: #fff;
span {
line-height: 64px;
font-weight: bold;
font-size: 36px;
color: #FFFFFF;
letter-spacing: 4px;
// background: linear-gradient(0deg, #56A1EF 0%, #FFFFFF 59%);
// -webkit-background-clip: text;
// -webkit-text-fill-color: transparent;
position: relative;
// top: -8px;
font-family: Microsoft YaHei;
}
}
}
.integrationNew_title_sub {
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 14px;
color: rgba(255, 255, 255, 0.75);
line-height: 22px;
padding: 0 125px;
background: url(@/assets/images/integration/danling/title_left.png) no-repeat left center, url(@/assets/images/integration/danling/title_right.png) no-repeat right center;
background-size: 115px 1px, 115px 1px;
}
.IY_list .IY_row:not(:last-child) {
margin-bottom: 68px;
}
.IY_list {
padding-top: 60px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: auto;
// grid-template-columns: 270px 270px 270px 270px 270px;
// grid-template-rows: 280px;
// gap: 56px 68px;
z-index: 1000;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.IY_row {
display: flex;
justify-content: center;
}
.IY_row .IY_item:not(:last-child) {
margin-right: 56px;
}
.IY_item {
width: 270px;
height: 280px;
border-radius: 50px;
text-align: center;
padding-top: 198px;
transition: all 0.3s;
position: relative;
top: 0;
cursor: pointer;
z-index: 10;
pointer-events: all;
background: url('@/assets/images/integration/mile/领导驾驶舱.png') center/100% 100% no-repeat;
.IY_item_name {
font-weight: bold;
font-size: 24px;
line-height: 42px;
color: #FFFFFF;
}
.IY_item_name_sub {
font-weight: 400;
font-size: 14px;
color: rgba(255, 255, 255, 0.7);
}
}
.IY_item:hover {
top: -15px;
}
}
.integrationJumpLoad {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 0;
left: 0;
z-index: 1080;
padding-bottom: 50px;
background-color: rgba(0, 0, 0, 0.6);
}
.hide {
visibility: hidden;
}
@-webkit-keyframes scale-in-center {
0% {
-webkit-transform: scaleY(0);
transform: scaleY(0);
opacity: 1;
}
100% {
-webkit-transform: scaleY(1);
transform: scaleY(1);
opacity: 1;
}
}
@keyframes scale-in-center {
0% {
-webkit-transform: scaleY(0);
transform: scaleY(0);
opacity: 1;
}
100% {
-webkit-transform: scaleY(1);
transform: scaleY(1);
opacity: 1;
}
}
.scaleInCenter {
visibility: visible;
-webkit-animation: scale-in-center .3s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
animation: scale-in-center .3s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
.CarouselRipples {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
& :global {
.CarouselRipples:before {
content: '';
display: inline-block;
vertical-align: middle;
height: 100%;
}
.integrationNew {
.anticon {
vertical-align: 0.125em;
}
}
}
\ No newline at end of file
src/pages/integratedLogin/components/AddModal.js
View file @
b278ba54
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/components/Master.js
View file @
b278ba54
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/components/PreviewModal.js
View file @
b278ba54
/* eslint-disable no-lonely-if */
/* eslint-disable no-unused-expressions */
/* eslint-disable prefer-template */
/* eslint-disable react/jsx-boolean-value */
/* eslint-disable no-inner-declarations */
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Modal
,
Collapse
,
notification
}
from
'antd'
;
import
{
appService
}
from
'@/api'
;
import
classnames
from
'classnames'
;
import
{
getImageUrl
}
from
'@/utils/utils'
;
import
styles
from
'../index.less'
;
const
{
Panel
}
=
Collapse
;
const
PreviewModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
imageUrl
,
keepImgeUrl
,
typ
e
}
=
props
;
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
keepImgeUrl
,
type
,
moduleName
,
groupNam
e
}
=
props
;
const
[
imgData
,
setImgData
]
=
useState
([]);
const
[
pickItem
,
setPickItem
]
=
useState
(
''
);
const
[
keepItem
,
setKeepItem
]
=
useState
(
''
);
const
[
keepGroupName
,
setKeepGroupName
]
=
useState
([]);
const
update
=
()
=>
{
appService
.
GetIntegrationConfigIcon
()
const
req1
=
appService
.
GetIntegrationConfigIcon
();
const
req2
=
appService
.
GetFileUrls
({
// moduleName: 'icon,androidMenu,menuNew,logo,CityTemp,bootAnimation,loginPageImage,homePageImage,userPageImage',
moduleName
:
moduleName
||
'CityTemp'
,
});
Promise
.
all
([
req1
,
req2
])
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
bb
=
[];
const
aa
=
[];
res
.
data
.
map
((
i
,
a
)
=>
{
if
(
res
[
0
]?.
code
===
0
)
{
res
[
0
].
data
.
map
((
i
,
a
)
=>
{
if
(
i
.
files
.
length
>
0
&&
type
!==
''
&&
i
.
groupName
!==
'网站图标'
)
{
bb
.
push
(
i
);
aa
.
push
(
i
.
groupName
);
...
...
@@ -34,21 +36,12 @@ const PreviewModal = props => {
aa
.
push
(
i
.
groupName
);
}
});
setKeepGroupName
(
aa
);
setImgData
(
bb
);
res
.
data
.
map
(
i
=>
{
res
[
0
].
data
.
map
(
i
=>
{
i
.
files
.
map
((
j
,
index
)
=>
{
if
(
keepImgeUrl
)
{
if
(
j
.
path
==
keepImgeUrl
)
{
setKeepItem
(
i
.
groupName
);
setPickItem
(
index
);
}
}
else
{
if
(
j
.
path
==
imageUrl
)
{
if
(
j
.
path
===
keepImgeUrl
)
{
setKeepItem
(
i
.
groupName
);
setPickItem
(
index
);
}
}
});
});
}
else
{
...
...
@@ -57,6 +50,37 @@ const PreviewModal = props => {
description
:
res
.
msg
,
});
}
if
(
res
[
1
]?.
code
===
0
)
{
const
urlList
=
[];
function
getUrl
(
arr
)
{
if
(
Array
.
isArray
(
arr
)
&&
arr
.
length
)
{
arr
.
forEach
(
a
=>
{
if
(
Array
.
isArray
(
a
.
fileUrls
)
&&
a
.
fileUrls
.
length
)
{
a
.
fileUrls
.
forEach
(
f
=>
{
// if (f && f.includes('CityTemp\\图库')) {
urlList
.
push
({
path
:
f
,
name
:
''
,
type
:
'custom'
,
});
// }
});
}
getUrl
(
a
.
child
);
});
}
}
getUrl
(
res
[
1
].
data
||
[]);
if
(
urlList
.
length
)
{
aa
.
push
(
groupName
||
'用户上传'
);
bb
.
push
({
groupName
:
groupName
||
'用户上传'
,
files
:
urlList
,
});
}
}
setKeepGroupName
(
aa
);
setImgData
(
bb
);
})
.
catch
(
err
=>
{
console
.
error
(
err
);
...
...
@@ -79,6 +103,7 @@ const PreviewModal = props => {
}
onCancel
();
};
const
getImg
=
img
=>
`
${
window
.
location
.
origin
}
/
${
encodeURIComponent
(
img
)}
`
;
const
handleCollapseChange
=
key
=>
{
setKeepGroupName
(
key
);
...
...
@@ -95,7 +120,7 @@ const PreviewModal = props => {
okText
=
"确认"
{...
props
}
onOk
=
{()
=>
onSubmit
()}
forceRender
=
{
true
}
forceRender
getContainer
=
{
false
}
>
<
Collapse
...
...
@@ -117,22 +142,14 @@ const PreviewModal = props => {
}}
>
{
i
.
files
.
map
((
k
,
index
)
=>
(
// <Image
// src={`${isDev ? process.env.PROXY : window.location.origin}${k}`}
// height="100px"
// />
<
div
className
=
{
styles
.
divItem
}
key
=
{
index
}
>
{
/* <CheckCircleTwoTone
className={classnames({
[styles.iconHidden]: index !== pickItem || i.groupName !== keepItem,
[styles.iconItem]: index === pickItem && i.groupName === keepItem,
})}
/> */
}
<
img
src
=
{
window
.
location
.
origin
+
`/
${
k
.
path
}
`
}
src
=
{
getImageUrl
(
k
.
path
)
}
className
=
{
classnames
({
[
styles
.
imgCommon
]:
true
,
[
styles
.
imgHidden
]:
index
!==
pickItem
||
i
.
groupName
!==
keepItem
,
[
styles
.
imgItem
]:
index
===
pickItem
&&
i
.
groupName
===
keepItem
,
[
styles
.
imgCustom
]:
k
.
type
===
'custom'
,
})}
height
=
"80px"
width
=
"80px"
...
...
src/pages/integratedLogin/index.js
View file @
b278ba54
This diff is collapsed.
Click to expand it.
src/pages/integratedLogin/index.less
View file @
b278ba54
...
...
@@ -32,14 +32,17 @@
}
.doctorTable {
margin-bottom: 1
6
px;
margin-bottom: 1
0
px;
}
.divItem {
display: inline-block;
margin-left: 30px;
margin-bottom: 30px;
// width: 80px;
}
.imgCommon {
border: 3px solid transparent;
}
.imgItem {
...
...
@@ -56,6 +59,10 @@
background-color: #2881a1;
}
.imgCustom {
background-color: #fafafa !important;
}
.imgHidden:hover {
border: 3px solid #00ff37;
box-sizing: border-box;
...
...
@@ -64,10 +71,7 @@
}
.iconItem {
// position: relative;
// left: 70px;
// top: 10px;
// font-size: 17px;
margin-top: -3px;
font-size: 17px;
float: right;
...
...
@@ -79,10 +83,7 @@
}
.iconHidden:hover {
// position: relative;
// left: 70px;
// top: 10px;
// font-size: 17px;
margin-top: -3px;
font-size: 17px;
float: right;
...
...
@@ -92,8 +93,7 @@
.table {
flex: 1;
background-color: white;
//height: calc(100vh - 130px);
//margin-top: 10px;
overflow-y: scroll;
padding: 8px;
}
...
...
src/pages/thirdParty/index.js
View file @
b278ba54
/* eslint-disable prettier/prettier */
import
React
,
{
use
Effect
}
from
'react'
;
import
React
,
{
use
Ref
,
useEffect
,
useState
}
from
'react'
;
import
Iframe
from
'react-iframe'
;
import
{
connect
}
from
'react-redux'
;
import
Cookies
from
'js-cookie'
;
...
...
@@ -8,6 +8,7 @@ import { actionCreators } from '@/containers/App/store';
import
_
from
'lodash'
;
import
{
useHistory
,
useAliveController
}
from
'@wisdom-utils/runtime'
;
import
IntegratedSwitch
from
'@/components/IntegratedSwitch'
;
import
{
message
}
from
'antd'
;
import
styles
from
'./index.less'
;
const
ThirdParty
=
props
=>
{
...
...
@@ -16,8 +17,38 @@ const ThirdParty = props => {
if
(
!
state
.
linkUrl
)
{
return
props
.
history
.
push
(
`/industry`
);
}
const
onMessageBack
=
e
=>
{
const
{
data
}
=
e
?.
data
||
{};
if
(
!
data
?.
type
)
return
;
switch
(
data
?.
type
)
{
// 页面加载完成
// 登录成功
case
'runAfterFirstMounted'
:
case
'loginSuccess'
:
break
;
case
'loginError'
:
message
.
warning
(
'登录失败,请联系管理人员'
);
break
;
case
'无法连接'
:
message
.
warning
(
'该站点无法连接,请联系管理人员'
);
break
;
case
'showBack'
:
break
;
case
'hideBack'
:
break
;
default
:
break
;
}
};
useEffect
(()
=>
{
window
.
addEventListener
(
'message'
,
onMessageBack
);
return
()
=>
{
window
.
removeEventListener
(
'message'
,
onMessageBack
);
};
},
[]);
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect
(()
=>
{
const
tk
=
Cookies
.
get
(
'token'
)
||
props
.
global
.
token
;
...
...
@@ -58,4 +89,7 @@ const mapDispatchToProps = dispatch => ({
dispatch
(
actionCreators
.
logout
());
},
});
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ThirdParty
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
,
)(
ThirdParty
);
src/pages/thirdParty/index.less
View file @
b278ba54
...
...
@@ -4,3 +4,17 @@
position: relative;
overflow: hidden;
}
.integrationJumpLoad {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 0;
left: 0;
z-index: 1080;
padding-bottom: 50px;
background-color: rgba(0, 0, 0, 0.5);
}
\ No newline at end of file
src/utils/utils.js
View file @
b278ba54
...
...
@@ -83,3 +83,27 @@ export function getVideoUrl() {
:
window
.
location
.
origin
.
replace
(
protocol
,
'ws:'
);
return
`
${
address
}
/`
;
}
export
const
getImageUrl
=
path
=>
{
if
(
!
path
||
typeof
path
!==
'string'
)
return
''
;
if
(
path
.
indexOf
(
'http'
)
===
0
)
{
return
path
;
}
if
(
path
.
indexOf
(
'data:'
)
===
0
)
{
return
path
;
}
if
(
path
.
startsWith
(
'assets'
))
{
return
`
${
window
.
location
.
origin
}
/civweb4/
${
path
}
`
.
replace
(
/
\\
/g
,
'/'
);
}
if
(
path
.
startsWith
(
'center/images'
))
{
return
`
${
window
.
location
.
origin
}
/
${
path
}
`
.
replace
(
/
\\
/g
,
'/'
);
}
if
(
path
.
includes
(
'/个人信息/'
))
{
path
=
`/cityinterface/rest/services/filedownload.svc/download
${
path
}
`
;
return
path
;
}
if
(
!
path
.
includes
(
'CityTemp'
)
&&
!
path
.
includes
(
'图库'
))
{
path
=
`CityTemp\\图库\\
${
path
}
`
;
}
return
`/PandaOMS/OMS/FileCenter/DownLoadFiles?module=图库&filePath=
${
encodeURIComponent
(
path
)}
`
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment