alert message 修改

This commit is contained in:
songjingcheng
2021-05-08 15:04:17 +08:00
parent 6ea0507f84
commit 04c6b8c0a5
2 changed files with 12 additions and 34 deletions

View File

@@ -106,37 +106,12 @@
fixed="right"> fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div> <div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items"> <div slot-scope="scope" class="table-operation-items">
<!-- <button class="table-operation-item" @click="$refs.dataList.showBottomBox('operationLog',scope.row)"><i class="nz-icon nz-icon-view1"></i></button> --> <button class="table-operation-item" @click="showBottomBox('detail',scope.row)"><i class="nz-icon nz-icon-view1"></i></button>
<div class="pointer" @click="detail(scope.row)"> <!-- <button class="table-operation-item" @click="detail(scope.row)"><i class="nz-icon nz-icon-view1"></i></button> -->
<span v-if="!scope.row.current || scope.row.alertRule.buildIn == 1">-</span>
<el-popover v-else placement="right" trigger="hover">
<div slot="reference">
<span :id="'alert-list-detail-'+scope.row.id" class="content-right-option" style="margin:0"><i class="nz-icon nz-icon-view1"></i></span>
<span>{{formatThreshold(scope.row.current[1],scope.row.alertRule.unit)}}</span>
</div>
<div>{{$unixTimeParseToString(scope.row.current[0])}}</div>
</el-popover>
</div>
<button class="table-operation-item" @click="toDeleteMessage(scope.row)"><i class="nz-icon nz-icon-delete"></i></button> <button class="table-operation-item" @click="toDeleteMessage(scope.row)"><i class="nz-icon nz-icon-delete"></i></button>
</div> </div>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog class="line-chart-block-modal nz-dialog endpoint-dialog"
:title="$t('overall.detail')"
:visible.sync="graphShow"
width="90%"
id="viewGraphDialog"
@close="dialogClose"
:modal-append-to-body='false'>
<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>
</div> </div>
</template> </template>
@@ -149,14 +124,12 @@ import chartDataFormat from '../../../charts/chartDataFormat'
import alertRuleInfo from '../../alert/alertRuleInfo' import alertRuleInfo from '../../alert/alertRuleInfo'
import alertLabel from '../../alert/alertLabel' import alertLabel from '../../alert/alertLabel'
import { calcDurationByStringTimeB } from '../../js/tools' import { calcDurationByStringTimeB } from '../../js/tools'
import chart from "../../../page/dashboard/overview/chart"
export default { export default {
name: 'alertMessageTable', name: 'alertMessageTable',
components: { components: {
nzAlertTag, nzAlertTag,
alertRuleInfo: alertRuleInfo, alertRuleInfo: alertRuleInfo,
alertLabel: alertLabel, alertLabel: alertLabel,
chart:chart,
}, },
props: { props: {
nowTime: { nowTime: {

View File

@@ -39,6 +39,7 @@
@del="del" @del="del"
@edit="edit" @edit="edit"
@orderBy="tableDataSort" @orderBy="tableDataSort"
@queryMessage='queryMessage'
@reload="getTableData" @reload="getTableData"
@selectionChange="selectionChange" @selectionChange="selectionChange"
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }" @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"
@@ -268,6 +269,12 @@ export default {
this.queryChartDate() this.queryChartDate()
}) })
}, },
queryMessage (alertMessage) {
if (!this.hasButton('alertMessage_view')) {
return
}
this.$refs.dataList.showBottomBox(alertMessage, alertRule)
},
queryChartDate () { queryChartDate () {
const $temp = this const $temp = this
const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h') const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h')
@@ -393,13 +400,11 @@ export default {
delete this.searchLabel.endAt delete this.searchLabel.endAt
} }
this.tools.loading = true this.tools.loading = true
if(ind===0){ if(ind===0 || ind ===1 || ind ===2){
console.log(1);
delete this.searchLabel.startAt delete this.searchLabel.startAt
delete this.searchLabel.endAt delete this.searchLabel.endAt
} }
this.$get(this.url+'?state='+ii, this.searchLabel).then(response => { this.$get(this.url+'?state='+ii, this.searchLabel).then(response => {
console.log(this.searchLabel)
this.tools.loading = false this.tools.loading = false
if (response.code == 200) { if (response.code == 200) {
this.nowTime = this.utcTimeToTimezoneStr(response.time) this.nowTime = this.utcTimeToTimezoneStr(response.time)