activity.jsx 32 KB

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