Compare commits

...

4 Commits

Author SHA1 Message Date
吴舒先 4e52f5ec4a 和远程合并 2024-07-12 16:21:08 +08:00
吴舒先 670fd66c8a 添加删除表的操作 2024-07-12 16:08:03 +08:00
吴舒先 70840d44fe 添加删除表的操作 2024-07-10 01:38:02 +08:00
leap df97f5bb02 temporary cache @ 2024年7月9日 2024-07-09 23:34:00 +08:00
1 changed files with 74 additions and 23 deletions

View File

@ -183,9 +183,45 @@ export default {
this.$handleNetError(error); //
})
}
if (row.type == 0){ //
this.$axios.post('http:localhosat:8000/deleteTable/',{table_id:row.table_id}).then(response=>{
if(response.data.message == '删除成功'){
//
this.$message({
type: 'success',
message: '删除成功,即将刷新界面'
});
location.reload(); //
}
})
.catch(error=>{
this.$handleNetError(error);
})
}else if(row.type == 1){ // 线
this.$axios.post('http:localhosat:8000/deleteSelected/',{table_id:row.table_id, clue_id:row.clue_id}).then(response=>{
if(response.data.message == '删除成功'){
//
this.$message({
type: 'success',
message: '删除成功,即将刷新界面'
});
location.reload(); //
}else{
this.$message({
type: 'error',
message: '删除失败'
});
}
})
.catch(error=>{
this.$handleNetError(error); //
})
}
},
// 线
deleteSelected(){
async deleteSelected(){
//
if(this.deleteClues.length == 0){
this.$message({
@ -200,12 +236,18 @@ export default {
type: row.type,
table_id: row?.table_id, //
clue_id: row?.clue_id ?? null, // clue_idnull
type: row.type,
table_id: row?.table_id, //
clue_id: row?.clue_id ?? null, // clue_idnull
}));
//
for(let i = 0; i < deleteItems.length; i++){
if(deleteItems[i].type == 0){ //
this.axios.post('http://localhost:8000/deleteTable',{table_id: deleteItems[i].table_id}).then(response=>{
let flag = true;
try{
//
for(let i = 0; i < deleteItems.length; i++){
if(deleteItems[i].type == 0){ //
let response = await this.$axios.post('http://localhost:8000/deleteTable',{table_id: deleteItems[i].table_id})
if(response.data.message == '删除成功'){
//
this.$message({
@ -217,14 +259,10 @@ export default {
type: 'error',
message: '删除失败'
});
return;
}
})
.catch(error=>{
this.$handleNetError(error);
})
}else if(deleteItems[i].type == 1){ // 线
this.$axios.post('http://localhost:8000/deleteSelected/',
{table_id:deleteItems[i].table_id, clue_id:deleteItems[i].clue_id}).then(response=>{
}else if(deleteItems[i].type == 1){ // 线
let response = await this.$axios.post('http://localhost:8000/deleteSelected/',{table_id:deleteItems[i].table_id, clue_id:deleteItems[i].clue_id})
if(response.data.message == '删除成功'){
//
this.$message({
@ -236,20 +274,24 @@ export default {
type: 'error',
message: '删除失败'
});
return;
}
})
.catch(error=>{
this.$handleNetError(error); //
return;
})
}
}
}catch (error){
flag = false;
this.$handleNetError(error);
}
this.$message({
type: 'success',
message: '删除成功,即将刷新界面'
});
//
location.reload();
if(flag){
this.$message({
type: 'success',
message: '删除成功,即将刷新界面'
});
//
location.reload();
}
},
refreshData(){
location.reload();
@ -295,4 +337,13 @@ export default {
background-color: white;
align-items: center;
}
.withdrawHeader{
height:6%;
padding :0;
width: 100%;
display:flex;
justify-content: space-between;
background-color: white;
align-items: center;
}
</style>