[update] 国内标准左侧树拖拽排序

This commit is contained in:
lideqin
2024-08-16 09:34:18 +08:00
parent f47dc0d87c
commit ee00559b94
@@ -262,7 +262,7 @@ import {
removeDomesticStandard, removeDomesticStandard,
shareDomesticStandard, shareDomesticStandard,
collectionDomesticStandard, collectionDomesticStandard,
cancelCollectionDomesticStandard, domesticSystemTreeSortSave cancelCollectionDomesticStandard, domesticSystemTreeSortSave, editDomesticSystemTree
} from '../../../api/standardRegulationLibraryApi' } from '../../../api/standardRegulationLibraryApi'
import { import {
OperationType, OperationType,
@@ -461,7 +461,7 @@ export default {
// nodeArray.push({ // nodeArray.push({
// id: dragNodeData.id, // id: dragNodeData.id,
// parentId: dragNodeData.parentId, // parentId: dragNodeData.parentId,
// sort: dragNodeData.sort // nodeOrder: dragNodeData.nodeOrder
// }) // })
// } else { // } else {
// nodeArray.splice(index === -1 ? 0 : index, 0, dragNodeData) // nodeArray.splice(index === -1 ? 0 : index, 0, dragNodeData)
@@ -476,18 +476,19 @@ export default {
// const dept = { // const dept = {
// id: element.id, // id: element.id,
// parentId: element.pid, // parentId: element.pid,
// sort: dropPosition === 1 ? i : i + 1 // nodeOrder: dropPosition === 1 ? i : i + 1
// } // }
// paramObj = dept // paramObj = dept
// } // }
// }) // })
paramObj.nodeId = dragNodeData.id // 拖拽节点的id paramObj.id = dragNodeData.id
// paramObj.nodeId = dragNodeData.id // 拖拽节点的id
paramObj.parentId = nodeData.parentId // 目标节点的父级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)
console.log('此处调用后端接口保存数据' + paramObj.id + paramObj.sort) console.log('此处调用后端接口保存数据' + paramObj.id + paramObj.nodeOrder)
domesticSystemTreeSortSave(paramObj).then(res => { editDomesticSystemTree(paramObj).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
// 重新获取树节点不改变展开节点 // 重新获取树节点不改变展开节点