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
2f4d379e
Commit
2f4d379e
authored
Dec 18, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复移动配置
parent
baa85b98
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
39 deletions
+75
-39
SiteConfig.jsx
src/pages/mobileConfig/SiteConfig.jsx
+1
-2
index.js
src/pages/mobileConfig/index.js
+17
-5
VersionPublish.js
src/pages/mobileConfig/menuconfig/VersionPublish.js
+48
-31
otherConfig.less
src/pages/mobileConfig/menuconfig/otherConfig.less
+4
-0
api.js
src/services/appConfig/api.js
+1
-1
api.js
src/services/mobileConfig/api.js
+4
-0
No files found.
src/pages/mobileConfig/SiteConfig.jsx
View file @
2f4d379e
...
...
@@ -74,7 +74,7 @@ const SiteConfig = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
submitCallback
();
submitCallback
(
obj
.
title
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -87,7 +87,6 @@ const SiteConfig = props => {
description
:
res
.
message
||
'编辑失败'
,
});
}
console
.
log
(
res
,
'res'
);
})
.
catch
(
err
=>
{
setLoading
(
false
);
...
...
src/pages/mobileConfig/index.js
View file @
2f4d379e
...
...
@@ -55,10 +55,18 @@ const MobileConfigPage = props => {
return
item
;
});
setParentKey
(
arr
[
0
].
id
);
setSingleList
(
arr
);
setMiniTitle
(
arr
[
0
].
text
);
setClientName
(
arr
[
0
].
subSystemValue
);
if
(
miniTitle
)
{
let
obj
=
arr
.
find
(
item
=>
item
.
text
===
miniTitle
);
setParentKey
(
obj
.
id
);
setMiniTitle
(
obj
.
text
);
setClientName
(
obj
.
subSystemValue
);
}
else
{
setParentKey
(
arr
[
0
].
id
);
setMiniTitle
(
arr
[
0
].
text
);
setClientName
(
arr
[
0
].
subSystemValue
);
}
console
.
log
(
arr
);
}
else
{
setShowConfig
(
false
);
...
...
@@ -106,14 +114,17 @@ const MobileConfigPage = props => {
setClientName
(
obj
.
subSystemValue
);
setMiniTitle
(
obj
.
text
);
};
const
submitCallback
=
()
=>
{
const
submitCallback
=
val
=>
{
setFlag
(
flag
+
1
);
setMiniTitle
(
val
);
setSubType
(
''
);
};
const
addCallback
=
val
=>
{
console
.
log
(
val
);
setSubType
(
''
);
setAddVisible
(
false
);
setMiniTitle
(
val
);
setFlag
(
flag
+
1
);
// setMiniTitle(val);
};
...
...
@@ -130,6 +141,7 @@ const MobileConfigPage = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
setMiniTitle
(
''
);
setFlag
(
flag
+
1
);
deleteMiniMenu
({
visible
:
val
});
notification
.
success
({
...
...
@@ -221,7 +233,7 @@ const MobileConfigPage = props => {
{
title
:
'版本包配置'
,
key
:
'3'
,
component
:
<
VersionPublish
/>
,
component
:
<
VersionPublish
clientName
=
{
clientName
}
/>
,
},
];
return
(
...
...
src/pages/mobileConfig/menuconfig/VersionPublish.js
View file @
2f4d379e
...
...
@@ -4,6 +4,7 @@ import { Switch, Button, Message, Spin, Modal } from 'antd';
import
BaseForm
from
'@/components/BaseForm/index'
;
import
{
getApkNameAndDate
,
SaveMobileApk
}
from
'@/services/appConfig/api'
;
import
{
getMobileFiles
}
from
'@/services/mobileConfig/api'
;
import
styles
from
'./otherConfig.less'
;
...
...
@@ -11,7 +12,9 @@ import styles from './otherConfig.less';
// location.origin
// }/cityinterface/rest/services/filedownload.svc/download/BufFile/Mobile/APK/`;
export
default
()
=>
{
export
default
props
=>
{
console
.
log
(
props
);
const
{
clientName
}
=
props
;
const
items
=
[
{
label
:
'更新描述'
,
...
...
@@ -50,12 +53,13 @@ export default () => {
const
formEntity
=
useRef
(
null
);
const
fileEntity
=
useRef
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
tru
e
);
// 显示请求的loading
const
[
loading
,
setLoading
]
=
useState
(
fals
e
);
// 显示请求的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
[
upFlag
,
setUpFlag
]
=
useState
(
1
);
// const uploadProps = {
// name: 'file',
...
...
@@ -79,17 +83,18 @@ export default () => {
formData
.
set
(
'description'
,
describe
);
formData
.
set
(
'isRefresh'
,
!!
forceUpdate
);
formData
.
set
(
'file'
,
file
);
formData
.
set
(
'client'
,
'miniapp'
);
formData
.
set
(
'client'
,
clientName
);
setProgress
(
true
);
SaveMobileApk
(
formData
).
then
(
res
=>
{
console
.
log
(
res
);
setProgress
(
false
);
if
(
Number
(
res
.
code
)
===
20
0
)
{
if
(
Number
(
res
.
code
)
===
0
)
{
Message
.
success
(
'更新成功'
);
setUpFlag
(
upFlag
+
1
);
setShowModal
(
false
);
init
();
}
else
{
Message
.
error
(
res
.
msg
);
//
Message.error(res.msg);
}
});
})
...
...
@@ -114,32 +119,46 @@ export default () => {
};
const
init
=
()
=>
{
getApkNameAndDate
({})
.
then
(
res
=>
{
const
message
=
res
.
ResultMessage
||
''
;
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
);
});
//
getApkNameAndDate({})
//
.then(res => {
//
const message = res.ResultMessage || '';
//
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
();
},
[]);
useEffect
(()
=>
{
console
.
log
(
window
.
location
.
origin
);
getMobileFiles
({
client
:
clientName
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
{
data
}
=
res
;
let
fileName
=
data
.
apkPath
.
split
(
'/'
)[
data
.
apkPath
.
split
(
'/'
).
length
-
1
]
||
''
;
setFileData
({
...
data
,
fileName
,
isRefresh
:
true
,
});
}
});
},
[
upFlag
]);
return
(
<
div
className
=
{
loading
?
styles
.
loadingContainer
:
styles
.
VersionPublish
}
>
{
loading
?
(
...
...
@@ -168,14 +187,12 @@ export default () => {
<
/div
>
<
div
className
=
{
styles
.
row
}
>
<
div
className
=
{
styles
.
label
}
>
更新描述:
<
/div
>
<
div
className
=
"value"
>
更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:更新描述:
<
/div
>
<
div
className
=
"value"
>
{
fileData
.
description
}
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
row
}
>
<
div
className
=
{
styles
.
label
}
>
强制更新:
<
/div
>
<
div
className
=
"value"
>
<
Switch
checked
disabled
/>
<
Switch
checked
=
{
fileData
.
isRefresh
}
disabled
/>
<
/div
>
<
/div
>
<
Button
...
...
@@ -198,7 +215,7 @@ export default () => {
>
<
BaseForm
items
=
{
items
}
getForm
=
{
handleGetForm
}
/
>
<
div
className
=
{
styles
.
row
}
>
<
div
className
=
{
`
${
styles
.
label
}
${
styles
.
required
}
`
}
>
<
div
className
=
{
`
${
styles
.
label
2
}
${
styles
.
required
}
`
}
>
apk
文件:
<
/div
>
<
input
...
...
src/pages/mobileConfig/menuconfig/otherConfig.less
View file @
2f4d379e
...
...
@@ -27,4 +27,7 @@
.label {
width: 100px;
flex-shrink: 0;
}
.label2 {
flex-shrink: 0;
}
\ No newline at end of file
src/services/appConfig/api.js
View file @
2f4d379e
...
...
@@ -115,4 +115,4 @@ export const getApkNameAndDate = params =>
);
// 上传apk版本信息以及apk包的接口
export
const
SaveMobileApk
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/FileCenter/SaveMobileApk`
,
params
);
post
(
`
/Publish/OMS
/FileCenter/SaveMobileApk`
,
params
);
src/services/mobileConfig/api.js
View file @
2f4d379e
...
...
@@ -108,3 +108,7 @@ export const dragMenu = params =>
export
const
deleteMiniMenu
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/PlatformCenter/DeleteMiniMenu`
,
params
);
// 获取移动应用上传APK信息
export
const
getMobileFiles
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/FileCenter/GetMobileFiles`
,
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