Commit 70cc8739 authored by Maofei94's avatar Maofei94

Merge branch 'master' of g.civnet.cn:test/maintenance

parents 17ef2560 a54591f2
...@@ -48,6 +48,7 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -48,6 +48,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
previewTitle: '', previewTitle: '',
imgBed: [], imgBed: [],
curSelectedImg: '', curSelectedImg: '',
prevProps:{},
fileList: this.props.value ? Array.isArray(this.props.value) ? this.props.value.map((v) => ({ fileList: this.props.value ? Array.isArray(this.props.value) ? this.props.value.map((v) => ({
url: v, url: v,
uid: uuid(8, 16), uid: uuid(8, 16),
...@@ -64,8 +65,9 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -64,8 +65,9 @@ class PicturesWall extends React.Component<PicturesWallType> {
static getDerivedStateFromProps = (props, state) => { static getDerivedStateFromProps = (props, state) => {
const fileList = state.fileList; const fileList = state.fileList;
const shouldUpdate = props.value && fileList.every(f => Array.isArray(props.value) ? !props.value.some(v => f.url === v) : f.url !== props.value) const shouldUpdate = props.value && fileList.every(f => Array.isArray(props.value) ? !props.value.some(v => f.url === v) : f.url !== props.value)
if(fileList.length === 0 && props.value && shouldUpdate){ if(props.value !== state.prevProps.value && shouldUpdate){
return { return {
provProps: props,
fileList: Array.isArray(props.value) ? props.value.map((v) => ({ fileList: Array.isArray(props.value) ? props.value.map((v) => ({
url: v, url: v,
uid: uuid(8, 16), uid: uuid(8, 16),
...@@ -79,7 +81,9 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -79,7 +81,9 @@ class PicturesWall extends React.Component<PicturesWallType> {
}] as UploadFile<any>[] }] as UploadFile<any>[]
} }
} }
return null; return {
prevProps: props
};
} }
update = () =>{ update = () =>{
......
...@@ -39,12 +39,15 @@ const WebConfigPage = props => { ...@@ -39,12 +39,15 @@ const WebConfigPage = props => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (!curWeb) return;
const title = curWeb.text;
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
curWeb && getWebconfig(curWeb.text).then(res => {
getWebconfig(curWeb.text).then(res => { setConfigObj(res);
setConfigObj(res); if (title === curWeb.text) {
setToEdit(res); setToEdit(res);
}); }
});
}, [curWeb]); }, [curWeb]);
const renderTabPane = tabPaneItem => ( const renderTabPane = tabPaneItem => (
......
.webConfigContainer{ .webConfigContainer{
position: absolute;
width: 100%;
height: 100%;
.ant-tabs-content-holder>.ant-tabs-content.ant-tabs-content-top{
position: absolute;
width: 100%;
height: calc(100% - 40px);
}
} }
.webConfigContainer > .ant-tabs-card .ant-tabs-content { .webConfigContainer > .ant-tabs-card .ant-tabs-content {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment