20250711会议要求修改

This commit is contained in:
wangxk 2025-07-15 11:59:01 +08:00
parent 3c7fe4c13f
commit d3c8bde081
10 changed files with 45717 additions and 353 deletions

View File

@ -212,7 +212,7 @@ export function testDataScanById(params:any){
})
}
//获取异步信息
//获取异步信息(扫描)
export function obtaintestData(params:any){
return request ({
url:'/experimentalData/ts-nodes/obtaintestData',
@ -221,6 +221,15 @@ export function obtaintestData(params:any){
})
}
//获取异步信息(解压)
export function decompressionFolderData(params:any){
return request ({
url:'/experimentalData/ts-files/decompressionFolderData',
method:'post',
params:params,
})
}
//判断节点
export function selectTsNodesByTskeId(params:any){
return request ({

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ const initChart = () => {
},
xAxis: {
type: 'value',
name: '时间 (s)',
name: '时间 (h)',
nameLocation: 'middle',
nameGap: 30
},
@ -60,7 +60,7 @@ const updateChart = () => {
console.log('Updating chart...'); //
// {x,y} -> [x,y]
const seriesData = props.chartData.map(item => [item.x, item.y]);
const seriesData = props.chartData.map(item => [item.x / 3600, item.y]); //
console.log('seriesData:', seriesData); //
//

View File

@ -9,7 +9,11 @@
<script setup>
import { ref, onMounted, watch, defineEmits, onBeforeUnmount } from 'vue'
import * as d3 from 'd3'
import chinaData from './newJson.json'
//
import chinaProvinces from './china_provinces.json'
//
import worldMap from './newJson.json'
// ==================== ====================
const DEFAULT_MAP_SIZE = { width: 800, height: 600 }
@ -40,12 +44,12 @@ const emit = defineEmits(['qvehuan1'])
// ==================== ====================
const mapContainer = ref(null)
const isFullscreen = ref(false)
const isRouteInitialized = ref(false) // initqie
// ==================== D3 ====================
let svgInstance = null
let mapGroup = null
let markersGroup = null
let routeGroup = null
let zoomBehavior = null
// ==================== ====================
@ -65,7 +69,6 @@ const createProjection = () => {
* 初始化地图基础结构
*/
const initializeMap = () => {
//
if (svgInstance) svgInstance.remove()
const { width, height } = getContainerSize()
@ -80,49 +83,90 @@ const initializeMap = () => {
//
const mainGroup = svgInstance.append('g')
mapGroup = mainGroup.append('g').attr('class', 'map-layer')
markersGroup = mainGroup.append('g').attr('class', 'markers-layer')
//
renderChinaMap(pathGenerator)
mapGroup = mainGroup.append('g').attr('class', 'map-layer') // /
markersGroup = mainGroup.append('g').attr('class', 'markers-layer') //
routeGroup = mainGroup.append('g').attr('class', 'route-layer') //
//
renderWorldCountries(pathGenerator)
//
renderChinaProvinces(projection)
//
initializeZoomBehavior(mainGroup)
}
/**
* 渲染中国地图路径和文字
* @param {d3.GeoPath} path - 路径生成器
* 渲染世界地图中的所有国家
*/
const renderChinaMap = (path) => {
//
mapGroup.append('g')
.selectAll('path')
.data(chinaData.features)
const renderWorldCountries = (path) => {
mapGroup.selectAll('.country-path')
.data(worldMap.features)
.enter()
.append('path')
.attr('class', 'country-path')
.attr('d', path)
.attr('fill', '#e7e7e7')
.attr('stroke', '#fff')
.attr('stroke', '#000')
.attr('stroke-width', 0.2)
//
mapGroup.append('g')
.selectAll('text')
.data(chinaData.features)
//
mapGroup.selectAll('.country-label')
.data(worldMap.features)
.enter()
.append('text')
.attr('transform', d => `translate(${path.centroid(d)})`)
.attr('class', 'country-label')
.attr('transform', d => {
const centroid = path.centroid(d)
return `translate(${centroid[0]},${centroid[1]})`
})
.text(d => d.properties.name || '')
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'central')
.style('font', '12px Arial')
.style('font-size', '10px')
.attr('fill', '#333')
.style('pointer-events', 'none')
}
/**
* 渲染中国省份边界
*/
const renderChinaProvinces = (projection) => {
const pathGenerator = d3.geoPath().projection(projection)
//
mapGroup.selectAll('.province-path')
.data(chinaProvinces.features)
.enter()
.append('path')
.attr('class', 'province-path')
.attr('d', pathGenerator)
.attr('fill', 'none')
.attr('stroke', '#000')
.attr('stroke-width', 0.2)
//
mapGroup.selectAll('.province-label')
.data(chinaProvinces.features)
.enter()
.append('text')
.attr('class', 'province-label')
.attr('transform', d => {
const centroid = pathGenerator.centroid(d)
return `translate(${centroid[0]},${centroid[1]})`
})
.text(d => d.properties.name || '')
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'central')
.style('font-size', '2px')
.attr('fill', '#000')
.style('pointer-events', 'none')
}
/**
* 初始化缩放行为
* @param {d3.Selection} group - 需要应用缩放的分组
*/
const initializeZoomBehavior = (group) => {
zoomBehavior = d3.zoom()
@ -134,49 +178,40 @@ const initializeZoomBehavior = (group) => {
}
// ==================== 线 ====================
/**
* 更新路线和标记点
*/
const updateRoute = () => {
if (!props.coordinates?.length) return
if (!mapGroup) initializeMap()
if (!props.coordinates?.length || !mapGroup) return
const projection = createProjection()
const pathGenerator = d3.geoPath().projection(projection)
//
if (isRouteInitialized.value) {
mapGroup.selectAll('.route-path').remove()
// 线
routeGroup.selectAll('.route-path').remove()
markersGroup.selectAll('*').remove()
isRouteInitialized.value = false
emit('qvehuan1', isRouteInitialized.value)
}
// 线
renderRoutePath(pathGenerator)
renderMarkers(projection)
}
/**
* 绘制路径动画
* @param {d3.GeoPath} path - 路径生成器
*/
const renderRoutePath = (path) => {
const routeData = {
type: "LineString",
coordinates: props.coordinates
}
mapGroup.append('path')
routeGroup.selectAll('.route-path').remove()
routeGroup.append('path')
.datum(routeData)
.attr('class', 'route-path')
.attr('d', path)
.attr('fill', 'none')
.attr('stroke', '#f00')
.attr('stroke-width', 0.1)
.attr('stroke-dasharray', function() {
.attr('stroke-dasharray', function () {
return this.getTotalLength()
})
.attr('stroke-dashoffset', function() {
.attr('stroke-dashoffset', function () {
return this.getTotalLength()
})
.transition()
@ -184,10 +219,6 @@ const renderRoutePath = (path) => {
.attr('stroke-dashoffset', 0)
}
/**
* 绘制位置标记点
* @param {d3.GeoProjection} projection - 地理投影实例
*/
const renderMarkers = (projection) => {
props.coordinates.forEach(coord => {
if (!isValidCoordinate(coord)) return
@ -225,18 +256,16 @@ const toggleFullscreen = () => {
setTimeout(() => {
initializeMap()
updateRoute()
}, 100) // DOM
}, 100)
}
// ==================== ====================
onMounted(() => {
window.addEventListener('resize', handleWindowResize)
//
initializeMap() // [!code ++]
// coordinates线
if (props.coordinates?.length) { // [!code ++]
updateRoute() // [!code ++]
} // [!code ++]
initializeMap()
if (props.coordinates?.length) {
updateRoute()
}
})
onBeforeUnmount(() => {
@ -245,8 +274,7 @@ onBeforeUnmount(() => {
// ==================== ====================
watch(() => props.qvehuan, (newVal) => {
isRouteInitialized.value = newVal
updateRoute()
if (!newVal) updateRoute()
})
watch(() => props.coordinates, () => {
@ -254,7 +282,7 @@ watch(() => props.coordinates, () => {
}, { deep: true })
</script>
<style>
<style scoped>
.map-container {
position: relative;
background-color: #f0f8ff;

File diff suppressed because one or more lines are too long

View File

@ -868,6 +868,21 @@ function readyto(ready: any, type: any) {
}, 5000)
}
}
/**
* 格式化文件大小传入单位是 KB
* @param size 千字节数 (KB)
* @returns 格式化后的文件大小字符串
*/
const formatFileSize = (size: number): string => {
if(!size) return '--'
if (size < 1024) return `${size.toFixed(1)} KB`;
const mb = size / 1024;
if (mb < 1024) return `${mb.toFixed(1)} MB`;
const gb = mb / 1024;
return `${gb.toFixed(1)} GB`;
};
</script>
<template>
@ -945,7 +960,9 @@ function readyto(ready: any, type: any) {
<el-table-column type="selection" width="40" />
<!-- <el-table-column type="index" label="序号" width="70" align="center"></el-table-column> -->
<el-table-column prop="fileName" label="文件名称">
</el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="90" align="center">
<template #default="{ row }">{{formatFileSize(Number(row.fileSize))}}</template>
</el-table-column>
<el-table-column prop="keywords" label="关键字"></el-table-column>
<el-table-column prop="description" label="文件描述"></el-table-column>

View File

@ -53,7 +53,7 @@ function addproject() {
title.value = "新增储存源"
projectForme.value = {
name: "",//
key: "",//
key: "",//id
remark: "",//
type: "",//
filePath: "",//
@ -157,7 +157,7 @@ function handleClose(formEl: any) {
const ruleFormRef = ref()
const projectForme: any = ref({
name: "",//
key: "",//
key: "",//id
remark: "",//
type: "",//
filePath: "",//
@ -173,7 +173,7 @@ async function submitForm(formEl: any) {
if (valid) {
let params: any = {
name: projectForme.value.name,//
key: projectForme.value.key,//
key: projectForme.value.key,//id
remark: projectForme.value.remark,//
type: projectForme.value.type,//
storageSourceAllParam: {
@ -200,7 +200,20 @@ async function submitForm(formEl: any) {
//
const moderules = ref({
name: [{ required: true, message: "请输入存储源名称", trigger: "blur" }],
key: [{ required: true, message: "请输入存储源别名", trigger: "blur" }],
key: [
{ required: true, message: "请输入存储源id", trigger: "blur" },
{
validator: (rule: any, value: string, callback: any) => {
const chinesePattern = /[\u4e00-\u9fa5]/;
if (chinesePattern.test(value)) {
callback(new Error('存储源id必须为英文名称'));
} else {
callback();
}
},
trigger: 'blur'
}
],
remark: [{ required: true, message: "请输入存储源备注", trigger: "blur" }],
type: [{ required: true, message: "请输入存储源策略", trigger: "change" }],
filePath: [{ required: true, message: "请输入文件路径", trigger: "blur" }],
@ -240,12 +253,12 @@ function comparePercentage(percentStr: any) {
return percentStr.spaceOccupancyRatio;
}
const arr = percentStr.spaceOccupancyRatio.split(";").map(item => parseFloat(item.replace("%", "")));
if(arr.length > 0){
if (arr.length > 0) {
arr.forEach(item => {
if ((item < 20 && item > 10)|| item == 20) {
if ((item < 20 && item > 10) || item == 20) {
percentStr.resar = '#c5c528'
}
if (item < 10|| item == 10) {
if (item < 10 || item == 10) {
percentStr.resar = 'red'
}
});
@ -287,32 +300,32 @@ function comparePercentage(percentStr: any) {
<!-- <el-table-column type="index" label="序号" width="70" align="center"></el-table-column> -->
<el-table-column prop="name" label="存储空间名称" width="200">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{
scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="key" label="存储源别名" width="100">
<el-table-column prop="key" label="存储源id" width="100">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{
scope.row.key }}</span>
</template>
</el-table-column>
<el-table-column prop="type" label="存储策略" width="100">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{
typeName(dictType, scope.row.type) }}</span>
</template>
</el-table-column>
<el-table-column prop="valueData" label="存储路径" width="200">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{
scope.row.valueData }}</span>
</template>
</el-table-column>
<el-table-column prop="storeContent" label="存放项目/任务">
<template #default="scope">
<div class="ellipsis">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }"
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }"
class="single-line-ellipsis">{{ scope.row.storeContent }}</span>
<img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)"
style="cursor: pointer;">
@ -321,10 +334,15 @@ function comparePercentage(percentStr: any) {
</el-table-column>
<el-table-column prop="spaceOccupancyRatio" label="剩余空间占比" width="140">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{
comparePercentage(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="spaceOccupancyRatio" label="剩余空间大小" width="110">
<template #default="scope">
<span :style="{ color: scope.row.resar, 'font-size': scope.row.resar != '' ? '16px' : '' }">{{ scope.row.remainingSpaceSize }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="80" align="center">
<template #default="scope">
<span
@ -345,12 +363,12 @@ function comparePercentage(percentStr: any) {
:close-on-click-modal="false" destroy-on-close>
<el-form ref="ruleFormRef" :model="projectForme" :rules="moderules" label-width="auto" class="demo-ruleForm"
status-icon>
<el-form-item label=" 存储源id" prop="key">
<el-input v-model="projectForme.key" :disabled="storeContent != ''" />
</el-form-item>
<el-form-item label=" 存储源名称" prop="name">
<el-input v-model="projectForme.name" :disabled="storeContent != ''" />
</el-form-item>
<el-form-item label=" 存储源别名" prop="key">
<el-input v-model="projectForme.key" :disabled="storeContent != ''" />
</el-form-item>
<el-form-item label=" 存储源备注">
<el-input v-model="projectForme.remark" :disabled="storeContent != ''" />
</el-form-item>
@ -360,7 +378,8 @@ function comparePercentage(percentStr: any) {
:value="item.itemcode" />
</el-select>
</el-form-item>
<el-form-item v-if="projectForme.type" :label="projectForme.type == 'minio'?'宿主机挂载绝对路径':'存储空间绝对路径'" prop="filePath">
<el-form-item v-if="projectForme.type" :label="projectForme.type == 'minio' ? '宿主机挂载绝对路径' : '存储空间绝对路径'"
prop="filePath">
<el-input v-model="projectForme.filePath" :disabled="storeContent != ''" />
</el-form-item>
<el-form-item label=" AccessKey" prop="accessKey" v-if="projectForme.type == 'minio'">

View File

@ -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, confirmDeleteNodes, 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 { tstaskList, obtaintestData, decompressionFolderData, getTsNodesTree, confirmDeleteNodes, 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";
@ -57,6 +57,10 @@ onBeforeUnmount(() => {
if (ws1 != null) {
ws1.close()
}
if (ws2 != null) {
ws2.close()
}
})
//
const vMove = {
@ -93,13 +97,34 @@ function setupWebSocket() {
};
}
let ws2
function setupWebSocket2() {
ws2.onopen = () => {
console.log('websocket连接成功1111')
};
ws2.onerror = (error) => {
};
ws2.onmessage = (e) => {
console.log('websocket接收到消息', e)
// tonstatus(true)
readyto2(e.data)
}
ws2.onclose = () => {
};
}
watch(() => projectId.value, (newVal) => {
if (newVal) {
if (ws1 != null) {
ws1.close()
}
if (ws2 != null) {
ws2.close()
}
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
setupWebSocket()
ws2 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'id_extract_' + projectId.value)
setupWebSocket2()
}
});
//
@ -115,6 +140,8 @@ function getProject() {
// taskName.value = projectArr.value[0].taskName
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
setupWebSocket()
ws2 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + "id_extract_" + projectId.value)
setupWebSocket2()
gettreedata()
tonstatus(false)
})
@ -143,6 +170,12 @@ function tonstatus(ready: any) {
gettreedata()
})
//
decompressionFolderData({ taskId: projectId.value }).then((res: any) => {
if (res.data != '没有解压任务!') {
readyto2(res.data)
}
})
}
function readyto(ready: any) {
if (ready) {
@ -160,6 +193,29 @@ function readyto(ready: any) {
}, 5000)
}
}
function readyto2(msg: any) {
let gai = ref(false)
ElMessageBox.confirm(
msg,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
gai.value = true
getdata()
})
setTimeout(() => {
ElMessageBox.close()
if(!gai.value){
getdata()
}
}, 5000)
}
//
const treedata = ref([])
const treeloading = ref(false)
@ -213,7 +269,7 @@ function handleNodeClick(data: any, node: any) {
if (nodename.value == '根节点') {
filepath.value = data.path
} else {
filepath.value =data.path + nodename.value + '/'
filepath.value = data.path + nodename.value + '/'
}
creatform.value.workPath = ''
}
@ -1316,7 +1372,7 @@ async function submitzip(formEl: any) {
if (!formEl) return
await formEl.validate((valid: any, fields: any) => {
if (valid) {
loading.value = true
// loading.value = true
zipfiles.value = false
if (zipzheng.value == true) {
let idsarr = []
@ -1344,8 +1400,8 @@ async function submitzip(formEl: any) {
Decompression({ id: jiezip.value.id, parentId: zipParentid.value, decompressionPath: zipObj.value.compressedPath, path: filepath.value, taskId: projectId.value }).then((res: any) => {
if (res.code == 0) {
ElMessage.success('解压成功')
getdata()
// ElMessage.success('')
zipfiles.value = false
tableIdarr.value.length = 0
filetableRef.value!.clearSelection()
@ -1658,6 +1714,21 @@ function texexceltClose() {
function repstring(row: any) {
return JSON.parse(JSON.stringify(row)).replace(filepath.value, "");
}
/**
* 格式化文件大小传入单位是 KB
* @param size 千字节数 (KB)
* @returns 格式化后的文件大小字符串
*/
const formatFileSize = (size: number): string => {
if(!size) return '--'
if (size < 1024) return `${size.toFixed(1)} KB`;
const mb = size / 1024;
if (mb < 1024) return `${mb.toFixed(1)} MB`;
const gb = mb / 1024;
return `${gb.toFixed(1)} GB`;
};
</script>
<template>
@ -1722,8 +1793,7 @@ function repstring(row: any) {
</div>
<div>
<!-- :disabled="pathid.value" -->
<el-button type="primary" :disabled="loading"
@click="creatFile">创建文件/文件夹</el-button>
<el-button type="primary" :disabled="loading" @click="creatFile">创建文件/文件夹</el-button>
<el-button type="primary" :disabled="loading" @click="openFile">上传</el-button>
<el-button type="primary" @click="delprojectArr()" :disabled="tableIdarr.length == 0">删除</el-button>
<el-button type="primary" @click="xiafilemony()" :disabled="tableIdarr.length == 0">下载</el-button>
@ -1747,6 +1817,9 @@ function repstring(row: any) {
<div v-else-if="scope.row.isFile == 'FILE'">{{ scope.row.fileName }} </div>
</template>
</el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="90" align="center">
<template #default="{ row }">{{ formatFileSize(Number(row.fileSize)) }}</template>
</el-table-column>
<el-table-column prop="keywords" label="关键字"></el-table-column>
<!-- <el-table-column prop="workPath" label="路径">
<template #default="scope">
@ -1916,7 +1989,7 @@ function repstring(row: any) {
</el-input>
<el-input v-else v-model="zipObj.compressedName" disabled maxlength="40" show-word-limit></el-input>
</el-form-item>
<el-form-item label="压缩路径:" prop="compressedPath">
<el-form-item :label="title + '路径:'" prop="compressedPath">
<el-input v-model="zipObj.compressedPath" maxlength="600" show-word-limit>
<template #prepend>
<el-popover :visible="visible" placement="right" :width="400" trigger="click">

View File

@ -646,7 +646,7 @@ const handleMenuClick = (action: string, type: any) => {
size: currentNode.value.fileSize,
type: currentNode.value.isFile
}]
downloadToLocal({ parameterLists: params,taskId:projectId.value }).then((res: any) => {
downloadToLocal({ parameterLists: params, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
minioOnlyFiles.value = minioOnlyFiles.value.filter((item: any) => item.id !== currentNode.value.id)
@ -675,7 +675,7 @@ const handleMenuClick = (action: string, type: any) => {
size: currentNode.value.fileSize,
type: currentNode.value.isFile
}]
uploadToBackup({ parameterLists: params,taskId:projectId.value }).then((res: any) => {
uploadToBackup({ parameterLists: params, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("上传成功")
localOnlyFiles.value = localOnlyFiles.value.filter((item: any) => item.id !== currentNode.value.id)
@ -689,7 +689,7 @@ const handleMenuClick = (action: string, type: any) => {
break
case 'delete':
//
deleteTsFilesById({ id: currentNode.value.id, type: type,taskId:projectId.value }).then((res: any) => {
deleteTsFilesById({ id: currentNode.value.id, type: type, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("删除成功")
getlocaltree()
@ -729,7 +729,7 @@ function tableBeifen(row: any) {
}]
loading1.value = true
loading2.value = true
uploadToBackup({ parameterLists: params,taskId:projectId.value }).then((res: any) => {
uploadToBackup({ parameterLists: params, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("上传成功")
diffSure(false)
@ -761,7 +761,7 @@ function moretableBeifen() {
})
loading1.value = true
loading2.value = true
uploadToBackup({ parameterLists: beifenArr3,taskId:projectId.value }).then((res: any) => {
uploadToBackup({ parameterLists: beifenArr3, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
diffSure(false)
diffChange(false)
@ -792,7 +792,7 @@ function tablerestore(row: any) {
}]
loading3.value = true
loading2.value = true
downloadToLocal({ parameterLists: params,taskId:projectId.value }).then((res: any) => {
downloadToLocal({ parameterLists: params, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
diffChange(false)
@ -824,7 +824,7 @@ function moretablerestore() {
})
loading2.value = true
loading3.value = true
downloadToLocal({ parameterLists: restoreArr3,taskId:projectId.value }).then((res: any) => {
downloadToLocal({ parameterLists: restoreArr3, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
diffChange(false)
@ -850,7 +850,7 @@ function delhuifu() {
ids.value.push(item.id)
})
loading3.value = true
deleteTsFilesByIds({ ids: ids.value.join(','), type: 'minio',taskId:projectId.value }).then((res: any) => {
deleteTsFilesByIds({ ids: ids.value.join(','), type: 'minio', taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("删除成功")
diffMiss(false)
@ -889,7 +889,7 @@ function bfclick(type: any) {
beifenArr2.forEach((items: any) => {
beifenArr3.push({ path: items.workPath, name: items.fileName, size: items.fileSize, type: items.isFile })
})
uploadToBackup({ parameterLists: beifenArr3,taskId:projectId.value }).then((res: any) => {
uploadToBackup({ parameterLists: beifenArr3, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("上传成功")
diffChange(false)
@ -901,7 +901,7 @@ function bfclick(type: any) {
restoreArr2.forEach((items: any) => {
restoreArr3.push({ path: items.backupPath, name: items.fileName, size: items.fileSize, type: items.isFile })
})
downloadToLocal({ parameterLists: restoreArr3,taskId:projectId.value }).then((res: any) => {
downloadToLocal({ parameterLists: restoreArr3, taskId: projectId.value }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
diffChange(false)
@ -987,7 +987,7 @@ function openPreview(row: any, type: any) {
}
}
function geturl(row: any, type1: any, pan: any) {
obtainUrl({ id: row.id, type: type1,taskId:projectId.value }).then((res: any) => {
obtainUrl({ id: row.id, type: type1, taskId: projectId.value }).then((res: any) => {
if (pan) {
ViewfileUrl.value = res.data.url
isViewfile.value = true
@ -1075,6 +1075,22 @@ function CloseView() {
}
//tabbas
const tabs = ref(1)
/**
* 格式化文件大小传入单位是 KB
* @param size 千字节数 (KB)
* @returns 格式化后的文件大小字符串
*/
const formatFileSize = (size: number): string => {
if (!size) return '--'
if (size < 1024) return `${size.toFixed(1)} KB`;
const mb = size / 1024;
if (mb < 1024) return `${mb.toFixed(1)} MB`;
const gb = mb / 1024;
return `${gb.toFixed(1)} GB`;
};
</script>
<template>
@ -1107,20 +1123,20 @@ const tabs = ref(1)
<div class="legend">
<div class="legend_box">
<div class="legend_color1"></div>
<div class="legend_text">工作空间新增文件</div>
<div class="legend_text">工作空间新增文件({{ localOnlyFiles.length }})</div>
</div>
<div class="legend_box">
<div class="legend_color2"></div>
<div class="legend_text">工作空间已删除文件</div>
<div class="legend_text">工作空间已删除文件({{ minioOnlyFiles.length }})</div>
</div>
<div class="legend_box">
<div class="legend_color3"></div>
<div class="legend_text">工作空间内容变动文件</div>
<div class="legend_text">工作空间内容变动文件({{ md5MismatchedFiles.length }})</div>
</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>
@ -1140,7 +1156,7 @@ const tabs = ref(1)
:class="data.station == '0' ? 'custom-tree-node' : (data.station == '1' ? 'custom-tree-node1' : (data.station == '2' ? 'custom-tree-node2' : 'custom-tree-node3'))">
<span class="text">
{{ data.fileName }}({{ data.isFile == 'FOLDER' ? data.children.length :
data.fileSize + 'KB' }})
formatFileSize(Number(data.fileSize)) }})
<!-- <span v-if="data.station != '0'">({{ data.station == '1' ? '新增' :
(data.station
== '2' ? '已变更' : '已删除') }})</span> -->
@ -1175,7 +1191,7 @@ const tabs = ref(1)
<!-- data.children.length -->
<span class="text">{{ data.fileName }}({{ data.isFile == 'FOLDER' ?
data.children.length :
data.fileSize + 'KB' }})</span>
formatFileSize(Number(data.fileSize)) }})</span>
<!-- <span v-if="data.station != '0'">({{ data.station == '1' ? '新增' :
(data.station
== '2' ? '已变更' : '已删除') }})</span> -->
@ -1211,7 +1227,7 @@ const tabs = ref(1)
@click="moretableBeifen()">备份</el-button>
</div>
<el-table v-loading="loading1" :data="localOnlyFiles" @selection-change="bifenChange"
:header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838',height: '50px' }"
:header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838', height: '50px' }"
style="width: 100%; height: calc(60vh);margin-bottom: 20px;" border>
<el-table-column type="selection" width="40" />
@ -1629,7 +1645,7 @@ const tabs = ref(1)
//
.legend {
width: 40%;
width: 45%;
display: flex;
align-items: center;
justify-content: space-between;

View File

@ -8,9 +8,24 @@ export default {
import { onMounted, ref } from "vue";
import { ElMessage, ElMessageBox } from 'element-plus'
import Page from '@/components/Pagination/page.vue'
import { tstaskPage, addtsTask, updatetsTask, deleteTsTaskById, deleteTsTaskByIds, confirmDeleteTask,selectTsNodesById } from "@/api/testtask";
import { tstaskPage, addtsTask, updatetsTask, deleteTsTaskById, deleteTsTaskByIds, confirmDeleteTask, selectTsNodesById } from "@/api/testtask";
import { storagesBytype } from "@/api/storage";
import { getDict } from '@/api/dict'
///////
let result2 = ref([])
let result1 = ref([
{ name: '任务编号', code: 'task_code' },
{ name: '任务名称', code: 'task_name' },
{ name: '任务地点', code: 'task_place' },
{ name: '任务人员', code: 'task_person' },
{ name: '载体名称', code: 'carrier_name' },
{ name: '设备编号', code: 'device_code' },
{ name: '任务类型', code: 'task_type' },
{ name: '试验描述', code: 'test_describe' },
{ name: '传感器描述', code: 'sensor_describe' },
{ name: '本地存储空间', code: 'local_storage_id' },
{ name: '备份存储空间', code: 'backup_storage_id' },
])
//
const tableData: any = ref([]);
//
@ -18,11 +33,8 @@ const dataduan = ref([])
const queryParams: any = ref({
current: 1,
size: 20,
taskName: '',
taskPlace: '',
taskPerson: '',
carrierType: '',
deviceCode: '',
keyword: '',
fieldName: '',
startDate: '',
endDate: ''
});
@ -42,6 +54,7 @@ function zhuandata(dateString: any) {
const loading = ref(false)
//
function getdata() {
loading.value = true
if (dataduan.value && dataduan.value.length > 0) {
const dataArr = []
@ -56,24 +69,27 @@ function getdata() {
}
formitemarr.value.length = 0
loading.value = true
if (result2.value.length > 0) {
// attributeContent
queryParams.value.attributeContentJson = [];
console.log(result2.value)
if (checkList1.value.length > 0) {
queryParams.value.fieldName = checkList1.value.join(',')
} else if (checkList2.value.length == 0 && queryParams.value.keyword) {
let result1Name = []
result1.value.forEach((item: any) => {
result1Name.push(item.code)
})
queryParams.value.fieldName = result1Name.join(',')
}
if (checkList2.value.length > 0) {
queryParams.value.attributeContentJson = checkList2.value.join(',')
} else if (checkList2.value.length == 0 && queryParams.value.keyword) {
let result1Name = []
result2.value.forEach((item: any) => {
// 访
queryParams.value.attributeContentJson.push({
[item.code]: queryParams.value[item.code]?queryParams.value[item.code]:''
});
});
console.log( queryParams.value.attributeContentJson)
// debugger
if( queryParams.value.attributeContentJson.length > 0){
queryParams.value.attributeContentJson = encodeURIComponent(JSON.stringify(queryParams.value.attributeContentJson))
}
result1Name.push(item.code)
})
queryParams.value.attributeContentJson = result1Name.join(',')
}
tstaskPage(queryParams.value).then((res: any) => {
visible.value = false
loading.value = false
tableData.value = res.data.records
queryParams.value.current = res.data.current
@ -89,6 +105,7 @@ function getdata() {
}
item.taskProps = arr
result2.value = arr
// result.value = [...new Set([...result1.value, ...result2.value])];
// debugger
if (item.taskProps.length > 0) {
item.taskProps.forEach((items: any) => {
@ -369,8 +386,9 @@ function generateUniqueId(length: any) {
function dellable(index: any) {
formitemarr.value.splice(index, 1)
}
let result2 = ref([])
const checkList1 = ref([])
const checkList2 = ref([])
const visible:any = ref(false)
</script>
<template>
@ -378,34 +396,40 @@ let result2 = ref([])
<div class="record-box">
<div class="sou_title">
<div class="sou_title_left">
<el-input style="margin-right: 10px ;width:80px;margin-bottom: 10px;" v-model="queryParams.taskCode"
clearable @change="getdata()" placeholder="任务编号"></el-input>
<el-input style="margin-right: 10px ;width:180px;margin-bottom: 10px;"
v-model="queryParams.taskName" clearable @change="getdata()" placeholder="任务名称"></el-input>
<el-select style="margin-right: 10px ;width:180px;margin-bottom: 10px;"
v-model="queryParams.taskType" clearable placeholder="任务类型" @change="getdata()">
<el-option v-for="item in dictType" :key="item.itemcode" :label="item.dictname"
:value="item.itemcode" />
</el-select>
<el-input style="margin-right: 10px ;width:180px;margin-bottom: 10px;"
v-model="queryParams.taskPlace" clearable @change="getdata()" placeholder="任务地点"></el-input>
<el-input style="margin-right: 10px ;width:180px;margin-bottom: 10px;"
v-model="queryParams.taskPerson" clearable @change="getdata()" placeholder="任务人员"></el-input>
<el-date-picker v-model="dataduan" type="daterange" range-separator="" @change="getdata()"
<el-input style="margin-right: 10px ;width:240px;" v-model="queryParams.keyword" clearable
@change="getdata()" placeholder="全属性搜索"></el-input>
<el-button type="primary" @click="getdata()">搜索</el-button>
<el-popover placement="bottom" :width="400" trigger="click" :visible="visible">
<template #reference>
<el-button @click="visible = true" type="primary">高级</el-button>
</template>
<div>
<el-input style="margin-right: 10px;width:240px;" v-model="queryParams.keyword" clearable
placeholder=""></el-input>
<el-button type="primary" @click="getdata()">搜索</el-button>
</div>
<div class="shuxingtitle" v-if="result1.length > 0">
<div class="kuai"></div>
<div class="txt"> 固定属性</div>
</div>
<el-checkbox-group v-model="checkList1">
<el-checkbox v-for="item in result1" :key="item.code" :label="item.name"
:value="item.code" />
</el-checkbox-group>
<div class="shuxingtitle" v-if="result2.length > 0">
<div class="kuai"></div>
<div class="txt"> 自定义属性</div>
</div>
<el-checkbox-group v-model="checkList2">
<el-checkbox v-for="item in result2" :key="item.code" :label="item.name"
:value="item.code" />
</el-checkbox-group>
<el-date-picker v-model="dataduan" type="daterange" range-separator=""
style="margin-right: 10px ;margin-bottom: 10px;" start-placeholder="开始时间"
end-placeholder="结束时间" />
<el-input style="margin-right: 10px ;width:200px;" v-model="queryParams.carrierName" clearable
@change="getdata()" placeholder="载机名称"></el-input>
<el-input style="margin-right: 10px ;width:200px;" v-model="queryParams.deviceCode" clearable
@change="getdata()" placeholder="设备代号_编号"></el-input>
<el-input style="margin-right: 10px ;width:380px;" v-model="queryParams.testDescribe" clearable
@change="getdata()" placeholder="试验描述"></el-input>
<el-input style="margin-right: 10px ;width:380px;" v-model="queryParams.sensorDescribe" clearable
@change="getdata()" placeholder="传感器描述"></el-input>
<el-input v-for="item in result2" style="margin:10px 10px 0px 0px;width:180px;" v-model="queryParams[item.code]"
clearable @change="getdata()" :placeholder="item.name"></el-input>
<el-button v-if="result2.length == 0" type="primary" @click="getdata()">搜索</el-button>
<el-button v-else type="primary" style="margin-top: 10px;" @click="getdata()">搜索</el-button>
</el-popover>
<!-- <el-button v-else type="primary" style="margin-top: 10px;" @click="getdata()">搜索</el-button> -->
</div>
<div>
<el-button type="primary" @click="addproject()">新增</el-button>
@ -414,7 +438,7 @@ let result2 = ref([])
</div>
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange"
:header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838', height: '50px' }"
style="width: 100%; height: calc(64vh);margin-bottom: 20px;" border>
style="width: 100%; height: calc(71vh);margin-bottom: 20px;" border>
<el-table-column type="selection" width="40" />
<el-table-column prop="taskCode" label="任务编号" width="90"></el-table-column>
<el-table-column prop="taskName" label="任务名称" width="600"></el-table-column>
@ -494,15 +518,16 @@ let result2 = ref([])
</el-select>
</el-form-item>
<el-form-item label="任务时间" prop="taskDate" style="width: 50%;margin-left: 15px;">
<el-date-picker :disabled="projectForme.id" v-model="projectForme.taskDate" type="daterange" range-separator="-"
start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD"
<el-date-picker :disabled="projectForme.id" v-model="projectForme.taskDate" type="daterange"
range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" />
</el-form-item>
</div>
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<el-form-item label="任务地点" prop="taskPlace" style="width: 50%;">
<el-input :disabled="projectForme.id" v-model="projectForme.taskPlace" maxlength="500" show-word-limit />
<el-input :disabled="projectForme.id" v-model="projectForme.taskPlace" maxlength="500"
show-word-limit />
</el-form-item>
<el-form-item label="任务人员" style="width: 50%;margin-left: 15px;">
<el-input v-model="projectForme.taskPerson" maxlength="500" show-word-limit />
@ -510,10 +535,12 @@ let result2 = ref([])
</div>
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<el-form-item label="载机名称" style="width: 50%;">
<el-input :disabled="projectForme.id" v-model="projectForme.carrierName" maxlength="40" show-word-limit />
<el-input :disabled="projectForme.id" v-model="projectForme.carrierName" maxlength="40"
show-word-limit />
</el-form-item>
<el-form-item label="设备代号_编号" style="width: 50%;margin-left: 15px;">
<el-input :disabled="projectForme.id" v-model="projectForme.deviceCode" maxlength="40" show-word-limit />
<el-input :disabled="projectForme.id" v-model="projectForme.deviceCode" maxlength="40"
show-word-limit />
</el-form-item>
</div>
<!-- <el-form-item label="载体类型">
@ -648,4 +675,24 @@ let result2 = ref([])
}
}
.shuxingtitle {
font-size: 16px;
font-weight: 600;
color: #409eff;
margin-top: 5px;
box-sizing: border-box;
display: flex;
align-items: center;
.kuai {
width: 3px;
height: 14px;
background: #409eff;
}
.txt {
padding: 0px 0px 0px 5px;
}
}
</style>