|
@@ -32,7 +32,8 @@
|
|
|
:accept="'.csv, .xlsx, .xls'"
|
|
|
:auto-upload="false"
|
|
|
limit="1"
|
|
|
- @click.prevent
|
|
|
+ :disabled="true"
|
|
|
+ :before-upload="() => false"
|
|
|
>
|
|
|
<div class="iconText" @click="validateAndHandleChange">
|
|
|
<app-icon icon="UploadFilled" size="50px" />
|
|
@@ -74,6 +75,7 @@
|
|
|
<!-- <el-button @click="validateAndHandleChange" type="primary"
|
|
|
>导入定位数据</el-button
|
|
|
> -->
|
|
|
+ <el-button type="primary" @click="submitPy">数据测量分析</el-button>
|
|
|
</div>
|
|
|
<div class="stepTwo" v-if="stepsActive === 1">
|
|
|
<el-empty
|
|
@@ -316,11 +318,13 @@ import InitCharts from "./components/initCharts.vue";
|
|
|
import CylinderOfTower from "./components/CylinderOfTower.vue";
|
|
|
import PlotOfFit from "./components/PlotOfFit.vue";
|
|
|
import axios from "axios";
|
|
|
+import path from "path";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
stepsActive: 0,
|
|
|
+ pathFileName: "",
|
|
|
chartKey: 0, // 用于强制重新渲染子组件
|
|
|
activeNames: ["1"],
|
|
|
tabActiveName: "init",
|
|
@@ -366,7 +370,7 @@ export default {
|
|
|
const absolutePath = await window.electronAPI.getFilePath(); // ✅ 修正:不传 file
|
|
|
if (absolutePath) {
|
|
|
console.log("文件绝对路径:", absolutePath);
|
|
|
- this.fetchA1(absolutePath);
|
|
|
+ this.pathFileName = absolutePath;
|
|
|
// this.fetchA2(absolutePath);
|
|
|
} else {
|
|
|
console.log("未选择文件或路径获取失败");
|
|
@@ -374,11 +378,29 @@ export default {
|
|
|
} catch (error) {
|
|
|
console.error("获取文件路径失败:", error);
|
|
|
}
|
|
|
+ // ✅ 手动触发 input[type="file"]
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const inputEl =
|
|
|
+ this.$refs.uploadRef.$el.querySelector("input[type='file']");
|
|
|
+ // if (inputEl) {
|
|
|
+ // inputEl.click();
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitPy() {
|
|
|
+ if (this.pathFileName !== "") {
|
|
|
+ this.fetchA1(this.pathFileName);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请先选择文件",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
async fetchA1(path) {
|
|
|
try {
|
|
|
- const result = await window.electronAPI.callPythonAPI("a1",path);
|
|
|
+ const result = await window.electronAPI.callPythonAPI("a1", path);
|
|
|
console.log("A1 API 响应:", result);
|
|
|
} catch (error) {
|
|
|
console.error("A1 API 失败:", error);
|