dingxin 5 lat temu
rodzic
commit
9f5afb2999

+ 9
- 6
src/components/SelectButton/BuildSelect.jsx Wyświetl plik

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

+ 11
- 2
src/components/Wangedit/Wangedit.jsx Wyświetl plik

1
 import React from 'react';
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
  * @param {*} props
6
  * @param {*} props
33
       }
34
       }
34
     }
35
     }
35
     this.editor.customConfig.zIndex = 100
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
     this.editor.create()
46
     this.editor.create()
38
     this.editor.customConfig.uploadImgShowBase64 = true
47
     this.editor.customConfig.uploadImgShowBase64 = true
39
     this.editor.txt.html(this.props.value)
48
     this.editor.txt.html(this.props.value)

+ 1
- 0
src/pages/activity/groupActivity/helpRecord.jsx Wyświetl plik

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

+ 2
- 2
src/pages/carouselFigure/SelectGroup.jsx Wyświetl plik

15
   const [visible, setVisible] = useState(false);
15
   const [visible, setVisible] = useState(false);
16
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择拼团' })
16
   const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择拼团' })
17
   const getGroupTitle = val => {
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
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
20
   const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
21
 
21
 
65
             option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
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
         </Select>
70
         </Select>
71
       </Modal>
71
       </Modal>

+ 1
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Wyświetl plik

272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
273
         </p>
273
         </p>
274
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
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
         </div>
276
         </div>
277
         <EChart options={options} style={style} />
277
         <EChart options={options} style={style} />
278
         {props.tableShow &&
278
         {props.tableShow &&

+ 5
- 2
src/pages/system/document/list.jsx Wyświetl plik

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

+ 16
- 18
src/pages/system/document/see.jsx Wyświetl plik

1
 import React, { useState, useEffect } from 'react';
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
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
6
-import { router } from 'umi';
7
 
7
 
8
 
8
 
9
 function body (props) {
9
 function body (props) {
12
 
12
 
13
   useEffect(() => {
13
   useEffect(() => {
14
     getList()
14
     getList()
15
-
16
   }, [])
15
   }, [])
17
 // , documentVerifyId: documentVerifyId
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
       console.log('data:', data.imgList)
21
       console.log('data:', data.imgList)
23
       setData(data.imgList)
22
       setData(data.imgList)
24
-    }).catch(err => {
23
+    }).catch(_err => {
25
       // eslint-disable-next-line no-unused-expressions
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
     router.push({
31
     router.push({
33
       pathname: '/system/document/list',
32
       pathname: '/system/document/list',
34
     });
33
     });
35
   }
34
   }
36
 
35
 
37
 
36
 
38
-
39
   return (
37
   return (
40
     <>
38
     <>
41
       <div style={{ background: '#ECECEC', padding: '30px' }}>
39
       <div style={{ background: '#ECECEC', padding: '30px' }}>
42
         <Row gutter={16}>
40
         <Row gutter={16}>
43
           {
41
           {
44
             // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
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
         </Row>
49
         </Row>
52
       </div>
50
       </div>
53
       <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
51
       <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
54
-       
52
+
55
         <Button onClick={cancelPage}>返回</Button>
53
         <Button onClick={cancelPage}>返回</Button>
56
-        
54
+
57
       </div>
55
       </div>
58
-     
59
-      
56
+
57
+
60
     </>
58
     </>
61
   )
59
   )
62
 }
60
 }

+ 1
- 1
src/pages/system/intention.jsx Wyświetl plik

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