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
b8642b44
Commit
b8642b44
authored
Dec 04, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/test/maintenance
parents
4fbf5765
2dc0063d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
20 deletions
+137
-20
VersionPublish.js
src/pages/appConfig/VersionPublish.js
+85
-18
VersionPublish.less
src/pages/appConfig/VersionPublish.less
+40
-1
UserManage.js
src/pages/userCenter/UserManage.js
+1
-1
UserManage.less
src/pages/userCenter/UserManage.less
+6
-0
RoleManage.less
src/pages/userCenter/roleManage/RoleManage.less
+2
-0
api.js
src/services/appConfig/api.js
+3
-0
No files found.
src/pages/appConfig/VersionPublish.js
View file @
b8642b44
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
Switch
,
Button
,
Message
,
Spin
,
Modal
}
from
'antd'
;
// import axios from 'axios';
import
BaseForm
from
'@/components/BaseForm/index'
;
import
{
getApkNameAndDate
}
from
'@/services/appConfig/api'
;
import
{
getApkNameAndDate
,
SaveMobileApk
}
from
'@/services/appConfig/api'
;
import
styles
from
'./VersionPublish.less'
;
// const JSON_BASE = `${
// location.origin
// }/cityinterface/rest/services/filedownload.svc/download/BufFile/Mobile/APK/`;
export
default
()
=>
{
const
items
=
[
{
...
...
@@ -41,29 +46,51 @@ export default () => {
],
formType
:
'SINGLE_RADIO'
,
},
{
label
:
'apk上传'
,
dataIndex
:
'file'
,
rules
:
[
{
required
:
true
,
message
:
'请上传对应的apk'
,
},
],
formType
:
'IMGSHOP'
,
},
];
const
formEntity
=
useRef
(
null
);
const
fileEntity
=
useRef
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
// 显示请求的loading
const
[
showModal
,
setShowModal
]
=
useState
(
false
);
// 显示更新的modal
const
[
fileData
,
setFileData
]
=
useState
({});
// 获取到的包名和更新时间
const
[
file
,
setFile
]
=
useState
({});
// 上传的文件
const
[
fileSuccess
,
setFileSuccess
]
=
useState
(
false
);
// 本地文件是否成功
const
[
progress
,
setProgress
]
=
useState
(
false
);
// 是否正在保存
// const uploadProps = {
// name: 'file',
// action: `${window.location.origin}${PUBLISH_SERVICE}/FileCenter/UploadSingleFile`,
// headers: {
// Authorization: 'Bearer ' + localStorage.getItem('token') || '',
// },
// onChange(info) {
// console.log(info)
// setFile(info.file);
// },
// };
const
submitForm
=
()
=>
{
console
.
log
(
formEntity
);
const
{
validateFields
}
=
formEntity
.
current
;
validateFields
()
.
then
(
values
=>
{
console
.
log
(
values
);
const
{
describe
,
forceUpdate
}
=
values
;
const
formData
=
new
FormData
();
formData
.
set
(
'description'
,
describe
);
formData
.
set
(
'isRefresh'
,
!!
forceUpdate
);
formData
.
set
(
'file'
,
file
);
setProgress
(
true
);
SaveMobileApk
(
formData
).
then
(
res
=>
{
console
.
log
(
res
);
setProgress
(
false
);
if
(
Number
(
res
.
code
)
===
200
)
{
Message
.
success
(
'更新成功'
);
setShowModal
(
false
);
init
();
}
else
{
Message
.
error
(
res
.
msg
);
}
});
})
.
catch
(
res
=>
{
const
{
errorFields
,
values
}
=
res
;
...
...
@@ -75,22 +102,41 @@ export default () => {
formEntity
.
current
=
form
;
};
useEffect
(()
=>
{
const
handleFileChange
=
e
=>
{
console
.
log
(
e
.
target
.
files
);
setFile
(
e
.
target
.
files
[
0
]);
setFileSuccess
(
true
);
};
const
handleUpload
=
()
=>
{
fileEntity
.
current
.
click
();
};
const
init
=
()
=>
{
getApkNameAndDate
({})
.
then
(
res
=>
{
console
.
log
(
res
);
const
message
=
res
.
ResultMessage
||
''
;
const
[
fileName
,
updateTime
]
=
message
.
split
(
','
);
const
[
fileName
=
''
,
updateTime
]
=
message
.
split
(
','
);
setFileData
({
fileName
,
updateTime
,
});
setLoading
(
false
);
// const index = fileName.lastIndexOf('.');
// axios
// .get(`${JSON_BASE}${fileName.slice(0, index)}.json`, {})
// .then(res => {
// console.log(res);
// });
})
.
catch
(
err
=>
{
Message
.
error
(
err
);
setLoading
(
false
);
});
};
useEffect
(()
=>
{
init
();
},
[]);
return
(
...
...
@@ -112,8 +158,8 @@ export default () => {
<
div
className
=
{
styles
.
row
}
>
<
div
className
=
{
styles
.
label
}
>
下载地址:
<
/div
>
<
div
className
=
"value"
>
<
a
href
=
"
https://example.com
"
target
=
"_blank"
>
https
:
//example.com
<
a
href
=
"
/MobileGCK/getApk
"
target
=
"_blank"
>
{
`/MobileGCK/getApk`
}
<
/a
>
<
/div
>
<
/div
>
...
...
@@ -143,6 +189,27 @@ export default () => {
onOk
=
{
submitForm
}
>
<
BaseForm
items
=
{
items
}
getForm
=
{
handleGetForm
}
/
>
<
div
className
=
{
styles
.
row
}
>
<
div
className
=
{
`
${
styles
.
label
}
${
styles
.
required
}
`
}
>
apk
文件:
<
/div
>
<
input
ref
=
{
f
=>
{
fileEntity
.
current
=
f
;
}}
className
=
{
styles
[
'file-item'
]}
type
=
"file"
onChange
=
{
handleFileChange
}
/
>
<
Button
type
=
"primary"
onClick
=
{
handleUpload
}
>
{
fileSuccess
?
'上传成功'
:
'开始上传'
}
<
/Button
>
<
/div
>
{
progress
&&
(
<
div
className
=
{
styles
.
loadingBox
}
>
<
Spin
/>
<
/div
>
)}
<
/Modal
>
)}
<
/div
>
...
...
src/pages/appConfig/VersionPublish.less
View file @
b8642b44
...
...
@@ -19,6 +19,44 @@
}
.label {
width: 100px;
display: flex;
align-items: center;
width: 80px;
flex-shrink: 0;
text-align: right;
color: rgba(0, 0, 0, 0.85);
font-size: 14px;
}
.required {
&::before {
display: inline-block;
margin-right: 4px;
color: #ff4d4f;
font-size: 14px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
}
}
.file-item {
display: none;
}
.ant-form-item:last-child {
margin-bottom: 0;
}
.loadingBox {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
\ No newline at end of file
src/pages/userCenter/UserManage.js
View file @
b8642b44
...
...
@@ -1335,7 +1335,7 @@ const UserManage = () => {
}}
okText
=
"确认"
cancelText
=
"取消"
width
=
"9
6
0px"
width
=
"9
2
0px"
>
<
Spin
spinning
=
{
loading
}
tip
=
"loading"
>
<
Tabs
defaultActiveKey
=
"1"
style
=
{{
marginTop
:
'-16px'
}}
>
...
...
src/pages/userCenter/UserManage.less
View file @
b8642b44
...
...
@@ -107,6 +107,7 @@
padding-top: 6px;
.ant-tree-switcher{
line-height: 1;
margin-right: 0px !important;
color:#1890FF;
.ant-tree-switcher-line-icon{
margin-left: 5px;
...
...
@@ -182,4 +183,8 @@
line-height: 1;
color:#1890FF;
}
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
min-width: 204px !important;
}
}
\ No newline at end of file
src/pages/userCenter/roleManage/RoleManage.less
View file @
b8642b44
...
...
@@ -19,6 +19,7 @@
.ant-tree-iconEle{
display: flex;
align-items: center;
width: 18px;
}
}
}
...
...
@@ -63,6 +64,7 @@
.ant-tree-switcher{
display: flex;
align-items: center;
margin-right: -8px;
// color:#1890FF;
.ant-tree-switcher-line-icon{
// margin-left: 5px;
...
...
src/services/appConfig/api.js
View file @
b8642b44
...
...
@@ -107,3 +107,6 @@ export const getApkNameAndDate = params =>
`/Cityinterface/Services/CityServer_MobileBusiness/REST/BaseREST.svc/AppModifyTime`
,
params
,
);
// 上传apk版本信息以及apk包的接口
export
const
SaveMobileApk
=
params
=>
post
(
`/Publish/OMS/FileCenter/SaveMobileApk`
,
params
);
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