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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
62 deletions
+79
-62
cloud.js
src/api/service/cloud.js
+17
-3
Site.js
src/layouts/Site.js
+50
-50
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'
;
const
portalURL
=
'CityInterface/rest/Services/Portal.svc'
;
export
const
API
=
{
GET_DATA_DICTIONARY_LIST
:
'/CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc/GetDataDictionaryList'
,
GET_DATA_DICTIONARY_LIST
:
'/CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc/GetDataDictionaryList'
,
// GET_ACCOUNT_PAGELIST: `/CityInterface/Services/CityServer_CaseManage/REST/CaseManageREST.svc/GetAccountPageList`,
GET_ACCOUNT_PAGELIST
:
`/PandaWorkFlow/WorkFlow/AccountManage/GetAccountPageList`
,
// 云平台使用分析
LOGIN_STATISTIC
:
`
${
portalURL
}
/OMManage/LoginStatisticServer`
,
FUNCTIONS_STATISTIC
:
`
${
portalURL
}
/OMManage/FunctionStatisticServer`
,
...
...
@@ -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
;
src/layouts/Site.js
View file @
ba410954
...
...
@@ -157,45 +157,55 @@ class Site {
const
stations
=
self
.
insertYSStation
();
if
(
city
)
{
// eslint-disable-next-line no-undef
appService
.
getWeather
({
city
,
'request.preventCache'
:
new
Date
().
getTime
(),
ignoreSite
:
true
,
})
// eslint-disable-next-line no-shadow
.
then
(
res
=>
{
if
(
res
.
say
.
statusCode
===
ERR_OK
)
{
const
firtValue
=
res
.
getMe
[
0
];
if
(
firtValue
.
cityName
)
{
const
text
=
firtValue
.
forcastFirst
.
split
(
' '
)[
1
];
const
imgPath
=
firtValue
.
presentPictureFirst
.
replace
(
'gif'
,
'svg'
);
resolve
({
stations
,
allStation
,
weathers
:
{
icon
:
`https://panda-water.cn/web4/assets/images/weather2/
${
imgPath
}
`
,
text
:
`
${
text
}
${
firtValue
.
temperatureFirst
}
`
,
},
siteCityList
:
self
.
siteCityList
,
citySelector
:
self
.
citySelector
,
currentStationName
:
self
.
currentStationName
,
});
}
}
else
{
resolve
({
stations
,
allStation
,
siteCityList
:
self
.
siteCityList
,
citySelector
:
self
.
citySelector
,
currentStationName
:
self
.
currentStationName
,
weathers
:
{},
});
}
})
.
catch
(
error
=>
{
// if (city) {
// // eslint-disable-next-line no-undef
// appService
// .getWeather({
// city,
// 'request.preventCache': new Date().getTime(),
// ignoreSite: true,
// })
// // eslint-disable-next-line no-shadow
// .then(res => {
// if (res.say.statusCode === ERR_OK) {
// const firtValue = res.getMe[0];
// if (firtValue.cityName) {
// const text = firtValue.forcastFirst.split(' ')[1];
// const imgPath = firtValue.presentPictureFirst.replace('gif', 'svg');
// resolve({
// stations,
// allStation,
// weathers: {
// icon: `https://panda-water.cn/web4/assets/images/weather2/${imgPath}`,
// text: `${text} ${firtValue.temperatureFirst}`,
// },
// siteCityList: self.siteCityList,
// citySelector: self.citySelector,
// currentStationName: self.currentStationName,
// });
// }
// } else {
// resolve({
// stations,
// allStation,
// siteCityList: self.siteCityList,
// citySelector: self.citySelector,
// currentStationName: self.currentStationName,
// weathers: {},
// });
// }
// })
// .catch(error => {
// resolve({
// stations,
// allStation,
// currentStationName: self.currentStationName,
// weathers: {},
// siteCityList: self.siteCityList,
// citySelector: self.citySelector,
// });
// });
// } else {
resolve
({
stations
,
allStation
,
...
...
@@ -204,17 +214,7 @@ class Site {
siteCityList
:
self
.
siteCityList
,
citySelector
:
self
.
citySelector
,
});
});
}
else
{
resolve
({
stations
,
allStation
,
currentStationName
:
self
.
currentStationName
,
weathers
:
{},
siteCityList
:
self
.
siteCityList
,
citySelector
:
self
.
citySelector
,
});
}
// }
}
});
}
...
...
src/pages/system/previews/preview.js
View file @
ba410954
...
...
@@ -2,11 +2,10 @@ import React, { useEffect, useState, useCallback } from 'react';
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
notification
}
from
'antd'
;
import
classnames
from
'classnames'
;
import
{
cloudService
}
from
'@/api
'
;
import
{
getAccountPageListSite
}
from
'@/api/service/cloud
'
;
import
{
connect
}
from
'react-redux'
;
import
useFullScreen
from
'../iframe/useFullScreen'
;
import
styles
from
'./index.less'
;
const
PrevieView
=
props
=>
{
const
params
=
Object
.
assign
({},
props
.
params
,
{
fullscreen
:
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
,
...
...
@@ -15,34 +14,38 @@ const PrevieView = props => {
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
}
=
params
;
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
userInfo
=
props
.
global
?.
userInfo
;
const
{
userInfo
=
{}
}
=
props
.
global
;
const
getImgUrl
=
useCallback
(()
=>
{
cloudService
.
getAccountPageList
(
{
getAccountPageListSite
(
{
pageIndex
:
1
,
pageSize
:
5
,
sortFields
:
'录入时间'
,
direction
:
'desc'
,
info
:
imgName
,
accountName
,
})
ignoreSite
:
true
,
},
props
.
global
,
userInfo
.
site
,
)
.
then
(
res
=>
{
const
configData
=
JSON
.
parse
(
res
.
data
.
jsonData
||
'[]'
);
if
(
configData
.
length
>
0
&&
configData
[
0
][
'演示图片'
])
{
const
url
=
`
${
window
.
location
.
origin
}
/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=
${
configData
[
0
][
'演示图片'
]
}
&_site=
${
userInfo
?
.
site
}
`;
}
&_site=
${
userInfo
.
site
}
`
;
setImgUrl
(
url
);
}
})
.
catch
(
err
=>
{
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
});
});
}
,
[
accountName
,
imgName
,
props
.
global
,
userInfo
.
site
]
);
useEffect
(()
=>
{
getImgUrl
();
}, [getImgUrl
, userInfo
]);
},
[
getImgUrl
]);
return
(
<
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