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";
...@@ -272,49 +273,49 @@ class TreeItem extends React.Component { ...@@ -272,49 +273,49 @@ class TreeItem extends React.Component {
</span> </span>
{type == "News" && data.name != "公告" {type == "News" && data.name != "公告"
? addshow && ( ? addshow && (
<span <span
style={{ float: "right", position: "absolute", right: "15%" }} //bug-12640-liyuan 30 -> 15% style={{ float: "right", position: "absolute", right: "15%" }} //bug-12640-liyuan 30 -> 15%
> >
<Icon <Icon
type="plus" type="plus"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.showModal("1")} onClick={() => this.showModal("1")}
/> />
<Icon <Icon
type="edit" type="edit"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.showModal("2")} onClick={() => this.showModal("2")}
/> />
{/* <Icon {/* <Icon
type="delete" type="delete"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.onDelete()} onClick={() => this.onDelete()}
/> */} /> */}
</span> </span>
) )
: ""} : ""}
{type == "" {type == ""
? show && ( ? show && (
<span <span
style={{ float: "right", position: "absolute", right: "15%" }} //bug-12640-liyuan 30 -> 15% style={{ float: "right", position: "absolute", right: "15%" }} //bug-12640-liyuan 30 -> 15%
> >
<Icon <Icon
type="plus" type="plus"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.showModal("1")} onClick={() => this.showModal("1")}
/> />
<Icon <Icon
type="edit" type="edit"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.showModal("2")} onClick={() => this.showModal("2")}
/> />
<Icon <Icon
type="delete" type="delete"
className={Styles.pmEditIcon} className={Styles.pmEditIcon}
onClick={() => this.onDelete()} onClick={() => this.onDelete()}
/> />
</span> </span>
) )
: ""} : ""}
</p> </p>
</div> </div>
...@@ -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;
} }
...@@ -745,8 +746,8 @@ class Information extends React.Component { ...@@ -745,8 +746,8 @@ class Information extends React.Component {
logoPath: logoPath logoPath: logoPath
? logoPath ? logoPath
: this.props.seeEdit : this.props.seeEdit
? this.props.seeEdit.logoPath ? this.props.seeEdit.logoPath
: "", : "",
fileName: values.fileName, fileName: values.fileName,
typeOne: values.type[0], typeOne: values.type[0],
typeTwo: values.type[1] ? values.type[1] : 0, typeTwo: values.type[1] ? values.type[1] : 0,
...@@ -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;
} }
...@@ -793,8 +794,8 @@ class Information extends React.Component { ...@@ -793,8 +794,8 @@ class Information extends React.Component {
logoPath: logoPath logoPath: logoPath
? logoPath ? logoPath
: this.props.seeEdit : this.props.seeEdit
? this.props.seeEdit.logoPath ? this.props.seeEdit.logoPath
: "", : "",
fileName: values.fileName, fileName: values.fileName,
typeOne: element.value[0].value, typeOne: element.value[0].value,
typeTwo: element.value[1] ? element.value[1].value : 0, typeTwo: element.value[1] ? element.value[1].value : 0,
...@@ -1107,12 +1108,20 @@ class Information extends React.Component { ...@@ -1107,12 +1108,20 @@ class Information extends React.Component {
> >
编辑 编辑
</a> </a>
<a <Popconfirm
className={Styles.marr10} title="确定要删除吗?"
onClick={() => this.delete(record.id)} okText="确定"
cancelText="取消"
onConfirm={() => this.delete(record.id)}
> >
删除 {/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
</a> <a
className={Styles.marr10}
href="#"
>
删除
</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">
<a <Popconfirm
href="javascript:void(0)" title="确定要删除吗?"
onClick={() => self.deleteQuestion(text.id, index)} okText="确定"
cancelText="取消"
onConfirm={() => self.deleteQuestion(text.id, index)}
> >
删除 {/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
</a> <a
href="#"
>
删除
</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 => {
...@@ -454,12 +455,12 @@ class AddQuestion extends Component { ...@@ -454,12 +455,12 @@ class AddQuestion extends Component {
: 1, : 1,
selectedrecord: _this.props.examInfo.libraryName selectedrecord: _this.props.examInfo.libraryName
? { ? {
name: _this.props.examInfo.libraryName, name: _this.props.examInfo.libraryName,
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,9 +615,9 @@ class AddQuestion extends Component { ...@@ -614,9 +615,9 @@ class AddQuestion extends Component {
handleCancelBank = () => { handleCancelBank = () => {
this.setState({ this.setState({
visible: false, visible: false,
selectedrecord:null, selectedrecord: null,
selectedRowKeys2:[], selectedRowKeys2: [],
}); });
}; };
//添加题库确定按钮 //添加题库确定按钮
handleOkBank = () => { handleOkBank = () => {
...@@ -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} `;
...@@ -1486,10 +1487,10 @@ class AddQuestion extends Component { ...@@ -1486,10 +1487,10 @@ class AddQuestion extends Component {
item.type == 1 item.type == 1
? "单选题" ? "单选题"
: item.type == 2 : item.type == 2
? "多选题" ? "多选题"
: item.type == 3 : item.type == 3
? "判断题" ? "判断题"
: "问答题", : "问答题",
topic: item.stem, topic: item.stem,
questionBank: item.name, questionBank: item.name,
}; };
...@@ -1922,7 +1923,9 @@ class AddQuestion extends Component { ...@@ -1922,7 +1923,9 @@ class AddQuestion extends Component {
</Modal> </Modal>
</div> </div>
)} )}
<h3 style={{ marginTop: 40 }}>试题排序</h3> {this.props.questionWay != 1 && (
<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,8 +139,8 @@ class Exam extends Component { ...@@ -138,8 +139,8 @@ 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 },
}} }}
> >
<a style={{ marginRight: 16 }} href="javascript:void(0)"> <a style={{ marginRight: 16 }} href="javascript:void(0)">
...@@ -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>
<a <Popconfirm
href="javascript:void(0)" title="确定要删除吗?"
onClick={() => this.deleteExam(text.id)} okText="确定"
style={{ marginLeft: 10 }} cancelText="取消"
onConfirm={() => this.deleteExam(text.id)}
> >
删除 {/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
</a> <a
href="javascript:void(0)"
style={{ marginLeft: 10 }}
>
删除
</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>
<a <Popconfirm
style={{ marginRight: 16,marginLeft: 10 }} title="确定要删除吗?"
href="javascript:void(0)" okText="确定"
onClick={() => this.deleteExam(text.id)} cancelText="取消"
onConfirm={() => this.deleteExam(text.id)}
> >
删除 {/*4月10号临时发布 后台没有发布生产接口 前端只能隐藏*/}
</a> <a
style={{ marginLeft: 10 }}
href="#"
>
删除
</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,
}); });
...@@ -496,10 +512,10 @@ class Exam extends Component { ...@@ -496,10 +512,10 @@ class Exam extends Component {
var examUpListData = []; var examUpListData = [];
var examDownListData = []; var examDownListData = [];
var examDraftListData = []; var examDraftListData = [];
pagination.total = total; pagination.total = total;
pagination.showTotal = total => `总共:${total} `; pagination.showTotal = total => `总共:${total} `;
pagination.current = page; pagination.current = page;
if (list.length > 0) { if (list.length > 0) {
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
examUpListData.push({ examUpListData.push({
key: i, key: i,
...@@ -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