2019-12-06 17:36:33 +08:00
|
|
|
|
<style scoped>
|
2020-01-08 10:17:31 +08:00
|
|
|
|
.list {
|
2019-12-06 17:36:33 +08:00
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
2020-07-28 14:26:51 +08:00
|
|
|
|
/deep/ .too-long-split{
|
2020-07-27 18:26:44 +08:00
|
|
|
|
cursor: pointer;
|
2020-07-27 19:02:30 +08:00
|
|
|
|
vertical-align: bottom;
|
|
|
|
|
|
}
|
|
|
|
|
|
span.el-tooltip {
|
|
|
|
|
|
display: inline-block;
|
2020-07-27 18:26:44 +08:00
|
|
|
|
}
|
2020-07-29 14:46:35 +08:00
|
|
|
|
/deep/.top-tools{
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
}
|
2019-12-06 17:36:33 +08:00
|
|
|
|
</style>
|
2020-05-15 17:15:13 +08:00
|
|
|
|
<style lang="scss">
|
2020-05-31 22:33:16 +08:00
|
|
|
|
@import '../../charts/chart';
|
2020-05-15 17:15:13 +08:00
|
|
|
|
</style>
|
2019-12-06 17:36:33 +08:00
|
|
|
|
<template>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
<div class="list">
|
2020-08-04 21:53:06 +08:00
|
|
|
|
<div class="main-list main-and-sub-transition" :class="{'main-list-with-sub': bottomBox.showSubList}">
|
|
|
|
|
|
<div class="top-tools" v-show="bottomBox.mainResizeShow">
|
|
|
|
|
|
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': bottomBox.showSubList}">
|
2020-10-12 18:15:24 +08:00
|
|
|
|
<pick-time :refresh-data-func="getAlertList" v-model="searchTime" :use-chart-unit="false" :use-refresh="false" :default-pick="12" :show-empty="true"></pick-time>
|
2020-12-15 21:13:07 +08:00
|
|
|
|
<div class="top-tool-search margin-r-20">
|
2020-08-04 21:53:06 +08:00
|
|
|
|
<search-input :searchMsg="searchMsg" @search="search" :bottomBox.inTransform="bottomBox.inTransform"></search-input>
|
2020-07-29 11:09:06 +08:00
|
|
|
|
</div>
|
2020-12-08 21:53:37 +08:00
|
|
|
|
<button :title="$t('overall.exportExcelLower')" @click="showExportDialog" type="button" v-has="'message_export'"
|
2020-11-30 14:34:26 +08:00
|
|
|
|
class="nz-btn nz-btn-size-normal nz-btn-style-light" id="alert-list-export">
|
2020-09-11 16:34:28 +08:00
|
|
|
|
<i class="nz-icon nz-icon-download1"></i>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</button>
|
2021-02-04 11:21:00 +08:00
|
|
|
|
<delete-button :clickFunction="openDelMessageBox" :delete-objs="batchDeleteObjs" @after="getAlertList" api="alert/message" v-has="'message_delete'" id="alert-msg-batch-delete"></delete-button>
|
2020-07-29 11:09:06 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<div class="pagination-top pagination-top-hide display-none"></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<alertMessageTable
|
2021-02-07 18:19:59 +08:00
|
|
|
|
id="alert-msg-table"
|
2020-10-29 19:11:46 +08:00
|
|
|
|
ref="alertMessageTable"
|
2020-08-02 22:43:53 +08:00
|
|
|
|
:tableData="tableData"
|
2020-08-04 21:53:06 +08:00
|
|
|
|
:loading="tools.loading"
|
2020-08-02 22:43:53 +08:00
|
|
|
|
:tableHeight="mainTableHeight"
|
|
|
|
|
|
:tableId="tableId"
|
|
|
|
|
|
@tableDataSort="tableDataSort"
|
2020-12-08 21:53:37 +08:00
|
|
|
|
:from="$CONSTANTS.fromRoute.message"
|
2020-08-02 22:43:53 +08:00
|
|
|
|
@deleteMessage="deleteMessage"
|
2020-10-29 19:11:46 +08:00
|
|
|
|
@select-change="(selection)=>{this.batchDeleteObjs=selection}"
|
2021-03-05 11:37:44 +08:00
|
|
|
|
:now-time="nowTime"
|
2020-08-02 22:43:53 +08:00
|
|
|
|
></alertMessageTable>
|
2020-08-04 21:53:06 +08:00
|
|
|
|
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
|
2020-08-02 22:43:53 +08:00
|
|
|
|
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
|
2020-07-29 11:09:06 +08:00
|
|
|
|
</div>
|
2020-08-02 22:43:53 +08:00
|
|
|
|
</div>
|
2020-08-04 21:53:06 +08:00
|
|
|
|
<bottom-box v-if="bottomBox.showSubList" :show-sub-list="bottomBox.showSubList" :sub-resize-show="bottomBox.subResizeShow" :is-full-screen="bottomBox.isFullScreen" :from="'alertMessage'" :target-tab.sync="bottomBox.targetTab" :detailList="tabDetailList"
|
|
|
|
|
|
@closeSubList="bottomBox.showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen" @listResize="listResize" :tabList="tabList"></bottom-box>
|
2020-04-09 12:19:21 +08:00
|
|
|
|
<!--导出-->
|
2020-04-08 20:27:07 +08:00
|
|
|
|
<div class="export-xlsx">
|
|
|
|
|
|
<el-dialog :visible.sync="importBox.show" :title="importBox.title" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-dialog">
|
|
|
|
|
|
<div class="upload-body">
|
2021-02-04 11:21:00 +08:00
|
|
|
|
<button @click="exportCur" class="el-button el-button--default el-button--small" id="alert-msg-exportcur">
|
2020-04-08 20:27:07 +08:00
|
|
|
|
<span>{{$t('overall.exportCur')}}</span>
|
|
|
|
|
|
</button>
|
2021-02-04 11:21:00 +08:00
|
|
|
|
<button @click="exportAll" class="el-button el-button--default el-button--small" id="alert-msg-exportall">
|
2020-04-08 20:27:07 +08:00
|
|
|
|
<span>{{$t('overall.exportAll')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
2020-05-12 19:59:08 +08:00
|
|
|
|
<!--export-->
|
2020-08-06 10:10:49 +08:00
|
|
|
|
<!--<div class="export-xlsx">-->
|
|
|
|
|
|
<!--<el-dialog :visible.sync="deleteBox.show" :title="$t('overall.delete')" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-message">-->
|
|
|
|
|
|
<!--<div class="upload-body">-->
|
|
|
|
|
|
<!--<el-input type="textarea" :placeholder="$t('alert.description')" v-model="deleteBox.remark"></el-input>-->
|
|
|
|
|
|
<!--<div style="text-align: right; margin-top: 10px;">-->
|
|
|
|
|
|
<!--<button @click="closeDialog" class="el-button el-button--default el-button--small">-->
|
|
|
|
|
|
<!--<span>{{$t('tip.no')}}</span>-->
|
|
|
|
|
|
<!--</button>-->
|
|
|
|
|
|
<!--<button @click="deleteMessage" class="el-button el-button--default el-button--small el-button--primary">-->
|
|
|
|
|
|
<!--<span>{{$t('tip.yes')}}</span>-->
|
|
|
|
|
|
<!--</button>-->
|
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
|
<!--</el-dialog>-->
|
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
|
<!--<el-dialog class="line-chart-block-modal nz-dialog endpoint-dialog"-->
|
|
|
|
|
|
<!--:title="$t('overall.detail')"-->
|
|
|
|
|
|
<!--:visible.sync="graphShow"-->
|
|
|
|
|
|
<!--width="90%"-->
|
|
|
|
|
|
<!--id="viewGraphDialog"-->
|
|
|
|
|
|
<!--@close="dialogClose">-->
|
|
|
|
|
|
<!--<div slot="title">-->
|
|
|
|
|
|
<!--{{$t("project.endpoint.dialogTitle")}}-->
|
|
|
|
|
|
<!--<div class="float-right panel-calendar dialog-tool" style="display: flex">-->
|
|
|
|
|
|
<!--<pick-time :refresh-data-func="queryChartDate" :use-refresh="false" :use-chart-unit="false" v-model="searchTime" style="height: 28px;" @unitChange="chartUnitChange"></pick-time>-->
|
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
|
<!--<chart ref="messageChart" name="alertMessageChart" :unit="chartUnit"></chart>-->
|
|
|
|
|
|
<!--</el-dialog>-->
|
2020-01-19 18:31:18 +08:00
|
|
|
|
</div>
|
2019-12-06 17:36:33 +08:00
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2020-04-06 22:11:25 +08:00
|
|
|
|
import bus from '../../../libs/bus';
|
2020-05-12 19:59:08 +08:00
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
import nzAlertTag from './nzAlertTag';
|
|
|
|
|
|
import chart from '../../page/dashboard/overview/chart'
|
2020-10-12 18:15:24 +08:00
|
|
|
|
import pickTime from "../../common/pickTime";
|
2020-06-04 19:14:04 +08:00
|
|
|
|
import chartDataFormat from "../../charts/chartDataFormat";
|
2020-07-27 18:26:44 +08:00
|
|
|
|
import alertRuleInfo from '../../common/alert/alertRuleInfo'
|
|
|
|
|
|
import alertLabel from '../../common/alert/alertLabel'
|
2020-08-04 21:53:06 +08:00
|
|
|
|
import alertMessageTable from '../../common/alert/alertMessageTable.vue'
|
2020-10-29 19:11:46 +08:00
|
|
|
|
import deleteButton from "../../common/deleteButton";
|
2020-01-19 18:31:18 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: "alertList",
|
2020-05-11 16:11:06 +08:00
|
|
|
|
components: {
|
2020-05-12 19:59:08 +08:00
|
|
|
|
'nz-alert-tag': nzAlertTag,
|
2020-07-27 18:26:44 +08:00
|
|
|
|
'chart': chart,
|
|
|
|
|
|
'alertRuleInfo':alertRuleInfo,
|
|
|
|
|
|
'alertLabel':alertLabel,
|
2020-07-29 14:46:35 +08:00
|
|
|
|
'alertMessageTable':alertMessageTable,
|
2020-10-12 18:15:24 +08:00
|
|
|
|
'pick-time':pickTime,
|
2020-10-29 19:11:46 +08:00
|
|
|
|
'delete-button':deleteButton,
|
2020-05-11 16:11:06 +08:00
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
/*二级列表相关*/
|
|
|
|
|
|
mainTableHeight: this.$tableHeight.normal, //主列表table高度
|
2020-08-04 21:53:06 +08:00
|
|
|
|
/*二级页面相关*/
|
|
|
|
|
|
bottomBox: {
|
|
|
|
|
|
tabList: [], //二级列表的标签
|
|
|
|
|
|
tabDetailList: [], //多个详情
|
|
|
|
|
|
mainResizeShow: true, //dom高度改变时是否展示|隐藏
|
|
|
|
|
|
subResizeShow: true,
|
|
|
|
|
|
isFullScreen: false, //全屏状态
|
|
|
|
|
|
showSubList: false, //是否显示二级列表
|
|
|
|
|
|
targetTab: '', //显示二级列表中的哪个页签
|
|
|
|
|
|
inTransform: false, //搜索框相关,搜索条件下拉框是否在transform里
|
|
|
|
|
|
},
|
|
|
|
|
|
/*工具参数*/
|
|
|
|
|
|
tools: {
|
|
|
|
|
|
loading: false, //是否显示table加载动画
|
|
|
|
|
|
toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性
|
|
|
|
|
|
tableHover: false, //控制滚动条和top按钮同时出现
|
|
|
|
|
|
showTopBtn: false, //显示To top按钮
|
|
|
|
|
|
showCustomTableTitle: false, //自定义列弹框是否显示
|
|
|
|
|
|
customTableTitle: [], //自定义列工具的数据
|
|
|
|
|
|
},
|
2020-04-21 18:00:21 +08:00
|
|
|
|
|
2020-04-08 20:27:07 +08:00
|
|
|
|
//导出相关
|
2020-04-09 12:19:21 +08:00
|
|
|
|
importBox: {show: false, title:this.$t('overall.exportExcel')},
|
2020-04-09 16:48:23 +08:00
|
|
|
|
deleteBox: {show: false, ids: "", remark: '', state: 2},
|
2020-10-29 19:11:46 +08:00
|
|
|
|
batchDeleteObjs:[],
|
2020-05-12 19:59:08 +08:00
|
|
|
|
//详情相关
|
|
|
|
|
|
graphShow: false,
|
|
|
|
|
|
chartDatas: [],
|
2020-05-15 15:48:28 +08:00
|
|
|
|
sameLabels: ['instance','module','project','asset','endpoint','datacenter'],
|
2020-05-12 19:59:08 +08:00
|
|
|
|
legend: [],
|
2020-10-12 18:15:24 +08:00
|
|
|
|
searchTime: [],
|
2020-11-30 14:34:26 +08:00
|
|
|
|
searchTimeSelect: bus.getTimezontDateRange(),
|
2020-05-15 17:24:32 +08:00
|
|
|
|
currentMsg: {},
|
2020-05-15 18:07:20 +08:00
|
|
|
|
chartUnit: 5,
|
2020-05-12 19:59:08 +08:00
|
|
|
|
|
2020-03-13 12:20:02 +08:00
|
|
|
|
tableId: 'alertListTable', //需要分页的table的id,用于记录每页数量
|
2020-01-19 18:31:18 +08:00
|
|
|
|
pageObj: {
|
|
|
|
|
|
pageNo: 1,
|
2020-12-17 11:07:57 +08:00
|
|
|
|
pageSize: this.$CONSTANTS.defaultPageSize,
|
2020-03-20 21:05:31 +08:00
|
|
|
|
total: 0
|
2020-01-19 18:31:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
tableTitle: [
|
|
|
|
|
|
{
|
2020-04-24 11:38:57 +08:00
|
|
|
|
label: 'ID',
|
|
|
|
|
|
prop: 'id',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
width: 80
|
|
|
|
|
|
}, {
|
2020-01-19 18:31:18 +08:00
|
|
|
|
label: this.$t("alert.alertName"),
|
|
|
|
|
|
prop: 'alertRule',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
width: 180
|
|
|
|
|
|
}, {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
label: this.$t("alert.list.labels"),
|
|
|
|
|
|
prop: 'labels',
|
|
|
|
|
|
show: true,
|
2020-07-29 11:09:06 +08:00
|
|
|
|
width:350,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("alert.severity"),
|
|
|
|
|
|
prop: 'severity',
|
|
|
|
|
|
show: true,
|
2020-07-27 18:26:44 +08:00
|
|
|
|
width: 100,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('alert.summary'),
|
|
|
|
|
|
prop: 'summary',
|
2020-07-27 18:26:44 +08:00
|
|
|
|
show: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('alert.description'),
|
|
|
|
|
|
prop: 'description',
|
2020-07-27 18:26:44 +08:00
|
|
|
|
show: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('alert.list.state'),
|
|
|
|
|
|
prop: 'state',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("alert.startAt"),
|
|
|
|
|
|
prop: 'startAt',
|
|
|
|
|
|
show: true,
|
2020-07-27 18:26:44 +08:00
|
|
|
|
width: 150
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('alert.endAt'),
|
|
|
|
|
|
prop: 'endAt',
|
|
|
|
|
|
show: true,
|
2020-07-27 18:26:44 +08:00
|
|
|
|
width: 150
|
2020-05-12 19:59:08 +08:00
|
|
|
|
}, {
|
2020-06-21 17:13:25 +08:00
|
|
|
|
label: this.$t('overall.value'),
|
2020-05-12 19:59:08 +08:00
|
|
|
|
prop: 'current',
|
2020-07-27 18:26:44 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
width: 100
|
2020-05-12 19:59:08 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('overall.option'),
|
|
|
|
|
|
prop: 'option',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
width: 90
|
|
|
|
|
|
}
|
2020-01-19 18:31:18 +08:00
|
|
|
|
],
|
|
|
|
|
|
searchMsg: { //给搜索框子组件传递的信息
|
|
|
|
|
|
zheze_none: true,
|
|
|
|
|
|
searchLabelList: [{
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id: 1,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
name: this.$t('alert.alertName'),
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'alertName',
|
|
|
|
|
|
disabled: false
|
2020-04-17 21:27:20 +08:00
|
|
|
|
}, /*{
|
2020-01-19 18:31:18 +08:00
|
|
|
|
id: 3,
|
|
|
|
|
|
name: this.$t('alert.list.type'),
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
label: 'alertType',
|
|
|
|
|
|
disabled: false
|
2020-04-17 21:27:20 +08:00
|
|
|
|
}, */{
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id: 20,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
name: this.$t('alert.severity'),
|
|
|
|
|
|
type: 'selectString',
|
|
|
|
|
|
label: 'severity',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
}, {
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id: 21,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
name: this.$t('asset.asset'),
|
|
|
|
|
|
type: 'asset',
|
|
|
|
|
|
label: 'asset',
|
2020-04-17 21:27:20 +08:00
|
|
|
|
disabled: false
|
2020-04-20 21:27:32 +08:00
|
|
|
|
}, {
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id:22,
|
2020-04-20 21:27:32 +08:00
|
|
|
|
name: this.$t('project.project.project'),
|
|
|
|
|
|
type: 'project',
|
|
|
|
|
|
label: 'project',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
}, {
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id:23,
|
2020-04-20 21:27:32 +08:00
|
|
|
|
name: this.$t('project.module.module'),
|
|
|
|
|
|
type: 'module',
|
|
|
|
|
|
label: 'module',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
}, {
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id:24,
|
2020-04-20 21:27:32 +08:00
|
|
|
|
name: this.$t('project.endpoint.endpoint'),
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'endpointId',
|
|
|
|
|
|
disabled: false
|
2020-03-31 17:22:15 +08:00
|
|
|
|
}, {
|
2020-05-19 18:22:22 +08:00
|
|
|
|
id:25,
|
2020-03-31 17:22:15 +08:00
|
|
|
|
name: this.$t('alert.list.state'),
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
label: 'alertMessageState',
|
|
|
|
|
|
disabled: false
|
2020-10-30 14:09:11 +08:00
|
|
|
|
},{
|
|
|
|
|
|
id:26,
|
|
|
|
|
|
name: this.$t('alert.list.id'),
|
|
|
|
|
|
type: 'id',
|
|
|
|
|
|
label: 'id',
|
|
|
|
|
|
disabled: false
|
2020-11-21 16:12:02 +08:00
|
|
|
|
},{
|
|
|
|
|
|
id:27,
|
|
|
|
|
|
name: this.$t('config.dc.dc'),
|
|
|
|
|
|
type: 'idc',
|
|
|
|
|
|
label: 'idcId',
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
readonly: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
|
|
|
searchLabel: { //搜索参数
|
2019-12-17 17:17:30 +08:00
|
|
|
|
|
|
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
tableData: [],
|
2020-08-03 10:47:04 +08:00
|
|
|
|
requestIndex:0,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
viewAssetState: false,
|
2021-03-05 11:37:44 +08:00
|
|
|
|
nowTime:'',
|
2020-01-08 10:17:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-04-06 22:11:25 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
tagType() {
|
|
|
|
|
|
return (key) => {
|
|
|
|
|
|
if (key == 'asset' || key == 'module' || key == 'project' || key == 'datacenter' || key == 'endpoint') {
|
2020-05-11 16:11:06 +08:00
|
|
|
|
return "normal";
|
2020-04-06 22:11:25 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
return "info";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-04-09 17:00:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
tagValue() {
|
|
|
|
|
|
return (key, value) => {
|
|
|
|
|
|
if (key == 'type') {
|
|
|
|
|
|
if (value == 1) {
|
|
|
|
|
|
value = this.$t("project.project.project");
|
|
|
|
|
|
} else if (value == 2) {
|
|
|
|
|
|
value = this.$t("module.module.module");
|
|
|
|
|
|
} else if (value == 3) {
|
|
|
|
|
|
value = this.$t("asset.asset");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return key + ":" + value;
|
|
|
|
|
|
}
|
2020-04-06 22:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
methods: {
|
2020-07-22 19:04:30 +08:00
|
|
|
|
labelsSort:function(obj){
|
|
|
|
|
|
let buildIn=['asset','endpoint','module','project','datacenter']
|
|
|
|
|
|
let labels=JSON.parse(JSON.stringify(obj));
|
|
|
|
|
|
let result=[];
|
|
|
|
|
|
for(let key of buildIn){
|
|
|
|
|
|
if(key in labels){
|
|
|
|
|
|
result.push({label:key,value:labels[key]})
|
|
|
|
|
|
delete labels[key]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Object.keys(labels).sort().forEach(key=>{
|
|
|
|
|
|
result.push({label:key,value:labels[key]})
|
|
|
|
|
|
})
|
|
|
|
|
|
return result;
|
|
|
|
|
|
},
|
2020-10-12 18:15:24 +08:00
|
|
|
|
|
2020-12-15 21:13:07 +08:00
|
|
|
|
getAlertList() {
|
|
|
|
|
|
if (!this.hasButton('message_view')) {
|
|
|
|
|
|
this.$message.error(this.$t("tip.noAccess"));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
|
|
|
|
|
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
2020-10-12 18:15:24 +08:00
|
|
|
|
if(this.searchTime&& this.searchTime.length>1){
|
2020-10-16 19:26:50 +08:00
|
|
|
|
this.$set(this.searchLabel, "startAt", this.timezoneToUtcTimeStr(this.searchTime[0]));
|
|
|
|
|
|
this.$set(this.searchLabel, "endAt", this.timezoneToUtcTimeStr(this.searchTime[1]));
|
2020-10-12 18:15:24 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
delete this.searchLabel.startAt
|
|
|
|
|
|
delete this.searchLabel.endAt
|
|
|
|
|
|
}
|
2020-08-04 21:53:06 +08:00
|
|
|
|
this.tools.loading = true;
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.$get('alert/message', this.searchLabel).then(response => {
|
2020-08-04 21:53:06 +08:00
|
|
|
|
this.tools.loading = false;
|
2020-01-19 18:31:18 +08:00
|
|
|
|
if (response.code == 200) {
|
2021-03-16 17:54:05 +08:00
|
|
|
|
this.nowTime=this.utcTimeToTimezoneStr(response.time);
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.tableData = response.data.list;
|
2020-11-25 11:53:37 +08:00
|
|
|
|
let axiosAll=[]
|
2020-09-28 16:27:03 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.tableData.forEach((item) => {
|
|
|
|
|
|
item.labels = JSON.parse(item.labels);
|
2020-10-15 10:03:08 +08:00
|
|
|
|
if(item.alertRule.buildIn != 1){
|
|
|
|
|
|
let paramStr = JSON.stringify(this.promQueryParamConvert(item));
|
2020-11-25 11:53:37 +08:00
|
|
|
|
axiosAll.push(axios.get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length-1).replace(/\+/g, "%2B").replace(/ /g, "%20").replace(/\\/g, "")))
|
|
|
|
|
|
}else{
|
|
|
|
|
|
axiosAll.push('')
|
2020-10-15 10:03:08 +08:00
|
|
|
|
}
|
2020-05-12 19:59:08 +08:00
|
|
|
|
});
|
2020-11-25 11:53:37 +08:00
|
|
|
|
axios.all(axiosAll).then(res=>{
|
|
|
|
|
|
res.forEach((item,index)=>{
|
|
|
|
|
|
let current = [];
|
|
|
|
|
|
let response2 = item.data;
|
|
|
|
|
|
if (response2.data && response2.data.result && response2.data.result.length > 0) {
|
|
|
|
|
|
current = response2.data.result[0].value.map((item, i) => {
|
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
|
return bus.computeTimezone(item);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return parseFloat(item).toFixed(2);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
current=[null,null]
|
|
|
|
|
|
}
|
|
|
|
|
|
this.tableData[index].current=current;
|
|
|
|
|
|
})
|
2020-12-01 10:55:39 +08:00
|
|
|
|
this.$set(this.tableData,[...this.tableData])
|
2020-11-25 11:53:37 +08:00
|
|
|
|
})
|
2020-04-06 22:11:25 +08:00
|
|
|
|
});
|
2020-05-28 17:32:23 +08:00
|
|
|
|
this.deleteBox.ids='';
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.pageObj.total = response.data.total;
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}
|
2020-04-06 22:11:25 +08:00
|
|
|
|
});
|
2020-01-19 18:31:18 +08:00
|
|
|
|
},
|
2020-06-05 17:45:31 +08:00
|
|
|
|
promQueryParamConvert(obj){
|
2020-11-16 17:57:48 +08:00
|
|
|
|
let r = "(" + obj.alertRule.expr + ")";
|
2020-11-25 11:53:37 +08:00
|
|
|
|
let intoLabels=false
|
2020-11-16 17:57:48 +08:00
|
|
|
|
if (Object.keys(obj.labels).length > 0) {
|
2020-11-25 11:53:37 +08:00
|
|
|
|
r += function(){
|
|
|
|
|
|
let group =" and " + "(group({";
|
2020-11-16 17:57:48 +08:00
|
|
|
|
let by = " by (";
|
|
|
|
|
|
|
|
|
|
|
|
for (let k in obj.labels) {
|
|
|
|
|
|
if (k != 'alertname' && k != 'severity') {
|
2020-11-25 11:53:37 +08:00
|
|
|
|
intoLabels=true;
|
2020-11-16 17:57:48 +08:00
|
|
|
|
group += k;
|
|
|
|
|
|
group += "=";
|
|
|
|
|
|
group += ("'" + obj.labels[k] + "',");
|
|
|
|
|
|
by += k;
|
|
|
|
|
|
by += ","
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-11-25 11:53:37 +08:00
|
|
|
|
if(intoLabels){
|
|
|
|
|
|
group = group.substring(0, group.length-1);
|
|
|
|
|
|
by = by.substring(0, by.length-1);
|
|
|
|
|
|
group += "})";
|
|
|
|
|
|
by += ")";
|
|
|
|
|
|
return group + by + ")";
|
|
|
|
|
|
}else{
|
|
|
|
|
|
return ''
|
|
|
|
|
|
}
|
2020-11-16 17:57:48 +08:00
|
|
|
|
|
|
|
|
|
|
}();
|
|
|
|
|
|
}
|
|
|
|
|
|
return r;
|
|
|
|
|
|
/*let result="(" + obj.alertRule.expr + ")";
|
2020-06-05 17:45:31 +08:00
|
|
|
|
if(obj.labels){
|
|
|
|
|
|
if(obj.labels.alertname){
|
|
|
|
|
|
delete obj.labels.alertname;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(obj.labels.severity){
|
|
|
|
|
|
delete obj.labels.severity;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(Object.keys(obj.labels).length>0){
|
|
|
|
|
|
result+=" and ("+function(){
|
|
|
|
|
|
let q = "{";
|
|
|
|
|
|
for (let k in obj.labels) {
|
2020-05-13 18:23:10 +08:00
|
|
|
|
q += k;
|
|
|
|
|
|
q += "=";
|
|
|
|
|
|
q += ("'" + obj.labels[k] + "',");
|
2020-06-05 17:45:31 +08:00
|
|
|
|
};
|
|
|
|
|
|
if (q.length > 1) {
|
|
|
|
|
|
q = q.substring(0, q.length-1);
|
2020-05-13 18:23:10 +08:00
|
|
|
|
}
|
2020-06-05 17:45:31 +08:00
|
|
|
|
q += "}";
|
|
|
|
|
|
return q;
|
|
|
|
|
|
}() + ")";
|
|
|
|
|
|
}
|
2020-11-16 17:57:48 +08:00
|
|
|
|
return result;*/
|
2020-05-12 19:59:08 +08:00
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
//asset弹框控制
|
|
|
|
|
|
tabControl(data) {
|
|
|
|
|
|
if (data === 'close') {
|
|
|
|
|
|
this.viewAssetState = false
|
|
|
|
|
|
this.$refs['assetEditUnit'].tabView = false
|
2019-12-17 17:17:30 +08:00
|
|
|
|
}
|
2020-01-19 18:31:18 +08:00
|
|
|
|
},
|
2020-10-29 19:11:46 +08:00
|
|
|
|
openDelMessageBox:function(){
|
|
|
|
|
|
if(this.batchDeleteObjs.length<1) return;
|
|
|
|
|
|
if(this.$refs.alertMessageTable){
|
|
|
|
|
|
this.$refs.alertMessageTable.toDeleteMessage(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-05-21 19:59:17 +08:00
|
|
|
|
toDeleteMessage(obj) {
|
|
|
|
|
|
if (obj) {
|
|
|
|
|
|
this.deleteBox.ids = obj.id + "";
|
|
|
|
|
|
}
|
2020-04-09 12:19:21 +08:00
|
|
|
|
this.deleteBox.show = true;
|
|
|
|
|
|
},
|
2020-08-06 10:10:49 +08:00
|
|
|
|
deleteMessage(deleteBox,cb) {
|
2020-07-29 14:46:35 +08:00
|
|
|
|
this.$put("alert/message", deleteBox).then(res => {
|
2020-04-09 12:19:21 +08:00
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
|
|
|
|
|
this.getAlertList();
|
2020-08-06 10:10:49 +08:00
|
|
|
|
cb();
|
2020-04-09 12:19:21 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
selectChange(s) {
|
2020-04-09 16:48:23 +08:00
|
|
|
|
let ids = [];
|
|
|
|
|
|
this.deleteBox.ids = "";
|
2020-04-09 12:19:21 +08:00
|
|
|
|
s.forEach(item => {
|
2020-04-09 16:48:23 +08:00
|
|
|
|
ids.push(item.id);
|
2020-04-09 12:19:21 +08:00
|
|
|
|
});
|
2020-04-09 16:48:23 +08:00
|
|
|
|
this.deleteBox.ids = ids.join(",");
|
2020-04-09 12:19:21 +08:00
|
|
|
|
},
|
2020-04-08 20:27:07 +08:00
|
|
|
|
showExportDialog() {
|
|
|
|
|
|
this.importBox.show = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
closeDialog() {
|
|
|
|
|
|
this.importBox.show = false;
|
2020-04-09 12:19:21 +08:00
|
|
|
|
this.deleteBox.show = false;
|
2020-04-08 20:27:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
exportCur:function(){
|
2020-10-14 16:14:52 +08:00
|
|
|
|
let searchLabel=Object.assign({},this.searchLabel)
|
|
|
|
|
|
this.$set(searchLabel,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
|
|
|
|
|
|
this.exportExcel(searchLabel);
|
2020-04-08 20:27:07 +08:00
|
|
|
|
this.closeDialog();
|
|
|
|
|
|
},
|
|
|
|
|
|
exportAll:function(){
|
2020-04-09 12:19:21 +08:00
|
|
|
|
let temp = JSON.parse(JSON.stringify(this.searchLabel));
|
|
|
|
|
|
temp.pageSize = -1;
|
2020-10-14 16:14:52 +08:00
|
|
|
|
this.$set(temp,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
|
2020-04-09 12:19:21 +08:00
|
|
|
|
this.exportExcel(temp);
|
2020-04-08 20:27:07 +08:00
|
|
|
|
this.closeDialog();
|
|
|
|
|
|
},
|
2020-04-13 17:10:42 +08:00
|
|
|
|
getTimeString:function(){
|
|
|
|
|
|
let split='-';
|
|
|
|
|
|
let date=new Date();
|
|
|
|
|
|
let year=date.getFullYear();
|
|
|
|
|
|
let month=this.formatNum(date.getMonth()+1);
|
|
|
|
|
|
let day=this.formatNum(date.getDate());
|
|
|
|
|
|
let hours=this.formatNum(date.getHours());
|
|
|
|
|
|
let minutes=this.formatNum(date.getMinutes());
|
|
|
|
|
|
let seconds=this.formatNum(date.getSeconds());
|
|
|
|
|
|
return year + split + month + split + day + ' ' + hours + split + minutes + split + seconds;
|
|
|
|
|
|
},
|
|
|
|
|
|
formatNum:function(num){
|
|
|
|
|
|
return num>9?num:'0'+num;
|
|
|
|
|
|
},
|
2020-04-08 20:27:07 +08:00
|
|
|
|
exportExcel:function(params){
|
2020-04-21 22:39:07 +08:00
|
|
|
|
for (let item in params) {
|
|
|
|
|
|
if (params[item]) {
|
|
|
|
|
|
if (item == "alertMessageState") {
|
|
|
|
|
|
this.$set(params, "state", params[item]);
|
|
|
|
|
|
} else{
|
|
|
|
|
|
this.$set(params, item, params[item]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-04-08 20:27:07 +08:00
|
|
|
|
let temp=this;
|
|
|
|
|
|
if(!params){
|
|
|
|
|
|
params=temp.params;
|
|
|
|
|
|
}
|
|
|
|
|
|
axios.get("alert/message/export", {responseType:'blob', params: params}).then(res=>{
|
|
|
|
|
|
let fileName = 'alert-message-'+temp.getTimeString()+'.xlsx';
|
|
|
|
|
|
if(window.navigator.msSaveOrOpenBlob){
|
|
|
|
|
|
// 兼容ie11
|
|
|
|
|
|
let blobObject = new Blob([res.data]);
|
|
|
|
|
|
window.navigator.msSaveOrOpenBlob(blobObject, fileName);
|
|
|
|
|
|
}else{
|
|
|
|
|
|
let url = URL.createObjectURL(new Blob([res.data]));
|
|
|
|
|
|
let a = document.createElement('a');
|
|
|
|
|
|
document.body.appendChild(a); //此处增加了将创建的添加到body当中
|
|
|
|
|
|
a.href = url;
|
|
|
|
|
|
a.download = fileName;
|
|
|
|
|
|
a.target = '_blank';
|
|
|
|
|
|
a.click();
|
|
|
|
|
|
a.remove(); //将a标签移除
|
|
|
|
|
|
}
|
2020-11-20 21:11:42 +08:00
|
|
|
|
},error=>{
|
|
|
|
|
|
let $self=this;
|
|
|
|
|
|
let reader = new FileReader();
|
|
|
|
|
|
reader.onload = function(event){
|
|
|
|
|
|
let responseText = reader.result;
|
|
|
|
|
|
let exception = JSON.parse(responseText);
|
|
|
|
|
|
if(exception.message){
|
|
|
|
|
|
$self.$message.error(exception.message)
|
|
|
|
|
|
}else{
|
|
|
|
|
|
console.error(error)
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
reader.readAsText(error.response.data);
|
2020-04-08 20:27:07 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2020-04-06 22:11:25 +08:00
|
|
|
|
// 全屏
|
|
|
|
|
|
fullScreen() {
|
2020-08-04 21:53:06 +08:00
|
|
|
|
let vm = this;
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.$bottomBoxWindow.fullScreen(vm);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 退出全屏
|
|
|
|
|
|
exitFullScreen() {
|
2020-08-04 21:53:06 +08:00
|
|
|
|
let vm = this;
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.$bottomBoxWindow.exitFullScreen(vm);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 鼠标拖动二级列表
|
|
|
|
|
|
listResize(e) {
|
2020-08-04 21:53:06 +08:00
|
|
|
|
let vm = this;
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.$bottomBoxWindow.listResize(vm, e);
|
|
|
|
|
|
},
|
2020-04-15 15:27:02 +08:00
|
|
|
|
showTagDetail(data, key) {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
let open = false;
|
|
|
|
|
|
if (key == "asset" || key == "project" || key == "module" || key == "endpoint" || key == "datacenter") {
|
|
|
|
|
|
open = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (open) {
|
|
|
|
|
|
let labelList = [];
|
|
|
|
|
|
let detailList = [];
|
2020-04-15 15:27:02 +08:00
|
|
|
|
for (let item in data) {
|
|
|
|
|
|
if (item == "asset" || item == "project" || item == "module" || item == "endpoint" || item == "dc") {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
labelList.push(item);
|
2020-04-15 15:27:02 +08:00
|
|
|
|
detailList.push(data[item]);
|
2020-04-06 22:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-08-04 21:53:06 +08:00
|
|
|
|
this.bottomBox.showSubList = true;
|
2020-04-06 22:11:25 +08:00
|
|
|
|
this.tabList = labelList;
|
2020-04-15 15:27:02 +08:00
|
|
|
|
/*this.tabDetailList = detailList;
|
2020-08-04 21:53:06 +08:00
|
|
|
|
this.bottomBox.targetTab = key;*/
|
2020-04-06 22:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
labelsClassName(row) {
|
2020-05-11 16:11:06 +08:00
|
|
|
|
if (row.column.label == this.$t("alert.list.labels")) {
|
2020-04-06 22:11:25 +08:00
|
|
|
|
return "alert-message-list-labels";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
pageNo(val) {
|
|
|
|
|
|
this.pageObj.pageNo = val;
|
|
|
|
|
|
this.getAlertList();
|
|
|
|
|
|
},
|
|
|
|
|
|
pageSize(val) {
|
|
|
|
|
|
this.pageObj.pageSize = val;
|
2020-03-13 12:20:02 +08:00
|
|
|
|
localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val);
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.getAlertList();
|
|
|
|
|
|
},
|
2020-08-04 21:53:06 +08:00
|
|
|
|
search(searchObj) {
|
2020-07-15 18:32:25 +08:00
|
|
|
|
let orderBy='';
|
|
|
|
|
|
if(this.searchLabel.orderBy){
|
|
|
|
|
|
orderBy=this.searchLabel.orderBy
|
|
|
|
|
|
}
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.searchLabel = {};
|
|
|
|
|
|
this.pageObj.pageNo = 1;
|
|
|
|
|
|
for (let item in searchObj) {
|
|
|
|
|
|
if (searchObj[item]) {
|
2020-04-17 21:27:20 +08:00
|
|
|
|
if (item == "alertMessageState") {
|
|
|
|
|
|
this.$set(this.searchLabel, "state", searchObj[item]);
|
2020-04-20 21:27:32 +08:00
|
|
|
|
} else{
|
2020-04-17 21:27:20 +08:00
|
|
|
|
this.$set(this.searchLabel, item, searchObj[item]);
|
|
|
|
|
|
}
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}
|
2020-01-06 19:03:38 +08:00
|
|
|
|
}
|
2020-07-15 18:32:25 +08:00
|
|
|
|
if(orderBy){
|
|
|
|
|
|
this.$set(this.searchLabel, 'orderBy', orderBy);
|
|
|
|
|
|
}
|
2020-11-17 09:05:43 +08:00
|
|
|
|
this.$refs.alertMessageTable.$refs.alertListTable.bodyWrapper.scrollTop = 0;
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.getAlertList();
|
|
|
|
|
|
},
|
|
|
|
|
|
fillProject: function (module) {
|
|
|
|
|
|
this.$get('project', {"id": module.projectId}).then(response => {
|
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
|
module.project = response.data.list[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
closeViews: function () {
|
|
|
|
|
|
this.$refs.alertConfigBox.show(false, false);
|
|
|
|
|
|
this.$refs.projectBox.show(false, false);
|
|
|
|
|
|
this.$refs.moduleBox.show(false, false);
|
|
|
|
|
|
this.viewAssetState = false;
|
2020-07-15 18:32:25 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 数据排序
|
|
|
|
|
|
tableDataSort(item){
|
|
|
|
|
|
let orderBy='';
|
|
|
|
|
|
if(item.order==='ascending'){
|
|
|
|
|
|
orderBy=item.prop;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(item.order==='descending'){
|
|
|
|
|
|
orderBy='-'+item.prop;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.pageObj.orderBy=orderBy;
|
|
|
|
|
|
this.$set(this.searchLabel, "orderBy", orderBy);
|
|
|
|
|
|
this.getAlertList();
|
2020-07-27 18:26:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
// label tooltip是否显示
|
|
|
|
|
|
labelToolTipDis(labelType){
|
|
|
|
|
|
switch(labelType){
|
|
|
|
|
|
case 'asset':
|
|
|
|
|
|
case 'module':
|
|
|
|
|
|
case 'project':
|
|
|
|
|
|
return false;
|
|
|
|
|
|
default: return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// alertNmae鼠标划入
|
|
|
|
|
|
alertMessagehover(item,index){
|
|
|
|
|
|
item.loading=true;
|
|
|
|
|
|
this.$set(this.tableData,index,item);
|
|
|
|
|
|
},
|
|
|
|
|
|
// label 鼠标划入
|
|
|
|
|
|
labelHover(item,index,type){
|
|
|
|
|
|
if(this.labelToolTipDis(type)){
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
item[type].loading=true;
|
|
|
|
|
|
this.$set(this.tableData,index,item);
|
2020-01-19 18:31:18 +08:00
|
|
|
|
}
|
2020-01-06 19:03:38 +08:00
|
|
|
|
},
|
2020-04-06 22:11:25 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
showSubList(n) {
|
|
|
|
|
|
this.$bottomBoxWindow.showSubListWatch(vm, n);
|
|
|
|
|
|
},
|
2020-12-29 15:38:04 +08:00
|
|
|
|
tableData: {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler(n) {
|
|
|
|
|
|
if (n.length === 0 && this.pageObj.pageNo > 1) {
|
|
|
|
|
|
this.pageNo(this.pageObj.pageNo-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-04-06 22:11:25 +08:00
|
|
|
|
},
|
2020-11-21 12:21:27 +08:00
|
|
|
|
created(){
|
|
|
|
|
|
//是否存在分页缓存
|
|
|
|
|
|
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);
|
|
|
|
|
|
if (pageSize != 'undefined' && pageSize != null) {
|
|
|
|
|
|
this.pageObj.pageSize = pageSize
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-19 18:31:18 +08:00
|
|
|
|
mounted() {
|
2020-08-04 21:53:06 +08:00
|
|
|
|
//初始化表头
|
|
|
|
|
|
this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)
|
|
|
|
|
|
? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path))
|
|
|
|
|
|
: this.tableTitle;
|
2020-10-30 15:54:47 +08:00
|
|
|
|
this.tableTitleReset(this.tableTitle,this.tools.customTableTitle);
|
2020-03-13 12:20:02 +08:00
|
|
|
|
//是否存在分页缓存
|
|
|
|
|
|
let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId);
|
2020-03-20 18:22:44 +08:00
|
|
|
|
if (pageSize != 'undefined' && pageSize != null) {
|
2020-03-13 12:20:02 +08:00
|
|
|
|
this.pageObj.pageSize = pageSize
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-01-19 18:31:18 +08:00
|
|
|
|
this.getAlertList();
|
2019-12-13 17:08:35 +08:00
|
|
|
|
}
|
2019-12-06 17:36:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|