修改样式

dev_aliyun_beta
杨树林 5 years ago
parent fc27a073be
commit ee388f88f3

@ -2101,7 +2101,7 @@ class PollNewQuestbank extends Component {
}
//上下移到服务器中
Upanddownmovementof = (bool, poll_question_id) => {
Upanddownmovementof = (bool, poll_question_id,index) => {
// console.log("调用了Upanddownmovementofr")
// console.log(poll_question_id)
var thiss = this;
@ -2111,11 +2111,22 @@ class PollNewQuestbank extends Component {
opr: "up",
}).then((result) => {
try {
if (result.data.status === 0) {
this.props.showNotification(`上移成功`);
thiss.thisinitializationdatanew();
if(result){
if(result.data){
if (result.data.status === 0) {
this.props.showNotification(`上移成功`);
let arr = this.state.poll_questions;
let newarr = [...arr];
let temp = newarr[index - 1];
newarr[index - 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
thiss.thisinitializationdatanew();
}
}
}
// console.log(JSON.stringify(result))
} catch (e) {
// console.log("上移题目成功 错误")
console.log(e)
@ -2127,13 +2138,25 @@ class PollNewQuestbank extends Component {
axios.put(url, {
opr: "down",
}).then((result) => {
try {
if (result.data.status === 0) {
// message.success("下移题目成功", 1)
this.props.showNotification(`下移成功`);
thiss.thisinitializationdatanew();
if(result){
if(result.data){
if (result.data.status === 0) {
// message.success("下移题目成功", 1)
this.props.showNotification(`下移成功`);
let arr = this.state.poll_questions;
let newarr = [...arr];
let temp = newarr[index + 1];
newarr[index + 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
thiss.thisinitializationdatanew();
}
}
}
// console.log(JSON.stringify(result))
} catch (e) {
// console.log("下移题目成功 错误")
console.log(e)
@ -2272,17 +2295,11 @@ class PollNewQuestbank extends Component {
//点击向上排序按钮事件
handleClickBySortUp = (index, object) => {
// console.log("handleClickBySortUp 521")
let arr = this.state.poll_questions;
let newarr = [...arr];
// console.log(newarr)
if (index != 0) {
this.Upanddownmovementof(true, object.question.id);
let temp = newarr[index - 1];
newarr[index - 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
this.Upanddownmovementof(true, object.question.id,index);
}
}
@ -2293,13 +2310,8 @@ class PollNewQuestbank extends Component {
let newarr = [...arr];
//
if (index != newarr.length - 1) {
this.Upanddownmovementof(false, object.question.id);
let temp = newarr[index + 1];
newarr[index + 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
this.Upanddownmovementof(false, object.question.id,index);
} else {
// console.log("2222index==arr.length");
// console.log(this.state.poll_questions);

Loading…
Cancel
Save