feat: 几个详情页
1.asset详情页 2.asset页面 alert 超链接 3.alert rule 详情页 4.datacenter详情页
This commit is contained in:
@@ -689,6 +689,12 @@ li{
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
background-color: $content-right-background-color;
|
background-color: $content-right-background-color;
|
||||||
}
|
}
|
||||||
|
.nz-table.el-table td.has-message .cell {
|
||||||
|
background-color: #f8d7da;
|
||||||
|
}
|
||||||
|
.nz-table.el-table td.has-no-message .cell {
|
||||||
|
background-color: #d4edda;
|
||||||
|
}
|
||||||
.nz-table.el-table th {
|
.nz-table.el-table th {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -1335,10 +1341,10 @@ li{
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
.red {
|
.red {
|
||||||
background-color:#ff6347;
|
background-color: #ff6347 !important;
|
||||||
}
|
}
|
||||||
.green {
|
.green {
|
||||||
background-color:lightGreen;
|
background-color:lightGreen !important;
|
||||||
}
|
}
|
||||||
.grey {
|
.grey {
|
||||||
background-color:lightGrey;
|
background-color:lightGrey;
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
></common-detail-tab>
|
></common-detail-tab>
|
||||||
<!--机柜-->
|
<!--机柜-->
|
||||||
<cabinet-tab v-show="subResizeShow" v-if="from == 'dc' && targetTab == 'cabinet'" :obj="obj" @changeTab="changeTab"></cabinet-tab>
|
<cabinet-tab v-show="subResizeShow" v-if="from == 'dc' && targetTab == 'cabinet'" :obj="obj" @changeTab="changeTab"></cabinet-tab>
|
||||||
|
<!--告警信息-->
|
||||||
|
<alert-message-tab v-show="subResizeShow" v-if="((from == 'alertRule' || from == 'asset') && targetTab == 'alertMessage')" :from="from" :obj="obj" @changeTab="changeTab"></alert-message-tab>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,12 +31,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import commonDetailTab from "./tabs/commonDetailTab"
|
import commonDetailTab from "./tabs/commonDetailTab"
|
||||||
import cabinetTab from "./tabs/cabinetTab";
|
import cabinetTab from "./tabs/cabinetTab";
|
||||||
|
import alertMessageTab from "./tabs/alertMessageTab";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "cabinetBox",
|
name: "cabinetBox",
|
||||||
components:{
|
components:{
|
||||||
'common-detail-tab': commonDetailTab,
|
'common-detail-tab': commonDetailTab,
|
||||||
'cabinet-tab': cabinetTab,
|
'cabinet-tab': cabinetTab,
|
||||||
|
'alert-message-tab': alertMessageTab,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
isFullScreen: false, //是否全屏
|
isFullScreen: false, //是否全屏
|
||||||
|
|||||||
@@ -1,298 +0,0 @@
|
|||||||
<template>
|
|
||||||
<span>
|
|
||||||
<!-- 副列表 endpoint query-->
|
|
||||||
<div @mousedown="listResize" class="sub-list-resize" v-if="showSubList && !isFullScreen">一</div>
|
|
||||||
<div class="sub-list" v-if="showSubList">
|
|
||||||
<div class="sub-list-window-control">
|
|
||||||
<!--半屏-->
|
|
||||||
<div class="window-control-btn" v-if="isFullScreen" @click="exitFullScreen"><i class="nz-icon nz-icon-exit-full-screen"></i></div>
|
|
||||||
<!--全屏-->
|
|
||||||
<div class="window-control-btn" v-if="!isFullScreen" @click="fullScreen"><i class="el-icon-full-screen"></i></div>
|
|
||||||
<!--关闭-->
|
|
||||||
<div class="window-control-btn" @click="closeSubList"><i class="el-icon-close"></i></div>
|
|
||||||
</div>
|
|
||||||
<template>
|
|
||||||
<div class="sub-top-tools" v-show="subResizeShow">
|
|
||||||
<div class="sub-list-tabs margin-l-20" style="width: calc(100% - 780px);">
|
|
||||||
<div class="sub-list-tab">{{$t("dashboard.overview.dataCenter.cabinet")}}</div>
|
|
||||||
<span class="sub-list-tab-txt">{{$t("asset.createAssetTab.dcName")}}:{{obj.name}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="top-tool-right">
|
|
||||||
<div class="top-tool-search">
|
|
||||||
<search-input :searchMsg="searchMsg" @search="search"></search-input>
|
|
||||||
</div>
|
|
||||||
<button type="button" @click="toAddCabinet" :title="$t('overall.createCabinet')"
|
|
||||||
class="nz-btn nz-btn-size-normal nz-btn-style-light float-right margin-l-20" id="cab-add">
|
|
||||||
<i class="nz-icon-create-square nz-icon"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
class="nz-table"
|
|
||||||
:data="tableData"
|
|
||||||
border
|
|
||||||
v-show="subResizeShow"
|
|
||||||
v-loading="loading"
|
|
||||||
ref="cabTable"
|
|
||||||
v-scrollBar:el-table
|
|
||||||
:height="$tableHeight.noPagination"
|
|
||||||
style="width: 100%;">
|
|
||||||
<el-table-column
|
|
||||||
:resizable="false"
|
|
||||||
v-for="(item, index) in tableTitle"
|
|
||||||
v-if="item.show"
|
|
||||||
:width="item.width"
|
|
||||||
:key="`col-${index}`"
|
|
||||||
:label="item.label"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope" :column="item">
|
|
||||||
<div v-if="item.prop == 'option'" class="content-right-options">
|
|
||||||
<span :title="$t('overall.edit')" @click="editCabinet(scope.row)" class="content-right-option" :id="'dc-edit-'+scope.row.id"><i class="nz-icon nz-icon-edit"></i></span>
|
|
||||||
|
|
||||||
<span :title="$t('overall.delete')" @click="delCabinet(scope.row)" class="content-right-option" :id="'dc-del-'+scope.row.id"><i class="el-icon-delete"></i></span>
|
|
||||||
</div>
|
|
||||||
<template v-else-if="item.prop == 'assetStat'">
|
|
||||||
<el-popover
|
|
||||||
placement="top-start"
|
|
||||||
offset="-100"
|
|
||||||
trigger="hover"
|
|
||||||
:content="$t('overall.result.total') + ':' + scope.row.assetStat.total + ',' + $t('asset.createAssetTab.inStock') + ':' + scope.row.assetStat.inStock + ',' + $t('asset.createAssetTab.notInStock') + ':' + scope.row.assetStat.outStock">
|
|
||||||
<div slot="reference" class="dc-asset-states">
|
|
||||||
<span class="dc-asset-state dc-asset-state-total">{{scope.row.assetStat.total}}</span>
|
|
||||||
<span class="dc-asset-state dc-asset-state-in">{{scope.row.assetStat.inStock}}</span>
|
|
||||||
<span class="dc-asset-state dc-asset-state-out">{{scope.row.assetStat.outStock}}</span>
|
|
||||||
</div>
|
|
||||||
</el-popover>
|
|
||||||
|
|
||||||
</template >
|
|
||||||
<template v-else-if="item.prop == 'alertStat'">
|
|
||||||
<el-popover
|
|
||||||
placement="top-start"
|
|
||||||
offset="-128"
|
|
||||||
trigger="hover"
|
|
||||||
:content="$t('overall.result.total') + ':' + scope.row.alertStat.total + ',' + $t('alert.config.high') + ':' + scope.row.alertStat.high + ',' + $t('alert.config.medium') + ':' + scope.row.alertStat.medium+ ',' + $t('alert.config.low') + ':' + scope.row.alertStat.low">
|
|
||||||
<div slot="reference" class="dc-asset-states">
|
|
||||||
<span class="dc-asset-state dc-asset-state-total">{{scope.row.alertStat.total}}</span>
|
|
||||||
<span class="dc-asset-state dc-asset-state-high">{{scope.row.alertStat.high}}</span>
|
|
||||||
<span class="dc-asset-state dc-asset-state-out">{{scope.row.alertStat.medium}}</span>
|
|
||||||
<span class="dc-asset-state dc-asset-state-in">{{scope.row.alertStat.low}}</span>
|
|
||||||
</div>
|
|
||||||
</el-popover>
|
|
||||||
</template >
|
|
||||||
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
|
||||||
<template v-else>-</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<cabinet-box :cur-cabinet="currentCabinet" :cur-idc="currentDc" ref="cabinetEditBox" @after="getCabinetList"></cabinet-box>
|
|
||||||
<button class="to-top" v-show="showTopBtn && subResizeShow" @click="$toTop('ps', 1)"><i class="nz-icon nz-icon-top"></i></button>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import cabinetBox from "../../common/rightBox/cabinetBox";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "cabinetBox",
|
|
||||||
components:{
|
|
||||||
'cabinet-box':cabinetBox
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
isFullScreen: false, //是否全屏
|
|
||||||
showSubList: Boolean, //是否显示
|
|
||||||
subResizeShow: Boolean, //resize时,用v-show="subResizeShow"控制页面内容是否显示
|
|
||||||
obj: Object, //关联的实体对象,有:"asset"、"alertRule"
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentCabinet: {
|
|
||||||
id:'',
|
|
||||||
idcId:'',
|
|
||||||
name:'',
|
|
||||||
remark:'',
|
|
||||||
seq:'',
|
|
||||||
uSize:0
|
|
||||||
},
|
|
||||||
showTopBtn: false, //top按钮是否显示
|
|
||||||
loading: false,
|
|
||||||
currentDc: {},
|
|
||||||
tableTitle: [
|
|
||||||
{
|
|
||||||
label: 'ID',
|
|
||||||
prop: 'id',
|
|
||||||
show: true,
|
|
||||||
width: 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label:this.$t('overall.name'),
|
|
||||||
prop:'name',
|
|
||||||
show:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label:this.$t('asset.createAssetTab.uSize'),
|
|
||||||
prop:'uSize',
|
|
||||||
show:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label:this.$t('config.dc.assets'),
|
|
||||||
prop:'assetStat',
|
|
||||||
show:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label:this.$t('alert.alert'),
|
|
||||||
prop:'alertStat',
|
|
||||||
show:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label:this.$t('config.dc.remark'),
|
|
||||||
prop:'remark',
|
|
||||||
show:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: this.$t('config.account.option'),
|
|
||||||
prop: 'option',
|
|
||||||
show: true,
|
|
||||||
width: 120
|
|
||||||
}
|
|
||||||
],
|
|
||||||
searchMsg: { //给搜索框子组件传递的信息
|
|
||||||
zheze_none: true,
|
|
||||||
searchLabelList: [
|
|
||||||
{
|
|
||||||
id: 11,
|
|
||||||
name: this.$t('overall.name'),
|
|
||||||
type: 'input',
|
|
||||||
label: 'name',
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:12,
|
|
||||||
name:this.$t('asset.createAssetTab.uSize'),
|
|
||||||
label:'uSize',
|
|
||||||
disabled: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:13,
|
|
||||||
name:this.$t('config.dc.remark'),
|
|
||||||
label:'remark',
|
|
||||||
disabled: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
searchLabel: { //搜索参数
|
|
||||||
},
|
|
||||||
tableData: [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toAddCabinet:function(){
|
|
||||||
this.$refs.cabinetEditBox.show(true,true);
|
|
||||||
this.$refs.cabinetEditBox.reset();
|
|
||||||
},
|
|
||||||
editCabinet(cabinet) {
|
|
||||||
this.currentCabinet = JSON.parse(JSON.stringify(cabinet));
|
|
||||||
console.info(this.$refs.cabinetEditBox)
|
|
||||||
this.$refs.cabinetEditBox.show(true, true);
|
|
||||||
},
|
|
||||||
getCabinetList() {
|
|
||||||
this.tableData = [];
|
|
||||||
this.loading = true;
|
|
||||||
this.$set(this.searchLabel, "pageNo", 1);
|
|
||||||
this.$set(this.searchLabel, "pageSize", -1);
|
|
||||||
this.$get("/cabinet", this.searchLabel).then(response => {
|
|
||||||
if (response.code == 200) {
|
|
||||||
this.loading = false;
|
|
||||||
this.tableData = response.data.list;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
search: function (searchObj) {
|
|
||||||
this.searchLabel = {idcId: this.currentDc.id, pageNo: 1, pageSize: -1};
|
|
||||||
for (let item in searchObj) {
|
|
||||||
if (searchObj[item]) {
|
|
||||||
this.$set(this.searchLabel, item, searchObj[item]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.getCabinetList();
|
|
||||||
},
|
|
||||||
exitFullScreen() {
|
|
||||||
this.$emit("exitFullScreen");
|
|
||||||
},
|
|
||||||
fullScreen() {
|
|
||||||
this.$emit("fullScreen");
|
|
||||||
},
|
|
||||||
closeSubList() {
|
|
||||||
this.$emit("closeSubList");
|
|
||||||
this.tableData = [];
|
|
||||||
},
|
|
||||||
listResize(e) {
|
|
||||||
this.$emit('listResize', e);
|
|
||||||
},
|
|
||||||
delCabinet:function(cabinet){
|
|
||||||
this.$confirm(this.$t("tip.confirmDelete"), {
|
|
||||||
confirmButtonText: this.$t("tip.yes"),
|
|
||||||
cancelButtonText: this.$t("tip.no"),
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.$delete('/cabinet?ids='+cabinet.id).then(response=>{
|
|
||||||
if(response.code == 200){
|
|
||||||
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
|
||||||
this.getCabinetList();
|
|
||||||
}else{
|
|
||||||
this.$message.error(response.msg);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
obj: {
|
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
|
||||||
handler(n) {
|
|
||||||
if (n) {
|
|
||||||
this.currentDc = JSON.parse(JSON.stringify(n));
|
|
||||||
this.searchLabel = {idcId: this.currentDc.id};
|
|
||||||
this.getCabinetList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
//绑定滚动条事件,控制top按钮
|
|
||||||
let el = this.$refs.cabTable.$el.querySelector(".el-table__body-wrapper");
|
|
||||||
if (el._ps_) {
|
|
||||||
el.addEventListener("ps-scroll-y", () => {
|
|
||||||
if (el._ps_.scrollbarYTop > 50) {
|
|
||||||
this.showTopBtn = true;
|
|
||||||
} else {
|
|
||||||
this.showTopBtn = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
/*重写el-loading样式*/
|
|
||||||
.nz-table .el-loading-spinner .circular{
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
animation: loading-rotate 2s linear infinite;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.nz-table .el-loading-spinner{
|
|
||||||
background: url(../../../assets/img/loading.gif) no-repeat;
|
|
||||||
background-size: 48px 48px;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
top: 50%;
|
|
||||||
left: 48.5%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,107 +1,94 @@
|
|||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
<!-- 副列表 endpoint query-->
|
<div class="sub-top-tools">
|
||||||
<div @mousedown="listResize" class="sub-list-resize" v-if="showSubList && !isFullScreen">一</div>
|
<div class="sub-list-tabs">
|
||||||
<div class="sub-list" v-if="showSubList">
|
<div class="sub-list-tab-title">
|
||||||
<div class="sub-top-tools" v-show="subResizeShow">
|
<template v-if="from == 'asset'">{{$t("project.endpoint.asset")}}:{{obj.host}}</template>
|
||||||
<div class="sub-list-tabs margin-l-20" style="width: calc(100% - 780px);">
|
<template v-if="from == 'alertRule'">{{$t("alert.alertName")}}:{{obj.alertName}}</template>
|
||||||
<div class="sub-list-tab">{{$t("overall.query")}}</div>
|
</div><div
|
||||||
<span class="sub-list-tab-txt">
|
class="sub-list-tab" @click="changeTab('detail')">{{$t("overall.detail")}}</div><div
|
||||||
<template v-if="from == 'asset'">{{$t("project.endpoint.asset")}}:{{obj.host}}</template>
|
class="sub-list-tab sub-list-tab-active">{{$t("alert.message")}}</div>
|
||||||
<template v-if="from == 'alertRule'">{{$t("alert.alertName")}}:{{obj.alertName}}</template>
|
</div>
|
||||||
</span>
|
<div class="top-tool-right">
|
||||||
</div>
|
<div class="top-tool-search">
|
||||||
<!--时间选择器-->
|
<search-input :searchMsg="searchMsg" @search="search"></search-input>
|
||||||
<div class="top-tool-right">
|
|
||||||
<div class="top-tool-search">
|
|
||||||
<search-input :searchMsg="searchMsg" @search="search"></search-input>
|
|
||||||
</div>
|
|
||||||
<div class="sub-list-window-control">
|
|
||||||
<!--半屏-->
|
|
||||||
<div class="window-control-btn" v-if="isFullScreen" @click="exitFullScreen"><i class="nz-icon nz-icon-exit-full-screen"></i></div>
|
|
||||||
<!--全屏-->
|
|
||||||
<div class="window-control-btn" v-if="!isFullScreen" @click="fullScreen"><i class="el-icon-full-screen"></i></div>
|
|
||||||
<!--关闭-->
|
|
||||||
<div class="window-control-btn" @click="closeSubList"><i class="el-icon-close"></i></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
</div>
|
||||||
:data="tableData"
|
<el-table
|
||||||
v-loading="loading"
|
class="nz-table"
|
||||||
element-loading-background="rgba(0, 0, 0, 0)"
|
:data="tableData"
|
||||||
border
|
element-loading-background="rgba(0, 0, 0, 0)"
|
||||||
tooltip-effect="light"
|
border
|
||||||
v-scrollBar:el-table
|
v-loading="loading"
|
||||||
class="nz-table"
|
ref="alertMessageSubList"
|
||||||
:height="$tableHeight.openSubList.subList"
|
tooltip-effect="light"
|
||||||
ref="alertMessageSubList"
|
v-scrollBar:el-table
|
||||||
v-show="subResizeShow"
|
:height="$tableHeight.openSubList.subList"
|
||||||
style="width: 100%; margin-top: 5px;">
|
style="width: 100%;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="false"
|
:resizable="false"
|
||||||
v-for="(item, index) in tablelable"
|
v-for="(item, index) in tablelable"
|
||||||
v-if="item.show"
|
v-if="item.show"
|
||||||
:width="item.width"
|
:width="item.width"
|
||||||
:key="`col-${index}`"
|
:key="`col-${index}`"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
min-width="110px"
|
min-width="110px"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<template v-if="item.prop == 'alertRule'">
|
<template v-if="item.prop == 'alertRule'">
|
||||||
<div class="too-long-split" :id="'view-rule-'+scope.row[item.prop].id"
|
<div class="too-long-split" :id="'view-rule-'+scope.row[item.prop].id"
|
||||||
v-if="scope.row[item.prop].alertName">{{scope.row[item.prop].alertName}}</div>
|
v-if="scope.row[item.prop].alertName">{{scope.row[item.prop].alertName}}</div>
|
||||||
<template v-else>-</template>
|
|
||||||
</template>
|
|
||||||
<div v-else-if="item.prop == 'type'" class="content-right-options">
|
|
||||||
<span v-if="scope.row[item.prop] == 1">Project</span>
|
|
||||||
<span v-if="scope.row[item.prop] == 2">Module</span>
|
|
||||||
<span v-if="scope.row[item.prop] == 3">Device</span>
|
|
||||||
</div>
|
|
||||||
<template v-else-if="item.prop == 'summary'">
|
|
||||||
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
|
||||||
<template v-else>-</template>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="item.prop == 'description'">
|
|
||||||
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</template>
|
|
||||||
<span v-else-if="item.prop == 'severity'">
|
|
||||||
<span v-if="scope.row[item.prop] == 'high'"><i class="el-icon-arrow-up"></i> {{severityData[1].value}}</span>
|
|
||||||
<span style="padding-left: 18px;" v-if="scope.row[item.prop] == 'medium'">{{severityData[0].value}}</span>
|
|
||||||
<span v-if="scope.row[item.prop] == 'low'"><i class="el-icon-arrow-down"></i> {{severityData[2].value}}</span>
|
|
||||||
</span>
|
|
||||||
<div v-else-if="item.prop == 'linkObject'">
|
|
||||||
<span v-if="(scope.row['type'] == 1 || scope.row['type'] == 2) && scope.row[item.prop]" class="link too-long-split"
|
|
||||||
@click="viewAlertType(scope.row['type'],scope.row[item.prop])" style="max-width: 125px;"
|
|
||||||
:id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].name}}</span>
|
|
||||||
<span v-else-if="scope.row['type'] == 3 && scope.row[item.prop]" class="link"
|
|
||||||
@click="viewAlertType(scope.row['type'],scope.row[item.prop].id)"
|
|
||||||
:id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].host}}</span>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="item.prop == 'state'">
|
|
||||||
<span class="">
|
|
||||||
{{scope.row['state'] == 1 ? "Pending" : ""}}
|
|
||||||
{{scope.row['state'] == 2 ? "Expired" : ""}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
|
||||||
<template v-else>-</template>
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<div v-else-if="item.prop == 'type'" class="content-right-options">
|
||||||
<el-table-column width="28" :resizable="false">
|
<span v-if="scope.row[item.prop] == 1">Project</span>
|
||||||
<template slot="header" slot-scope="scope">
|
<span v-if="scope.row[item.prop] == 2">Module</span>
|
||||||
<span @click.stop="elementsetShow('shezhi',$event)" class="nz-table-gear">
|
<span v-if="scope.row[item.prop] == 3">Device</span>
|
||||||
<i class="nz-icon nz-icon-gear"></i>
|
</div>
|
||||||
</span>
|
<template v-else-if="item.prop == 'summary'">
|
||||||
|
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
||||||
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<template v-else-if="item.prop == 'description'">
|
||||||
</el-table>
|
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
|
||||||
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
|
<span v-else>-</span>
|
||||||
<button class="to-top" v-show="showTopBtn && subResizeShow" @click="$toTop('ps', 1)"><i class="nz-icon nz-icon-top"></i></button>
|
</template>
|
||||||
</div>
|
<span v-else-if="item.prop == 'severity'">
|
||||||
|
<span v-if="scope.row[item.prop] == 'high'"><i class="el-icon-arrow-up"></i> {{severityData[1].value}}</span>
|
||||||
|
<span style="padding-left: 18px;" v-if="scope.row[item.prop] == 'medium'">{{severityData[0].value}}</span>
|
||||||
|
<span v-if="scope.row[item.prop] == 'low'"><i class="el-icon-arrow-down"></i> {{severityData[2].value}}</span>
|
||||||
|
</span>
|
||||||
|
<div v-else-if="item.prop == 'linkObject'">
|
||||||
|
<span v-if="(scope.row['type'] == 1 || scope.row['type'] == 2) && scope.row[item.prop]" class="link too-long-split"
|
||||||
|
@click="viewAlertType(scope.row['type'],scope.row[item.prop])" style="max-width: 125px;"
|
||||||
|
:id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].name}}</span>
|
||||||
|
<span v-else-if="scope.row['type'] == 3 && scope.row[item.prop]" class="link"
|
||||||
|
@click="viewAlertType(scope.row['type'],scope.row[item.prop].id)"
|
||||||
|
:id="'link-obj-'+scope.row['type']+'-'+scope.row[item.prop].id">{{scope.row[item.prop].host}}</span>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="item.prop == 'state'">
|
||||||
|
<span class="">
|
||||||
|
{{scope.row['state'] == 1 ? "Pending" : ""}}
|
||||||
|
{{scope.row['state'] == 2 ? "Expired" : ""}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
||||||
|
<template v-else>-</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="28" :resizable="false">
|
||||||
|
<template slot="header" slot-scope="scope">
|
||||||
|
<span @click.stop="elementsetShow('shezhi',$event)" class="nz-table-gear">
|
||||||
|
<i class="nz-icon nz-icon-gear"></i>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
|
||||||
|
<button class="to-top" v-show="showTopBtn && subResizeShow" @click="$toTop('ps', 1)"><i class="nz-icon nz-icon-top"></i></button>
|
||||||
<project-box :project="viewProjectData" ref="projectBox" @reload="getAlertList"></project-box>
|
<project-box :project="viewProjectData" ref="projectBox" @reload="getAlertList"></project-box>
|
||||||
<module-box :module="viewModuleData" @reload="getAlertList" ref="moduleBox"></module-box>
|
<module-box :module="viewModuleData" @reload="getAlertList" ref="moduleBox"></module-box>
|
||||||
<asset-box :edit-unit-show='viewAssetState' @refreshData="getAlertList" @sendStateData="tabControl" ref="assetEditUnit"></asset-box>
|
<asset-box :edit-unit-show='viewAssetState' @refreshData="getAlertList" @sendStateData="tabControl" ref="assetEditUnit"></asset-box>
|
||||||
@@ -120,13 +107,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "alertMessageBox",
|
name: "alertMessageTab",
|
||||||
|
components: {
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
isFullScreen: false, //是否全屏
|
|
||||||
showSubList: Boolean, //是否显示
|
|
||||||
subResizeShow: Boolean, //resize时,用v-show="subResizeShow"控制页面内容是否显示
|
|
||||||
from: String, //来自哪个主页面,有:"asset"、"alertRule"
|
from: String, //来自哪个主页面,有:"asset"、"alertRule"
|
||||||
obj: Object, //关联的实体对象,有:"asset"、"alertRule"
|
obj: Object, //关联的实体对象
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -231,19 +217,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
viewRuleData: {
|
|
||||||
id: '',
|
|
||||||
alertName: '',
|
|
||||||
type: '',
|
|
||||||
linkObject: {id: '', name: ''},
|
|
||||||
linkId: '',
|
|
||||||
expr: '',
|
|
||||||
last: '',
|
|
||||||
severity: '',
|
|
||||||
summary: '',
|
|
||||||
description: '',
|
|
||||||
receiver: '',
|
|
||||||
},
|
|
||||||
viewProjectData: {id: '', name: '', remark: ''},
|
viewProjectData: {id: '', name: '', remark: ''},
|
||||||
viewModuleData: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []},
|
viewModuleData: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []},
|
||||||
viewAssetState: false,
|
viewAssetState: false,
|
||||||
@@ -285,6 +258,10 @@
|
|||||||
this.tablelable = data;
|
this.tablelable = data;
|
||||||
this.dropCol = data;
|
this.dropCol = data;
|
||||||
},
|
},
|
||||||
|
// 切换tab
|
||||||
|
changeTab(tab) {
|
||||||
|
this.$emit('changeTab', tab);
|
||||||
|
},
|
||||||
getAlertList() {
|
getAlertList() {
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -307,24 +284,7 @@
|
|||||||
localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val);
|
localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val);
|
||||||
this.getAlertList();
|
this.getAlertList();
|
||||||
},
|
},
|
||||||
search: function (searchObj) {
|
|
||||||
this.searchLabel = {};
|
|
||||||
if (this.from == "alertRule") {
|
|
||||||
this.searchLabel.ruleId = this.obj.id;
|
|
||||||
} else if (this.from == "asset") {
|
|
||||||
this.searchLabel.type = 3;
|
|
||||||
this.searchLabel.linkId = this.obj.id;
|
|
||||||
}
|
|
||||||
this.pageObj.pageNo = 1;
|
|
||||||
for (let item in searchObj) {
|
|
||||||
if (searchObj[item]) {
|
|
||||||
this.$set(this.searchLabel, item, searchObj[item]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.getAlertList();
|
|
||||||
},
|
|
||||||
viewAlertType(type, typeObj) {
|
viewAlertType(type, typeObj) {
|
||||||
console.info(type, typeObj)
|
|
||||||
this.closeViews();
|
this.closeViews();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -360,11 +320,21 @@
|
|||||||
this.$refs.moduleBox.show(false, false);
|
this.$refs.moduleBox.show(false, false);
|
||||||
this.viewAssetState = false;
|
this.viewAssetState = false;
|
||||||
},
|
},
|
||||||
exitFullScreen() {
|
search: function (searchObj) {
|
||||||
this.$emit("exitFullScreen");
|
this.searchLabel = {};
|
||||||
},
|
if (this.from == "alertRule") {
|
||||||
fullScreen() {
|
this.searchLabel.ruleId = this.obj.id;
|
||||||
this.$emit("fullScreen");
|
} else if (this.from == "asset") {
|
||||||
|
this.searchLabel.type = 3;
|
||||||
|
this.searchLabel.linkId = this.obj.id;
|
||||||
|
}
|
||||||
|
this.pageObj.pageNo = 1;
|
||||||
|
for (let item in searchObj) {
|
||||||
|
if (searchObj[item]) {
|
||||||
|
this.$set(this.searchLabel, item, searchObj[item]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.getAlertList();
|
||||||
},
|
},
|
||||||
closeSubList() {
|
closeSubList() {
|
||||||
this.$emit("closeSubList");
|
this.$emit("closeSubList");
|
||||||
@@ -376,9 +346,6 @@
|
|||||||
this.viewAssetState = false
|
this.viewAssetState = false
|
||||||
this.$refs['assetEditUnit'].tabView = false
|
this.$refs['assetEditUnit'].tabView = false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
listResize(e) {
|
|
||||||
this.$emit('listResize', e);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -431,21 +398,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style scoped>
|
||||||
/*重写el-loading样式*/
|
|
||||||
.nz-table .el-loading-spinner .circular{
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
animation: loading-rotate 2s linear infinite;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.nz-table .el-loading-spinner{
|
|
||||||
background: url(../../../assets/img/loading.gif) no-repeat;
|
|
||||||
background-size: 48px 48px;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
top: 50%;
|
|
||||||
left: 48.5%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -6,15 +6,26 @@
|
|||||||
<template v-if="from == 'dc'">{{$t("asset.createAssetTab.dcName")}}:{{obj.name}}</template>
|
<template v-if="from == 'dc'">{{$t("asset.createAssetTab.dcName")}}:{{obj.name}}</template>
|
||||||
<template v-else-if="from == 'account'">{{$t("config.account.account")}}:{{obj.username}}</template>
|
<template v-else-if="from == 'account'">{{$t("config.account.account")}}:{{obj.username}}</template>
|
||||||
<template v-else-if="from == 'promServer'">ID:{{obj.id}}</template>
|
<template v-else-if="from == 'promServer'">ID:{{obj.id}}</template>
|
||||||
|
<template v-else-if="from == 'alertRule'">{{$t("alert.alertName")}}:{{obj.alertName}}</template>
|
||||||
|
<template v-else-if="from == 'asset'">{{$t("asset.tableTitle.host")}}:{{obj.host}}</template>
|
||||||
</div><div class="sub-list-tab sub-list-tab-active">{{$t("overall.detail")}}</div><template v-if="from == 'dc'">
|
</div><div class="sub-list-tab sub-list-tab-active">{{$t("overall.detail")}}</div><template v-if="from == 'dc'">
|
||||||
<div class="sub-list-tab" @click="changeTab('cabinet')">{{$t("config.dc.cabinets")}}</div>
|
<div class="sub-list-tab" @click="changeTab('cabinet')">{{$t("config.dc.cabinets")}}</div>
|
||||||
|
</template><template v-if="from == 'alertRule' || from == 'asset'">
|
||||||
|
<div class="sub-list-tab" @click="changeTab('alertMessage')">{{$t("alert.message")}}</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px;">
|
<div style="margin-top: 10px;">
|
||||||
<div style="padding: 5px; color: #606266;" v-for="item in detail">
|
<template v-for="item in detail">
|
||||||
{{item.label}}: {{item.value}}
|
<div style="width: 30%; display: inline-block; padding: 5px; color: #606266; word-break: break-all; vertical-align: top">
|
||||||
</div>
|
<span>{{item.label}}: </span>
|
||||||
|
<template v-if="item.type && item.type == 'status'">
|
||||||
|
<div style="margin-top: 0" :class="{'active-icon green': item.value == '1', 'active-icon red': item.value == '0' || item.value == '-1' || item.value == '-2'}"></div>
|
||||||
|
<span style="color: #999">{{item.msg}}</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>{{item.value}}</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
<span slot="reference" class="sidebar-info-item-txt" style="margin-bottom: -14px; display: block;" v-if="tabView">{{assetData.sn}}</span>
|
<span slot="reference" class="sidebar-info-item-txt" style="margin-bottom: -14px; display: block;" v-if="tabView">{{assetData.sn}}</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.host')" prop="host">
|
<el-form-item :label="$t('asset.createAssetTab.host')" prop="host">
|
||||||
<el-input size="small" v-if="!tabView" v-model="assetData.host"/>
|
<el-input size="small" v-if="!tabView" v-model="assetData.host"/>
|
||||||
<span v-if="tabView">{{assetData.host}}</span>
|
<span v-if="tabView">{{assetData.host}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.state')">
|
<el-form-item :label="$t('asset.createAssetTab.state')">
|
||||||
<div v-if="!tabView" class="select-style">
|
<div v-if="!tabView" class="select-style">
|
||||||
<el-select size="small" v-model="assetData.state" placeholder="" popper-class="asset-dropdown" >
|
<el-select size="small" v-model="assetData.state" placeholder="" popper-class="asset-dropdown" >
|
||||||
<el-option
|
<el-option
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<span v-if="tabView">{{assetViewData.assetType}}</span>
|
<span v-if="tabView">{{assetViewData.assetType}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!------------------------------------------厂商/型号---------------------------------------------->
|
<!------------------------------------------厂商/型号---------------------------------------------->
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.vendorModel')" class="right-box-form-content" prop="modelId">
|
<el-form-item :label="$t('asset.createAssetTab.vendorModel')" class="right-box-form-content" prop="modelId">
|
||||||
<template v-if="!tabView">
|
<template v-if="!tabView">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
:options="vendorTypeOptionData"
|
:options="vendorTypeOptionData"
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<span v-if="tabView">{{assetViewData.vendor}} {{assetViewData.model}}</span>
|
<span v-if="tabView">{{assetViewData.vendor}} {{assetViewData.model}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.purchaseDate')">
|
<el-form-item :label="$t('asset.createAssetTab.purchaseDate')">
|
||||||
<div class="select-style" v-if="!tabView">
|
<div class="select-style" v-if="!tabView">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
size="small"
|
size="small"
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
<div class="asset-sub-title">{{$t('asset.createAssetTab.dc')}}</div>
|
<div class="asset-sub-title">{{$t('asset.createAssetTab.dc')}}</div>
|
||||||
<div class="line-100 asset-line"></div>
|
<div class="line-100 asset-line"></div>
|
||||||
<!------------------------------------------IDC---------------------------------------------->
|
<!------------------------------------------IDC---------------------------------------------->
|
||||||
<el-form-item :label="this.$t('asset.createAssetTab.dcName')" class="right-box-form-content" prop="idcId">
|
<el-form-item :label="$t('asset.createAssetTab.dcName')" class="right-box-form-content" prop="idcId">
|
||||||
<template v-if="!tabView">
|
<template v-if="!tabView">
|
||||||
<!-- <el-select popper-class="asset-dropdown" size="mini" v-model="assetData.idcId" clearable @change="getSingleIDCData" class="right-box-row-with-btn" placeholder="">-->
|
<!-- <el-select popper-class="asset-dropdown" size="mini" v-model="assetData.idcId" clearable @change="getSingleIDCData" class="right-box-row-with-btn" placeholder="">-->
|
||||||
<el-select popper-class="asset-dropdown" size="small" v-model="assetData.idcId" clearable @change="getSingleIDCData" placeholder="">
|
<el-select popper-class="asset-dropdown" size="small" v-model="assetData.idcId" clearable @change="getSingleIDCData" placeholder="">
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
tooltip-effect="light"
|
tooltip-effect="light"
|
||||||
:height="mainTableHeight"
|
:height="mainTableHeight"
|
||||||
v-scrollBar:el-table
|
v-scrollBar:el-table
|
||||||
|
:cell-class-name="messageStyle"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="false"
|
:resizable="false"
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
:label="item.label"
|
:label="item.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
min-width="110px"
|
min-width="110px"
|
||||||
|
|
||||||
>
|
>
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<div v-if="item.prop == 'option'" class="content-right-options">
|
<div v-if="item.prop == 'option'" class="content-right-options">
|
||||||
@@ -70,7 +72,6 @@
|
|||||||
@click="viewAlertType(scope.row['type'],scope.row[item.prop].id)">{{scope.row[item.prop].host}}</span>
|
@click="viewAlertType(scope.row['type'],scope.row[item.prop].id)">{{scope.row[item.prop].host}}</span>
|
||||||
<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 == 'alertNum'">
|
<template v-else-if="item.prop == 'alertNum'">
|
||||||
<span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum}}</span>
|
<span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum}}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -91,8 +92,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<alert-message-box v-if="showSubList" @listResize="listResize" :show-sub-list="showSubList" :from="'alertRule'" :subResizeShow="subResizeShow" :obj="alertRuleForMessage" :isFullScreen="isFullScreen"
|
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="alertRuleForMessage" :isFullScreen="isFullScreen" :from="'alertRule'" :targetTab="targetTab" :detail="ruleDetail"
|
||||||
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen"></alert-message-box>
|
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen" @listResize="listResize" ></bottom-box>
|
||||||
|
<!--<alert-message-box v-if="showSubList" @listResize="listResize" :show-sub-list="showSubList" :from="'alertRule'" :subResizeShow="subResizeShow" :obj="alertRuleForMessage" :isFullScreen="isFullScreen"
|
||||||
|
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen"></alert-message-box>-->
|
||||||
</div>
|
</div>
|
||||||
<alert-config-box :parentAlertRule="alertRule" @reload="getTableData" ref="alertConfigBox"></alert-config-box>
|
<alert-config-box :parentAlertRule="alertRule" @reload="getTableData" ref="alertConfigBox"></alert-config-box>
|
||||||
<project-box :project="viewProjectData" ref="projectBox" @reload="getTableData"></project-box>
|
<project-box :project="viewProjectData" ref="projectBox" @reload="getTableData"></project-box>
|
||||||
@@ -118,12 +121,17 @@
|
|||||||
name: "alert-config",
|
name: "alert-config",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
/*二级列表相关*/
|
||||||
|
ruleDetail: {},
|
||||||
|
targetTab: '', //展示二级列表中的哪个页签
|
||||||
showElementSet: false, //控制自定义列的弹框
|
showElementSet: false, //控制自定义列的弹框
|
||||||
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
||||||
mainResizeShow: true, //dom高度改变时部分内容是否展示
|
mainResizeShow: true, //dom高度改变时部分内容是否展示
|
||||||
subResizeShow: true,
|
subResizeShow: true,
|
||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
showSubList: false, //是否展示二级列表
|
showSubList: false, //是否展示二级列表
|
||||||
|
alertRuleForMessage: {}, //传给alertMessage上滑框的对象
|
||||||
|
|
||||||
tableId: 'alertRuleTable', //需要分页的table的id,用于记录每页数量
|
tableId: 'alertRuleTable', //需要分页的table的id,用于记录每页数量
|
||||||
showTopBtn: false,
|
showTopBtn: false,
|
||||||
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
||||||
@@ -172,7 +180,6 @@
|
|||||||
description: '',
|
description: '',
|
||||||
receiver: '',
|
receiver: '',
|
||||||
},
|
},
|
||||||
alertRuleForMessage: {}, //传给alertMessage上滑框的对象
|
|
||||||
tablelable: [],
|
tablelable: [],
|
||||||
dropCol: [],
|
dropCol: [],
|
||||||
pageObj: {
|
pageObj: {
|
||||||
@@ -219,11 +226,6 @@
|
|||||||
prop: 'alertName',
|
prop: 'alertName',
|
||||||
show: true,
|
show: true,
|
||||||
width: 120
|
width: 120
|
||||||
}, {
|
|
||||||
label: this.$t("alert.config.alertNum"),
|
|
||||||
prop: 'alertNum',
|
|
||||||
show: true,
|
|
||||||
width: 120
|
|
||||||
}, {
|
}, {
|
||||||
label: this.$t("alert.config.expr"),
|
label: this.$t("alert.config.expr"),
|
||||||
prop: 'expr',
|
prop: 'expr',
|
||||||
@@ -249,6 +251,11 @@
|
|||||||
label: this.$t('alert.description'),
|
label: this.$t('alert.description'),
|
||||||
prop: 'description',
|
prop: 'description',
|
||||||
show: true,
|
show: true,
|
||||||
|
}, {
|
||||||
|
label: this.$t("alert.message"),
|
||||||
|
prop: 'alertNum',
|
||||||
|
show: true,
|
||||||
|
width: 90
|
||||||
}, /*{
|
}, /*{
|
||||||
label: this.$t('alert.config.receiver'),
|
label: this.$t('alert.config.receiver'),
|
||||||
prop: 'receiver',
|
prop: 'receiver',
|
||||||
@@ -270,6 +277,7 @@
|
|||||||
queryMessage(alertRule) {
|
queryMessage(alertRule) {
|
||||||
this.alertRuleForMessage = alertRule;
|
this.alertRuleForMessage = alertRule;
|
||||||
this.showSubList = true;
|
this.showSubList = true;
|
||||||
|
this.targetTab = 'alertMessage';
|
||||||
},
|
},
|
||||||
// 鼠标拖动二级列表
|
// 鼠标拖动二级列表
|
||||||
listResize(e) {
|
listResize(e) {
|
||||||
@@ -405,10 +413,20 @@
|
|||||||
this.$refs.alertConfigBox.show(true, true);
|
this.$refs.alertConfigBox.show(true, true);
|
||||||
},
|
},
|
||||||
detail: function (u) {
|
detail: function (u) {
|
||||||
this.alertRule = Object.assign({}, u);
|
this.alertRuleForMessage = Object.assign({}, u);
|
||||||
this.$refs.alertConfigBox.show(true, false);
|
this.targetTab = "detail";
|
||||||
|
this.showSubList = true;
|
||||||
|
},
|
||||||
|
messageStyle(e) {
|
||||||
|
if (e.columnIndex == 8) {
|
||||||
|
if (e.row.alertNum > 0) {
|
||||||
|
return 'has-message';
|
||||||
|
} else {
|
||||||
|
return 'has-no-message';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
},
|
},
|
||||||
|
|
||||||
getTableData: function () {
|
getTableData: function () {
|
||||||
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
||||||
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
||||||
@@ -536,7 +554,35 @@
|
|||||||
this.$refs.projectBox.show(false, false);
|
this.$refs.projectBox.show(false, false);
|
||||||
this.$refs.moduleBox.show(false, false);
|
this.$refs.moduleBox.show(false, false);
|
||||||
this.viewAsset = false;
|
this.viewAsset = false;
|
||||||
}
|
},
|
||||||
|
convertToDetail(obj) {
|
||||||
|
let detail = [];
|
||||||
|
detail.push({label: this.$t("alert.alertName"), value: obj.alertName});
|
||||||
|
detail.push({label: this.$t("alert.config.expr"), value: obj.expr});
|
||||||
|
let type = "";
|
||||||
|
for (let i = 0; i < this.typeData.length; i++) {
|
||||||
|
if (obj.type == this.typeData[i].key) {
|
||||||
|
type = this.typeData[i].value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detail.push({label: this.$t("alert.list.type"), value: type});
|
||||||
|
let link = "";
|
||||||
|
if (obj.type == 1 || obj.type == 2) {
|
||||||
|
link = obj.linkObject.name;
|
||||||
|
} else if (obj.type == 3) {
|
||||||
|
link = obj.linkObject.host;
|
||||||
|
}
|
||||||
|
detail.push({label: this.$t("alert.config.link"), value: link});
|
||||||
|
detail.push({label: this.$t("alert.config.for"), value: obj.last});
|
||||||
|
let severity = this.severityData.filter((item, index) => {
|
||||||
|
return obj.severity == item.key;
|
||||||
|
})[0].value;
|
||||||
|
detail.push({label: this.$t("alert.severity"), value: severity});
|
||||||
|
detail.push({label: this.$t("alert.description"), value: obj.description});
|
||||||
|
detail.push({label: this.$t("alert.message"), value: obj.alertNum});
|
||||||
|
return detail;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
showSubList(n) {
|
showSubList(n) {
|
||||||
@@ -579,7 +625,13 @@
|
|||||||
}
|
}
|
||||||
}, 210);
|
}, 210);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
alertRuleForMessage: {
|
||||||
|
deep: true,
|
||||||
|
handler(n) {
|
||||||
|
this.ruleDetail = this.convertToDetail(n);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
window.onresize = null;
|
window.onresize = null;
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
<span>{{scope.row.idc.tel}}</span>
|
<span>{{scope.row.idc.tel}}</span>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="item.prop == 'option'">
|
<template v-if="item.prop == 'option'">
|
||||||
<span :title="$t('overall.view')" @click.stop="tagShow('showView',scope.row.id)" class="content-right-option" :id="'asset-detail-'+scope.row.id"><i
|
<span :title="$t('overall.view')" @click.stop="tagShow('showView',scope.row)" class="content-right-option" :id="'asset-detail-'+scope.row.id"><i
|
||||||
class="el-icon-view"></i>
|
class="el-icon-view"></i>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -187,14 +187,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
<button class="to-top" v-show="showTopBtn" @click="$toTop"><i class="nz-icon nz-icon-top"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<alert-message-box v-if="showSubList" @listResize="listResize" :show-sub-list="showSubList" :from="'asset'" :subResizeShow="subResizeShow" :obj="alertMsgAsset" :isFullScreen="isFullScreen"
|
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="alertMsgAsset" :isFullScreen="isFullScreen" :from="'asset'" :targetTab="targetTab" :detail="assetDetail"
|
||||||
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen"></alert-message-box>
|
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen" @listResize="listResize" ></bottom-box>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--<asset-add-unit :add-unit-show='addUnitShow' @refreshData="flushData" ref="assetAddUnit"
|
|
||||||
@sendStateData="tabControl"></asset-add-unit>
|
|
||||||
<asset-edit-unit :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
|
||||||
ref="assetEditUnit"></asset-edit-unit>-->
|
|
||||||
<asset-box :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
<asset-box :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
||||||
ref="assetEditUnit"></asset-box>
|
ref="assetEditUnit"></asset-box>
|
||||||
<element-set
|
<element-set
|
||||||
@@ -223,6 +219,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
/*二级页面相关*/
|
||||||
|
assetDetail: [], //asset详情
|
||||||
alertMsgAsset: {}, //告警信息对应的asset对象
|
alertMsgAsset: {}, //告警信息对应的asset对象
|
||||||
showElementSet: false, //控制自定义列的弹框
|
showElementSet: false, //控制自定义列的弹框
|
||||||
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
||||||
@@ -231,6 +229,8 @@
|
|||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
||||||
showSubList: false, //是否展示二级列表
|
showSubList: false, //是否展示二级列表
|
||||||
|
targetTab: '', //展示二级列表中的哪个页签
|
||||||
|
|
||||||
showElementSet: false, //自定义列弹框是否显示
|
showElementSet: false, //自定义列弹框是否显示
|
||||||
tableId: 'assetTable', //需要分页的table的id,用于记录每页数量
|
tableId: 'assetTable', //需要分页的table的id,用于记录每页数量
|
||||||
searchMsg: { //给搜索框子组件传递的信息
|
searchMsg: { //给搜索框子组件传递的信息
|
||||||
@@ -487,7 +487,13 @@
|
|||||||
}
|
}
|
||||||
}, 210);
|
}, 210);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
alertMsgAsset: {
|
||||||
|
deep: true,
|
||||||
|
handler(n) {
|
||||||
|
this.assetDetail = this.convertToDetail(n);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 鼠标拖动二级列表
|
// 鼠标拖动二级列表
|
||||||
@@ -651,16 +657,6 @@
|
|||||||
this.$store.commit('setHeaderTable', data);
|
this.$store.commit('setHeaderTable', data);
|
||||||
this.tablelable = data;
|
this.tablelable = data;
|
||||||
},
|
},
|
||||||
ssss(id, sn) {
|
|
||||||
let routeData = this.$router.resolve({
|
|
||||||
name: "terminal",
|
|
||||||
query: {
|
|
||||||
id: id,
|
|
||||||
host: sn
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.open(routeData.href);
|
|
||||||
},
|
|
||||||
cli(id,host,accounts){
|
cli(id,host,accounts){
|
||||||
let port = '';
|
let port = '';
|
||||||
let accountId = '';
|
let accountId = '';
|
||||||
@@ -678,6 +674,7 @@
|
|||||||
//this.$refs.webSsh.show(id,host,accountId,port);
|
//this.$refs.webSsh.show(id,host,accountId,port);
|
||||||
},
|
},
|
||||||
jumpToAlertMsg(asset) {
|
jumpToAlertMsg(asset) {
|
||||||
|
this.targetTab = 'alertMessage';
|
||||||
this.alertMsgAsset = JSON.parse(JSON.stringify(asset));
|
this.alertMsgAsset = JSON.parse(JSON.stringify(asset));
|
||||||
this.showSubList = true;
|
this.showSubList = true;
|
||||||
},
|
},
|
||||||
@@ -808,9 +805,12 @@
|
|||||||
this.$refs['assetEditUnit'].getAssetData(id)
|
this.$refs['assetEditUnit'].getAssetData(id)
|
||||||
}
|
}
|
||||||
if (data === 'showView') {
|
if (data === 'showView') {
|
||||||
this.editUnitShow = true
|
this.alertMsgAsset = Object.assign({}, id);
|
||||||
|
this.targetTab = "detail";
|
||||||
|
this.showSubList = true;
|
||||||
|
/*this.editUnitShow = true
|
||||||
this.$refs['assetEditUnit'].getAssetData(id)
|
this.$refs['assetEditUnit'].getAssetData(id)
|
||||||
this.$refs['assetEditUnit'].tabView = true
|
this.$refs['assetEditUnit'].tabView = true*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editing() {
|
editing() {
|
||||||
@@ -898,6 +898,45 @@
|
|||||||
}
|
}
|
||||||
this.getAssetData();
|
this.getAssetData();
|
||||||
},
|
},
|
||||||
|
convertToDetail(obj) {
|
||||||
|
let detail = [];
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.sn"), value: obj.sn});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.host"), value: obj.host});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.state"), value: obj.state == 1 ? this.$t('asset.createAssetTab.inStock'): this.$t('asset.createAssetTab.notInStock')});
|
||||||
|
detail.push({label: this.$t("asset.tableTitle.modules"), value: obj.endpointNum});
|
||||||
|
detail.push({label: this.$t("asset.tableTitle.alerts"), value: obj.alertNum});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.assetType"), value: obj.model.type.value});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.vendorModel"), value: obj.model.vendor.value + " " + obj.model.name});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.assetType"), value: obj.model.type.value});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.purchaseDate"), value: obj.purchaseDate});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.dcName"), value: obj.idc ? obj.idc.name : ""});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.idc ? obj.idc.location : ""});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.principal"), value: obj.idc ? this.getPrincipalName(obj.idc.principal) : ""});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.idc ? obj.idc.location : ""});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.tel"), value: obj.idc ? obj.idc.tel : ""});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.cabinet"), value: obj.cabinet ? obj.cabinet.name : ""});
|
||||||
|
detail.push({label: this.$t("asset.editAssetTab.uSize"), value: obj.cabinet ? obj.cabinet.uSize : ""});
|
||||||
|
detail.push({label: this.$t("asset.editAssetTab.remark"), value: obj.idc ? obj.idc.remark : ""});
|
||||||
|
if (obj.accounts.length > 0) {
|
||||||
|
let account = obj.accounts[0];
|
||||||
|
if (account.protocol == 'SSH') {
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.protocol"), value: 'SSH'});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.account"), value: account.user});
|
||||||
|
let loginType = "";
|
||||||
|
if (account.authType == 1) {
|
||||||
|
loginType = this.$t('asset.createAssetTab.password');
|
||||||
|
} else if (account.authType == 2) {
|
||||||
|
loginType = this.$t('asset.createAssetTab.ssh');
|
||||||
|
}
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.loginType"), value: loginType});
|
||||||
|
} else if (account.protocol == 'TELNET') {
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.protocol"), value: 'TELNET'});
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.account"), value: account.user});
|
||||||
|
}
|
||||||
|
detail.push({label: this.$t("asset.createAssetTab.port"), value: account.port});
|
||||||
|
}
|
||||||
|
return detail;
|
||||||
|
},
|
||||||
formatPingTime:function(str){
|
formatPingTime:function(str){
|
||||||
if(!str || str == ''){
|
if(!str || str == ''){
|
||||||
return this.$t('asset.assetStatPre')+this.$t('asset.assetStatDown');
|
return this.$t('asset.assetStatPre')+this.$t('asset.assetStatDown');
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="content-right">
|
<div class="content-right">
|
||||||
<div class="main-list" :class="{'main-list-with-sub': showSubList}">
|
<div class="main-list" :class="{'main-list-with-sub': showSubList}">
|
||||||
<div class="top-tools" v-show="mainResizeShow">
|
<div class="top-tools" v-show="mainResizeShow">
|
||||||
<div class="top-tool-main-right margin-r-20" :class="{'top-tool-main-right-to-left': showSubList}">
|
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': showSubList}">
|
||||||
<div class="top-tool-search">
|
<div class="top-tool-search">
|
||||||
<search-input ref="searchInput" :searchMsg="searchMsg" @search="search" :inTransform="inTransform"></search-input>
|
<search-input ref="searchInput" :searchMsg="searchMsg" @search="search" :inTransform="inTransform"></search-input>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -157,13 +157,17 @@
|
|||||||
name: "dc",
|
name: "dc",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
/*二级列表相关*/
|
||||||
targetTab: '', //展示二级列表中的哪个页签
|
targetTab: '', //展示二级列表中的哪个页签
|
||||||
showElementSet: false, //控制自定义列的弹框
|
|
||||||
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
||||||
mainResizeShow: true, //dom高度改变时部分内容是否展示
|
mainResizeShow: true, //dom高度改变时部分内容是否展示
|
||||||
subResizeShow: true,
|
subResizeShow: true,
|
||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
showSubList: false, //是否展示二级列表
|
showSubList: false, //是否展示二级列表
|
||||||
|
cabinetDc: {}, // 用在二级cabinet列表页里
|
||||||
|
dcDetail: [], //dc的详情信息,包含标题
|
||||||
|
|
||||||
|
showElementSet: false, //控制自定义列的弹框
|
||||||
tableId: 'dcTable', //需要分页的table的id,用于记录每页数量
|
tableId: 'dcTable', //需要分页的table的id,用于记录每页数量
|
||||||
showTopBtn: false,
|
showTopBtn: false,
|
||||||
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
||||||
@@ -178,8 +182,6 @@
|
|||||||
name: ''
|
name: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cabinetDc: {}, // 用在二级cabinet列表页里
|
|
||||||
dcDetail: [], //dc的详情信息,包含标题
|
|
||||||
pageObj: {
|
pageObj: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
@@ -403,7 +405,11 @@
|
|||||||
convertToDetail(obj) {
|
convertToDetail(obj) {
|
||||||
let detail = [];
|
let detail = [];
|
||||||
detail.push({label: this.$t("overall.name"), value: obj.name});
|
detail.push({label: this.$t("overall.name"), value: obj.name});
|
||||||
|
detail.push({label: this.$t("config.dc.area"), value: obj.area.name});
|
||||||
detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.location});
|
detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.location});
|
||||||
|
detail.push({label: this.$t("config.dc.cabinetNum"), value: obj.cabinetNum});
|
||||||
|
let assets = this.$t('overall.result.total') + ' ' + obj.assetStat.total + ',' + this.$t('asset.createAssetTab.inStock') + ' ' + obj.assetStat.inStock + ',' + this.$t('asset.createAssetTab.notInStock') + ' ' + obj.assetStat.outStock;
|
||||||
|
detail.push({label: this.$t("config.dc.assets"), value: assets});
|
||||||
detail.push({label: this.$t("asset.createAssetTab.tel"), value: obj.tel});
|
detail.push({label: this.$t("asset.createAssetTab.tel"), value: obj.tel});
|
||||||
let principal = '';
|
let principal = '';
|
||||||
for (let i = 0; i < this.userData.length; i++) {
|
for (let i = 0; i < this.userData.length; i++) {
|
||||||
@@ -413,7 +419,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
detail.push({label: this.$t("asset.createAssetTab.principal"), value: principal});
|
detail.push({label: this.$t("asset.createAssetTab.principal"), value: principal});
|
||||||
detail.push({label: this.$t("config.dc.area"), value: obj.area.name});
|
|
||||||
return detail;
|
return detail;
|
||||||
},
|
},
|
||||||
toAdd() {
|
toAdd() {
|
||||||
|
|||||||
@@ -458,6 +458,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
detail.push({label: this.$t('config.promServer.type'), value: type});
|
detail.push({label: this.$t('config.promServer.type'), value: type});
|
||||||
|
detail.push({
|
||||||
|
label: this.$t('asset.createAssetTab.state'),
|
||||||
|
value: obj.status,
|
||||||
|
type: 'status',
|
||||||
|
msg: this.$t('asset.assetStatPre')+(obj.checkTime ? obj.checkTime : this.$t('asset.assetStatDown'))
|
||||||
|
});
|
||||||
return detail;
|
return detail;
|
||||||
},
|
},
|
||||||
elementsetShow(s, e) {
|
elementsetShow(s, e) {
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ import cabinetConfigBox from "./components/common/popBox/cabinetConfig"; //面
|
|||||||
import dcBox from "./components/common/rightBox/dcBox"; //dc弹框
|
import dcBox from "./components/common/rightBox/dcBox"; //dc弹框
|
||||||
import modelBox from "./components/common/rightBox/modelBox"; //model弹框
|
import modelBox from "./components/common/rightBox/modelBox"; //model弹框
|
||||||
import selectArea from "./components/common/popBox/selectArea"; //dc弹框
|
import selectArea from "./components/common/popBox/selectArea"; //dc弹框
|
||||||
import alertMessageBox from "./components/common/bottomBox/alertMessageBox"; //alertMessage上滑框
|
import bottomBox from "./components/common/bottomBox/bottomBox"; //上滑框
|
||||||
import dcBottomBox from "./components/common/bottomBox/dcBottomBox"; //机柜上滑框
|
|
||||||
import bottomBox from "./components/common/bottomBox/bottomBox"; //机柜上滑框
|
|
||||||
import "perfect-scrollbar/css/perfect-scrollbar.css";
|
import "perfect-scrollbar/css/perfect-scrollbar.css";
|
||||||
import loading from "./components/common/loading";
|
import loading from "./components/common/loading";
|
||||||
import mibBox from "./components/common/rightBox/mibBox";
|
import mibBox from "./components/common/rightBox/mibBox";
|
||||||
@@ -62,8 +60,6 @@ Vue.component("dc-box", dcBox);
|
|||||||
Vue.component("model-box", modelBox);
|
Vue.component("model-box", modelBox);
|
||||||
Vue.component("select-area", selectArea);
|
Vue.component("select-area", selectArea);
|
||||||
Vue.component('loading',loading);
|
Vue.component('loading',loading);
|
||||||
Vue.component('alert-message-box', alertMessageBox);
|
|
||||||
Vue.component('dc-bottom-box', dcBottomBox);
|
|
||||||
Vue.component('bottom-box', bottomBox);
|
Vue.component('bottom-box', bottomBox);
|
||||||
Vue.component('mib-box',mibBox);
|
Vue.component('mib-box',mibBox);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ export const clickoutside = {
|
|||||||
if (el.contains(e.target)) {
|
if (el.contains(e.target)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
//console.info(e)
|
|
||||||
let flag = true;
|
let flag = true;
|
||||||
top: for (let i = 0; i < e.path.length; i++) {
|
top: for (let i = 0; i < e.path.length; i++) {
|
||||||
for (let j = 0; j < exceptClassName.length; j++) {
|
for (let j = 0; j < exceptClassName.length; j++) {
|
||||||
@@ -113,29 +112,31 @@ export const scrollBar = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 启用x轴后不让原生滚动条出来作乱
|
// 启用x轴后不让原生滚动条出来作乱
|
||||||
vnode.context.$nextTick(() => {
|
if (el) {
|
||||||
if (arg === "xterm") {
|
vnode.context.$nextTick(() => {
|
||||||
el = el.querySelector(".xterm-viewport");
|
if (arg === "xterm") {
|
||||||
!el && console.warn("未发现className为xterm-viewport的dom");
|
el = el.querySelector(".xterm-viewport");
|
||||||
}
|
!el && console.warn("未发现className为xterm-viewport的dom");
|
||||||
el.classList.add("ps");
|
}
|
||||||
el.addEventListener("ps-scroll-y", () =>
|
el.classList.add("ps");
|
||||||
el.classList.add("ps")
|
el.addEventListener("ps-scroll-y", () =>
|
||||||
);
|
el.classList.add("ps")
|
||||||
el.addEventListener("ps-scroll-x", () =>
|
);
|
||||||
el.classList.add("ps")
|
el.addEventListener("ps-scroll-x", () =>
|
||||||
);
|
el.classList.add("ps")
|
||||||
//el上挂一份属性
|
);
|
||||||
el_scrollBar(el);
|
//el上挂一份属性
|
||||||
});
|
el_scrollBar(el);
|
||||||
|
});
|
||||||
|
|
||||||
const rules = ["fixed", "absolute", "relative"];
|
const rules = ["fixed", "absolute", "relative"];
|
||||||
if (!rules.includes(window.getComputedStyle(el, null).position)) {
|
if (!rules.includes(window.getComputedStyle(el, null).position)) {
|
||||||
console.error(
|
console.error(
|
||||||
`perfect-scrollbar所在的容器的position属性必须是以下之一:${rules.join(
|
`perfect-scrollbar所在的容器的position属性必须是以下之一:${rules.join(
|
||||||
"、"
|
"、"
|
||||||
)}`
|
)}`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentUpdated(el, binding, vnode, oldVnode) {
|
componentUpdated(el, binding, vnode, oldVnode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user