判断节点和websoct改动
This commit is contained in:
parent
01d1bf1dbf
commit
a2b04b8f04
@ -221,3 +221,12 @@ export function obtaintestData(params:any){
|
||||
|
||||
})
|
||||
}
|
||||
//判断节点
|
||||
export function selectTsNodesByTskeId(params:any){
|
||||
return request ({
|
||||
url:'/experimentalData/ts-nodes/selectTsNodesByTskeId',
|
||||
method:'post',
|
||||
params:params,
|
||||
|
||||
})
|
||||
}
|
@ -102,3 +102,11 @@ export function obtainInformationAsync(queryParams:any) {
|
||||
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 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 { useUserStore } from '@/store/modules/user';
|
||||
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 AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||
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 useFileUpload from "@/components/file/file/useFileUpload";
|
||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||
@ -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 = {
|
||||
mounted(el: any) {
|
||||
@ -115,15 +124,22 @@ const treeForm = ref({
|
||||
nodeName: '',
|
||||
})
|
||||
//扫庙
|
||||
const buttonmsg = ref('扫描项目文档')
|
||||
const buttonmsg = ref('扫描项目完整路径')
|
||||
function scan() {
|
||||
console.log('pathid.value')
|
||||
selectNodesByProjectId({ projectId: projectId.value }).then((res: any) => {
|
||||
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||
ElMessage.warning(res.msg)
|
||||
return
|
||||
} else {
|
||||
specialScanById({ id: projectId.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
tonstatus()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
//获取树数据
|
||||
const treeRef = ref();
|
||||
const filePath = ref('')
|
||||
@ -361,6 +377,11 @@ function openFile() {
|
||||
}
|
||||
//上传文件并扫描
|
||||
function upfileZip() {
|
||||
selectNodesByProjectId({ projectId: projectId.value }).then((res: any) => {
|
||||
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||
ElMessage.warning(res.msg)
|
||||
return
|
||||
} else {
|
||||
title.value = "上传项目包并扫描"
|
||||
localStorage.setItem('filepath', '/temporary');
|
||||
localStorage.setItem('storageKey', JSON.stringify(['sdlocal']));
|
||||
@ -376,6 +397,9 @@ function upfileZip() {
|
||||
}
|
||||
judge.value = false
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
//修改文件
|
||||
const judge = ref(false)
|
||||
function editfile(row: any, item: any) {
|
||||
@ -465,9 +489,10 @@ function submitfile() {
|
||||
}
|
||||
fileObj.value.projectId = projectId.value
|
||||
fileObj.value.nodeId = pathid.value
|
||||
fileObj.value.filePath = filePath.value
|
||||
fileObj.value.targetPath = filePath.value
|
||||
fileObj.value.fileName = fileName.join(',')
|
||||
fileObj.value.fileSize = fileSize.join(',')
|
||||
fileObj.value.sourcePath = '/temporary'
|
||||
addFiles(fileObj.value).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
closeDialog()
|
||||
@ -770,6 +795,7 @@ function tonstatus() {
|
||||
})
|
||||
gettreedata()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
28
web/src/views/testdata/datamanagement/index.vue
vendored
28
web/src/views/testdata/datamanagement/index.vue
vendored
@ -5,7 +5,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<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 { useAppStore } from '@/store/modules/app';
|
||||
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 AudioPlayer from '@/components/file/preview/AudioPlayer.vue';
|
||||
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 useFileUpload from "@/components/file/file/useFileUpload";
|
||||
import useHeaderStorageList from "@/components/header/useHeaderStorageList";
|
||||
@ -52,7 +52,7 @@ onMounted(() => {
|
||||
getProject()
|
||||
|
||||
});
|
||||
onUnmounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
closeSSE()
|
||||
if (ws1 != null) {
|
||||
ws1.close()
|
||||
@ -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([])
|
||||
@ -103,7 +112,7 @@ function getProject() {
|
||||
projectArr.value = res.data
|
||||
projectId.value = projectArr.value[0].id
|
||||
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()
|
||||
gettreedata()
|
||||
tonstatus()
|
||||
@ -111,10 +120,20 @@ function getProject() {
|
||||
}
|
||||
//扫描
|
||||
function scan() {
|
||||
selectTsNodesByTskeId({ taskId: projectId.value }).then((res: any) => {
|
||||
|
||||
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
|
||||
ElMessage.warning(res.msg)
|
||||
return
|
||||
|
||||
} else {
|
||||
testDataScanById({ id: projectId.value }).then((res: any) => {
|
||||
tonstatus()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
const tonloading = ref(false)
|
||||
const buttonmsg = ref('扫描试验数据')
|
||||
function tonstatus() {
|
||||
@ -127,6 +146,7 @@ function tonstatus() {
|
||||
tonloading.value = true
|
||||
buttonmsg.value = '处理中...'
|
||||
}
|
||||
gettreedata()
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -27,7 +27,9 @@ const { dialogVideoVisible, dialogTextVisible, dialogPdfVisible, dialogOfficeVis
|
||||
|
||||
const { openRow } = useFileData();
|
||||
const userStore = useUserStore();
|
||||
let ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'backups' )
|
||||
const projectId = ref()
|
||||
const pathid = ref()
|
||||
let ws1
|
||||
function setupWebSocket() {
|
||||
ws1.onopen = () => {
|
||||
console.log('websocket连接成功')
|
||||
@ -45,10 +47,9 @@ function setupWebSocket() {
|
||||
}
|
||||
|
||||
//左侧树的选择框
|
||||
const projectId = ref()
|
||||
|
||||
const projectArr = ref([])
|
||||
//左侧树配置
|
||||
const pathid = ref()
|
||||
const treeRef = ref();
|
||||
const treedata = ref([])
|
||||
const treeloading = ref(false)
|
||||
@ -117,6 +118,8 @@ function tonstatus(){
|
||||
tonloading.value = true
|
||||
buttonmsg.value = '处理中...'
|
||||
}
|
||||
getlocaltree()
|
||||
getminiotree()
|
||||
})
|
||||
}
|
||||
////
|
||||
@ -144,26 +147,25 @@ function backups() {
|
||||
ids.push(item.id)
|
||||
})
|
||||
params.id = ids.join(',')
|
||||
} else {
|
||||
}
|
||||
params.nodeId = pathid.value
|
||||
params.taskId = projectId.value
|
||||
}
|
||||
if (ids.length > 0) {
|
||||
automaticFileBackupByIds(params).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.msg)
|
||||
// ElMessage.success(res.msg)
|
||||
tonstatus()
|
||||
getlocaltree()
|
||||
getminiotree()
|
||||
// getlocaltree()
|
||||
// getminiotree()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
automaticFileBackup(params).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success(res.msg)
|
||||
// ElMessage.success(res.msg)
|
||||
tonstatus()
|
||||
getlocaltree()
|
||||
getminiotree()
|
||||
// getlocaltree()
|
||||
// getminiotree()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -384,6 +386,11 @@ function handleNodeClick(data: any, node: any) {
|
||||
localOnlyFiles.value.length = 0
|
||||
md5MismatchedFiles.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()
|
||||
getminiotree()
|
||||
tonstatus()
|
||||
@ -889,12 +896,14 @@ function bfclick(type: any) {
|
||||
}
|
||||
onMounted(() => {
|
||||
getProject()
|
||||
setupWebSocket()
|
||||
// setupWebSocket()
|
||||
});
|
||||
// 组件卸载时取消防抖(可选)
|
||||
// onBeforeUnmount(() => {
|
||||
// handleCheckChange.cancel()
|
||||
// })
|
||||
onBeforeUnmount(() => {
|
||||
if (ws1 != null) {
|
||||
ws1.close()
|
||||
}
|
||||
})
|
||||
//拖动条
|
||||
const vMove = {
|
||||
mounted(el: any) {
|
||||
@ -1091,7 +1100,8 @@ const tabs = ref(1)
|
||||
</div>
|
||||
</div>
|
||||
<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="diffFile()">差异批量处理</el-button>
|
||||
</div>
|
||||
@ -1167,8 +1177,8 @@ const tabs = ref(1)
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件差异性对比 -->
|
||||
<el-dialog title="差异批量处理" v-model="differential" width="50%" :before-close="diffClose" top="30px" :close-on-click-modal="false"
|
||||
draggable destroy-on-close>
|
||||
<el-dialog title="差异批量处理" v-model="differential" width="50%" :before-close="diffClose" top="30px"
|
||||
:close-on-click-modal="false" draggable destroy-on-close>
|
||||
<div class="tabbs_all">
|
||||
<div @click="tabs = 1" :class="tabs == 1 ? '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 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" />
|
||||
</el-dialog>
|
||||
<!-- 文本编辑器 -->
|
||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-text-dialog zfile-dialog-mini-close" :destroy-on-close="true"
|
||||
:title="filePreview.fileName" v-model="dialogTextVisible">
|
||||
<el-dialog draggable :close-on-click-modal="false" class="zfile-text-dialog zfile-dialog-mini-close"
|
||||
:destroy-on-close="true" :title="filePreview.fileName" v-model="dialogTextVisible">
|
||||
<TextViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||
v-if="dialogTextVisible && filePreview.fileName.indexOf('.md') === -1" />
|
||||
<MarkdownViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||
@ -1318,19 +1329,22 @@ const tabs = ref(1)
|
||||
</el-dialog>
|
||||
|
||||
<!-- 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" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 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">
|
||||
<OfficeViewer :file-name="filePreview.fileName" :file-url="filePreview.url"
|
||||
v-if="dialogOfficeVisible" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 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"
|
||||
v-if="dialog3dVisible" />
|
||||
</el-dialog>
|
||||
@ -1338,13 +1352,13 @@ const tabs = ref(1)
|
||||
<AudioPlayer></AudioPlayer>
|
||||
<Viewfile v-if="isViewfile" :showTime="true" :title="title1" :url="ViewfileUrl" :type="fileType"
|
||||
@update="CloseView" />
|
||||
<el-dialog :title="title" v-model="textedit" :before-close="textClose" top="30px" draggable :close-on-click-modal="false" width="60%"
|
||||
destroy-on-close>
|
||||
<el-dialog :title="title" v-model="textedit" :before-close="textClose" top="30px" draggable
|
||||
:close-on-click-modal="false" width="60%" destroy-on-close>
|
||||
<textEdit :rowId="rowId" :fileUrl="fileUrl1" />
|
||||
<!-- </el-scrollbar> -->
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" v-model="textedit1" :before-close="texexceltClose" top="30px" draggable :close-on-click-modal="false"
|
||||
width="60%" destroy-on-close>
|
||||
<el-dialog :title="title" v-model="textedit1" :before-close="texexceltClose" top="30px" draggable
|
||||
:close-on-click-modal="false" width="60%" destroy-on-close>
|
||||
<txtexl :file-url="fileUrl" :rowId="rowId" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user