diff --git a/web/src/views/testdata/datamanagement/index.vue b/web/src/views/testdata/datamanagement/index.vue index e288df7..d4e7aba 100644 --- a/web/src/views/testdata/datamanagement/index.vue +++ b/web/src/views/testdata/datamanagement/index.vue @@ -994,6 +994,7 @@ const rowarr: any = ref() function renames(row: any) { rename.value = true rowarr.value = row + renameobj.value.fileName = row.fileName } function RenameClose() { rename.value = false @@ -1342,7 +1343,7 @@ function removeSuffix(filename: any) { - + @@ -1422,7 +1423,7 @@ function removeSuffix(filename: any) { - + (null) +//文件差异性对比 +const differential = ref(true) +function diffClose() { + differential.value = false +} //获取所有项目 function getProject() { tstaskList().then((res: any) => { @@ -65,36 +86,12 @@ function gettreedata() { nextTick(() => { treeRef.value?.setCurrentKey(pathid.value); }); - getdata() + getWorkData() }) } function handleNodeClick(data: any, node: any) { pathid.value = data.nodeId - getdata() -} -//工作空间数据处理 -const loadNode = (node: any, resolve: (data: any) => void) => { - if (node.level === 0) { - return resolve(workdata.value) - } - let hasChild = false - console.log(node) - if (node.data.isFile === 'FOLDER') { - hasChild = true - queryParams.value.id = node.data.id - getdata() - } else { - hasChild = false - } - let data: any = [] - if (hasChild) { - data = workTreeArr.value - } else { - data = [] - } - - resolve(data) - + getWorkData() } //工作空间树点击 const handleCheckChange = ( @@ -102,22 +99,64 @@ const handleCheckChange = ( checked: boolean, indeterminate: boolean ) => { - console.log(data, checked, indeterminate) + console.log(data, checked) } //工作空间树获取 -//获取表格数据 -function getdata() { +//获取工作空间数据 +function getWorkData() { // workloading.value = true queryParams.value.nodeId = pathid.value queryParams.value.taskId = projectId.value tsFilesPage(queryParams.value).then((res: any) => { // workloading.value = false workdata.value = res.data.records + backupsdata.value = res.data.records worktree.value = true - workTreeArr.value = workdata.value }) } +//备份空间 +function backupsChange( + data: any, + checked: boolean, + indeterminate: boolean +) { + console.log(data, checked) +} +//右键菜单 +const handleRightClick = (event: Event, data: any, node: any) => { + console.log(data) + event.preventDefault() + currentNode.value = data + contextMenuVisible.value = true + contextMenuPosition.value = { + x: (event as MouseEvent).clientX + 10, + y: (event as MouseEvent).clientY + } +} + +const handleMenuClick = (action: string, type: any) => { + contextMenuVisible.value = false + switch (action) { + case 'restore': + // 处理恢复逻辑 + break + case 'backups': + // 处理备份逻辑 + break + case 'delete': + // 处理删除逻辑 + break + case 'preview': + // 处理预览逻辑 + break + } +} + +// 点击其他地方关闭菜单 +document.addEventListener('click', () => { + contextMenuVisible.value = false +}) onMounted(() => { getProject() }); @@ -139,6 +178,32 @@ const vMove = { }; } } +//预览 +// 文件预览相关, 视频、音频、文本、图片 +const VideoPlayer = defineAsyncComponent({ + loader: () => import("@/components/file/preview/VideoPlayer.vue"), + loadingComponent: VideoPlayerAsyncLoading +}) +const TextViewer = defineAsyncComponent({ + loader: () => import("@/components/file/preview/TextViewer.vue"), + loadingComponent: TextViewerAsyncLoading +}) +const MarkdownViewer = defineAsyncComponent({ + loader: () => import("@/components/file/preview/MarkdownViewer.vue"), + loadingComponent: MarkdownViewerDialogAsyncLoading +}) +const PdfViewer = defineAsyncComponent({ + loader: () => import("@/components/file/preview/PdfViewer.vue"), + loadingComponent: MarkdownViewerDialogAsyncLoading +}) +const OfficeViewer = defineAsyncComponent({ + loader: () => import("@/components/file/preview/OfficeViewer.vue"), + loadingComponent: MarkdownViewerDialogAsyncLoading +}) +const Three3dPreview = defineAsyncComponent({ + loader: () => import("@/components/file/preview/Three3dPreview.vue"), + loadingComponent: MarkdownViewerDialogAsyncLoading +}) @@ -173,11 +238,184 @@ const vMove = { 工作空间: - + + + + + + {{ data.fileName }}({{ data.isFile == 'FOLDER' ? '0' : + data.fileSize + 'MB' }}) + + + + + 备份 + 删除 + 预览 + + + - + + 备份空间: + + + + + + + {{ data.fileName }}({{ data.isFile == 'FOLDER' ? '0' : + data.fileSize + 'MB' }}) + + + + + 恢复 + 删除 + 预览 + + + + + + + + + + + 新增内容: + 全部备份 + + + + + + + + {{ scope.row.fileSize + 'MB' }} + + + + + + + + + + + + + + + 变更内容: + 全部备份 + + + + + + + + {{ scope.row.fileSize + 'MB' }} + + + + + + + + + + + + + + + 缺失内容: 全部恢复 + + + + + + + {{ scope.row.fileSize + 'MB' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -249,6 +487,9 @@ const vMove = { margin-left: 15px; .tree_button { + display: flex; + align-items: center; + justify-content: flex-end; margin-bottom: 15px; } @@ -261,7 +502,7 @@ const vMove = { .tree_left { width: 49%; height: calc(78vh); - border: 1px solid red; + .tree_title { font-size: 20px; @@ -275,10 +516,8 @@ const vMove = { } .custom-tree-node { - flex: 1; - display: flex; - align-items: center; - justify-content: space-between; + display: inline-block; + width: 100%; font-size: 14px; padding: 5px; } @@ -312,4 +551,43 @@ const vMove = { padding: 0px !important; } } + +.context-menu { + position: fixed; + background: #fff; + border: 1px solid #ebeef5; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); + z-index: 9999; + min-width: 100px; + border-radius: 10px; + + .menu-item { + padding: 8px 16px; + cursor: pointer; + + &:hover { + background: #409eff; + color: #fff; + border-radius: 10px; + } + } +} + +//文件差异性对比 +.newContent { + width: 100%; + + .newContent_title { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + + .newContent_title_text { + font-size: 20px; + font-weight: 800; + } + } + +}