罗斌杰 2 years ago
parent
commit
f368d02191
  1. 45
      src/views/common-settings/ItemType.vue

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

@ -125,6 +125,24 @@
>删除</el-button >删除</el-button
> >
</div> </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>
</div> </div>
<el-dialog <el-dialog
@ -265,7 +283,7 @@ import {
projectedid, projectedid,
} from "@/request/commonapi"; } from "@/request/commonapi";
import { basicsetings, physicalexaminationlist } from "@/request/systemapi"; import { basicsetings, physicalexaminationlist } from "@/request/systemapi";
import { getapi } from "@/api/api";
import { getapi,putapi } from "@/api/api";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { objCopy } from "@/utlis/proFunc"; import { objCopy } from "@/utlis/proFunc";
import Sortable from "sortablejs"; import Sortable from "sortablejs";
@ -350,7 +368,8 @@ export default {
isshow: true, isshow: true,
activeRows: [], activeRows: [],
message: true, message: true,
tableKey:''
tableKey:'',
isshows:true
}; };
}, },
created() { created() {
@ -447,7 +466,8 @@ export default {
} }
}, },
onChoose({newIndex,oldIndex }) { 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 oldRow = _this.activeRows[oldIndex];
// const newRow = _this.activeRows[newIndex]; // const newRow = _this.activeRows[newIndex];
// if(oldRow.level === newRow.level || // if(oldRow.level === newRow.level ||
@ -475,7 +495,7 @@ export default {
"parentId" "parentId"
); );
_this.$set(_this,'tableData',data) _this.$set(_this,'tableData',data)
_this.isshow = false;
_this.isshows = false;
let beforeScrollTop = _this.$refs.tableData.$el.querySelector('div.el-table__body-wrapper').scrollTop let beforeScrollTop = _this.$refs.tableData.$el.querySelector('div.el-table__body-wrapper').scrollTop
_this.tableKey = new Date().getTime() _this.tableKey = new Date().getTime()
_this.$nextTick(() => { _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() { rena() {
let id = this.row.id; let id = this.row.id;

Loading…
Cancel
Save