diff --git a/src/views/manage/calculate/edit.vue b/src/views/manage/calculate/edit.vue index bbb1600..47f423b 100644 --- a/src/views/manage/calculate/edit.vue +++ b/src/views/manage/calculate/edit.vue @@ -163,7 +163,7 @@ const handleSubmit = useThrottleFn(() => { /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/operatorLibrary/calculate" }); + router.push({ path: "/operatorLibrary/calculate" }); } /** 算子主类型改变 */ diff --git a/src/views/manage/calculate/view.vue b/src/views/manage/calculate/view.vue index 79e8b7b..4e618a1 100644 --- a/src/views/manage/calculate/view.vue +++ b/src/views/manage/calculate/view.vue @@ -70,7 +70,7 @@ const dataInfo = ref({}); /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/operatorLibrary/calculate" }); + router.push({ path: "/operatorLibrary/calculate" }); } /** 初始化数据 */ diff --git a/src/views/manage/calculateParam/edit.vue b/src/views/manage/calculateParam/edit.vue index abad109..84dbc34 100644 --- a/src/views/manage/calculateParam/edit.vue +++ b/src/views/manage/calculateParam/edit.vue @@ -213,7 +213,7 @@ furouter.pushileExceed() { /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/operatorLibrary/calculateParam" }); + router.push({ path: "/operatorLibrary/calculateParam" }); } /** 搜索算子 */ diff --git a/src/views/manage/calculateParam/view.vue b/src/views/manage/calculateParam/view.vue index 0abc179..832cabf 100644 --- a/src/views/manage/calculateParam/view.vue +++ b/src/views/manage/calculateParam/view.vue @@ -87,7 +87,7 @@ const formData = reactive({ /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/operatorLibrary/calculateParam" }); + router.push({ path: "/operatorLibrary/calculateParam" }); } /** 初始化数据 */ diff --git a/src/views/manage/otherTool/add.vue b/src/views/manage/otherTool/add.vue index 99e78f7..3d29483 100644 --- a/src/views/manage/otherTool/add.vue +++ b/src/views/manage/otherTool/add.vue @@ -94,10 +94,12 @@ const router = useRouter(); const formRef = ref(ElForm); // 表单 const loading = ref(false); // 加载状态 -// 用户表单数据 +// 表单数据 const formData = reactive({ unregisted: null, }); +// 上传组件 +const uploadRef = ref(); const userStore = useUserStore(); // 基础数据列表 @@ -163,7 +165,7 @@ function getCurrentRow(row: { [key: string]: any }) { /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/tester/otherTool" }); + router.push({ path: "/tester/otherTool" }); } // 初始化选项列表 diff --git a/src/views/manage/otherTool/index.vue b/src/views/manage/otherTool/index.vue index ec0e755..540685a 100644 --- a/src/views/manage/otherTool/index.vue +++ b/src/views/manage/otherTool/index.vue @@ -152,17 +152,15 @@ function handleDelete(row: { [key: string]: any }) { /** 查看第三方工具链 */ function handleDetail(row: { [key: string]: any }) { - localStorage.setItem('toolChainsKey-'+row.tool_id, JSON.stringify(row)); - router.replace({ path: "/tester/otherToolDetail", query: { id: row.tool_id } }); + router.push({ path: "/tester/otherToolDetail", query: { id: row.tool_id } }); } /** 新增第三方工具链 */ function handleAdd() { - router.replace({ path: "/tester/otherToolEdit" }); + router.push({ path: "/tester/otherToolEdit" }); } onMounted(() => { handleQuery(); }); - -router.pushrouter.push \ No newline at end of file + \ No newline at end of file diff --git a/src/views/manage/otherTool/view.vue b/src/views/manage/otherTool/view.vue index 892c40e..e9bdff6 100644 --- a/src/views/manage/otherTool/view.vue +++ b/src/views/manage/otherTool/view.vue @@ -17,15 +17,15 @@ - - + + - - + + @@ -133,7 +133,6 @@ - router.pushm-item> @@ -214,6 +213,28 @@ const rules = reactive({ params_content: [{ required: true, message: "运行参数文件不能为空", trigger: "blur" }], }); +// 基础数据列表 +let listOpt = reactive({ + typeList: [ + { + type: "quantizer", + name: "量化工具", + }, + { + type: "compiler", + name: "编译工具", + }, + { + type: "label", + name: "标注工具", + }, + { + type: "other", + name: "其他工具", + }, + ], +}); + /** 表单提交 */ const handleSubmitFile = useThrottleFn(() => { formRef.value.validate((valid: any) => { @@ -257,6 +278,7 @@ function handleFileChange(file) { if (isJSON(res)) { let jsonStr = JSON.stringify(res); form.params_content = jsonStr; + form.params_content_v2 = res; formRef.value.validateField("params_content"); fileStatus.value = true; } @@ -277,6 +299,7 @@ function isJSON(str) { uploadRef.value.clearFiles(); fileStatus.value = false; form.params_content = ""; + form.params_content_v2 = "{}"; return false; } } @@ -297,6 +320,7 @@ function uploadFile(file) { // 文件删除 function handleFileRemove() { form.params_content = ""; + form.params_content_v2 = "{}"; fileStatus.value = false; } @@ -309,22 +333,25 @@ function handleFileExceed() { /** 返回默认页面 */ function closeBack() { - router.replace({ path: "/tester/otherTool" }); + router.push({ path: "/tester/otherTool" }); } /** 初始化数据 */ function initData(){ let id=route.query.id; - var row = localStorage.getItem('toolChainsKey-'+id); - if(!row){ - ElMessage.error("未找到相关数据,请从列表页进入详情"); - closeBack(); - } - baseForm = row; + loading.value = true; + OperatorApi.toolChains(id) + .then((res) => { + //JSON转换 + baseForm = res.data.data; + }) + .finally(() => { + loading.value = false; + }); } onMounted(() => { - //initData(); + initData(); });