vxe-pc-ui 4.11.1 → 4.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/tree/src/tree.js +83 -67
  5. package/es/ui/index.js +1 -1
  6. package/es/ui/src/log.js +1 -1
  7. package/lib/icon/style/style.css +1 -1
  8. package/lib/icon/style/style.min.css +1 -1
  9. package/lib/index.umd.js +91 -75
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/style.min.css +1 -1
  13. package/lib/tree/src/tree.js +87 -71
  14. package/lib/tree/src/tree.min.js +1 -1
  15. package/lib/ui/index.js +1 -1
  16. package/lib/ui/index.min.js +1 -1
  17. package/lib/ui/src/log.js +1 -1
  18. package/lib/ui/src/log.min.js +1 -1
  19. package/package.json +1 -1
  20. package/packages/tree/src/tree.ts +88 -73
  21. /package/es/icon/{iconfont.1765466150452.ttf → iconfont.1765525478141.ttf} +0 -0
  22. /package/es/icon/{iconfont.1765466150452.woff → iconfont.1765525478141.woff} +0 -0
  23. /package/es/icon/{iconfont.1765466150452.woff2 → iconfont.1765525478141.woff2} +0 -0
  24. /package/es/{iconfont.1765466150452.ttf → iconfont.1765525478141.ttf} +0 -0
  25. /package/es/{iconfont.1765466150452.woff → iconfont.1765525478141.woff} +0 -0
  26. /package/es/{iconfont.1765466150452.woff2 → iconfont.1765525478141.woff2} +0 -0
  27. /package/lib/icon/style/{iconfont.1765466150452.ttf → iconfont.1765525478141.ttf} +0 -0
  28. /package/lib/icon/style/{iconfont.1765466150452.woff → iconfont.1765525478141.woff} +0 -0
  29. /package/lib/icon/style/{iconfont.1765466150452.woff2 → iconfont.1765525478141.woff2} +0 -0
  30. /package/lib/{iconfont.1765466150452.ttf → iconfont.1765525478141.ttf} +0 -0
  31. /package/lib/{iconfont.1765466150452.woff → iconfont.1765525478141.woff} +0 -0
  32. /package/lib/{iconfont.1765466150452.woff2 → iconfont.1765525478141.woff2} +0 -0
@@ -1872,84 +1872,55 @@ export default defineVxeComponent({
1872
1872
  dragToChild: !!prevDragToChild,
1873
1873
  offsetIndex: dragOffsetIndex as 0 | 1
1874
1874
  }
1875
- const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
1876
- return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
1877
- if (!status) {
1878
- return errRest
1879
- }
1880
1875
 
1881
- const dragNodeid = getNodeId(dragNode)
1882
- const dragNodeRest = nodeMaps[dragNodeid] || {}
1883
- const _dragNodeIndex = dragNodeRest._index
1884
- let dragNodeHeight = 0
1885
- let dragOffsetTop = -1
1886
- if (animation) {
1887
- const prevItemEl = el.querySelector<HTMLElement>(`.vxe-tree--node-wrapper[nodeid="${prevDragNode}"]`)
1888
- const oldItemEl = el.querySelector<HTMLElement>(`.vxe-tree--node-wrapper[nodeid="${dragNodeid}"]`)
1889
- const targetItemEl = prevItemEl || oldItemEl
1890
- if (targetItemEl) {
1891
- dragNodeHeight = targetItemEl.offsetHeight
1892
- }
1893
- if (oldItemEl) {
1894
- dragOffsetTop = oldItemEl.offsetTop
1895
- }
1876
+ const dragNodeid = getNodeId(dragNode)
1877
+ const dragNodeRest = nodeMaps[dragNodeid] || {}
1878
+ const _dragNodeIndex = dragNodeRest._index
1879
+ let dragNodeHeight = 0
1880
+ let dragOffsetTop = -1
1881
+ if (animation) {
1882
+ const prevItemEl = el.querySelector<HTMLElement>(`.vxe-tree--node-wrapper[nodeid="${prevDragNode}"]`)
1883
+ const oldItemEl = el.querySelector<HTMLElement>(`.vxe-tree--node-wrapper[nodeid="${dragNodeid}"]`)
1884
+ const targetItemEl = prevItemEl || oldItemEl
1885
+ if (targetItemEl) {
1886
+ dragNodeHeight = targetItemEl.offsetHeight
1896
1887
  }
1888
+ if (oldItemEl) {
1889
+ dragOffsetTop = oldItemEl.offsetTop
1890
+ }
1891
+ }
1897
1892
 
1898
- let oafIndex = -1
1899
- let nafIndex = -1
1900
-
1901
- if (transform) {
1902
- // 移出源位置
1903
- const oldRest = dragNodeRest
1904
- const newNodeid = getNodeId(prevDragNode)
1905
- const newRest = nodeMaps[newNodeid]
1906
-
1907
- if (oldRest && newRest) {
1908
- const { level: oldLevel } = oldRest
1909
- const { level: newLevel } = newRest
1910
-
1911
- const oldAllMaps: Record<string, any> = {}
1912
- XEUtils.eachTree([dragNode], item => {
1913
- oldAllMaps[getNodeId(item)] = item
1914
- }, { children: mapChildrenField })
1915
-
1916
- let isSelfToChildStatus = false
1917
-
1918
- if (oldLevel && newLevel) {
1919
- // 子到子
1893
+ let oafIndex = -1
1894
+ let nafIndex = -1
1895
+ const oldAllMaps: Record<string, any> = {}
1896
+ let isSelfToChildStatus = false
1920
1897
 
1921
- if (isPeerDrag && !isCrossDrag) {
1922
- if (oldRest.item[parentField] !== newRest.item[parentField]) {
1923
- // 非同级
1924
- return errRest
1925
- }
1926
- } else {
1927
- if (!isCrossDrag) {
1928
- return errRest
1929
- }
1930
- if (oldAllMaps[newNodeid]) {
1931
- isSelfToChildStatus = true
1932
- if (!(isCrossDrag && isSelfToChildDrag)) {
1933
- if (VxeUI.modal) {
1934
- VxeUI.modal.message({
1935
- status: 'error',
1936
- content: getI18n('vxe.error.treeDragChild')
1937
- })
1938
- }
1939
- return errRest
1940
- }
1941
- }
1942
- }
1943
- } else if (oldLevel) {
1944
- // 子到根
1945
-
1946
- if (!isCrossDrag) {
1898
+ const oldRest = dragNodeRest
1899
+ const newNodeid = getNodeId(prevDragNode)
1900
+ const newRest = nodeMaps[newNodeid]
1901
+ if (transform) {
1902
+ if (oldRest && newRest) {
1903
+ const { level: oldLevel } = oldRest
1904
+ const { level: newLevel } = newRest
1905
+
1906
+ XEUtils.eachTree([dragNode], item => {
1907
+ oldAllMaps[getNodeId(item)] = item
1908
+ }, { children: mapChildrenField })
1909
+
1910
+ if (oldLevel && newLevel) {
1911
+ // 子到子
1912
+
1913
+ if (isPeerDrag && !isCrossDrag) {
1914
+ if (oldRest.item[parentField] !== newRest.item[parentField]) {
1915
+ // 非同级
1916
+ clearNodeDragData()
1917
+ clearCrossTreeDragStatus()
1947
1918
  return errRest
1948
1919
  }
1949
- } else if (newLevel) {
1950
- // 根到子
1951
-
1920
+ } else {
1952
1921
  if (!isCrossDrag) {
1922
+ clearNodeDragData()
1923
+ clearCrossTreeDragStatus()
1953
1924
  return errRest
1954
1925
  }
1955
1926
  if (oldAllMaps[newNodeid]) {
@@ -1961,13 +1932,57 @@ export default defineVxeComponent({
1961
1932
  content: getI18n('vxe.error.treeDragChild')
1962
1933
  })
1963
1934
  }
1935
+ clearNodeDragData()
1936
+ clearCrossTreeDragStatus()
1964
1937
  return errRest
1965
1938
  }
1966
1939
  }
1967
- } else {
1968
- // 根到根
1969
1940
  }
1941
+ } else if (oldLevel) {
1942
+ // 子到根
1943
+
1944
+ if (!isCrossDrag) {
1945
+ clearNodeDragData()
1946
+ clearCrossTreeDragStatus()
1947
+ return errRest
1948
+ }
1949
+ } else if (newLevel) {
1950
+ // 根到子
1951
+
1952
+ if (!isCrossDrag) {
1953
+ clearNodeDragData()
1954
+ clearCrossTreeDragStatus()
1955
+ return errRest
1956
+ }
1957
+ if (oldAllMaps[newNodeid]) {
1958
+ isSelfToChildStatus = true
1959
+ if (!(isCrossDrag && isSelfToChildDrag)) {
1960
+ if (VxeUI.modal) {
1961
+ VxeUI.modal.message({
1962
+ status: 'error',
1963
+ content: getI18n('vxe.error.treeDragChild')
1964
+ })
1965
+ }
1966
+ clearNodeDragData()
1967
+ clearCrossTreeDragStatus()
1968
+ return errRest
1969
+ }
1970
+ }
1971
+ } else {
1972
+ // 根到根
1973
+ }
1974
+ }
1975
+ }
1970
1976
 
1977
+ const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
1978
+ return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
1979
+ if (!status) {
1980
+ return errRest
1981
+ }
1982
+
1983
+ if (transform) {
1984
+ // 移出源位置
1985
+ if (oldRest && newRest) {
1971
1986
  const fullList = XEUtils.toTreeArray(internalData.afterTreeList, {
1972
1987
  key: keyField,
1973
1988
  parentKey: parentField,