|
@@ -30,6 +30,7 @@ const { TextArea } = Input;
|
30
|
30
|
const [ tab, changeTab ] = useState('basic')
|
31
|
31
|
const newsId = props.location.query.newsId
|
32
|
32
|
const [ dynamicData, setDynamicData ] = useState({})
|
|
33
|
+
|
33
|
34
|
if(newsId){
|
34
|
35
|
useEffect(() => {
|
35
|
36
|
getDynamicData(newsId);
|
|
@@ -46,6 +47,8 @@ const { TextArea } = Input;
|
46
|
47
|
}
|
47
|
48
|
}
|
48
|
49
|
|
|
50
|
+
|
|
51
|
+
|
49
|
52
|
const cancelPage = () =>{
|
50
|
53
|
router.push({
|
51
|
54
|
pathname: '/news/list/NewsList',
|
|
@@ -53,11 +56,17 @@ const { TextArea } = Input;
|
53
|
56
|
}
|
54
|
57
|
|
55
|
58
|
const Basic = (props) => {
|
|
59
|
+ const [ changeBuildingId, setChangeBuildingIdData ] = useState('')
|
|
60
|
+
|
|
61
|
+ const handleBuildingChange = (e) => {
|
|
62
|
+ console.log(e)
|
|
63
|
+ setChangeBuildingIdData(e)
|
|
64
|
+ }
|
56
|
65
|
const fields = [
|
57
|
66
|
{
|
58
|
67
|
label: '意向项目',
|
59
|
68
|
name: 'buildingId',
|
60
|
|
- render: <BuildSelect />,
|
|
69
|
+ render: <BuildSelect onChange={(e => handleBuildingChange(e))}/>,
|
61
|
70
|
value: dynamicData.buildingId,
|
62
|
71
|
rules: [
|
63
|
72
|
{required: true, message: '请选择所属项目'},
|
|
@@ -85,7 +94,7 @@ const { TextArea } = Input;
|
85
|
94
|
{
|
86
|
95
|
label: '资讯类型',
|
87
|
96
|
name: 'newsTypeId',
|
88
|
|
- render: <NewsTypeSelect />,
|
|
97
|
+ render: <NewsTypeSelect buildingId={changeBuildingId || dynamicData.buildingId}/>,
|
89
|
98
|
value: dynamicData.newsTypeId,
|
90
|
99
|
rules: [
|
91
|
100
|
{required: true, message: '请选择资讯类型'},
|