refactor(接口测试): 任务中心和报告列表状态统一
--bug=1013989 --user=赵勇 [通用设置]任务中心-状态列表中应按照报告结果情况列出所有状态并保持中英文一致 https://www.tapd.cn/55049933/s/1180637
This commit is contained in:
parent
b06ca671eb
commit
0028f296f4
|
@ -36,9 +36,9 @@
|
||||||
return status.toLowerCase();
|
return status.toLowerCase();
|
||||||
},
|
},
|
||||||
showStatus(status) {
|
showStatus(status) {
|
||||||
return status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1);
|
return status === "unexecute"? "NotExecute":
|
||||||
|
status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -111,34 +111,8 @@
|
||||||
<el-progress :percentage="getPercentage(item.executionStatus)" :format="format"/>
|
<el-progress :percentage="getPercentage(item.executionStatus)" :format="format"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<span v-if="item.executionStatus && item.executionStatus.toLowerCase() === 'error'"
|
<span :class="showClass(item.executionStatus.toLowerCase())">
|
||||||
class="ms-task-error">
|
{{ showStatus(item.executionStatus.toLowerCase()) }}
|
||||||
Error
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'success'"
|
|
||||||
class="ms-task-success">
|
|
||||||
Success
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'stop'"
|
|
||||||
class="ms-task-stopped">
|
|
||||||
Stopped
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'unexecute'"
|
|
||||||
class="ms-task-stopped">
|
|
||||||
Unexecuted
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'errorreportresult'"
|
|
||||||
class="ms-task-error-report-status">
|
|
||||||
FakeError
|
|
||||||
</span>
|
|
||||||
<span v-else-if="item.executionStatus && item.executionStatus.toLowerCase() === 'running'"
|
|
||||||
class="ms-task-running">
|
|
||||||
Running
|
|
||||||
</span>
|
|
||||||
<span v-else>
|
|
||||||
{{
|
|
||||||
item.executionStatus ? item.executionStatus.toLowerCase()[0].toUpperCase() + item.executionStatus.toLowerCase().substr(1) : item.executionStatus
|
|
||||||
}}
|
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -244,6 +218,22 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showStatus(status) {
|
||||||
|
status = status.toLowerCase();
|
||||||
|
switch (status) {
|
||||||
|
case "unexecute":
|
||||||
|
return "NotExecute";
|
||||||
|
case "errorreportresult":
|
||||||
|
return "FakeError";
|
||||||
|
case "stop":
|
||||||
|
return "Stopped";
|
||||||
|
default:
|
||||||
|
return status.toLowerCase()[0].toUpperCase() + status.toLowerCase().substr(1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showClass(status) {
|
||||||
|
return "ms-task-" + status;
|
||||||
|
},
|
||||||
nextData() {
|
nextData() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.init();
|
this.init();
|
||||||
|
@ -260,9 +250,9 @@ export default {
|
||||||
let request = {type: row.executionModule, reportId: row.id};
|
let request = {type: row.executionModule, reportId: row.id};
|
||||||
array = [request];
|
array = [request];
|
||||||
} else {
|
} else {
|
||||||
array.push({type: 'API', projectId: getCurrentProjectID(),userId:getCurrentUser().id});
|
array.push({type: 'API', projectId: getCurrentProjectID(), userId: getCurrentUser().id});
|
||||||
array.push({type: 'SCENARIO', projectId: getCurrentProjectID(),userId:getCurrentUser().id});
|
array.push({type: 'SCENARIO', projectId: getCurrentProjectID(), userId: getCurrentUser().id});
|
||||||
array.push({type: 'PERFORMANCE', projectId: getCurrentProjectID(),userId:getCurrentUser().id});
|
array.push({type: 'PERFORMANCE', projectId: getCurrentProjectID(), userId: getCurrentUser().id});
|
||||||
}
|
}
|
||||||
this.$post('/api/automation/stop/batch', array, response => {
|
this.$post('/api/automation/stop/batch', array, response => {
|
||||||
this.$success(this.$t('report.test_stop_success'));
|
this.$success(this.$t('report.test_stop_success'));
|
||||||
|
@ -554,7 +544,7 @@ export default {
|
||||||
color: #F56C6C;
|
color: #F56C6C;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ms-task-error-report-status {
|
.ms-task-errorreportresult {
|
||||||
color: #F6972A;
|
color: #F6972A;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,11 +554,15 @@ export default {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ms-task-unexecute {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
.ms-task-success {
|
.ms-task-success {
|
||||||
color: #67C23A;
|
color: #67C23A;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ms-task-stopped {
|
.ms-task-stop {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue