From 5a887acf1924950715086633d329db045223b5c4 Mon Sep 17 00:00:00 2001 From: liuwh <hugeinfo123> Date: Tue, 09 Jun 2020 14:47:27 +0800 Subject: [PATCH] test --- SunshineIns/src/page/ActiveManageEdit.jsx | 92 +++++++++++++++++++++++---------------------- 1 files changed, 47 insertions(+), 45 deletions(-) diff --git a/SunshineIns/src/page/ActiveManageEdit.jsx b/SunshineIns/src/page/ActiveManageEdit.jsx index 00ccef8..f4bd483 100644 --- a/SunshineIns/src/page/ActiveManageEdit.jsx +++ b/SunshineIns/src/page/ActiveManageEdit.jsx @@ -83,7 +83,6 @@ if (endTime == null) { endTime = Date.now(); } - console.log(res.attachments) this.setState({ savedate: { ...res.activity, @@ -125,18 +124,18 @@ })) } - selectonClick = () => { + selectonClick = (value) => { this.setState({ questionnaireModal: true, modalLoading: true }) Fetch.questionQuery({ status: 3, + title : value, page: this.state.page, size: this.state.pageSize, }) .then(res => { - console.log('res', res); this.setState({ modalLoading: false }) @@ -154,6 +153,10 @@ }); } + selClick = () =>{ + this.selectonClick(""); + } + selectCancelModel = () => { this.setState({ questionnaireModal: false, @@ -164,7 +167,7 @@ questionnaireCancle = () => { - const {selectedQuestionnaireData}=this.state; + const { selectedQuestionnaireData } = this.state; // this.props.history.push(`/questionnaire/detail/${selectedQuestionnaireData.id}`) window.open('index.html#/activeManageEditquestionnaire/' + selectedQuestionnaireData.id); } @@ -174,24 +177,16 @@ } handleOk = (e) => { - console.log(e) this.setState({ questionnaireModal: false, selectedRowKeys: [] }) } - questionnaireSearch = (value) => { - console.log(value) - } - submit = () => { const { savedate, selectedQuestionnaireData, fileList } = this.state; savedate.startTime = moment(savedate.startDate + " " + moment(savedate.startHour).format(format), 'YYYY-MM-DD HH:mm') savedate.endTime = moment(savedate.endDate + " " + moment(savedate.endHour).format(format), 'YYYY-MM-DD HH:mm') - // console.log({...savedate,queId:selectedQuestionnaireData[0].id}); - console.log(savedate); - console.log(selectedQuestionnaireData); if (!savedate.host) { message.warning("主持人不能为空"); return; @@ -265,7 +260,6 @@ } getNum = (e) => { - console.log(e.target.value) this.setState({ num: e.target.value }) @@ -306,12 +300,10 @@ } confirm = (e) => { - console.log(e); const data = { id: e, status: 2 }; this.setState({ loading: true }) Fetch.auditPerson(data).then(res => { if (res.code == 0) { - console.log(res) this.setState({ loading: false }) message.success('审核通过'); this.getDetail(); @@ -324,12 +316,10 @@ } cancel = (e) => { - console.log(e); const data = { id: e, status: 4 }; this.setState({ loading: true }) Fetch.auditPerson(data).then(res => { if (res.code == 0) { - console.log(res) this.setState({ loading: false }) message.error('审核不通过'); this.getDetail(); @@ -387,13 +377,23 @@ } handleEditorChange = (editorState) => { + console.log('editorState', editorState) this.setState({ editorState }) + const htmlContent = editorState.toHTML() + console.log(htmlContent) + this.setState(({ savedate }) => ({ + savedate: { + ...savedate, + course: htmlContent + } + })) } submitContent = () => { // 在编辑器获得焦点时按下ctrl+s会执行此方法 // 编辑器内容提交到服务端之前,可直接调用editorState.toHTML()来获取HTML格式的内容 const htmlContent = this.state.editorState.toHTML() + console.log(htmlContent) this.setState(({ savedate }) => ({ savedate: { ...savedate, @@ -404,10 +404,6 @@ onSelectChange = (selectedRowKeys, selectedRows) => { const { tableData } = this.state; - console.log('selectedRowKeys changed: ', selectedRowKeys); - console.log('selectedRowKeys changed: ', selectedRows); - console.log(tableData[selectedRowKeys[0]]); - console.log(tableData); this.setState({ selectedQuestionnaireData: tableData[selectedRowKeys[0]], selectedRowKeys @@ -417,7 +413,6 @@ handleCancel = () => this.setState({ previewVisible: false }) render() { const { savedate, previewVisible, previewImage, editorState, selectedRowKeys, fileList, attList1, dateSource, code, hitList, activityType, disabled, loading, modalLoading } = this.state; - console.log('disabled', fileList) const props = { action: domain + 'api/v1/attachment/materials?entityId=' + savedate.id, onChange: ({ file, fileList }) => { @@ -482,7 +477,7 @@ ) }]; const questionnaireColumns = [{ - title: '主题', + title: '问卷标题', dataIndex: 'title', key: 'title', ellipsis: true, @@ -510,16 +505,18 @@ title: '报名方', dataIndex: 'proposerName', key: 'proposerName' - }, { - title: '报名方性质', - dataIndex: 'signerType', - key: 'signerType', - render: text => (<span>{text == 1 ? '个人' : '企业'}</span>) - }, { - title: '报名人数', - dataIndex: 'signNum', - key: 'signNum', - }, { + }, + // { + // title: '报名方性质', + // dataIndex: 'signerType', + // key: 'signerType', + // render: text => (<span>{text == 1 ? '个人' : '企业'}</span>) + // }, { + // title: '报名人数', + // dataIndex: 'signNum', + // key: 'signNum', + // }, + { title: '审核状态', dataIndex: 'signStatus', key: 'signStatus', @@ -539,10 +536,9 @@ cancelText="不通过" > <a href="#">审核</a> - </Popconfirm> : <span disabled>审核</span> + </Popconfirm> : <span disabled></span> ) }]; - return ( <div className="app-page"> <Spin spinning={loading}> @@ -677,7 +673,7 @@ <Button type="link" onClick={this.questionnaireCancle}>查看</Button> <Button type="link" onClick={this.questionnaireDel}>删除</Button> </div> : - <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.selectonClick}>请选择</Button> + <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.selClick}>请选择</Button> } </Col> </Row> @@ -690,10 +686,10 @@ this.state.selectedQuestionnaireData.title ? <div> <span style={{ margin: '0 20px' }}>{this.state.selectedQuestionnaireData.title}</span> - <Button type="link" disabled onClick={this.questionnaireCancle}>查看</Button> + <Button type="link" onClick={this.questionnaireCancle}>查看</Button> <Button type="link" disabled onClick={this.questionnaireDel}>删除</Button> </div> : - <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.selectonClick}>请选择</Button> + <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.selClick}>请选择</Button> } </Col> </Row> @@ -701,21 +697,21 @@ } { - activityType == 'act_1' ? (dateSource.length > 0 ? + savedate.activityType == 'act_1' ? (dateSource.length > 0 ? <div style={divStyle}> <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>报名人员信息</Divider> <TableView columns={columns} data={dateSource} pageSize='6' size='small' /> </div> : null) : null } { - activityType == 'act_2' || activityType == 'act_3' ? (dateSource.length > 0 ? + savedate.activityType == 'act_2' || savedate.activityType == 'act_3' ? (dateSource.length > 0 ? <div style={divStyle}> <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>报名名单</Divider> <TableView columns={act2columns} data={dateSource} pageSize='6' size='small' /> </div> : null) : null } { - activityType == 'act_2' || activityType == 'act_3' ? (dateSource.length > 0 ? + savedate.activityType == 'act_2' || savedate.activityType == 'act_3' ? (dateSource.length > 0 ? <div style={divStyle}> <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>培训结果</Divider> <div style={divStyle}> @@ -730,13 +726,19 @@ </Modal> </Col> </Row> + <Row type="flex" align='top' justify="space-around"> + <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>培训结果</span></Col> + <Col span={18} push={0} > + <span>{savedate.result}</span> + </Col> + </Row> </div> </div> : null) : null } { - activityType == 'act_1' && ( + savedate.activityType == 'act_1' && ( savedate.activityStatus == null || savedate.activityStatus == 0 ? <div style={{ display: 'flex', justifyContent: 'center' }}> <Button style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.submit}>提交</Button> @@ -756,7 +758,7 @@ ) } { - activityType == 'act_2' || activityType == 'act_3' && ( + savedate.activityType == 'act_2' || savedate.activityType == 'act_3' ? ( savedate.activityStatus == null || savedate.activityStatus == 0 ? <div style={{ display: 'flex', justifyContent: 'center' }}> <Button style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.submit}>提交</Button> @@ -773,7 +775,7 @@ <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button> </div> ) - ) + ) : '' } </BusDetailView> @@ -829,7 +831,7 @@ enterButton="查询" size="large" style={{ margin: '12px' }} - onSearch={value => this.questionnaireSearch(value)} + onSearch={value => this.selectonClick(value)} /> <Table -- Gitblit v1.8.0