dingxin 5 år sedan
förälder
incheckning
ac82501558

+ 11
- 3
src/components/SelectButton/BuildSelect.jsx Visa fil

@@ -47,11 +47,19 @@ const BuildingSelect = (props) => {
47 47
     setValue(e)
48 48
     props.onChange(e)
49 49
   }
50
-
50
+  // '' === value ? undefined : value
51 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 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 64
       </Select>
57 65
   )

+ 1
- 1
src/components/SelectButton/CitySelect.jsx Visa fil

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

+ 2
- 2
src/pages/activity/ActivityList.jsx Visa fil

@@ -106,11 +106,11 @@ const toEditGoods = (dynamicId) => () => {
106 106
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this,row)}>{ row.status === 1 ? '取消发布' : '发布' }<Icon type="close-circle" className={styles.edit} /></span>
107 107
           </AuthButton>
108 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 110
           </AuthButton>
111 111
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
112 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 114
           </AuthButton>
115 115
         </>
116 116
       )

+ 4
- 3
src/pages/activity/editActivity.jsx Visa fil

@@ -133,7 +133,8 @@ const Edit = (props) => {
133 133
         label: '报名时间',
134 134
         name: 'signupTime',
135 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 138
         rules: [
138 139
           { required: true, message: '请选择报名时间' },
139 140
         ]
@@ -146,8 +147,8 @@ const Edit = (props) => {
146 147
       submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
147 148
       submitValue.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
148 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 152
       console.log('submit data --->', submitValue)
152 153
       if (dynamicId) {
153 154
         submitValue.dynamicId = dynamicId

+ 1
- 1
src/pages/building/list/index.jsx Visa fil

@@ -135,7 +135,7 @@ function CartBody(props) {
135 135
       </p>
136 136
       <p className={Styles.cardItem}>
137 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 139
       </p>
140 140
       <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.106rem' }}>
141 141
       <AuthButton name="admin.building.update.status.put" noRight={null}>

+ 1
- 0
src/pages/channel/recommendClients.jsx Visa fil

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

+ 1
- 0
src/pages/customer/independentList/index.jsx Visa fil

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

+ 6
- 0
src/pages/customer/recommendCustomer/index.jsx Visa fil

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

+ 8
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Visa fil

@@ -182,7 +182,14 @@ const UserBehavior = props => {
182 182
       })),
183 183
   }
184 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 195
   function showDetails(row) {

+ 5
- 21
src/pages/indexEcharts/userBehavior.jsx Visa fil

@@ -34,18 +34,6 @@ const header = props => {
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 37
   const [eventypes, setEventTypes] = useState([])
50 38
   function getBizEventType(row) {
51 39
 
@@ -101,23 +89,18 @@ function getUserBehaviorSummary(params) {
101 89
   }
102 90
 
103 91
   function redata(e) {
104
-
105
-
106 92
     console.log('行为回调数据:', e)
107 93
   }
108 94
   const [eventType, setEventType] = useState('')
109 95
   function handleChangeType(value) {
110
-    console.log(value,"1111111111111");
111 96
     setEventType(value)
112 97
   }
113 98
   const [event, setEvent] = useState('')
114 99
   function handleChangeEvent(value) {
115
-    console.log(value,"222222222222");
116 100
     setEvent(value)
117 101
   }
118 102
   const [activity, setActivity] = useState('')
119 103
   function handleChangeProperty(value) {
120
-    console.log(value,"33333333333333");
121 104
     setActivity(value)
122 105
   }
123 106
 
@@ -169,11 +152,12 @@ function getUserBehaviorSummary(params) {
169 152
           <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
170 153
         </Radio.Group>
171 154
         <RangePicker
172
-          style={{ paddingLeft: '30px' }}
155
+          style={{ paddingLeft: '30px', width: '400px' }}
173 156
           ranges={{
174 157
             Today: [moment(), moment()],
175 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 161
           showTime
178 162
           onChange={onChangetime}
179 163
         />
@@ -185,17 +169,17 @@ function getUserBehaviorSummary(params) {
185 169
       <div style={{ display: 'flex', margin: '24px 0' }}>
186 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 173
           {eventypes.map(type => (
190 174
             <Option key={type.typeId}>{type.typeName}</Option>
191 175
           ))}
192 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 178
           {eventList.map(event => (
195 179
             <Option key={event.eventId}>{event.eventName}</Option>
196 180
           ))}
197 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 183
           {properties.map(property => (
200 184
             <Option key={property.propertyId}>{property.propertyName}</Option>
201 185
           ))}

+ 17
- 1
src/pages/news/list/NewsList.jsx Visa fil

@@ -5,6 +5,7 @@ import router from 'umi/router';
5 5
 import request from '../../../utils/request';
6 6
 import apis from '../../../services/apis';
7 7
 import Styles from './style.less';
8
+import styles from '../../style/GoodsList.less';
8 9
 import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9 10
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
10 11
 import SelectCity from '../../../components/SelectButton/CitySelect'
@@ -118,6 +119,19 @@ function body(props) {
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 135
     function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
122 136
       console.log("newsId" + newsId + "status" + newsStatus);
123 137
       if (newsStatus === 1) {
@@ -167,6 +181,8 @@ function body(props) {
167 181
         bodyStyle={{ padding: '10px 20px' }}
168 182
       >
169 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 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 188
                   <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
@@ -210,7 +226,7 @@ function body(props) {
210 226
             <span>收藏数量:{data.saveNum}</span>
211 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 230
         </div>
215 231
       </Card>
216 232
     )

+ 5
- 0
src/services/apis.js Visa fil

@@ -156,6 +156,11 @@ export default {
156 156
       method: 'PUT',
157 157
       url: `${prefix}/taNews/:id`,
158 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 166
   newsType: {