判断节点和websoct改动
This commit is contained in:
parent
01d1bf1dbf
commit
a2b04b8f04
@ -219,5 +219,14 @@ export function obtaintestData(params:any){
|
|||||||
method:'post',
|
method:'post',
|
||||||
params:params,
|
params:params,
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//判断节点
|
||||||
|
export function selectTsNodesByTskeId(params:any){
|
||||||
|
return request ({
|
||||||
|
url:'/experimentalData/ts-nodes/selectTsNodesByTskeId',
|
||||||
|
method:'post',
|
||||||
|
params:params,
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -101,4 +101,12 @@ export function obtainInformationAsync(queryParams:any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
params:queryParams
|
params:queryParams
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
////判断节点
|
||||||
|
export function selectNodesByProjectId(queryParams:any) {
|
||||||
|
return request({
|
||||||
|
url: '/specialDocument/sd_nodes/selectNodesByProjectId',
|
||||||
|
method: 'post',
|
||||||
|
params:queryParams
|
||||||
|
});
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, nextTick, defineAsyncComponent,onBeforeUnmount } from "vue";
|
import { ref, onMounted, nextTick, defineAsyncComponent, onBeforeUnmount, watch } from "vue";
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import { useUserStore } from '@/store/modules/user';
|
||||||
import { ElMessageBox, ElMessage } from "element-plus";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
@ -13,7 +13,7 @@ import { Search } from '@element-plus/icons-vue'
|
|||||||
import Page from '@/components/Pagination/page.vue';
|
import Page from '@/components/Pagination/page.vue';
|
||||||
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||||
import { batchDeleteReq } from "@/api/file-operator";
|
import { batchDeleteReq } from "@/api/file-operator";
|
||||||
import { projectList, documentUploadById, obtainInformationAsync, getNodesTree, addNodes, updateNodes, deleteNodesById, getFilesPage, addFiles, updateFiles, deleteFilesById, deleteFilesByIds, specialScanById } from "@/api/document";
|
import { projectList, selectNodesByProjectId, documentUploadById, obtainInformationAsync, getNodesTree, addNodes, updateNodes, deleteNodesById, getFilesPage, addFiles, updateFiles, deleteFilesById, deleteFilesByIds, specialScanById } from "@/api/document";
|
||||||
import ZUpload from '@/components/file/ZUpload.vue'
|
import ZUpload from '@/components/file/ZUpload.vue'
|
||||||
import useFileUpload from "@/components/file/file/useFileUpload";
|
import useFileUpload from "@/components/file/file/useFileUpload";
|
||||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||||
@ -42,17 +42,17 @@ const { openRow } = useFileData();
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProject()
|
getProject()
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
if (ws1 != null) {
|
if (ws1 != null) {
|
||||||
ws1.close()
|
ws1.close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const projectId = ref()
|
const projectId = ref()
|
||||||
//websocket
|
//websocket
|
||||||
let ws1
|
let ws1
|
||||||
function setupWebSocket() {
|
function setupWebSocket() {
|
||||||
ws1.onopen = () => {
|
ws1.onopen = () => {
|
||||||
console.log('websocket连接成功')
|
console.log('websocket连接成功')
|
||||||
@ -60,7 +60,7 @@ function setupWebSocket() {
|
|||||||
ws1.onerror = (error) => {
|
ws1.onerror = (error) => {
|
||||||
};
|
};
|
||||||
ws1.onmessage = (e) => {
|
ws1.onmessage = (e) => {
|
||||||
console.log('websocket接收到消息',e)
|
console.log('websocket接收到消息', e)
|
||||||
tonstatus()
|
tonstatus()
|
||||||
}
|
}
|
||||||
ws1.onclose = () => {
|
ws1.onclose = () => {
|
||||||
@ -68,6 +68,15 @@ function setupWebSocket() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
watch(() => projectId.value, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
if (ws1 != null) {
|
||||||
|
ws1.close()
|
||||||
|
}
|
||||||
|
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'projectId_' + projectId.value)
|
||||||
|
setupWebSocket()
|
||||||
|
}
|
||||||
|
});
|
||||||
//拖动条
|
//拖动条
|
||||||
const vMove = {
|
const vMove = {
|
||||||
mounted(el: any) {
|
mounted(el: any) {
|
||||||
@ -96,7 +105,7 @@ function getProject() {
|
|||||||
projectArr.value = res.data
|
projectArr.value = res.data
|
||||||
projectId.value = projectArr.value[0].id
|
projectId.value = projectArr.value[0].id
|
||||||
projectName.value = projectArr.value[0].projectName
|
projectName.value = projectArr.value[0].projectName
|
||||||
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'projectId_' + projectId.value )
|
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'projectId_' + projectId.value)
|
||||||
setupWebSocket()
|
setupWebSocket()
|
||||||
tonstatus()
|
tonstatus()
|
||||||
// gettreedata()
|
// gettreedata()
|
||||||
@ -115,14 +124,21 @@ const treeForm = ref({
|
|||||||
nodeName: '',
|
nodeName: '',
|
||||||
})
|
})
|
||||||
//扫庙
|
//扫庙
|
||||||
const buttonmsg = ref('扫描项目文档')
|
const buttonmsg = ref('扫描项目完整路径')
|
||||||
function scan() {
|
function scan() {
|
||||||
console.log('pathid.value')
|
selectNodesByProjectId({ projectId: projectId.value }).then((res: any) => {
|
||||||
specialScanById({ id: projectId.value }).then((res: any) => {
|
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||||
if (res.code == 0) {
|
ElMessage.warning(res.msg)
|
||||||
tonstatus()
|
return
|
||||||
|
} else {
|
||||||
|
specialScanById({ id: projectId.value }).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
tonstatus()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取树数据
|
//获取树数据
|
||||||
const treeRef = ref();
|
const treeRef = ref();
|
||||||
@ -361,20 +377,28 @@ function openFile() {
|
|||||||
}
|
}
|
||||||
//上传文件并扫描
|
//上传文件并扫描
|
||||||
function upfileZip() {
|
function upfileZip() {
|
||||||
title.value = "上传项目包并扫描"
|
selectNodesByProjectId({ projectId: projectId.value }).then((res: any) => {
|
||||||
localStorage.setItem('filepath', '/temporary');
|
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||||
localStorage.setItem('storageKey', JSON.stringify(['sdlocal']));
|
ElMessage.warning(res.msg)
|
||||||
upfile.value = true
|
return
|
||||||
fileObj.value = {
|
} else {
|
||||||
projectId: '', //所属项目ID
|
title.value = "上传项目包并扫描"
|
||||||
nodeId: '', //节点ID
|
localStorage.setItem('filepath', '/temporary');
|
||||||
fileName: '', //文件名称
|
localStorage.setItem('storageKey', JSON.stringify(['sdlocal']));
|
||||||
filePath: '', //文件对象存储路径
|
upfile.value = true
|
||||||
keywords: '', //关键字
|
fileObj.value = {
|
||||||
description: '', //文件描述
|
projectId: '', //所属项目ID
|
||||||
fileSize: '', //M
|
nodeId: '', //节点ID
|
||||||
}
|
fileName: '', //文件名称
|
||||||
judge.value = false
|
filePath: '', //文件对象存储路径
|
||||||
|
keywords: '', //关键字
|
||||||
|
description: '', //文件描述
|
||||||
|
fileSize: '', //M
|
||||||
|
}
|
||||||
|
judge.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
//修改文件
|
//修改文件
|
||||||
const judge = ref(false)
|
const judge = ref(false)
|
||||||
@ -465,9 +489,10 @@ function submitfile() {
|
|||||||
}
|
}
|
||||||
fileObj.value.projectId = projectId.value
|
fileObj.value.projectId = projectId.value
|
||||||
fileObj.value.nodeId = pathid.value
|
fileObj.value.nodeId = pathid.value
|
||||||
fileObj.value.filePath = filePath.value
|
fileObj.value.targetPath = filePath.value
|
||||||
fileObj.value.fileName = fileName.join(',')
|
fileObj.value.fileName = fileName.join(',')
|
||||||
fileObj.value.fileSize = fileSize.join(',')
|
fileObj.value.fileSize = fileSize.join(',')
|
||||||
|
fileObj.value.sourcePath = '/temporary'
|
||||||
addFiles(fileObj.value).then((res: any) => {
|
addFiles(fileObj.value).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
closeDialog()
|
closeDialog()
|
||||||
@ -754,22 +779,23 @@ const buttonmsg1 = ref('初始化导入项目完整压缩包')
|
|||||||
function tonstatus() {
|
function tonstatus() {
|
||||||
//sao
|
//sao
|
||||||
obtainInformationAsync({ id: projectId.value }).then((res: any) => {
|
obtainInformationAsync({ id: projectId.value }).then((res: any) => {
|
||||||
if (res.data.status == '1' && res.data.name == '扫描' ) {
|
if (res.data.status == '1' && res.data.name == '扫描') {
|
||||||
tonloading.value = false
|
tonloading.value = false
|
||||||
buttonmsg.value = '扫描项目完整路径'
|
buttonmsg.value = '扫描项目完整路径'
|
||||||
} else if(res.data.status == '0' && res.data.name == '扫描') {
|
} else if (res.data.status == '0' && res.data.name == '扫描') {
|
||||||
tonloading.value = true
|
tonloading.value = true
|
||||||
buttonmsg.value = '处理中...'
|
buttonmsg.value = '处理中...'
|
||||||
} else if(res.data.status == '1' && res.data.name == '上传'){
|
} else if (res.data.status == '1' && res.data.name == '上传') {
|
||||||
tonloading1.value = false
|
tonloading1.value = false
|
||||||
buttonmsg1.value = '初始化导入项目完整压缩包'
|
buttonmsg1.value = '初始化导入项目完整压缩包'
|
||||||
}else if(res.data.status == '0' && res.data.name == '上传'){
|
} else if (res.data.status == '0' && res.data.name == '上传') {
|
||||||
tonloading1.value = true
|
tonloading1.value = true
|
||||||
buttonmsg1.value = '处理中...'
|
buttonmsg1.value = '处理中...'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
gettreedata()
|
gettreedata()
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -808,11 +834,11 @@ function tonstatus() {
|
|||||||
</el-tree>
|
</el-tree>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" :loading="tonloading1" @click="upfileZip()" :disabled="tonloading"
|
<el-button type="primary" :loading="tonloading1" @click="upfileZip()" :disabled="tonloading"
|
||||||
style="width: 100%;margin-bottom: 5px;">{{ buttonmsg1 }}</el-button>
|
style="width: 100%;margin-bottom: 5px;">{{ buttonmsg1 }}</el-button>
|
||||||
<el-button type="primary" :loading="tonloading" @click="scan()" :disabled="tonloading1"
|
<el-button type="primary" :loading="tonloading" @click="scan()" :disabled="tonloading1"
|
||||||
style="width: 100%;margin-left: 0px;">{{ buttonmsg
|
style="width: 100%;margin-left: 0px;">{{ buttonmsg
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
42
web/src/views/testdata/datamanagement/index.vue
vendored
42
web/src/views/testdata/datamanagement/index.vue
vendored
@ -5,7 +5,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, nextTick, defineAsyncComponent, onUnmounted } from "vue";
|
import { ref, onMounted, nextTick, defineAsyncComponent ,watch,onBeforeUnmount} from "vue";
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import { useUserStore } from '@/store/modules/user';
|
||||||
@ -13,7 +13,7 @@ import { ElMessageBox, ElMessage, ElMain } from "element-plus";
|
|||||||
import Page from '@/components/Pagination/page.vue';
|
import Page from '@/components/Pagination/page.vue';
|
||||||
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
import AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||||
import { batchDeleteReq } from "@/api/file-operator";
|
import { batchDeleteReq } from "@/api/file-operator";
|
||||||
import { tstaskList, obtaintestData, getTsNodesTree, addTsNodes, updateTsNodes, deleteTsNodesById, tsFilesPage, addTsFiles, testDataScanById, updateTsFiles, deleteTsFilesById, listTsFiles, deleteTsFilesByIds, compress, Decompression, compare, downloadToLocal, uploadToBackup, addTsFile, list, moveFileFolder, copyFileFolder, startSimpleNavi, stopSimpleNavi } from "@/api/datamanagement";
|
import { tstaskList, obtaintestData, getTsNodesTree, addTsNodes, selectTsNodesByTskeId, updateTsNodes, deleteTsNodesById, tsFilesPage, addTsFiles, testDataScanById, updateTsFiles, deleteTsFilesById, listTsFiles, deleteTsFilesByIds, compress, Decompression, compare, downloadToLocal, uploadToBackup, addTsFile, list, moveFileFolder, copyFileFolder, startSimpleNavi, stopSimpleNavi } from "@/api/datamanagement";
|
||||||
import ZUpload from '@/components/file/ZUpload.vue'
|
import ZUpload from '@/components/file/ZUpload.vue'
|
||||||
import useFileUpload from "@/components/file/file/useFileUpload";
|
import useFileUpload from "@/components/file/file/useFileUpload";
|
||||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||||
@ -50,13 +50,13 @@ const { openRow } = useFileData();
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProject()
|
getProject()
|
||||||
|
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onBeforeUnmount(() => {
|
||||||
closeSSE()
|
closeSSE()
|
||||||
if (ws1 != null) {
|
if (ws1 != null) {
|
||||||
ws1.close()
|
ws1.close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//拖动条
|
//拖动条
|
||||||
const vMove = {
|
const vMove = {
|
||||||
@ -77,7 +77,7 @@ const vMove = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const projectId = ref()
|
const projectId = ref()
|
||||||
let ws1
|
let ws1
|
||||||
function setupWebSocket() {
|
function setupWebSocket() {
|
||||||
ws1.onopen = () => {
|
ws1.onopen = () => {
|
||||||
console.log('websocket连接成功')
|
console.log('websocket连接成功')
|
||||||
@ -85,7 +85,7 @@ function setupWebSocket() {
|
|||||||
ws1.onerror = (error) => {
|
ws1.onerror = (error) => {
|
||||||
};
|
};
|
||||||
ws1.onmessage = (e) => {
|
ws1.onmessage = (e) => {
|
||||||
console.log('websocket接收到消息',e)
|
console.log('websocket接收到消息', e)
|
||||||
tonstatus()
|
tonstatus()
|
||||||
}
|
}
|
||||||
ws1.onclose = () => {
|
ws1.onclose = () => {
|
||||||
@ -93,6 +93,15 @@ function setupWebSocket() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
watch(() => projectId.value, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
if (ws1 != null) {
|
||||||
|
ws1.close()
|
||||||
|
}
|
||||||
|
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
|
||||||
|
setupWebSocket()
|
||||||
|
}
|
||||||
|
});
|
||||||
//左侧树的选择框
|
//左侧树的选择框
|
||||||
|
|
||||||
const projectArr = ref([])
|
const projectArr = ref([])
|
||||||
@ -103,7 +112,7 @@ function getProject() {
|
|||||||
projectArr.value = res.data
|
projectArr.value = res.data
|
||||||
projectId.value = projectArr.value[0].id
|
projectId.value = projectArr.value[0].id
|
||||||
taskName.value = projectArr.value[0].taskName
|
taskName.value = projectArr.value[0].taskName
|
||||||
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId' + projectId.value )
|
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
|
||||||
setupWebSocket()
|
setupWebSocket()
|
||||||
gettreedata()
|
gettreedata()
|
||||||
tonstatus()
|
tonstatus()
|
||||||
@ -111,9 +120,19 @@ function getProject() {
|
|||||||
}
|
}
|
||||||
//扫描
|
//扫描
|
||||||
function scan() {
|
function scan() {
|
||||||
testDataScanById({ id: projectId.value }).then((res: any) => {
|
selectTsNodesByTskeId({ taskId: projectId.value }).then((res: any) => {
|
||||||
tonstatus()
|
|
||||||
|
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||||
|
ElMessage.warning(res.msg)
|
||||||
|
return
|
||||||
|
|
||||||
|
} else {
|
||||||
|
testDataScanById({ id: projectId.value }).then((res: any) => {
|
||||||
|
tonstatus()
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
const tonloading = ref(false)
|
const tonloading = ref(false)
|
||||||
const buttonmsg = ref('扫描试验数据')
|
const buttonmsg = ref('扫描试验数据')
|
||||||
@ -127,6 +146,7 @@ function tonstatus() {
|
|||||||
tonloading.value = true
|
tonloading.value = true
|
||||||
buttonmsg.value = '处理中...'
|
buttonmsg.value = '处理中...'
|
||||||
}
|
}
|
||||||
|
gettreedata()
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import { Search } from '@element-plus/icons-vue'
|
|||||||
import { ElMessageBox, ElMessage } from "element-plus";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import { useUserStore } from '@/store/modules/user';
|
||||||
import { tstaskList, getTsNodesTree, tsFilesPage, deleteTsFilesByIds } from "@/api/datamanagement";
|
import { tstaskList, getTsNodesTree, tsFilesPage, deleteTsFilesByIds } from "@/api/datamanagement";
|
||||||
import { listLocalAndBackup, compare, compareLocalList, automaticFileBackupByIds, compareMd5List, compareMinioList, compareLocal, compareMd5, compareMinio, uploadToBackup, downloadToLocal, deleteTsFilesById, automaticFileBackup, obtainUrl, listBackupTree, listLocalTree,automaticFileBackupData } from "@/api/fileSynchronization";
|
import { listLocalAndBackup, compare, compareLocalList, automaticFileBackupByIds, compareMd5List, compareMinioList, compareLocal, compareMd5, compareMinio, uploadToBackup, downloadToLocal, deleteTsFilesById, automaticFileBackup, obtainUrl, listBackupTree, listLocalTree, automaticFileBackupData } from "@/api/fileSynchronization";
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es';
|
||||||
import Page from '@/components/Pagination/page.vue';
|
import Page from '@/components/Pagination/page.vue';
|
||||||
//text文件编辑功能
|
//text文件编辑功能
|
||||||
@ -27,7 +27,9 @@ const { dialogVideoVisible, dialogTextVisible, dialogPdfVisible, dialogOfficeVis
|
|||||||
|
|
||||||
const { openRow } = useFileData();
|
const { openRow } = useFileData();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
let ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'backups' )
|
const projectId = ref()
|
||||||
|
const pathid = ref()
|
||||||
|
let ws1
|
||||||
function setupWebSocket() {
|
function setupWebSocket() {
|
||||||
ws1.onopen = () => {
|
ws1.onopen = () => {
|
||||||
console.log('websocket连接成功')
|
console.log('websocket连接成功')
|
||||||
@ -35,7 +37,7 @@ function setupWebSocket() {
|
|||||||
ws1.onerror = (error) => {
|
ws1.onerror = (error) => {
|
||||||
};
|
};
|
||||||
ws1.onmessage = (e) => {
|
ws1.onmessage = (e) => {
|
||||||
console.log('websocket接收到消息',e)
|
console.log('websocket接收到消息', e)
|
||||||
tonstatus()
|
tonstatus()
|
||||||
}
|
}
|
||||||
ws1.onclose = () => {
|
ws1.onclose = () => {
|
||||||
@ -45,10 +47,9 @@ function setupWebSocket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//左侧树的选择框
|
//左侧树的选择框
|
||||||
const projectId = ref()
|
|
||||||
const projectArr = ref([])
|
const projectArr = ref([])
|
||||||
//左侧树配置
|
//左侧树配置
|
||||||
const pathid = ref()
|
|
||||||
const treeRef = ref();
|
const treeRef = ref();
|
||||||
const treedata = ref([])
|
const treedata = ref([])
|
||||||
const treeloading = ref(false)
|
const treeloading = ref(false)
|
||||||
@ -107,16 +108,18 @@ function gettreeTwo() {
|
|||||||
///
|
///
|
||||||
const tonloading = ref(false)
|
const tonloading = ref(false)
|
||||||
const buttonmsg = ref('文件备份')
|
const buttonmsg = ref('文件备份')
|
||||||
function tonstatus(){
|
function tonstatus() {
|
||||||
//sao
|
//sao
|
||||||
automaticFileBackupData({nodeId:pathid.value,taskId:projectId.value}).then((res:any)=>{
|
automaticFileBackupData({ nodeId: pathid.value, taskId: projectId.value }).then((res: any) => {
|
||||||
if(res.data.status == '1'){
|
if (res.data.status == '1') {
|
||||||
tonloading.value = false
|
tonloading.value = false
|
||||||
buttonmsg.value = '文件备份'
|
buttonmsg.value = '文件备份'
|
||||||
}else{
|
} else {
|
||||||
tonloading.value = true
|
tonloading.value = true
|
||||||
buttonmsg.value = '处理中...'
|
buttonmsg.value = '处理中...'
|
||||||
}
|
}
|
||||||
|
getlocaltree()
|
||||||
|
getminiotree()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
////
|
////
|
||||||
@ -144,26 +147,25 @@ function backups() {
|
|||||||
ids.push(item.id)
|
ids.push(item.id)
|
||||||
})
|
})
|
||||||
params.id = ids.join(',')
|
params.id = ids.join(',')
|
||||||
} else {
|
|
||||||
params.nodeId = pathid.value
|
|
||||||
params.taskId = projectId.value
|
|
||||||
}
|
}
|
||||||
|
params.nodeId = pathid.value
|
||||||
|
params.taskId = projectId.value
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
automaticFileBackupByIds(params).then((res: any) => {
|
automaticFileBackupByIds(params).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
ElMessage.success(res.msg)
|
// ElMessage.success(res.msg)
|
||||||
tonstatus()
|
tonstatus()
|
||||||
getlocaltree()
|
// getlocaltree()
|
||||||
getminiotree()
|
// getminiotree()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
automaticFileBackup(params).then((res: any) => {
|
automaticFileBackup(params).then((res: any) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
ElMessage.success(res.msg)
|
// ElMessage.success(res.msg)
|
||||||
tonstatus()
|
tonstatus()
|
||||||
getlocaltree()
|
// getlocaltree()
|
||||||
getminiotree()
|
// getminiotree()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -384,6 +386,11 @@ function handleNodeClick(data: any, node: any) {
|
|||||||
localOnlyFiles.value.length = 0
|
localOnlyFiles.value.length = 0
|
||||||
md5MismatchedFiles.value.length = 0
|
md5MismatchedFiles.value.length = 0
|
||||||
minioOnlyFiles.value.length = 0
|
minioOnlyFiles.value.length = 0
|
||||||
|
if (ws1 != null) {
|
||||||
|
ws1.close()
|
||||||
|
}
|
||||||
|
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value + '_nodeId_' + pathid.value)
|
||||||
|
setupWebSocket()
|
||||||
getlocaltree()
|
getlocaltree()
|
||||||
getminiotree()
|
getminiotree()
|
||||||
tonstatus()
|
tonstatus()
|
||||||
@ -643,7 +650,7 @@ const handleMenuClick = (action: string, type: any) => {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const params = [{
|
const params = [{
|
||||||
path: currentNode.value.path,
|
path: currentNode.value.path,
|
||||||
name: currentNode.value.fileName,
|
name: currentNode.value.fileName,
|
||||||
size: currentNode.value.fileSize,
|
size: currentNode.value.fileSize,
|
||||||
type: currentNode.value.isFile
|
type: currentNode.value.isFile
|
||||||
@ -696,7 +703,7 @@ function tableBeifen(row: any) {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const params = [{
|
const params = [{
|
||||||
path: row.workPath,
|
path: row.workPath,
|
||||||
name: row.fileName,
|
name: row.fileName,
|
||||||
size: row.fileSize,
|
size: row.fileSize,
|
||||||
type: row.isFile
|
type: row.isFile
|
||||||
@ -759,7 +766,7 @@ function tablerestore(row: any) {
|
|||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const params = [{
|
const params = [{
|
||||||
path: row.backupPath,
|
path: row.backupPath,
|
||||||
name: row.fileName,
|
name: row.fileName,
|
||||||
size: row.fileSize,
|
size: row.fileSize,
|
||||||
type: row.isFile
|
type: row.isFile
|
||||||
@ -794,7 +801,7 @@ function moretablerestore() {
|
|||||||
|
|
||||||
let restoreArr2 = JSON.parse(JSON.stringify(restoreArr.value))
|
let restoreArr2 = JSON.parse(JSON.stringify(restoreArr.value))
|
||||||
restoreArr2.forEach((items: any) => {
|
restoreArr2.forEach((items: any) => {
|
||||||
restoreArr3.push({ path: items.backupPath, name: items.fileName, size: items.fileSize, type: items.isFile })
|
restoreArr3.push({ path: items.backupPath, name: items.fileName, size: items.fileSize, type: items.isFile })
|
||||||
})
|
})
|
||||||
loading2.value = true
|
loading2.value = true
|
||||||
loading3.value = true
|
loading3.value = true
|
||||||
@ -873,7 +880,7 @@ function bfclick(type: any) {
|
|||||||
let restoreArr3 = []
|
let restoreArr3 = []
|
||||||
let restoreArr2 = JSON.parse(JSON.stringify(changeclick.value))
|
let restoreArr2 = JSON.parse(JSON.stringify(changeclick.value))
|
||||||
restoreArr2.forEach((items: any) => {
|
restoreArr2.forEach((items: any) => {
|
||||||
restoreArr3.push({ path: items.backupPath, name: items.fileName, size: items.fileSize, type: items.isFile })
|
restoreArr3.push({ path: items.backupPath, name: items.fileName, size: items.fileSize, type: items.isFile })
|
||||||
})
|
})
|
||||||
downloadToLocal({ parameterLists: restoreArr3 }).then((res: any) => {
|
downloadToLocal({ parameterLists: restoreArr3 }).then((res: any) => {
|
||||||
if (res.code == '0') {
|
if (res.code == '0') {
|
||||||
@ -889,12 +896,14 @@ function bfclick(type: any) {
|
|||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProject()
|
getProject()
|
||||||
setupWebSocket()
|
// setupWebSocket()
|
||||||
});
|
});
|
||||||
// 组件卸载时取消防抖(可选)
|
// 组件卸载时取消防抖(可选)
|
||||||
// onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
// handleCheckChange.cancel()
|
if (ws1 != null) {
|
||||||
// })
|
ws1.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
//拖动条
|
//拖动条
|
||||||
const vMove = {
|
const vMove = {
|
||||||
mounted(el: any) {
|
mounted(el: any) {
|
||||||
@ -949,13 +958,13 @@ function openPreview(row: any, type: any) {
|
|||||||
if (getFileExtension(row.fileName) == 'pdf' || getFileExtension(row.fileName) == 'pptx' || getFileExtension(row.fileName) == 'xlsx' || getFileExtension(row.fileName) == 'xls' || getFileExtension(row.fileName) == 'docx' || getFileExtension(row.fileName) == 'doc' || getFileExtension(row.fileName) == 'bin') {
|
if (getFileExtension(row.fileName) == 'pdf' || getFileExtension(row.fileName) == 'pptx' || getFileExtension(row.fileName) == 'xlsx' || getFileExtension(row.fileName) == 'xls' || getFileExtension(row.fileName) == 'docx' || getFileExtension(row.fileName) == 'doc' || getFileExtension(row.fileName) == 'bin') {
|
||||||
title1.value = row.fileName
|
title1.value = row.fileName
|
||||||
geturl(row, type, true)
|
geturl(row, type, true)
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
row.fileType = getFileType(row.fileName)
|
row.fileType = getFileType(row.fileName)
|
||||||
filePreview.value = row
|
filePreview.value = row
|
||||||
geturl(row, type, false)
|
geturl(row, type, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function geturl(row: any, type1: any, pan: any) {
|
function geturl(row: any, type1: any, pan: any) {
|
||||||
@ -1091,7 +1100,8 @@ const tabs = ref(1)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tree_button">
|
<div class="tree_button">
|
||||||
<el-button type="primary" :loading="tonloading" :disabled="!pathid" @click="backups()" >{{buttonmsg}}</el-button>
|
<el-button type="primary" :loading="tonloading" :disabled="!pathid"
|
||||||
|
@click="backups()">{{ buttonmsg }}</el-button>
|
||||||
<el-button type="primary" :disabled="!pathid" @click="diffFile2()">差异检测</el-button>
|
<el-button type="primary" :disabled="!pathid" @click="diffFile2()">差异检测</el-button>
|
||||||
<el-button type="primary" :disabled="!pathid" @click="diffFile()">差异批量处理</el-button>
|
<el-button type="primary" :disabled="!pathid" @click="diffFile()">差异批量处理</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -1167,8 +1177,8 @@ const tabs = ref(1)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 文件差异性对比 -->
|
<!-- 文件差异性对比 -->
|
||||||
<el-dialog title="差异批量处理" v-model="differential" width="50%" :before-close="diffClose" top="30px" :close-on-click-modal="false"
|
<el-dialog title="差异批量处理" v-model="differential" width="50%" :before-close="diffClose" top="30px"
|
||||||
draggable destroy-on-close>
|
:close-on-click-modal="false" draggable destroy-on-close>
|
||||||
<div class="tabbs_all">
|
<div class="tabbs_all">
|
||||||
<div @click="tabs = 1" :class="tabs == 1 ? 'tabbs_box1' : 'tabbs_box'">新增文件</div>
|
<div @click="tabs = 1" :class="tabs == 1 ? 'tabbs_box1' : 'tabbs_box'">新增文件</div>
|
||||||
<div @click="tabs = 2" :class="tabs == 2 ? 'tabbs_box1' : 'tabbs_box'">修改文件</div>
|
<div @click="tabs = 2" :class="tabs == 2 ? 'tabbs_box1' : 'tabbs_box'">修改文件</div>
|
||||||
@ -1305,12 +1315,13 @@ const tabs = ref(1)
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 组件预览 -->
|
<!-- 组件预览 -->
|
||||||
<!-- 视频播放器 -->
|
<!-- 视频播放器 -->
|
||||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-video-dialog" :destroy-on-close="true" v-model="dialogVideoVisible">
|
<el-dialog draggable :close-on-click-modal="false" class="zfile-video-dialog" :destroy-on-close="true"
|
||||||
|
v-model="dialogVideoVisible">
|
||||||
<video-player v-if="dialogVideoVisible" ref="videoPlayer" />
|
<video-player v-if="dialogVideoVisible" ref="videoPlayer" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 文本编辑器 -->
|
<!-- 文本编辑器 -->
|
||||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-text-dialog zfile-dialog-mini-close" :destroy-on-close="true"
|
<el-dialog draggable :close-on-click-modal="false" class="zfile-text-dialog zfile-dialog-mini-close"
|
||||||
:title="filePreview.fileName" v-model="dialogTextVisible">
|
:destroy-on-close="true" :title="filePreview.fileName" v-model="dialogTextVisible">
|
||||||
<TextViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
<TextViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||||
v-if="dialogTextVisible && filePreview.fileName.indexOf('.md') === -1" />
|
v-if="dialogTextVisible && filePreview.fileName.indexOf('.md') === -1" />
|
||||||
<MarkdownViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
<MarkdownViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||||
@ -1318,19 +1329,22 @@ const tabs = ref(1)
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- pdf 在线预览 -->
|
<!-- pdf 在线预览 -->
|
||||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-pdf-dialog" :title="filePreview.fileName" v-model="dialogPdfVisible">
|
<el-dialog draggable :close-on-click-modal="false" class="zfile-pdf-dialog"
|
||||||
|
:title="filePreview.fileName" v-model="dialogPdfVisible">
|
||||||
<PdfViewer :file-name="filePreview.fileName" :file-url="filePreview.url" v-if="dialogPdfVisible" />
|
<PdfViewer :file-name="filePreview.fileName" :file-url="filePreview.url" v-if="dialogPdfVisible" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- office 在线预览 -->
|
<!-- office 在线预览 -->
|
||||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-office-dialog zfile-dialog-mini-close zfile-dialog-hidden-title"
|
<el-dialog draggable :close-on-click-modal="false"
|
||||||
|
class="zfile-office-dialog zfile-dialog-mini-close zfile-dialog-hidden-title"
|
||||||
:title="filePreview.fileName" v-model="dialogOfficeVisible">
|
:title="filePreview.fileName" v-model="dialogOfficeVisible">
|
||||||
<OfficeViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
<OfficeViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||||
v-if="dialogOfficeVisible" />
|
v-if="dialogOfficeVisible" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 3d 在线预览 -->
|
<!-- 3d 在线预览 -->
|
||||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-3d-dialog" :title="filePreview.fileName" v-model="dialog3dVisible">
|
<el-dialog draggable :close-on-click-modal="false" class="zfile-3d-dialog" :title="filePreview.fileName"
|
||||||
|
v-model="dialog3dVisible">
|
||||||
<Three3dPreview :file-name="filePreview.fileName" :file-url="filePreview.url"
|
<Three3dPreview :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||||
v-if="dialog3dVisible" />
|
v-if="dialog3dVisible" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -1338,13 +1352,13 @@ const tabs = ref(1)
|
|||||||
<AudioPlayer></AudioPlayer>
|
<AudioPlayer></AudioPlayer>
|
||||||
<Viewfile v-if="isViewfile" :showTime="true" :title="title1" :url="ViewfileUrl" :type="fileType"
|
<Viewfile v-if="isViewfile" :showTime="true" :title="title1" :url="ViewfileUrl" :type="fileType"
|
||||||
@update="CloseView" />
|
@update="CloseView" />
|
||||||
<el-dialog :title="title" v-model="textedit" :before-close="textClose" top="30px" draggable :close-on-click-modal="false" width="60%"
|
<el-dialog :title="title" v-model="textedit" :before-close="textClose" top="30px" draggable
|
||||||
destroy-on-close>
|
:close-on-click-modal="false" width="60%" destroy-on-close>
|
||||||
<textEdit :rowId="rowId" :fileUrl="fileUrl1" />
|
<textEdit :rowId="rowId" :fileUrl="fileUrl1" />
|
||||||
<!-- </el-scrollbar> -->
|
<!-- </el-scrollbar> -->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog :title="title" v-model="textedit1" :before-close="texexceltClose" top="30px" draggable :close-on-click-modal="false"
|
<el-dialog :title="title" v-model="textedit1" :before-close="texexceltClose" top="30px" draggable
|
||||||
width="60%" destroy-on-close>
|
:close-on-click-modal="false" width="60%" destroy-on-close>
|
||||||
<txtexl :file-url="fileUrl" :rowId="rowId" />
|
<txtexl :file-url="fileUrl" :rowId="rowId" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user