pengjun 2 years ago
parent
commit
6c9f0d31bf
  1. 45
      src/views/common-settings/ItemType.vue

45
src/views/common-settings/ItemType.vue

@ -125,6 +125,24 @@
>删除</el-button
>
</div>
<div style="margin-top: 10px">
<el-button
type=""
@click="assertion"
:disabled="isshows"
class="commonbutton"
>排序</el-button
>
</div>
<div style="margin-top: 10px">
<el-button
type=""
:disabled="isshows"
@click="cancellation"
class="commonbutton"
>取消</el-button
>
</div>
</div>
</div>
<el-dialog
@ -265,7 +283,7 @@ import {
projectedid,
} from "@/request/commonapi";
import { basicsetings, physicalexaminationlist } from "@/request/systemapi";
import { getapi } from "@/api/api";
import { getapi,putapi } from "@/api/api";
import { mapState } from "vuex";
import { objCopy } from "@/utlis/proFunc";
import Sortable from "sortablejs";
@ -350,7 +368,8 @@ export default {
isshow: true,
activeRows: [],
message: true,
tableKey:''
tableKey:'',
isshows:true
};
},
created() {
@ -447,7 +466,8 @@ export default {
}
},
onChoose({newIndex,oldIndex }) {
// _this.$refs['tableData'].setCurrentRow(_this.activeRows[newIndex]);
_this.$refs['tableData'].setCurrentRow(_this.activeRows[oldIndex]);
_this.treeclick(_this.activeRows[oldIndex]);
// const oldRow = _this.activeRows[oldIndex];
// const newRow = _this.activeRows[newIndex];
// if(oldRow.level === newRow.level ||
@ -475,7 +495,7 @@ export default {
"parentId"
);
_this.$set(_this,'tableData',data)
_this.isshow = false;
_this.isshows = false;
let beforeScrollTop = _this.$refs.tableData.$el.querySelector('div.el-table__body-wrapper').scrollTop
_this.tableKey = new Date().getTime()
_this.$nextTick(() => {
@ -494,6 +514,23 @@ export default {
})
});
},
//
assertion() {
const result = [];
this.activeRows.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index+1 });
});
putapi("/api/app/ItemType/UpdateSortMany",{ itemList: result }).then((res) => {
if (res.code != -1) {
this.isshows = true;
}
});
},
//
cancellation() {
this.getlist()
this.isshows=true
},
//
rena() {
let id = this.row.id;

Loading…
Cancel
Save