perf: alert-msg二级页面labels格式更改

This commit is contained in:
陈劲松
2020-04-08 21:23:17 +08:00
parent fcc269b8e2
commit f47f322bae
2 changed files with 25 additions and 9 deletions

View File

@@ -1336,6 +1336,9 @@ li{
/* --end--复选框自定义颜色 */ /* --end--复选框自定义颜色 */
/* dashboard-dialog */ /* dashboard-dialog */
.nz-message .el-dialog__body {
padding: 0 20px 10px 20px;
}
.nz-dialog { .nz-dialog {
overflow: hidden; overflow: hidden;
} }
@@ -1409,6 +1412,9 @@ li{
.el-textarea textarea { .el-textarea textarea {
height: 140px !important; height: 140px !important;
} }
.nz-message .el-textarea textarea {
height: 70px !important;
}
/*el-data-picker选中背景色*/ /*el-data-picker选中背景色*/
.el-date-table td.current:not(.disabled) span { .el-date-table td.current:not(.disabled) span {
background-color: $global-text-color-active; background-color: $global-text-color-active;

View File

@@ -26,6 +26,7 @@
tooltip-effect="light" tooltip-effect="light"
v-scrollBar:el-table v-scrollBar:el-table
:height="$tableHeight.openSubList.subList" :height="$tableHeight.openSubList.subList"
:cell-class-name="labelsClassName"
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
:resizable="false" :resizable="false"
@@ -34,7 +35,7 @@
:width="item.width" :width="item.width"
:key="`col-${index}`" :key="`col-${index}`"
:label="item.label" :label="item.label"
show-overflow-tooltip :show-overflow-tooltip="item.prop != 'labels'"
min-width="110px" min-width="110px"
> >
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
@@ -70,6 +71,11 @@
:id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].host}}</span> :id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].host}}</span>
<span v-else>-</span> <span v-else>-</span>
</div>--> </div>-->
<template v-else-if="item.prop == 'labels'">
<el-tag v-if="key != 'alertname' && key != 'severity'"
type="info"
size="mini" v-for="(value, key) in scope.row.labels" class="alert-message-tag">{{key}}{{value}}</el-tag>
</template>
<div v-else-if="item.prop == 'state'"> <div v-else-if="item.prop == 'state'">
<span class=""> <span class="">
{{scope.row['state'] == 1 ? "Pending" : ""}} {{scope.row['state'] == 1 ? "Pending" : ""}}
@@ -134,15 +140,9 @@
show: true, show: true,
width: 180 width: 180
}, { }, {
label: this.$t("alert.list.type"), label: this.$t("alert.list.labels"),
prop: 'type', prop: 'labels',
show: true, show: true,
width: 100
}, {
label: this.$t("alert.list.linked"),
prop: 'linkObject',
show: true,
width: 140
}, { }, {
label: this.$t("alert.severity"), label: this.$t("alert.severity"),
prop: 'severity', prop: 'severity',
@@ -279,6 +279,9 @@
if (response.code == 200) { if (response.code == 200) {
this.loading = false; this.loading = false;
this.tableData = response.data.list; this.tableData = response.data.list;
this.tableData.forEach((item) => {
item.labels = JSON.parse(item.labels);
});
this.pageObj.total = response.data.total; this.pageObj.total = response.data.total;
} }
}); });
@@ -316,6 +319,13 @@
break; break;
} }
}, },
labelsClassName(row) {
if (row.columnIndex == 1) {
return "alert-message-list-labels";
} else {
return "";
}
},
fillProject: function (module) { fillProject: function (module) {
this.$get('project', {"id": module.projectId}).then(response => { this.$get('project', {"id": module.projectId}).then(response => {
if (response.code == 200) { if (response.code == 200) {