zhoulisen 5 years ago
parent
commit
144a8a5dc6

+ 1
- 1
src/pages/carouselFigure/SelectH5.1.jsx View File

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

+ 8
- 2
src/pages/carouselFigure/SelectH5.jsx View File

@@ -1,5 +1,5 @@
1 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 3
 import { apis, fetch } from '../../utils/request';
4 4
 import Navigate from '@/components/Navigate';
5 5
 
@@ -17,6 +17,7 @@ export default props => {
17 17
   const [visible, setVisible] = useState(false);
18 18
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
19 19
   const getGroupTitle = val => {
20
+    console.log(val, (list.filter(x => x.drainageId == val)[0] || {}).name, '========')
20 21
     return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
21 22
   }
22 23
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
@@ -33,6 +34,11 @@ export default props => {
33 34
         buildingId,
34 35
       },
35 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 42
       setList(data.records || [])
37 43
 
38 44
       updateGroup(buildingId ? undefined : value);
@@ -113,7 +119,7 @@ export default props => {
113 119
             />
114 120
           </Col>
115 121
           <Col span={4} offset={1}>
116
-            <Button type="primary" onClick={()=>clearVal('')}>清除选择</Button>
122
+            <Button type="primary" onClick={() => clearVal('')}>清除选择</Button>
117 123
           </Col>
118 124
         </Row>
119 125
 

+ 17
- 5
src/pages/carouselFigure/editAdvertising.jsx View File

@@ -53,6 +53,12 @@ const createEditor = () => {
53 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 62
     contentVisible = data.contentType === 'other';
57 63
     activityVisible = data.contentType === 'activity';
58 64
     newsVisible = data.contentType === 'news';
@@ -66,14 +72,20 @@ const createEditor = () => {
66 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 78
       isHaveActive = false
73 79
     } else {
74 80
       isHaveActive = true
75 81
     }
76 82
 
83
+    if (data.showPosition == 'index') {
84
+      isHavePosition = true;
85
+    } else {
86
+      isHavePosition = false;
87
+    }
88
+
77 89
     contentVisible = data.contentType === 'other';
78 90
     activityVisible = data.contentType === 'activity';
79 91
     newsVisible = data.contentType === 'news';
@@ -92,7 +104,7 @@ const createEditor = () => {
92 104
   const XForm = createForm({ onValuesChange: handleFormValueChange })
93 105
 
94 106
   return (props) => {
95
-    const [tab, changeTab] = useState('basic')
107
+    // const [tab, changeTab] = useState('basic')
96 108
     const contentId = props.location.query.contentId
97 109
     const [data, setData] = useState({})
98 110
     const formRef = useRef(null);
@@ -129,7 +141,7 @@ const createEditor = () => {
129 141
         props: {
130 142
           onChange: () => {
131 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 145
               console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
134 146
               formRef.current.props.form.resetFields(['contentType', []]);
135 147
             }