fix:修改测试出的问题

This commit is contained in:
he-zhi-cheng
2025-09-18 17:23:05 +08:00
parent 77ed33e66c
commit c414e66e2b
11 changed files with 794 additions and 312 deletions

View File

@ -13,7 +13,7 @@
</GuiLeftSider>
<template #content>
<a-doption @click="onShowCurvesClick">显示曲线</a-doption>
<!-- <a-doption>Option 2</a-doption> -->
<a-doption @click="openCurveSaveDialogForSelectedFiles">数据导出</a-doption>
<!-- <a-doption>Option 3</a-doption> -->
</template>
</a-dropdown>
@ -36,6 +36,7 @@ import GuiForDataShow from './vuecomponents/GuiForDataShow.vue';
import GuiLeftSider from './vuecomponents/GuiLeftSider.vue';
import SaveFileDialog from './vuecomponents/SaveFileDialog.vue';
import { fs } from '@tauri-apps/api';
import { ElMessage } from 'element-plus';
export default {
name: 'APPDataview',
@ -171,7 +172,7 @@ export default {
await fs.copyFile(file.path, targetPath)
}
this.$message.success(`成功保存 ${files.length} 个文件到 ${location}`)
ElMessage.success(`成功保存 ${files.length} 个文件到 ${location}`)
} catch (error) {
console.error('保存文件失败:', error)
alert('保存文件失败: ' + error.message)
@ -182,13 +183,21 @@ export default {
handleCancelSave() {
this.showSaveDialog = false
this.filesToSave = []
}
},
async openCurveSaveDialogForSelectedFiles() {
const paths = (this.selectedFilePaths && this.selectedFilePaths.length > 0)
? this.selectedFilePaths
: (this.selectedFilePath ? [this.selectedFilePath] : []);
if (!paths.length) {
alert('请先选择一个或多个文件后再导出');
return;
}
this.$refs.GuiForDataShow.openSaveCurveDialogByPaths(paths);
},
},
}
</script>
<style scoped>