dingxin 5 年之前
父節點
當前提交
ac82501558

+ 11
- 3
src/components/SelectButton/BuildSelect.jsx 查看文件

47
     setValue(e)
47
     setValue(e)
48
     props.onChange(e)
48
     props.onChange(e)
49
   }
49
   }
50
-
50
+  // '' === value ? undefined : value
51
   return (
51
   return (
52
-      <Select value={'' === value ? undefined : value} style={{ width: '180px' }} placeholder="请选择项目" onChange={handleChange}>
52
+      <Select
53
+      showSearch
54
+      value={props.value}
55
+      style={{ width: '180px' }} 
56
+      placeholder="请选择项目" 
57
+      onChange={handleChange}
58
+      filterOption={(input, option) =>
59
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
60
+      }>
53
           {data.map(building => (
61
           {data.map(building => (
54
-            <Option key={building.buildingId}>{building.buildingName}</Option>
62
+            <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
55
           ))}
63
           ))}
56
       </Select>
64
       </Select>
57
   )
65
   )

+ 1
- 1
src/components/SelectButton/CitySelect.jsx 查看文件

33
       <Select 
33
       <Select 
34
       showSearch 
34
       showSearch 
35
       value={props.value} 
35
       value={props.value} 
36
-      style={{ width: '180px' }} 
36
+      style={{ width: '180px' }}
37
       placeholder="请选择城市" 
37
       placeholder="请选择城市" 
38
       onChange={props.onChange} 
38
       onChange={props.onChange} 
39
       filterOption={(input, option) =>
39
       filterOption={(input, option) =>

+ 2
- 2
src/pages/activity/ActivityList.jsx 查看文件

106
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
106
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
107
           </AuthButton>
107
           </AuthButton>
108
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
108
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
109
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
109
+            {row.isEnlist != 2 && <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={finishDynamic.bind(this,row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
110
           </AuthButton>
110
           </AuthButton>
111
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
111
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
112
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
112
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
113
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>
113
+            {row.isEnlist != 2 && <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
114
           </AuthButton>
114
           </AuthButton>
115
         </>
115
         </>
116
       )
116
       )

+ 4
- 3
src/pages/activity/editActivity.jsx 查看文件

133
         label: '报名时间',
133
         label: '报名时间',
134
         name: 'signupTime',
134
         name: 'signupTime',
135
         type: FieldTypes.RangePicker,
135
         type: FieldTypes.RangePicker,
136
-        value: dynamicData.enlistStart != null ? [moment(dynamicData.enlistStart, 'YYYY-MM-DD'), moment(dynamicData.enlistEnd, 'YYYY-MM-DD')] : null,
136
+        value: dynamicData.enlistStart != null ? [moment(dynamicData.enlistStart, 'YYYY-MM-DD HH:mm'), moment(dynamicData.enlistEnd, 'YYYY-MM-DD HH:mm')] : null,
137
+        props: {showTime:{ format: 'HH:mm' }},
137
         rules: [
138
         rules: [
138
           { required: true, message: '请选择报名时间' },
139
           { required: true, message: '请选择报名时间' },
139
         ]
140
         ]
146
       submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
147
       submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
147
       submitValue.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
148
       submitValue.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
148
       const [enlistStart, enlistEnd] = signupTime
149
       const [enlistStart, enlistEnd] = signupTime
149
-      submitValue.enlistStart = moment(enlistStart).format('YYYY-MM-DD');
150
-      submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD');
150
+      submitValue.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
151
+      submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
151
       console.log('submit data --->', submitValue)
152
       console.log('submit data --->', submitValue)
152
       if (dynamicId) {
153
       if (dynamicId) {
153
         submitValue.dynamicId = dynamicId
154
         submitValue.dynamicId = dynamicId

+ 1
- 1
src/pages/building/list/index.jsx 查看文件

135
       </p>
135
       </p>
136
       <p className={Styles.cardItem}>
136
       <p className={Styles.cardItem}>
137
         <span className={Styles.title}>录入时间</span>
137
         <span className={Styles.title}>录入时间</span>
138
-        <span >:{data.createDate}</span>
138
+        <span >:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
139
       </p>
139
       </p>
140
       <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.106rem' }}>
140
       <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.106rem' }}>
141
       <AuthButton name="admin.building.update.status.put" noRight={null}>
141
       <AuthButton name="admin.building.update.status.put" noRight={null}>

+ 1
- 0
src/pages/channel/recommendClients.jsx 查看文件

84
     dataIndex: 'createDate',
84
     dataIndex: 'createDate',
85
     key: 'createDate',
85
     key: 'createDate',
86
     align: 'center',
86
     align: 'center',
87
+    render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
87
   },
88
   },
88
   {
89
   {
89
     title: '状态',
90
     title: '状态',

+ 1
- 0
src/pages/customer/independentList/index.jsx 查看文件

106
         title: '推荐时间',
106
         title: '推荐时间',
107
         dataIndex: 'createDate',
107
         dataIndex: 'createDate',
108
         key: 'createDate',
108
         key: 'createDate',
109
+        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
109
       },
110
       },
110
       {
111
       {
111
         title: '状态',
112
         title: '状态',

+ 6
- 0
src/pages/customer/recommendCustomer/index.jsx 查看文件

6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
9
 
10
 
10
 
11
 
11
 const { Option } = Select;
12
 const { Option } = Select;
215
             </Select>,
216
             </Select>,
216
           )}
217
           )}
217
         </Form.Item>
218
         </Form.Item>
219
+        <Form.Item>
220
+          {getFieldDecorator('buildingId')(
221
+            <BuildingSelect />,
222
+          )}
223
+        </Form.Item>
218
         <Form.Item style={{ position:'absolute',right:'38px' }}>
224
         <Form.Item style={{ position:'absolute',right:'38px' }}>
219
             <Button type="primary" htmlType="submit" >
225
             <Button type="primary" htmlType="submit" >
220
               搜索
226
               搜索

+ 8
- 1
src/pages/indexEcharts/components/UserBehavior.jsx 查看文件

182
       })),
182
       })),
183
   }
183
   }
184
   function handleBuildingChange(e) {
184
   function handleBuildingChange(e) {
185
-    getUserBehaviorSummary({ buildingId: e })
185
+    const date = formatDate(props.startDate, props.endDate)
186
+    getUserBehaviorSummary({
187
+      ...date,
188
+      activity: props.activity,
189
+      event: props.event,
190
+      eventType: props.eventType,
191
+      buildingId: e,
192
+    })
186
   }
193
   }
187
 
194
 
188
   function showDetails(row) {
195
   function showDetails(row) {

+ 5
- 21
src/pages/indexEcharts/userBehavior.jsx 查看文件

34
     
34
     
35
   }, [])
35
   }, [])
36
  
36
  
37
-
38
-function getUserBehaviorSummary(params) {
39
-
40
-
41
-  request({
42
-    ...apis.indexEcharts.userBehavior.summary,
43
-    params
44
-  }).then((data) => {
45
-    setData(data || {})
46
-
47
-  })
48
-}
49
   const [eventypes, setEventTypes] = useState([])
37
   const [eventypes, setEventTypes] = useState([])
50
   function getBizEventType(row) {
38
   function getBizEventType(row) {
51
 
39
 
101
   }
89
   }
102
 
90
 
103
   function redata(e) {
91
   function redata(e) {
104
-
105
-
106
     console.log('行为回调数据:', e)
92
     console.log('行为回调数据:', e)
107
   }
93
   }
108
   const [eventType, setEventType] = useState('')
94
   const [eventType, setEventType] = useState('')
109
   function handleChangeType(value) {
95
   function handleChangeType(value) {
110
-    console.log(value,"1111111111111");
111
     setEventType(value)
96
     setEventType(value)
112
   }
97
   }
113
   const [event, setEvent] = useState('')
98
   const [event, setEvent] = useState('')
114
   function handleChangeEvent(value) {
99
   function handleChangeEvent(value) {
115
-    console.log(value,"222222222222");
116
     setEvent(value)
100
     setEvent(value)
117
   }
101
   }
118
   const [activity, setActivity] = useState('')
102
   const [activity, setActivity] = useState('')
119
   function handleChangeProperty(value) {
103
   function handleChangeProperty(value) {
120
-    console.log(value,"33333333333333");
121
     setActivity(value)
104
     setActivity(value)
122
   }
105
   }
123
 
106
 
169
           <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
152
           <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
170
         </Radio.Group>
153
         </Radio.Group>
171
         <RangePicker
154
         <RangePicker
172
-          style={{ paddingLeft: '30px' }}
155
+          style={{ paddingLeft: '30px', width: '400px' }}
173
           ranges={{
156
           ranges={{
174
             Today: [moment(), moment()],
157
             Today: [moment(), moment()],
175
             'This Month': [moment().startOf('month'), moment().endOf('month')],
158
             'This Month': [moment().startOf('month'), moment().endOf('month')],
176
           }}
159
           }}
160
+          // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
177
           showTime
161
           showTime
178
           onChange={onChangetime}
162
           onChange={onChangetime}
179
         />
163
         />
185
       <div style={{ display: 'flex', margin: '24px 0' }}>
169
       <div style={{ display: 'flex', margin: '24px 0' }}>
186
         <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
170
         <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
187
        
171
        
188
-        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
172
+        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
189
           {eventypes.map(type => (
173
           {eventypes.map(type => (
190
             <Option key={type.typeId}>{type.typeName}</Option>
174
             <Option key={type.typeId}>{type.typeName}</Option>
191
           ))}
175
           ))}
192
       </Select>
176
       </Select>
193
-        <Select  style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
177
+        <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
194
           {eventList.map(event => (
178
           {eventList.map(event => (
195
             <Option key={event.eventId}>{event.eventName}</Option>
179
             <Option key={event.eventId}>{event.eventName}</Option>
196
           ))}
180
           ))}
197
       </Select>
181
       </Select>
198
-        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
182
+        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
199
           {properties.map(property => (
183
           {properties.map(property => (
200
             <Option key={property.propertyId}>{property.propertyName}</Option>
184
             <Option key={property.propertyId}>{property.propertyName}</Option>
201
           ))}
185
           ))}

+ 17
- 1
src/pages/news/list/NewsList.jsx 查看文件

5
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
6
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
7
 import Styles from './style.less';
7
 import Styles from './style.less';
8
+import styles from '../../style/GoodsList.less';
8
 import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
 import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
10
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
10
 import SelectCity from '../../../components/SelectButton/CitySelect'
11
 import SelectCity from '../../../components/SelectButton/CitySelect'
118
       });
119
       });
119
     }
120
     }
120
 
121
 
122
+    //   置顶
123
+    const topNews = (weightParam, newsId) => () => {
124
+      const weight = Math.abs(weightParam - 1)
125
+      request({ ...apis.news.weight, params: {newsId: newsId, weight} }).then((data) => {
126
+          console.log(data)
127
+          message.info('操作成功!')
128
+          getList({ pageNum: 1, pageSize: 10 })
129
+      }).catch((err) => {
130
+          console.log(err)
131
+          message.info(err.msg || err.message)
132
+      })
133
+    }
134
+
121
     function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
135
     function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
122
       console.log("newsId" + newsId + "status" + newsStatus);
136
       console.log("newsId" + newsId + "status" + newsStatus);
123
       if (newsStatus === 1) {
137
       if (newsStatus === 1) {
167
         bodyStyle={{ padding: '10px 20px' }}
181
         bodyStyle={{ padding: '10px 20px' }}
168
       >
182
       >
169
         <AuthButton name="admin.taNews.id.put" noRight={null}>
183
         <AuthButton name="admin.taNews.id.put" noRight={null}>
184
+          <span style={{ position: 'absolute', right: '100px', top: '19px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{ data.weight === 1 ? '取消置顶' : '置顶' }</span>
185
+
170
           <span style={{ position: 'absolute', right: '20px', top: '20px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(data.newsId)}>
186
           <span style={{ position: 'absolute', right: '20px', top: '20px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(data.newsId)}>
171
             编辑
187
             编辑
172
                   <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
188
                   <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
210
             <span>收藏数量:{data.saveNum}</span>
226
             <span>收藏数量:{data.saveNum}</span>
211
           </p>
227
           </p>
212
 
228
 
213
-          <p style={{ fontSize: ' 0.106rem', color: '#999', marginBottom: '8px' }}>发布时间:{data.createDate}</p>
229
+          <p style={{ fontSize: ' 0.106rem', color: '#999', marginBottom: '8px' }}>发布时间:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</p>
214
         </div>
230
         </div>
215
       </Card>
231
       </Card>
216
     )
232
     )

+ 5
- 0
src/services/apis.js 查看文件

156
       method: 'PUT',
156
       method: 'PUT',
157
       url: `${prefix}/taNews/:id`,
157
       url: `${prefix}/taNews/:id`,
158
       action: 'admin.taNews.id.put',
158
       action: 'admin.taNews.id.put',
159
+    },
160
+    weight: {
161
+      method: 'PUT',
162
+      url: `${prefix}/taNews/weight`,
163
+      action: 'admin.taNews.weight.put',
159
     }
164
     }
160
   },
165
   },
161
   newsType: {
166
   newsType: {