|
|
@ -21,7 +21,7 @@ |
|
|
|
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span> |
|
|
|
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-tree :data="listData" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop"> |
|
|
|
<el-tree :data="list" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop"> |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
<span class="name">{{ data.name }}</span> |
|
|
|
<span class="name">{{ data.name }}</span> |
|
|
|
<span class="action" v-show="!sorting"> |
|
|
|
<span class="action" v-show="!sorting"> |
|
|
@ -66,8 +66,8 @@ export default { |
|
|
|
first: "栏目管理" |
|
|
|
first: "栏目管理" |
|
|
|
}, |
|
|
|
}, |
|
|
|
name: this.$store.state.name, |
|
|
|
name: this.$store.state.name, |
|
|
|
originalList: [], |
|
|
|
originList: [], |
|
|
|
listData: [], |
|
|
|
list: [], |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
pageNo: 1, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
@ -88,7 +88,7 @@ export default { |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
if (JSON.stringify(this.originalList) !== JSON.stringify(this.listData)) { |
|
|
|
if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) { |
|
|
|
this.$confirm("确定返回?排序尚未保存。", "提示", { |
|
|
|
this.$confirm("确定返回?排序尚未保存。", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
@ -106,8 +106,8 @@ export default { |
|
|
|
this.$get(this.api.queryAllColumns, { |
|
|
|
this.$get(this.api.queryAllColumns, { |
|
|
|
school: 0 |
|
|
|
school: 0 |
|
|
|
}).then(({ columnTree }) => { |
|
|
|
}).then(({ columnTree }) => { |
|
|
|
this.listData = columnTree |
|
|
|
this.list = columnTree |
|
|
|
this.originalList = JSON.parse(JSON.stringify(this.listData)); |
|
|
|
this.originList = JSON.parse(JSON.stringify(this.list)); |
|
|
|
this.total = columnTree.length |
|
|
|
this.total = columnTree.length |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
@ -156,7 +156,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
sortSubmit() { |
|
|
|
sortSubmit() { |
|
|
|
this.level = 0 |
|
|
|
this.level = 0 |
|
|
|
let list = JSON.parse(JSON.stringify(this.listData)) |
|
|
|
let list = JSON.parse(JSON.stringify(this.list)) |
|
|
|
this.handleList(list) |
|
|
|
this.handleList(list) |
|
|
|
this.$post(this.api.columnReorder, { |
|
|
|
this.$post(this.api.columnReorder, { |
|
|
|
columnTree: list |
|
|
|
columnTree: list |
|
|
@ -188,7 +188,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancelSort() { |
|
|
|
cancelSort() { |
|
|
|
this.sorting = false; |
|
|
|
this.sorting = false; |
|
|
|
this.listData = JSON.parse(JSON.stringify(this.originalList)); |
|
|
|
this.list = JSON.parse(JSON.stringify(this.originList)); |
|
|
|
this.sortObj.destroy(); |
|
|
|
this.sortObj.destroy(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
openSort() { |
|
|
|
openSort() { |
|
|
|