5-29代码更改

This commit is contained in:
wangxk 2025-05-28 15:18:16 +08:00
parent a2b04b8f04
commit 793313ef6b
4 changed files with 49 additions and 34 deletions

View File

@ -149,15 +149,16 @@ function gettreedata() {
getNodesTree(treeForm.value).then((res: any) => {
treedata.value = res.data
treeloading.value = false
filePath.value = res.data[0].path + res.data[0].nodeName + '/'
if (treedata.value[0]) {
pathid.value = treedata.value[0].id
filePath.value = res.data[0].path + res.data[0].nodeName + '/'
nextTick(() => {
treeRef.value?.setCurrentKey(pathid.value);
});
getdata()
} else {
tableData.value.length = 0
loading.value = false
}
@ -360,8 +361,9 @@ const fileObj: any = ref({
//
const upfile = ref(false)
function openFile() {
titleon.value = false
title.value = "上传文件"
localStorage.setItem('filepath', filePath.value);
localStorage.setItem('filepath', '/filestemporary/');
localStorage.setItem('storageKey', JSON.stringify(['sdlocal']));
upfile.value = true
fileObj.value = {
@ -376,12 +378,15 @@ function openFile() {
judge.value = true
}
//
const titleon = ref(false)
function upfileZip() {
selectNodesByProjectId({ projectId: projectId.value }).then((res: any) => {
if (res.msg == "该项目已经初始化完成,局部更新请选择节点上传文件!") {
ElMessage.warning(res.msg)
return
} else {
titleon.value = true
// ElMessage.warning("")
title.value = "上传项目包并扫描"
localStorage.setItem('filepath', '/temporary');
localStorage.setItem('storageKey', JSON.stringify(['sdlocal']));
@ -458,6 +463,7 @@ function submitfile() {
if (res.code == 0) {
tonstatus()
upfile.value = false
titleon.value = true
}
})
} else {
@ -492,7 +498,7 @@ function submitfile() {
fileObj.value.targetPath = filePath.value
fileObj.value.fileName = fileName.join(',')
fileObj.value.fileSize = fileSize.join(',')
fileObj.value.sourcePath = '/temporary'
fileObj.value.sourcePath = '/filestemporary'
addFiles(fileObj.value).then((res: any) => {
if (res.code == 0) {
closeDialog()
@ -924,6 +930,9 @@ function tonstatus() {
</el-dialog>
<el-dialog :title="title" v-model="upfile" width="50%" :before-close="fileClose" top="30px" draggable
:close-on-click-modal="false" destroy-on-close>
<div v-if="titleon" style="width: 100%;text-align: center;font-size: 18px;margin-bottom: 15px;color: red;" >
请保持压缩包内第一层文件夹名称与项目名称一致
</div>
<el-scrollbar :height="judge ? '400px' : ''">
<el-form ref="ruleFormRef" style="max-width: 100%" :model="fileObj" :rules="moderqqqules"
label-width="auto" class="demo-ruleForm" status-icon>
@ -944,6 +953,7 @@ function tonstatus() {
</el-form-item>
</el-form>
</el-scrollbar>
<div style="width: 100%;display: flex;justify-content: end;">
<el-button type="primary" @click="submitfile">确定</el-button>
<el-button @click="fileClose">取消</el-button>

View File

@ -149,14 +149,18 @@ async function submitForm(formEl: any) {
if (valid) {
if (projectForme.value.id) {
updateSdproject(projectForme.value).then((res: any) => {
getdata()
ElMessage.success("修改成功")
if (res.code == 0) {
getdata()
ElMessage.success("修改成功")
}
frame.value = false
})
} else {
addSdproject(projectForme.value).then((res: any) => {
getdata()
ElMessage.success("添加成功")
if (res.code == 0) {
getdata()
ElMessage.success("添加成功")
}
frame.value = false
})
}
@ -186,14 +190,14 @@ function typeName(arr: any, itemCode: any) {
});
return nameone
}
const logqing= ref(false)
const logqing = ref(false)
const logTxt = ref('')
function Loglist(row:any){
function Loglist(row: any) {
title.value = row.projectName + '_项目描述'
logqing.value = true
logTxt.value = row.description
}
function handleClose1(){
function handleClose1() {
logqing.value = false
}
</script>
@ -240,13 +244,14 @@ function handleClose1(){
<template #default="scope">
<div class="ellipsis">
<span class="single-line-ellipsis">{{ scope.row.description }}</span>
<img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)" style="cursor: pointer;" >
</div>
<img src="@/assets/MenuIcon/xqing.png" alt="" title="详情" @click="Loglist(scope.row)"
style="cursor: pointer;">
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="projectProps" label="项目信息"></el-table-column> -->
<el-table-column fixed="right" label="操作" width="80" align="center">
<template #default="scope">
<span
@ -304,28 +309,30 @@ function handleClose1(){
</el-dialog>
<el-dialog :title="title" v-model="logqing" width="60%" :before-close="handleClose1" top="30px" draggable
:close-on-click-modal="false" destroy-on-close>
<div class="texlog">
<el-scrollbar height="80vh">
{{ logTxt }}
</el-scrollbar>
</div>
<div class="texlog">
<el-scrollbar height="80vh">
{{ logTxt }}
</el-scrollbar>
</div>
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.texlog{
.texlog {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.ellipsis{
.ellipsis {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
}
.single-line-ellipsis {
width: 800px;
/* 限制容器宽度 */

View File

@ -5,7 +5,7 @@ export default {
</script>
<script setup lang="ts">
import { ref, onMounted, nextTick, defineAsyncComponent ,watch,onBeforeUnmount} 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';
@ -179,6 +179,7 @@ function gettreedata() {
getdata()
} else {
tableData.value.length = 0
loading.value = false
}
})
@ -276,7 +277,7 @@ function handleClose(formEl: any) {
//
function delSubItem(row: any) {
ElMessageBox.confirm(
'您确定要删除该项目吗?',
'您确定要删除该节点及其中的文件吗?',
'警告',
{
confirmButtonText: '确定',
@ -333,10 +334,10 @@ function getdata() {
queryParams.value.taskId = projectId.value
queryParams.value.id = creatform.value.parentId
tsFilesPage(queryParams.value).then((res: any) => {
loading.value = false
queryParams.value.current = res.data.current
queryParams.value.size = res.data.size
total.value = res.data.total
loading.value = false
tableData.value = res.data.records
})
}
@ -1288,7 +1289,6 @@ async function submitzip(formEl: any) {
tableIdarr.value.length = 0
filetableRef.value!.clearSelection()
}
})
} else {
@ -1656,7 +1656,7 @@ function repstring(row: any) {
</template>
</el-tree>
<el-button type="primary" @click="scan()" style="width: 100%;" :loading="tonloading">{{ buttonmsg
}}</el-button>
}}</el-button>
</div>
<div class="moveBtn" v-move>
<div class="moveBtn-line"></div>

View File

@ -153,19 +153,15 @@ function backups() {
if (ids.length > 0) {
automaticFileBackupByIds(params).then((res: any) => {
if (res.code == 0) {
// ElMessage.success(res.msg)
comparearr.value.length = 0
tonstatus()
// getlocaltree()
// getminiotree()
}
})
} else {
automaticFileBackup(params).then((res: any) => {
if (res.code == 0) {
// ElMessage.success(res.msg)
comparearr.value.length = 0
tonstatus()
// getlocaltree()
// getminiotree()
}
})
}
@ -189,17 +185,19 @@ function getchayi() {
params.taskId = projectId.value
}
compareLocalList(params).then((res: any) => {
// debugger
localOnlyFiles.value = res.data
gettreeTwo()
comparearr.value.length = 0
})
compareMd5List(params).then((res: any) => {
md5MismatchedFiles.value = res.data
gettreeTwo()
comparearr.value.length = 0
})
compareMinioList(params).then((res: any) => {
minioOnlyFiles.value = res.data
gettreeTwo()
comparearr.value.length = 0
})
}
@ -347,7 +345,7 @@ function diffColor() {
});
}
function diffClose() {
comparearr.value.length = 0
// comparearr.value.length = 0
workall.value.length = 0
differential.value = false
diffFile2()