From 101098593cd1d998979cb8c603276b8f6687942e Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Wed, 08 Apr 2020 14:45:02 +0800
Subject: [PATCH] 修复问卷编辑问题
---
SunshineIns/src/page/ActiveManageEdit.jsx | 69 +++++++++++++++-------------------
1 files changed, 30 insertions(+), 39 deletions(-)
diff --git a/SunshineIns/src/page/ActiveManageEdit.jsx b/SunshineIns/src/page/ActiveManageEdit.jsx
index 54d86a0..2c3caca 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,
@@ -136,7 +135,6 @@
size: this.state.pageSize,
})
.then(res => {
- console.log('res', res);
this.setState({
modalLoading: false
})
@@ -174,24 +172,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 +255,6 @@
}
getNum = (e) => {
- console.log(e.target.value)
this.setState({
num: e.target.value
})
@@ -306,12 +295,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 +311,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 +372,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 +399,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 +408,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 }) => {
@@ -510,16 +500,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 +531,9 @@
cancelText="不通过"
>
<a href="#">审核</a>
- </Popconfirm> : <span disabled>审核</span>
+ </Popconfirm> : <span disabled></span>
)
}];
-
return (
<div className="app-page">
<Spin spinning={loading}>
@@ -690,7 +681,7 @@
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>
@@ -701,21 +692,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}>
@@ -742,7 +733,7 @@
}
{
- 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>
@@ -762,7 +753,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>
@@ -779,7 +770,7 @@
<Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
</div>
)
- )
+ ) : '123'
}
</BusDetailView>
--
Gitblit v1.8.0