andrew 4 年 前
コミット
fbbc098f10
共有35 個のファイルを変更した2285 個の追加0 個の削除を含む
  1. 132
    0
      estateagents-admin-manager/src/components/HeaderSearch/index.jsx
  2. 32
    0
      estateagents-admin-manager/src/components/HeaderSearch/index.less
  3. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/ApartmentSelect.jsx
  4. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/BlockSelect.jsx
  5. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/FloorSelect.jsx
  6. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/RoomSelect.jsx
  7. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/SalesBatchSelect.jsx
  8. 64
    0
      estateagents-admin-manager/src/components/HouseSelect/UnitSelect.jsx
  9. 166
    0
      estateagents-admin-manager/src/components/MiniQRCode/index.jsx
  10. 20
    0
      estateagents-admin-manager/src/components/MiniQRCode/style.less
  11. 39
    0
      estateagents-admin-manager/src/components/ModalButton/ModalButton.jsx
  12. 9
    0
      estateagents-admin-manager/src/components/ModalButton/index.jsx
  13. 34
    0
      estateagents-admin-manager/src/components/Navigate/index.jsx
  14. 11
    0
      estateagents-admin-manager/src/components/Navigate/style.less
  15. 95
    0
      estateagents-admin-manager/src/components/NoticeIcon/NoticeList.jsx
  16. 105
    0
      estateagents-admin-manager/src/components/NoticeIcon/NoticeList.less
  17. 155
    0
      estateagents-admin-manager/src/components/NoticeIcon/index.jsx
  18. 31
    0
      estateagents-admin-manager/src/components/NoticeIcon/index.less
  19. 16
    0
      estateagents-admin-manager/src/components/PageLoading/index.jsx
  20. 117
    0
      estateagents-admin-manager/src/components/PaginationWrapper/index.jsx
  21. 10
    0
      estateagents-admin-manager/src/components/PaginationWrapper/style.less
  22. 81
    0
      estateagents-admin-manager/src/components/SearchForm/index.jsx
  23. 65
    0
      estateagents-admin-manager/src/components/SelectButton/AreaSelect.jsx
  24. 65
    0
      estateagents-admin-manager/src/components/SelectButton/BuildSelect.jsx
  25. 77
    0
      estateagents-admin-manager/src/components/SelectButton/BuildSelect2.jsx
  26. 64
    0
      estateagents-admin-manager/src/components/SelectButton/CitySelect.jsx
  27. 65
    0
      estateagents-admin-manager/src/components/SelectButton/CitySelect2.jsx
  28. 64
    0
      estateagents-admin-manager/src/components/SelectButton/CitySelect3.jsx
  29. 65
    0
      estateagents-admin-manager/src/components/SelectButton/LivePlatSelect.jsx
  30. 64
    0
      estateagents-admin-manager/src/components/SelectButton/MiniappIconSelect.jsx
  31. 63
    0
      estateagents-admin-manager/src/components/SelectButton/NewTypeSelect.jsx
  32. 82
    0
      estateagents-admin-manager/src/components/SelectButton/QrcodeType.jsx
  33. 82
    0
      estateagents-admin-manager/src/components/SelectButton/QrcodeType1.jsx
  34. 45
    0
      estateagents-admin-manager/src/components/SelectButton/WxDictSelect.jsx
  35. 47
    0
      estateagents-admin-manager/src/components/SelectButton/channelSelect.jsx

+ 132
- 0
estateagents-admin-manager/src/components/HeaderSearch/index.jsx ファイルの表示

@@ -0,0 +1,132 @@
1
+import { AutoComplete, Icon, Input } from 'antd';
2
+import React, { Component } from 'react';
3
+import classNames from 'classnames';
4
+import debounce from 'lodash/debounce';
5
+import styles from './index.less';
6
+export default class HeaderSearch extends Component {
7
+  static defaultProps = {
8
+    defaultActiveFirstOption: false,
9
+    onPressEnter: () => {},
10
+    onSearch: () => {},
11
+    onChange: () => {},
12
+    className: '',
13
+    placeholder: '',
14
+    dataSource: [],
15
+    defaultOpen: false,
16
+    onVisibleChange: () => {},
17
+  };
18
+
19
+  static getDerivedStateFromProps(props) {
20
+    if ('open' in props) {
21
+      return {
22
+        searchMode: props.open,
23
+      };
24
+    }
25
+
26
+    return null;
27
+  }
28
+
29
+  inputRef = null;
30
+
31
+  constructor(props) {
32
+    super(props);
33
+    this.state = {
34
+      searchMode: props.defaultOpen,
35
+      value: '',
36
+    };
37
+    this.debouncePressEnter = debounce(this.debouncePressEnter, 500, {
38
+      leading: true,
39
+      trailing: false,
40
+    });
41
+  }
42
+
43
+  onKeyDown = e => {
44
+    if (e.key === 'Enter') {
45
+      this.debouncePressEnter();
46
+    }
47
+  };
48
+  onChange = value => {
49
+    if (typeof value === 'string') {
50
+      const { onSearch, onChange } = this.props;
51
+      this.setState({
52
+        value,
53
+      });
54
+
55
+      if (onSearch) {
56
+        onSearch(value);
57
+      }
58
+
59
+      if (onChange) {
60
+        onChange(value);
61
+      }
62
+    }
63
+  };
64
+  enterSearchMode = () => {
65
+    const { onVisibleChange } = this.props;
66
+    onVisibleChange(true);
67
+    this.setState(
68
+      {
69
+        searchMode: true,
70
+      },
71
+      () => {
72
+        const { searchMode } = this.state;
73
+
74
+        if (searchMode && this.inputRef) {
75
+          this.inputRef.focus();
76
+        }
77
+      },
78
+    );
79
+  };
80
+  leaveSearchMode = () => {
81
+    this.setState({
82
+      searchMode: false,
83
+      value: '',
84
+    });
85
+  };
86
+  debouncePressEnter = () => {
87
+    const { onPressEnter } = this.props;
88
+    const { value } = this.state;
89
+    onPressEnter(value);
90
+  };
91
+
92
+  render() {
93
+    const { className, placeholder, open, ...restProps } = this.props;
94
+    const { searchMode, value } = this.state;
95
+    delete restProps.defaultOpen; // for rc-select not affected
96
+
97
+    const inputClass = classNames(styles.input, {
98
+      [styles.show]: searchMode,
99
+    });
100
+    return (
101
+      <span
102
+        className={classNames(className, styles.headerSearch)}
103
+        onClick={this.enterSearchMode}
104
+        onTransitionEnd={({ propertyName }) => {
105
+          if (propertyName === 'width' && !searchMode) {
106
+            const { onVisibleChange } = this.props;
107
+            onVisibleChange(searchMode);
108
+          }
109
+        }}
110
+      >
111
+        <Icon type="search" key="Icon" />
112
+        <AutoComplete
113
+          key="AutoComplete"
114
+          {...restProps}
115
+          className={inputClass}
116
+          value={value}
117
+          onChange={this.onChange}
118
+        >
119
+          <Input
120
+            ref={node => {
121
+              this.inputRef = node;
122
+            }}
123
+            aria-label={placeholder}
124
+            placeholder={placeholder}
125
+            onKeyDown={this.onKeyDown}
126
+            onBlur={this.leaveSearchMode}
127
+          />
128
+        </AutoComplete>
129
+      </span>
130
+    );
131
+  }
132
+}

+ 32
- 0
estateagents-admin-manager/src/components/HeaderSearch/index.less ファイルの表示

@@ -0,0 +1,32 @@
1
+@import '~antd/es/style/themes/default.less';
2
+
3
+.headerSearch {
4
+  :global(.anticon-search) {
5
+    font-size: 16px;
6
+    cursor: pointer;
7
+  }
8
+  .input {
9
+    width: 0;
10
+    background: transparent;
11
+    border-radius: 0;
12
+    transition: width 0.3s, margin-left 0.3s;
13
+    :global(.ant-select-selection) {
14
+      background: transparent;
15
+    }
16
+    input {
17
+      padding-right: 0;
18
+      padding-left: 0;
19
+      border: 0;
20
+      box-shadow: none !important;
21
+    }
22
+    &,
23
+    &:hover,
24
+    &:focus {
25
+      border-bottom: 1px solid @border-color-base;
26
+    }
27
+    &.show {
28
+      width: 210px;
29
+      margin-left: 8px;
30
+    }
31
+  }
32
+}

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/ApartmentSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const ApartmentSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.apartmentList, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.apartmentId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择户型"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(apartment => (
59
+            <Option key={apartment.apartmentId} value={apartment.apartmentId}>{apartment.apartmentName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default ApartmentSelect

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/BlockSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const BlockSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.block, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.buildingId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择楼栋"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(block => (
59
+            <Option key={block.blockId} value={block.blockId}>{block.blockName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default BlockSelect

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/FloorSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const FloorSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.floor, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId, blockId: props.blockId, unitId: props.unitId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.buildingId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择楼层"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(floor => (
59
+            <Option key={floor.floorId} value={floor.floorId}>{floor.floorName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default FloorSelect

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/RoomSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const RoomSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.room, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId, blockId: props.blockId, unitId: props.unitId, floorId: props.floorId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.buildingId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择房号"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(room => (
59
+            <Option key={room.roomId} value={room.roomId}>{room.roomName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default RoomSelect

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/SalesBatchSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const SalesBatchSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.apartmentList, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.apartmentId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择批次"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(apartment => (
59
+            <Option key={apartment.apartmentId} value={apartment.apartmentId}>{apartment.apartmentName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default SalesBatchSelect

+ 64
- 0
estateagents-admin-manager/src/components/HouseSelect/UnitSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const UnitSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getList();
27
+  }, [props.value])
28
+
29
+
30
+  const getList = e => {
31
+    request({ ...apis.house.unit, params: { pageNum: 1, pageSize: 999, buildingId: props.buildingId, blockId: props.blockId} }).then(data => {
32
+        setData(data.records)
33
+        checkValue(data.records)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.buildingId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '已删除,请重新选择'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择单元"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(unit => (
59
+            <Option key={unit.unitId} value={unit.unitId}>{unit.unitName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default UnitSelect

+ 166
- 0
estateagents-admin-manager/src/components/MiniQRCode/index.jsx ファイルの表示

@@ -0,0 +1,166 @@
1
+import React, { PureComponent } from 'react'
2
+import PropTypes from 'prop-types'
3
+import classNames from 'classnames'
4
+import { Button, Modal, Tooltip } from 'antd'
5
+import { fetch, apis } from '../../utils/request'
6
+
7
+import Style from './style.less'
8
+
9
+const fetchQRCode = fetch(apis.image.qrcode)
10
+
11
+function encodeParam (o) {
12
+  return Object.keys(o).map((k) => {
13
+    const v = encodeURIComponent(o[k] || '')
14
+    return `${k}=${v}`
15
+  }).join('&')
16
+}
17
+
18
+class MiniQRCode extends PureComponent {
19
+  constructor(props) {
20
+    super(props)
21
+
22
+    this.state = {
23
+      previewVisible: false,
24
+      qrcode: undefined,
25
+      loading: false,
26
+    }
27
+  }
28
+
29
+  componentDidMount() {
30
+    if (this.props.targetId && this.props.value) {
31
+      const params = this.getQRCodeParams(this.props)
32
+
33
+      if (!params) return;
34
+
35
+      this.setState({
36
+        qrcode: {
37
+          img: this.props.value,
38
+          params,
39
+        }
40
+      })
41
+    }
42
+  }
43
+
44
+  componentDidUpdate(prevProps) {
45
+    const preParams = this.getQRCodeParams(prevProps)
46
+    const curParams = this.getQRCodeParams(this.props)
47
+
48
+    // 需要重新生成二维码
49
+    if (preParams !== curParams) {
50
+      this.createQRCode()
51
+      return
52
+    }
53
+
54
+    // 如果 value 有了更新
55
+    const { img } = this.state.qrcode || {}
56
+    if (prevProps.value !== this.props.value && this.props.value !== img) {
57
+      this.setState({
58
+        qrcode: {
59
+          img: this.props.value,
60
+          params: curParams,
61
+        }
62
+      })
63
+    }
64
+  }
65
+
66
+  getQRCodeParams = (props) => {
67
+    const { targetId, sceneParams = {}, page, params = {} } = props
68
+
69
+    if (!targetId || !page) {
70
+      return;
71
+    }
72
+
73
+    const sceneObj = {
74
+      id: targetId,
75
+      ...sceneParams,
76
+    }
77
+
78
+    return JSON.stringify({
79
+      scene: encodeParam(sceneObj),
80
+      page,
81
+      ...params,
82
+    })
83
+  }
84
+
85
+  createQRCode = () => {
86
+    const params = this.getQRCodeParams(this.props)
87
+
88
+    if (!params) {
89
+      return;
90
+    }
91
+
92
+    this.setState({ loading: true }, () => {
93
+      fetchQRCode({ data: { params } }).then((img) => {
94
+        this.setState({ qrcode: { img, params }, loading: false }, () => {
95
+          if (this.props.onChange) {
96
+            this.props.onChange(img)
97
+          }
98
+        })
99
+      })
100
+    })
101
+  }
102
+
103
+  handleThumbClick = () => {
104
+    this.setState({ previewVisible: true })
105
+  }
106
+
107
+  handleCancel = () => {
108
+    this.setState({ previewVisible: false })
109
+  }
110
+
111
+  handleBtnClick = () => {
112
+    this.createQRCode()
113
+  }
114
+
115
+  render() {
116
+    const { loading, qrcode = {}, previewVisible } = this.state
117
+    const { className, style, size } = this.props
118
+    const icon = !qrcode.img ? 'plus' : 'redo'
119
+    const btnText = !qrcode.img ? '生成' : '重新生成'
120
+    const clsList = classNames(Style.miniQRCode, className)
121
+    const styleUsed = style || {}
122
+    const thumbSize = size || 120
123
+    const thumbStyle = {
124
+      width: `${thumbSize}px`,
125
+      height: `${thumbSize}px`,
126
+    }
127
+    const btnSize = thumbSize > 96 ? 'default' : 'small'
128
+
129
+    return (
130
+      <div className={clsList} style={styleUsed}>
131
+        {
132
+          qrcode.img && (
133
+            <Tooltip title={qrcode.params}>
134
+              <div className={Style.thumb} onClick={this.handleThumbClick} style={thumbStyle}>
135
+                <img src={qrcode.img} alt=""/>
136
+              </div>
137
+            </Tooltip>
138
+          )
139
+        }
140
+        <div className={Style.body}>
141
+          <Button loading={loading} size={btnSize} icon={icon} onClick={this.handleBtnClick}>{btnText}</Button>
142
+        </div>
143
+        <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
144
+          <img alt="preview" style={{ width: '100%' }} src={qrcode.img} />
145
+        </Modal>
146
+      </div>
147
+    );
148
+  }
149
+}
150
+
151
+MiniQRCode.propTypes = {
152
+  value: PropTypes.string,
153
+  onChange: PropTypes.func,
154
+  targetId: PropTypes.oneOfType([
155
+    PropTypes.string,
156
+    PropTypes.number,
157
+  ]),
158
+  page: PropTypes.string,
159
+  sceneParams: PropTypes.object,
160
+  params: PropTypes.object,
161
+  className: PropTypes.string,
162
+  style: PropTypes.object,
163
+  size: PropTypes.number,
164
+}
165
+
166
+export default MiniQRCode

+ 20
- 0
estateagents-admin-manager/src/components/MiniQRCode/style.less ファイルの表示

@@ -0,0 +1,20 @@
1
+.miniQRCode {
2
+  background: transparent;
3
+  display: flex;
4
+  align-items: center;
5
+
6
+  .thumb {
7
+    flex: none;
8
+    padding: 8px;
9
+    margin-right: 12px;
10
+
11
+    img {
12
+      width: 100%;
13
+      height: 100%;
14
+    }
15
+  }
16
+
17
+  .body {
18
+    flex: auto;
19
+  }
20
+}

+ 39
- 0
estateagents-admin-manager/src/components/ModalButton/ModalButton.jsx ファイルの表示

@@ -0,0 +1,39 @@
1
+import React from 'react';
2
+import { Modal, Button, message } from 'antd';
3
+
4
+export default function ModalButton(props) {
5
+  const {
6
+    method = 'confirm',
7
+    title = '',
8
+    content = '',
9
+    modalConfigs = {},
10
+    onClick,
11
+    onCancel,
12
+    // 未选数据弹出提示
13
+    beforeCheck = '',
14
+    okText = '确认',
15
+    cancelText = '取消',
16
+    ...btnProps
17
+  } = props || {}
18
+
19
+  const handleClick = e => {
20
+    if (!!beforeCheck) { message.info(beforeCheck); return }
21
+    Modal[method]({
22
+      title,
23
+      content,
24
+      okText,
25
+      cancelText,
26
+      ...modalConfigs,
27
+      onOk() {
28
+        // eslint-disable-next-line no-unused-expressions
29
+        onClick && onClick(e);
30
+      },
31
+      onCancel() {
32
+        // eslint-disable-next-line no-unused-expressions
33
+        onCancel && onCancel();
34
+      },
35
+    })
36
+  }
37
+
38
+  return <Button {...btnProps} onClick={handleClick}>{props.children}</Button>
39
+}

+ 9
- 0
estateagents-admin-manager/src/components/ModalButton/index.jsx ファイルの表示

@@ -0,0 +1,9 @@
1
+import React from 'react';
2
+import ModalButton from './ModalButton';
3
+
4
+const ConfirmButton = props => <ModalButton {...props} method="confirm" />
5
+
6
+export {
7
+  ModalButton,
8
+  ConfirmButton,
9
+}

+ 34
- 0
estateagents-admin-manager/src/components/Navigate/index.jsx ファイルの表示

@@ -0,0 +1,34 @@
1
+import React from 'react';
2
+import Link from 'umi/link';
3
+
4
+import styles from './style.less';
5
+
6
+const Navigate = ({ children, to, onClick }) => {
7
+    // to 包含协议 用 a
8
+    const useA = (to || '').indexOf('://') > -1 ? 'a' : '';
9
+    // 否则用 Link
10
+    const useLink = to && to.indexOf('://') === -1 ? Link : '';
11
+    // 没有 to 则使用 span
12
+    const element = useA || useLink || 'span';
13
+
14
+    const events = onClick ? { onClick } : {};
15
+    const style = { color: '#1D74D9', cursor: 'pointer' };
16
+
17
+    let redirect = {};
18
+    if (useA) {
19
+        redirect = { href: to }
20
+    } else if (useLink) {
21
+        redirect = { to }
22
+    }
23
+
24
+    const props = {
25
+        className: 'cust-navi',
26
+        style,
27
+        ...redirect,
28
+        ...events,
29
+    }
30
+
31
+    return React.createElement(element, props, children);
32
+};
33
+
34
+export default Navigate;

+ 11
- 0
estateagents-admin-manager/src/components/Navigate/style.less ファイルの表示

@@ -0,0 +1,11 @@
1
+
2
+:global {
3
+  .cust-navi {
4
+    color: #1D74D9;
5
+    cursor: pointer;
6
+  
7
+    * {
8
+      color: #1D74D9 !important;
9
+    }
10
+  }
11
+}

+ 95
- 0
estateagents-admin-manager/src/components/NoticeIcon/NoticeList.jsx ファイルの表示

@@ -0,0 +1,95 @@
1
+import { Avatar, List } from 'antd';
2
+import React from 'react';
3
+import classNames from 'classnames';
4
+import styles from './NoticeList.less';
5
+
6
+const NoticeList = ({
7
+  data = [],
8
+  onClick,
9
+  onClear,
10
+  title,
11
+  onViewMore,
12
+  emptyText,
13
+  showClear = true,
14
+  clearText,
15
+  viewMoreText,
16
+  showViewMore = false,
17
+}) => {
18
+  if (data.length === 0) {
19
+    return (
20
+      <div className={styles.notFound}>
21
+        <img
22
+          src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
23
+          alt="not found"
24
+        />
25
+        <div>{emptyText}</div>
26
+      </div>
27
+    );
28
+  }
29
+
30
+  return (
31
+    <div>
32
+      <List
33
+        className={styles.list}
34
+        dataSource={data}
35
+        renderItem={(item, i) => {
36
+          const itemCls = classNames(styles.item, {
37
+            [styles.read]: item.read,
38
+          }); // eslint-disable-next-line no-nested-ternary
39
+
40
+          const leftIcon = item.avatar ? (
41
+            typeof item.avatar === 'string' ? (
42
+              <Avatar className={styles.avatar} src={item.avatar} />
43
+            ) : (
44
+              <span className={styles.iconElement}>{item.avatar}</span>
45
+            )
46
+          ) : null;
47
+          return (
48
+            <List.Item
49
+              className={itemCls}
50
+              key={item.key || i}
51
+              onClick={() => onClick && onClick(item)}
52
+            >
53
+              <List.Item.Meta
54
+                className={styles.meta}
55
+                avatar={leftIcon}
56
+                title={
57
+                  <div className={styles.title}>
58
+                    {item.title}
59
+                    <div className={styles.extra}>{item.extra}</div>
60
+                  </div>
61
+                }
62
+                description={
63
+                  <div>
64
+                    <div className={styles.description}>{item.description}</div>
65
+                    <div className={styles.datetime}>{item.datetime}</div>
66
+                  </div>
67
+                }
68
+              />
69
+            </List.Item>
70
+          );
71
+        }}
72
+      />
73
+      <div className={styles.bottomBar}>
74
+        {showClear ? (
75
+          <div onClick={onClear}>
76
+            {clearText} {title}
77
+          </div>
78
+        ) : null}
79
+        {showViewMore ? (
80
+          <div
81
+            onClick={e => {
82
+              if (onViewMore) {
83
+                onViewMore(e);
84
+              }
85
+            }}
86
+          >
87
+            {viewMoreText}
88
+          </div>
89
+        ) : null}
90
+      </div>
91
+    </div>
92
+  );
93
+};
94
+
95
+export default NoticeList;

+ 105
- 0
estateagents-admin-manager/src/components/NoticeIcon/NoticeList.less ファイルの表示

@@ -0,0 +1,105 @@
1
+@import '~antd/es/style/themes/default.less';
2
+
3
+.list {
4
+  max-height: 400px;
5
+  overflow: auto;
6
+  &::-webkit-scrollbar {
7
+    display: none;
8
+  }
9
+  .item {
10
+    padding-right: 24px;
11
+    padding-left: 24px;
12
+    overflow: hidden;
13
+    cursor: pointer;
14
+    transition: all 0.3s;
15
+
16
+    .meta {
17
+      width: 100%;
18
+    }
19
+
20
+    .avatar {
21
+      margin-top: 4px;
22
+      background: #fff;
23
+    }
24
+    .iconElement {
25
+      font-size: 32px;
26
+    }
27
+
28
+    &.read {
29
+      opacity: 0.4;
30
+    }
31
+    &:last-child {
32
+      border-bottom: 0;
33
+    }
34
+    &:hover {
35
+      background: @primary-1;
36
+    }
37
+    .title {
38
+      margin-bottom: 8px;
39
+      font-weight: normal;
40
+    }
41
+    .description {
42
+      font-size: 12px;
43
+      line-height: @line-height-base;
44
+    }
45
+    .datetime {
46
+      margin-top: 4px;
47
+      font-size: 12px;
48
+      line-height: @line-height-base;
49
+    }
50
+    .extra {
51
+      float: right;
52
+      margin-top: -1.5px;
53
+      margin-right: 0;
54
+      color: @text-color-secondary;
55
+      font-weight: normal;
56
+    }
57
+  }
58
+  .loadMore {
59
+    padding: 8px 0;
60
+    color: @primary-6;
61
+    text-align: center;
62
+    cursor: pointer;
63
+    &.loadedAll {
64
+      color: rgba(0, 0, 0, 0.25);
65
+      cursor: unset;
66
+    }
67
+  }
68
+}
69
+
70
+.notFound {
71
+  padding: 73px 0 88px;
72
+  color: @text-color-secondary;
73
+  text-align: center;
74
+  img {
75
+    display: inline-block;
76
+    height: 76px;
77
+    margin-bottom: 16px;
78
+  }
79
+}
80
+
81
+.bottomBar {
82
+  height: 46px;
83
+  color: @text-color;
84
+  line-height: 46px;
85
+  text-align: center;
86
+  border-top: 1px solid @border-color-split;
87
+  border-radius: 0 0 @border-radius-base @border-radius-base;
88
+  transition: all 0.3s;
89
+  div {
90
+    display: inline-block;
91
+    width: 50%;
92
+    cursor: pointer;
93
+    transition: all 0.3s;
94
+    user-select: none;
95
+    &:hover {
96
+      color: @heading-color;
97
+    }
98
+    &:only-child {
99
+      width: 100%;
100
+    }
101
+    &:not(:only-child):last-child {
102
+      border-left: 1px solid @border-color-split;
103
+    }
104
+  }
105
+}

+ 155
- 0
estateagents-admin-manager/src/components/NoticeIcon/index.jsx ファイルの表示

@@ -0,0 +1,155 @@
1
+import { Badge, Icon, Spin, Tabs } from 'antd';
2
+import React, { Component } from 'react';
3
+import classNames from 'classnames';
4
+import NoticeList from './NoticeList';
5
+import HeaderDropdown from '../HeaderDropdown';
6
+import styles from './index.less';
7
+const { TabPane } = Tabs;
8
+export default class NoticeIcon extends Component {
9
+  static Tab = NoticeList;
10
+  static defaultProps = {
11
+    onItemClick: () => {},
12
+    onPopupVisibleChange: () => {},
13
+    onTabChange: () => {},
14
+    onClear: () => {},
15
+    onViewMore: () => {},
16
+    loading: false,
17
+    clearClose: false,
18
+    emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
19
+  };
20
+  state = {
21
+    visible: false,
22
+  };
23
+  onItemClick = (item, tabProps) => {
24
+    const { onItemClick } = this.props;
25
+
26
+    if (onItemClick) {
27
+      onItemClick(item, tabProps);
28
+    }
29
+  };
30
+  onClear = (name, key) => {
31
+    const { onClear } = this.props;
32
+
33
+    if (onClear) {
34
+      onClear(name, key);
35
+    }
36
+  };
37
+  onTabChange = tabType => {
38
+    const { onTabChange } = this.props;
39
+
40
+    if (onTabChange) {
41
+      onTabChange(tabType);
42
+    }
43
+  };
44
+  onViewMore = (tabProps, event) => {
45
+    const { onViewMore } = this.props;
46
+
47
+    if (onViewMore) {
48
+      onViewMore(tabProps, event);
49
+    }
50
+  };
51
+
52
+  getNotificationBox() {
53
+    const { children, loading, clearText, viewMoreText } = this.props;
54
+
55
+    if (!children) {
56
+      return null;
57
+    }
58
+
59
+    const panes = React.Children.map(children, child => {
60
+      if (!child) {
61
+        return null;
62
+      }
63
+
64
+      const { list, title, count, tabKey, showClear, showViewMore } = child.props;
65
+      const len = list && list.length ? list.length : 0;
66
+      const msgCount = count || count === 0 ? count : len;
67
+      const tabTitle = msgCount > 0 ? `${title} (${msgCount})` : title;
68
+      return (
69
+        <TabPane tab={tabTitle} key={title}>
70
+          <NoticeList
71
+            clearText={clearText}
72
+            viewMoreText={viewMoreText}
73
+            data={list}
74
+            onClear={() => this.onClear(title, tabKey)}
75
+            onClick={item => this.onItemClick(item, child.props)}
76
+            onViewMore={event => this.onViewMore(child.props, event)}
77
+            showClear={showClear}
78
+            showViewMore={showViewMore}
79
+            title={title}
80
+            {...child.props}
81
+          />
82
+        </TabPane>
83
+      );
84
+    });
85
+    return (
86
+      <>
87
+        <Spin spinning={loading} delay={300}>
88
+          <Tabs className={styles.tabs} onChange={this.onTabChange}>
89
+            {panes}
90
+          </Tabs>
91
+        </Spin>
92
+      </>
93
+    );
94
+  }
95
+
96
+  handleVisibleChange = visible => {
97
+    const { onPopupVisibleChange } = this.props;
98
+    this.setState({
99
+      visible,
100
+    });
101
+
102
+    if (onPopupVisibleChange) {
103
+      onPopupVisibleChange(visible);
104
+    }
105
+  };
106
+
107
+  render() {
108
+    const { className, count, popupVisible, bell } = this.props;
109
+    const { visible } = this.state;
110
+    const noticeButtonClass = classNames(className, styles.noticeButton);
111
+    const notificationBox = this.getNotificationBox();
112
+    const NoticeBellIcon = bell || <Icon type="bell" className={styles.icon} />;
113
+    const trigger = (
114
+      <span
115
+        className={classNames(noticeButtonClass, {
116
+          opened: visible,
117
+        })}
118
+      >
119
+        <Badge
120
+          count={count}
121
+          style={{
122
+            boxShadow: 'none',
123
+          }}
124
+          className={styles.badge}
125
+        >
126
+          {NoticeBellIcon}
127
+        </Badge>
128
+      </span>
129
+    );
130
+
131
+    if (!notificationBox) {
132
+      return trigger;
133
+    }
134
+
135
+    const popoverProps = {};
136
+
137
+    if ('popupVisible' in this.props) {
138
+      popoverProps.visible = popupVisible;
139
+    }
140
+
141
+    return (
142
+      <HeaderDropdown
143
+        placement="bottomRight"
144
+        overlay={notificationBox}
145
+        overlayClassName={styles.popover}
146
+        trigger={['click']}
147
+        visible={visible}
148
+        onVisibleChange={this.handleVisibleChange}
149
+        {...popoverProps}
150
+      >
151
+        {trigger}
152
+      </HeaderDropdown>
153
+    );
154
+  }
155
+}

+ 31
- 0
estateagents-admin-manager/src/components/NoticeIcon/index.less ファイルの表示

@@ -0,0 +1,31 @@
1
+@import '~antd/es/style/themes/default.less';
2
+
3
+.popover {
4
+  position: relative;
5
+  width: 336px;
6
+}
7
+
8
+.noticeButton {
9
+  display: inline-block;
10
+  cursor: pointer;
11
+  transition: all 0.3s;
12
+}
13
+.icon {
14
+  padding: 4px;
15
+  vertical-align: middle;
16
+}
17
+
18
+.badge {
19
+  font-size: 16px;
20
+}
21
+
22
+.tabs {
23
+  :global {
24
+    .ant-tabs-nav-scroll {
25
+      text-align: center;
26
+    }
27
+    .ant-tabs-bar {
28
+      margin-bottom: 0;
29
+    }
30
+  }
31
+}

+ 16
- 0
estateagents-admin-manager/src/components/PageLoading/index.jsx ファイルの表示

@@ -0,0 +1,16 @@
1
+import React from 'react';
2
+import { Spin } from 'antd'; // loading components from code split
3
+// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
4
+
5
+const PageLoading = () => (
6
+  <div
7
+    style={{
8
+      paddingTop: 100,
9
+      textAlign: 'center',
10
+    }}
11
+  >
12
+    <Spin size="large" />
13
+  </div>
14
+);
15
+
16
+export default PageLoading;

+ 117
- 0
estateagents-admin-manager/src/components/PaginationWrapper/index.jsx ファイルの表示

@@ -0,0 +1,117 @@
1
+import React, { useState } from 'react';
2
+import PropTypes from 'prop-types';
3
+import { Pagination } from 'antd';
4
+import classNames from 'classnames'
5
+import { useQuery } from '../../utils/hooks';
6
+import { ObjSpEqual } from '../../utils/utils'
7
+import Styles from './style.less'
8
+
9
+class PaginationWrapper extends React.PureComponent {
10
+
11
+  state = {
12
+    data: {
13
+      current: 1,
14
+      total: 0,
15
+      pages: 0,
16
+    },
17
+    loadding: false,
18
+  }
19
+
20
+  componentDidMount () {
21
+    this.fetchData(1)
22
+  }
23
+
24
+  componentDidUpdate(prevProps) {
25
+    if (!ObjSpEqual(prevProps.params, this.props.params)) {
26
+      this.fetchData(1)
27
+    }
28
+  } 
29
+
30
+  fetchData = (page) => {
31
+    this.setState({ loadding: true })
32
+    
33
+    const requestParams = this.props.params || {}
34
+    this.props.request({
35
+      ...requestParams,
36
+      params: {
37
+        pageNum: page,              // 有的接口是 pageNum
38
+        pageNumber: page,  // 有的接口是 pageNumber
39
+        ...(requestParams.params || {}),
40
+      }
41
+    }).then((res) => {
42
+      this.setState({ loadding: false, data: res })
43
+    })
44
+  }
45
+
46
+  handlePageChange = (page) => {
47
+    this.fetchData(page)
48
+  }
49
+
50
+  render() {
51
+    const { className, style, bodyClass, footerClass, render } = this.props
52
+    const { data } = this.state
53
+
54
+    return (
55
+      <div className={classNames(Styles['pg-wrapper'], className)} style={style}>
56
+        <div className={classNames(Styles.body, bodyClass)}>
57
+          {render(data)}
58
+        </div>
59
+        <div className={classNames(Styles.footer, footerClass)}>
60
+          <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={this.handlePageChange} current={data.current}/>
61
+        </div>
62
+      </div>
63
+    )
64
+  }
65
+}
66
+
67
+PaginationWrapper.propTypes = {
68
+  request: PropTypes.func.isRequired,
69
+  render: PropTypes.func.isRequired,
70
+  params: PropTypes.object,
71
+  className: PropTypes.oneOfType([
72
+    PropTypes.string,
73
+    PropTypes.array,
74
+    PropTypes.object,
75
+  ]),
76
+  bodyClass: PropTypes.oneOfType([
77
+    PropTypes.string,
78
+    PropTypes.array,
79
+    PropTypes.object,
80
+  ]),
81
+  footerClass: PropTypes.oneOfType([
82
+    PropTypes.string,
83
+    PropTypes.array,
84
+    PropTypes.object,
85
+  ]),
86
+  style: PropTypes.object,
87
+}
88
+
89
+// /**
90
+//  * 分页封装
91
+//  * @param {page, params, request, render, className, style, bodyClass, footerClass} props 
92
+//  */
93
+// function PaginationWrapper(props) {
94
+//   const defaultPage = props.page || 1
95
+//   const [pageNum, setPage] = useState(defaultPage)
96
+//   const requestParams = props.params || {}
97
+//   const [data = {}, loading, err] = useQuery({ ...requestParams, params: { ...(requestParams.params || {}), pageNum, pageNumber: pageNum }}, props.request)
98
+
99
+//   // if (typeof props.setData === 'function') {
100
+//   //   props.setData(data)
101
+//   // }
102
+
103
+//   console.log('------render PaginationWrapper-------', pageNum, data, loading)
104
+
105
+//   return (
106
+//     <div className={classNames(Styles['pg-wrapper'], props.className)} style={props.style}>
107
+//       <div className={classNames(Styles.body, props.bodyClass)}>
108
+//         {props.render(data)}
109
+//       </div>
110
+//       <div className={classNames(Styles.footer, props.footerClass)}>
111
+//         <Pagination showQuickJumper defaultCurrent={defaultPage} total={data.total} onChange={pg => setPage(pg)} current={data.current}/>
112
+//       </div>
113
+//     </div>
114
+//   )
115
+// }
116
+
117
+export default PaginationWrapper

+ 10
- 0
estateagents-admin-manager/src/components/PaginationWrapper/style.less ファイルの表示

@@ -0,0 +1,10 @@
1
+.pg-wrapper {
2
+  .body {}
3
+
4
+  .footer {
5
+    margin-top: 30px;
6
+    display: flex;
7
+    align-items: center;
8
+    flex-direction: row-reverse;
9
+  }
10
+}

+ 81
- 0
estateagents-admin-manager/src/components/SearchForm/index.jsx ファイルの表示

@@ -0,0 +1,81 @@
1
+import React from 'react';
2
+import PropTyps from 'prop-types';
3
+import { Form, Button } from 'antd';
4
+
5
+function isFunc(fn) { return typeof fn === 'function' };
6
+
7
+class SearchForm extends React.PureComponent {
8
+  handleSubmit = e => {
9
+    e.preventDefault();
10
+    this.props.form.validateFields((err, values) => {
11
+      if (!err && isFunc(this.props.onSearch)) {
12
+        this.props.onSearch(values)
13
+        return
14
+      }
15
+
16
+      if (err) {
17
+        console.error(err)
18
+        if (isFunc(this.props.onError)) {
19
+          this.props.onError(err)
20
+        }
21
+        return
22
+      }
23
+    });
24
+  };
25
+
26
+  handleReset = e => {
27
+    this.props.form.resetFields()
28
+    if (isFunc(this.props.onReset)) {
29
+      this.props.onReset()
30
+    }
31
+  }
32
+
33
+  render () {
34
+    const { form, hideResetBtn } = this.props;
35
+
36
+    return (
37
+      <Form layout="inline" onSubmit={this.handleSubmit} colon={false}>
38
+        {
39
+          (this.props.fields || []).map((field, index) => {
40
+            const { element, render, name, label, value } = field || {}
41
+
42
+            if (!element && !render) return null;
43
+
44
+            const conifg = value  ? { initialValue: value } : {}
45
+            const Item = isFunc(render) ? render(this.props) : element
46
+
47
+            return <Form.Item label={label} key={`fm-${index}`}>{form.getFieldDecorator(name, conifg)(Item)}</Form.Item>
48
+          })
49
+        }
50
+        <Form.Item>
51
+          <Button type="primary" htmlType="submit">搜索</Button>
52
+        </Form.Item>
53
+        { hideResetBtn && (
54
+          <Form.Item>
55
+            <Button type="default" onClick="handleReset">重置</Button>
56
+          </Form.Item>
57
+        )}
58
+      </Form>
59
+    );
60
+  }
61
+}
62
+
63
+// 提供给父组件 onChange 事件
64
+function onValuesChange(props, changedValues, allValues) {
65
+  if (isFunc(props.onChange)) {
66
+    props.onChange(changedValues, allValues)
67
+  }
68
+}
69
+
70
+const EnhanceForm = Form.create({ onValuesChange })(SearchForm)
71
+
72
+EnhanceForm.propTypes = {
73
+  onSearch: PropTyps.func.isRequired,
74
+  onReset: PropTyps.func,
75
+  onError: PropTyps.func,
76
+  onChange: PropTyps.func,
77
+  fields: PropTyps.arrayOf(PropTyps.object),
78
+  hideResetBtn: PropTyps.bool,
79
+}
80
+
81
+export default EnhanceForm;

+ 65
- 0
estateagents-admin-manager/src/components/SelectButton/AreaSelect.jsx ファイルの表示

@@ -0,0 +1,65 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+import { APIBaseURL } from '../../utils/constant'
6
+
7
+const { Option } = Select;
8
+const prefix = APIBaseURL
9
+
10
+/**
11
+ *
12
+ *
13
+ * @param {*} props
14
+ * @returns
15
+ */
16
+const CitySelect = (props) => {
17
+  const [ data, setData ] = useState([])
18
+  const cityId = typeof props.cityId === 'function' ? props.cityId() : props.cityId
19
+
20
+  useEffect(() => {
21
+    getCityAreaList();
22
+    getValue();
23
+  },[cityId])
24
+
25
+  const getCityAreaList = (e) => {
26
+    request({
27
+        url: prefix + 'api/admin/tdCityList/tdAreaCity',
28
+        method: 'GET',
29
+        params: {leveltype: 3, cityId},
30
+        action: 'select',
31
+    }).then((data) => {
32
+        setData(data)
33
+    })
34
+  }
35
+
36
+  /**
37
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
38
+   */
39
+  const getValue = () => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.id == props.value)
42
+      const va = (tempData.length > 0) ? props.value : undefined
43
+      props.onChange(va)
44
+    }
45
+  }
46
+
47
+  return (
48
+      <Select
49
+      {...props}
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择区域"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }
58
+      >
59
+          {data.map(city => (
60
+            <Option key={city.id} value={city.name}>{city.name}</Option>
61
+          ))}
62
+      </Select>
63
+  )
64
+}
65
+export default CitySelect

+ 65
- 0
estateagents-admin-manager/src/components/SelectButton/BuildSelect.jsx ファイルの表示

@@ -0,0 +1,65 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const BuildingSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getBuildList();
27
+  }, [props.value])
28
+
29
+
30
+  const getBuildList = e => {
31
+    request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(data => {
32
+        setData(data)
33
+        checkValue(data)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.buildingId == props.value)
42
+      const va = (tempData.length > 0) ? props.value : '项目已下线,请重新选择项目'
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择项目"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          <Option key="" value="">全部项目</Option>
59
+          {data.map(building => (
60
+            <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
61
+          ))}
62
+      </Select>
63
+  )
64
+}
65
+export default BuildingSelect

+ 77
- 0
estateagents-admin-manager/src/components/SelectButton/BuildSelect2.jsx ファイルの表示

@@ -0,0 +1,77 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const BuildingSelect2 = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  console.log('props', props.cityId);
26
+  useEffect(() => {
27
+    getBuildList();
28
+  }, [props.cityId])
29
+
30
+
31
+  const getBuildList = e => {
32
+    request({ ...apis.building.buildingSelect, params: { cityId: props.cityId, pageNum: 1, pageSize: 999 } }).then(data => {
33
+      setData(data)
34
+      checkValue(data)
35
+      // 默认选中第一个
36
+    })
37
+  }
38
+
39
+
40
+  const checkValue = (data) => {
41
+    if (props.value) {
42
+      const tempData = data.filter(f => f.buildingId == props.value)
43
+      const va = (tempData.length > 0) ? props.value : '项目已下线,请重新选择项目'
44
+      props.onChange(va)
45
+
46
+    }
47
+  }
48
+
49
+  const onChange = (buildingId) => {
50
+    const building = data.filter(x => buildingId === x.buildingId)[0]
51
+
52
+    props.onChange(buildingId, building)
53
+    // if (props.value) {
54
+    //   const tempData = data.filter(f => f.buildingId == props.value)
55
+    //   const va = (tempData.length > 0) ? props.value : '项目已下线,请重新选择项目'
56
+    //   props.onChange(va)
57
+
58
+    // }={props.onChange}building.buildingId
59
+  }
60
+
61
+  return (
62
+    <Select
63
+      showSearch
64
+      value={props.value}
65
+      style={{ width: '300px' }}
66
+      placeholder="请选择项目"
67
+      onChange={ onChange}
68
+      filterOption={(input, option) =>
69
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
70
+      }>
71
+      {data.map(building => (
72
+        <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
73
+      ))}
74
+    </Select>
75
+  )
76
+}
77
+export default BuildingSelect2

+ 64
- 0
estateagents-admin-manager/src/components/SelectButton/CitySelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+import { APIBaseURL } from '../../utils/constant'
6
+
7
+const { Option } = Select;
8
+const prefix = APIBaseURL
9
+
10
+/**
11
+ *
12
+ *
13
+ * @param {*} props
14
+ * @returns
15
+ */
16
+const CitySelect = (props) => {
17
+  const [ data, setData ] = useState([])
18
+
19
+  useEffect(() => {
20
+    getCityList();
21
+    getValue();
22
+  },[props.value])
23
+
24
+  const getCityList = (e) => {
25
+    request({
26
+        url: prefix + 'api/admin/tdCityList/tdCity',
27
+        method: 'GET',
28
+        params: {leveltype: 2, pageNum: 1,pageSize: 999},
29
+        action: 'select',
30
+    }).then((data) => {
31
+        setData(data)
32
+    })
33
+  }
34
+
35
+  /**
36
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
37
+   */
38
+  const getValue = () => {
39
+    if (props.value) {
40
+      const tempData = data.filter(f => f.id == props.value)
41
+      const va = (tempData.length > 0) ? props.value : undefined
42
+      props.onChange(va)
43
+    }
44
+  }
45
+
46
+  return (
47
+      <Select
48
+      {...props}
49
+      showSearch
50
+      value={props.value}
51
+      style={{ width: '300px' }}
52
+      placeholder="请选择城市"
53
+      onChange={props.onChange}
54
+      filterOption={(input, option) =>
55
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
56
+      }
57
+      >
58
+          {data.map(city => (
59
+            <Option key={city.id} value={city.id}>{city.name}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default CitySelect

+ 65
- 0
estateagents-admin-manager/src/components/SelectButton/CitySelect2.jsx ファイルの表示

@@ -0,0 +1,65 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+import { APIBaseURL } from '../../utils/constant'
6
+
7
+const { Option } = Select;
8
+const prefix = APIBaseURL
9
+
10
+/**
11
+ *
12
+ *
13
+ * @param {*} props
14
+ * @returns
15
+ */
16
+const CitySelect = (props) => {
17
+  const [ data, setData ] = useState([])
18
+
19
+  useEffect(() => {
20
+    getCityList();
21
+  },[props.value])
22
+
23
+  const getCityList = (e) => {
24
+    request({
25
+        url: prefix + 'api/admin/tdCityList/tdCity',
26
+        method: 'GET',
27
+        params: {leveltype: 2, pageNum: 1,pageSize: 999},
28
+        action: 'select',
29
+    }).then((data) => {
30
+        setData(data)
31
+        getValue(data);
32
+        console.log('---123---')
33
+    })
34
+  }
35
+
36
+  /**
37
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
38
+   */
39
+  const getValue = (data) => {
40
+    console.log(props.value)
41
+    if (props.value) {
42
+      const tempData = data.filter(f => f.id == props.value)
43
+      const va = (tempData.length > 0) ? props.value : undefined
44
+      props.onChange(va)
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '180px' }}
53
+      placeholder="请选择城市"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }
58
+      >
59
+          {data.map(city => (
60
+            <Option key={city.id} value={city.id}>{city.name}</Option>
61
+          ))}
62
+      </Select>
63
+  )
64
+}
65
+export default CitySelect

+ 64
- 0
estateagents-admin-manager/src/components/SelectButton/CitySelect3.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+import { APIBaseURL } from '../../utils/constant'
6
+
7
+const { Option } = Select;
8
+const prefix = APIBaseURL
9
+
10
+/**
11
+ *
12
+ *
13
+ * @param {*} props
14
+ * @returns
15
+ */
16
+const CitySelect3 = (props) => {
17
+  const [ data, setData ] = useState([])
18
+  console.log('props', props.buildingId)
19
+  useEffect(() => {
20
+    getCityList();
21
+    getValue();
22
+  },[props.buildingId])
23
+
24
+  const getCityList = (e) => {
25
+    request({
26
+        url: prefix + 'api/admin/tdCityList/tdCity',
27
+        method: 'GET',
28
+        params: {leveltype: 2, pageNum: 1,pageSize: 999},
29
+        action: 'select',
30
+    }).then((data) => {
31
+        setData(data)
32
+    })
33
+  }
34
+
35
+  /**
36
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
37
+   */
38
+  const getValue = () => {
39
+    if (props.value) {
40
+      const tempData = data.filter(f => f.id == props.value)
41
+      const va = (tempData.length > 0) ? props.value : undefined
42
+      props.onChange(va)
43
+    }
44
+  }
45
+
46
+  return (
47
+      <Select
48
+      {...props}
49
+      showSearch
50
+      value={props.value}
51
+      style={{ width: '300px' }}
52
+      placeholder="请选择城市"
53
+      onChange={props.onChange}
54
+      filterOption={(input, option) =>
55
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
56
+      }
57
+      >
58
+          {data.map(city => (
59
+            <Option key={city.id} value={city.id}>{city.name}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default CitySelect3

+ 65
- 0
estateagents-admin-manager/src/components/SelectButton/LivePlatSelect.jsx ファイルの表示

@@ -0,0 +1,65 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const LivePlatSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+
26
+  useEffect(() => {
27
+    getLivePlatList();
28
+  }, [props.value])
29
+
30
+
31
+  const getLivePlatList = e => {
32
+    request({ ...apis.taliveActivity.livePlatList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
33
+        setData(data)
34
+        checkValue(data)
35
+        // 默认选中第一个
36
+    })
37
+  }
38
+
39
+
40
+  const checkValue = (data) => {
41
+    if (props.value) {
42
+      const tempData = data.filter(f => f.id == props.value)
43
+      const va = (tempData.length > 0) ? props.value : '平台已下线,请重新选择'
44
+      props.onChange(va)
45
+
46
+    }
47
+  }
48
+
49
+  return (
50
+      <Select
51
+      showSearch
52
+      value={`${props.value || ''}`}
53
+      style={{ width: '300px' }}
54
+      placeholder="请选择平台"
55
+      onChange={props.onChange}
56
+      filterOption={(input, option) =>
57
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
58
+      }>
59
+          {data.map(live => (
60
+            <Option key={live.id} value={`${live.id}`}>{live.livePlatName}</Option>
61
+          ))}
62
+      </Select>
63
+  )
64
+}
65
+export default LivePlatSelect

+ 64
- 0
estateagents-admin-manager/src/components/SelectButton/MiniappIconSelect.jsx ファイルの表示

@@ -0,0 +1,64 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+function usePrevious(props) {
9
+  const ref = useRef();
10
+  useEffect(() => {
11
+    ref.current = props;
12
+  });
13
+  return ref.current;
14
+}
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+const MiniappIconSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState([])
25
+  useEffect(() => {
26
+    getMiniappIconSelect();
27
+  }, [props.value])
28
+
29
+
30
+  const getMiniappIconSelect = e => {
31
+    request({ ...apis.icon.minippIconList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
32
+        setData(data)
33
+        checkValue(data)
34
+        // 默认选中第一个
35
+    })
36
+  }
37
+
38
+
39
+  const checkValue = (data) => {
40
+    if (props.value) {
41
+      const tempData = data.filter(f => f.iconCode == props.value)
42
+      const va = (tempData.length > 0) ? props.value : ''
43
+      props.onChange(va)
44
+
45
+    }
46
+  }
47
+
48
+  return (
49
+      <Select
50
+      showSearch
51
+      value={props.value}
52
+      style={{ width: '300px' }}
53
+      placeholder="请选择功能"
54
+      onChange={props.onChange}
55
+      filterOption={(input, option) =>
56
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
+      }>
58
+          {data.map(icon => (
59
+            <Option key={icon.iconCode} value={icon.iconCode}>{icon.iconName}</Option>
60
+          ))}
61
+      </Select>
62
+  )
63
+}
64
+export default MiniappIconSelect

+ 63
- 0
estateagents-admin-manager/src/components/SelectButton/NewTypeSelect.jsx ファイルの表示

@@ -0,0 +1,63 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+import { APIBaseURL } from '../../utils/constant'
6
+
7
+const prefix = `${APIBaseURL}api/admin`
8
+
9
+const { Option } = Select;
10
+
11
+function usePrevious(props) {
12
+  const ref = useRef();
13
+  useEffect(() => {
14
+    ref.current = props;
15
+  });
16
+  return ref.current;
17
+}
18
+
19
+/**
20
+ *
21
+ *
22
+ * @param {*} props
23
+ * @returns
24
+ */
25
+const NewsTypeSelect = (props) => {
26
+  const [ data, setData ] = useState([])
27
+  const [ value, setValue ] = useState('')
28
+  const preProps = usePrevious(props)
29
+  
30
+  if ((!preProps || !preProps.value) && props.value && !value) {
31
+    setValue(props.value)
32
+  }
33
+
34
+  useEffect(() => {
35
+    getNewsTypeList();
36
+  },[props.buildingId])
37
+
38
+  const getNewsTypeList = (e) => {
39
+    request({
40
+        url: `${prefix}/taNewsType`,
41
+        method: 'GET',
42
+        params: {pageNum: 1,pageSize: 999,buildingId: props.buildingId},
43
+        action: 'admin.taNewsType.get',
44
+    }).then((data) => {
45
+        setData(data.records)
46
+    })
47
+  }
48
+
49
+  const handleChange = (e) => {
50
+    setValue(e)
51
+    props.onChange(e)
52
+  }
53
+
54
+  return (
55
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择资讯类型" onChange={handleChange}>
56
+          {data.map(type => (
57
+            <Option key={type.newsTypeId} value={type.newsTypeId}>{type.newsTypeName}</Option>
58
+          ))}
59
+      </Select>
60
+  )
61
+}
62
+export default NewsTypeSelect
63
+

+ 82
- 0
estateagents-admin-manager/src/components/SelectButton/QrcodeType.jsx ファイルの表示

@@ -0,0 +1,82 @@
1
+import React, { useMemo } from 'react';
2
+import { Select } from 'antd';
3
+
4
+const { Option } = Select;
5
+
6
+
7
+const qrcodeType = props => {
8
+    //   const [data, setData] = useState([])
9
+    //   useEffect(() => {
10
+
11
+    //   }, [props.value])
12
+    // const visible2 = props.visible || true
13
+    const all = props.all || false
14
+
15
+    const visible = useMemo(() => (props.visible), [props.visible]);
16
+    
17
+    const data = [
18
+        {
19
+            name: '项目',
20
+            value: 'project',
21
+            visible,
22
+        },
23
+        {
24
+            name: '报名活动',
25
+            value: 'activity',
26
+            visible,
27
+        },
28
+        {
29
+            name: '助力活动',
30
+            value: 'help',
31
+            visible,
32
+        },
33
+        {
34
+            name: '拼团活动',
35
+            value: 'group',
36
+            visible,
37
+        },
38
+        {
39
+            name: 'H5活动',
40
+            value: 'h5',
41
+            visible: true,
42
+        },
43
+        {
44
+            name: '直播活动',
45
+            value: 'live',
46
+            visible: true,
47
+        },
48
+        {
49
+            name: '资讯',
50
+            value: 'news',
51
+            visible,
52
+        },
53
+        {
54
+            name: '在线选房',
55
+            value: 'salesBatch',
56
+            visible,
57
+        },
58
+    ]
59
+
60
+
61
+    return (
62
+        // <>234</>
63
+        <Select
64
+            showSearch
65
+            value={props.value}
66
+            style={{ width: '250px' }}
67
+            placeholder="请选择二维码内容类型"
68
+            onChange={props.onChange}
69
+            // filterOption={(input, option) =>
70
+            //     // eslint-disable-next-line max-len
71
+            //     option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
72
+            // }
73
+        >
74
+            {all && <Option key="" value="">全部类型</Option>}
75
+            {data.map(Item => (
76
+
77
+                Item.visible ? <Option key={Item.vlaue} value={Item.value}> {Item.name} </Option> : ''
78
+            ))}
79
+        </Select>
80
+    )
81
+}
82
+export default qrcodeType

+ 82
- 0
estateagents-admin-manager/src/components/SelectButton/QrcodeType1.jsx ファイルの表示

@@ -0,0 +1,82 @@
1
+import React, { useMemo } from 'react';
2
+import { Select } from 'antd';
3
+
4
+const { Option } = Select;
5
+
6
+
7
+const qrcodeType = props => {
8
+    //   const [data, setData] = useState([])
9
+    //   useEffect(() => {
10
+
11
+    //   }, [props.value])
12
+    // const visible2 = props.visible || true
13
+    const all = props.all || false
14
+
15
+    const visible = useMemo(() => (props.visible), [props.visible]);
16
+    
17
+    const data = [
18
+        {
19
+            name: '项目',
20
+            value: 'building',
21
+            visible,
22
+        },
23
+        {
24
+            name: '报名活动',
25
+            value: 'activity',
26
+            visible,
27
+        },
28
+        {
29
+            name: '助力活动',
30
+            value: 'help',
31
+            visible,
32
+        },
33
+        {
34
+            name: '拼团活动',
35
+            value: 'group',
36
+            visible,
37
+        },
38
+        {
39
+            name: 'H5活动',
40
+            value: 'h5',
41
+            visible: true,
42
+        },
43
+        {
44
+            name: '直播活动',
45
+            value: 'live',
46
+            visible: true,
47
+        },
48
+        {
49
+            name: '资讯',
50
+            value: 'news',
51
+            visible,
52
+        },
53
+        {
54
+            name: '在线选房',
55
+            value: 'house',
56
+            visible,
57
+        },
58
+    ]
59
+
60
+
61
+    return (
62
+        // <>234</>
63
+        <Select
64
+            showSearch
65
+            value={props.value}
66
+            style={{ width: '250px' }}
67
+            placeholder="请选择二维码内容类型"
68
+            onChange={props.onChange}
69
+            // filterOption={(input, option) =>
70
+            //     // eslint-disable-next-line max-len
71
+            //     option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
72
+            // }
73
+        >
74
+            {all && <Option key="" value="">全部类型</Option>}
75
+            {data.map(Item => (
76
+
77
+                Item.visible ? <Option key={Item.vlaue} value={Item.value}> {Item.name} </Option> : ''
78
+            ))}
79
+        </Select>
80
+    )
81
+}
82
+export default qrcodeType

+ 45
- 0
estateagents-admin-manager/src/components/SelectButton/WxDictSelect.jsx ファイルの表示

@@ -0,0 +1,45 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const WxDictSelect = props => {
15
+  const [data, setData] = useState([])
16
+  const [value, setValue] = useState([])
17
+  useEffect(() => {
18
+    getWxDictList();
19
+  }, [props.value])
20
+
21
+
22
+  const getWxDictList = e => {
23
+    request({ ...apis.wxDict.list, params: { pageNumber: 1, pageSize: 999 } }).then(data => {
24
+        setData(data.records)
25
+        // 默认选中第一个
26
+    })
27
+  }
28
+
29
+  return (
30
+      <Select
31
+      showSearch
32
+      value={props.value}
33
+      style={{ width: '250px' }}
34
+      placeholder="请选择用户来源"
35
+      onChange={props.onChange}
36
+      filterOption={(input, option) =>
37
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38
+      }>
39
+          {data.map(wxDict => (
40
+            <Option key={wxDict.sceneType} value={wxDict.sceneType}>{wxDict.sceneAlias}</Option>
41
+          ))}
42
+      </Select>
43
+  )
44
+}
45
+export default WxDictSelect

+ 47
- 0
estateagents-admin-manager/src/components/SelectButton/channelSelect.jsx ファイルの表示

@@ -0,0 +1,47 @@
1
+import React, { useState, useEffect, useMemo } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const ChannelSelect = props => {
15
+  const [data, setData] = useState([])
16
+  useEffect(() => {
17
+    getChannelSelect();
18
+  }, [props.value])
19
+
20
+  const all = props.all || false
21
+
22
+
23
+  const getChannelSelect = e => {
24
+    request({ ...apis.channelList.getList, params: { pageNumber: 1, pageSize: 999 } }).then(data => {
25
+      setData(data.channelNmae)
26
+      // 默认选中第一个
27
+    })
28
+  }
29
+
30
+  return (
31
+    <Select
32
+      showSearch
33
+      value={props.value}
34
+      style={{ width: '250px' }}
35
+      placeholder="请选择渠道"
36
+      onChange={props.onChange}
37
+      filterOption={(input, option) =>
38
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
39
+      }>
40
+      {all && <Option key="" value="">全部渠道</Option>}
41
+      {data.map(Item => (
42
+        <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
43
+      ))}
44
+    </Select>
45
+  )
46
+}
47
+export default ChannelSelect