项目描述缩小,左侧树操作顺序更改,扫描完成增加提示,增加储存元列,存储空间占比更改,存储内容改名

This commit is contained in:
wangxk 2025-07-05 09:28:58 +08:00
parent 60b22314bf
commit e5d791e520
6 changed files with 95 additions and 32 deletions

View File

@ -62,7 +62,7 @@ function setupWebSocket() {
}; };
ws1.onmessage = (e) => { ws1.onmessage = (e) => {
console.log('websocket接收到消息', e) console.log('websocket接收到消息', e)
tonstatus() tonstatus(true)
} }
ws1.onclose = () => { ws1.onclose = () => {
@ -109,7 +109,7 @@ function getProject() {
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(false)
// gettreedata() // gettreedata()
}) })
@ -135,7 +135,7 @@ function scan() {
} else { } else {
specialScanById({ id: projectId.value }).then((res: any) => { specialScanById({ id: projectId.value }).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
tonstatus() tonstatus(false)
} }
}) })
} }
@ -474,7 +474,7 @@ function submitfile() {
if (localStorage.getItem('filepath') == '/temporary') { if (localStorage.getItem('filepath') == '/temporary') {
documentUploadById({ fileName: JSON.parse(localStorage.getItem('fileArr'))[0].name, id: projectId.value }).then((res: any) => { documentUploadById({ fileName: JSON.parse(localStorage.getItem('fileArr'))[0].name, id: projectId.value }).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
tonstatus() tonstatus(false)
upfile.value = false upfile.value = false
titleon.value = true titleon.value = true
closeDialog() closeDialog()
@ -814,12 +814,13 @@ const fileIcon = (row: any) => {
const tonloading = ref(false) const tonloading = ref(false)
const tonloading1 = ref(false) const tonloading1 = ref(false)
const buttonmsg1 = ref('初始化导入项目完整压缩包') const buttonmsg1 = ref('初始化导入项目完整压缩包')
function tonstatus() { function tonstatus(ready: any) {
//sao //sao
obtainInformationAsync({ id: projectId.value }).then((res: any) => { obtainInformationAsync({ id: projectId.value }).then((res: any) => {
if (res.data.scanstatus == '1') { if (res.data.scanstatus == '1') {
tonloading.value = false tonloading.value = false
buttonmsg.value = '扫描项目完整路径' buttonmsg.value = '扫描项目完整路径'
readyto(ready,'1')
} else if (res.data.scanstatus == '0') { } else if (res.data.scanstatus == '0') {
tonloading.value = true tonloading.value = true
buttonmsg.value = '处理中...' buttonmsg.value = '处理中...'
@ -827,6 +828,7 @@ function tonstatus() {
if (res.data.uploadstatus == '1') { if (res.data.uploadstatus == '1') {
tonloading1.value = false tonloading1.value = false
buttonmsg1.value = '初始化导入项目完整压缩包' buttonmsg1.value = '初始化导入项目完整压缩包'
readyto(ready,'2')
} else if (res.data.uploadstatus == '0') { } else if (res.data.uploadstatus == '0') {
tonloading1.value = true tonloading1.value = true
buttonmsg1.value = '处理中...' buttonmsg1.value = '处理中...'
@ -834,7 +836,23 @@ function tonstatus() {
}) })
gettreedata() gettreedata()
} }
function readyto(ready: any, type: any) {
if (ready) {
let msg = type == '1' ? '项目扫描成功' : '项目初始化成功'
ElMessageBox.confirm(
msg,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
})
}
}
</script> </script>
<template> <template>
@ -859,14 +877,15 @@ function tonstatus() {
<span class="custom-tree-node"> <span class="custom-tree-node">
<span class="text">{{ data.nodeName }}</span> <span class="text">{{ data.nodeName }}</span>
<span class="img_tree" v-if="nodename != '根节点'"> <span class="img_tree" v-if="nodename != '根节点'">
<img src="@/assets/project/xiu.png" alt="" title="编辑" @click="editSubItem(data)">
<img src="@/assets/project/del.png" alt="" title="删除" @click="delSubItem(data)">
<img v-if="data.nodeType == '01'" src="@/assets/project/jia.png" alt="" title="添加课题" <img v-if="data.nodeType == '01'" src="@/assets/project/jia.png" alt="" title="添加课题"
@click="addSubItem(data)"> @click="addSubItem(data)">
<img v-if="data.nodeType == '02'" src="@/assets/project/jia.png" alt="" title="添加年度" <img v-if="data.nodeType == '02'" src="@/assets/project/jia.png" alt="" title="添加年度"
@click="addSubItem(data)"> @click="addSubItem(data)">
<img v-if="data.nodeType == '03'" src="@/assets/project/jia.png" alt="" title="添加主题" <img v-if="data.nodeType == '03'" src="@/assets/project/jia.png" alt="" title="添加主题"
@click="addSubItem(data)"> @click="addSubItem(data)">
<img src="@/assets/project/xiu.png" alt="" title="编辑" @click="editSubItem(data)">
<img src="@/assets/project/del.png" alt="" title="删除" @click="delSubItem(data)">
</span> </span>
</span> </span>
</template> </template>
@ -1121,7 +1140,7 @@ function tonstatus() {
.img_tree { .img_tree {
display: flex; display: flex;
width: 20%; width: 25%;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

View File

@ -407,7 +407,7 @@ let result2 = ref([])
</div> </div>
<el-form-item label=" 项目描述"> <el-form-item label=" 项目描述">
<el-input v-model="projectForme.description" :rows="25" type="textarea" show-word-limit /> <el-input v-model="projectForme.description" :rows="18" type="textarea" show-word-limit />
</el-form-item> </el-form-item>
<el-form-item v-for="(item, index) in formitemarr" :label="item.name"> <el-form-item v-for="(item, index) in formitemarr" :label="item.name">
<div style="width: 100%;display: flex;align-items: center;justify-content: space-between;"> <div style="width: 100%;display: flex;align-items: center;justify-content: space-between;">

View File

@ -236,16 +236,19 @@ function handleClose1() {
function comparePercentage(percentStr: any) { function comparePercentage(percentStr: any) {
// //
if (!percentStr.spaceOccupancyRatio) { if (!percentStr.spaceOccupancyRatio) {
percentStr.resar = false percentStr.resar = ''
return percentStr.spaceOccupancyRatio; return percentStr.spaceOccupancyRatio;
} }
const arr = percentStr.spaceOccupancyRatio.split(";").map(item => parseFloat(item.replace("%", ""))); const arr = percentStr.spaceOccupancyRatio.split(";").map(item => parseFloat(item.replace("%", "")));
if(arr.length > 0){ if(arr.length > 0){
arr.forEach(item => { arr.forEach(item => {
if (item > 80 || item == 80) { if ((item < 20 && item > 10)|| item == 20) {
percentStr.resar = true percentStr.resar = '#c5c528'
} }
}); if (item < 10|| item == 10) {
percentStr.resar = 'red'
}
});
} }
// const percent = parseFloat(percentStr.spaceOccupancyRatio.replace('%', '')); // const percent = parseFloat(percentStr.spaceOccupancyRatio.replace('%', ''));
@ -284,26 +287,32 @@ function comparePercentage(percentStr: any) {
<!-- <el-table-column type="index" label="序号" width="70" align="center"></el-table-column> --> <!-- <el-table-column type="index" label="序号" width="70" align="center"></el-table-column> -->
<el-table-column prop="name" label="存储空间名称" width="200"> <el-table-column prop="name" label="存储空间名称" width="200">
<template #default="scope"> <template #default="scope">
<span :style="{ color: scope.row.resar ? 'red' : '', 'font-size': scope.row.resar ? '16px' : '' }">{{ <span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
scope.row.name }}</span> scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="key" label="存储源别名" width="100">
<template #default="scope">
<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"> <el-table-column prop="type" label="存储策略" width="100">
<template #default="scope"> <template #default="scope">
<span :style="{ color: scope.row.resar ? 'red' : '', 'font-size': scope.row.resar ? '16px' : '' }">{{ <span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
typeName(dictType, scope.row.type) }}</span> typeName(dictType, scope.row.type) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="valueData" label="存储路径" width="200"> <el-table-column prop="valueData" label="存储路径" width="200">
<template #default="scope"> <template #default="scope">
<span :style="{ color: scope.row.resar ? 'red' : '', 'font-size': scope.row.resar ? '16px' : '' }">{{ <span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
scope.row.valueData }}</span> scope.row.valueData }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="storeContent" label="存储内容"> <el-table-column prop="storeContent" label="存放项目/任务">
<template #default="scope"> <template #default="scope">
<div class="ellipsis"> <div class="ellipsis">
<span :style="{ color: scope.row.resar ? 'red' : '', '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> class="single-line-ellipsis">{{ scope.row.storeContent }}</span>
<img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)" <img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
@ -312,7 +321,7 @@ function comparePercentage(percentStr: any) {
</el-table-column> </el-table-column>
<el-table-column prop="spaceOccupancyRatio" label="存储空间占用比例" width="140"> <el-table-column prop="spaceOccupancyRatio" label="存储空间占用比例" width="140">
<template #default="scope"> <template #default="scope">
<span :style="{ color: scope.row.resar ? 'red' : '', 'font-size': scope.row.resar ? '16px' : '' }">{{ <span :style="{ color: scope.row.resar, 'font-size': scope.row.resar !='' ? '16px' : '' }">{{
comparePercentage(scope.row) }}</span> comparePercentage(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -86,7 +86,7 @@ function setupWebSocket() {
}; };
ws1.onmessage = (e) => { ws1.onmessage = (e) => {
console.log('websocket接收到消息', e) console.log('websocket接收到消息', e)
tonstatus() tonstatus(true)
} }
ws1.onclose = () => { ws1.onclose = () => {
@ -116,25 +116,26 @@ function getProject() {
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value) ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
setupWebSocket() setupWebSocket()
gettreedata() gettreedata()
tonstatus() tonstatus(false)
}) })
} }
// //
function scan() { function scan() {
testDataScanById({ id: projectId.value }).then((res: any) => { testDataScanById({ id: projectId.value }).then((res: any) => {
tonstatus() tonstatus(false)
}) })
} }
const tonloading = ref(false) const tonloading = ref(false)
const buttonmsg = ref('扫描试验数据') const buttonmsg = ref('扫描试验数据')
function tonstatus() { function tonstatus(ready: any) {
//sao //sao
obtaintestData({ id: projectId.value }).then((res: any) => { obtaintestData({ id: 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 = '扫描试验数据'
readyto(ready)
} else { } else {
tonloading.value = true tonloading.value = true
buttonmsg.value = '处理中...' buttonmsg.value = '处理中...'
@ -143,6 +144,22 @@ function tonstatus() {
}) })
} }
function readyto(ready: any) {
if (ready) {
ElMessageBox.confirm(
'项目扫描成功',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
})
}
}
// //
const treedata = ref([]) const treedata = ref([])
const treeloading = ref(false) const treeloading = ref(false)
@ -1668,10 +1685,11 @@ function repstring(row: any) {
<span class="custom-tree-node"> <span class="custom-tree-node">
<span class="text">{{ data.nodeName }}</span> <span class="text">{{ data.nodeName }}</span>
<span class="img_tree" v-if="nodename != '根节点'"> <span class="img_tree" v-if="nodename != '根节点'">
<img src="@/assets/project/jia.png" alt="" title="添加子项目" @click="addSubItem(data)">
<img src="@/assets/project/xiu.png" alt="" title="编辑" @click="editSubItem(data)"> <img src="@/assets/project/xiu.png" alt="" title="编辑" @click="editSubItem(data)">
<img src="@/assets/project/del.png" alt="" title="删除" @click="delSubItem(data)"> <img src="@/assets/project/del.png" alt="" title="删除" @click="delSubItem(data)">
<!-- <img src="@/assets/images/chayi.png" alt="" title="差异性对比" @click="opendifference(data)"> --> <!-- <img src="@/assets/images/chayi.png" alt="" title="差异性对比" @click="opendifference(data)"> -->
<img src="@/assets/project/jia.png" alt="" title="添加子项目" @click="addSubItem(data)">
</span> </span>
</span> </span>
</template> </template>
@ -2186,7 +2204,7 @@ function repstring(row: any) {
.img_tree { .img_tree {
display: flex; display: flex;
width: 20%; width: 25%;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

View File

@ -38,7 +38,7 @@ function setupWebSocket() {
}; };
ws1.onmessage = (e) => { ws1.onmessage = (e) => {
console.log('websocket接收到消息', e) console.log('websocket接收到消息', e)
tonstatus() tonstatus(true)
} }
ws1.onclose = () => { ws1.onclose = () => {
@ -108,12 +108,13 @@ function gettreeTwo() {
/// ///
const tonloading = ref(false) const tonloading = ref(false)
const buttonmsg = ref('文件备份') const buttonmsg = ref('文件备份')
function tonstatus() { function tonstatus(ready: any) {
//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 = '文件备份'
readyto(ready)
} else { } else {
tonloading.value = true tonloading.value = true
buttonmsg.value = '处理中...' buttonmsg.value = '处理中...'
@ -122,6 +123,22 @@ function tonstatus() {
getminiotree() getminiotree()
}) })
} }
function readyto(ready: any) {
if (ready) {
ElMessageBox.confirm(
'项目扫描成功',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
})
}
}
//// ////
function backups() { function backups() {
ElMessageBox.confirm( ElMessageBox.confirm(
@ -155,14 +172,14 @@ function backups() {
automaticFileBackupByIds(params).then((res: any) => { automaticFileBackupByIds(params).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
comparearr.value.length = 0 comparearr.value.length = 0
tonstatus() tonstatus(false)
} }
}) })
} else { } else {
automaticFileBackup(params).then((res: any) => { automaticFileBackup(params).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
comparearr.value.length = 0 comparearr.value.length = 0
tonstatus() tonstatus(false)
} }
}) })
} }
@ -396,7 +413,7 @@ function handleNodeClick(data: any, node: any) {
setupWebSocket() setupWebSocket()
getlocaltree() getlocaltree()
getminiotree() getminiotree()
tonstatus() tonstatus(false)
} }
// //
const handleCheckChange = ( const handleCheckChange = (

View File

@ -521,10 +521,10 @@ let result2 = ref([])
</el-form-item> --> </el-form-item> -->
<el-form-item label="试验描述"> <el-form-item label="试验描述">
<el-input v-model="projectForme.testDescribe" :rows="12" type="textarea" show-word-limit /> <el-input v-model="projectForme.testDescribe" :rows="7" type="textarea" show-word-limit />
</el-form-item> </el-form-item>
<el-form-item label="传感器描述"> <el-form-item label="传感器描述">
<el-input v-model="projectForme.sensorDescribe" :rows="12" type="textarea" show-word-limit /> <el-input v-model="projectForme.sensorDescribe" :rows="7" type="textarea" show-word-limit />
</el-form-item> </el-form-item>
<!-- <el-form-item label="设备名称"> <!-- <el-form-item label="设备名称">