|
|
|
@ -85,25 +85,20 @@ |
|
|
|
></div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="操作" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag |
|
|
|
class="move" |
|
|
|
style=" |
|
|
|
cursor: move; |
|
|
|
background-color: rgb(245, 245, 245); |
|
|
|
border: none; |
|
|
|
" |
|
|
|
@dragstart="handleEdit(scope.row)" |
|
|
|
draggable="true" |
|
|
|
> |
|
|
|
<i |
|
|
|
class="el-icon-d-caret" |
|
|
|
style="width: 1rem; height: 1rem; color: rgb(113, 113, 113)" |
|
|
|
></i> |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column label="操作" width="" align="center"> |
|
|
|
<template> |
|
|
|
<el-tag |
|
|
|
class="move" |
|
|
|
style="cursor: move;background-color: rgb(245, 245, 245);border:none" |
|
|
|
draggable="true" |
|
|
|
> |
|
|
|
<i |
|
|
|
class="el-icon-d-caret" |
|
|
|
style="width: 1rem; height: 1rem;color: rgb(113, 113, 113)" |
|
|
|
></i> |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -119,6 +114,22 @@ |
|
|
|
<el-button type="" @click="editpopup" class="commonbutton" |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button type="" @click="topping" class="commonbutton">置顶</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button type="" @click="toppings" class="commonbutton">置底</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button type="" :disabled="isshow" @click="assertion" class="commonbutton" |
|
|
|
>排序</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button type="" :disabled="isshow" @click="cancellation" class="commonbutton" |
|
|
|
>取消</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 分页 --> |
|
|
|
@ -450,14 +461,15 @@ export default { |
|
|
|
this.tableData.forEach((item, index) => { |
|
|
|
// index 从0开始的, displayOrder从大到小排 |
|
|
|
// const currentDisplayOrder = this.tableData.length -1 |
|
|
|
const currentDisplayOrder = this.initTableData[index].displayOrder; |
|
|
|
if (item.displayOrder != currentDisplayOrder) { |
|
|
|
// const currentDisplayOrder = this.initTableData[index].displayOrder; |
|
|
|
// if (item.displayOrder != currentDisplayOrder) { |
|
|
|
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置 |
|
|
|
result.push({ |
|
|
|
id: item.resultStatusId, |
|
|
|
displayOrder: currentDisplayOrder, |
|
|
|
}); |
|
|
|
} |
|
|
|
result.push({ id: item.id, displayOrder: index+1 }); |
|
|
|
// result.push({ |
|
|
|
// id: item.resultStatusId, |
|
|
|
// displayOrder: currentDisplayOrder, |
|
|
|
// }); |
|
|
|
// } |
|
|
|
}); |
|
|
|
sortstatus({ itemList: result }).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
@ -477,6 +489,10 @@ export default { |
|
|
|
animation: 300, |
|
|
|
// 指定父元素下可被拖拽的子元素 |
|
|
|
// draggable: ".module-manager .el-table__row", |
|
|
|
onChoose({oldIndex}){ |
|
|
|
_this.$refs['tableData'].setCurrentRow(_this.tableData[oldIndex]); |
|
|
|
_this.rowclick(_this.tableData[oldIndex]) |
|
|
|
}, |
|
|
|
onEnd({ newIndex, oldIndex }) { |
|
|
|
// console.log(arr); |
|
|
|
_this.isshow = false; |
|
|
|
@ -494,14 +510,41 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
//置顶置底 |
|
|
|
topping(row, t) { |
|
|
|
stateBottomTop(row.resultStatusId, t).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.getlist(); |
|
|
|
this.$message.success("操作成功"); |
|
|
|
} |
|
|
|
}); |
|
|
|
topping() { |
|
|
|
this.form = { ...this.curRow }; |
|
|
|
if (this.form.id == undefined) { |
|
|
|
this.$message.warning("请选择操作的数据"); |
|
|
|
} else { |
|
|
|
stateBottomTop(this.form.id, 1).then((res) => { |
|
|
|
if(res.code!=-1){ |
|
|
|
this.getlist(); |
|
|
|
this.$message.success('操作成功') |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
toppings() { |
|
|
|
this.form = { ...this.curRow }; |
|
|
|
if (this.form.id == undefined) { |
|
|
|
this.$message.warning("请选择操作的数据"); |
|
|
|
} else { |
|
|
|
stateBottomTop(this.form.id, 2).then((res) => { |
|
|
|
if(res.code!=-1){ |
|
|
|
this.getlist(); |
|
|
|
this.$message.success('操作成功') |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
//置顶置底 |
|
|
|
// topping(row, t) { |
|
|
|
// stateBottomTop(row.resultStatusId, t).then((res) => { |
|
|
|
// if (res.code != -1) { |
|
|
|
// this.getlist(); |
|
|
|
// this.$message.success("操作成功"); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
//删除 |
|
|
|
delsrts(row) { |
|
|
|
deletedstate(row.resultStatusId).then((res) => { |
|
|
|
|