feat:新增asset endpoint 列点击悬浮窗

This commit is contained in:
bsdbc
2020-02-28 08:29:52 +08:00
parent 456c11cd86
commit a95fd7d7dd
3 changed files with 274 additions and 17 deletions

View File

@@ -86,7 +86,7 @@
<div v-if="item.prop == 'pingStatus'">
<el-popover
placement="right"
width="50"
width="200"
trigger="hover"
:content="formatPingTime(scope.row.pingLastUpdate)">
<div slot="reference" style="width: 20px">
@@ -96,15 +96,20 @@
</div>
<template v-if="item.prop=='Module'">
<template v-if="scope.row.moduleNum > 0" >
<module-list-pop :asset-id="scope.row.id + ''" @openModuleBox="openModuleBox" placement="left" :ref="'moduleListPop' + scope.row.id">
<endpoint-status-pop :asset-id="scope.row.id" :ref="'endpointPop' + scope.row.id">
<template v-slot:optionZone>
<!-- <button class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75">{{scope.row.moduleNum}}</button>-->
<span class="clickable">{{scope.row.endpointNum}}</span>
</template>
</endpoint-status-pop>
<!--<module-list-pop :asset-id="scope.row.id + ''" @openModuleBox="openModuleBox" placement="left" :ref="'moduleListPop' + scope.row.id">
<template v-slot:optionZone>
&lt;!&ndash; <button class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75">{{scope.row.moduleNum}}</button>&ndash;&gt;
<span class="clickable">{{scope.row.moduleNum}}</span>
</template>
</module-list-pop>
</module-list-pop>-->
</template>
<!-- <button type="button" v-else class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75 nz-btn-disabled">{{scope.row.moduleNum}}</button>-->
<span v-else class="unclickable">{{scope.row.moduleNum}}</span>
<span v-else class="unclickable">{{scope.row.endpointNum}}</span>
</template>
<template v-if="item.prop=='Alert'">
<!-- <button type="button" v-if="scope.row.alertNum > 0" id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row.id)" class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75">{{scope.row.alertNum}}</button>-->
@@ -195,9 +200,13 @@
<script>
import bus from "../../../libs/bus";
import exportXLSX from "../../common/exportXLSX";
import endpointStatusPop from "./endpointStatusPop";
export default {
name: "asset",
components:{'export-excel':exportXLSX},
components:{
'export-excel':exportXLSX,
'endpoint-status-pop':endpointStatusPop
},
data() {
return {
searchMsg: { //给搜索框子组件传递的信息
@@ -301,11 +310,11 @@
}, {
label: this.$t("asset.tableTitle.principal"),
prop: 'principal',
show: true,
show: false,
}, {
label: this.$t("asset.tableTitle.principalTel"),
prop: 'tel',
show: true,
show: false,
width: 115
}, {
label: this.$t('config.account.option'),
@@ -712,7 +721,7 @@
},
formatPingTime:function(str){
if(!str || str == ''){
return 'Never';
return 'Last reply:Never';
}
let ds='-';
let ts=':';
@@ -724,7 +733,7 @@
let minutes=time.getMinutes() > 9 ?time.getMinutes():('0'+time.getMinutes());
let seconds=time.getSeconds() > 9 ? time.getSeconds():('0'+time.getSeconds());
return year+ds+month+ds+day+' '+hours+ts+minutes+ts+seconds;
return 'Last reply:'+year+ds+month+ds+day+' '+hours+ts+minutes+ts+seconds;
}
},