| | |
| | | if (endTime == null) { |
| | | endTime = Date.now(); |
| | | } |
| | | console.log |
| | | console.log(res.attachments) |
| | | this.setState({ |
| | | savedate: { |
| | | ...res.activity, |
| | |
| | | status: res.activity.activityStatus || '', |
| | | disabled: res.activity.activityStatus == 0 ? false : true, |
| | | dateSource: res.personList || [], |
| | | // fileList: res.attachments.length > 0 ? res.attachments.filter(item=>(item.typeId==1000)) : [], |
| | | fileList: res.attachments || [], |
| | | loading: false, |
| | | }); |
| | |
| | | handleCancel = () => this.setState({ previewVisible: false }) |
| | | render() { |
| | | const { savedate, previewVisible, previewImage,editorState, fileList, dateSource, code, hitList, activityType, disabled, loading } = this.state; |
| | | console.log('disabled', disabled) |
| | | console.log('disabled', fileList) |
| | | const props = { |
| | | action: domain + 'api/v1/attachment/materials?entityId=' + savedate.id, |
| | | onChange: ({ file, fileList }) => { |
| | | this.setState({ fileList }); |
| | | }, |
| | | fileList: fileList, |
| | | fileList: fileList.filter(item=>(item.typeId==1000)), |
| | | onRemove: (file) => { |
| | | Fetch.deleteAttachment(file.uid) |
| | | .then(res => { |
| | | message.success("移除成功!"); |
| | | }); |
| | | this.setState(({ fileList }) => { |
| | | const index = fileList.indexOf(file); |
| | | const newFileList = fileList.slice(); |
| | | newFileList.splice(index, 1); |
| | | return { |
| | | fileList: newFileList, |
| | | }; |
| | | }); |
| | | } |
| | | }; |
| | | const bottmProps = { |
| | | action: domain + 'api/v1/attachment/materials?entityId=' + savedate.id, |
| | | onChange: ({ file, fileList }) => { |
| | | this.setState({ fileList }); |
| | | }, |
| | | fileList: fileList.filter(item=>(item.typeId==1020)), |
| | | onRemove: (file) => { |
| | | Fetch.deleteAttachment(file.uid) |
| | | .then(res => { |
| | |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/activeManage">活动管理</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item><a href="index.html#/activeManage">法治活动</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>活动发布</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='活动发布' > |
| | |
| | | </div> : null) : null |
| | | } |
| | | { |
| | | activityType == 'act_2' || activityType == 'act_3' ? (dateSource.length > 0 ? |
| | | <div style={divStyle}> |
| | | <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>培训结果</Divider> |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='top' justify="space-around"> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>添加图片</span></Col> |
| | | <Col span={18} push={0} > |
| | | <Upload disabled={disabled} listType="picture-card" onPreview={this.handlePreview} {...bottmProps}> |
| | | |
| | | </Upload> |
| | | <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}> |
| | | <img alt="example" style={{ width: '100%' }} src={previewImage} /> |
| | | </Modal> |
| | | </Col> |
| | | </Row> |
| | | </div> |
| | | </div> : null) : null |
| | | } |
| | | |
| | | { |
| | | activityType == 'act_1' && ( |
| | | savedate.activityStatus == null || savedate.activityStatus == 0 ? |
| | | <div style={{ display: 'flex', justifyContent: 'center' }}> |