Commit b18678d0 authored by zhengke's avatar zhengke

当前文件位置 组件

parent dfa8d120
......@@ -62,7 +62,6 @@ import OrgService from '@/services/OrgService';
import { ref,reactive,watch } from 'vue';
import { View,Download,EditPen,Delete } from '@element-plus/icons-vue';
import { ElMessage,ElTree } from 'element-plus';
import ConfigService from '@/services/ConfigService';
import FolderService from "@/services/FolderService";
const props = defineProps({
......
<template>
<span><span class="text-info q-ml-sm">/</span> {{datas.Navigation}} </span>
</template>
<script setup lang="ts">
import { ApiResult } from '@/configs/axios';
import OrgService from '@/services/OrgService';
import { ref,reactive,watch } from 'vue';
import { View,Download,EditPen,Delete } from '@element-plus/icons-vue';
import FolderService from "@/services/FolderService";
const props = defineProps({
folderId:{
type: Number,
required: 1
},
fileType: {
type:Number,
required: 1
}
})
const emit = defineEmits<{
(event: 'close'): void,
(event: 'success'): void
}>()
const datas = reactive({
fileList: [] as Tree[],
Navigation: '' as String,
ParentFileId: 0,
ParentFile: [] as Array
})
const dataList=ref([])
const getFile = async () => {
let querys = {
FileType: props.fileType
}
let pageRes = await FolderService.GetMyFolderTree(querys);
if (pageRes.data.resultCode == 1) {
dataList.value = pageRes.data.data
datas.Navigation = ''
recursive(dataList.value)
}
}
const recursive = (arrs:Array) =>{
if(arrs.length>0) arrs.forEach(x => {
if(x.FileId==props.folderId){
datas.Navigation = x.FileName
datas.ParentFileId = x.ParentFileId
}
if(x.ChildList.length>0){
recursionChild(x)
}
})
}
const recursionChild = (arrs:any,ParentFileId:any) => {
if(arrs&&arrs.ChildList.length>0) {
recursive(arrs.ChildList)
}
}
const recursiveTitle = (arrs:any,ParentFileId:any) => {
console.log(ParentFileId,'-----ParentFileId')
if(arrs.length>0) arrs.forEach(x => {
if(x.FileId==ParentFileId||x.ParentFileId==ParentFileId){
datas.ParentFiles.push(x.FileName)
console.log(datas.ParentFiles,'====datas.ParentFiles ')
}
if(x.ChildList.length>0){
recursionChild(x)
}
})
}
const recursionChildTitle = (arrs:any,ParentFileId:any) => {
if(arrs&&arrs.ChildList.length>0) {
recursiveTitle(arrs.ChildList,ParentFileId)
}
}
watch(props, (val) => {
getFile()
})
watch(datas, (val) => {
if(datas.ParentFileId){
datas.ParentFiles = []
// console.log(val.ParentFiles,'=====0000000')
recursiveTitle(dataList.value,datas.ParentFileId)
}
})
getFile()
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -16,17 +16,22 @@
><el-icon class="q-pt-md" v-if="queryObj.FileId > 0" size="20"
><ArrowLeft /></el-icon
></span>
<span v-if="queryObj.FileId == 0" class="q-pl-md">
<template v-if="currentMenu == 3">行程文档</template>
<template v-else-if="currentMenu == 4">广告图</template>
<span class="q-pl-md"
:class="[queryObj.FileId == 0?'':'row items-center']">
<span>
<template v-if="currentMenu == 3">行程文档</template>
<template v-else-if="currentMenu == 4">广告图</template>
</span>
<breadPeeling v-if="queryObj.FileId" :folder-id="queryObj.FileId" :file-type="queryObj.FileType"></breadPeeling>
</span>
<span v-else class="q-pl-md row items-center">
<!-- <span v-else class="q-pl-md row items-center">
<span>
<template v-if="currentMenu == 3">行程文档</template>
<template v-else-if="currentMenu == 4">广告图</template>
</span>
<span><span class="text-info q-ml-sm">/</span> {{ Navigation.FileName }}</span>
</span>
</span> -->
</h5>
<div class="select-btn q-pl-lg pointer q-mt-sm">
<el-icon>
......@@ -236,6 +241,7 @@ import ShareForm from "./ShareForm.vue";
import Folder from "./Folder.vue";
import HistoricalVersion from "./HistoricalVersion.vue";
import TreeFile from "./TreeFile.vue";
import breadPeeling from "./breadPeeling.vue";
const SalesEditorStore = useSellTemplateStore();
const marketStore = useScreenStore();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment