activity.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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. onRowClick={this.tableRowClick} />
  475. </Spin>
  476. </div>
  477. <Modal title="活动详情" width={600} className="activity-modal"
  478. visible={this.state.visible}
  479. maskClosable={false}
  480. footer={null}
  481. afterClose={() => { this.state.RowData = {}; this.state.asist = null; this.state.asistArray = []; }}
  482. onCancel={() => { this.setState({ visible: false }) }} >
  483. <Spin spinning={this.state.loading}>
  484. <div className="clearfix">
  485. <div className="modal-box">
  486. <span className="modal-box-title">活动标题</span>
  487. <div className="modal-box-detail">
  488. <Input value={this.state.RowData.name}
  489. onChange={(e) => {
  490. this.state.RowData.name = e.target.value;
  491. this.setState({ RowData: this.state.RowData });
  492. }} />
  493. </div>
  494. </div>
  495. <div className="modal-box">
  496. <span className="modal-box-title">标题图片</span>
  497. <div className="modal-box-detail clearfix" style={{ width: '360px' }}>
  498. <Avatar visible={this.state.visible}
  499. imageUrl={this.state.RowData.titleUrl ? (globalConfig.avatarHost + "/upload" + this.state.RowData.titleUrl) : null}
  500. urlData={(url) => { this.state.RowData.titleUrl = url }} />
  501. </div>
  502. </div>
  503. <div className="modal-box">
  504. <span className="modal-box-title">活动描述</span>
  505. <div className="modal-box-detail">
  506. <Input type="textarea" rows={4} value={this.state.RowData.summary}
  507. onChange={(e) => {
  508. this.state.RowData.summary = e.target.value;
  509. this.setState({ RowData: this.state.RowData });
  510. }} />
  511. </div>
  512. </div>
  513. <div className="modal-box">
  514. <span className="modal-box-title">活动类型</span>
  515. <div className="modal-box-detail" style={{ width: '160px' }}>
  516. <Select placeholder="选择活动类型"
  517. style={{ width: 120 }}
  518. value={this.state.RowData.type}
  519. onChange={(e) => {
  520. this.state.RowData.type = e;
  521. this.setState({ RowData: this.state.RowData });
  522. }}>
  523. {this.state.activityTypeOption}
  524. </Select>
  525. </div>
  526. <span className="modal-box-title">活动形式</span>
  527. <div className="modal-box-detail" style={{ width: '160px' }}>
  528. <Select placeholder="选择活动形式"
  529. style={{ width: 120 }}
  530. value={this.state.RowData.form}
  531. onChange={(e) => {
  532. this.state.RowData.form = e;
  533. this.setState({ RowData: this.state.RowData });
  534. }}>
  535. {this.state.activityFormOption}
  536. </Select>
  537. </div>
  538. </div>
  539. <div className="modal-box">
  540. <span className="modal-box-title">活动地址</span>
  541. <div className="modal-box-detail">
  542. <Input value={this.state.RowData.address}
  543. onChange={(e) => {
  544. this.state.RowData.address = e.target.value;
  545. this.setState({ RowData: this.state.RowData });
  546. }} />
  547. </div>
  548. </div>
  549. <div className="modal-box">
  550. <span className="modal-box-title">主办单位</span>
  551. <div className="modal-box-detail">
  552. <Input value={this.state.RowData.host}
  553. onChange={(e) => {
  554. this.state.RowData.host = e.target.value;
  555. this.setState({ RowData: this.state.RowData });
  556. }} />
  557. </div>
  558. </div>
  559. <div className="modal-box">
  560. <span className="modal-box-title">承办单位</span>
  561. <div className="modal-box-detail">
  562. <Input value={this.state.RowData.undertake}
  563. onChange={(e) => {
  564. this.state.RowData.undertake = e.target.value;
  565. this.setState({ RowData: this.state.RowData });
  566. }} />
  567. </div>
  568. </div>
  569. <div className="modal-box">
  570. <span className="modal-box-title">协办单位</span>
  571. <div className="modal-box-detail">
  572. <Input value={this.state.asist} style={{ width: '320px', marginRight: '20px' }}
  573. onChange={(e) => { this.setState({ asist: e.target.value }); }} />
  574. <Button onClick={() => {
  575. if (!this.state.asist || this.state.asist.length == 0) {
  576. return;
  577. }
  578. let _me = this, theArr = this.state.asistArray.concat(), theBool = true;
  579. if (!theArr.length) {
  580. theArr.push(this.state.asist);
  581. } else {
  582. this.state.asistArray.map((item, i) => {
  583. if (item === _me.state.asist) {
  584. theBool = false;
  585. };
  586. });
  587. if (theBool) {
  588. theArr.push(_me.state.asist);
  589. } else {
  590. message.warning('已经录入该单位!')
  591. }
  592. };
  593. this.setState({ asistArray: theArr, asist: null });
  594. }}>添加</Button>
  595. </div>
  596. <div className="modal-box-detail" style={{ marginLeft: '106px' }}>
  597. {this.state.asistArray.map((item, i) => {
  598. return <p key={i}>{item}</p>
  599. })}
  600. </div>
  601. </div>
  602. <div className="modal-box">
  603. <span className="modal-box-title">活动时间</span>
  604. <div className="modal-box-detail">
  605. <DatePicker style={{ width: '150px' }}
  606. showTime
  607. format="YYYY-MM-DD HH:mm:ss"
  608. placeholder="选择开始时间"
  609. value={this.state.RowData.startTimeFormattedDate ? moment(this.state.RowData.startTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  610. onChange={(t, str) => {
  611. this.state.RowData.startTimeFormattedDate = str;
  612. this.setState({ RowData: this.state.RowData });
  613. }} />
  614. <span>到</span>
  615. <DatePicker style={{ width: '150px' }}
  616. showTime
  617. format="YYYY-MM-DD HH:mm:ss"
  618. placeholder="选择结束时间"
  619. value={this.state.RowData.endTimeFormattedDate ? moment(this.state.RowData.endTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  620. onChange={(t, str) => {
  621. this.state.RowData.endTimeFormattedDate = str;
  622. this.setState({ RowData: this.state.RowData });
  623. }} />
  624. </div>
  625. </div>
  626. <div className="modal-box">
  627. <span className="modal-box-title">报名截止时间</span>
  628. <div className="modal-box-detail">
  629. <DatePicker style={{ width: '150px' }}
  630. showTime
  631. format="YYYY-MM-DD HH:mm:ss"
  632. placeholder="选择截止时间"
  633. value={this.state.RowData.enrollDeadlineFormattedDate ? moment(this.state.RowData.enrollDeadlineFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
  634. onChange={(t, str) => {
  635. this.state.RowData.enrollDeadlineFormattedDate = str;
  636. this.setState({ RowData: this.state.RowData });
  637. }} />
  638. </div>
  639. </div>
  640. <div className="modal-box">
  641. <span className="modal-box-title">活动图片</span>
  642. <div className="modal-box-detail">
  643. <PicturesWall
  644. fileList={(e) => { this.state.RowData.imgUrls = e; this.setState({ RowData: this.state.RowData }); }}
  645. pictureUrl={this.state.RowData.imgUrls || []} />
  646. </div>
  647. </div>
  648. <div className="modal-box">
  649. <span className="modal-box-title">活动结果描述</span>
  650. <div className="modal-box-detail">
  651. <Input type="textarea" rows={4} value={this.state.RowData.result}
  652. onChange={(e) => {
  653. this.state.RowData.result = e.target.value;
  654. this.setState({ RowData: this.state.RowData });
  655. }} />
  656. </div>
  657. </div>
  658. </div>
  659. <div className="modal-box">
  660. <Button type="primary" onClick={this.submit}>提交</Button>
  661. <Button type="ghost" onClick={() => { this.setState({ visible: false }) }}>取消</Button>
  662. </div>
  663. </Spin>
  664. </Modal>
  665. </div >
  666. );
  667. }
  668. });
  669. export default Activity;