From 8363862c8d4847346cfb105bb1daccdc88527fe9 Mon Sep 17 00:00:00 2001 From: wangxk Date: Fri, 20 Jun 2025 18:05:23 +0800 Subject: [PATCH] =?UTF-8?q?2025-6-19=E4=BC=9A=E8=AE=AE=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/project/index.ts | 8 ++ web/src/api/testtask/index.ts | 8 ++ web/src/views/special/project/index.vue | 129 ++++++++++-------- web/src/views/system/storage/index.vue | 81 ++++++++--- .../views/testdata/datamanagement/index.vue | 52 ++++--- .../testdata/fileSynchronization/index.vue | 4 +- web/src/views/testdata/testtask/index.vue | 124 ++++++++++------- 7 files changed, 252 insertions(+), 154 deletions(-) diff --git a/web/src/api/project/index.ts b/web/src/api/project/index.ts index 43fcd12..fca2296 100644 --- a/web/src/api/project/index.ts +++ b/web/src/api/project/index.ts @@ -39,4 +39,12 @@ export function addSdproject(queryParams:any) { method: 'post', params: queryParams }); + } + //检查项目下有无节点 + export function selectNodesById(queryParams:any) { + return request({ + url: '/specialDocument/sd_nodes/selectNodesById', + method: 'post', + params: queryParams + }); } \ No newline at end of file diff --git a/web/src/api/testtask/index.ts b/web/src/api/testtask/index.ts index f834dc4..5f42a39 100644 --- a/web/src/api/testtask/index.ts +++ b/web/src/api/testtask/index.ts @@ -47,4 +47,12 @@ export function confirmDeleteTask(queryParams: any) { method: 'post', params: queryParams }); +} +//试验任务是否可修改 +export function selectTsNodesById(queryParams: any) { + return request({ + url: '/experimentalData/ts-nodes/selectTsNodesById', + method: 'post', + params: queryParams + }); } \ No newline at end of file diff --git a/web/src/views/special/project/index.vue b/web/src/views/special/project/index.vue index e8fa908..2d3a297 100644 --- a/web/src/views/special/project/index.vue +++ b/web/src/views/special/project/index.vue @@ -8,26 +8,42 @@ export default { import { onMounted, ref } from "vue"; import { ElMessage, ElMessageBox } from 'element-plus' import Page from '@/components/Pagination/page.vue' -import { projectPage, addSdproject, updateSdproject, deleteSdprojectById, deleteSdprojectByIds } from "@/api/project"; +import { projectPage, addSdproject, updateSdproject, deleteSdprojectById, deleteSdprojectByIds, selectNodesById } from "@/api/project"; import { storagesBytype } from "@/api/storage"; import { getDict } from '@/api/dict' import { id } from "element-plus/es/locale"; +import { debug } from "console"; //定义表格数据 -const tableData: any = ref([{}, {}]); +const tableData: any = ref([]); // 查询数据 const queryParams: any = ref({ current: 1, size: 20, projectType: '', projectName: '', - description: '' + description: '', + attributeContentJson:'', }); const total = ref(0); // 表格加载 const loading = ref(false) //获取表格数据 function getdata() { + formitemarr.value.length = 0 loading.value = true + if (result2.value.length > 0) { + // 初始化attributeContent数组 + queryParams.value.attributeContentJson = []; + result2.value.forEach((item: any) => { + // 修复动态属性名语法和属性访问方式 + queryParams.value.attributeContentJson.push({ + [item.code]: queryParams.value[item.code]?queryParams.value[item.code]:'' + }); + }); + if( queryParams.value.attributeContentJson.length > 0){ + queryParams.value.attributeContentJson = encodeURIComponent(JSON.stringify(queryParams.value.attributeContentJson)) + } + } projectPage(queryParams.value).then((res: any) => { loading.value = false tableData.value = res.data.records @@ -35,6 +51,7 @@ function getdata() { queryParams.value.size = res.data.size total.value = res.data.total let arr = [] + // result2.value.length = 0 tableData.value.forEach((item: any) => { if (item.projectProps) { arr = JSON.parse(item.projectProps) @@ -42,9 +59,23 @@ function getdata() { arr = [] } item.projectProps = arr + result2.value = arr + // debugger + if (item.projectProps.length > 0) { + item.projectProps.forEach((items: any) => { + item[items.code] = items.data + }) + } }); - console.log(tableData.value) + if (tableData.value[0].projectProps && tableData.value[0].projectProps.length > 0) { + tableData.value[0].projectProps.forEach((item: any) => { + formitemarr.value.push({ name: item.name, data: '', code: item.code }) + }) + + } }) + + } //获取字典项目类型 const dictType = ref([]) @@ -53,7 +84,7 @@ function getDictOne() { getDict({ dictcode: 'zxxmlx' }).then((res: any) => { dictType.value = res.data }) - storagesBytype({type:'local'}).then((res: any) => { + storagesBytype({ type: 'local' }).then((res: any) => { storagesarr.value = res.data }) } @@ -72,9 +103,11 @@ function addproject() { projectProps: "",//信息 projectTime: "",//时间 projectType: ""//类型 - , localStorageId: "" + , localStorageId: "", + attributeContentJson:'', } - formitemarr.value.length = 0 + shidou.value = false + // formitemarr.value.length = 0 } //修改项目弹框 function editproject(row: any) { @@ -82,6 +115,13 @@ function editproject(row: any) { frame.value = true projectForme.value = JSON.parse(JSON.stringify(row)) formitemarr.value = projectForme.value.projectProps + selectNodes(row) +} +const shidou = ref(false) +function selectNodes(row: any) { + selectNodesById({ projectId: row.id }).then((res: any) => { + shidou.value = res.data + }) } //删除项目弹框 function delproject(row: any) { @@ -200,7 +240,7 @@ const moderules = ref({ projectType: [{ required: true, message: "请选择项目类型", trigger: "change" }], projectName: [{ required: true, message: "请输入项目名称", trigger: "blur" }], projectTime: [{ type: 'date', required: true, message: "请选择项目启动时间", trigger: "change" }], - localStorageId:[{ required: true, message: "请选择存储空间", trigger: "change" }] + localStorageId: [{ required: true, message: "请选择存储空间", trigger: "change" }] }); onMounted(() => { getdata() @@ -244,7 +284,7 @@ function labledsure() { return } generateUniqueId - formitemarr.value.push({ name: dataname.value, data: '', id: generateUniqueId(8) }) + formitemarr.value.push({ name: dataname.value, data: '', code: generateUniqueId(8) }) labledone.value = false } function generateUniqueId(length: any) { @@ -265,23 +305,7 @@ function generateUniqueId(length: any) { function dellable(index: any) { formitemarr.value.splice(index, 1) } -let result1 =ref([]) -let result2 =ref([]) -const attloading = ref(false) -const attbute = ref(false) -function attribute(input: any) { - result2.value = input - result1.value.length = 0 - let inoutarr = JSON.parse(JSON.stringify(input)) - result1.value = [inoutarr.reduce((acc:any, item:any) => { - acc[item.id] = item.data; - return acc; - }, {})]; - attbute.value = true -} -function attributeclose(){ - attbute.value = false -} +let result2 = ref([]) - + - - - + @@ -384,11 +405,10 @@ function attributeclose(){ format="YYYY-MM-DD HH:mm:ss" style="width:100%;" value-format="YYYY-MM-DD HH:mm:ss" /> - - - - + + + + @@ -425,17 +445,7 @@ function attributeclose(){ - - - - -
- -
-
+ @@ -486,14 +496,15 @@ function attributeclose(){ width: 100%; display: flex; justify-content: space-between; - align-items: center; - margin-bottom: 20px; + // align-items: center; + margin-bottom: 10px; .sou_title_left { - width: 50%; + width: 72%; display: flex; align-items: center; - justify-content: space-between; + // justify-content: space-between; + flex-wrap: wrap; } } diff --git a/web/src/views/system/storage/index.vue b/web/src/views/system/storage/index.vue index e87dd4f..ff96191 100644 --- a/web/src/views/system/storage/index.vue +++ b/web/src/views/system/storage/index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from "vue"; import { ElMessage, ElMessageBox } from 'element-plus' import { getDict } from '@/api/dict' import Page from '@/components/Pagination/page.vue' -import { storage, storagesPage, storage2, storagestorageId,storagesBytype } from "@/api/storage"; +import { storage, storagesPage, storage2, storagestorageId, storagesBytype } from "@/api/storage"; //定义表格数据 const tableData: any = ref([]); // 查询数据 @@ -48,6 +48,7 @@ const title = ref("") const frame = ref(false) //新增项目弹框 function addproject() { + storeContent.value = '' frame.value = true title.value = "新增储存源" projectForme.value = { @@ -63,7 +64,17 @@ function addproject() { } } //修改项目弹框 +const storeContent = ref('') function editproject(row: any) { + if (row.storeContent) { + ElMessage.warning('已有项目绑定该存储空间,请先解除关联!') + return + } + if (row.storeContent) { + storeContent.value = row.storeContent + } else { + storeContent.value = '' + } storage2({ id: row.id }).then((res: any) => { projectForme.value.name = res.data.name projectForme.value.key = res.data.key @@ -93,7 +104,7 @@ function delproject(row: any) { } ) .then(() => { - if(row.storeContent){ + if (row.storeContent) { ElMessage.warning('已有项目绑定该存储空间,请先解除关联!') return } @@ -215,14 +226,27 @@ function typeName(arr: any, itemCode: any) { const logqing = ref(false) const logTxt = ref('') function Loglist(row: any) { - title.value = row.name+'_存储内容' + title.value = row.name + '_存储内容' logqing.value = true logTxt.value = row.storeContent } function handleClose1() { logqing.value = false } +function comparePercentage(percentStr: any) { + // 去除百分号并转换为数字 + if (!percentStr.spaceOccupancyRatio) { + percentStr.resar = false + return percentStr.spaceOccupancyRatio; + } + const percent = parseFloat(percentStr.spaceOccupancyRatio.replace('%', '')); + if (percent > 80 || percent == 80) { + percentStr.resar = true + } + + return percentStr.spaceOccupancyRatio; +}