perf: 各列表有些没内容的字段用‘-’展示

This commit is contained in:
陈劲松
2020-03-13 16:56:54 +08:00
parent de51ed0c79
commit dd689508d4
4 changed files with 13 additions and 6 deletions

View File

@@ -73,7 +73,8 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<template v-else-if="item.prop == 'alertName'">{{scope.row.alertName}}</template> <template v-else-if="item.prop == 'alertName'">{{scope.row.alertName}}</template>
<span v-else>{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="28"> <el-table-column width="28">

View File

@@ -80,7 +80,8 @@
{{scope.row['state'] == 2 ? "Expired" : ""}} {{scope.row['state'] == 2 ? "Expired" : ""}}
</span> </span>
</div> </div>
<span v-else>{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="28"> <el-table-column width="28">

View File

@@ -53,7 +53,7 @@
<span v-else-if="item.prop == 'status'"> <span v-else-if="item.prop == 'status'">
<el-popover placement="right" width="50" trigger="hover" :content="(scope.row[item.prop] == '1'?$t('overall.available'):$t('overall.unavailable'))+'['+(scope.row.checkTime&&scope.row.checkTime!=''?(new Date(scope.row.checkTime).getHours()+':'+new Date(scope.row.checkTime).getMinutes()):'--')+']'"> <el-popover placement="right" width="50" trigger="hover" :content="(scope.row[item.prop] == '1'?$t('overall.available'):$t('overall.unavailable'))+'['+(scope.row.checkTime&&scope.row.checkTime!=''?(new Date(scope.row.checkTime).getHours()+':'+new Date(scope.row.checkTime).getMinutes()):'--')+']'">
<div slot="reference" style="width: 20px"> <div slot="reference" style="width: 20px">
<div :class="{'active-icon green':scope.row[item.prop] == '1','active-icon red':scope.row[item.prop] == '0'}"></div> <div :class="{'active-icon green':scope.row[item.prop] == '1','active-icon red':scope.row[item.prop] == '0' || scope.row[item.prop] == '-1' || scope.row[item.prop] == '-2'}"></div>
</div> </div>
</el-popover> </el-popover>
<!-- {{scope.row[item.prop] == '1' ? $t('overall.available') : ''}}--> <!-- {{scope.row[item.prop] == '1' ? $t('overall.available') : ''}}-->
@@ -66,7 +66,8 @@
&nbsp; &nbsp;
<span :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" :id="'prom-del-'+scope.row.id"><i class="el-icon-delete"></i></span> <span :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" :id="'prom-del-'+scope.row.id"><i class="el-icon-delete"></i></span>
</div> </div>
<span v-else>{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="28"> <el-table-column width="28">

View File

@@ -139,7 +139,10 @@
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="viewAsset(scope.row[item.prop].id)">{{scope.row[item.prop].host}}</span> <span v-if="item.prop == 'asset' && scope.row[item.prop]" class="link" @click="viewAsset(scope.row[item.prop].id)">{{scope.row[item.prop].host}}</span>
<span v-else-if="item.prop == 'param'"> <span v-else-if="item.prop == 'param'">
<template v-if="scope.row.paramObj">
<span v-for="(p,i) in scope.row.paramObj">{{p.key}}={{p.value}}<span v-if="i < scope.row.paramObj.length-1"></span></span> <span v-for="(p,i) in scope.row.paramObj">{{p.key}}={{p.value}}<span v-if="i < scope.row.paramObj.length-1"></span></span>
</template>
<template v-else>-</template>
</span> </span>
<div v-else-if="item.prop == 'option'" class="content-right-options"> <div v-else-if="item.prop == 'option'" class="content-right-options">
<span :title="$t('overall.query')" @click="showEndpoint(scope.row)" class="content-right-option" :id="'edp-query-'+scope.row.id"><i class="el-icon-search"></i></span> <span :title="$t('overall.query')" @click="showEndpoint(scope.row)" class="content-right-option" :id="'edp-query-'+scope.row.id"><i class="el-icon-search"></i></span>
@@ -157,7 +160,8 @@
</el-popover> </el-popover>
<!-- {{ scope.row.state == 1 ? 'up' : ''}}{{scope.row.state == 0 ? 'down' : ''}}--> <!-- {{ scope.row.state == 1 ? 'up' : ''}}{{scope.row.state == 0 ? 'down' : ''}}-->
</span> </span>
<span v-else>{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="28"> <el-table-column width="28">