罗斌杰 2 years ago
parent
commit
a756964328
  1. 109
      src/views/basic-dictionary/ResultStatus.vue

109
src/views/basic-dictionary/ResultStatus.vue

@ -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) => {

Loading…
Cancel
Save