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
2d348500
Commit
2d348500
authored
Sep 17, 2020
by
成旭东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘详情 动态 户型图 楼盘图片查询接口分开
parent
8e7db100
Pipeline
#28260
passed with stage
in 6 minutes 6 seconds
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
27 deletions
+139
-27
houseImage.tsx
...pages/mpEstate/estateList/edite/components/houseImage.tsx
+31
-7
houseType.tsx
src/pages/mpEstate/estateList/edite/components/houseType.tsx
+32
-10
projectTrends.tsx
...es/mpEstate/estateList/edite/components/projectTrends.tsx
+31
-7
index.tsx
src/pages/mpEstate/estateList/edite/index.tsx
+3
-3
estateList.ts
src/pages/mpEstate/models/estateList.ts
+24
-0
estateList.ts
src/pages/mpEstate/services/estateList.ts
+18
-0
No files found.
src/pages/mpEstate/estateList/edite/components/houseImage.tsx
View file @
2d348500
...
...
@@ -24,12 +24,38 @@ const HouseImage = (props: any) => {
};
const
{
baseData
,
isEdite
}
=
props
;
const
{
houseImage
=
[]
}
=
baseData
;
const
[
houseImage
,
setHouseImage
]:
any
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
currentHouseImage
,
setCurrentHouseImage
]:
any
=
useState
([]);
// 获取基础数据
const
getImageData
=
()
=>
{
const
params
=
{
id
:
baseData
.
id
,
};
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/fetchEstateImage`
,
payload
:
params
,
callback
:
(
ret
:
any
)
=>
{
if
(
ret
.
error
)
{
message
.
error
(
ret
.
error
);
}
else
{
setHouseImage
(
ret
)
}
}
});
};
useEffect
(()
=>
{
getImageData
();
},
[
baseData
]);
// 按照创建时间进行排序
const
formatTimeHouseImageData
=
()
=>
{
const
returnData
=
houseImage
.
sort
((
a
:
any
,
b
:
any
)
=>
{
...
...
@@ -43,7 +69,7 @@ const HouseImage = (props: any) => {
useEffect
(()
=>
{
formatTimeHouseImageData
();
},
[
baseData
]);
},
[
houseImage
]);
const
[
firstHouseImage
,
setFirstHouseImage
]:
any
=
useState
({});
const
[
firstFlag
,
setFirstFlag
]:
any
=
useState
(
false
);
...
...
@@ -93,7 +119,7 @@ const HouseImage = (props: any) => {
// 添加数据
const
addData
=
()
=>
{
form
.
validateFields
().
then
((
fieldsValue
:
any
)
=>
{
const
{
dispatch
,
getBaseData
}
=
props
;
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/addEstateHouseImage`
,
...
...
@@ -107,7 +133,7 @@ const HouseImage = (props: any) => {
}
else
{
message
.
success
(
'添加成功'
);
get
Bas
eData
();
get
Imag
eData
();
setFirstFlag
(
!
firstFlag
)
}
}
...
...
@@ -142,11 +168,9 @@ const HouseImage = (props: any) => {
const
deleteHouseImage
=
(
obj
:
any
,
e
:
any
)
=>
{
e
.
stopPropagation
();
const
{
getBaseData
}
=
props
;
if
(
obj
.
id
)
{
deleteData
(
obj
.
id
,
()
=>
{
get
Bas
eData
();
get
Imag
eData
();
});
}
else
{
message
.
error
(
'未添加的图片, 不能删除'
);
...
...
src/pages/mpEstate/estateList/edite/components/houseType.tsx
View file @
2d348500
...
...
@@ -184,12 +184,38 @@ const DrawerForm = (props: any) => {
const
HouseType
=
(
props
:
any
)
=>
{
const
{
baseData
,
isEdite
}
=
props
;
const
{
houseLayout
=
[]
}
=
baseData
;
const
[
houseLayout
,
setHouseLayout
]:
any
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
currentLayout
,
setCurrentLayout
]:
any
=
useState
([]);
// 获取基础数据
const
getLayoutData
=
()
=>
{
const
params
=
{
id
:
baseData
.
id
,
};
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/fetchEstateLayout`
,
payload
:
params
,
callback
:
(
ret
:
any
)
=>
{
if
(
ret
.
error
)
{
message
.
error
(
ret
.
error
);
}
else
{
setHouseLayout
(
ret
)
}
}
});
};
useEffect
(()
=>
{
getLayoutData
();
},
[
baseData
]);
// 按照创建时间进行排序
const
formatTimeHouseTypeData
=
()
=>
{
const
returnData
=
houseLayout
.
sort
((
a
:
any
,
b
:
any
)
=>
{
...
...
@@ -203,7 +229,7 @@ const HouseType = (props: any) => {
useEffect
(()
=>
{
formatTimeHouseTypeData
();
},
[
baseData
]);
},
[
houseLayout
]);
const
[
firstLayout
,
setFirstLayout
]:
any
=
useState
({});
const
[
firstFlag
,
setFirstFlag
]:
any
=
useState
(
false
);
...
...
@@ -226,7 +252,7 @@ const HouseType = (props: any) => {
// 添加数据
const
addLayout
=
()
=>
{
form
.
validateFields
().
then
((
fieldsValue
:
any
)
=>
{
const
{
dispatch
,
getBaseData
}
=
props
;
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/addEstateHouseType`
,
...
...
@@ -240,7 +266,7 @@ const HouseType = (props: any) => {
}
else
{
message
.
success
(
'添加成功'
);
get
Base
Data
();
get
Layout
Data
();
setFirstFlag
(
!
firstFlag
)
}
}
...
...
@@ -309,11 +335,9 @@ const HouseType = (props: any) => {
const
deleteHouseType
=
(
obj
:
any
,
e
:
any
)
=>
{
e
.
stopPropagation
();
const
{
getBaseData
}
=
props
;
if
(
obj
.
id
)
{
deleteData
(
obj
.
id
,
()
=>
{
get
Base
Data
();
get
Layout
Data
();
});
}
else
{
message
.
error
(
'未添加户型, 不能删除'
);
...
...
@@ -328,8 +352,6 @@ const HouseType = (props: any) => {
// 抽屉确认
const
drawerFormOk
=
(
_
:
any
,
fieldsValue
:
any
)
=>
{
const
{
getBaseData
}
=
props
;
if
(
fieldsValue
.
id
)
{
const
updateId
=
fieldsValue
.
id
;
// eslint-disable-next-line no-param-reassign
...
...
@@ -339,7 +361,7 @@ const HouseType = (props: any) => {
setEditeObj
({});
setDrawerVisible
(
!
drawerVisible
);
get
Base
Data
();
get
Layout
Data
();
});
}
else
{
message
.
error
(
'未上传户型,不可编辑'
);
...
...
src/pages/mpEstate/estateList/edite/components/projectTrends.tsx
View file @
2d348500
...
...
@@ -152,12 +152,38 @@ const DrawerForm = (props: any) => {
const
ProjectTrends
=
(
props
:
any
)
=>
{
const
{
baseData
,
isEdite
}
=
props
;
const
{
projectTrends
=
[]
}
=
baseData
;
const
[
projectTrends
,
setProjectTrends
]:
any
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
currentTrend
,
setCurrentTrend
]:
any
=
useState
([]);
// 获取基础数据
const
getTrendsData
=
()
=>
{
const
params
=
{
id
:
baseData
.
id
,
};
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/fetchEstateTrends`
,
payload
:
params
,
callback
:
(
ret
:
any
)
=>
{
if
(
ret
.
error
)
{
message
.
error
(
ret
.
error
);
}
else
{
setProjectTrends
(
ret
)
}
}
});
};
useEffect
(()
=>
{
getTrendsData
();
},
[
baseData
]);
// 按照创建时间进行排序
const
formatTimeTrendData
=
()
=>
{
const
returnData
=
projectTrends
.
sort
((
a
:
any
,
b
:
any
)
=>
{
...
...
@@ -171,7 +197,7 @@ const ProjectTrends = (props: any) => {
useEffect
(()
=>
{
formatTimeTrendData
();
},
[
baseData
]);
},
[
projectTrends
]);
const
[
firstTrend
,
setFirstTrend
]:
any
=
useState
({});
const
[
firstFlag
,
setFirstFlag
]:
any
=
useState
(
false
);
...
...
@@ -194,7 +220,7 @@ const ProjectTrends = (props: any) => {
// 添加数据
const
addTrend
=
()
=>
{
form
.
validateFields
().
then
((
fieldsValue
:
any
)
=>
{
const
{
dispatch
,
getBaseData
}
=
props
;
const
{
dispatch
}
=
props
;
dispatch
({
type
:
`estateList/addEstateTrend`
,
...
...
@@ -208,7 +234,7 @@ const ProjectTrends = (props: any) => {
}
else
{
message
.
success
(
'添加成功'
);
get
Base
Data
();
get
Trends
Data
();
setFirstFlag
(
!
firstFlag
)
}
}
...
...
@@ -260,8 +286,6 @@ const ProjectTrends = (props: any) => {
// 抽屉确认
const
drawerFormOk
=
(
_
:
any
,
fieldsValue
:
any
)
=>
{
const
{
getBaseData
}
=
props
;
if
(
fieldsValue
.
id
)
{
const
updateId
=
fieldsValue
.
id
;
// eslint-disable-next-line no-param-reassign
...
...
@@ -271,7 +295,7 @@ const ProjectTrends = (props: any) => {
setEditeObj
({});
setDrawerVisible
(
!
drawerVisible
);
get
Base
Data
();
get
Trends
Data
();
});
}
else
{
message
.
error
(
'未上传动态,不可编辑'
);
...
...
src/pages/mpEstate/estateList/edite/index.tsx
View file @
2d348500
...
...
@@ -91,13 +91,13 @@ const VideoList: React.FC<any> = (props) => {
)
}
</
TabPane
>
<
TabPane
tab=
"楼盘动态"
key=
"3"
>
<
ProjectTrends
baseData=
{
baseData
}
getBaseData=
{
getBaseData
}
isEdite=
{
isEdite
}
/>
<
ProjectTrends
baseData=
{
baseData
}
isEdite=
{
isEdite
}
/>
</
TabPane
>
<
TabPane
tab=
"户型图"
key=
"4"
>
<
HouseType
baseData=
{
baseData
}
getBaseData=
{
getBaseData
}
isEdite=
{
isEdite
}
/>
<
HouseType
baseData=
{
baseData
}
isEdite=
{
isEdite
}
/>
</
TabPane
>
<
TabPane
tab=
"楼盘图片"
key=
"5"
>
<
HouseImage
baseData=
{
baseData
}
getBaseData=
{
getBaseData
}
isEdite=
{
isEdite
}
/>
<
HouseImage
baseData=
{
baseData
}
isEdite=
{
isEdite
}
/>
</
TabPane
>
</
Tabs
>
</
Card
>
...
...
src/pages/mpEstate/models/estateList.ts
View file @
2d348500
import
{
fetchEstateList
,
fetchEstateBase
,
fetchEstateTrends
,
fetchEstateLayout
,
fetchEstateImage
,
fetchEstateTag
,
updateEstate
,
updateEstateProjectTag
,
...
...
@@ -46,6 +49,27 @@ const EstateListModel: EstateListModelType = {
callback
(
response
);
}
},
*
fetchEstateTrends
({
payload
,
callback
}:
any
,
{
call
}:
any
)
{
const
response
=
yield
call
(
fetchEstateTrends
,
payload
);
if
(
callback
)
{
callback
(
response
);
}
},
*
fetchEstateLayout
({
payload
,
callback
}:
any
,
{
call
}:
any
)
{
const
response
=
yield
call
(
fetchEstateLayout
,
payload
);
if
(
callback
)
{
callback
(
response
);
}
},
*
fetchEstateImage
({
payload
,
callback
}:
any
,
{
call
}:
any
)
{
const
response
=
yield
call
(
fetchEstateImage
,
payload
);
if
(
callback
)
{
callback
(
response
);
}
},
*
fetchEstateTag
({
payload
,
callback
}:
any
,
{
call
}:
any
)
{
const
response
=
yield
call
(
fetchEstateTag
,
payload
);
...
...
src/pages/mpEstate/services/estateList.ts
View file @
2d348500
...
...
@@ -13,6 +13,24 @@ export async function fetchEstateBase(query: any) {
});
}
export
async
function
fetchEstateTrends
(
query
:
any
)
{
return
request
(
`/estate/trends/
${
query
.
id
}
`
,
{
method
:
'GET'
,
});
}
export
async
function
fetchEstateLayout
(
query
:
any
)
{
return
request
(
`/estate/layout/
${
query
.
id
}
`
,
{
method
:
'GET'
,
});
}
export
async
function
fetchEstateImage
(
query
:
any
)
{
return
request
(
`/estate/image/
${
query
.
id
}
`
,
{
method
:
'GET'
,
});
}
export
async
function
fetchEstateTag
(
query
:
any
)
{
return
request
(
`/estate/tag/
${
query
.
type
}
`
,
{
params
:
query
.
data
,
...
...
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