activity.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. import React from 'react';
  2. import { Icon, Button, Spin, message, Table, Input, Modal, DatePicker, Upload, Select } from 'antd';
  3. import { beforeUpload, getBase64, getActivityForm, getActivityType, splitUrl } from '../../../tools';
  4. import { activityForm, activityType } from '../../../dataDic';
  5. import moment from 'moment';
  6. import ajax from 'jquery/src/ajax/xhr.js';
  7. import $ from 'jquery/src/ajax';
  8. const Avatar = React.createClass({
  9. getInitialState () {
  10. return {
  11. imageUrl: ''
  12. }
  13. },
  14. handleChange (info) {
  15. if (info.file.status === 'done') {
  16. // Get this url from response in real world.
  17. getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
  18. this.props.urlData(info.file.response.data);
  19. }
  20. },
  21. componentWillReceiveProps (nextProps) {
  22. if (this.props.visible && !nextProps.visible) {
  23. this.state.imageUrl = null;
  24. };
  25. },
  26. render () {
  27. const imageUrl = this.state.imageUrl;
  28. return (
  29. <Upload
  30. className="avatar-uploader"
  31. name={this.props.name}
  32. showUploadList={false}
  33. action={globalConfig.context + "/api/admin/activity/upload"}
  34. data={{ 'sign': 'activity_title_picture' }}
  35. beforeUpload={beforeUpload}
  36. onChange={this.handleChange} >
  37. {
  38. (imageUrl || this.props.imageUrl) ?
  39. <img src={imageUrl || this.props.imageUrl} role="presentation" id={this.props.name} /> :
  40. <Icon type="plus" className="avatar-uploader-trigger" />
  41. }
  42. </Upload>
  43. );
  44. }
  45. });
  46. const PicturesWall = React.createClass({
  47. getInitialState () {
  48. return {
  49. previewVisible: false,
  50. previewImage: '',
  51. fileList: [],
  52. }
  53. },
  54. handleCancel () {
  55. this.setState({ previewVisible: false })
  56. },
  57. handlePreview (file) {
  58. this.setState({
  59. previewImage: file.url || file.thumbUrl,
  60. previewVisible: true,
  61. });
  62. },
  63. handleChange (info) {
  64. let fileList = info.fileList;
  65. this.setState({ fileList });
  66. this.props.fileList(fileList);
  67. },
  68. componentWillReceiveProps (nextProps) {
  69. this.state.fileList = nextProps.pictureUrl;
  70. },
  71. render () {
  72. const { previewVisible, previewImage, fileList } = this.state;
  73. const uploadButton = (
  74. <div>
  75. <Icon type="plus" />
  76. <div className="ant-upload-text">点击上传</div>
  77. </div>
  78. );
  79. return (
  80. <div className="clearfix">
  81. <Upload
  82. action={globalConfig.context + "/api/admin/activity/upload"}
  83. data={{ 'sign': 'activity_content_picture' }}
  84. listType="picture-card"
  85. fileList={fileList}
  86. onPreview={this.handlePreview}
  87. onChange={this.handleChange} >
  88. {fileList.length >= 5 ? null : uploadButton}
  89. </Upload>
  90. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  91. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  92. </Modal>
  93. </div>
  94. );
  95. }
  96. });
  97. const Activity = React.createClass({
  98. loadData (pageNo) {
  99. this.setState({
  100. loading: true
  101. });
  102. $.ajax({
  103. method: "get",
  104. dataType: "json",
  105. crossDomain: false,
  106. url: globalConfig.context + '/api/admin/activity/list',
  107. data: {
  108. pageNo: pageNo || 1,
  109. pageSize: this.state.pagination.pageSize,
  110. sTime: this.state.startDate, //活动开始时间(startTime起)
  111. eTime: this.state.endDate, //活动开始时间(startTime止)
  112. name: this.state.searchName,
  113. host: this.state.searchHost,
  114. type: this.state.searchType ? Number(this.state.searchType) : undefined, // 活动类型
  115. form: this.state.searchForm ? Number(this.state.searchForm) : undefined, //活动形式
  116. },
  117. success: function (data) {
  118. let theArr = [];
  119. if (!data.data || !data.data.list) {
  120. if (data.error && data.error.length) {
  121. message.warning(data.error[0].message);
  122. };
  123. } else {
  124. for (let i = 0; i < data.data.list.length; i++) {
  125. let thisdata = data.data.list[i];
  126. theArr.push({
  127. key: i,
  128. id: thisdata.id,
  129. startTime: thisdata.startTime,
  130. startTimeFormattedDate: thisdata.startTimeFormattedDate,
  131. endTime: thisdata.endTime,
  132. endTimeFormattedDate: thisdata.endTimeFormattedDate,
  133. name: thisdata.name,
  134. host: thisdata.host,
  135. type: thisdata.type,
  136. form: thisdata.form,
  137. enrollDeadline: thisdata.enrollDeadline,
  138. enrollDeadlineFormattedDate: thisdata.enrollDeadlineFormattedDate
  139. });
  140. };
  141. this.state.pagination.current = data.data.pageNo;
  142. this.state.pagination.total = data.data.totalCount;
  143. };
  144. this.setState({
  145. tableData: theArr,
  146. pagination: this.state.pagination
  147. });
  148. }.bind(this),
  149. }).always(function () {
  150. this.setState({
  151. loading: false
  152. });
  153. }.bind(this));
  154. },
  155. loadDetailData () {
  156. this.setState({
  157. loading: true
  158. });
  159. $.ajax({
  160. method: "get",
  161. dataType: "json",
  162. crossDomain: false,
  163. url: globalConfig.context + '/api/admin/activity/detail',
  164. data: {
  165. id: this.state.RowData.id //新闻主键ID(数字类型,非字符串)
  166. },
  167. success: function (data) {
  168. let theObj = {}, theArr = [];
  169. if (!data.data) {
  170. if (data.error && data.error.length) {
  171. message.warning(data.error[0].message);
  172. };
  173. } else {
  174. theObj = data.data;
  175. theArr = theObj.asist ? theObj.asist.split(',') : [];
  176. theObj.imgUrls = theObj.imgUrls ? splitUrl(theObj.imgUrls, ',', globalConfig.avatarHost + '/upload') : [];
  177. };
  178. this.setState({
  179. RowData: theObj,
  180. asistArray: theArr
  181. });
  182. }.bind(this),
  183. }).always(function () {
  184. this.setState({
  185. loading: false
  186. });
  187. }.bind(this));
  188. },
  189. getInitialState () {
  190. return {
  191. loading: false,
  192. visible: false,
  193. selectedRowKeys: [],
  194. selectedRows: [],
  195. asistArray: [],
  196. keysObj: {},
  197. RowData: {},
  198. pagination: {
  199. defaultCurrent: 1,
  200. defaultPageSize: 10,
  201. showQuickJumper: true,
  202. pageSize: 10,
  203. onChange: function (page) {
  204. this.loadData(page);
  205. }.bind(this),
  206. showTotal: function (total) {
  207. return '共' + total + '条数据';
  208. }
  209. },
  210. columns: [
  211. {
  212. title: '活动名称',
  213. dataIndex: 'name',
  214. key: 'name',
  215. width: '20%'
  216. }, {
  217. title: '主办单位',
  218. dataIndex: 'host',
  219. key: 'host',
  220. }, {
  221. title: '活动类型',
  222. dataIndex: 'type',
  223. key: 'type',
  224. render: (text) => { return getActivityType(text); }
  225. }, {
  226. title: '活动形式',
  227. dataIndex: 'form',
  228. key: 'form',
  229. render: (text) => { return getActivityForm(text); }
  230. }, {
  231. title: '报名截止时间',
  232. dataIndex: 'enrollDeadlineFormattedDate',
  233. key: 'enrollDeadlineFormattedDate'
  234. }, {
  235. title: '活动开始时间',
  236. dataIndex: 'startTimeFormattedDate',
  237. key: 'startTimeFormattedDate'
  238. }
  239. ],
  240. tableData: []
  241. };
  242. },
  243. tableRowClick (record, index) {
  244. this.state.RowData = record;
  245. this.loadDetailData();
  246. this.setState({
  247. visible: true
  248. });
  249. },
  250. componentWillMount () {
  251. this.loadData();
  252. let theTypeOption = [], theFormOption = [];
  253. activityType.map((item) => {
  254. theTypeOption.push(
  255. <Select.Option key={item.value}>{item.key}</Select.Option>
  256. )
  257. });
  258. activityForm.map((item) => {
  259. theFormOption.push(
  260. <Select.Option key={item.value}>{item.key}</Select.Option>
  261. )
  262. });
  263. this.state.activityTypeOption = theTypeOption;
  264. this.state.activityFormOption = theFormOption;
  265. },
  266. submit () {
  267. if (!this.state.RowData.name) {
  268. message.warning('必须填写一个标题!');
  269. return;
  270. };
  271. if (!this.state.RowData.startTimeFormattedDate) {
  272. message.warning('必须选择一个活动开始时间!');
  273. return;
  274. };
  275. if (!this.state.RowData.type) {
  276. message.warning('必须选择一个活动类型!');
  277. return;
  278. };
  279. if (!this.state.RowData.form) {
  280. message.warning('必须选择一个活动形式!');
  281. return;
  282. };
  283. if (!this.state.RowData.address) {
  284. message.warning('必须选择一个活动地点!');
  285. return;
  286. };
  287. let imgUrls = null;
  288. if (this.state.RowData.imgUrls && this.state.RowData.imgUrls.length) {
  289. let picArr = [];
  290. this.state.RowData.imgUrls.map(function (item) {
  291. picArr.push(item.response.data);
  292. });
  293. imgUrls = picArr.join(",");
  294. };
  295. this.setState({
  296. loading: true
  297. });
  298. $.ajax({
  299. method: "post",
  300. dataType: "json",
  301. crossDomain: false,
  302. url: globalConfig.context + (this.state.RowData.id ? '/api/admin/activity/update' : '/api/admin/activity/add'),
  303. data: {
  304. id: this.state.RowData.id || null, //主键,如果不填主键则为新增记录,填主键则为更新
  305. name: this.state.RowData.name,// 标题,
  306. address: this.state.RowData.address,// 活动地址,
  307. host: this.state.RowData.host,// 主办单位,
  308. undertake: this.state.RowData.undertake,// 承办单位,
  309. asist: this.state.asistArray ? this.state.asistArray.join(',') : undefined,// 协办单位A,协办单位B,
  310. type: this.state.RowData.type,// 0, //活动类型
  311. form: this.state.RowData.form,// 1, //活动形式
  312. imgUrls: imgUrls,// 活动图片,
  313. result: this.state.RowData.result,// 活动结果,
  314. titleUrl: this.state.RowData.titleUrl,// 题图URL,
  315. summary: this.state.RowData.summary,// 描述,
  316. startTimeFormattedDate: this.state.RowData.startTimeFormattedDate,// 2012-02-02, //活动开始时间 yyyy-MM-dd
  317. endTimeFormattedDate: this.state.RowData.endTimeFormattedDate,// 2012-09-09, //活动结束时间 yyyy-MM-dd
  318. enrollDeadlineFormattedDate: this.state.RowData.enrollDeadlineFormattedDate,// 2012-09-09, //报名结束时间 yyyy-MM-dd
  319. },
  320. success: function (data) {
  321. if (data.error && data.error.length) {
  322. message.warning(data.error[0].message);
  323. } else {
  324. message.success('保存成功!');
  325. this.setState({ visible: false });
  326. this.loadData();
  327. };
  328. }.bind(this),
  329. }).always(function () {
  330. this.setState({
  331. loading: false
  332. });
  333. }.bind(this));
  334. },
  335. cleanCache (sign) {
  336. this.setState({
  337. loading: true
  338. });
  339. $.ajax({
  340. method: "post",
  341. dataType: "json",
  342. crossDomain: false,
  343. url: globalConfig.context + '/api/admin/activity/cleanCache',
  344. data: {
  345. 'cacheKey': sign
  346. },
  347. success: function (data) {
  348. if (data.error && data.error.length) {
  349. message.warning(data.error[0].message);
  350. } else {
  351. message.success('清除缓存成功!');
  352. };
  353. }.bind(this),
  354. }).always(function () {
  355. this.setState({
  356. loading: false
  357. });
  358. }.bind(this));
  359. },
  360. delectRow () {
  361. let deletedIds = [];
  362. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  363. let rowItem = this.state.selectedRows[idx];
  364. if (rowItem.id) {
  365. deletedIds.push(rowItem.id)
  366. };
  367. };
  368. this.setState({
  369. selectedRowKeys: [],
  370. loading: deletedIds.length > 0
  371. });
  372. $.ajax({
  373. method: "POST",
  374. dataType: "json",
  375. crossDomain: false,
  376. url: globalConfig.context + "/api/admin/activity/delete",
  377. data: {
  378. ids: deletedIds
  379. }
  380. }).done(function (data) {
  381. if (data.error && data.error.length) {
  382. message.warning(data.error[0].message);
  383. } else {
  384. message.success('删除成功!');
  385. };
  386. this.setState({
  387. loading: false,
  388. });
  389. this.loadData();
  390. }.bind(this));
  391. },
  392. reset () {
  393. this.state.startDate = undefined;
  394. this.state.endDate = undefined;
  395. this.state.searchName = undefined;
  396. this.state.searchHost = undefined;
  397. this.state.searchType = undefined;
  398. this.state.searchForm = undefined;
  399. this.loadData();
  400. },
  401. render () {
  402. const rowSelection = {
  403. selectedRowKeys: this.state.selectedRowKeys,
  404. onChange: (selectedRowKeys, selectedRows) => {
  405. this.setState({
  406. selectedRows: selectedRows.slice(-1),
  407. selectedRowKeys: selectedRowKeys.slice(-1)
  408. });
  409. }
  410. };
  411. const hasSelected = this.state.selectedRowKeys.length > 0;
  412. return (
  413. <div className="admin-content" >
  414. <div className="admin-content-title">
  415. <span>活动圈管理</span>
  416. <Button type="primary" style={{ float: 'right' }}
  417. onClick={() => { this.setState({ RowData: {}, visible: true }) }}>
  418. 添加<Icon type="plus" />
  419. </Button>
  420. </div>
  421. <div className="admin-content-warp">
  422. <div className="admin-content-search">
  423. <Input placeholder="活动名称" style={{ width: 200 }}
  424. value={this.state.searchName}
  425. onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
  426. <Input placeholder="主办单位" style={{ width: 200 }}
  427. value={this.state.searchHost}
  428. onChange={(e) => { this.setState({ searchHost: e.target.value }); }} />
  429. <Select placeholder="活动类型"
  430. style={{ width: 100 }}
  431. value={this.state.searchType}
  432. onChange={(e) => { this.setState({ searchType: e }) }}>
  433. {this.state.activityTypeOption}
  434. </Select>
  435. <Select placeholder="活动形式"
  436. style={{ width: 100 }}
  437. value={this.state.searchForm}
  438. onChange={(e) => { this.setState({ searchForm: e }) }}>
  439. {this.state.activityFormOption}
  440. </Select>
  441. <span>活动时间</span>
  442. <DatePicker style={{ width: 150 }}
  443. showTime
  444. format="YYYY-MM-DD HH:mm:ss"
  445. placeholder="搜索开始时间"
  446. value={this.state.startDate ? moment(this.state.startDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  447. onChange={(t, str) => {
  448. this.setState({ startDate: str });
  449. }} />
  450. <span>到</span>
  451. <DatePicker style={{ width: 150 }}
  452. showTime
  453. format="YYYY-MM-DD HH:mm:ss"
  454. placeholder="搜索结束时间"
  455. value={this.state.endDate ? moment(this.state.endDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  456. onChange={(t, str) => {
  457. this.setState({ endDate: str });
  458. }} />
  459. <Button type="primary" onClick={() => { this.loadData() }}>搜索</Button>
  460. <Button onClick={this.reset}>重置</Button>
  461. <Button type='danger' disabled={!hasSelected} onClick={this.delectRow}>
  462. 删除<Icon type="minus" />
  463. </Button>
  464. <Button type="primary" onClick={() => { this.cleanCache('activity_portal_list_cache_key'); }}>清除缓存</Button>
  465. </div>
  466. <Spin spinning={this.state.loading}>
  467. <Table className="no-all-select" columns={this.state.columns}
  468. dataSource={this.state.tableData}
  469. pagination={this.state.pagination}
  470. rowSelection={rowSelection}
  471. onRowClick={this.tableRowClick} />
  472. </Spin>
  473. </div>
  474. <Modal title="活动详情" width={600} className="activity-modal"
  475. visible={this.state.visible}
  476. maskClosable={false}
  477. footer={null}
  478. afterClose={() => { this.state.RowData = {}; this.state.asist = null; this.state.asistArray = []; }}
  479. onCancel={() => { this.setState({ visible: false }) }} >
  480. <Spin spinning={this.state.loading}>
  481. <div className="clearfix">
  482. <div className="modal-box">
  483. <span className="modal-box-title">活动标题</span>
  484. <div className="modal-box-detail">
  485. <Input value={this.state.RowData.name}
  486. onChange={(e) => {
  487. this.state.RowData.name = e.target.value;
  488. this.setState({ RowData: this.state.RowData });
  489. }} />
  490. </div>
  491. </div>
  492. <div className="modal-box">
  493. <span className="modal-box-title">标题图片</span>
  494. <div className="modal-box-detail clearfix" style={{ width: '360px' }}>
  495. <Avatar visible={this.state.visible}
  496. imageUrl={this.state.RowData.titleUrl ? (globalConfig.avatarHost + "/upload" + this.state.RowData.titleUrl) : null}
  497. urlData={(url) => { this.state.RowData.titleUrl = url }} />
  498. </div>
  499. </div>
  500. <div className="modal-box">
  501. <span className="modal-box-title">活动描述</span>
  502. <div className="modal-box-detail">
  503. <Input type="textarea" rows={4} value={this.state.RowData.summary}
  504. onChange={(e) => {
  505. this.state.RowData.summary = e.target.value;
  506. this.setState({ RowData: this.state.RowData });
  507. }} />
  508. </div>
  509. </div>
  510. <div className="modal-box">
  511. <span className="modal-box-title">活动类型</span>
  512. <div className="modal-box-detail" style={{ width: '160px' }}>
  513. <Select placeholder="选择活动类型"
  514. style={{ width: 120 }}
  515. value={this.state.RowData.type}
  516. onChange={(e) => {
  517. this.state.RowData.type = e;
  518. this.setState({ RowData: this.state.RowData });
  519. }}>
  520. {this.state.activityTypeOption}
  521. </Select>
  522. </div>
  523. <span className="modal-box-title">活动形式</span>
  524. <div className="modal-box-detail" style={{ width: '160px' }}>
  525. <Select placeholder="选择活动形式"
  526. style={{ width: 120 }}
  527. value={this.state.RowData.form}
  528. onChange={(e) => {
  529. this.state.RowData.form = e;
  530. this.setState({ RowData: this.state.RowData });
  531. }}>
  532. {this.state.activityFormOption}
  533. </Select>
  534. </div>
  535. </div>
  536. <div className="modal-box">
  537. <span className="modal-box-title">活动地址</span>
  538. <div className="modal-box-detail">
  539. <Input value={this.state.RowData.address}
  540. onChange={(e) => {
  541. this.state.RowData.address = e.target.value;
  542. this.setState({ RowData: this.state.RowData });
  543. }} />
  544. </div>
  545. </div>
  546. <div className="modal-box">
  547. <span className="modal-box-title">主办单位</span>
  548. <div className="modal-box-detail">
  549. <Input value={this.state.RowData.host}
  550. onChange={(e) => {
  551. this.state.RowData.host = e.target.value;
  552. this.setState({ RowData: this.state.RowData });
  553. }} />
  554. </div>
  555. </div>
  556. <div className="modal-box">
  557. <span className="modal-box-title">承办单位</span>
  558. <div className="modal-box-detail">
  559. <Input value={this.state.RowData.undertake}
  560. onChange={(e) => {
  561. this.state.RowData.undertake = e.target.value;
  562. this.setState({ RowData: this.state.RowData });
  563. }} />
  564. </div>
  565. </div>
  566. <div className="modal-box">
  567. <span className="modal-box-title">协办单位</span>
  568. <div className="modal-box-detail">
  569. <Input value={this.state.asist} style={{ width: '320px', marginRight: '20px' }}
  570. onChange={(e) => { this.setState({ asist: e.target.value }); }} />
  571. <Button onClick={() => {
  572. let _me = this, theArr = this.state.asistArray.concat(), theBool = true;
  573. if (!theArr.length) {
  574. theArr.push(this.state.asist);
  575. } else {
  576. this.state.asistArray.map((item, i) => {
  577. if (item === _me.state.asist) {
  578. theBool = false;
  579. };
  580. });
  581. if (theBool) {
  582. theArr.push(_me.state.asist);
  583. } else {
  584. message.warning('已经录入该单位!')
  585. }
  586. };
  587. this.setState({ asistArray: theArr, asist: null });
  588. }}>添加</Button>
  589. </div>
  590. <div className="modal-box-detail" style={{ marginLeft: '106px' }}>
  591. {this.state.asistArray.map((item, i) => {
  592. return <p key={i}>{item}</p>
  593. })}
  594. </div>
  595. </div>
  596. <div className="modal-box">
  597. <span className="modal-box-title">活动时间</span>
  598. <div className="modal-box-detail">
  599. <DatePicker style={{ width: '150px' }}
  600. showTime
  601. format="YYYY-MM-DD HH:mm:ss"
  602. placeholder="选择开始时间"
  603. value={this.state.RowData.startTimeFormattedDate ? moment(this.state.RowData.startTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  604. onChange={(t, str) => {
  605. this.state.RowData.startTimeFormattedDate = str;
  606. this.setState({ RowData: this.state.RowData });
  607. }} />
  608. <span>到</span>
  609. <DatePicker style={{ width: '150px' }}
  610. showTime
  611. format="YYYY-MM-DD HH:mm:ss"
  612. placeholder="选择结束时间"
  613. value={this.state.RowData.endTimeFormattedDate ? moment(this.state.RowData.endTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  614. onChange={(t, str) => {
  615. this.state.RowData.endTimeFormattedDate = str;
  616. this.setState({ RowData: this.state.RowData });
  617. }} />
  618. </div>
  619. </div>
  620. <div className="modal-box">
  621. <span className="modal-box-title">报名截止时间</span>
  622. <div className="modal-box-detail">
  623. <DatePicker style={{ width: '150px' }}
  624. showTime
  625. format="YYYY-MM-DD HH:mm:ss"
  626. placeholder="选择截止时间"
  627. value={this.state.RowData.enrollDeadlineFormattedDate ? moment(this.state.RowData.enrollDeadlineFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  628. onChange={(t, str) => {
  629. this.state.RowData.enrollDeadlineFormattedDate = str;
  630. this.setState({ RowData: this.state.RowData });
  631. }} />
  632. </div>
  633. </div>
  634. <div className="modal-box">
  635. <span className="modal-box-title">活动图片</span>
  636. <div className="modal-box-detail">
  637. <PicturesWall
  638. fileList={(e) => { this.state.RowData.imgUrls = e; this.setState({ RowData: this.state.RowData }); }}
  639. pictureUrl={this.state.RowData.imgUrls || []} />
  640. </div>
  641. </div>
  642. <div className="modal-box">
  643. <span className="modal-box-title">活动结果描述</span>
  644. <div className="modal-box-detail">
  645. <Input type="textarea" rows={4} value={this.state.RowData.result}
  646. onChange={(e) => {
  647. this.state.RowData.result = e.target.value;
  648. this.setState({ RowData: this.state.RowData });
  649. }} />
  650. </div>
  651. </div>
  652. </div>
  653. <div className="modal-box">
  654. <Button type="primary" onClick={this.submit}>提交</Button>
  655. <Button type="ghost" onClick={() => { this.setState({ visible: false }) }}>取消</Button>
  656. </div>
  657. </Spin>
  658. </Modal>
  659. </div >
  660. );
  661. }
  662. });
  663. export default Activity;