Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
CivManage
Commits
5af2c243
Commit
5af2c243
authored
May 16, 2023
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '1.图片上传下载逻辑优化2.接口添加'
parent
fcacc12b
Pipeline
#72418
failed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
30 deletions
+102
-30
index.tsx
src/components/Upload/index.tsx
+21
-11
WorkflowHomePage.jsx
...ges/bsmanager/workOrder/workflowEdit/WorkflowHomePage.jsx
+23
-6
AddModal.jsx
src/pages/platformCenter/integratedLogin/AddModal.jsx
+17
-4
Integrate.jsx
src/pages/platformCenter/integratedLogin/Integrate.jsx
+11
-3
Master.jsx
src/pages/platformCenter/integratedLogin/Master.jsx
+15
-5
api.js
src/services/common/api.js
+5
-0
api.js
src/services/standingBook/api.js
+10
-1
No files found.
src/components/Upload/index.tsx
View file @
5af2c243
...
...
@@ -6,6 +6,7 @@ import classnames from 'classnames';
import
{
UploadFile
,
UploadChangeParam
,
RcFile
}
from
'antd/lib/upload/interface'
;
import
{
uuid
}
from
'@/utils/tools'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
styles
from
'./index.less'
;
import
{
getImageBases
}
from
'@/services/common/api'
;
import
UploadContext
from
'./context'
...
...
@@ -264,17 +265,26 @@ class PicturesWall extends React.Component<PicturesWallType> {
// })
// }
getImageUrl(path) {
if (path && path.indexOf('
http
') === 0) {
return path
}
if (path && path.indexOf('
data
:
') === 0) {
return path
}
if (path && path.indexOf('
assets
') === 0) {
return `${window.location.origin}/civweb4/${path}`.replace(/
\\
/g, '
/
')
}
return `${window.location.origin}/${path}`.replace(/
\\
/g, '
/
')
getImageUrl(path: string) {
// return new Promise<string>((resolve, reject) => {
// DownLoadFiles({ module: '
图库
', filePath: path }).then(res=> {
// let reader = new FileReader();
// reader.readAsDataURL(res);
// reader.onload = () => resolve(reader.result as string);
// })
// });
return `/PandaOMS/OMS/FileCenter/DownLoadFiles?module=图库&filePath=${path}`
// if (path && path.indexOf('
http
') === 0) {
// return path
// }
// if (path && path.indexOf('
data
:
') === 0) {
// return path
// }
// if (path && path.indexOf('
assets
') === 0) {
// return `${window.location.origin}/civweb4/${path}`.replace(/
\\
/g, '
/
')
// }
// return `${window.location.origin}/${path}`.replace(/
\\
/g, '
/
')
}
getFileName(path: string) {
...
...
src/pages/bsmanager/workOrder/workflowEdit/WorkflowHomePage.jsx
View file @
5af2c243
...
...
@@ -18,6 +18,7 @@ import FlowGroupModal from './workFlowComponents/FlowGroupModal';
import
Order
from
'./workFlowComponents/Order'
;
import
styles
from
'./WorkflowHomePage.less'
;
import
{
WFGetAllFlow
,
GetFlowNode
,
DeleteFlow
}
from
'@/services/workflow/workflow'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
{
UpdateFlowGroup
}
from
'@/services/workflow/workflow'
;
const
plugins
=
[
ScrollToPlugin
];
const
{
Search
}
=
Input
;
...
...
@@ -113,6 +114,7 @@ const WorkflowHomePage = () => {
let
list
=
res
.
data
.
map
((
item
,
index
)
=>
{
item
.
children
.
forEach
(
ele
=>
{
flowNameList
.
push
(
ele
.
FlowName
);
ele
.
PreviewImage
=
getImgUrl
(
ele
.
PreviewImage
)
});
item
.
isOld
=
true
;
item
.
bgType
=
(
index
+
1
)
%
5
;
...
...
@@ -263,7 +265,11 @@ const WorkflowHomePage = () => {
getFlowList
();
message
.
success
(
'删除成功'
);
}
else
{
message
.
error
({
content
:
<
div
style=
{
{
whiteSpace
:
'pre-line'
,
textAlign
:
'justify'
}
}
>
{
res
.
msg
}
</
div
>
});
message
.
error
({
content
:
(
<
div
style=
{
{
whiteSpace
:
'pre-line'
,
textAlign
:
'justify'
}
}
>
{
res
.
msg
}
</
div
>
),
});
}
})
.
catch
(()
=>
{
...
...
@@ -273,6 +279,16 @@ const WorkflowHomePage = () => {
onCancel
()
{},
});
};
const
getImgUrl
=
img
=>
{
// return new Promise((resolve, reject) => {
// DownLoadFiles({ module: '图库', filePath: img }).then(res => {
// let reader = new FileReader();
// reader.readAsDataURL(res);
// reader.onload = () => resolve(reader.result);
// });
// });a
return
`/PandaOMS/OMS/FileCenter/DownLoadFiles?module=图库&filePath=
${
img
}
`
};
// tab栏选项渲染
const
tabRender
=
(
val
,
index
)
=>
(
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-around'
}
}
>
...
...
@@ -408,9 +424,9 @@ const WorkflowHomePage = () => {
<
div
className=
{
styles
.
name
}
contenteditable=
"true"
>
<
Input
style=
{
{
width
:
item
.
name
.
length
*
14
+
'px'
,
width
:
item
.
name
.
length
*
14
+
'px'
,
fontSize
:
'14px'
,
padding
:
'0'
padding
:
'0'
,
}
}
placeholder=
"请输入分组名称"
onBlur=
{
e
=>
{
...
...
@@ -418,8 +434,8 @@ const WorkflowHomePage = () => {
}
}
bordered=
{
false
}
defaultValue=
{
item
.
name
}
onInput=
{
e
=>
{
e
.
currentTarget
.
style
.
width
=
(
e
.
currentTarget
.
value
.
length
)
*
14
+
"px"
;
onInput=
{
e
=>
{
e
.
currentTarget
.
style
.
width
=
e
.
currentTarget
.
value
.
length
*
14
+
'px'
;
}
}
// onPressEnter=
{
e
=
>
{
// console.log(e, '触发咯');
...
...
@@ -492,7 +508,8 @@ const WorkflowHomePage = () => {
// window.location.origin
// }/PandaOMS/OMS/FileCenter/DownLoadFiles?filePath=${ele.PreviewImage}`
}
// />
<
img
src=
{
`${window.location.origin}/${ele.PreviewImage}`
}
/>
// <img src=
{
`${window.location.origin}/${ele.PreviewImage}`
}
/
>
<
img
src
=
{
ele
.
PreviewImage
}
/
>
)
:
(
<
img
className=
{
styles
.
noDataImg
}
...
...
src/pages/platformCenter/integratedLogin/AddModal.jsx
View file @
5af2c243
...
...
@@ -27,6 +27,7 @@ import {
EditIntegratedLogin
,
GetIntegratedloginSetting
,
}
from
'@/services/integratedLogin/api'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
PreviewModal
from
'./PreviewModal'
;
...
...
@@ -392,6 +393,10 @@ const AddModal = props => {
setFileList
(
newFileList
);
};
const
getImg
=
img
=>
{
return
`/PandaOMS/OMS/FileCenter/DownLoadFiles?module=图库\\第三方图标&filePath=
${
img
}
`
;
};
const
handleChange
=
info
=>
{
setKeepImgeUrl
(
''
);
setIm
(
''
);
...
...
@@ -401,10 +406,18 @@ const AddModal = props => {
}
if
(
info
.
file
.
status
===
'done'
)
{
getBase64
(
info
.
file
.
originFileObj
,
url
=>
{
setLoading
(
false
);
setImageUrl
(
url
);
});
// DownLoadFiles({ module: '图库\\第三方图标', filePath: info.file.response.data }).then(res => {
// let reader = new FileReader();
// reader.readAsDataURL(res);
// reader.onload = function() {
// setImageUrl(reader.result);
// };
// });
setImageUrl
(
getImg
(
info
.
file
.
response
.
data
));
// getBase64(info.file.originFileObj, url => {
// setLoading(false);
// setImageUrl(url);
// });
}
};
...
...
src/pages/platformCenter/integratedLogin/Integrate.jsx
View file @
5af2c243
...
...
@@ -18,6 +18,7 @@ import {
SetIntegratedloginSettingSort
,
EditIntegratedLogin
,
}
from
'@/services/integratedLogin/api'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
{
EditTwoTone
,
DeleteOutlined
,
...
...
@@ -55,6 +56,10 @@ const Integrate = () => {
console
.
log
(
tableData
);
},
[
flag
]);
const
getImg
=
img
=>
{
return
`/PandaOMS/OMS/FileCenter/DownLoadFiles?module=图库\\第三方图标&filePath=
${
img
}
`
;
};
const
columns
=
[
{
title
:
'序号'
,
...
...
@@ -70,15 +75,16 @@ const Integrate = () => {
},
{
title
:
'图标'
,
dataIndex
:
'
icon
Url'
,
key
:
'
icon
Url'
,
dataIndex
:
'
show
Url'
,
key
:
'
show
Url'
,
align
:
'center'
,
width
:
200
,
render
:
(
text
,
record
)
=>
{
if
(
text
)
{
return
(
<
Image
src=
{
`${window.location.origin}/${text}`
}
// src={`${window.location.origin}/${text}`}
src=
{
text
}
height=
"50px"
style=
{
{
backgroundColor
:
'#2881a1'
}
}
/>
...
...
@@ -315,11 +321,13 @@ const Integrate = () => {
aa
.
push
(
i
.
SystemName
);
resnew
.
data
[
j
].
AccountParamKey
=
i
.
AccountParam
[
0
].
key
;
resnew
.
data
[
j
].
AccountParamValue
=
i
.
AccountParam
[
0
].
value
;
resnew
.
data
[
j
].
showUrl
=
getImg
(
resnew
.
data
[
j
].
iconUrl
)
});
}
console
.
log
(
aa
);
setKeepSystemName
(
aa
);
console
.
log
(
resnew
.
data
);
console
.
log
(
resnew
.
data
,
'resnew.dataresnew.dataresnew.data'
);
setTableData
(
resnew
.
data
);
}
else
{
notification
.
error
({
...
...
src/pages/platformCenter/integratedLogin/Master.jsx
View file @
5af2c243
...
...
@@ -20,6 +20,7 @@ import {
AddIntegratedloginSetting
,
GetIntegratedloginSetting
,
}
from
'@/services/integratedLogin/api'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
PreviewModal
from
'./PreviewModal'
;
...
...
@@ -225,11 +226,20 @@ const Master = props => {
return
;
}
if
(
info
.
file
.
status
===
'done'
)
{
getBase64
(
info
.
file
.
originFileObj
,
url
=>
{
setLoading
(
false
);
setImageUrl
(
url
);
});
setImageUrl
(
getImg
(
info
.
file
.
response
.
data
));
// if (info.file.status === 'done') {
// DownLoadFiles({ module: '图库\\第三方图标', filePath: info.file.response.data }).then(res => {
// let reader = new FileReader();
// reader.readAsDataURL(res);
// reader.onload = function() {
// setImageUrl(reader.result);
// };
// });
// getBase64(info.file.originFileObj, url => {
// setLoading(false);
// setImageUrl(url);
// });
}
};
...
...
src/services/common/api.js
View file @
5af2c243
...
...
@@ -15,3 +15,8 @@ export const getSysConfigurate = params =>
export
const
gateWayConfig
=
params
=>
get
(
`/PandaCore/GCK/Basis/GateWayConfig`
,
params
);
// 获取网关配置
export
const
GetGateWay
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/GetGateWay`
,
param
);
// 获取图片文件流
export
const
DownLoadFiles
=
query
=>
get
(
`/PandaOMS/OMS/FileCenter/DownLoadFiles`
,
query
,
{
responseType
:
'blob'
,
});
src/services/standingBook/api.js
View file @
5af2c243
...
...
@@ -131,6 +131,14 @@ export const CheckImportLedgerConfig = data =>
export
const
ImportLedgerConfig
=
data
=>
post
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/ImportLedgerConfig`
,
data
);
// 获取台账字段配置数据
//
根据ID
获取台账字段配置数据
export
const
Ledger_QueryLedger
=
query
=>
get
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/Ledger_QueryLedger`
,
query
);
// 根据表名获取台账字段配置数据
export
const
Ledger_ReloadLedgerFields
=
query
=>
get
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/Ledger_ReloadLedgerFields`
,
query
);
// 提交台账配置数据
export
const
Ledger_SaveLedger
=
data
=>
post
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/Ledger_SaveLedger`
,
data
);
\ No newline at end of file
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