|
@@ -173,7 +173,6 @@ export default {
|
|
|
getAllModel({
|
|
getAllModel({
|
|
|
userId: 1
|
|
userId: 1
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
- console.log("res",res);
|
|
|
|
|
tableData.value = res.data;
|
|
tableData.value = res.data;
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -194,23 +193,43 @@ export default {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleTrain =(modelId) => {
|
|
const handleTrain =(modelId) => {
|
|
|
- ElMessageBox.confirm("确定要训练吗?", "提示", {
|
|
|
|
|
- type: "warning",
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- // ElMessage.success("删除成功");
|
|
|
|
|
- //tableData.value.splice(index, 1);
|
|
|
|
|
- //let idx=tableData._rawValue[index].id;
|
|
|
|
|
|
|
+ ElMessageBox( {
|
|
|
|
|
+ title: "确定要训练吗?",
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ confirmButtonText: 'OK',
|
|
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
|
|
+ beforeClose: (action, instance, done) => {
|
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
|
|
+ instance.confirmButtonText = 'Loading...'
|
|
|
let idx=modelId;
|
|
let idx=modelId;
|
|
|
console.log("modelId: "+idx);
|
|
console.log("modelId: "+idx);
|
|
|
train({
|
|
train({
|
|
|
modelId: idx
|
|
modelId: idx
|
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
console.log("train_res: ",res);
|
|
console.log("train_res: ",res);
|
|
|
|
|
+ if (res.status === 200 & res.data === true)
|
|
|
|
|
+ {
|
|
|
|
|
+ ElMessageBox({
|
|
|
|
|
+ title: '模型训练',
|
|
|
|
|
+ message: `模型训练成功`,
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ })
|
|
|
|
|
+ done()
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ ElMessage.error("训练失败!失败码:"+res.status);
|
|
|
|
|
+ done()
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {});
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ done()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 删除操作(单个)
|
|
// 删除操作(单个)
|