perf: terminallog红绿提示统一

This commit is contained in:
陈劲松
2020-04-25 12:07:36 +08:00
parent fdce566edb
commit fceeb685d6
4 changed files with 21 additions and 15 deletions

View File

@@ -722,13 +722,13 @@ li{
padding: 0;
background-color: $content-right-background-color;
}
.nz-table td.has-message .cell>span {
.nz-table td.danger .cell>span {
background-color: #ff6666;
color: white;
padding:2px 5px;
border-radius: 4px;
}
.nz-table td.has-no-message .cell>span {
.nz-table td.success .cell>span {
background-color: #1bd383;
color: white;
padding:2px 5px;

View File

@@ -360,9 +360,9 @@
messageStyle(e) {
if (e.column.label == this.$t("alert.message")) {
if (e.row.alertNum > 0) {
return 'has-message';
return 'danger';
} else {
return 'has-no-message';
return 'success';
}
}
return '';

View File

@@ -690,9 +690,9 @@
messageStyle(e) {
if (e.column.label == this.$t("asset.tableTitle.alerts")) {
if (e.row.alertNum > 0) {
return 'has-message';
return 'danger';
} else {
return 'has-no-message';
return 'success';
}
}
return '';

View File

@@ -52,6 +52,7 @@
:height="$tableHeight.normal"
v-scrollBar:el-table="'large'"
v-loading="loading"
:cell-class-name="messageStyle"
style="width: 100%;">
<el-table-column
:resizable="false"
@@ -67,15 +68,9 @@
{{scope.row[item.prop] == 'zh' ? '中文' : ''}}
{{scope.row[item.prop] == 'ru' ? 'русский' : ''}}
</span>
<span v-else-if="item.prop == 'status'">
<el-tag v-if="scope.row.status==='1'"
type="success"
disable-transitions>{{$t("config.terminallog.success")}}</el-tag>
<el-tag v-else
type="danger"
disable-transitions>
{{$t("config.terminallog.fail")}}</el-tag>
</span>
<template v-else-if="item.prop == 'status'">
<span>{{scope.row.status==='1' ? $t("config.terminallog.success") : $t("config.terminallog.fail")}}</span>
</template>
<span v-else>{{scope.row[item.prop]}}</span>
</template>
</el-table-column>
@@ -301,6 +296,17 @@
}
});
},
messageStyle(e) {
if (e.column.label == this.$t('config.terminallog.status')) {
console.info(e.row)
if (e.row.status == '1') {
return 'success';
} else {
return 'danger';
}
}
return '';
},
toEditReceiver: function (item) {
if (!item.isEdit) {
//如果不在编辑状态,那么其他项如果有改动,则还原改动,最后开始编辑