Procházet zdrojové kódy

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

zlisen před 4 roky
rodič
revize
ce083dadc9

+ 1
- 0
config/defaultSettings.js Zobrazit soubor

@@ -2,6 +2,7 @@ export default {
2 2
   navTheme: 'dark',
3 3
   // 拂晓蓝
4 4
   primaryColor: '#1890ff',
5
+  backgroundColor:'red',
5 6
   layout: 'sidemenu',
6 7
   contentWidth: 'Fluid',
7 8
   fixedHeader: false,

+ 67
- 1
config/routes.js Zobrazit soubor

@@ -443,7 +443,6 @@ export default [
443 443
                 component: './channel/Agent/List',
444 444
               },
445 445
 
446
-
447 446
               // {
448 447
               //   path: '/channel/channelList',
449 448
               //   name: '渠道管理',
@@ -510,6 +509,50 @@ export default [
510 509
               },
511 510
             ],
512 511
           },
512
+          {
513
+            //帮我找房页面+
514
+            path: '/home',
515
+            name: '帮我找房',
516
+            component: '../layouts/BlankLayout',
517
+            routes: [
518
+              {
519
+                path: '/home/recommend/home',
520
+                name: '找房需求',
521
+                component: './home/recommend/index',
522
+              },
523
+              {
524
+                path: '/home/recommend/audit',
525
+                name: '回访确认',
526
+                hideInMenu: true,
527
+                component: './home/Recommend/audit',
528
+              },
529
+              {
530
+                path: '/home/recommend/auditcopy',
531
+                name: '回访确认',
532
+                hideInMenu: true,
533
+                component: './home/Recommend/auditCopy',
534
+              },
535
+            ],
536
+          },
537
+          {
538
+            //我的课堂+
539
+            path: '/course',
540
+            name: '我的课堂',
541
+            component: '../layouts/BlankLayout',
542
+            routes: [
543
+              {
544
+                path: '/course/List',
545
+                name: '课程管理',
546
+                component: './course/List',
547
+              },
548
+              {
549
+                path: '/course/Edit',
550
+                name: '课程编辑',
551
+                hideInMenu: true,
552
+                component: './course/Edit',
553
+              },
554
+            ],
555
+          },
513 556
           {
514 557
             path: '/carouselFigure',
515 558
             name: '资源位管理',
@@ -581,6 +624,29 @@ export default [
581 624
                 name: '意向值',
582 625
                 component: './system/intention',
583 626
               },
627
+              //+购房百科
628
+              {
629
+                path: '/system/Sellhouse/index',
630
+                name: '购房百科',
631
+                component: './system/Sellhouse/index',
632
+              },
633
+              {
634
+                path: '/system/houseTypes/index',
635
+                name: '购房百科类型',
636
+                component: './system/Sellhouse/houseTypes/index',
637
+              },
638
+              {
639
+                path: '/system/Sellhouse/Edit',
640
+                name: '新增/编辑购房百科',
641
+                hideInMenu: true,
642
+                component: './system/Sellhouse/Edit',
643
+              },
644
+              {
645
+                path: '/system/Sellhouse/houseTypes/Newindex',
646
+                name: '新增',
647
+                hideInMenu: true,
648
+                component: './system/Sellhouse/houseTypes/Newindex',
649
+              },
584 650
               {
585 651
                 path: '/system/housingPolicy/list',
586 652
                 name: '购房百科',

+ 22
- 0
src/components/SelectButton/BuildSelectCourse.jsx Zobrazit soubor

@@ -0,0 +1,22 @@
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
+const handleChange = (buildingId) => {
9
+  props.onChange(buildingId, building)
10
+}
11
+
12
+const BuildSelectHouse = props => {
13
+  
14
+  return (
15
+    <Select defaultValue='0' style={{ width: 220 }} onChange={handleChange}>
16
+      <Option value="0">置业顾问</Option>
17
+      <Option value="1">经纪人</Option>
18
+      <Option value="2">置业顾问&amp;经纪人</Option>
19
+    </Select>
20
+  )
21
+}
22
+export default BuildSelectHouse

+ 35
- 0
src/components/SelectButton/BuildSelectHouse.jsx Zobrazit soubor

@@ -0,0 +1,35 @@
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 handleChange(value) {
9
+  console.log(`selected ${value}`);
10
+}
11
+
12
+function usePrevious(props) {
13
+  const ref = useRef();
14
+  useEffect(() => {
15
+    ref.current = props;
16
+  });
17
+  return ref.current;
18
+}
19
+
20
+
21
+const BuildSelectHouse = props => {
22
+  
23
+  
24
+
25
+
26
+  const [data, setData] = useState([])
27
+  const [value, setValue] = useState([])
28
+  return (
29
+    <Select defaultValue='0' style={{ width: 220 }} onChange={handleChange}>
30
+      <Option value="0">南京</Option>
31
+      <Option value="1">北京</Option>
32
+    </Select>
33
+  )
34
+}
35
+export default BuildSelectHouse

+ 1
- 1
src/layouts/BasicLayout.jsx Zobrazit soubor

@@ -131,7 +131,7 @@ const BasicLayout = (props) => {
131 131
       footerRender={footerRender}
132 132
       menuDataRender={menuDataRender(menus)}
133 133
       formatMessage={formatMessage}
134
-      rightContentRender={() => <GlobalHeader title={routeItem.name} history={history} location={location} />}
134
+      rightContentRender={() => <GlobalHeader title={routeItem?.name} history={history} location={location} />}//加非空判断
135 135
       {...props}
136 136
       {...settings}
137 137
     >

+ 10
- 9
src/pages/building/Developers/index.jsx Zobrazit soubor

@@ -2,10 +2,10 @@ import React, { useMemo, useRef, useCallback, useState } from 'react'
2 2
 import {Button} from 'antd'
3 3
 import apis from '@/services/apis'
4 4
 import AuthButton from '@/components/AuthButton';
5
-// import QueryTable from '@/components/QueryTable'
6
-import TableList from '@/components/TableList'
5
+import QueryTable from '@/components/QueryTable'
7 6
 import getTableColumns from './tableColumns'
8 7
 import { router } from 'umi';
8
+import getSearchFields from './searchFields'//searchbox
9 9
 
10 10
 export default (props) => {
11 11
   const ref = useRef()
@@ -20,14 +20,12 @@ export default (props) => {
20 20
     });
21 21
   }, [])
22 22
 
23
-  const onDelete = useCallback((row) => {
24
-
25
-  }, [])
26
-
23
+  const onDelete = useCallback((row) => {}, [])//格式
24
+  const searchFields = useMemo(getSearchFields, [])//搜索框
27 25
 
28 26
   const tableColumns = useMemo(() => {
29 27
     return getTableColumns({
30
-      page,
28
+      page,//可无
31 29
       onEdit:(e)=>toEdit(e),
32 30
       onDelete,
33 31
     })
@@ -35,8 +33,9 @@ export default (props) => {
35 33
 
36 34
   const actionRender = () => {
37 35
     return (
36
+      //name 名字错误
38 37
       <AuthButton name="admin.tdBuildingType.add" noRight={null}>
39
-        <Button type="primary" icon="plus" onClick={() => toEdit()} >
38
+        <Button type="primary" icon="plus" onClick={toEdit} >
40 39
           新增
41 40
         </Button>
42 41
       </AuthButton>
@@ -45,11 +44,13 @@ export default (props) => {
45 44
 
46 45
   return (
47 46
     <>
48
-      <TableList
47
+      <QueryTable
48
+      //搜索组件
49 49
         rowKey="buildingId"
50 50
         api={apis.building.getList}
51 51
         columns={tableColumns}
52 52
         actionRender={actionRender}
53
+        searchFields={searchFields}
53 54
       />
54 55
     </>
55 56
   )

+ 20
- 0
src/pages/building/Developers/searchFields.js Zobrazit soubor

@@ -0,0 +1,20 @@
1
+
2
+export default () => [
3
+
4
+  {
5
+    name: 'name',
6
+    label: '开发商名称',
7
+    placeholder: '请输入开发商名称',
8
+  },
9
+  // {
10
+  //   name: 'buildingName',
11
+  //   label: '开发商名称',
12
+  //   placeholder: '开发商名称',
13
+  //   type: 'select',
14
+  //   options: [
15
+  //     {label: '全部', value:0},
16
+  //     {label: '雅居乐·龙悦幸福小镇',value:1},
17
+  //     {label: '中国碧桂园', value: 2}
18
+  //   ]
19
+  // }
20
+]

+ 1
- 1
src/pages/building/Developers/tableColumns.js Zobrazit soubor

@@ -10,7 +10,7 @@ export default ({page, onEdit, onDelete}) => [
10 10
     title: '开发商索引字母',
11 11
     key: '#',
12 12
     align: 'center',
13
-    render: (t, r, index) => (page.current - 1) * page.pageSize + index + 1,
13
+    render: (t, r, index) => (page.current - 1) * page.pageSize + index + 1,//可无
14 14
   },
15 15
   {
16 16
     title: '开发商名称',

+ 259
- 0
src/pages/course/Edit/index.jsx Zobrazit soubor

@@ -0,0 +1,259 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { UploadOutlined } from '@ant-design/icons';
3
+import { Input, Card, message, Radio, Select,Upload, Button } from 'antd';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import BuildSelect from '@/components/SelectButton/BuildSelectCourse'
6
+import router from 'umi/router';
7
+import { FieldTypes, createForm } from '@/components/XForm';
8
+import Wangedit from '@/components/Wangedit/Wangedit'
9
+// import channels from './channelList.less';
10
+// import Tagss from '../components/Tagss.jsx';
11
+import apis from '@/services/apis';
12
+import request from '@/utils/request'
13
+import BuildingSelection from '../components/BuildingSelection'
14
+import { render } from 'react-dom';
15
+import ImageUpload from '@/components/XForm/ImageUpload';
16
+//下拉
17
+function handleChange(value) {
18
+  console.log(`selected ${value}`);
19
+}
20
+const { TextArea } = Input;
21
+const { Option } = Select;
22
+let consultantChecked = false;
23
+
24
+const setExtraData = (data) => {
25
+  consultantChecked = data.isConsultant
26
+}
27
+
28
+const handleFormValueChange = (props, changedValues, allValues) => {
29
+    setExtraData(allValues)
30
+}
31
+
32
+const XForm = createForm({ onValuesChange: handleFormValueChange })
33
+
34
+/**
35
+ *
36
+ *
37
+ * @param {*} props
38
+ * @returns
39
+ */
40
+const StaffEdit = (props) => {
41
+  const roleId = props.location.query.roleId
42
+  const [userData, setUserData] = useState({})
43
+  const [tagData, setTagData] = useState([])
44
+  const [roleData, setRoleData] = useState([])
45
+  const [buildData, setBuildData] = useState([])
46
+  const [visible, setVisible] = useState(false)
47
+  //图文单选详情Radio
48
+  const [newsDetailType, setNewsOenType] = useState(1);
49
+
50
+  //视频组件
51
+  
52
+  const getVideo = {
53
+    action: '//jsonplaceholder.typicode.com/posts/',
54
+    listType: 'picture',
55
+    previewFile(file) {
56
+      console.log('Your upload file:', file);
57
+      // Your process logic. Here we just mock to the same file
58
+      return fetch('https://next.json-generator.com/api/json/get/4ytyBoLK8', {
59
+        method: 'POST',
60
+        body: file,
61
+      })
62
+        .then(res => res.json())
63
+        .then(({ thumbnail }) => thumbnail);
64
+    },
65
+  };
66
+
67
+  const getTagList = () => {
68
+    request({ ...apis.staff.taTags, params: { pageNum: 1, pageSize: 999 } }).then((data) => {
69
+      setTagData(data.records)
70
+    })
71
+  }
72
+
73
+  const getRoleList = () => {
74
+    request({ ...apis.role.getRoleList, params: { pageNum: 1, pageSize: 999 } }).then((data) => {
75
+      console.log(data)
76
+      setRoleData(data.records)
77
+    })
78
+  }
79
+
80
+  //获取项目列表
81
+  const getBuildList = e => {
82
+    request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(data => {
83
+        setBuildData(data)
84
+    })
85
+  }
86
+
87
+  // 查询列表
88
+  const getUserData = (roleId) => {
89
+    request({ ...apis.staff.getTaUser, urlData: { id: roleId } }).then((data) => {
90
+      consultantChecked = data.isConsultant
91
+      setUserData(data)
92
+      setNewsOenType(Number(data.newsDetailType))
93
+    })
94
+  }
95
+
96
+  if(userData.buildingIds && buildData.length > 0 && !consultantChecked){
97
+      const newBuildings = userData.buildingIds.filter(x => buildData.filter(it => it.buildingId === x)[0])
98
+      userData.buildingIds = newBuildings
99
+  }
100
+
101
+  if(userData.roleIds && roleData.length > 0){
102
+    const newRoleIds = userData.roleIds.filter(x => roleData.filter(it => it.roleId === x)[0])
103
+      userData.roleIds = newRoleIds
104
+  }
105
+
106
+  useEffect(() => {
107
+    getTagList();
108
+    getRoleList();
109
+    getBuildList();
110
+    if (roleId) {
111
+      getUserData(roleId);
112
+    }
113
+  }, [])
114
+
115
+  // const tagsChange = (value) => {
116
+  //   console.log(`selected ${value}`);
117
+  // }
118
+
119
+  const handleSubmit = val => {
120
+    if (roleId) {
121
+      request({ ...apis.course.alterCourse, urlData: { id: roleId }, data: val, }).then((data) => {
122
+        console.log(data, "tauser")
123
+        message.info("保存成功")
124
+        router.go(-1)
125
+      }).catch(error => {
126
+        // message.info(error.message)
127
+      })
128
+    } else {
129
+      request({ ...apis.course.addCourse, data: val, }).then((data) => {
130
+        console.log(data, "tauser")
131
+        message.info("保存成功")
132
+        router.go(-1)
133
+      }).catch(error => {
134
+        // message.info(error.message)
135
+      })
136
+    }
137
+  }
138
+
139
+
140
+  //视频--------------------
141
+ 
142
+
143
+
144
+
145
+
146
+  const photoBeforeUpload = (file) => {
147
+    // const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
148
+    // if (!isJpgOrPng) {
149
+    //   message.error('请上传 JPG/PNG 格式的图片!');
150
+    // }
151
+    console.log(file.size, file.size / 1024)
152
+    const isLt100k = (file.size / 1024) < 100;
153
+    if (!isLt100k) {
154
+      message.error('请上传小于100k的图片!');
155
+    }
156
+    return isLt100k;
157
+  }
158
+  const handleChange = (value) => {
159
+    console.log(`selected ${value}`);
160
+  }
161
+
162
+  const fields = [
163
+    {
164
+      label: '参与对象',
165
+      name: 'roleId',
166
+      render:<Select  initialValue={'0'} style={{ width: 200 }}>
167
+        <Option value='0'>置业顾问</Option>
168
+        <Option value='1'>经纪人</Option>
169
+        <Option value='2'>置业顾问&amp;经纪人</Option>
170
+      </Select> ,
171
+      rules: [
172
+        { required: true, message: '请输入参与对象' },
173
+      ],
174
+    },
175
+    {
176
+      label: '主图',
177
+      name: 'curriculumImg',
178
+      type: FieldTypes.ImageUploader,
179
+      extra: '建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情',
180
+      value: userData.curriculumImg,
181
+      // render:<ImageUpload/>,
182
+      // beforeUpload: (e) => photoBeforeUpload(e),
183
+      rules: [
184
+        { required: true, message: '主图' },
185
+      ]
186
+    },
187
+
188
+    {
189
+      label: '课程标题',
190
+      name: 'content',
191
+      render: <Input style={{width:'550px'}} ></Input>,
192
+      value: userData.usernew,
193
+    
194
+      // className={channels.inpuitTxt}
195
+      rules: [
196
+        { required: true, message: '请输入课程标题' },
197
+      ]
198
+    },
199
+    {
200
+      label: '简介',
201
+      name: 'remark',
202
+      render: <TextArea  style={{width:'550px'}}  rows='5' ></TextArea>,
203
+      value: userData.description,
204
+      rules: [
205
+        { required: true, message: '请输入简介' },
206
+      ]
207
+  
208
+      // className={channels.inpuitTxt}
209
+    },
210
+    {
211
+      label:'详情',
212
+      name:'newsOen',
213
+      render:(
214
+        <Radio.Group 
215
+        onChange={e=>{
216
+          setNewsOenType(e.target.value)
217
+        }} >
218
+          <Radio value='1'>图文</Radio>,
219
+          <Radio value='0'>视频</Radio>,
220
+        </Radio.Group>
221
+      ),
222
+      value:userData,
223
+      rules: [{ required: true, message: '请选择详情类型' }],
224
+
225
+    },
226
+    {
227
+      label: '详情内容',
228
+      name: 'newsDetail',
229
+      render: <Wangedit />,
230
+      hidden: newsDetailType == 0,
231
+      value: userData.newsDetail,
232
+      rules: [{ required: true, message: '请输入详情内容' }],
233
+    },
234
+    {
235
+      label:'视频详情',
236
+      name:'newVideo',
237
+      hidden: newsDetailType == 1,
238
+      value:userData.newVideo,
239
+      render: <Upload {...getVideo} maxCount='1' accept='.avi,.mp4,.wmv,.flv'>
240
+      <Button ><UploadOutlined />上传视频</Button>
241
+    </Upload>,
242
+      extra: '仅支AVI、MP4、WMV、FIV格式视频',
243
+    rules:[{required:true,message:'请上传视频详情'}]
244
+    },
245
+    {
246
+      label: '权重',
247
+      name: 'weight',
248
+      type: FieldTypes.Number,
249
+      render: <Input type="number" style={{ width: 150}} />,
250
+      value: '1',
251
+      help: '数字越大越靠前',
252
+    },
253
+  ]
254
+
255
+  return <Card>
256
+            <XForm onChange={console.log} onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
257
+        </Card>
258
+}
259
+export default StaffEdit

+ 0
- 0
src/pages/course/components/BuildingSelection.jsx Zobrazit soubor


+ 197
- 0
src/pages/course/list/index.jsx Zobrazit soubor

@@ -0,0 +1,197 @@
1
+import React, { useMemo, useRef, useCallback, useState } from 'react';
2
+import { Button, Avatar,Radio ,Modal, message } from 'antd';
3
+import moment from 'moment';
4
+import apis from '@/services/apis';
5
+import request from '@/utils/request';
6
+import AuthButton from '@/components/AuthButton';
7
+import QueryTable from '@/components/QueryTable';
8
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
9
+import OperButton from '@/components/OperButton';
10
+import withActions from '@/components/ActionList';
11
+import { router } from 'umi';
12
+
13
+
14
+export default props => {
15
+  const ref = useRef();
16
+  const [visible, setVisible] = useState(false);
17
+  const [data, setData] = useState(false);
18
+  const toEdit = useCallback(row => {
19
+    //跳转到编辑页面
20
+    router.push({
21
+      pathname: '/course/Edit',
22
+      query: {
23
+        userId: row?.userId || undefined,
24
+      },
25
+    });
26
+  }, []);
27
+
28
+
29
+  const confirm = data => () => {
30
+    // console.log(data, "11111")
31
+    if (data.status === 1) {
32
+      if (data.isConsultant) {
33
+        request({
34
+          // ...apis.staff.check,
35
+          ...apis.course.alterCourse,
36
+          
37
+          params: {
38
+            content: data.content,
39
+            // roleId: data.consultantPersonId,
40
+            roleId: data.roleId,
41
+            createdBy: data.createdBy,
42
+          },
43
+        }).then(res => {
44
+          if (res.length > 0) {
45
+          } else {
46
+            const titleMessahe = data.isConsultant
47
+              ? '确认取消发布此课程吗?'
48
+              : '确认发布此课程吗?';
49
+            Modal.confirm({
50
+              title: titleMessahe,
51
+              okText: '确认',
52
+              cancelText: '取消',
53
+              onOk() {
54
+                // ...apis.staff.change,
55
+                request({ ...apis.course.alterCourse, urlData: { id: data.userId, type: 'off' } }).then(
56
+                  res => {
57
+                    message.info('操作成功');
58
+                    ref.current.reload();
59
+                  },
60
+                );
61
+              },
62
+            });
63
+          }
64
+        });
65
+      } else {
66
+        const titleMessahe = data.isConsultant
67
+          ? '确认发布此课程吗?'
68
+          : '确认取消发布此课程吗?';
69
+        Modal.confirm({
70
+          title: titleMessahe,
71
+          okText: '确认',
72
+          cancelText: '取消',
73
+          onOk() {
74
+            request({ ...apis.course.alterCourse, urlData: { id: data.userId, type: 'off' } }).then(
75
+              res => {
76
+                message.info('操作成功');
77
+                ref.current.reload();
78
+              },
79
+            );
80
+          },
81
+        });
82
+      }
83
+    } else {
84
+      Modal.confirm({
85
+        title: '确认发布此课程吗?',
86
+        okText: '确认',
87
+        cancelText: '取消',
88
+        onOk() {
89
+          request({ ...apis.course.alterCourse, urlData: { id: data.userId, type: 'on' } }).then(res => {
90
+            message.info('操作成功');
91
+            ref.current.reload();
92
+          });
93
+        },
94
+      });
95
+    }
96
+  };
97
+
98
+  const searchFields = [
99
+    {
100
+      name: 'content',
101
+      label: '课程标题',
102
+      placeholder: '请输入课程标题',
103
+    },
104
+    {
105
+      name: 'roleId',
106
+      label: '阅读对象',
107
+      placeholder: '请选阅读对象',
108
+      type: 'select',
109
+      options: [
110
+        { label: '全部', value: '' },
111
+        { label: '置业顾问', value: '0' },
112
+        { label: '经纪人', value: '1' },
113
+      ],
114
+    },
115
+  ];
116
+  const tableColumns = [
117
+    {
118
+      title: '课程标题',
119
+      dataIndex: 'content',
120
+      key: 'content',
121
+      align: 'center',
122
+    },
123
+    {
124
+      title:'课程主图',
125
+      dataIndex:'curriculumImg',
126
+      key:'curriculumImg',
127
+      align:'center',
128
+      render: (_,record) => <img src={record.curriculumImg} style={{ width: '165px', height: '104px' }} />,
129
+      // render:(record)=>(<img src={require(record)}/>)
130
+    },
131
+    {
132
+      title: '阅读人数',
133
+      dataIndex: 'lookNum',
134
+      key: 'lookNum',
135
+      align: 'center',
136
+    },
137
+    {
138
+      title: '阅读对象',
139
+      dataIndex: 'roleId',
140
+      key: 'roleId',
141
+      align: 'center',
142
+      render: text  => (text === '0' ? '置业顾问' :text === '1' ? '经纪人':'置业顾问&经纪人'),
143
+    },
144
+    
145
+    {
146
+      //权重---
147
+      title: '权重',
148
+      dataIndex: 'weight',
149
+      key: 'weight',
150
+      align: 'center',
151
+      // render: (_, record) => <><span>{record.numear = '20'}</span></>,
152
+    },
153
+    {
154
+      title: '操作',
155
+      key: 'isPublish',
156
+      //isPublish
157
+      align: 'center',
158
+      render: withActions(
159
+        (_, row) => [
160
+          <AuthButton name="admin.building.public" noRight={null}>
161
+            <OperButton onClick={confirm(row)}> {row.status === 1 ? '取消发布' : '发布'}</OperButton>
162
+          </AuthButton>,
163
+          <AuthButton name="admin.building.delete" noRight={null}>
164
+               <OperButton onClick>添加标签</OperButton>
165
+               <OperButton onClick={()=>toEdit(row)}>{row.status ===1? '编辑':''}</OperButton>
166
+               {/* <OperButton onClick={()=>toEdit(row)} >编辑</OperButton> */}
167
+          </AuthButton>,
168
+        ],
169
+        { noMargin: true },
170
+      ),
171
+    },
172
+  ];
173
+  const actionRender = () => {
174
+    return (
175
+      <AuthButton name="admin.newclassType.add" noRight={null}>
176
+        <Button type="primary" icon="plus" onClick={() => toEdit()}>
177
+          新增
178
+        </Button>
179
+      </AuthButton>
180
+    );
181
+  };
182
+
183
+  return (
184
+    <>
185
+      <QueryTable
186
+        ref={ref}
187
+        rowKey="curriculumId"
188
+        // api={apis.staff.taUser}
189
+        
190
+        api={apis.course.Tablecourse}
191
+        columns={tableColumns}
192
+        searchFields={searchFields}
193
+        actionRender={actionRender}
194
+      />
195
+    </>
196
+  );
197
+};

+ 148
- 0
src/pages/home/Recommend/audit.jsx Zobrazit soubor

@@ -0,0 +1,148 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Card, Radio, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+import { router } from 'umi';
8
+
9
+
10
+const { TextArea } = Input;
11
+
12
+const tailFormItemLayout = {
13
+  labelCol: {
14
+    xs: { span: 20 },
15
+    sm: { span: 3 },
16
+  },
17
+  wrapperCol: {
18
+    xs: { span: 20 },
19
+    sm: { span: 16 },
20
+  },
21
+};
22
+
23
+const openNotificationWithIcon = (type, message) => {
24
+  notification[type]({
25
+    message, 
26
+    description:
27
+      '',
28
+  });
29
+}
30
+
31
+function body(props) {
32
+  const { getFieldDecorator } = props.form
33
+
34
+  // eslint-disable-next-line react-hooks/rules-of-hooks
35
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: ''})
36
+
37
+  // eslint-disable-next-line react-hooks/rules-of-hooks
38
+  const [dataSource, setDataSource] = useState({ picture: '' })
39
+
40
+  const { id } = props.location.query;
41
+
42
+  if (id !== '') {
43
+    //useEffect循环可能导致在呈现字段之前无法设置表单字段
44
+    // eslint-disable-next-line react-hooks/rules-of-hooks
45
+    useEffect(() => {
46
+      getById(id)
47
+    }, [])
48
+  }
49
+
50
+  // 获取详情信息
51
+  function getById(currentId) {
52
+    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
53
+      // res.reportDate = moment(res.reportDate)
54
+    if(res){
55
+        props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
56
+        //包裹的没渲染完就执行set 导致在呈现字段之前无法设置表单字段
57
+    }
58
+
59
+    })
60
+  }
61
+
62
+  function submitDate(params) {
63
+    // props.form.setFieldsValue(res)
64
+    console.log(params, 'params')
65
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66
+      // eslint-disable-next-line no-unused-expressions
67
+      openNotificationWithIcon('success', '操作成功')
68
+      router.go(-1)
69
+    }).catch(err => {
70
+      // eslint-disable-next-line no-unused-expressions
71
+
72
+    })
73
+  }
74
+
75
+  // 提交事件
76
+  function handleSubmit(e) {
77
+    e.preventDefault();
78
+    props.form.validateFields((err, values) => {
79
+      if (!err) {
80
+        submitDate({ verifyStatus: '1' })
81
+        // submitDate({ ...values })
82
+      }
83
+    });
84
+  }
85
+
86
+  return (
87
+    <Card>
88
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
89
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
90
+          {getFieldDecorator('customerId')(
91
+            <Input
92
+              placeholder="客户ID"
93
+            />,
94
+          )}
95
+        </Form.Item>
96
+        {/* ············分割线............. */}
97
+        <Form.Item label="意向项目:">
98
+          {getFieldDecorator('intention')(
99
+            <Input placeholder="意向项目"/>,
100
+          )}
101
+        </Form.Item>
102
+        <Form.Item label="客户姓名">
103
+          {getFieldDecorator('name')(
104
+            <Input placeholder="客户姓名" />,
105
+          )}
106
+        </Form.Item>
107
+        <Form.Item label="客户电话">
108
+          {getFieldDecorator('phone')(
109
+            <Input placeholder="客户电话" />,
110
+            
111
+          )}
112
+        </Form.Item>
113
+        <Form.Item label="客户性别">
114
+          {getFieldDecorator('sex')(
115
+            <Radio.Group>
116
+              <Radio value={1}>男</Radio>
117
+              <Radio value={2}>女</Radio>
118
+            </Radio.Group>,
119
+          )}
120
+        </Form.Item>
121
+        <Form.Item label="客户备注"   >
122
+          {getFieldDecorator('say')(
123
+            <TextArea  placeholder="客户描述" rows={7} />,
124
+          )}
125
+        </Form.Item>
126
+        <Form.Item label="回访备注" >
127
+          {getFieldDecorator('describe' ,{
128
+            rules:[{required:true,message:'请输入回访备注!'}]//v3x必填
129
+          })(
130
+            <TextArea placeholder="回访备注" rows={7} />,
131
+          )}
132
+        </Form.Item>
133
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
134
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
135
+            有效
136
+          </Button>
137
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
138
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
139
+            无效
140
+          </Button>
141
+        </Form.Item>
142
+      </Form>
143
+    </Card>
144
+  );
145
+}
146
+const HouseCopm = Form.create({ name: 'body' })(body);
147
+
148
+export default HouseCopm

+ 104
- 0
src/pages/home/Recommend/auditCopy.jsx Zobrazit soubor

@@ -0,0 +1,104 @@
1
+import React, { useEffect } from 'react';
2
+import { Form, Input, Button, Card, Radio } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+
7
+
8
+const { TextArea } = Input;
9
+
10
+const tailFormItemLayout = {
11
+  labelCol: {
12
+    xs: { span: 20 },
13
+    sm: { span: 3 },
14
+  },
15
+  wrapperCol: {
16
+    xs: { span: 20 },
17
+    sm: { span: 16 },
18
+  },
19
+};
20
+
21
+function body(props) {
22
+  const { getFieldDecorator } = props.form
23
+  const { id } = props.location.query;
24
+
25
+  if (id !== '') {
26
+    // eslint-disable-next-line react-hooks/rules-of-hooks
27
+    useEffect(() => {
28
+      getById(id)
29
+    }, [])
30
+  }
31
+
32
+  // 获取详情信息
33
+  function getById(currentId) {
34
+    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
35
+      // res.reportDate = moment(res.reportDate)
36
+      if(res){
37
+        props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
38
+      }
39
+    
40
+    })
41
+  }
42
+  //返回上一页
43
+  function backCom(){
44
+    window.history.back(-1)
45
+  }
46
+  return (
47
+    <Card>
48
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
49
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
50
+          {getFieldDecorator('customerId')(
51
+            <Input
52
+              placeholder="客户ID"
53
+            />,
54
+          )}
55
+        </Form.Item>
56
+        {/* ············分割线............. */}
57
+        <Form.Item label="意向项目:">
58
+          {getFieldDecorator('intention')(
59
+            <Input
60
+              placeholder="意向项目"
61
+            />,
62
+          )}
63
+        </Form.Item>
64
+        <Form.Item label="客户姓名">
65
+          {getFieldDecorator('name')(
66
+            <Input placeholder="客户姓名" />,
67
+          )}
68
+        </Form.Item>
69
+        <Form.Item label="客户电话">
70
+          {getFieldDecorator('phone')(
71
+            <Input placeholder="客户电话" />,
72
+          )}
73
+        </Form.Item>
74
+        <Form.Item label="客户性别">
75
+          {getFieldDecorator('sex')(
76
+            <Radio.Group>
77
+              <Radio value={1}>男</Radio>
78
+              <Radio value={2}>女</Radio>
79
+            </Radio.Group>,
80
+          )}
81
+        </Form.Item>
82
+        <Form.Item label="客户备注"  >
83
+          {getFieldDecorator('say')(
84
+            <TextArea  placeholder="客户描述" rows={7}
85
+            />,
86
+          )}
87
+        </Form.Item>
88
+        <Form.Item label="回访备注" >
89
+          {getFieldDecorator('describe' ,{
90
+            rules:[{required:true}]//v3x必填
91
+          })(
92
+            <TextArea placeholder="回访备注" rows={7}  value={props}/>,
93
+          )}
94
+        </Form.Item>
95
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
96
+          <Button onClick={backCom} >返回</Button>
97
+        </Form.Item>
98
+      </Form>
99
+    </Card>
100
+  );
101
+}
102
+const HouseCopm = Form.create({ name: 'body' })(body);
103
+
104
+export default HouseCopm

+ 241
- 0
src/pages/home/Recommend/index.jsx Zobrazit soubor

@@ -0,0 +1,241 @@
1
+import React, {PureComponent, useMemo, useState } from 'react';
2
+import {  Avatar, Button } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import QueryTable from '@/components/QueryTable'
7
+import { router } from 'umi';
8
+import { render } from 'enzyme';
9
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
10
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
11
+import renderAuthorize from '@/components/Authorized/renderAuthorize';
12
+import { setLocale } from 'umi-plugin-locale';
13
+import { fromPairs } from 'lodash';
14
+import { backgroundColor } from 'echarts/lib/theme/dark';
15
+
16
+
17
+// const a={
18
+//   /**
19
+//  *
20
+//  *
21
+//  * @param {*} props
22
+//  * @returns
23
+//  */
24
+
25
+// }
26
+// let(dataIndex){
27
+//   render(){
28
+//     return(
29
+//       <h1><input type="datetime-local" name="ckassname" id="" /></h1>
30
+//     )
31
+//   }
32
+// }
33
+
34
+function Recommend() {
35
+  const [exportLoding,setExportLoding] = useState(false)
36
+  //详情页面弹窗配置
37
+  function toAudit(cuurentId) {
38
+    router.push({
39
+      pathname: '/home/recommend/audit',
40
+      query: {
41
+        id: cuurentId,
42
+      },
43
+    })
44
+    
45
+  }
46
+  function toSee(cuurentId) {
47
+    router.push({
48
+      pathname: '/home/recommend/auditCopy',
49
+      query: {
50
+        id: cuurentId,
51
+      },
52
+    })
53
+    
54
+  }
55
+
56
+
57
+  /**
58
+   *导出数据(推荐用户)
59
+   *
60
+   */
61
+  function exportRecommendCustomer() {
62
+    setExportLoding(true)
63
+    request({
64
+      ...apis.customer.customerRecommendRecommenderExport,
65
+      responseType: 'blob',
66
+    }).then(response => {
67
+      console.log('exportRecommendCustomer: ', response)
68
+      download(response)
69
+    }).catch(error => {
70
+
71
+    })
72
+  }
73
+
74
+  function download(data) {
75
+    if (!data) {
76
+      return 
77
+    }
78
+    const url = window.URL.createObjectURL(new Blob([data]))
79
+    const link = document.createElement('a')
80
+    link.style.display = 'none'
81
+    link.href = url
82
+    link.setAttribute('download', '推荐客户.xlsx')
83
+    document.body.append(link)
84
+    link.click()
85
+    setExportLoding(false)
86
+  }
87
+  const columns = [
88
+    {
89
+      title: '头像',
90
+      dataIndex: 'picture',
91
+      key: 'picture',
92
+      align:'center',
93
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
94
+    },
95
+    {
96
+      title: '姓名',
97
+      dataIndex: 'name',
98
+      key: 'name',
99
+      align:'center',
100
+      // render: (_, record) => <><span>{record.name = '曹建芳'}</span></>,
101
+    },
102
+    {
103
+      title: '电话',
104
+      dataIndex: 'phone',
105
+      key: 'phone',
106
+      align:'center',
107
+    },
108
+    {
109
+      title: '性别',
110
+      dataIndex: 'sex',
111
+      key: 'sex',
112
+      align:'center',
113
+      // eslint-disable-next-line no-nested-ternary
114
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
115
+    },
116
+    {
117
+      title: '意向区域',
118
+      dataIndex: 'area',//意向区域
119
+      key: 'area',
120
+      align:'center',
121
+      render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
122
+
123
+    },
124
+    {
125
+      title: '意向项目',
126
+      dataIndex: 'intention',
127
+      key: 'intention',
128
+      // intention
129
+      //project
130
+      align:'center',
131
+      // render: (_, record) => <><span>{record.area = '香颂.蔚澜半岛'}</span></>,
132
+      render:(_,record)=><span>{record='香颂.蔚澜半岛'}</span>
133
+
134
+    },
135
+    {
136
+      title: '提交时间',
137
+      dataIndex: 'createDate',
138
+      key: 'createDate',
139
+      align:'center',
140
+      render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
141
+    },
142
+    {
143
+      title: '状态',
144
+      dataIndex: 'verifyStatus',
145
+      key: 'verifyStatus',
146
+      align:'center',
147
+      render: (_, record) => <><span>{record.verifyStatus === 0 ? '待回访' : record.verifyStatus === 1 ? '已回访'   : record.verifyStatus === 2 ? '无效' : ''}</span></>,
148
+    },
149
+    {
150
+      title: '操作',
151
+      dataIndex: 'customerId',
152
+      key: 'customerId',
153
+      align:'center',
154
+
155
+      render: (_, record) => (
156
+        <><span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} >
157
+          {record.verifyStatus ===0?<span onClick={() => toAudit(record.customerId)}>审核</span>
158
+          : record.verifyStatus ===1?<span onClick={() => toSee(record.customerId)}>查看详情</span>
159
+          : record.verifyStatus ===2?<span onClick={() => toSee(record.customerId)}>查看详情</span>
160
+          :''}</span>
161
+        </>
162
+      ),
163
+    },
164
+  ]
165
+
166
+
167
+ const searchFields=[
168
+  // {
169
+  //   name:'builidingId',
170
+  //   label:'用户',
171
+  //   placeholder:'选择用户',
172
+  //   render:()=><BuildSelect style={{width:160}}/>
173
+
174
+  // },
175
+  {
176
+    name: 'project',
177
+    label: '意向项目',
178
+    placeholder: '请输入意向项目',
179
+  },
180
+
181
+  {
182
+    name: 'name',
183
+    label: '姓名',
184
+    placeholder: '请输入姓名',
185
+  },
186
+  {
187
+    name: 'tel',
188
+    label: '电话',
189
+    placeholder: '请输入电话',
190
+  },
191
+    {
192
+    name: 'types',
193
+    label: '类型',
194
+    placeholder: '类型',
195
+    type: 'select',
196
+    placeholder:'全部',//错误
197
+    options: [
198
+      {label: '全部'},
199
+      {label: '买房',value:1},
200
+      {label: '租房', value: 2},
201
+      {label: '海外', value: 3}
202
+    ]
203
+  },
204
+  {
205
+    name: 'verifyStatus',
206
+    label: '状态',
207
+    placeholder: '请选择状态',
208
+    type: 'select',
209
+    placeholder:'全部',//错误
210
+    options: [
211
+      {label: '全部'},
212
+      {label: '待回访', value: 0},
213
+      {label: '已回访', value: 1},
214
+      {label: '无效', value: 2}
215
+    ]
216
+  },
217
+  ]
218
+ const actionRender = () => {
219
+  return (
220
+    <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
221
+      导出
222
+    </Button>
223
+  );
224
+};
225
+
226
+  return (
227
+    <>
228
+      <QueryTable
229
+          rowKey="recommendCustomer"
230
+          // recommendCustomer
231
+          api={apis.homeload.houseSchr}
232
+          searchFields={searchFields}
233
+          columns={columns}
234
+          actionRender={actionRender}
235
+        />
236
+    
237
+    </>
238
+  );
239
+}
240
+
241
+export default Recommend

+ 151
- 0
src/pages/home/Recommend/style.less Zobrazit soubor

@@ -0,0 +1,151 @@
1
+.SubmitButton {
2
+  // background: rgba(239,39,58,1);
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.text {
7
+  color: rgba(239,39,58,1);
8
+}
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: #ffffff;
12
+  border-radius: 7px;
13
+  border: 1px solid #dbdbdb;
14
+}
15
+.addButton {
16
+  background: #50be00;
17
+  border-radius: 4px;
18
+  border: 0px;
19
+  margin: 10px 0px;
20
+}
21
+.cardText {
22
+  color: #333;
23
+  display: flex;
24
+  align-items: center;
25
+  position: relative;
26
+  line-height: 1.5;
27
+  font-size: 0.106rem;
28
+  margin-bottom: 0.08rem;
29
+
30
+}
31
+.cardItem{
32
+  color: #666;
33
+  display: flex;
34
+  align-items: center; 
35
+  line-height: 1.5;
36
+  font-size: 0.106rem;
37
+  margin-bottom: 0.08rem; 
38
+}
39
+.ediText {
40
+  font-size: 0.106rem;
41
+  color: #ff925c;
42
+  line-height: 24px;
43
+  position: absolute;
44
+  right: 0;
45
+}
46
+.title{
47
+  display: inline-block;
48
+  width:  0.54rem;
49
+  justify-content: space-between;
50
+  text-align: justify;
51
+  text-align-last:justify
52
+}
53
+
54
+.address { 
55
+  width: 400px;
56
+  height: 24px; 
57
+  text-overflow: ellipsis; 
58
+  white-space: nowrap;
59
+  overflow: hidden;
60
+}
61
+
62
+.pitchButton { 
63
+  border-color: rgba(255,126,72,1);
64
+  background-color: rgba(255,126,72,1);
65
+  color: rgba(255,255,255,1); 
66
+}
67
+.noButton {
68
+  border-color: rgba(255,126,72,1);
69
+  color: rgba(255,126,72,1);
70
+}
71
+.displayS {
72
+  display: none;
73
+}
74
+
75
+
76
+// 客户详情样式
77
+.cardBox{
78
+  display: flex;
79
+  .leftBox{
80
+    width:342px;
81
+    min-width:342px;
82
+    height:511px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:-webkit-fill-available;
93
+    height:511px;
94
+    min-width: 800px;
95
+    background:rgba(255,255,255,1);
96
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97
+    border-radius:8px;
98
+    display: inline-block;
99
+    padding: 30px;
100
+    overflow: hidden;
101
+    position: relative;
102
+  }
103
+  .tit{
104
+    font-size:24px;
105
+    font-weight:600;
106
+    color:#222;
107
+    margin: 10px 0 0 0;
108
+  }
109
+  .touxiang{
110
+    width: 120px;
111
+    width: 120px;
112
+    border-radius: 6px;
113
+    margin: 30px 0 20px 0;
114
+  }
115
+  .infoItem{
116
+    color:#666;
117
+    font-size: 19px;
118
+    margin: 0 0 10px 0;
119
+    
120
+  }
121
+  .rightItem{
122
+    color:#666;
123
+    font-size: 19px;
124
+    margin: 0 0 15px 0;
125
+  }
126
+  .right{
127
+    position: absolute;
128
+    top:108px;
129
+    left:170px;
130
+  }
131
+  .rightInfo{
132
+    position: absolute;
133
+    top:50px;
134
+    left:50%;
135
+  }
136
+  
137
+}
138
+.recordBox{
139
+  width:100%;
140
+  background:rgba(255,255,255,1);
141
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
142
+  border-radius:8px;
143
+  margin-top: 30px;
144
+  padding: 30px;
145
+  .tableName{
146
+    font-size:24px;
147
+    font-weight:600;
148
+    color:#222;
149
+  }
150
+}
151
+

+ 134
- 7
src/pages/staff/Organization/index.jsx Zobrazit soubor

@@ -1,15 +1,142 @@
1
-import React from 'react';
1
+import React, { Component } from 'react';
2
+import { Tree } from 'antd';
3
+const { DirectoryTree } = Tree;
2 4
 
3
-function Organization(props) {
5
+// function Organization(props) {
4 6
   
5 7
 
6 8
 
9
+//   return (
10
+//     <>
11
+//      组织架构
12
+//     </>
13
+//   );
14
+// }
15
+
16
+
17
+// export default Organization
18
+
19
+
20
+const treeData = [
21
+  {
22
+    title: '江苏XX软件集团',
23
+    key: '0-0',
24
+    children: [
25
+      {
26
+        title: '南京123电子科技有限公司',
27
+        key: '0-0-1',
28
+
29
+        // isLeaf: true,
30
+        children: [
31
+          {
32
+            title: '秦淮区分公司',
33
+            key: '0-0-1-0',
34
+            // isLeaf: true,
35
+            children: [
36
+              {
37
+                title: '制造一区',
38
+                key: '0-0-1-1',
39
+                isLeaf: true,
40
+              },
41
+              {
42
+                title: '总裁办公室',
43
+                key: '0-0-1-2',
44
+                isLeaf: true,
45
+              },
46
+              {
47
+                title: '工艺部',
48
+                key: '0-0-1-3',
49
+                isLeaf: true,
50
+              },
51
+              {
52
+                title: '技术部',
53
+                key: '0-0-1-4',
54
+                isLeaf: true,
55
+              },
56
+            ]
57
+          },
58
+        ]
59
+      },
60
+      {
61
+        title: '苏州¥¥科技股份有限公司',
62
+        key: '0-0-0',
63
+        isLeaf: true,
64
+      },
65
+      {
66
+        title: '宿迁ABC电商服务有限公司',
67
+        key: '0-0-0-1',
68
+        isLeaf: true,
69
+      },
70
+    ],
71
+  },
72
+  //---------------
73
+  {
74
+    title: '系统管理',
75
+    key: '0-2',
76
+    children: [
77
+      {
78
+        title: '机器设置',
79
+        key: '0-2-0',
80
+        isLeaf: true,
81
+      },
82
+      {
83
+        title: '散热设置',
84
+        key: '0-2-1',
85
+        // isLeaf: true,
86
+        children:[
87
+          {
88
+            title:'一号风扇',
89
+            key:'0-2-1-0'
90
+          },
91
+          {
92
+            title:'二号风扇',
93
+            key:'0-2-1-1'
94
+          },
95
+        ]
96
+      },
97
+      {
98
+        title: '广播设置',
99
+        key: '0-2-2',
100
+        isLeaf: true,
101
+      },
102
+    ],
103
+  },
104
+];
105
+
106
+const Demo = () => {
107
+  const onSelect = (keys, info) => {
108
+    console.log('Trigger Select', keys, info);
109
+  };
110
+
111
+  const onExpand = () => {
112
+    console.log('Trigger Expand');
113
+  };
114
+
7 115
   return (
8
-    <>
9
-     组织架构
10
-    </>
116
+    <DirectoryTree
117
+      multiple
118
+      defaultExpandAll
119
+      onSelect={onSelect}
120
+      onExpand={onExpand}
121
+      treeData={treeData}
122
+    />
11 123
   );
12
-}
124
+};
13 125
 
14 126
 
15
-export default Organization
127
+class Treetest extends Component {
128
+    // constructor(props) {
129
+    //     super(props);
130
+    //     //react定义数据
131
+    //     this.state = {
132
+    //     }
133
+    // }
134
+    render() {
135
+        return (
136
+          <div>
137
+            <DirectoryTree  treeData={treeData} />
138
+          </div>
139
+        )
140
+    }
141
+}
142
+export default  Treetest;

+ 21
- 0
src/pages/system/Sellhouse/Edit.jsx Zobrazit soubor

@@ -0,0 +1,21 @@
1
+import React, {  } from 'react';
2
+// import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
+import { Card, Tabs } from 'antd';
4
+import Basic from './compents/Basic'
5
+
6
+const { TabPane } = Tabs;
7
+
8
+export default props => {
9
+    const newsId = props.location.query.newsId
10
+  return (
11
+    <Card>
12
+      <Tabs defaultActiveKey="1">
13
+        <TabPane tab="基本信息" key="1">
14
+          {/* <div style={{ maxWidth: 1000 }}> */}
15
+            <Basic newsId={newsId} />
16
+          {/* </div> */}
17
+        </TabPane>
18
+      </Tabs>
19
+    </Card>
20
+  );
21
+};

+ 354
- 0
src/pages/system/Sellhouse/NewsHouse.jsx Zobrazit soubor

@@ -0,0 +1,354 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Modal, message, Card, Row, Col, Pagination, Alert } from 'antd';
3
+import moment from 'moment';
4
+import router from 'umi/router';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import Styles from './style.less';
8
+import styles from '../../style/GoodsList.less';
9
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
10
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
11
+import SelectCity from '../../../components/SelectButton/CitySelect'
12
+import Prompt from 'umi/prompt';
13
+
14
+import AuthButton from '@/components/AuthButton';
15
+import EditIcon from '@/components/EditIcon';
16
+import Navigate from '@/components/Navigate';
17
+
18
+
19
+const { Option } = Select;
20
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+const { Meta } = Card;
22
+
23
+const tempDate = [{ code: 's101' }]
24
+
25
+/**
26
+ *
27
+ *
28
+ * @param {*} props
29
+ * @returns
30
+ */
31
+function body(props) {
32
+  const { getFieldDecorator } = props.form
33
+
34
+  // eslint-disable-next-line react-hooks/rules-of-hooks
35
+  const [dataSource, setDataSource] = useState({ records: [] })
36
+  const [page, setPage] = useState(props.location.query.page || 1)
37
+
38
+
39
+  // eslint-disable-next-line react-hooks/rules-of-hooks
40
+  useEffect(() => {
41
+    if (localStorage.getItem("newsPageParams")) {
42
+      props.form.setFieldsValue(JSON.parse(localStorage.getItem("newsPageParams")));
43
+      // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
44
+
45
+      getList(JSON.parse(localStorage.getItem("newsPageParams")))
46
+    } else {
47
+      localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: 1, pageSize: 6 }));
48
+      getList({ pageNum: 1, pageSize: 6 })
49
+    }
50
+  }, [])
51
+
52
+  function getList(params) {
53
+    // 网路请求
54
+    request({ ...apis.news.getList, params: { ...params } }).then(res => {
55
+      setDataSource(res)
56
+    }).catch(err => {
57
+      // eslint-disable-next-line no-unused-expressions
58
+      <Alert
59
+        style={{
60
+          marginBottom: 24,
61
+        }}
62
+        message={err}
63
+        type="error"
64
+        showIcon
65
+      />
66
+    })
67
+  }
68
+
69
+  // 提交事件
70
+  function handleSubmit(e) {
71
+    e.preventDefault();
72
+    props.form.validateFields((err, values) => {
73
+      if (!err) {
74
+        console.log('提交数据: ', values)
75
+        const { startDate } = values
76
+        localStorage.setItem("newsPageParams", (JSON.stringify({ pageNum: 1, pageSize: 6, ...values })));
77
+        getList({ pageNum: 1, pageSize: 6, ...values })
78
+      }
79
+    });
80
+  }
81
+
82
+  // 跳转到编辑资讯列表
83
+  const toEditList = (id) => () => {
84
+    router.push({
85
+      pathname: '/system/Sellhouse/editNewsList',
86
+      query: {
87
+        id
88
+      },
89
+    });
90
+  }
91
+
92
+
93
+
94
+  /**
95
+   *卡片
96
+   *
97
+   * @returns
98
+   */
99
+  function CartBody(props) {
100
+    const { data } = props
101
+    console.log(data);
102
+    const cancelPage = () => {
103
+      router.push({
104
+        pathname: '/system/Sellhouse/NewsHouse',
105
+      });
106
+    }
107
+
108
+    //删除资讯
109
+    const changeNewsListStatus = (row, newsId) => () => {
110
+      Modal.confirm({
111
+        title: '资讯会被删除,小程序端和后台都无法再看到',
112
+        okText: '确认',
113
+        cancelText: '取消',
114
+        onOk() {
115
+          request({ ...apis.news.put, urlData: { id: newsId }, data: { ...row, status: -1 } }).then((data) => {
116
+            message.info('操作成功!')
117
+            getList(JSON.parse(localStorage.getItem("newsPageParams")));
118
+          }).catch((err) => {
119
+            console.log(err)
120
+            message.info(err.msg || err.message)
121
+          })
122
+        }
123
+      });
124
+    }
125
+
126
+    // 跳转到编辑资讯列表
127
+    const toEditList = (newsId) => () => {
128
+      router.push({
129
+        pathname: '/system/Sellhouse/editNewsList',
130
+        query: {
131
+          newsId,
132
+        },
133
+      });
134
+    }
135
+
136
+    //   置顶
137
+    const topNews = (weightParam, newsId) => () => {
138
+      const weight = Math.abs(weightParam - 1)
139
+      request({ ...apis.news.weight, params: { newsId: newsId, weight } }).then((data) => {
140
+        console.log(data)
141
+        message.info('操作成功!')
142
+        getList(JSON.parse(localStorage.getItem("newsPageParams")))
143
+      }).catch((err) => {
144
+        console.log(err)
145
+        message.info(err.msg || err.message)
146
+      })
147
+    }
148
+
149
+    function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
150
+      console.log("newsId" + newsId + "status" + newsStatus);
151
+      if (newsStatus === 1) {
152
+        Modal.confirm({
153
+          title: '资讯会在小程序端隐藏,后台可继续编辑重新发布',
154
+          okText: '确认',
155
+          cancelText: '取消',
156
+          onOk() {
157
+            request({ ...apis.news.cancel, data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId }, urlData: { id: newsId }, }).then((data) => {
158
+              message.info('操作成功!')
159
+              getList(JSON.parse(localStorage.getItem("newsPageParams")));
160
+            }).catch((err) => {
161
+              console.log(err)
162
+              message.info(err.msg || err.message)
163
+            })
164
+          },
165
+          onCancel() {
166
+            console.log('Cancel');
167
+          },
168
+        });
169
+      } else if (newsStatus === 0) {
170
+        Modal.confirm({
171
+          title: '确认发布该资讯?',
172
+          okText: '确认',
173
+          cancelText: '取消',
174
+          onOk() {
175
+            request({ ...apis.news.cancel, data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId }, urlData: { id: newsId }, }).then((data) => {
176
+              message.info('操作成功!')
177
+              getList(JSON.parse(localStorage.getItem("newsPageParams")));
178
+            }).catch((err) => {
179
+              console.log(err)
180
+              message.info(err.msg || err.message)
181
+            })
182
+          },
183
+          onCancel() {
184
+            console.log('Cancel');
185
+          },
186
+        });
187
+      }
188
+    }
189
+
190
+    return (
191
+      <Card
192
+        // hoverable
193
+        style={{ height: '230px', minWidth: '570px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', position: 'relative' }}
194
+        cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '230px', height: '228px' }}></img>}
195
+        bodyStyle={{ padding: '10px 20px' }}
196
+      >
197
+        <AuthButton name="admin.taNews.top" noRight={null}>
198
+          <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{data.weight === 1 ? '取消置顶' : '置顶'}</span>
199
+        </AuthButton>
200
+
201
+        <AuthButton name="admin.taNews.id.put" noRight={null}>
202
+          <span style={{ position: 'absolute', right: '10px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(data.newsId)}>
203
+            <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
204
+          </span>
205
+        </AuthButton>
206
+        <AuthButton name="admin.taNews.publish" noRight={null}>
207
+          {data.newsStatus === 0 ?
208
+            <span style={{ position: 'absolute', left: '250px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', zIndex: 1, cursor: 'pointer' }} onClick={cancelRelease.bind(this, data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
209
+              <EditIcon text="取消发布" color='#FF4A4A' type="cancel"></EditIcon>
210
+            </span> :
211
+            <span style={{ position: 'absolute', left: '250px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', zIndex: 1, cursor: 'pointer' }} onClick={cancelRelease.bind(this, data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
212
+              <EditIcon text="发布" color='#ff925c' type="publish"></EditIcon>
213
+            </span>
214
+          }
215
+        </AuthButton>
216
+        <AuthButton name="admin.taNews.id.delete" noRight={null}>
217
+          <span style={{ position: 'absolute', right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', zIndex: 1 }} onClick={changeNewsListStatus(data, data.newsId)}>
218
+            <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon>
219
+          </span>
220
+        </AuthButton>
221
+        <div style={{ position: 'absolute', left: '240px', top: '0px', padding: '16px 10px', width: '64%' }}>
222
+          <p style={{
223
+            fontSize: ' 0.106rem', color: '#333', fontWeight: '600', marginBottom: '10px', overflow: 'hidden',
224
+            textOverflow: 'ellipsis',
225
+            whiteSpace: 'nowrap',
226
+            width: '75%',
227
+          }}><Navigate to={`/news/list/editNewsList?newsId=${data.newsId}`}>{data.newsName}</Navigate></p>
228
+          <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex' }}>
229
+            <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>资讯类型:{data.newsType.newsTypeName}</span>
230
+            <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
231
+          </p>
232
+
233
+          <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex', alignItems: 'center' }}>
234
+            <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>阅读数量:{data.pvNum}</span>
235
+            <span>转发数量:{data.shareNum}</span>
236
+          </p>
237
+
238
+          <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex', alignItems: 'center' }}>
239
+            {/* <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span> */}
240
+            <span>收藏数量:{data.saveNum}</span>
241
+          </p>
242
+
243
+          <p style={{ fontSize: ' 0.106rem', color: '#999', marginBottom: '8px' }}>发布时间:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</p>
244
+        </div>
245
+      </Card>
246
+    )
247
+  }
248
+
249
+
250
+  // Change 事件
251
+  function handleSelectChange(e) {
252
+    // eslint-disable-next-line no-console
253
+    console.log(e)
254
+  }
255
+
256
+  // 分页
257
+  function onChange(pageNumber) {
258
+    props.form.validateFields((err, values) => {
259
+      if (!err) {
260
+        localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: pageNumber, pageSize: 6, ...values }));
261
+        // eslint-disable-next-line react-hooks/rules-of-hooks
262
+        getList({ pageNum: pageNumber, pageSize: 6, ...values })
263
+      }
264
+    });
265
+  }
266
+
267
+  //重置搜索
268
+  function handleReset() {
269
+    props.form.resetFields();
270
+    localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: 1, pageSize: 6 }));
271
+    getList({ pageNum: 1, pageSize: 6 })
272
+  }
273
+
274
+  function getDate(value, dateString) {
275
+    // moment(value).format('YYYY-MM-DD HH:mm:ss')
276
+    console.log(value, dateString)
277
+  }
278
+
279
+  return (
280
+    <>
281
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
282
+
283
+        <Form.Item>
284
+          {getFieldDecorator('cityId')(
285
+            <SelectCity />,
286
+          )}
287
+        </Form.Item>
288
+        <Form.Item>
289
+          {getFieldDecorator('buildingId')(
290
+            <BuildSelect />,
291
+          )}
292
+        </Form.Item>
293
+        <Form.Item>
294
+          {getFieldDecorator('title')(
295
+            <Input
296
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
297
+              placeholder="请输入标题"
298
+            />,
299
+          )}
300
+        </Form.Item>
301
+        <Form.Item>
302
+          {getFieldDecorator('newsTypeId')(
303
+            <NewsTypeSelect />,
304
+          )}
305
+        </Form.Item>
306
+        <Form.Item>
307
+          {getFieldDecorator('newsStatus')(
308
+            <Select style={{ width: '180px' }} placeholder="状态">
309
+              <Option value="0">已发布</Option>
310
+              <Option value="1">未发布</Option>
311
+            </Select>,
312
+          )}
313
+        </Form.Item>
314
+        <Form.Item>
315
+          <AuthButton name="admin.news.search" noRight={null}>
316
+            <Button type="primary" htmlType="submit" >
317
+              搜索
318
+            </Button>
319
+          </AuthButton>
320
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
321
+            重置
322
+            </Button>
323
+        </Form.Item>
324
+      </Form>
325
+      <AuthButton name="admin.taNews.post" noRight={null}>
326
+        <Button type="danger" style={{ padding: '0 40px', margin: '20px 0' }} onClick={toEditList()}>
327
+          新增
328
+        </Button>
329
+      </AuthButton>
330
+
331
+      {/* 卡片内容,显示楼盘项目  */}
332
+      <Row>
333
+        {
334
+          dataSource.records.map((item, index) => (
335
+            <Col span={12}>
336
+              <CartBody data={item} key={item.buildingId} />
337
+            </Col>
338
+          ))
339
+        }
340
+      </Row>
341
+      {/* 分页 */}
342
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
343
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} pageSize={6} onChange={onChange} current={dataSource.current} />
344
+      </div>
345
+      <Prompt message={location =>
346
+        location.pathname.startsWith("/news/list")
347
+          ? true
348
+          : localStorage.removeItem("newsPageParams")} />
349
+    </>
350
+  );
351
+}
352
+const WrappedBody = Form.create({ name: 'body' })(body);
353
+
354
+export default WrappedBody

+ 148
- 0
src/pages/system/Sellhouse/compents/Basic.jsx Zobrazit soubor

@@ -0,0 +1,148 @@
1
+import React, { useEffect, useState } from 'react';
2
+
3
+import { message} from 'antd';
4
+import apis from '@/services/apis';
5
+import router from 'umi/router';
6
+import XForm, { FieldTypes } from '@/components/XForm';
7
+import Wangedit from '@/components/Wangedit/Wangedit';
8
+import request from '@/utils/request';
9
+import searchFields from '@/pages/building/Developers/searchFields';
10
+import QueryTable from '@/components/QueryTable'
11
+import BuildSelect from '@/components/SelectButton/BuildSelectHouse';
12
+
13
+
14
+
15
+const Basic = props => {
16
+  const { newsId } = props;
17
+  const [dynamicData, setDynamicData] = useState({});
18
+  const [changeBuildingId, setChangeBuildingIdData] = useState('');
19
+  const [newsDetailType, setNewsDetailType] = useState(1);
20
+
21
+  useEffect(() => {
22
+    if (newsId) {
23
+      getDynamicData(newsId);
24
+    }
25
+  }, [newsId]);
26
+
27
+  // 查询详情
28
+  const getDynamicData = newsId => {
29
+    request({ ...apis.news.get, urlData: { id: newsId } })
30
+      .then(data => {
31
+        setDynamicData(data);
32
+        console.log(data, 'sss');
33
+        setNewsDetailType(Number(data.newsDetailType));
34
+      })
35
+      .catch(err => {
36
+        console.log(err);
37
+        message.info(err.msg || err.message);
38
+      });
39
+  };
40
+
41
+  const handleBuildingChange = e => {
42
+    console.log(e);
43
+    setChangeBuildingIdData(e);
44
+  };
45
+
46
+
47
+  const fields = [
48
+
49
+
50
+    // {
51
+    //   label: '城市',
52
+    //   name: 'building',
53
+    //   option:[
54
+    //     {label:'南京',value:'1'},
55
+    //     {label:'北京',value:'2'},
56
+    //   ]
57
+    // },
58
+    {
59
+      label: '意向项目',
60
+      name: 'buildingId',
61
+      render: <BuildSelect  />,
62
+      // onChange={e => handleBuildingChange(e)}
63
+      // value: dynamicData.buildingId,
64
+      rules: [{ required: true, message: '请选择所属项目' }],
65
+    },
66
+    {
67
+      label: '类型',
68
+      name: 'typesId',
69
+      value: dynamicData.buildingId,
70
+      option:[
71
+        {label:'买房准备',value:'1'},
72
+        {label:'看房选房',value:'2'},
73
+        {label:'认筹签约',value:'3'},
74
+      ]
75
+    },
76
+    {
77
+      label: '购房百科封面图',
78
+      name: 'newsImg',
79
+      type: FieldTypes.ImageUploader,
80
+      value: dynamicData.newsImg,
81
+      help: '建议尺寸:220px*176px,比例5:4,格式:jpg,用于:购房百科列表',
82
+      rules: [{ required: true, message: '请选择购房百科封面图' }],
83
+    },
84
+    {
85
+      label: '政策标题',
86
+      name: 'newsName',
87
+      type: FieldTypes.Text,
88
+      value: dynamicData.newsName,
89
+      rules: [{ required: true, message: '请输入政策标题' }],
90
+    },
91
+
92
+    {
93
+      label: '政策详情',
94
+      name: 'newsDetail',
95
+      render: <Wangedit />,
96
+      hidden: newsDetailType == 0,
97
+      value: dynamicData.newsDetail,
98
+      rules: [{ required: true, message: '请输入政策详情' }],
99
+    },
100
+      {
101
+      label: '状态',
102
+      name: 'newsTypeId',
103
+      option:[
104
+        {label:'已发布',value:'1'},
105
+        {label:'未发布',value:'2'},
106
+      ]
107
+    },
108
+  ];
109
+
110
+  // const handleSubmit = val => {
111
+  //   console.log(dynamicData, '12312345');
112
+  //   let { ...submitValue } = val;
113
+
114
+  //   if (newsId) {
115
+  //     submitValue.newsId = newsId;
116
+  //     request({ ...apis.news.put, urlData: { id: newsId }, data: { ...submitValue } })
117
+  //       .then(data => {
118
+  //         // cancelPage();
119
+  //         message.info('保存成功');
120
+  //         console.log(data, 'data1');
121
+  //       })
122
+  //       .catch(err => {
123
+  //         message.info(err.msg || err.message);
124
+  //       });
125
+  //   } else {
126
+  //     request({ ...apis.news.post, data: { ...submitValue } })
127
+  //       .then(data => {
128
+  //         // cancelPage();
129
+  //         message.info('保存成功');
130
+  //         router.go(-1);
131
+  //         console.log(data, 'data2');
132
+  //       })
133
+  //       .catch(err => {
134
+  //         message.info(err.msg || err.message);
135
+  //       });
136
+  //   }
137
+  // };
138
+
139
+  const cancelPage = () => {
140
+    router.go(-1);
141
+  };
142
+
143
+  return <XForm  onCancel={cancelPage} searchFields={searchFields} fields={fields}></XForm>;
144
+  // onSubmit={handleSubmit}
145
+  
146
+};
147
+
148
+export default Basic;

+ 37
- 0
src/pages/system/Sellhouse/houseTypes/Newindex.jsx Zobrazit soubor

@@ -0,0 +1,37 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Checkbox, Input, Card, Form, Button, Row, Col, Spin, message } from 'antd';
3
+import { connect } from 'dva';
4
+import XForm, { FieldTypes } from '@/components/XForm';
5
+import request from '@/utils/request';
6
+import router from 'umi/router';
7
+import apis from '@/services/apis';
8
+
9
+const { TextArea } = Input;
10
+
11
+const Backcom=()=>{
12
+  window.history.back(-1)
13
+}
14
+const Poster = props => {
15
+  const { getFieldDecorator } = props.form;
16
+  
17
+  return (
18
+    <Card>
19
+      <div>
20
+        <Form >
21
+          <Form.Item label="类型名称">
22
+            {getFieldDecorator('roleName', {})(<Input  style={{width:'500px'}} />)}
23
+
24
+          </Form.Item>
25
+            <Button  type="primary" htmlType="submit">
26
+              保存
27
+          </Button>
28
+            <Button style={{marginLeft:'20px'}} onClick={Backcom} >
29
+              取消
30
+          </Button>
31
+        </Form>
32
+      </div>
33
+    </Card>
34
+  )
35
+}
36
+const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
37
+export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);

+ 86
- 0
src/pages/system/Sellhouse/houseTypes/index.jsx Zobrazit soubor

@@ -0,0 +1,86 @@
1
+
2
+import React, { useState, useEffect } from 'react';
3
+import { Button, message, Table, Modal, Card } from 'antd';
4
+import withActions from '@/components/ActionList';
5
+import EditIcon from '@/components/EditIcon';
6
+import router from 'umi/router';
7
+import request from '@/utils/request'
8
+import apis from '@/services/apis';
9
+import AuthButton from '@/components/AuthButton';
10
+
11
+
12
+const header = props => {
13
+  function addRole(roleId) {
14
+    router.push({
15
+      pathname: '/system/Sellhouse/houseTypes/Newindex',
16
+    });
17
+  }
18
+  function stop(ids, status) {
19
+    Modal.confirm({
20
+      title: "确认要删除此条内容吗",
21
+      okText: '确认',
22
+      cancelText: '取消',
23
+      onOk() {
24
+        request({ ...apis.role.stop, urlData: { id: ids } }).then((data) => {
25
+          getRoleList({ pageNum: 1, pageSize: 100 })
26
+        }).catch((err) => {
27
+          console.log(err)
28
+          message.info(err.msg || err.message)
29
+        })
30
+      }
31
+    });
32
+  }
33
+
34
+  const columns = [
35
+    // {
36
+    //   title: '商品图片',
37
+    //   dataIndex: 'img',
38
+    //   key: 'img',
39
+    //   align: 'center',
40
+
41
+    //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
42
+    // },
43
+    {
44
+      title: '类型名称',
45
+      dataIndex: 'roleName',
46
+      key: 'roleName',
47
+      align: 'center',
48
+
49
+    },
50
+
51
+    {
52
+      title: '操作  ',
53
+      dataIndex: 'status',
54
+      key: 'status',
55
+      align: 'center',
56
+
57
+      render: withActions((text, record) => {
58
+        return record.isAdmin ? [] :
59
+          [
60
+            record.status === 1 ?
61
+            <AuthButton name="admin.role.publish" noRight={null}>
62
+              <EditIcon type="delete" text="删除" onClick={() => stop(record.roleId, record.status)} />
63
+            </AuthButton> : null,
64
+
65
+            <AuthButton name="admin.role.put" noRight={null}>
66
+              <EditIcon text="编辑" type="edit" onClick={() => toEditRole(record.roleId)} />
67
+            </AuthButton>,
68
+          ]
69
+      }),
70
+    },
71
+  ];
72
+
73
+
74
+  return (
75
+    <Card>
76
+      <AuthButton name="admin.role.add" noRight={null}>
77
+        <Button type="primary"  onClick={addRole}>新增</Button>
78
+      </AuthButton>
79
+      <div style={{marginTop:'20px'}}>
80
+        <Table rowKey="roleList"  columns={columns} />
81
+      </div>
82
+    </Card>
83
+
84
+  )
85
+}
86
+export default header

+ 259
- 0
src/pages/system/Sellhouse/index.jsx Zobrazit soubor

@@ -0,0 +1,259 @@
1
+import React, { useMemo, useRef, useCallback, useState } from 'react';
2
+// import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
+import { Button, notification, Spin, Modal, message } from 'antd';
4
+import { router } from 'umi';
5
+import QueryTable from '@/components/QueryTable';
6
+import request from '@/utils/request';
7
+import apis from '@/services/apis';
8
+import SelectCity from '@/components/SelectButton/CitySelect';
9
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect';
10
+import BuildSelect from '@/components/SelectButton/BuildSelect';
11
+import moment from 'moment';
12
+import OperButton from '@/components/OperButton';
13
+import AuthButton from '@/components/AuthButton';
14
+import withActions from '@/components/ActionList';
15
+import { number } from 'echarts/lib/export';
16
+
17
+export default props => {
18
+  const ref = useRef();
19
+  const [loading, setLoading] = useState(false);
20
+  const [page, setPage] = useState({ current: 1, pageSize: 10 });
21
+  const onPublish = useCallback(row => {
22
+    const buidingStatus = row.status === 1 ? 2 : 1;
23
+    request({ ...apis.building.updateStatus, data: { id: row.buildingId, status: buidingStatus } })
24
+      .then(() => {
25
+        notification.success({ message: '操作成功' });
26
+        setLoading(false);
27
+        ref.current.reload();
28
+      })
29
+      .catch(err => {
30
+        console.error(err);
31
+        setLoading(false);
32
+      });
33
+  }, []);
34
+
35
+  // 跳转到新增/编辑购房百科列表
36
+  const toEditList = newsId => {
37
+    router.push({
38
+      pathname: '/system/Sellhouse/Edit',
39
+      query: {
40
+        newsId,
41
+      },
42
+    });
43
+  };
44
+
45
+  const onDelete = useCallback(row => {
46
+    setLoading(true);
47
+    request({ ...apis.building.deleteBuilding, urlData: { id: row.buildingId } })
48
+      .then(() => {
49
+        notification.success({ message: '操作成功' });
50
+        setLoading(false);
51
+        ref.current.reload();
52
+      })
53
+      .catch(err => {
54
+        console.error(err);
55
+        setLoading(false);
56
+      });
57
+  }, []);
58
+
59
+  //   置顶
60
+  const topNews = (weightParam, newsId) => {
61
+    const weight = Math.abs(weightParam - 1);
62
+    request({ ...apis.news.weight, params: { newsId: newsId, weight } })
63
+      .then(data => {
64
+        console.log(data);
65
+        message.info('操作成功!');
66
+        ref.current.reload();
67
+      })
68
+      .catch(err => {
69
+        console.log(err);
70
+        message.info(err.msg || err.message);
71
+      });
72
+  };
73
+
74
+  //发布
75
+  function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
76
+    console.log('newsId' + newsId + 'status' + newsStatus);
77
+    if (newsStatus === 1) {
78
+      Modal.confirm({
79
+        title: '确认发布',
80
+        okText: '确认',
81
+        cancelText: '取消',
82
+        onOk() {
83
+          request({
84
+            ...apis.news.cancel,
85
+            data: { newsStatus: newsStatus, buildingId: buildingId, newsTypeId: newsTypeId },
86
+            urlData: { id: newsId },
87
+          })
88
+            .then(data => {
89
+              message.info('操作成功!');
90
+              ref.current.reload();
91
+            })
92
+            .catch(err => {
93
+              console.log(err);
94
+              message.info(err.msg || err.message);
95
+            });
96
+        },
97
+        onCancel() {
98
+          console.log('Cancel');
99
+        },
100
+      });
101
+    } else if (newsStatus === 0) {
102
+      Modal.confirm({
103
+        title: '确认发布该资讯?',
104
+        okText: '确认',
105
+        cancelText: '取消',
106
+        onOk() {
107
+          request({
108
+            ...apis.news.cancel,
109
+            data: { newsStatus: newsStatus, buildingId: buildingId, newsTypeId: newsTypeId },
110
+            urlData: { id: newsId },
111
+          })
112
+            .then(data => {
113
+              message.info('操作成功!');
114
+              ref.current.reload();
115
+            })
116
+            .catch(err => {
117
+              console.log(err);
118
+              message.info(err.msg || err.message);
119
+            });
120
+        },
121
+        onCancel() {
122
+          console.log('Cancel');
123
+        },
124
+      });
125
+    }
126
+  }
127
+
128
+  const searchFields = [
129
+    {
130
+      name:'cityId',
131
+      label:'城市',
132
+      placeholder:'请选择城市',
133
+      type:'select',
134
+      // defaultValue:1,
135
+      options:[
136
+      {label:'南京',value:'1'},
137
+      {label:'北京',value:'2'},
138
+      {label:'上海',value:'3'},
139
+      ]
140
+
141
+    },
142
+    // {
143
+    //   name: 'cityId',
144
+    //   label: '城市',
145
+    //   placeholder: '请选择城市',
146
+    //   render: () => <SelectCity style={{ width: 160 }} />,
147
+    // },
148
+  ];
149
+
150
+  const tableColumns = [
151
+    {
152
+      title: '购房政策主图',
153
+      key: 'houseImg',
154
+      //newsImg
155
+      dataIndex: 'houseImg',
156
+      align: 'center',
157
+      // render: t => <img src={t} width={128} height={72} style={{ borderRadius: '4px' }} alt="" />,
158
+    },
159
+    {
160
+      title: '标题',
161
+      key: 'huoseName',
162
+      dataIndex: 'huoseName',
163
+      align: 'center',
164
+      with: 300,
165
+      // ellipsis: true,
166
+      render:(_,record)=><span>{record.houseName='高奢生活,在遇到它之前你想象不到'}</span>
167
+    },
168
+    {
169
+      title: '城市',
170
+      key: 'houseType',
171
+      dataIndex: 'houseType',
172
+      align: 'center',
173
+      // render: t => t.newsTypeName,
174
+      render:(_,record)=><span>{record.houseType='南京'}</span>
175
+
176
+    },
177
+    {
178
+      title: '创建时间',
179
+      dataIndex: 'createDate',
180
+      key: 'createDate',
181
+      align: 'center',
182
+      render: t => moment(t).format('YYYY-MM-DD HH:mm'),
183
+    },
184
+    {
185
+      title: '状态',
186
+      dataIndex: 'newsStatus',
187
+      key: 'newsStatus',
188
+      align: 'center',
189
+      render: t => (t == 0 ? '已发布' : '未发布'),
190
+    },
191
+
192
+    {
193
+      title: '操作',
194
+      key: 'options',
195
+      align: 'center',
196
+      render: withActions(
197
+        (_, row) => [
198
+          <AuthButton name="admin.taNews.publish" noRight={null}>
199
+            <OperButton
200
+              onClick={() =>
201
+                cancelRelease(
202
+                  row.newsId,
203
+                  row.newsStatus === 0 ? 1 : 0,
204
+                  row.buildingId,
205
+                  row.newsType.newsTypeId,
206
+                )
207
+              }
208
+            >
209
+              {row.newsStatus === 0 ? '取消发布' : '发布'}
210
+            </OperButton>
211
+          </AuthButton>,
212
+          //   <AuthButton name="admin.taNews.top" noRight={null}>
213
+          //   <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{data.weight === 1 ? '取消置顶' : '置顶'}</span>
214
+          // </AuthButton>
215
+          row.newsStatus === 0 && (
216
+            <AuthButton name="admin.taNews.top" noRight={null}>
217
+              <OperButton onClick={() => topNews(row.weight, row.newsId)}>
218
+                {row.weight === 1 ? '取消置顶' : '置顶'}
219
+              </OperButton>
220
+            </AuthButton>
221
+          ),
222
+
223
+          <AuthButton name="admin.taNews.id.put" noRight={null}>
224
+            <OperButton onClick={() => toEditList(row.newsId)}>编辑</OperButton>
225
+          </AuthButton>,
226
+
227
+          <AuthButton name="admin.taNews.id.delete" noRight={null}>
228
+            <OperButton.Confirm
229
+              title="确认删除?"
230
+              content="删除之后不可恢复"
231
+              onClick={() => onDelete(row)}
232
+            >
233
+              删除
234
+            </OperButton.Confirm>
235
+          </AuthButton>,
236
+        ],
237
+        { noMargin: true },
238
+      ),
239
+    },
240
+  ];
241
+  const actionRender = () => {
242
+    return (
243
+      <Button type="primary" icon="plus" onClick={() => toEditList()}>
244
+        新增
245
+      </Button>
246
+    );
247
+  };
248
+
249
+  return (
250
+    <QueryTable
251
+      ref={ref}
252
+      rowKey="newsId"
253
+      api={apis.news.getList}
254
+      searchFields={searchFields}
255
+      columns={tableColumns}
256
+      actionRender={actionRender}
257
+    />
258
+  );
259
+};

+ 119
- 0
src/pages/system/Sellhouse/style.less Zobrazit soubor

@@ -0,0 +1,119 @@
1
+.SubmitButton {
2
+    background: #3a91d5;
3
+    border-radius: 7px;
4
+    border: 0px;
5
+  }
6
+  .SelectFrom {
7
+    width: 180px;
8
+    background: #ffffff;
9
+    border-radius: 7px;
10
+    border: 1px solid #dbdbdb;
11
+  }
12
+  .addButton {
13
+    background: #50be00;
14
+    border-radius: 4px;
15
+    border: 0px;
16
+    margin: 10px 0px;
17
+  }
18
+  .cardText {
19
+    color: #333;
20
+    display: flex;
21
+    align-items: center;
22
+    position: relative;
23
+    line-height: 1.5;
24
+    font-size: 0.106rem;
25
+    margin-bottom: 0.08rem;
26
+  
27
+  }
28
+  .cardItem{
29
+    color: #666;
30
+    display: flex;
31
+    align-items: center;  
32
+    line-height: 1.5;
33
+    font-size: 0.106rem;
34
+    margin-bottom: 0.08rem;
35
+  }
36
+  .ediText {
37
+    font-size: 0.106rem;
38
+    color: #ff925c;
39
+    line-height: 24px;
40
+    position: absolute;
41
+    right: 0;
42
+  }
43
+  .title{
44
+    display: inline-block;
45
+    width:  0.54rem;
46
+    justify-content: space-between;
47
+    text-align: justify;
48
+    text-align-last:justify
49
+  }
50
+  
51
+  .address { 
52
+    width: 400px;
53
+    height: 24px; 
54
+    text-overflow: ellipsis; 
55
+    white-space: nowrap;
56
+    overflow: hidden;
57
+  }
58
+
59
+  .SubmitButton {
60
+    background: rgba(239,39,58,1);
61
+    border-radius: 7px;
62
+    border: 0px;
63
+  }
64
+  .SelectFrom {
65
+    width: 180px;
66
+    background: #ffffff;
67
+    border-radius: 7px;
68
+    border: 1px solid #dbdbdb;
69
+  }
70
+  .addButton {
71
+    background: #50be00;
72
+    border-radius: 4px;
73
+    border: 0px;
74
+    margin: 10px 0px;
75
+  }
76
+  .cardText {
77
+    color: #333;
78
+    display: flex;
79
+    align-items: center;
80
+    position: relative;
81
+    line-height: 1.5;
82
+    font-size: 0.106rem;
83
+    margin-bottom: 0.08rem;
84
+  
85
+  }
86
+  .cardItem{
87
+    font-size: 0.106rem;
88
+    font-weight: 400;
89
+    color: #666;
90
+    line-height: 24px;
91
+    display: flex;
92
+    align-items: center;  
93
+  }
94
+  .ediText {
95
+    font-size:  0.106rem;
96
+    color: #ff925c;
97
+    line-height: 24px;
98
+    position: absolute;
99
+    right: 0;
100
+  }
101
+  .title{
102
+    display: inline-block;
103
+    width:  0.54rem;
104
+    justify-content: space-between;
105
+    text-align: justify;
106
+    text-align-last:justify
107
+  }
108
+  
109
+  .address { 
110
+    width: 400px;
111
+    height: 24px; 
112
+    text-overflow: ellipsis; 
113
+    white-space: nowrap;
114
+    overflow: hidden;
115
+  }
116
+  
117
+  
118
+  
119
+  

+ 1
- 0
src/pages/user/login/index.jsx Zobrazit soubor

@@ -5,6 +5,7 @@ import { connect } from 'dva';
5 5
 import md5 from "md5";
6 6
 import LoginComponents from './components/Login';
7 7
 import styles from './style.less';
8
+import { defineLocale } from 'moment';
8 9
 
9 10
 const { UserName, Password, Submit } = LoginComponents;
10 11
 

+ 44
- 0
src/services/apis.js Zobrazit soubor

@@ -208,6 +208,17 @@ export default {
208 208
       action: 'admin.taNewsType.get',
209 209
     }
210 210
   },
211
+  //预加 帮我找房
212
+  homeload: {
213
+    houseSchr:{
214
+      method: 'GET',
215
+      url: `${prefix}/home/Recommend/searchHouse`,
216
+      action: 'admin.home.Recommend.searchHouse.get',
217
+      // action: 'admin.customer.recommend.recommender.get',
218
+
219
+    }
220
+  },
221
+
211 222
   customer: {
212 223
     drift: {
213 224
       method: 'GET',
@@ -299,6 +310,13 @@ export default {
299 310
       url: `${prefix}/customer/recommend/recommender/export`,
300 311
       action: 'admin.customer.recommend.recommender.export.get',
301 312
     },
313
+
314
+    // //recommender
315
+    // homeRecommendrecommenderExport: { // 导出数据(home   推荐客户 预加)
316
+    //   method: 'GET',
317
+    //   url: `${prefix}/home/recommend/recommender/export`,
318
+    //   action: 'admin.home.recommend.recommender.export.get',
319
+    // },
302 320
     customerRecommendReportExport: { // 导出数据(报备客户)
303 321
       method: 'GET',
304 322
       url: `${prefix}/customer/recommend/report/export`,
@@ -712,6 +730,32 @@ export default {
712 730
       action: 'admin.taCustomImg.id.get',
713 731
     },
714 732
   },
733
+  //Course+
734
+  course:{
735
+  Tablecourse:{
736
+    method:'GET',
737
+    url:`${prefix}/curriculum`,
738
+    action: 'admin.curriculum.get',
739
+  },
740
+    searchCourse:{
741
+      method:'GET',
742
+      url:`${prefix}/curriculum/:id`,
743
+      // action:'admin.curriculum.id.get'
744
+      action: 'admin.taCustomImg.id.get',
745
+    },
746
+    addCourse:{
747
+      method:'POST',
748
+      // POST /api/admin/curriculum
749
+      url:`${prefix}/curriculum`,
750
+      action:'admin.curriculum.post',
751
+    },
752
+    //修改
753
+    alterCourse:{
754
+      method:'PUT',
755
+      url:`${prefix}/curriculum/:id`,
756
+      action:'admin.curriculum.id.put'
757
+    }
758
+  },
715 759
   system: {
716 760
     taPolicy: {
717 761
       url: `${prefix}/taPolicy/:id`,

+ 1
- 1
src/utils/request.js Zobrazit soubor

@@ -56,7 +56,7 @@ request.interceptors.request.use((url, options) => {
56 56
         },
57 57
         data,
58 58
         requestType: data instanceof FormData ? 'form' : 'json',
59
-        credentials: 'include', // 带 cookie
59
+        // credentials: 'include', // 带 cookie/s
60 60
         interceptors: true,
61 61
         getResponse: true,
62 62
       },