Commit 883f1a63 by chengming

修改bug

parent e259ecb8
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
Table, Table,
Button, Button,
message, message,
Popconfirm
} from "antd"; } from "antd";
import Head from "./head"; import Head from "./head";
import AddEditForm from "./addEditForm"; import AddEditForm from "./addEditForm";
...@@ -718,7 +719,7 @@ class Information extends React.Component { ...@@ -718,7 +719,7 @@ class Information extends React.Component {
message.warning("新闻类文章必须上传logo"); message.warning("新闻类文章必须上传logo");
return; return;
} }
if (!values.type[1] ) { if (!values.type[1]) {
message.warning("所属栏位子级未选择"); message.warning("所属栏位子级未选择");
return; return;
} }
...@@ -763,7 +764,7 @@ class Information extends React.Component { ...@@ -763,7 +764,7 @@ class Information extends React.Component {
message.warning("新闻类文章必须上传logo"); message.warning("新闻类文章必须上传logo");
return; return;
} }
if (!values.type[1] ) { if (!values.type[1]) {
message.warning("所属栏位子级未选择"); message.warning("所属栏位子级未选择");
return; return;
} }
...@@ -1107,12 +1108,20 @@ class Information extends React.Component { ...@@ -1107,12 +1108,20 @@ class Information extends React.Component {
> >
编辑 编辑
</a> </a>
<Popconfirm
title="确定要删除吗?"
okText="确定"
cancelText="取消"
onConfirm={() => this.delete(record.id)}
>
{/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
<a <a
className={Styles.marr10} className={Styles.marr10}
onClick={() => this.delete(record.id)} href="#"
> >
删除 删除
</a> </a>
</Popconfirm>
</div> </div>
)} )}
</div> </div>
......
...@@ -2,21 +2,14 @@ import React, { Component } from "react"; ...@@ -2,21 +2,14 @@ import React, { Component } from "react";
import { import {
Button, Button,
Table, Table,
Icon,
Steps,
Select, Select,
Input, Input,
InputNumber, InputNumber,
Modal, Modal,
Form, Form,
Tabs,
Upload,
Radio, Radio,
DatePicker,
message, message,
Transfer, Popconfirm
Tag,
Tooltip,
} from "antd"; } from "antd";
import func from "@/util/commonFunc.js"; import func from "@/util/commonFunc.js";
...@@ -257,19 +250,19 @@ class AddQuestion extends Component { ...@@ -257,19 +250,19 @@ class AddQuestion extends Component {
title: "序号", title: "序号",
dataIndex: "code", dataIndex: "code",
key: "code", key: "code",
width: "16.5%", width: "5%",
}, },
{ {
title: "题干", title: "题干",
dataIndex: "topic", dataIndex: "topic",
key: "topic", key: "topic",
width: "16.5%", width: "30%",
}, },
{ {
title: "分数", title: "分数",
dataIndex: "score", dataIndex: "score",
key: "score", key: "score",
width: "16.5%", width: "20%",
render: (text, record, index) => ( render: (text, record, index) => (
<InputNumber <InputNumber
key={this.state.randoming + index} key={this.state.randoming + index}
...@@ -277,7 +270,7 @@ class AddQuestion extends Component { ...@@ -277,7 +270,7 @@ class AddQuestion extends Component {
step={0.1} step={0.1}
formatter={limitDecimals} formatter={limitDecimals}
parser={limitDecimals} parser={limitDecimals}
style={{ width: 60, margin: 0 }} style={{ width: 120, margin: 0 }}
defaultValue={text.score ? text.score : 0} defaultValue={text.score ? text.score : 0}
onBlur={e => this.changeScore(e, text.id)} onBlur={e => this.changeScore(e, text.id)}
/> />
...@@ -287,13 +280,13 @@ class AddQuestion extends Component { ...@@ -287,13 +280,13 @@ class AddQuestion extends Component {
title: "类型", title: "类型",
dataIndex: "type", dataIndex: "type",
key: "type", key: "type",
width: "16.5%", width: "10%",
}, },
{ {
title: "排序", title: "排序",
dataIndex: "rank", dataIndex: "rank",
key: "rank", key: "rank",
width: "16.5%", width: "15%",
render: (text, record) => ( render: (text, record) => (
<div className="operation"> <div className="operation">
<a <a
...@@ -303,6 +296,7 @@ class AddQuestion extends Component { ...@@ -303,6 +296,7 @@ class AddQuestion extends Component {
上移 上移
</a> </a>
<a <a
style={{ marginLeft: '10px' }}
href="javascript:void(0)" href="javascript:void(0)"
onClick={() => self.downMove(text, record)} onClick={() => self.downMove(text, record)}
> >
...@@ -315,15 +309,22 @@ class AddQuestion extends Component { ...@@ -315,15 +309,22 @@ class AddQuestion extends Component {
title: "操作", title: "操作",
key: "action", key: "action",
dataIndex: "action", dataIndex: "action",
width: "16.5%", width: "15%",
render: (text, record, index) => ( render: (text, record, index) => (
<div className="operation"> <div className="operation">
<Popconfirm
title="确定要删除吗?"
okText="确定"
cancelText="取消"
onConfirm={() => self.deleteQuestion(text.id, index)}
>
{/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
<a <a
href="javascript:void(0)" href="#"
onClick={() => self.deleteQuestion(text.id, index)}
> >
删除 删除
</a> </a>
</Popconfirm>
</div> </div>
), ),
}, },
...@@ -333,7 +334,7 @@ class AddQuestion extends Component { ...@@ -333,7 +334,7 @@ class AddQuestion extends Component {
title: "序号", title: "序号",
dataIndex: "code", dataIndex: "code",
key: "code", key: "code",
width: "25%", width: "10%",
}, },
{ {
title: "题干", title: "题干",
...@@ -420,7 +421,7 @@ class AddQuestion extends Component { ...@@ -420,7 +421,7 @@ class AddQuestion extends Component {
if (this.id) { if (this.id) {
this.props.getExamInfo(this.id, () => { this.props.getExamInfo(this.id, () => {
_this.initState(_this.props.examInfo); _this.initState(_this.props.examInfo);
if (_this.props.examInfo.makeStrategy === 2 && _this.props.examInfo.libraryId && _this.props.examInfo.libraryId!="0") { if (_this.props.examInfo.makeStrategy === 2 && _this.props.examInfo.libraryId && _this.props.examInfo.libraryId != "0") {
_this.props.getLibraryCount( _this.props.getLibraryCount(
{ examId: examID, libraryId: _this.props.examInfo.libraryId }, { examId: examID, libraryId: _this.props.examInfo.libraryId },
res => { res => {
...@@ -458,8 +459,8 @@ class AddQuestion extends Component { ...@@ -458,8 +459,8 @@ class AddQuestion extends Component {
id: _this.props.examInfo.libraryId, id: _this.props.examInfo.libraryId,
} }
: null, : null,
selectedRowId: _this.props.examInfo && _this.props.examInfo.libraryId!="0" && [ selectedRowId: _this.props.examInfo && _this.props.examInfo.libraryId != "0" && [
_this.props.examInfo.libraryId , _this.props.examInfo.libraryId,
], ],
optionRank: 1, optionRank: 1,
random: "", random: "",
...@@ -561,7 +562,7 @@ class AddQuestion extends Component { ...@@ -561,7 +562,7 @@ class AddQuestion extends Component {
this.setState({ this.setState({
selectedRowrecord: selectedRows[0], selectedRowrecord: selectedRows[0],
selectedRowId: selectedRowKeys, selectedRowId: selectedRowKeys,
selectedrecord: { id: selectedRowKeys[0].id,name: selectedRowKeys[0].name }, selectedrecord: { id: selectedRowKeys[0].id, name: selectedRowKeys[0].name },
}); });
}; };
...@@ -614,8 +615,8 @@ class AddQuestion extends Component { ...@@ -614,8 +615,8 @@ class AddQuestion extends Component {
handleCancelBank = () => { handleCancelBank = () => {
this.setState({ this.setState({
visible: false, visible: false,
selectedrecord:null, selectedrecord: null,
selectedRowKeys2:[], selectedRowKeys2: [],
}); });
}; };
//添加题库确定按钮 //添加题库确定按钮
...@@ -952,7 +953,7 @@ class AddQuestion extends Component { ...@@ -952,7 +953,7 @@ class AddQuestion extends Component {
stemKey: "", stemKey: "",
typeKey: 0, typeKey: 0,
// selectedrecord:null, 该字段为页面上已选择的题库,如果此时清空会导致删除已选的必考题的时候不能实时刷新必考题列表 // selectedrecord:null, 该字段为页面上已选择的题库,如果此时清空会导致删除已选的必考题的时候不能实时刷新必考题列表
selectedRowKeys2:[], selectedRowKeys2: [],
}); });
} }
} else { } else {
...@@ -966,8 +967,8 @@ class AddQuestion extends Component { ...@@ -966,8 +967,8 @@ class AddQuestion extends Component {
libraryKey: "", libraryKey: "",
stemKey: "", stemKey: "",
typeKey: 0, typeKey: 0,
selectedrecord:null, selectedrecord: null,
selectedRowKeys2:[], selectedRowKeys2: [],
}); });
} }
} }
...@@ -1119,7 +1120,7 @@ class AddQuestion extends Component { ...@@ -1119,7 +1120,7 @@ class AddQuestion extends Component {
getExamPreview(examID, () => { getExamPreview(examID, () => {
const { examPreview } = _this.props; const { examPreview } = _this.props;
if (questionWay != 1) { if (questionWay != 1) {
if(selectedrecord && selectedrecord.id){ if (selectedrecord && selectedrecord.id) {
getLibraryCount({ examId: examID, libraryId: selectedrecord.id }); getLibraryCount({ examId: examID, libraryId: selectedrecord.id });
} }
} }
...@@ -1335,7 +1336,7 @@ class AddQuestion extends Component { ...@@ -1335,7 +1336,7 @@ class AddQuestion extends Component {
id: this.props.examID, id: this.props.examID,
// id: "987204670085234688" // id: "987204670085234688"
}; };
importQuestions(json, function() { importQuestions(json, function () {
message.success("导入成功"); message.success("导入成功");
}); });
} }
...@@ -1442,7 +1443,7 @@ class AddQuestion extends Component { ...@@ -1442,7 +1443,7 @@ class AddQuestion extends Component {
onChange(current, pageSize) { onChange(current, pageSize) {
getQuestionBankList({ pageindex: current, pagesize: 20 }); getQuestionBankList({ pageindex: current, pagesize: 20 });
}, },
size:"small" size: "small"
}; };
pagination.total = questionTotal; pagination.total = questionTotal;
pagination.showTotal = total => `总共:${total} `; pagination.showTotal = total => `总共:${total} `;
...@@ -1922,7 +1923,9 @@ class AddQuestion extends Component { ...@@ -1922,7 +1923,9 @@ class AddQuestion extends Component {
</Modal> </Modal>
</div> </div>
)} )}
{this.props.questionWay != 1 && (
<h3 style={{ marginTop: 40 }}>试题排序</h3> <h3 style={{ marginTop: 40 }}>试题排序</h3>
)}
<Form onSubmit={this.rankSubmit}> <Form onSubmit={this.rankSubmit}>
{this.props.questionWay != 1 && ( {this.props.questionWay != 1 && (
<FormItem {...formItemLayout} label="出题策略"> <FormItem {...formItemLayout} label="出题策略">
...@@ -1960,7 +1963,7 @@ class AddQuestion extends Component { ...@@ -1960,7 +1963,7 @@ class AddQuestion extends Component {
"/" + "/" +
func.siteCode + func.siteCode +
"/index/tool/test/test-management/edit", "/index/tool/test/test-management/edit",
search:`?id=${this.props.examID}`, search: `?id=${this.props.examID}`,
state: { id: this.props.examID }, state: { id: this.props.examID },
}} }}
> >
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
Divider, Divider,
message, message,
Spin, Spin,
Popconfirm
} from "antd"; } from "antd";
import Breadcrumb from "@/common/Breadcrumb"; import Breadcrumb from "@/common/Breadcrumb";
import func from "@/util/commonFunc.js"; import func from "@/util/commonFunc.js";
...@@ -138,7 +139,7 @@ class Exam extends Component { ...@@ -138,7 +139,7 @@ class Exam extends Component {
"/" + "/" +
func.siteCode + func.siteCode +
`/index/tool/test/test-management/look`, `/index/tool/test/test-management/look`,
search:`?id=${text.id}`, search: `?id=${text.id}`,
state: { id: text.id }, state: { id: text.id },
}} }}
> >
...@@ -220,7 +221,7 @@ class Exam extends Component { ...@@ -220,7 +221,7 @@ class Exam extends Component {
"/" + "/" +
func.siteCode + func.siteCode +
`/index/tool/test/test-management/edit`, `/index/tool/test/test-management/edit`,
search:`?id=${text.id}`, search: `?id=${text.id}`,
state: { id: text.id }, state: { id: text.id },
}} }}
> >
...@@ -242,13 +243,21 @@ class Exam extends Component { ...@@ -242,13 +243,21 @@ class Exam extends Component {
> >
复制 复制
</a> </a>
<Popconfirm
title="确定要删除吗?"
okText="确定"
cancelText="取消"
onConfirm={() => this.deleteExam(text.id)}
>
{/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
<a <a
href="javascript:void(0)" href="javascript:void(0)"
onClick={() => this.deleteExam(text.id)}
style={{ marginLeft: 10 }} style={{ marginLeft: 10 }}
> >
删除 删除
</a> </a>
</Popconfirm>
{text.visibleRange === 2 ? <Divider type="vertical" /> : null} {text.visibleRange === 2 ? <Divider type="vertical" /> : null}
</div> </div>
), ),
...@@ -313,7 +322,7 @@ class Exam extends Component { ...@@ -313,7 +322,7 @@ class Exam extends Component {
"/" + "/" +
func.siteCode + func.siteCode +
`/index/tool/test/test-management/edit`, `/index/tool/test/test-management/edit`,
search:`?id=${text.id}`, search: `?id=${text.id}`,
state: { id: text.id }, state: { id: text.id },
}} }}
> >
...@@ -328,13 +337,20 @@ class Exam extends Component { ...@@ -328,13 +337,20 @@ class Exam extends Component {
> >
上架 上架
</a> </a>
<Popconfirm
title="确定要删除吗?"
okText="确定"
cancelText="取消"
onConfirm={() => this.deleteExam(text.id)}
>
{/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
<a <a
style={{ marginRight: 16,marginLeft: 10 }} style={{ marginLeft: 10 }}
href="javascript:void(0)" href="#"
onClick={() => this.deleteExam(text.id)}
> >
删除 删除
</a> </a>
</Popconfirm>
{text.visibleRange === 2 ? <Divider type="vertical" /> : null} {text.visibleRange === 2 ? <Divider type="vertical" /> : null}
</div> </div>
), ),
...@@ -476,7 +492,7 @@ class Exam extends Component { ...@@ -476,7 +492,7 @@ class Exam extends Component {
{ {
pagesize, pagesize,
}, },
function() { function () {
this.setState({ this.setState({
page: 1, page: 1,
}); });
...@@ -544,7 +560,7 @@ class Exam extends Component { ...@@ -544,7 +560,7 @@ class Exam extends Component {
<Spin /> <Spin />
) : ( ) : (
<div className="list"> <div className="list">
<Breadcrumb title="考试管理"/> <Breadcrumb title="考试管理" />
<div className="list-btn"> <div className="list-btn">
<div> <div>
<Input <Input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment