Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp_estate_client
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
mp_estate_backstage
mp_estate_client
Commits
7ad07a39
Commit
7ad07a39
authored
Sep 08, 2020
by
成旭东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
b9b3e90b
Pipeline
#28003
passed with stage
in 2 minutes 3 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
3 deletions
+75
-3
index.tsx
src/pages/mpEstate/videoList/index.tsx
+75
-3
No files found.
src/pages/mpEstate/videoList/index.tsx
View file @
7ad07a39
...
@@ -3,18 +3,21 @@
...
@@ -3,18 +3,21 @@
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
connect
}
from
'umi'
;
import
{
connect
}
from
'umi'
;
import
{
Card
,
Table
,
message
,
Button
,
Switch
,
Popconfirm
,
Drawer
,
Form
,
Input
,
InputNumber
}
from
'antd'
;
import
{
Card
,
Table
,
message
,
Button
,
Switch
,
Popconfirm
,
Drawer
,
Form
,
Input
,
InputNumber
,
Select
}
from
'antd'
;
import
SearchForm
from
'@/components/SearchForm'
;
import
SearchForm
from
'@/components/SearchForm'
;
import
InputImages
from
'@/components/UploadMedia/InputImages'
;
import
InputImages
from
'@/components/UploadMedia/InputImages'
;
import
configData
from
'./config'
;
import
configData
from
'./config'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
{
Option
}
=
Select
;
const
DrawerForm
=
(
props
:
any
)
=>
{
const
DrawerForm
=
(
props
:
any
)
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
{
const
{
estateData
,
getProjectList
,
drawerFormOk
,
drawerFormOk
,
drawerFormCancel
,
drawerFormCancel
,
editeObj
,
editeObj
,
...
@@ -71,6 +74,16 @@ const DrawerForm = (props: any) => {
...
@@ -71,6 +74,16 @@ const DrawerForm = (props: any) => {
},
},
};
};
const
searchProject
=
(
val
:
any
)
=>
{
if
(
val
)
{
getProjectList
({
name
:
val
,
});
}
else
{
getProjectList
();
}
}
return
(
return
(
<>
<>
<
Form
<
Form
...
@@ -89,7 +102,16 @@ const DrawerForm = (props: any) => {
...
@@ -89,7 +102,16 @@ const DrawerForm = (props: any) => {
},
},
]
}
]
}
>
>
<
Input
/>
<
Select
showSearch
onSearch=
{
searchProject
}
>
{
estateData
.
list
.
map
((
item
:
any
,
index
:
any
)
=>
(
<
Option
key=
{
index
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Option
>
))
}
</
Select
>
</
FormItem
>
</
FormItem
>
<
FormItem
<
FormItem
name=
"title"
name=
"title"
...
@@ -206,6 +228,43 @@ const VideoList: React.FC<any> = (props) => {
...
@@ -206,6 +228,43 @@ const VideoList: React.FC<any> = (props) => {
},
},
});
});
const
[
estateData
,
setEstateData
]
=
useState
({
list
:
[],
pagination
:
{
pageSize
:
10
,
current
:
1
,
total
:
0
,
},
});
// 获取楼盘数据
const
getProjectList
=
(
params
=
{})
=>
{
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/fetchEstateList`
,
payload
:
params
,
callback
:
(
ret
:
any
)
=>
{
if
(
ret
.
error
)
{
message
.
error
(
ret
.
error
);
}
else
{
setEstateData
({
list
:
ret
.
data
,
pagination
:
{
pageSize
:
ret
.
size
,
current
:
ret
.
page
,
total
:
ret
.
total
,
},
})
}
}
});
};
useEffect
(()
=>
{
getProjectList
();
},
[]);
// 获取数据
// 获取数据
const
getPageList
=
(
params
=
{})
=>
{
const
getPageList
=
(
params
=
{})
=>
{
const
{
dispatch
}
=
props
;
const
{
dispatch
}
=
props
;
...
@@ -313,12 +372,22 @@ const VideoList: React.FC<any> = (props) => {
...
@@ -313,12 +372,22 @@ const VideoList: React.FC<any> = (props) => {
// 编辑视频
// 编辑视频
const
editeVideo
=
(
obj
:
any
)
=>
{
const
editeVideo
=
(
obj
:
any
)
=>
{
const
currentEstateData
=
estateData
.
list
.
map
((
item
:
any
)
=>
item
.
id
);
if
(
!
currentEstateData
.
includes
(
obj
.
project_id
))
{
getProjectList
({
name
:
obj
.
project
.
name
,
})
}
setEditeObj
(
obj
);
setEditeObj
(
obj
);
setDrawerVisible
(
!
drawerVisible
);
setDrawerVisible
(
!
drawerVisible
);
}
}
// 新建视频
// 新建视频
const
addEstateVideo
=
()
=>
{
const
addEstateVideo
=
()
=>
{
getProjectList
();
setEditeObj
({});
setEditeObj
({});
setDrawerVisible
(
!
drawerVisible
);
setDrawerVisible
(
!
drawerVisible
);
}
}
...
@@ -494,6 +563,8 @@ const VideoList: React.FC<any> = (props) => {
...
@@ -494,6 +563,8 @@ const VideoList: React.FC<any> = (props) => {
destroyOnClose
destroyOnClose
>
>
<
DrawerForm
<
DrawerForm
estateData=
{
estateData
}
getProjectList=
{
getProjectList
}
drawerFormOk=
{
drawerFormOk
}
drawerFormOk=
{
drawerFormOk
}
drawerFormCancel=
{
drawerFormCancel
}
drawerFormCancel=
{
drawerFormCancel
}
editeObj=
{
editeObj
}
editeObj=
{
editeObj
}
...
@@ -505,7 +576,8 @@ const VideoList: React.FC<any> = (props) => {
...
@@ -505,7 +576,8 @@ const VideoList: React.FC<any> = (props) => {
);
);
};
};
export
default
connect
(({
videoList
,
loading
}:
any
)
=>
({
export
default
connect
(({
estateList
,
videoList
,
loading
}:
any
)
=>
({
estateList
,
videoList
,
videoList
,
dataLoading
:
loading
.
effects
[
'videoList/fetchVideoList'
],
dataLoading
:
loading
.
effects
[
'videoList/fetchVideoList'
],
updateLoading
:
loading
.
effects
[
'videoList/updateEstateVideo'
],
updateLoading
:
loading
.
effects
[
'videoList/updateEstateVideo'
],
...
...
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