From c8cea421ce730f3210c678280148ec718a28e32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Mon, 22 Jul 2024 01:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dataSet/index.js | 2 +- src/views/manage/calculate/edit.vue | 16 +- src/views/manage/calculateParam/edit.vue | 6 +- src/views/manage/datas/add.vue | 257 +++++---- src/views/manage/datas/edit.vue | 647 ++++++++++++++--------- src/views/manage/datas/index.vue | 14 +- src/views/manage/otherTool/view.vue | 10 +- 7 files changed, 566 insertions(+), 386 deletions(-) diff --git a/src/api/dataSet/index.js b/src/api/dataSet/index.js index 716e071..423362e 100644 --- a/src/api/dataSet/index.js +++ b/src/api/dataSet/index.js @@ -47,7 +47,7 @@ const downloadFile = (id) => { }) } //删除指定的图像文件 -const deleteFile = (id) => { +const deleteFile = (id,data) => { return request({ url: `/dataset/raw/${id}/files`, method: "delete", diff --git a/src/views/manage/calculate/edit.vue b/src/views/manage/calculate/edit.vue index 4379bd5..e64abf6 100644 --- a/src/views/manage/calculate/edit.vue +++ b/src/views/manage/calculate/edit.vue @@ -86,7 +86,13 @@ 算子文件预览 - + @@ -187,11 +193,9 @@ function handleFileChange(file) { } uploadFile(file).then((res) => { if (isJSON(res)) { - let jsonStr = JSON.stringify(res); - formData.parameters = jsonStr; + formData.parameters = JSON.parse(str); formRef.value.validateField("parameters"); - //let json = JSON.parse(jsonStr); - codeHtml.value = res;//highlightJSON(json); + codeHtml.value = res; fileStatus.value = true; } }); @@ -231,7 +235,7 @@ function uploadFile(file) { // 文件删除 function handleFileRemove() { formData.parameters = ""; - codeHtml.value = "

"; + codeHtml.value = ""; fileStatus.value = false; } diff --git a/src/views/manage/calculateParam/edit.vue b/src/views/manage/calculateParam/edit.vue index 17c3422..4514a12 100644 --- a/src/views/manage/calculateParam/edit.vue +++ b/src/views/manage/calculateParam/edit.vue @@ -259,7 +259,11 @@ function handleChangeOperator() { OperatorApi.findOne(formData.operator_id).then((res) => { //JSON转换 codeJson.value = JSON.stringify(res.data.data.parameters); - fileStatus.value = true; + if(codeJson.value=='{}'){ + fileStatus.value = false; + }else{ + fileStatus.value = true; + } }); } diff --git a/src/views/manage/datas/add.vue b/src/views/manage/datas/add.vue index 7c42534..13b2fe9 100644 --- a/src/views/manage/datas/add.vue +++ b/src/views/manage/datas/add.vue @@ -67,21 +67,30 @@ - + - + - + - + - @@ -97,91 +106,61 @@ - - - - - - - - + + + + + 选择文件 + + + + + +
+ + 数据集参数文件预览 + + +
+
+
- 上传图片 确 定 取 消 - - - - - 选择文件 - - - - - - - - - - -