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
ba410954
Commit
ba410954
authored
Mar 25, 2024
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 图片预览修改
parent
5a6a7d77
Pipeline
#86426
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
70 deletions
+87
-70
cloud.js
src/api/service/cloud.js
+17
-3
Site.js
src/layouts/Site.js
+58
-58
preview.js
src/pages/system/previews/preview.js
+12
-9
No files found.
src/api/service/cloud.js
View file @
ba410954
import
{
request
}
from
'@wisdom-utils/utils'
;
import
*
as
constants
from
'../../constants'
;
import
*
as
constants
from
'../../constants'
;
const
portalURL
=
'CityInterface/rest/Services/Portal.svc'
;
const
portalURL
=
'CityInterface/rest/Services/Portal.svc'
;
export
const
API
=
{
export
const
API
=
{
GET_DATA_DICTIONARY_LIST
:
GET_DATA_DICTIONARY_LIST
:
'/CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc/GetDataDictionaryList'
,
'/CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc/GetDataDictionaryList'
,
// GET_ACCOUNT_PAGELIST: `/CityInterface/Services/CityServer_CaseManage/REST/CaseManageREST.svc/GetAccountPageList`,
// GET_ACCOUNT_PAGELIST: `/CityInterface/Services/CityServer_CaseManage/REST/CaseManageREST.svc/GetAccountPageList`,
GET_ACCOUNT_PAGELIST
:
`/PandaWorkFlow/WorkFlow/AccountManage/GetAccountPageList`
,
GET_ACCOUNT_PAGELIST
:
`/PandaWorkFlow/WorkFlow/AccountManage/GetAccountPageList`
,
// 云平台使用分析
// 云平台使用分析
LOGIN_STATISTIC
:
`
${
portalURL
}
/OMManage/LoginStatisticServer`
,
LOGIN_STATISTIC
:
`
${
portalURL
}
/OMManage/LoginStatisticServer`
,
FUNCTIONS_STATISTIC
:
`
${
portalURL
}
/OMManage/FunctionStatisticServer`
,
FUNCTIONS_STATISTIC
:
`
${
portalURL
}
/OMManage/FunctionStatisticServer`
,
...
@@ -50,4 +49,19 @@ const services = {
...
@@ -50,4 +49,19 @@ const services = {
},
},
};
};
export
const
getAccountPageListSite
=
(
data
,
props
,
site
)
=>
{
const
url
=
`
${
API
.
GET_ACCOUNT_PAGELIST
}
`
;
const
token
=
props
&&
props
.
access_token
!==
''
?
props
.
access_token
:
localStorage
.
getItem
(
'access_token'
);
return
request
({
url
,
method
:
constants
.
REQUEST_METHOD_POST
,
type
:
constants
.
REQUEST_HTTP
,
data
,
headers
:
{
'civ-site'
:
site
,
Authorization
:
`Bearer
${
token
}
`
,
},
});
};
export
default
services
;
export
default
services
;
src/layouts/Site.js
View file @
ba410954
...
@@ -157,64 +157,64 @@ class Site {
...
@@ -157,64 +157,64 @@ class Site {
const
stations
=
self
.
insertYSStation
();
const
stations
=
self
.
insertYSStation
();
if
(
city
)
{
//
if (city) {
// eslint-disable-next-line no-undef
//
// eslint-disable-next-line no-undef
appService
//
appService
.
getWeather
({
//
.getWeather({
city
,
//
city,
'request.preventCache'
:
new
Date
().
getTime
(),
//
'request.preventCache': new Date().getTime(),
ignoreSite
:
true
,
//
ignoreSite: true,
})
//
})
// eslint-disable-next-line no-shadow
//
// eslint-disable-next-line no-shadow
.
then
(
res
=>
{
//
.then(res => {
if
(
res
.
say
.
statusCode
===
ERR_OK
)
{
//
if (res.say.statusCode === ERR_OK) {
const
firtValue
=
res
.
getMe
[
0
];
//
const firtValue = res.getMe[0];
if
(
firtValue
.
cityName
)
{
//
if (firtValue.cityName) {
const
text
=
firtValue
.
forcastFirst
.
split
(
' '
)[
1
];
//
const text = firtValue.forcastFirst.split(' ')[1];
const
imgPath
=
firtValue
.
presentPictureFirst
.
replace
(
'gif'
,
'svg'
);
//
const imgPath = firtValue.presentPictureFirst.replace('gif', 'svg');
resolve
({
//
resolve({
stations
,
//
stations,
allStation
,
//
allStation,
weathers
:
{
//
weathers: {
icon
:
`https://panda-water.cn/web4/assets/images/weather2/
${
imgPath
}
`
,
//
icon: `https://panda-water.cn/web4/assets/images/weather2/${imgPath}`,
text
:
`
${
text
}
${
firtValue
.
temperatureFirst
}
`
,
//
text: `${text} ${firtValue.temperatureFirst}`,
},
//
},
siteCityList
:
self
.
siteCityList
,
//
siteCityList: self.siteCityList,
citySelector
:
self
.
citySelector
,
//
citySelector: self.citySelector,
currentStationName
:
self
.
currentStationName
,
//
currentStationName: self.currentStationName,
});
//
});
}
//
}
}
else
{
//
} else {
resolve
({
//
resolve({
stations
,
//
stations,
allStation
,
//
allStation,
siteCityList
:
self
.
siteCityList
,
//
siteCityList: self.siteCityList,
citySelector
:
self
.
citySelector
,
//
citySelector: self.citySelector,
currentStationName
:
self
.
currentStationName
,
//
currentStationName: self.currentStationName,
weathers
:
{},
//
weathers: {},
});
//
});
}
//
}
})
//
})
.
catch
(
error
=>
{
//
.catch(error => {
resolve
({
//
resolve({
stations
,
//
stations,
allStation
,
//
allStation,
currentStationName
:
self
.
currentStationName
,
//
currentStationName: self.currentStationName,
weathers
:
{},
//
weathers: {},
siteCityList
:
self
.
siteCityList
,
//
siteCityList: self.siteCityList,
citySelector
:
self
.
citySelector
,
//
citySelector: self.citySelector,
});
//
});
});
//
});
}
else
{
//
} else {
resolve
({
resolve
({
stations
,
stations
,
allStation
,
allStation
,
currentStationName
:
self
.
currentStationName
,
currentStationName
:
self
.
currentStationName
,
weathers
:
{},
weathers
:
{},
siteCityList
:
self
.
siteCityList
,
siteCityList
:
self
.
siteCityList
,
citySelector
:
self
.
citySelector
,
citySelector
:
self
.
citySelector
,
});
});
}
//
}
}
}
});
});
}
}
...
...
src/pages/system/previews/preview.js
View file @
ba410954
...
@@ -2,11 +2,10 @@ import React, { useEffect, useState, useCallback } from 'react';
...
@@ -2,11 +2,10 @@ import React, { useEffect, useState, useCallback } from 'react';
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
notification
}
from
'antd'
;
import
{
notification
}
from
'antd'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
cloudService
}
from
'@/api
'
;
import
{
getAccountPageListSite
}
from
'@/api/service/cloud
'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
useFullScreen
from
'../iframe/useFullScreen'
;
import
useFullScreen
from
'../iframe/useFullScreen'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
PrevieView
=
props
=>
{
const
PrevieView
=
props
=>
{
const
params
=
Object
.
assign
({},
props
.
params
,
{
const
params
=
Object
.
assign
({},
props
.
params
,
{
fullscreen
:
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
,
fullscreen
:
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
,
...
@@ -15,34 +14,38 @@ const PrevieView = props => {
...
@@ -15,34 +14,38 @@ const PrevieView = props => {
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
}
=
params
;
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
}
=
params
;
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
userInfo
=
props
.
global
?.
userInfo
;
const
{
userInfo
=
{}
}
=
props
.
global
;
const
getImgUrl
=
useCallback
(()
=>
{
const
getImgUrl
=
useCallback
(()
=>
{
cloudService
getAccountPageListSite
(
.
getAccountPageList
(
{
{
pageIndex
:
1
,
pageIndex
:
1
,
pageSize
:
5
,
pageSize
:
5
,
sortFields
:
'录入时间'
,
sortFields
:
'录入时间'
,
direction
:
'desc'
,
direction
:
'desc'
,
info
:
imgName
,
info
:
imgName
,
accountName
,
accountName
,
})
ignoreSite
:
true
,
},
props
.
global
,
userInfo
.
site
,
)
.
then
(
res
=>
{
.
then
(
res
=>
{
const
configData
=
JSON
.
parse
(
res
.
data
.
jsonData
||
'[]'
);
const
configData
=
JSON
.
parse
(
res
.
data
.
jsonData
||
'[]'
);
if
(
configData
.
length
>
0
&&
configData
[
0
][
'演示图片'
])
{
if
(
configData
.
length
>
0
&&
configData
[
0
][
'演示图片'
])
{
const
url
=
`
${
window
.
location
.
origin
}
/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=
${
const
url
=
`
${
window
.
location
.
origin
}
/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=
${
configData
[
0
][
'演示图片'
]
configData
[
0
][
'演示图片'
]
}
&_site=
${
userInfo
?
.
site
}
`;
}
&_site=
${
userInfo
.
site
}
`
;
setImgUrl
(
url
);
setImgUrl
(
url
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
});
});
});
}
,
[
accountName
,
imgName
,
props
.
global
,
userInfo
.
site
]
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getImgUrl
();
getImgUrl
();
}, [getImgUrl
, userInfo
]);
},
[
getImgUrl
]);
return
(
return
(
<
div
className
=
{
classnames
(
styles
[
'tab-preview'
],
canScroll
?
styles
[
'long-img'
]
:
styles
[
'normal-img'
])}
ref
=
{
ref
}
>
<
div
className
=
{
classnames
(
styles
[
'tab-preview'
],
canScroll
?
styles
[
'long-img'
]
:
styles
[
'normal-img'
])}
ref
=
{
ref
}
>
...
...
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