Browse Source

服务状态添加颜色区分

SJA-develop
liwei 3 years ago
parent
commit
cb2861cb2b
1 changed files with 20 additions and 2 deletions
  1. +20
    -2
      src/views/etcd/index.vue

+ 20
- 2
src/views/etcd/index.vue View File

@ -28,7 +28,7 @@
<el-table-column prop="exe_path" label="服务路径"> </el-table-column> <el-table-column prop="exe_path" label="服务路径"> </el-table-column>
<el-table-column label="服务状态"> <el-table-column label="服务状态">
<template #default="scope"> <template #default="scope">
{{ setStatusText(scope.row) }}
<span :class="`serve-text ${'status-color'+scope.row.state}`">{{ setStatusText(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="350" align="center"> <el-table-column label="操作" width="350" align="center">
@ -126,7 +126,7 @@ export default {
// status // status
setStatusText(row) { setStatusText(row) {
const item = this.statusList.find((e) => e.key == row.state); const item = this.statusList.find((e) => e.key == row.state);
return item.value || "";
return item.value || '';
}, },
// //
handleAdd() { handleAdd() {
@ -219,3 +219,21 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.serve-text{
color: #FFFFFF;
padding: 5px 10px;
}
.status-color0{
background: #f95450;
}
.status-color1{
background: #2e94bc;
}
.status-color2{
background: #4e75bc;
}
.status-color2{
background: #f7c139;
}
</style>

Loading…
Cancel
Save