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
65381607
Commit
65381607
authored
Jan 08, 2021
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 图片选择优化
parent
9de83766
Pipeline
#21945
skipped with stages
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
85 additions
and
52 deletions
+85
-52
context.js
src/components/Upload/context.js
+17
-16
index.less
src/components/Upload/index.less
+1
-1
index.tsx
src/components/Upload/index.tsx
+11
-5
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+1
-0
SiteConfig.jsx
src/pages/mobileConfig/SiteConfig.jsx
+4
-1
addConfig.jsx
src/pages/mobileConfig/addConfig.jsx
+1
-1
AddForm.jsx
src/pages/mobileConfig/menuconfig/AddForm.jsx
+6
-6
editForm.jsx
src/pages/mobileConfig/menuconfig/editForm.jsx
+6
-6
index.js
src/pages/user/login/index.js
+19
-1
AddForm.jsx
src/pages/webConfig/menuconfig/AddForm.jsx
+2
-2
editForm.jsx
src/pages/webConfig/menuconfig/editForm.jsx
+3
-3
utils.js
src/pages/webConfig/utils.js
+3
-0
api.js
src/services/common/api.js
+2
-0
index.js
src/services/index.js
+9
-10
No files found.
src/components/Upload/context.js
View file @
65381607
import
{
getImageBases
,
g
etSysConfigurate
}
from
'@/services/common/api'
;
import
{
getImageBases
,
g
ateWayConfig
}
from
'@/services/common/api'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
const
UploadContext
=
React
.
createContext
();
...
...
@@ -27,24 +27,25 @@ const PictureWallProvider = props => {
console
.
error
(
err
);
return
sleep
(
3000
).
then
(
update
);
});
const
updateDicName
=
()
=>
{
getSysConfigurate
().
then
(
res
=>
{
if
(
res
.
getMe
&&
(
res
.
getMe
[
0
]
===
1
||
res
.
getMe
[
0
]
===
'1'
))
{
window
.
DicNameSERVICE
=
'publish'
;
}
else
{
window
.
DicNameSERVICE
=
''
;
}
});
};
useEffect
(()
=>
{
update
();
},
[]);
useEffect
(()
=>
{
updateDicName
();
},
[]);
// const updateDicName = () => {
// gateWayConfig()
// .then(res => {
// if (res.code === 0 && res.data) {
// window.DicNameSERVICE = 'GateWay';
// } else {
// window.DicNameSERVICE = '';
// }
// })
// .catch(err => {
// window.DicNameSERVICE = '';
// });
// };
// useEffect(() => {
// updateDicName();
// }, []);
return
(
<
UploadContext
.
Provider
value
=
{{
imgBed
,
update
}}
>
{
children
}
...
...
src/components/Upload/index.less
View file @
65381607
...
...
@@ -25,7 +25,7 @@
}
}
.ant-tabs-content-holder{
padding: 5px 0;
//
padding: 5px 0;
}
.ant-modal-body{
padding-top: 0;
...
...
src/components/Upload/index.tsx
View file @
65381607
...
...
@@ -21,7 +21,7 @@ const wallCateName: any = {
const
tabNames
:
any
=
{
CityTemp
:
'用户上传'
,
icon
:
'icon图标'
,
androidMenu
:
'
安卓
图标'
,
androidMenu
:
'
移动应用
图标'
,
menuNew
:
'应用图标'
,
logo
:
'项目logo'
,
menu
:
'菜单图标'
...
...
@@ -50,6 +50,7 @@ interface PicturesWallType {
uploadContext
:
any
,
search
:
string
,
actives
:
any
,
picType
:
any
,
}
class
PicturesWall
extends
React
.
Component
<
PicturesWallType
>
{
...
...
@@ -310,6 +311,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
maxLen = 1,
cropRate = 375 / 158,
isCrop,
picType,
} = this.props;
const uploadButton = (
...
...
@@ -391,7 +393,11 @@ class PicturesWall extends React.Component<PicturesWallType> {
>
<Tabs defaultActiveKey={imgBed[0]?.moduleName} tabPosition="left" style={{ height: 520 }}>
{imgBed.map((item, i) => {
if(item.moduleName!==picType){
return
}
const child = [...item.child] || [];
console.log(picType)
if(item.fileUrls.length > 0){
child.push({
moduleName: item.moduleName,
...
...
@@ -401,13 +407,13 @@ class PicturesWall extends React.Component<PicturesWallType> {
}
return (
<TabPane tab={tabNames[item.moduleName]||item.moduleName} key={item.moduleName}>
<Input
{/*
<Input
placeholder="搜索图库"
className={styles.search}
size="middle"
value={this.state.search}
onChange={e => this.setState({search: e.target.value})}
allowClear/>
allowClear/>
*/}
<div className={styles.imgBox}>
<Collapse
bordered
...
...
@@ -419,9 +425,9 @@ class PicturesWall extends React.Component<PicturesWallType> {
</TabPane>
);
})}
<TabPane tab="更多" key="more">
{/*
<TabPane tab="更多" key="more">
<Result status="500" title="温馨提示" subTitle="更多素材, 正在筹备中..." />
</TabPane>
</TabPane>
*/}
</Tabs>
</Modal>
</>
...
...
src/pages/database/ManagementDataBase.jsx
View file @
65381607
...
...
@@ -207,6 +207,7 @@ const ManagementDataBase = () => {
render
:
text
=>
(
<
Button
size=
"small"
disabled=
{
!
text
}
onClick=
{
()
=>
{
handleLog
(
text
,
'版本日志'
);
}
}
...
...
src/pages/mobileConfig/SiteConfig.jsx
View file @
65381607
...
...
@@ -110,6 +110,9 @@ const SiteConfig = props => {
>
<
Input
placeholder=
"请输入应用名称"
allowClear
/>
</
Item
>
<
Item
label=
"应用类别:"
>
<
Input
value=
{
clientName
}
disabled
/>
</
Item
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
...
...
@@ -120,7 +123,7 @@ const SiteConfig = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"icon"
/>
</
Item
>
<
Item
...
...
src/pages/mobileConfig/addConfig.jsx
View file @
65381607
...
...
@@ -104,7 +104,7 @@ const AddConfig = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"icon"
/>
</
Item
>
<
Item
...
...
src/pages/mobileConfig/menuconfig/AddForm.jsx
View file @
65381607
...
...
@@ -74,7 +74,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
addType
===
1
&&
(
...
...
@@ -88,7 +88,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
...
...
@@ -103,7 +103,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
<
Item
label=
"功能参数"
name=
"funParam"
>
...
...
@@ -151,7 +151,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
addType
===
3
&&
(
...
...
@@ -165,7 +165,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
addType
===
4
&&
(
...
...
@@ -179,7 +179,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
<
Item
...
...
src/pages/mobileConfig/menuconfig/editForm.jsx
View file @
65381607
...
...
@@ -90,7 +90,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
nodeType
===
1
&&
(
...
...
@@ -104,7 +104,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
...
...
@@ -119,7 +119,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
<
Item
label=
"功能参数"
name=
"funParam"
>
...
...
@@ -167,7 +167,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
nodeType
===
3
&&
(
...
...
@@ -181,7 +181,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
{
nodeType
===
4
&&
(
...
...
@@ -195,7 +195,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"androidMenu"
/>
</
Item
>
)
}
<
Item
...
...
src/pages/user/login/index.js
View file @
65381607
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Alert
,
notification
}
from
'antd'
;
import
{
OMSLogin
}
from
'@/services/user/api'
;
import
{
gateWayConfig
}
from
'@/services/common/api'
;
import
{
AUTHORITY
,
USER_MODE
}
from
'@/utils/constants'
;
import
{
appConnector
}
from
'@/containers/App/store'
;
import
{
useHistory
}
from
'react-router-dom'
;
...
...
@@ -83,6 +84,23 @@ const Login = props => {
});
};
const
updateDicName
=
()
=>
{
gateWayConfig
()
.
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
)
{
window
.
DicNameSERVICE
=
'GateWay'
;
}
else
{
window
.
DicNameSERVICE
=
''
;
}
})
.
catch
(
err
=>
{
window
.
DicNameSERVICE
=
''
;
});
};
useEffect
(()
=>
{
updateDicName
();
},
[]);
return
(
<
div
className
=
{
styles
.
main
}
>
<
LoginForm
activeKey
=
{
type
}
onTabChange
=
{
setType
}
onSubmit
=
{
handleSubmit
}
>
...
...
src/pages/webConfig/menuconfig/AddForm.jsx
View file @
65381607
...
...
@@ -69,7 +69,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"menuNew"
/>
</
Item
>
<
Item
label=
"功能路径"
...
...
@@ -142,7 +142,7 @@ const AddForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"menuNew"
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
submitLoading
}
>
...
...
src/pages/webConfig/menuconfig/editForm.jsx
View file @
65381607
...
...
@@ -76,11 +76,11 @@ const EditForm = props => {
rules=
{
[
{
required
:
true
,
message
:
'请选择
在线
图标'
,
message
:
'请选择
菜单
图标'
,
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"menuNew"
/>
</
Item
>
<
Item
label=
"功能路径"
...
...
@@ -158,7 +158,7 @@ const EditForm = props => {
},
]
}
>
<
PicturesWall
/>
<
PicturesWall
picType=
"menuNew"
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
10
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
...
...
src/pages/webConfig/utils.js
View file @
65381607
...
...
@@ -115,6 +115,7 @@ export const getDefaultGetWebconfig = ({
shortcutIcon
:
{
label
:
'系统icon'
,
formType
:
ITEM_TYPE
.
IMGSHOP
,
picType
:
'icon'
,
rules
:
[
{
required
:
true
,
...
...
@@ -125,6 +126,7 @@ export const getDefaultGetWebconfig = ({
logo
:
{
label
:
'登录logo'
,
formType
:
ITEM_TYPE
.
IMGSHOP
,
picType
:
'logo'
,
rules
:
[
{
required
:
true
,
...
...
@@ -135,6 +137,7 @@ export const getDefaultGetWebconfig = ({
bannerLogo
:
{
label
:
'标题logo'
,
formType
:
ITEM_TYPE
.
IMGSHOP
,
picType
:
'logo'
,
rules
:
[
{
required
:
true
,
...
...
src/services/common/api.js
View file @
65381607
...
...
@@ -7,3 +7,5 @@ export const getSysConfigurate = params =>
get
(
`/CityInterface/rest/services/Common.svc/Tool/GetSysConfigurate?dicName=网关启停`
,
);
export
const
gateWayConfig
=
params
=>
get
(
`/Publish/OMS/GateWayConfig`
,
params
);
src/services/index.js
View file @
65381607
import
{
request
}
from
'../utils/request'
;
console
.
log
(
window
,
'window'
);
// export const CITY_SERVICE =
// window.DicNameSERVICE !== 'publish'
// ? '/Publish/GateWay/CityServer'
// : '/Cityinterface/rest/services';
export
const
CITY_SERVICE
=
'/Cityinterface/rest/services'
;
export
const
PUBLISH_SERVICE
=
'/Publish/OMS'
;
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
let
isGateWay
=
false
;
console
.
log
(
window
,
'window'
,
isGateWay
);
const
CITY_SERVICE
=
isGateWay
?
'/Publish/GateWay/CityServer'
:
'/Cityinterface/rest/services'
;
// export const CITY_SERVICE = '/Publish/GateWay/CityServer';
const
PUBLISH_SERVICE
=
isGateWay
?
'/Publish/GateWay/OMS'
:
'/Publish/OMS'
;
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
console
.
log
(
CITY_SERVICE
,
PUBLISH_SERVICE
);
const
get
=
async
(
url
,
params
,
options
=
{})
=>
request
({
url
,
...
...
@@ -32,4 +31,4 @@ const postForm = async (url, params = {}, options = {}) => {
return
post
(
url
,
formData
,
options
);
};
export
{
get
,
post
,
postForm
};
export
{
get
,
post
,
postForm
,
CITY_SERVICE
,
PUBLISH_SERVICE
};
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