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

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

View File

@ -407,7 +407,7 @@ let result2 = ref([])
</div>
<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 v-for="(item, index) in formitemarr" :label="item.name">
<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) {
//
if (!percentStr.spaceOccupancyRatio) {
percentStr.resar = false
percentStr.resar = ''
return percentStr.spaceOccupancyRatio;
}
const arr = percentStr.spaceOccupancyRatio.split(";").map(item => parseFloat(item.replace("%", "")));
if(arr.length > 0){
arr.forEach(item => {
if (item > 80 || item == 80) {
percentStr.resar = true
if ((item < 20 && item > 10)|| item == 20) {
percentStr.resar = '#c5c528'
}
});
if (item < 10|| item == 10) {
percentStr.resar = 'red'
}
});
}
// 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 prop="name" label="存储空间名称" width="200">
<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>
</template>
</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">
<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>
</template>
</el-table-column>
<el-table-column prop="valueData" label="存储路径" width="200">
<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>
</template>
</el-table-column>
<el-table-column prop="storeContent" label="存储内容">
<el-table-column prop="storeContent" label="存放项目/任务">
<template #default="scope">
<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>
<img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)"
style="cursor: pointer;">
@ -312,7 +321,7 @@ function comparePercentage(percentStr: any) {
</el-table-column>
<el-table-column prop="spaceOccupancyRatio" label="存储空间占用比例" width="140">
<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>
</template>
</el-table-column>

View File

@ -86,7 +86,7 @@ function setupWebSocket() {
};
ws1.onmessage = (e) => {
console.log('websocket接收到消息', e)
tonstatus()
tonstatus(true)
}
ws1.onclose = () => {
@ -116,25 +116,26 @@ function getProject() {
ws1 = new WebSocket(userStore.WebSocketUrl + '/websocket/' + 'taskId_' + projectId.value)
setupWebSocket()
gettreedata()
tonstatus()
tonstatus(false)
})
}
//
function scan() {
testDataScanById({ id: projectId.value }).then((res: any) => {
tonstatus()
tonstatus(false)
})
}
const tonloading = ref(false)
const buttonmsg = ref('扫描试验数据')
function tonstatus() {
function tonstatus(ready: any) {
//sao
obtaintestData({ id: projectId.value }).then((res: any) => {
if (res.data.status == '1') {
tonloading.value = false
buttonmsg.value = '扫描试验数据'
readyto(ready)
} else {
tonloading.value = true
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 treeloading = ref(false)
@ -1668,10 +1685,11 @@ function repstring(row: any) {
<span class="custom-tree-node">
<span class="text">{{ data.nodeName }}</span>
<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/del.png" alt="" title="删除" @click="delSubItem(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>
</template>
@ -2186,7 +2204,7 @@ function repstring(row: any) {
.img_tree {
display: flex;
width: 20%;
width: 25%;
align-items: center;
justify-content: space-between;

View File

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

View File

@ -521,10 +521,10 @@ let result2 = ref([])
</el-form-item> -->
<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 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 label="设备名称">