修改树节点切换菜单问题

This commit is contained in:
zhujiyan
2024-09-12 09:56:09 +08:00
parent 3fc8988748
commit 2983418c06

View File

@@ -65,7 +65,7 @@
<el-icon><Download /></el-icon> <el-icon><Download /></el-icon>
</el-button> </el-button>
<el-button <el-button
v-if="activePath != '/'" v-if="activePath && activePath != '/'"
type="danger" type="danger"
@click="handleDelDirOrFile(item)" @click="handleDelDirOrFile(item)"
size="small" size="small"
@@ -81,7 +81,7 @@
v-if="item?.type == 'file'" v-if="item?.type == 'file'"
src="@/assets/img/wenjian.svg" src="@/assets/img/wenjian.svg"
/> />
<!-- <span v-if="!item.type">暂无数据</span> --> <span v-if="!item.type">暂无数据</span>
<p> <p>
{{ {{
item && item &&
@@ -94,7 +94,7 @@
</p> </p>
</div> </div>
</div> </div>
<el-empty v-if="dirList.length == 0 || !dirList[0].type" /> <el-empty v-if="dirList.length == 0 || !dirList[0].type || activePathList.length === 0" />
</div> </div>
<popup ref="fileRef"></popup> <popup ref="fileRef"></popup>
<el-dialog <el-dialog
@@ -168,9 +168,12 @@ const isRoot = ref<boolean>(true)
//储存所有点击过的目录 //储存所有点击过的目录
const activePathList: any = ref([]) const activePathList: any = ref([])
const nodeClick = (e: any) => { const nodeClick = (e: any) => {
loading.value = true
if (e.level == 2) { if (e.level == 2) {
loading.value = true
nDid.value = e.ndid nDid.value = e.ndid
dirList.value = []
activePath.value = ''
activePathList.value = []
getDeviceRootPath(nDid.value) getDeviceRootPath(nDid.value)
.then((res: any) => { .then((res: any) => {
loading.value = false loading.value = false