mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix: 禁止把资源移动到【迁移资源】文件夹
This commit is contained in:
committed by
dataeaseShu
parent
3f39e5c6bc
commit
8cb6b64219
@@ -245,7 +245,7 @@ export const isFreeFolder = (node, flag) => {
|
||||
const freeRootId = (Number(oid) + flag).toString()
|
||||
let cNode = node
|
||||
while (cNode) {
|
||||
const data = node.data
|
||||
const data = cNode.data
|
||||
const id = data['id']
|
||||
if (id === freeRootId) {
|
||||
return true
|
||||
|
||||
@@ -541,14 +541,14 @@ const sortTypeChange = sortType => {
|
||||
state.curSortType = sortType
|
||||
}
|
||||
|
||||
const proxyHandleDrop = (arg1, arg2, arg3) => {
|
||||
const flagArray = ['dashboard', 'datav', 'dataset', 'datasource']
|
||||
const proxyAllowDrop = (arg1, arg2) => {
|
||||
const flagArray = ['dashboard', 'dataV', 'dataset', 'datasource']
|
||||
const flag = flagArray.findIndex(item => item === curCanvasType.value)
|
||||
if (flag < 0 || !isFreeFolder(arg2, flag + 1)) {
|
||||
handleDrop(arg1, arg2, arg3)
|
||||
return
|
||||
return allowDrop(arg1, arg2)
|
||||
}
|
||||
ElMessage.warning(t('free.save_error'))
|
||||
return false
|
||||
}
|
||||
|
||||
watch(filterText, val => {
|
||||
@@ -697,8 +697,8 @@ defineExpose({
|
||||
@node-collapse="nodeCollapse"
|
||||
@node-click="nodeClick"
|
||||
@node-drag-start="handleDragStart"
|
||||
:allow-drop="allowDrop"
|
||||
@node-drop="proxyHandleDrop"
|
||||
:allow-drop="proxyAllowDrop"
|
||||
@node-drop="handleDrop"
|
||||
draggable
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
|
||||
@@ -783,14 +783,15 @@ const getMenuList = (val: boolean) => {
|
||||
}
|
||||
].concat(menuList)
|
||||
}
|
||||
const proxyHandleDrop = (arg1, arg2, arg3) => {
|
||||
const flagArray = ['dashboard', 'datav', 'dataset', 'datasource']
|
||||
|
||||
const proxyAllowDrop = (arg1, arg2) => {
|
||||
const flagArray = ['dashboard', 'dataV', 'dataset', 'datasource']
|
||||
const flag = flagArray.findIndex(item => item === 'dataset')
|
||||
if (flag < 0 || !isFreeFolder(arg2, flag + 1)) {
|
||||
handleDrop(arg1, arg2, arg3)
|
||||
return
|
||||
return allowDrop(arg1, arg2)
|
||||
}
|
||||
ElMessage.warning(t('free.save_error'))
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -901,8 +902,8 @@ const proxyHandleDrop = (arg1, arg2, arg3) => {
|
||||
expand-on-click-node
|
||||
highlight-current
|
||||
@node-drag-start="handleDragStart"
|
||||
:allow-drop="allowDrop"
|
||||
@node-drop="proxyHandleDrop"
|
||||
:allow-drop="proxyAllowDrop"
|
||||
@node-drop="handleDrop"
|
||||
draggable
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
|
||||
@@ -1009,14 +1009,15 @@ const loadInit = () => {
|
||||
state.curSortType = historyTreeSort
|
||||
}
|
||||
}
|
||||
const proxyHandleDrop = (arg1, arg2, arg3) => {
|
||||
const flagArray = ['dashboard', 'datav', 'dataset', 'datasource']
|
||||
|
||||
const proxyAllowDrop = (arg1, arg2) => {
|
||||
const flagArray = ['dashboard', 'dataV', 'dataset', 'datasource']
|
||||
const flag = flagArray.findIndex(item => item === 'datasource')
|
||||
if (flag < 0 || !isFreeFolder(arg2, flag + 1)) {
|
||||
handleDrop(arg1, arg2, arg3)
|
||||
return
|
||||
return allowDrop(arg1, arg2)
|
||||
}
|
||||
ElMessage.warning(t('free.save_error'))
|
||||
return false
|
||||
}
|
||||
onMounted(() => {
|
||||
const dsId = wsCache.get('ds-info-id') || route.params.id
|
||||
@@ -1160,8 +1161,8 @@ const getMenuList = (val: boolean) => {
|
||||
:data="state.datasourceTree"
|
||||
:props="defaultProps"
|
||||
@node-drag-start="handleDragStart"
|
||||
:allow-drop="allowDrop"
|
||||
@node-drop="proxyHandleDrop"
|
||||
:allow-drop="proxyAllowDrop"
|
||||
@node-drop="handleDrop"
|
||||
draggable
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user