Sfoglia il codice sorgente

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

魏熙美 5 anni fa
parent
commit
d7026ed40d

+ 16
- 1
config/config.js Vedi File

@@ -375,6 +375,21 @@ export default {
375 375
                   name: '报表数据',
376 376
                   component: './system/report',
377 377
                 },
378
+                {
379
+                  path: '/system/intention',
380
+                  name: '意向值',
381
+                  component: './system/intention',
382
+                },
383
+                {
384
+                  path: '/system/housingPolicy',
385
+                  name: '购房政策维护',
386
+                  component: './system/housingPolicy',
387
+                },
388
+                {
389
+                  path: '/system/editPolicy',
390
+                  name: '',
391
+                  component: './system/editPolicy',
392
+                },
378 393
               ],
379 394
             },
380 395
             {
@@ -440,7 +455,7 @@ export default {
440 455
 
441 456
   proxy: {
442 457
     '/api/': {
443
-      target: 'http://127.0.0.1:8080/',
458
+      target: 'http://192.168.0.84:8080/',
444 459
       changeOrigin: true,
445 460
       // pathRewrite: { '^/server': '' },
446 461
     },

BIN
src/assets/bottom.png Vedi File


BIN
src/assets/yinhao.png Vedi File


+ 1
- 1
src/components/SelectButton/NewTypeSelect.jsx Vedi File

@@ -29,7 +29,7 @@ const NewsTypeSelect = (props) => {
29 29
   }
30 30
 
31 31
   return (
32
-      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择咨询类型" onChange={props.onChange}>
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择类型" onChange={props.onChange}>
33 33
           {data.map(type => (
34 34
             <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35 35
           ))}

+ 111
- 39
src/pages/activity/editActivity.jsx Vedi File

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
@@ -8,37 +8,42 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10 10
 import request from '../../utils/request'
11
+import PosterBottom from '../../assets/bottom.png'
12
+import yinhao from '../../assets/yinhao.png'
13
+import ImageUploader from '../../components/XForm/ImageUpload';
14
+import logo from '../../assets/logo.png';
11 15
 
12 16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
13 18
 /**
14 19
  *
15 20
  *
16 21
  * @param {*} props
17 22
  * @returns
18 23
  */
19
- const Edit = (props) => {
20
-  const [ tab, changeTab ] = useState('basic')
24
+const Edit = (props) => {
25
+  const [tab, changeTab] = useState('basic')
21 26
   const dynamicId = props.location.query.dynamicId
22
-  const [ dynamicData, setDynamicData ] = useState({})
23
-  if(dynamicId){
27
+  const [dynamicData, setDynamicData] = useState({})
28
+  if (dynamicId) {
24 29
     useEffect(() => {
25 30
       getDynamicData(dynamicId);
26
-    },[])
31
+    }, [])
27 32
 
28
-  // 查询列表
29
-  const getDynamicData = (dynamicId) => {
30
-    request({
33
+    // 查询列表
34
+    const getDynamicData = (dynamicId) => {
35
+      request({
31 36
         url: '/api/admin/buildingDynamic/Details',
32 37
         method: 'GET',
33 38
         params: { dynamicId },
34
-    }).then((data) => {
39
+      }).then((data) => {
35 40
         console.log(data)
36 41
         setDynamicData(data)
37
-    })
38
-  }
42
+      })
43
+    }
39 44
   }
40 45
 
41
-  const cancelPage = () =>{
46
+  const cancelPage = () => {
42 47
     router.push({
43 48
       pathname: '/activity/ActivityList',
44 49
     });
@@ -52,7 +57,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
52 57
         render: <BuildSelect />,
53 58
         value: dynamicData.buildingId,
54 59
         rules: [
55
-          {required: true, message: '请选择所属项目'},
60
+          { required: true, message: '请选择所属项目' },
56 61
         ]
57 62
       },
58 63
       {
@@ -67,16 +72,16 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
67 72
         type: FieldTypes.Text,
68 73
         value: dynamicData.title,
69 74
         rules: [
70
-          {required: true, message: '请输入活动标题'},
75
+          { required: true, message: '请输入活动标题' },
71 76
         ]
72 77
       },
73 78
       {
74 79
         label: '活动时间',
75 80
         name: 'activityTime',
76 81
         type: FieldTypes.RangePicker,
77
-        value: dynamicData.startDate != null ?  [moment(dynamicData.startDate,'YYYY-MM-DD'),moment(dynamicData.endDate,'YYYY-MM-DD')] : null,
82
+        value: dynamicData.startDate != null ? [moment(dynamicData.startDate, 'YYYY-MM-DD'), moment(dynamicData.endDate, 'YYYY-MM-DD')] : null,
78 83
         rules: [
79
-          {required: true, message: '请选择活动时间'},
84
+          { required: true, message: '请选择活动时间' },
80 85
         ]
81 86
       },
82 87
       {
@@ -85,7 +90,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
85 90
         type: FieldTypes.Text,
86 91
         value: dynamicData.address,
87 92
         rules: [
88
-          {required: true, message: '请输入活动地点'},
93
+          { required: true, message: '请输入活动地点' },
89 94
         ]
90 95
       },
91 96
       {
@@ -94,7 +99,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
94 99
         type: FieldTypes.Text,
95 100
         value: dynamicData.enlistNum,
96 101
         rules: [
97
-          {required: true, message: '请输入活动人数'},
102
+          { required: true, message: '请输入活动人数' },
98 103
         ]
99 104
       },
100 105
       {
@@ -107,24 +112,24 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
107 112
         label: '是否需要报名',
108 113
         name: 'isEnlist',
109 114
         render: <Radio.Group name="radiogroup">
110
-                  <Radio value={1}>是</Radio>
111
-                  <Radio value={0}>否</Radio>
112
-                </Radio.Group>,
113
-        value: dynamicData.isEnlist != null ? dynamicData.isEnlist-0 : 1,
115
+          <Radio value={1}>是</Radio>
116
+          <Radio value={0}>否</Radio>
117
+        </Radio.Group>,
118
+        value: dynamicData.isEnlist != null ? dynamicData.isEnlist - 0 : 1,
114 119
       },
115 120
       {
116 121
         label: '报名时间',
117 122
         name: 'signupTime',
118 123
         type: FieldTypes.RangePicker,
119
-        value: dynamicData.enlistStart != null ?  [moment(dynamicData.enlistStart,'YYYY-MM-DD'),moment(dynamicData.enlistEnd,'YYYY-MM-DD')] : null,
124
+        value: dynamicData.enlistStart != null ? [moment(dynamicData.enlistStart, 'YYYY-MM-DD'), moment(dynamicData.enlistEnd, 'YYYY-MM-DD')] : null,
120 125
         rules: [
121
-          {required: true, message: '请选择报名时间'},
126
+          { required: true, message: '请选择报名时间' },
122 127
         ]
123 128
       },
124 129
     ]
125
-  
126
-    const handleSubmit = val => { 
127
-      let {activityTime,signupTime, ...submitValue} = val
130
+
131
+    const handleSubmit = val => {
132
+      let { activityTime, signupTime, ...submitValue } = val
128 133
       const [startDate, endDate] = activityTime
129 134
       submitValue.startDate = moment(startDate).format('YYYY-MM-DD');
130 135
       submitValue.endDate = moment(endDate).format('YYYY-MM-DD');
@@ -132,7 +137,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
132 137
       submitValue.enlistStart = moment(enlistStart).format('YYYY-MM-DD');
133 138
       submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD');
134 139
       console.log('submit data --->', submitValue)
135
-      if(dynamicId){
140
+      if (dynamicId) {
136 141
         submitValue.dynamicId = dynamicId
137 142
         request({
138 143
           url: '/api/admin/buildingDynamic/update',
@@ -143,7 +148,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
143 148
         }).catch((err) => {
144 149
           message.info(err.msg || err.message)
145 150
         })
146
-      }else{
151
+      } else {
147 152
         request({
148 153
           url: '/api/admin/buildingDynamic/add',
149 154
           method: 'POST',
@@ -155,16 +160,83 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
155 160
         })
156 161
       }
157 162
     }
158
-    
163
+
159 164
     return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
160 165
   }
161
-  
166
+
162 167
   const Poster = (props) => {
163
-   return <div>Poster</div>
168
+
169
+    return <div style={{ display: 'flex' }}>
170
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
171
+        <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
172
+
173
+          <img style={{ width: '100%', height: '300px' }} src="http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg" alt="" />
174
+
175
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
176
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src="http://img0.imgtn.bdimg.com/it/u=3463541938,2540701974&fm=26&gp=0.jpg" alt="" />
177
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
178
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您阅读</span>
179
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
180
+          </div>
181
+          <p style={{
182
+            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
183
+            display: '-webkit-box', lineClamp: '3', height: '60px',
184
+            WebkitLineClamp: '2',
185
+            WebkitBoxOrient: 'vertical',
186
+            overflow: 'hidden',
187
+            textOverflow: 'ellipsis'
188
+          }}>破晓·内容生态下半场的版权到企业高峰论坛会议破晓·内容生态下半场的版权到企业高峰论坛活动</p>
189
+
190
+          <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
191
+          <p style={{
192
+            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
193
+            display: '-webkit-box', lineClamp: '3', height: '76px',
194
+            WebkitLineClamp: '3',
195
+            WebkitBoxOrient: 'vertical',
196
+            overflow: 'hidden',
197
+            textOverflow: 'ellipsis'
198
+          }}>活动描述:破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动</p>
199
+          <img src={PosterBottom} style={{ width: '100%' }} alt="" />
200
+        </div>
201
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
202
+      </div>
203
+      <div></div>
204
+    </div>
164 205
   }
165
- 
206
+
166 207
   const Share = (props) => {
167
-    return <div>Share</div>
208
+    const fields = [
209
+      {
210
+        label: '分享模板',
211
+        name: 'buildingId',
212
+        render: () => <div style={{ margin: ' 10px 20px' }}>
213
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
214
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>置业V客厅 精准获客平台</p>
215
+          <img style={{ width: '200px', height: '140px' }} src="http://house.china.com.cn/nanjing/UserFiles/20171124/11070256.jpg" alt="" />
216
+        </div>,
217
+      },
218
+      {
219
+        label: '海报标题',
220
+        name: 'newsTypeName',
221
+        type: FieldTypes.Text,
222
+        value: '',
223
+        rules: [
224
+          { required: true, message: '请输入咨询名称' },
225
+        ]
226
+      },
227
+      {
228
+        label: '类型图',
229
+        name: 'newsTypeImg',
230
+        type: FieldTypes.ImageUploader,
231
+        value: 'newsTypeImg',
232
+      },
233
+    ]
234
+    const handleSubmit = (values) => {
235
+
236
+    }
237
+    return <div>
238
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
239
+    </div>
168 240
   }
169 241
 
170 242
   return (
@@ -177,13 +249,13 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
177 249
         </Radio.Group>
178 250
       </div>
179 251
       <div>
180
-        { tab === 'basic' && <Basic /> }
181
-        { tab === 'poster' && <Poster /> }
182
-        { tab === 'share' && <Share /> }
252
+        {tab === 'basic' && <Basic />}
253
+        {tab === 'poster' && <Poster />}
254
+        {tab === 'share' && <Share />}
183 255
       </div>
184 256
     </div>
185 257
   );
186
- }
258
+}
187 259
 
188 260
 
189 261
 

+ 1
- 0
src/pages/channel/InviteClients.jsx Vedi File

@@ -37,6 +37,7 @@ const columns = [
37 37
     dataIndex: 'sex',
38 38
     key: 'sex',
39 39
     align: 'center',
40
+    render: (text, record) => <a style={ { color: '#66B3FF' } } >{ record.sex === 1 ? '男' : '女' }</a>,
40 41
   },
41 42
 ];
42 43
 const header = props => {

+ 2
- 2
src/pages/channel/brokerList.jsx Vedi File

@@ -155,7 +155,7 @@ const header = props => {
155 155
 return (
156 156
   <>
157 157
     <div className={ channels.searchBox }>
158
-      <div>
158
+      <div style = {{ marginLeft: '-5px' }}>
159 159
         <span className={ channels.selectName }>姓名</span>
160 160
         <Input onChange = { onInputChangePhone } style ={{ width: 150 }} />
161 161
         <span className={ channels.selectName }>电话</span>
@@ -163,7 +163,7 @@ return (
163 163
       </div>
164 164
       <div>
165 165
       <Button type="primary" onClick={() => queryList() }>查询</Button>
166
-      <Button onClick={() => refurbishList() }>重置</Button>
166
+      {/* <Button onClick={() => refurbishList() }>重置</Button> */}
167 167
     </div>
168 168
     </div>
169 169
     <Table dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />

+ 2
- 2
src/pages/channel/channelList.jsx Vedi File

@@ -168,10 +168,10 @@ const header = props => {
168 168
         </dvi>
169 169
         <div >
170 170
         <Button type="primary" onClick={() => queryList() }>查询</Button>
171
-        <Button onClick={() => reset() }>重置</Button>
171
+        {/* <Button onClick={() => reset() }>重置</Button> */}
172 172
         </div>
173 173
       </div>
174
-      <Button type="danger" onClick={toAdd}>新增</Button>
174
+      <Button type="danger" onClick={toAdd} className={channels.about} >新增</Button>
175 175
       <Table dataSource={data.result.records} columns={columns} pagination={{ pageSize: 10, total: data.result.total, onChange }} />
176 176
   </>
177 177
   )

+ 7
- 3
src/pages/channel/channelList.less Vedi File

@@ -32,13 +32,12 @@
32 32
 .about {
33 33
   padding: 0 30px;
34 34
   height: 36px;
35
-  background-color:rgba(255,255,255,1);
36
-  color: #fff;
37 35
   margin: 30px 0;
36
+  margin-left:8px;
38 37
 }
39 38
 
40 39
 .selectName {
41
-  font-size: 17px;
40
+  font-size: 14px;
42 41
   padding: 0 10px;
43 42
   height: 36px;
44 43
   color: rgb(10, 10, 10);
@@ -62,3 +61,8 @@
62 61
   float: 'left'; 
63 62
   width: 500
64 63
 }
64
+.brokerTable{
65
+  padding: 0 30px;
66
+  height: 36px;
67
+  margin: 30px 0;
68
+}

+ 1
- 0
src/pages/channel/recommendClients.jsx Vedi File

@@ -70,6 +70,7 @@ const columns = [
70 70
     dataIndex: 'sex',
71 71
     key: 'sex',
72 72
     align: 'center',
73
+    render: (text, record) => <a style={ { color: '#66B3FF' } } >{ record.sex === 1 ? '男' : '女' }</a>,
73 74
   },
74 75
   {
75 76
     title: '意向项目',

+ 1
- 1
src/pages/customer/independentList/index.jsx Vedi File

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';

+ 135
- 143
src/pages/news/list/NewsList.jsx Vedi File

@@ -63,7 +63,7 @@ function body(props) {
63 63
   }
64 64
 
65 65
   // 跳转到编辑资讯列表
66
-  const toEditList = (id) => ()  => {
66
+  const toEditList = (id) => () => {
67 67
     router.push({
68 68
       pathname: '/news/list/editNewsList',
69 69
       query: {
@@ -74,153 +74,145 @@ function body(props) {
74 74
 
75 75
 
76 76
 
77
-/**
78
- *卡片
79
- *
80
- * @returns
81
- */
82
-function CartBody(props) {
83
-  const { data } = props
84
-  console.log(data);
85
-  const cancelPage = () =>{
86
-    router.push({
87
-      pathname: '/news/list/NewsList',
88
-    });
89
-  }
90
-
91
-  //删除资讯
92
-  const changeNewsListStatus = (newsId) => () => {
93
-    Modal.confirm({
94
-      title: '确认删除该资讯?',
95
-      okText: '确认',
96
-      cancelText: '取消',
97
-      onOk() {
98
-        request({
99
-          url: '/api/admin/taNews/' + newsId,
100
-          method: 'DELETE',
101
-          // data: { ...row },
102
-        }).then((data) => {
103
-          message.info('操作成功!')
104
-          getList({ pageNum: 1, pageSize: 10 });
105
-        })
106
-      }
107
-    });
108
-  }
109
-
110
-  // 跳转到编辑资讯列表
111
-  const toEditList = (newsId) => ()  => {
112
-    router.push({
113
-      pathname: '/news/list/editNewsList',
114
-      query: {
115
-        newsId
116
-      },
117
-    });
118
-  } 
77
+  /**
78
+   *卡片
79
+   *
80
+   * @returns
81
+   */
82
+  function CartBody(props) {
83
+    const { data } = props
84
+    console.log(data);
85
+    const cancelPage = () => {
86
+      router.push({
87
+        pathname: '/news/list/NewsList',
88
+      });
89
+    }
119 90
 
120
-  function cancelRelease (newsId, newsStatus, buildingId,newsTypeId) {
121
-    console.log("newsId" + newsId + "status" + newsStatus);
122
-    if (newsStatus === 1){
91
+    //删除资讯
92
+    const changeNewsListStatus = (newsId) => () => {
123 93
       Modal.confirm({
124
-        title: '确认取消该资讯?',
94
+        title: '确认删除该资讯?',
125 95
         okText: '确认',
126 96
         cancelText: '取消',
127
-        onOk () {
97
+        onOk() {
128 98
           request({
129 99
             url: '/api/admin/taNews/' + newsId,
130
-            method: 'PUT',
131
-            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
100
+            method: 'DELETE',
101
+            // data: { ...row },
132 102
           }).then((data) => {
133 103
             message.info('操作成功!')
134 104
             getList({ pageNum: 1, pageSize: 10 });
135 105
           })
136
-        },
137
-        onCancel () {
138
-          console.log('Cancel');
139
-        },
106
+        }
140 107
       });
141
-    }else if (newsStatus === 0){
142
-      Modal.confirm({
143
-        title: '确认发布该资讯?',
144
-        okText: '确认',
145
-        cancelText: '取消',
146
-        onOk () {
147
-          request({
148
-            url: '/api/admin/taNews/' + newsId,
149
-            method: 'PUT',
150
-            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
151
-          }).then((data) => {
152
-            message.info('操作成功!')
153
-            getList({ pageNum: 1, pageSize: 10 });
154
-          })
155
-        },
156
-        onCancel () {
157
-          console.log('Cancel');
108
+    }
109
+
110
+    // 跳转到编辑资讯列表
111
+    const toEditList = (newsId) => () => {
112
+      router.push({
113
+        pathname: '/news/list/editNewsList',
114
+        query: {
115
+          newsId
158 116
         },
159 117
       });
160
-    }  
161
-  }
118
+    }
162 119
 
163
-  return (
164
-          <Card
165
-            hoverable
166
-            style={{ minWidth: '400px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
167
-            cover={<img alt="example" src={ data.newsImg } style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
168
-            bodyStyle={{ padding: '10px 20px' }}
169
-          >
170
-            <p className={Styles.cardText}>
171
-              <span className={Styles.title}>资讯类型</span>
172
-              <span >:{ data.newsType.newsTypeName }</span>
173
-              <span className={Styles.ediText} onClick={toEditList(data.newsId)}>
174
-                编辑
120
+    function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
121
+      console.log("newsId" + newsId + "status" + newsStatus);
122
+      if (newsStatus === 1) {
123
+        Modal.confirm({
124
+          title: '确认取消该资讯?',
125
+          okText: '确认',
126
+          cancelText: '取消',
127
+          onOk() {
128
+            request({
129
+              url: '/api/admin/taNews/' + newsId,
130
+              method: 'PUT',
131
+              data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId },
132
+            }).then((data) => {
133
+              message.info('操作成功!')
134
+              getList({ pageNum: 1, pageSize: 10 });
135
+            })
136
+          },
137
+          onCancel() {
138
+            console.log('Cancel');
139
+          },
140
+        });
141
+      } else if (newsStatus === 0) {
142
+        Modal.confirm({
143
+          title: '确认发布该资讯?',
144
+          okText: '确认',
145
+          cancelText: '取消',
146
+          onOk() {
147
+            request({
148
+              url: '/api/admin/taNews/' + newsId,
149
+              method: 'PUT',
150
+              data: { "newsStatus": newsStatus, "buildingId": buildingId, "newsTypeId": newsTypeId },
151
+            }).then((data) => {
152
+              message.info('操作成功!')
153
+              getList({ pageNum: 1, pageSize: 10 });
154
+            })
155
+          },
156
+          onCancel() {
157
+            console.log('Cancel');
158
+          },
159
+        });
160
+      }
161
+    }
162
+
163
+    return (
164
+      <Card
165
+        hoverable
166
+        style={{ height: '255px', minWidth: '640px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', position: 'relative' }}
167
+        cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '260px', height: '253px' }}></img>}
168
+        bodyStyle={{ padding: '10px 20px' }}
169
+      >
170
+        <span style={{ position: 'absolute', right: '20px', top: '20px', fontSize: '18px', color: '#FF7E48' }} onClick={toEditList(data.newsId)}>
171
+          编辑
175 172
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
176
-              </span>
177
-            </p>
178
-            <p className={Styles.cardText}>
179
-              <span className={Styles.title}>状态</span>
180
-              <span >:{ data.newsStatus == 0 ? "已发布" : "未发布" }</span>
181
-            </p>
182
-            <p className={Styles.cardItem}>
183
-              <span className={Styles.title}>阅读数量</span>
184
-              <span > :{ data.pvNum }</span>
185
-            </p>
186
-            <p className={Styles.cardItem}>
187
-              <span className={Styles.title}>转发数量</span>
188
-              <span>:{ data.shareNum }</span>
189
-            </p>
190
-            <p className={Styles.cardItem}>
191
-              <span className={Styles.title}>点赞数量</span>     
192
-              <span >:{ data.favorNum }</span>         
193
-            </p>
194
-            <p className={Styles.cardItem}>
195
-              <span className={Styles.title}>收藏数量</span>
196
-              <span >:{ data.saveNum }</span>
197
-            </p>
198
-            <p className={Styles.cardItem}>
199
-              <span className={Styles.title}>录入时间</span>
200
-              <span >:{ data.createDate }</span>
201
-            </p>
202
-            <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
203
-              {data.newsStatus === 0 ? 
204
-              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
205
-              取消发布
173
+        </span>
174
+        {data.newsStatus === 0 ?
175
+          <span style={{ position: 'absolute', left: '280px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={cancelRelease.bind(this, data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
176
+            取消发布
206 177
               <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
207
-              </span>:
208
-              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
209
-              发布
178
+          </span> :
179
+          <span style={{ position: 'absolute', left: '280px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={cancelRelease.bind(this, data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
180
+            发布
210 181
               <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
211
-              </span>
212
-              }
213
-              
214
-              <span style={{
215
-                color: '#FF4A4A', position: 'absolute', right: '0',
216
-              }} onClick={changeNewsListStatus(data.newsId)}>
217
-                删除
182
+          </span>
183
+        }
184
+
185
+        <span style={{ position: 'absolute', right: '20px', bottom: '18px', fontSize: '18px', color: '#FF7E48' }} onClick={changeNewsListStatus(data.newsId)}>
186
+          删除
218 187
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
219
-              </span>
220
-            </p>
221
-          </Card>
222
-  )
223
-}
188
+        </span>
189
+        <div style={{ position: 'absolute', left: '260px', top: '0px', padding: '20px' }}>
190
+          <p style={{
191
+            fontSize: '18px', color: '#333', fontWeight: '600', marginBottom: '10px', overflow: 'hidden',
192
+            textOverflow: 'ellipsis',
193
+            whiteSpace: 'nowrap',
194
+            width: '300px',
195
+          }}>{data.newsName}</p>
196
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
197
+            <span style={{ display: 'inline-block', width: '190px' }}>咨询类型:{data.newsType.newsTypeName}</span>
198
+            <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
199
+          </p>
200
+
201
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
202
+            <span style={{ display: 'inline-block', width: '190px' }}>阅读数量:{data.pvNum}</span>
203
+            <span>转发数量:{data.shareNum}</span>
204
+          </p>
205
+
206
+          <p style={{ fontSize: '18px', color: '#555', marginBottom: '10px' }}>
207
+            <span style={{ display: 'inline-block', width: '190px' }}>点赞数量:{data.favorNum}</span>
208
+            <span>收藏数量:{data.saveNum}</span>
209
+          </p>
210
+
211
+          <p style={{ fontSize: '18px', color: '#999', marginBottom: '10px' }}>发布时间:{data.createDate}</p>
212
+        </div>
213
+      </Card>
214
+    )
215
+  }
224 216
 
225 217
 
226 218
   // Change 事件
@@ -232,7 +224,7 @@ function CartBody(props) {
232 224
   // 分页
233 225
   function onChange(pageNumber) {
234 226
     // eslint-disable-next-line react-hooks/rules-of-hooks
235
-      getList({ pageNum: pageNumber, pageSize: 6 })
227
+    getList({ pageNum: pageNumber, pageSize: 6 })
236 228
   }
237 229
 
238 230
   function getDate(value, dateString) {
@@ -246,27 +238,27 @@ function CartBody(props) {
246 238
 
247 239
         <Form.Item>
248 240
           {getFieldDecorator('cityId')(
249
-            <SelectCity />,  
241
+            <SelectCity />,
250 242
           )}
251 243
         </Form.Item>
252 244
         <Form.Item>
253 245
           {getFieldDecorator('buildingId')(
254
-              <BuildSelect />,
255
-            )}
246
+            <BuildSelect />,
247
+          )}
256 248
         </Form.Item>
257
-        <Form.Item>
249
+        {/* <Form.Item>
258 250
           {getFieldDecorator('title')(
259 251
             <Input
260 252
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
261 253
               placeholder="请输入标题"
262 254
             />,
263 255
           )}
264
-        </Form.Item>
256
+        </Form.Item> */}
265 257
         <Form.Item>
266 258
           {getFieldDecorator('newsTypeId')(
267 259
             <NewsTypeSelect />,
268 260
           )}
269
-        </Form.Item>       
261
+        </Form.Item>
270 262
         <Form.Item>
271 263
           {getFieldDecorator('newsStatus')(
272 264
             <Select style={{ width: '180px' }} placeholder="状态">
@@ -276,12 +268,12 @@ function CartBody(props) {
276 268
           )}
277 269
         </Form.Item>
278 270
         <Form.Item>
279
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
271
+          <Button type="primary" htmlType="submit" >
280 272
             搜索
281 273
           </Button>
282 274
         </Form.Item>
283 275
       </Form>
284
-      <Button type="primary" className={Styles.addButton} onClick={toEditList()}>
276
+      <Button type="danger" style={{ padding: '0 40px', margin: '20px 0' }} onClick={toEditList()}>
285 277
         新增
286 278
       </Button>
287 279
 
@@ -289,10 +281,10 @@ function CartBody(props) {
289 281
       <Row style={{ padding: ' 0 10px' }}>
290 282
         {
291 283
           dataSource.records.map((item, index) => (
292
-              <Col span={8}>
293
-                <CartBody data={item} key={item.buildingId}/>
294
-              </Col>
295
-            ))
284
+            <Col span={12}>
285
+              <CartBody data={item} key={item.buildingId} />
286
+            </Col>
287
+          ))
296 288
         }
297 289
       </Row>
298 290
       {/* 分页 */}

+ 226
- 10
src/pages/staff/list/editRole.jsx Vedi File

@@ -1,8 +1,15 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Select } from 'antd';
1
+import React, { useState } from 'react';
2
+
3
+import { Checkbox, Row, Col, Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, DatePicker, Select, Form, Alert, Card } from 'antd';
3 4
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 5
 import styles from '../../style/GoodsList.less';
6
+import XForm, { FieldTypes } from '../../../components/XForm';
7
+import Wangedit from '../../../components/Wangedit/Wangedit'
8
+import channels from './channelList.less';
9
+
10
+import Tagss from '../components/Tagss.jsx';
5 11
 
12
+const { TextArea } = Input;
6 13
 
7 14
 
8 15
 /**
@@ -11,17 +18,226 @@ import styles from '../../style/GoodsList.less';
11 18
  * @param {*} props
12 19
  * @returns
13 20
  */
21
+const Edit = (props) => {
22
+
23
+
24
+
25
+  // const [tab, changeTab] = useState('basic')
26
+
27
+  const Permission = [
28
+    '项目管理',
29
+    '员工管理',
30
+    '客户管理',
31
+    '系统管理',
32
+    '渠道管理',
33
+    '轮播图管理',
34
+    '资讯管理',
35
+    '活动管理',
36
+    '积分商城',
37
+    '首页数据',
38
+  ]
39
+
40
+  // const Basic = (props) => {
41
+
42
+  //   const dataSource = [
43
+
44
+
45
+  //     {
46
+  //       name: '员工管理',
47
+  //       per: [
48
+  //         '111111',
49
+  //         '22222',
50
+  //         '33333',
51
+  //       ]
52
+  //     },
53
+  //     {
54
+  //       name: '角色管理',
55
+  //       per: [
56
+  //         '444',
57
+  //         '555',
58
+  //         '666',
59
+  //       ]
60
+  //     },
61
+  //   ];
62
+
63
+  //   const columns = [
64
+  //     // {
65
+  //     //   title: '商品图片',
66
+  //     //   dataIndex: 'img',
67
+  //     //   key: 'img',
68
+  //     //   align: 'center',
69
+
70
+  //     //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
71
+  //     // },
72
+  //     {
73
+  //       title: '员工管理',
74
+  //       dataIndex: 'name',
75
+  //       key: 'name',
76
+  //       align: 'left',
77
+  //       render: text => <a>{text}</a>,
78
+  //     },
79
+
80
+  //     {
81
+  //       // title: '操作  ',
82
+  //       dataIndex: 'status',
83
+  //       key: 'per',
84
+  //       align: 'left',
85
+  //       render: () => <>
86
+  //         {/* {pre.map((item,index)=>(
87
+  //       <Checkbox>{item[index]}</Checkbox>
88
+
89
+
90
+  //               ))} */}
91
+  //       </>,
92
+  //     },
93
+  //   ];
94
+  //   return <Table dataSource={dataSource} columns={columns} />
95
+
96
+
97
+
98
+
99
+  // }
100
+  // const [Card] = useState('Poster')
101
+
102
+  const Poster = (props) => {
103
+
104
+    const dataSource = [
105
+
106
+
107
+      {
108
+        name: '员工管理',
109
+        per: [
110
+          '111111',
111
+          '22222',
112
+          '33333',
113
+        ]
114
+      },
115
+      {
116
+        name: '角色管理',
117
+        per: [
118
+          '444',
119
+          '555',
120
+          '666',
121
+        ]
122
+      },
123
+    ];
124
+
125
+
126
+    const gridStyle1 = {
127
+      width: '20%',
128
+      textAlign: 'left',
129
+    };
130
+    const gridStyle2 = {
131
+      width: '80%',
132
+      textAlign: 'left',
133
+    };
14 134
 
135
+{/* <Checkbox>{Permission[index]}</Checkbox> */}
136
+    return <>
137
+      <div style={{}}>
15 138
 
16
-function header(props) {
17
-  const { getFieldDecorator } = props.form
18
-  return (
139
+        {Permission.map((item, index) => (
19 140
 
20
-    <>
21
-     <div>编辑角色</div>
141
+
142
+          <Card title={<Checkbox>{Permission[index]}</Checkbox>} bordered={true} style={{ width: '100%' }}>
143
+            
144
+              {dataSource.map((items, indexs) => (
145
+              <>
146
+                <Card.Grid style={gridStyle1}><Checkbox>{items.name}</Checkbox></Card.Grid>
147
+                
148
+                <Card.Grid style={gridStyle2}>
149
+                {items.per.map((itemss,indexss) =>(
150
+                  <Checkbox>{items.per[indexss]}</Checkbox>
151
+                ))}
152
+                </Card.Grid>
153
+                </>
154
+            ))}
155
+            
156
+          </Card>
157
+
158
+
159
+
160
+        ))}
161
+      </div>
22 162
     </>
23
-  )
163
+  }
164
+
165
+  const Share = (props) => {
166
+    return <div>Share</div>
167
+  }
168
+
169
+
170
+
171
+
172
+  const fields = [
173
+    {
174
+      label: '角色名称',
175
+      name: 'roleName',
176
+      type: FieldTypes.Text,
177
+      // placeholder: '名称',
178
+      value: ''
179
+    },
180
+
181
+
182
+
183
+    {
184
+      label: '简介',
185
+      name: 'roleIntroduction',
186
+      render: <TextArea className={channels.inpuitTxt} ></TextArea>,
187
+      value: ''
188
+
189
+    },
190
+
191
+    {
192
+      label: '菜单权限',
193
+      name: 'rolePermission',
194
+      render:
195
+        <>
196
+          <div>
197
+
198
+            <Poster />
199
+
200
+            {/* <Radio.Group value={tab} defaultValue="1" buttonStyle="solid">
201
+             
202
+        <Checkbox>Checkbox</Checkbox>
203
+                {Permission.map((item,index)=>(
204
+                  <Radio.Button style={BottonStyle} value="{index}">{Permission[index]}</Radio.Button>
205
+                 
206
+                ))}
207
+            </Radio.Group>
208
+          
209
+          </div>
210
+          <div>
211
+             
212
+          <Table dataSource={Permission[index]} columns={columns} />
213
+           
214
+             */}
215
+          </div>
216
+        </>,
217
+
218
+    }
219
+    // {
220
+    //   label: '状态',
221
+    //   name: 'roleState',
222
+    //   render: <Radio.Group>
223
+    //     <Radio.Button style={{background:'#f0f0f0'}} value="a">禁用</Radio.Button>
224
+    //     <Radio.Button style={{background:'#f0f0f0',color:'#ff7e48'}} value="b">启用</Radio.Button>
225
+    //   </Radio.Group>,
226
+    //   value: 'b'
227
+    // },
228
+
229
+  ]
230
+
231
+  const handleSubmit = val => {
232
+    window.console.log('submit data --->', val)
233
+  }
234
+  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
235
+
236
+
237
+
238
+
24 239
 }
25
-const WrappedHeader = Form.create({ name: 'header' })(header);
26 240
 
27
-export default WrappedHeader
241
+
242
+
243
+export default Edit

+ 8
- 1
src/pages/staff/list/editStaff.jsx Vedi File

@@ -21,6 +21,13 @@ const { TextArea } = Input;
21 21
 const Edit = (props) => {
22 22
 
23 23
   const fields = [
24
+    {
25
+      label: '名称',
26
+      name: 'staffName',
27
+      type: FieldTypes.Text,
28
+      // placeholder: '名称',
29
+      value: ''
30
+    },
24 31
     {
25 32
       label: '公司',
26 33
       name: 'staffCompany',
@@ -114,7 +121,7 @@ const Edit = (props) => {
114 121
   const handleSubmit = val => {
115 122
     window.console.log('submit data --->', val)
116 123
   }
117
-  return <XForm onSubmit={handleSubmit} fields={fields} offset={8}></XForm>
124
+  return <XForm onSubmit={handleSubmit} fields={fields} push={8}></XForm>
118 125
 
119 126
 
120 127
 

+ 115
- 0
src/pages/system/editPolicy.jsx Vedi File

@@ -0,0 +1,115 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import SelectCity from '../../components/SelectButton/CitySelect'
9
+import XForm, { FieldTypes } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit'
11
+import request from '../../utils/request'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const policyId = props.location.query.policyId
22
+  const [ policyData, setPolicyData ] = useState({})
23
+  if(policyId){
24
+    useEffect(() => {
25
+      getPolicyData(policyId);
26
+    },[])
27
+
28
+  // 查询列表
29
+  const getPolicyData = (policyId) => {
30
+    request({
31
+        url: '/api/admin/taPolicy/' + policyId,
32
+        method: 'GET',
33
+    }).then((data) => {
34
+        console.log(data)
35
+        setPolicyData(data)
36
+    })
37
+  }
38
+  }
39
+
40
+  const cancelPage = () =>{
41
+    router.push({
42
+      pathname: '/system/housingPolicy',
43
+    });
44
+  }
45
+    const fields = [
46
+      {
47
+        label: '城市',
48
+        name: 'cityId',
49
+        render: <SelectCity />,
50
+        value: policyData.cityId,
51
+      },
52
+      {
53
+        label: '政策图片',
54
+        name: 'policyImg',
55
+        type: FieldTypes.ImageUploader,
56
+        value: policyData.policyImg,
57
+      },
58
+      {
59
+        label: '政策标题',
60
+        name: 'title',
61
+        type: FieldTypes.Text,
62
+        value: policyData.title,
63
+      },
64
+      {
65
+        label: '政策详情',
66
+        name: 'body',
67
+        render: <Wangedit />,
68
+        value: policyData.body,
69
+      },
70
+      {
71
+        label: '状态',
72
+        name: 'publishStatus',
73
+        type: FieldTypes.Select,
74
+        dict: [{label:"未发布",value:0},{label:"已发布",value:1}],
75
+        value: policyData.publishStatus != null ? policyData.publishStatus : 1,
76
+      },
77
+    ]
78
+  
79
+    const handleSubmit = val => { 
80
+      console.log('submit data --->', val)
81
+      if(policyId){
82
+        val.policyId = policyId
83
+        request({
84
+          url: '/api/admin/taPolicy/'+policyId,
85
+          method: 'PUT',
86
+          data: val,
87
+        }).then((data) => {
88
+          message.info("保存成功")
89
+          cancelPage()
90
+        }).catch((err) => {
91
+          message.info(err.msg || err.message)
92
+        })
93
+      }else{
94
+        request({
95
+          url: '/api/admin/taPolicy',
96
+          method: 'POST',
97
+          data: val,
98
+        }).then((data) => {
99
+          message.info("保存成功")
100
+          cancelPage()
101
+        }).catch((err) => {
102
+          message.info(err.msg || err.message)
103
+        })
104
+      }
105
+    }
106
+     
107
+
108
+  return (
109
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
110
+  );
111
+ }
112
+
113
+
114
+
115
+export default Edit

+ 202
- 0
src/pages/system/housingPolicy.jsx Vedi File

@@ -0,0 +1,202 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+
10
+import request from '../../utils/request'
11
+
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+const header = (props) => {
16
+  const [ data, setData ] = useState({})
17
+
18
+  useEffect(() => {
19
+    getList({ pageNum: 1, pageSize: 10,cityId: '' });
20
+  },[])
21
+
22
+  // 查询列表
23
+  const getList = (params) => {
24
+    request({
25
+        url: '/api/admin/taPolicy',
26
+        method: 'GET',
27
+        params: { ...params },
28
+    }).then((data) => {
29
+        console.log(data)
30
+        setData(data)
31
+    })
32
+  }
33
+
34
+  
35
+// 跳转到编辑商品
36
+const toEditPolicy = (policyId) => () => {
37
+    router.push({
38
+      pathname: '/system/editPolicy',
39
+      query: {
40
+        policyId
41
+      },
42
+    });
43
+  }
44
+  
45
+  /**
46
+   *
47
+   *
48
+   * @param {*} props
49
+   * @returns
50
+   */
51
+  
52
+  const columns = [
53
+    {
54
+      title: '购房政策主图',
55
+      dataIndex: 'policyImg',
56
+      key: 'policyImg',
57
+      align: 'center',
58
+      render: (policyImg) => <img src={policyImg} className={styles.touxiang} />,
59
+    },
60
+    {
61
+      title: '标题',
62
+      dataIndex: 'title',
63
+      key: 'title',
64
+      align: 'center',
65
+    },
66
+    {
67
+      title: '城市',
68
+      dataIndex: 'cityName',
69
+      key: 'cityName',
70
+      align: 'center',
71
+    },
72
+    {
73
+      title: '创建时间',
74
+      dataIndex: 'createDate',
75
+      key: 'createDate',
76
+      align: 'center',
77
+      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD')}</span></>
78
+    },
79
+    {
80
+      title: '状态',
81
+      dataIndex: 'publishStatus',
82
+      key: 'publishStatus',
83
+      align: 'center',
84
+      render: (publishStatus)=> <><span>{publishStatus === 1 ? '已发布' : '未发布' }</span></>
85
+    },
86
+    {
87
+      title: '操作',
88
+      dataIndex: 'handle',
89
+      key: 'handle',
90
+      align: 'center',
91
+      render: (x,row) => <>
92
+                           <span style={{ color: '#1990FF' }} onClick={publicOrNoPublic(row)}>{ row.publishStatus === 0 ? '发布' : '取消发布' }<Icon type="close-circle" className={styles.edit} /></span>
93
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topPolicy(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
94
+                           <span style={{ color: '#FF925C' }} onClick={toEditPolicy(row.policyId)}>编辑<Icon type="form" className={styles.edit} /></span>
95
+                           <span style={{ color: '#FF925C' }} onClick={deletePolicy(row.policyId)}>删除<Icon type="form" className={styles.edit} /></span>
96
+                         </>
97
+    },
98
+  ];
99
+  
100
+  // 删除
101
+const deletePolicy = (policyId) => () => {
102
+  Modal.confirm({
103
+    title: '是否继续删除此政策?',
104
+    okText: '确定',
105
+    cancelText: '取消',
106
+    onOk() {
107
+        request({
108
+            url: '/api/admin/taPolicy/'+policyId,
109
+            method: 'DELETE',
110
+        }).then((data) => {
111
+            message.info('操作成功!')
112
+            getList({ pageNum: 1, pageSize: 10,cityId: '' });
113
+        }).catch((err) => {
114
+            console.log(err)
115
+            message.info(err.msg || err.message)
116
+        })
117
+    },
118
+  });
119
+}
120
+
121
+
122
+//   置顶
123
+  const topPolicy = (row) => () => {
124
+      const weight = Math.abs(row.weight - 1)
125
+      row.weight = weight
126
+      request({
127
+          url: '/api/admin/taPolicy/'+row.policyId,
128
+          method: 'PUT',
129
+          data: row,
130
+      }).then((data) => {
131
+          console.log(data)
132
+          message.info('操作成功!')
133
+          getList({ pageNum: 1, pageSize: 10,cityId: '' });
134
+      }).catch((err) => {
135
+          console.log(err)
136
+          message.info(err.msg || err.message)
137
+      })
138
+  }
139
+  
140
+  const publicOrNoPublic = (row) => () => {
141
+      if (row.publishStatus === 1) {
142
+        row.publishStatus = 0
143
+      } else {
144
+        row.publishStatus = 1
145
+      }
146
+
147
+      request({
148
+        url: '/api/admin/taPolicy/'+row.policyId,
149
+        method: 'PUT',
150
+        data: row,
151
+      }).then((data) => {
152
+          console.log(data)
153
+          message.info('操作成功!')
154
+          getList({ pageNum: 1, pageSize: 10,cityId: '' });
155
+      }).catch((err) => {
156
+          console.log(err)
157
+          message.info(err.msg || err.message)
158
+      })
159
+  }
160
+  
161
+  const changePageNum = (pageNumber) => {
162
+      getList({ pageNum: pageNumber, pageSize: 10 })
163
+  }
164
+
165
+  // 提交事件
166
+const handleSubmit = (e, props) => {
167
+    e.preventDefault();
168
+    props.form.validateFields((err, values) => {
169
+      if (!err) {
170
+        console.log('提交数据: ', values)
171
+        getList({ pageNum: 1, pageSize: 10, ...values })
172
+      }
173
+    });
174
+  }
175
+
176
+  const { getFieldDecorator } = props.form
177
+  return (
178
+
179
+    <>
180
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
181
+        <Form.Item>
182
+          {getFieldDecorator('cityId')(
183
+            <SelectCity />,
184
+          )}
185
+        </Form.Item>
186
+        <Form.Item>
187
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
188
+            搜索
189
+          </Button>
190
+        </Form.Item>
191
+      </Form>
192
+      <Button type="primary" className={styles.addBtn} onClick={toEditPolicy()}>新增</Button>
193
+      <Table dataSource={data.records} columns={columns} pagination={false}/>
194
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
195
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
196
+      </div>
197
+    </>
198
+  )
199
+}
200
+const WrappedHeader = Form.create({ name: 'header' })(header);
201
+
202
+export default WrappedHeader

+ 69
- 0
src/pages/system/intention.jsx Vedi File

@@ -0,0 +1,69 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message,Checkbox,Row, Col } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import XForm, { FieldTypes } from '../../components/XForm';
9
+import Wangedit from '../../components/Wangedit/Wangedit'
10
+import request from '../../utils/request'
11
+import SelectCity from '../../components/SelectButton/CitySelect'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const [ data, setData ] = useState([])
22
+
23
+  const changBuilding = (buildingId) => {
24
+    request({
25
+      url: '/api/admin/tdBizEventIntention',
26
+      method: 'GET',
27
+      params: {pageNum: 1, pageSize: 999,buildingId}
28
+    }).then((data) => {
29
+      console.log(data)
30
+      setData(data.records)
31
+    })
32
+  }
33
+
34
+  return (
35
+    <>
36
+    <Row>
37
+      <Col span={12}>
38
+        <BuildSelect onChange={changBuilding}/>
39
+      </Col>
40
+    </Row>
41
+    <Row>
42
+      <Col span={6} offset={6}>
43
+        用户操作
44
+      </Col>
45
+      <Col span={6} offset={6}>
46
+        意向值
47
+      </Col>
48
+    </Row>
49
+    {data.map((x) => {
50
+      console.log(x)
51
+      return <Row>
52
+                <Col span={6} offset={6}>
53
+                {x.eventName}
54
+                </Col>
55
+                <Col span={6} offset={6}>
56
+                  {x.intention}
57
+                </Col>
58
+              </Row>
59
+    })}
60
+    <Row>
61
+      <Button type="primary" className={styles.searchBtn} >确定</Button>
62
+    </Row>
63
+    </>
64
+  );
65
+ }
66
+
67
+
68
+
69
+export default Edit