[update] 国内标准左侧树拖拽排序
This commit is contained in:
@@ -262,7 +262,7 @@ import {
|
||||
removeDomesticStandard,
|
||||
shareDomesticStandard,
|
||||
collectionDomesticStandard,
|
||||
cancelCollectionDomesticStandard, domesticSystemTreeSortSave
|
||||
cancelCollectionDomesticStandard, domesticSystemTreeSortSave, editDomesticSystemTree
|
||||
} from '../../../api/standardRegulationLibraryApi'
|
||||
import {
|
||||
OperationType,
|
||||
@@ -461,7 +461,7 @@ export default {
|
||||
// nodeArray.push({
|
||||
// id: dragNodeData.id,
|
||||
// parentId: dragNodeData.parentId,
|
||||
// sort: dragNodeData.sort
|
||||
// nodeOrder: dragNodeData.nodeOrder
|
||||
// })
|
||||
// } else {
|
||||
// nodeArray.splice(index === -1 ? 0 : index, 0, dragNodeData)
|
||||
@@ -476,18 +476,19 @@ export default {
|
||||
// const dept = {
|
||||
// id: element.id,
|
||||
// parentId: element.pid,
|
||||
// sort: dropPosition === 1 ? i : i + 1
|
||||
// nodeOrder: dropPosition === 1 ? i : i + 1
|
||||
// }
|
||||
// paramObj = dept
|
||||
// }
|
||||
// })
|
||||
paramObj.nodeId = dragNodeData.id // 拖拽节点的id
|
||||
paramObj.id = dragNodeData.id
|
||||
// paramObj.nodeId = dragNodeData.id // 拖拽节点的id
|
||||
paramObj.parentId = nodeData.parentId // 目标节点的父级id
|
||||
paramObj.sort = dropPos[dropPos.length - 1] < info.dropPosition ? info.dropPosition : dropPos[dropPos.length - 1] // 要设置的排序值
|
||||
paramObj.nodeOrder = dropPos[dropPos.length - 1] < info.dropPosition ? info.dropPosition : dropPos[dropPos.length - 1] // 要设置的排序值
|
||||
}
|
||||
// console.log("拖拽后对象是:", paramObj)
|
||||
console.log('此处调用后端接口保存数据' + paramObj.id + paramObj.sort)
|
||||
domesticSystemTreeSortSave(paramObj).then(res => {
|
||||
console.log('此处调用后端接口保存数据' + paramObj.id + paramObj.nodeOrder)
|
||||
editDomesticSystemTree(paramObj).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
// 重新获取树节点不改变展开节点
|
||||
|
||||
Reference in New Issue
Block a user