dingxin vor 5 Jahren
Ursprung
Commit
2a042ad4b7

+ 5
- 5
src/pages/activity/helpActivity/edithelpActivity.jsx Datei anzeigen

206
     const submitPoster = () => {
206
     const submitPoster = () => {
207
       if (helpActivityId) {
207
       if (helpActivityId) {
208
         if (posterId) {
208
         if (posterId) {
209
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
209
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
210
             message.info("保存成功")
210
             message.info("保存成功")
211
           }).catch((err) => {
211
           }).catch((err) => {
212
             message.info(err.msg || err.message)
212
             message.info(err.msg || err.message)
213
           })
213
           })
214
         } else {
214
         } else {
215
-          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helPactivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
215
+          request({ ...apis.activity.addPoster, data: { targetId: helpActivityId, targetType: 'helpActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
216
             setPosterId(data.posterId)
216
             setPosterId(data.posterId)
217
             message.info("保存成功")
217
             message.info("保存成功")
218
           }).catch((err) => {
218
           }).catch((err) => {
293
 
293
 
294
     if (helpActivityId) {
294
     if (helpActivityId) {
295
       useEffect(() => {
295
       useEffect(() => {
296
-        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helPactivity' }, }).then((data) => {
296
+        request({ ...apis.activity.shareContent, params: { targetId: helpActivityId, targetType: 'helpActivity' }, }).then((data) => {
297
           console.log(data, "2222")
297
           console.log(data, "2222")
298
           if (data.length > 0) {
298
           if (data.length > 0) {
299
             setShareContentId(data[0].shareContentId)
299
             setShareContentId(data[0].shareContentId)
309
     const submitShare = () => {
309
     const submitShare = () => {
310
       if (helpActivityId) {
310
       if (helpActivityId) {
311
         if (shareContentId) {
311
         if (shareContentId) {
312
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
312
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
313
             message.info("保存成功")
313
             message.info("保存成功")
314
           }).catch((err) => {
314
           }).catch((err) => {
315
             message.info(err.msg || err.message)
315
             message.info(err.msg || err.message)
316
           })
316
           })
317
         } else {
317
         } else {
318
-          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helPactivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
318
+          request({ ...apis.activity.addShareContent, data: { targetId: helpActivityId, shareContentType: 'helpActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
319
             setShareContentId(data.shareContentId)
319
             setShareContentId(data.shareContentId)
320
             message.info("保存成功")
320
             message.info("保存成功")
321
           }).catch((err) => {
321
           }).catch((err) => {

+ 14
- 5
src/pages/activity/helpActivity/list.jsx Datei anzeigen

59
       dataIndex: 'startDate',
59
       dataIndex: 'startDate',
60
       key: 'startDate',
60
       key: 'startDate',
61
       align: 'center',
61
       align: 'center',
62
-      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
62
+      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(row.endDate).format('YYYY-MM-DD HH:mm')}`}</span></>,
63
     },
63
     },
64
     {
64
     {
65
       title: '已参加人数',
65
       title: '已参加人数',
197
 const handleSubmit = (e, props) => {
197
 const handleSubmit = (e, props) => {
198
     e.preventDefault();
198
     e.preventDefault();
199
     props.form.validateFields((err, values) => {
199
     props.form.validateFields((err, values) => {
200
+      console.log('values', values)
201
+      const startDate = moment(values.startTime).format('YYYY-MM-DD HH:mm');
202
+      const endDate = moment(values.endTime).format('YYYY-MM-DD HH:mm');
203
+      console.log('startDate', startDate)
200
       if (!err) {
204
       if (!err) {
201
         console.log('提交数据: ', values)
205
         console.log('提交数据: ', values)
202
         getList({ pageNum: 1, pageSize: 10, ...values })
206
         getList({ pageNum: 1, pageSize: 10, ...values })
233
             />,
237
             />,
234
           )}
238
           )}
235
         </Form.Item>
239
         </Form.Item>
236
-        {/* <Form.Item>
237
-          {getFieldDecorator('time')(
238
-            <DatePicker />
240
+        <Form.Item>
241
+          {getFieldDecorator('startTime')(
242
+            <DatePicker placeholder="活动开始时间"/>,
239
           )}
243
           )}
240
-        </Form.Item> */}
244
+        </Form.Item>
245
+        <Form.Item>
246
+          {getFieldDecorator('endTime')(
247
+            <DatePicker placeholder="活动结束时间"/>,
248
+          )}
249
+        </Form.Item>
241
         <Form.Item>
250
         <Form.Item>
242
           {getFieldDecorator('activityStatus')(
251
           {getFieldDecorator('activityStatus')(
243
             <Select style={{ width: '180px' }} placeholder="活动状态">
252
             <Select style={{ width: '180px' }} placeholder="活动状态">