<template>
|
<el-card class="bg-task-card" shadow="hover" :body-style="{ padding: '8px' }">
|
<!-- <template #header> -->
|
<el-row>
|
<el-space>
|
<el-tag>{{ nameToLabel(model.type) }}</el-tag>
|
<el-text tag="b" size="large" truncated>{{ model.name }}啊实打实大苏打啊实打实大苏打阿大撒大撒</el-text>
|
</el-space>
|
</el-row>
|
|
<!-- </template> -->
|
<el-text type="info" size="small">状态:{{ nameToLabel(model.status) }}</el-text>
|
<el-text type="info" size="small">开始:{{ model.startTime }}</el-text>
|
<el-text type="info" size="small">结束:{{ model.endTime }}</el-text>
|
<!-- <template #footer> -->
|
<el-button type="primary" size="small" :loading="false" @click="$emit('start', model)"
|
>开始任务</el-button
|
>
|
<el-button type="danger" size="small" :loading="false" @click="$emit('shutDown', model)"
|
>强制结束</el-button
|
>
|
<el-button type="danger" size="small" :loading="false" @click="$emit('remove', model)"
|
>移除任务</el-button
|
>
|
<el-button type="danger" size="small" :loading="false" @click="$emit('gotoResult', model)"
|
>查看结果</el-button
|
>
|
<el-text type="info" size="small">ID:{{ model.id }}</el-text>
|
<!-- </template> -->
|
</el-card>
|
</template>
|
<script>
|
import { nTlBgTask } from '@/enum/bgTask';
|
|
export default {
|
props: {
|
model: Object
|
},
|
emits: ['start', 'shutDown', 'remove', 'gotoResult'],
|
methods: {
|
nameToLabel(name) {
|
const t = nTlBgTask(name);
|
return t.label;
|
}
|
}
|
};
|
</script>
|
<style scoped>
|
.bg-task-card {
|
margin-bottom: 8px;
|
}
|
</style>
|