zhoulisen 5 年之前
父節點
當前提交
144a8a5dc6

+ 1
- 1
src/pages/carouselFigure/SelectH5.1.jsx 查看文件

65
 
65
 
66
   return (
66
   return (
67
     <div>
67
     <div>
68
-      <div onClick={() => setVisible(true)} style={{ color: 'red' }}>{group.groupName}</div>
68
+      <div onClick={() => setVisible(true)}>{group.groupName}</div>
69
       <Modal
69
       <Modal
70
         title="请选择"
70
         title="请选择"
71
         visible={visible}
71
         visible={visible}

+ 8
- 2
src/pages/carouselFigure/SelectH5.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input, Row, Col } from 'antd';
3
 import { apis, fetch } from '../../utils/request';
3
 import { apis, fetch } from '../../utils/request';
4
 import Navigate from '@/components/Navigate';
4
 import Navigate from '@/components/Navigate';
5
 
5
 
17
   const [visible, setVisible] = useState(false);
17
   const [visible, setVisible] = useState(false);
18
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
18
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
19
   const getGroupTitle = val => {
19
   const getGroupTitle = val => {
20
+    console.log(val, (list.filter(x => x.drainageId == val)[0] || {}).name, '========')
20
     return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
21
     return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
21
   }
22
   }
22
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
23
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
33
         buildingId,
34
         buildingId,
34
       },
35
       },
35
     }).then(data => {
36
     }).then(data => {
37
+      const getGroupTitle = val => {
38
+        console.log(val, (data.records.filter(x => x.drainageId == val)[0] || {}).name, '========')
39
+        return (data.records.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
40
+      }
41
+      const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
36
       setList(data.records || [])
42
       setList(data.records || [])
37
 
43
 
38
       updateGroup(buildingId ? undefined : value);
44
       updateGroup(buildingId ? undefined : value);
113
             />
119
             />
114
           </Col>
120
           </Col>
115
           <Col span={4} offset={1}>
121
           <Col span={4} offset={1}>
116
-            <Button type="primary" onClick={()=>clearVal('')}>清除选择</Button>
122
+            <Button type="primary" onClick={() => clearVal('')}>清除选择</Button>
117
           </Col>
123
           </Col>
118
         </Row>
124
         </Row>
119
 
125
 

+ 17
- 5
src/pages/carouselFigure/editAdvertising.jsx 查看文件

53
       isHavePosition = false;
53
       isHavePosition = false;
54
     }
54
     }
55
 
55
 
56
+    // if (data.contentType == 'h5' || data.contentType=='live') {
57
+    //   isHaveActive = true;
58
+    // } else {
59
+    //   isHaveActive = false;
60
+    // }
61
+
56
     contentVisible = data.contentType === 'other';
62
     contentVisible = data.contentType === 'other';
57
     activityVisible = data.contentType === 'activity';
63
     activityVisible = data.contentType === 'activity';
58
     newsVisible = data.contentType === 'news';
64
     newsVisible = data.contentType === 'news';
66
     buildingId = data.buildingId
72
     buildingId = data.buildingId
67
   }
73
   }
68
 
74
 
69
-  const setExtraData1 = (data) => {
70
-    console.log(data.buildingId, "data.buildingIddata.buildingId2")
71
-    if ((data.contentType == 'h5' && data.buildingId == null) || data.contentType == '' || data.contentType == 'nothing' || (data.contentType == 'live' && data.buildingId == null)) {
75
+  const setExtraData1 = data => {
76
+    console.log(data, "data.buildingIddata.buildingId2")
77
+    if ((data.contentType === 'h5' && data.buildingId == null) || data.contentType === '' || data.contentType === 'nothing' || (data.contentType === 'live' && data.buildingId == null)) {
72
       isHaveActive = false
78
       isHaveActive = false
73
     } else {
79
     } else {
74
       isHaveActive = true
80
       isHaveActive = true
75
     }
81
     }
76
 
82
 
83
+    if (data.showPosition == 'index') {
84
+      isHavePosition = true;
85
+    } else {
86
+      isHavePosition = false;
87
+    }
88
+
77
     contentVisible = data.contentType === 'other';
89
     contentVisible = data.contentType === 'other';
78
     activityVisible = data.contentType === 'activity';
90
     activityVisible = data.contentType === 'activity';
79
     newsVisible = data.contentType === 'news';
91
     newsVisible = data.contentType === 'news';
92
   const XForm = createForm({ onValuesChange: handleFormValueChange })
104
   const XForm = createForm({ onValuesChange: handleFormValueChange })
93
 
105
 
94
   return (props) => {
106
   return (props) => {
95
-    const [tab, changeTab] = useState('basic')
107
+    // const [tab, changeTab] = useState('basic')
96
     const contentId = props.location.query.contentId
108
     const contentId = props.location.query.contentId
97
     const [data, setData] = useState({})
109
     const [data, setData] = useState({})
98
     const formRef = useRef(null);
110
     const formRef = useRef(null);
129
         props: {
141
         props: {
130
           onChange: () => {
142
           onChange: () => {
131
             const type = formRef.current.props.form.getFieldValue('contentType')
143
             const type = formRef.current.props.form.getFieldValue('contentType')
132
-            if (formRef.current && (type !== 'live' && type !== 'h5' )) {
144
+            if (formRef.current && (type !== 'live' && type !== 'h5')) {
133
               console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
145
               console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
134
               formRef.current.props.form.resetFields(['contentType', []]);
146
               formRef.current.props.form.resetFields(['contentType', []]);
135
             }
147
             }