Commit f1b55bc6a4f6a59fce07d8f4fffc0f09c3a13817
1 parent
f552f352
删除添加loading,提示词颜色
Showing
1 changed file
with
9 additions
and
5 deletions
src/views/standard/test/index.vue
| ... | ... | @@ -122,9 +122,7 @@ |
| 122 | 122 | style="margin-bottom: 20px" |
| 123 | 123 | > |
| 124 | 124 | <template v-for="(item, index) in tabList"> |
| 125 | - <el-radio-button :key="index" :label="index + 1">{{ | |
| 126 | - item | |
| 127 | - }}</el-radio-button> | |
| 125 | + <el-radio-button :label="index + 1">{{ item }}</el-radio-button> | |
| 128 | 126 | </template> |
| 129 | 127 | </el-radio-group> |
| 130 | 128 | <div class="head-box" v-else> |
| ... | ... | @@ -376,6 +374,7 @@ |
| 376 | 374 | circle |
| 377 | 375 | size="mini" |
| 378 | 376 | icon="el-icon-delete" |
| 377 | + :loading="scoped.row.loading" | |
| 379 | 378 | ></el-button> |
| 380 | 379 | </el-popconfirm> |
| 381 | 380 | </template> |
| ... | ... | @@ -861,10 +860,11 @@ export default { |
| 861 | 860 | }, |
| 862 | 861 | //删除即时测考试 |
| 863 | 862 | async removeReport(obj, index) { |
| 863 | + this.tableData[index].loading = true; | |
| 864 | 864 | const { data, status, info } = await this.$request.deleteReport({ |
| 865 | 865 | id: obj.id, |
| 866 | 866 | }); |
| 867 | - if (status == 200) { | |
| 867 | + if (status === 0) { | |
| 868 | 868 | this.$message.success("删除成功!"); |
| 869 | 869 | this.tableData.splice(index, 1); |
| 870 | 870 | } else { |
| ... | ... | @@ -1103,7 +1103,11 @@ export default { |
| 1103 | 1103 | }); |
| 1104 | 1104 | this.loading = false; |
| 1105 | 1105 | if (status === 0) { |
| 1106 | - this.tableData = (data?.list && [...data?.list]) || []; | |
| 1106 | + this.tableData = | |
| 1107 | + data?.list.map((item) => { | |
| 1108 | + item.loading = false; | |
| 1109 | + return item; | |
| 1110 | + }) || []; | |
| 1107 | 1111 | this.total = data?.count || 0; |
| 1108 | 1112 | if (!query.classId) { |
| 1109 | 1113 | //多班级 | ... | ... |