dingxin 5 år sedan
förälder
incheckning
9f5afb2999

+ 9
- 6
src/components/SelectButton/BuildSelect.jsx Visa fil

@@ -22,11 +22,15 @@ function usePrevious(props) {
22 22
 const BuildingSelect = (props) => {
23 23
   const [ data, setData ] = useState([])
24 24
   const [ value, setValue ] = useState('')
25
-  const preProps = usePrevious(props)
25
+  // const preProps = usePrevious(props)
26 26
 
27
-  if ((!preProps || !preProps.value) && props.value && !value) {
27
+  // if ((!preProps) && props.value != value) {
28
+  //   setValue(props.value)
29
+  // }
30
+
31
+  useEffect(() => {
28 32
     setValue(props.value)
29
-  }
33
+  }, [props.value])
30 34
 
31 35
   useEffect(() => {
32 36
     getCityList();
@@ -36,7 +40,7 @@ const BuildingSelect = (props) => {
36 40
     request({ ...apis.building.buildingSelect, params: {pageNum: 1,pageSize: 999}, }).then((data) => {
37 41
         setData(data.records)
38 42
         // 默认选中第一个
39
-        if ((!preProps || !preProps.one) && props.one === 'true') {
43
+        if (props.checkFirst) {
40 44
           setValue(data.records[0].buildingId)
41 45
           props.onChange(data.records[0].buildingId)
42 46
         }
@@ -51,7 +55,7 @@ const BuildingSelect = (props) => {
51 55
   return (
52 56
       <Select
53 57
       showSearch
54
-      value={props.value}
58
+      value={value}
55 59
       style={{ width: '180px' }} 
56 60
       placeholder="请选择项目" 
57 61
       onChange={handleChange}
@@ -65,4 +69,3 @@ const BuildingSelect = (props) => {
65 69
   )
66 70
 }
67 71
 export default BuildingSelect
68
-

+ 11
- 2
src/components/Wangedit/Wangedit.jsx Visa fil

@@ -1,5 +1,6 @@
1 1
 import React from 'react';
2
-import E from 'wangeditor'
2
+import E from 'wangeditor';
3
+import { fetch, apis } from '../../utils/request';
3 4
 
4 5
 /**
5 6
  * @param {*} props
@@ -33,7 +34,15 @@ class Wangedit extends React.Component {
33 34
       }
34 35
     }
35 36
     this.editor.customConfig.zIndex = 100
36
-    this.editor.customConfig.uploadImgShowBase64 = true   
37
+    this.editor.customConfig.uploadImgMaxLength = 1
38
+    this.editor.customConfig.customUploadImg = function (files, insert) {
39
+      if (!files.length) return
40
+      
41
+      const data = new FormData()
42
+      data.append('file', files[0])
43
+
44
+      fetch(apis.image.upload)({data}).then(insert)
45
+    }
37 46
     this.editor.create()
38 47
     this.editor.customConfig.uploadImgShowBase64 = true
39 48
     this.editor.txt.html(this.props.value)

+ 1
- 0
src/pages/activity/groupActivity/helpRecord.jsx Visa fil

@@ -421,6 +421,7 @@ function helpRecord(row) {
421 421
       key: 'createTime',
422 422
       align: 'center',
423 423
       width: '15%',
424
+      render: (x, row) => <><span>{`${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
424 425
     },
425 426
     {
426 427
       title: '参团者',

+ 2
- 2
src/pages/carouselFigure/SelectGroup.jsx Visa fil

@@ -15,7 +15,7 @@ export default props => {
15 15
   const [visible, setVisible] = useState(false);
16 16
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择拼团' })
17 17
   const getGroupTitle = val => {
18
-    return (list.filter(x => x.groupActicityId == val)[0] || {}).activityName || '请选择拼团'
18
+    return (list.filter(x => x.groupActivityId == val)[0] || {}).activityName || '请选择拼团'
19 19
   }
20 20
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
21 21
 
@@ -65,7 +65,7 @@ export default props => {
65 65
             option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
66 66
           }>
67 67
           {
68
-            list.map(x => (<Select.Option key={x.groupActicityId} value={x.groupActicityId}>{x.activityName}</Select.Option>))
68
+            list.map(x => (<Select.Option key={x.groupActivityId} value={x.groupActivityId}>{x.activityName}</Select.Option>))
69 69
           }
70 70
         </Select>
71 71
       </Modal>

+ 1
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Visa fil

@@ -272,7 +272,7 @@ const UserBehavior = props => {
272 272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
273 273
         </p>
274 274
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
275
-          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} one="true"></BuildSelect>}
275
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} checkFirst></BuildSelect>}
276 276
         </div>
277 277
         <EChart options={options} style={style} />
278 278
         {props.tableShow &&

+ 5
- 2
src/pages/system/document/list.jsx Visa fil

@@ -3,6 +3,8 @@ import { Table, Form, Icon, Input, Button, message  } from 'antd'
3 3
 import request from '../../../utils/request';
4 4
 import apis from '../../../services/apis';
5 5
 import { router } from 'umi';
6
+import moment from 'moment';
7
+
6 8
 
7 9
 function body(props) {
8 10
   // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -81,13 +83,14 @@ function body(props) {
81 83
     },
82 84
     {
83 85
       title: '手机号',
84
-      dataIndex: 'phone',
85
-      key: 'phone',
86
+      dataIndex: 'tel',
87
+      key: 'tel',
86 88
     },
87 89
     {
88 90
       title: '提交时间',
89 91
       dataIndex: 'createDate',
90 92
       key: 'createDate',
93
+      render: (createDate) => moment(createDate).format('YYYY-MM-DD')
91 94
     },
92 95
     {
93 96
       title: '状态',

+ 16
- 18
src/pages/system/document/see.jsx Visa fil

@@ -1,9 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal} from 'antd'
2
+import { Col, Row, Button, Modal } from 'antd'
3
+import { router } from 'umi';
3 4
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4 5
 import request from '../../../utils/request';
5 6
 import apis from '../../../services/apis';
6
-import { router } from 'umi';
7 7
 
8 8
 
9 9
 function body (props) {
@@ -12,51 +12,49 @@ function body (props) {
12 12
 
13 13
   useEffect(() => {
14 14
     getList()
15
-
16 15
   }, [])
17 16
 // , documentVerifyId: documentVerifyId
18
-  function getList (params) {
17
+  function getList (_params) {
19 18
     // 网路请求
20
-    console.log(props,'1111')
21
-    request({ ...apis.system.documentVerifyDetail, urlData:{ id:documentVerifyId }  }).then(data => {
19
+    console.log(props, '1111')
20
+    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
22 21
       console.log('data:', data.imgList)
23 22
       setData(data.imgList)
24
-    }).catch(err => {
23
+    }).catch(_err => {
25 24
       // eslint-disable-next-line no-unused-expressions
26 25
 
27 26
     })
28 27
   }
29
-  
30 28
 
31
-  const cancelPage = () =>{
29
+
30
+  const cancelPage = () => {
32 31
     router.push({
33 32
       pathname: '/system/document/list',
34 33
     });
35 34
   }
36 35
 
37 36
 
38
-
39 37
   return (
40 38
     <>
41 39
       <div style={{ background: '#ECECEC', padding: '30px' }}>
42 40
         <Row gutter={16}>
43 41
           {
44 42
             // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
45
-            data.map((data, inx) => 
46
-              <Col span={6}>
47
-               <ZmageImg style={{ width: '300px', height: '400px' }} src={data.img} />
48
-              </Col>
43
+            data.map(item =>
44
+              <Col span={6} key={item.documentImgId}>
45
+               <ZmageImg style={{ width: '300px', height: '400px' }} src={item.img} />
46
+              </Col>,
49 47
             )
50 48
           }
51 49
         </Row>
52 50
       </div>
53 51
       <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
54
-       
52
+
55 53
         <Button onClick={cancelPage}>返回</Button>
56
-        
54
+
57 55
       </div>
58
-     
59
-      
56
+
57
+
60 58
     </>
61 59
   )
62 60
 }

+ 1
- 1
src/pages/system/intention.jsx Visa fil

@@ -57,7 +57,7 @@ const Edit = (props) => {
57 57
     <>
58 58
       <Row>
59 59
         <Col span={6}>
60
-          <BuildSelect onChange={changBuilding} one="true" />
60
+          <BuildSelect onChange={changBuilding} checkFirst />
61 61
         </Col>
62 62
         <Col span={5} style={{ lineHeight: '30px' }}>
63 63
           用户操作