diff --git a/src/views/basic-dictionary/ResultStatus.vue b/src/views/basic-dictionary/ResultStatus.vue index 68e4ef9..f4b703c 100644 --- a/src/views/basic-dictionary/ResultStatus.vue +++ b/src/views/basic-dictionary/ResultStatus.vue @@ -85,25 +85,20 @@ > - + + + @@ -119,6 +114,22 @@ 编辑 +
+ 置顶 +
+
+ 置底 +
+
+ 排序 +
+
+ 取消 +
@@ -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) => {