dev_jupyter
杨树林 5 years ago
parent 100d9a5cba
commit cbf422e6cb

@ -177,7 +177,7 @@ class Paperreview extends Component {
</Breadcrumb>
</div>
<Paperreview_item {...this.state} {...this.props}>
<Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.props.getdata(data)}>
</Paperreview_item>

@ -75,8 +75,83 @@ class Paperreview_item extends Component {
}
onDragEnd=(result)=>{
console.log("拖拽成功了");
console.log(result);
const ids=this.props.single_questions.questions[result.source.index].id;
const positions=this.props.single_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json`
var data={
position:positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds=(result)=>{
const ids=this.props.multiple_questions.questions[result.source.index].id;
const positions=this.props.multiple_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json`
var data={
position:positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss=(result)=>{
const ids=this.props.judgement_questions.questions[result.source.index].id;
const positions=this.props.judgement_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json`
var data={
position:positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss=(result)=>{
const ids=this.props.judgement_questions.questions[result.source.index].id;
const positions=this.props.judgement_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json`
var data={
position:positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
render() {
@ -173,12 +248,45 @@ class Paperreview_item extends Component {
<div className="scd">删除</div>
<div className="szdfd">设置得分</div>
</div>
{
multiple_questions&&multiple_questions.questions.map((object, index) => {
return (
<Paperreview_single objectsingle={object}></Paperreview_single>
)
})}
<DragDropContext onDragEnd={this.onDragEnds} >
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions&&multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_single objectsingle={object}></Paperreview_single>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
@ -202,13 +310,44 @@ class Paperreview_item extends Component {
<div className="scd">删除</div>
<div className="szdfd">设置得分</div>
</div>
{
judgement_questions&&judgement_questions.questions.map((object, index) => {
return (
<Paperreview_single objectsingle={object}></Paperreview_single>
)
})}
<DragDropContext onDragEnd={this.onDragEndss} >
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions&&judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_single objectsingle={object}></Paperreview_single>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:""
@ -238,12 +377,44 @@ class Paperreview_item extends Component {
<div className="scd">删除</div>
<div className="szdfd">设置得分</div>
</div>
{
program_questions&&program_questions.questions.map((object, index) => {
return (
<Paperreview_single objectsingle={object}></Paperreview_single>
)
})}
<DragDropContext onDragEnd={this.onDragEndsss} >
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions&&program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_single objectsingle={object}></Paperreview_single>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>

Loading…
Cancel
Save