|
|
@@ -34,9 +34,9 @@
|
|
|
<script>
|
|
|
import { ref, reactive } from "vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
-import { fetchData,fetchModuleDetail } from "../../api";
|
|
|
+import { fetchData,fetchModuleDetail } from "../api";
|
|
|
import {useRoute} from "vue-router";
|
|
|
-import {use}from "../../api/model"
|
|
|
+import {use}from "../api/model"
|
|
|
|
|
|
export default {
|
|
|
|
|
|
@@ -64,12 +64,34 @@ export default {
|
|
|
modelId:modelId,
|
|
|
fileId:fileId
|
|
|
}
|
|
|
- use(data).then(res=>{
|
|
|
- console.log(res.data);
|
|
|
- tableData.value=res.data
|
|
|
+ ElMessageBox({
|
|
|
+ title: "正在拼命预测!",
|
|
|
+ beforeClose: (action, instance, done) => {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ instance.confirmButtonText = '预测中...'
|
|
|
+ use(data).then(res=>{
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ if (res.status === 200)
|
|
|
+ {
|
|
|
+ ElMessageBox({
|
|
|
+ title: '模型使用',
|
|
|
+ message: `模型预测成功`,
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ console.log(res);
|
|
|
+ ElMessage.error("预测失败!失败码:"+res.status);
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ console.log(res.data);
|
|
|
+ tableData.value=res.data
|
|
|
+ });
|
|
|
+ //console.log("getData被调用了")
|
|
|
+ }
|
|
|
})
|
|
|
- console.log("getData被调用了")
|
|
|
-
|
|
|
};
|
|
|
|
|
|
// 相当于beforeCreated生命周期中调用了getData()函数
|