NEZ-2781 fix:Alert Message 二级列表 查询时间不会动态变化

This commit is contained in:
zhangyu
2023-04-18 15:15:48 +08:00
parent 96ecc2efe8
commit 43f1e3544a
4 changed files with 16 additions and 6 deletions

View File

@@ -19,7 +19,7 @@
<el-select v-model="state" class="margin-r-10" size="small" value-key="value" :disabled="from === fromRoute.alertSilence" @change="getTableData" popper-class="right-box-select-top right-public-box-dropdown-top" style="width: 110px">
<el-option v-for="item in stateOptions" :key="item.value" :label="$t(item.label)" :value="item.value"></el-option>
</el-select>
<pick-time v-model="searchTimeHeader" :default-pick="10" :refresh-data-func="getTableData" :show-empty="true" :use-chart-unit="false" :use-refresh="false" :sign="sign"></pick-time>
<pick-time ref="pickTime" v-model="searchTimeHeader" :default-pick="10" :refresh-data-func="getTableData" :show-empty="true" :use-chart-unit="false" :use-refresh="false" :sign="sign"></pick-time>
</template>
<template v-slot>
<alertMessageTable
@@ -630,7 +630,8 @@ export default {
if (this.$refs.dataTable) {
this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0
}
this.getTableData()
// this.getTableData()
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.refresh()
},
fillProject (module) {
this.$get('project', { id: module.projectId }).then(response => {

View File

@@ -13,7 +13,7 @@
>
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-slot:top-tool-right>
<el-input v-model="matchContent" class="margin-r-10" placeholder="" size="small" @keyup.enter.native="queryLogData()">
<el-input v-model="matchContent" class="margin-r-10" placeholder="" size="small" @keyup.enter.native="dateChange()">
<el-select slot="prepend" v-model="matchSymbol" class="symbol-select" size="small" style="width: 60px;">
<el-option value="|=">
<span style="font-family: Inter-Regular">|=</span>
@@ -28,7 +28,7 @@
<span style="font-family: Inter-Regular">!~</span>
</el-option>
</el-select>
<button slot="suffix" class="search-icon-btn"><i class="el-icon-search" @click="queryLogData()"></i></button>
<button slot="suffix" class="search-icon-btn"><i class="el-icon-search" @click="dateChange()"></i></button>
</el-input>
<pick-time id="explore" ref="pickTime" v-model="filterTime" :refresh-data-func="queryLogData" :sign="sign" :use-chart-unit="false" :use-refresh="false">
<template slot="added-text">{{$t('overall.query')}}</template>
@@ -114,6 +114,9 @@ export default {
reader.readAsText(error.response.data)
})
},
dateChange () {
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.refresh()
},
queryLogData (limit = 100) { // log的chart和table是一个请求
this.loading = true
if (this.expressions.length > 0) {

View File

@@ -590,6 +590,10 @@ export default {
} else {
this.isPopoverDisabled = false
}
},
refresh () {
this.setSearchTime(this.nowTimeType.type, this.nowTimeType.value, this.searchTime)
this.$emit('change', this.searchTime)
}
},
watch: {
@@ -601,6 +605,7 @@ export default {
if (showTime) {
this.showTime = Object.assign({}, showTime)
this.searchTime = this.$parent.searchTime
this.nowTimeType = this.showTime
}
if (this.showEmpty && this.defaultPick === 12) {
this.searchTime = []

View File

@@ -18,7 +18,7 @@
<button id="asset-filter" :class="[dataListLayout.indexOf('clickSearch') > -1?'is-focus':'' ]" class="top-tool-btn margin-r-10" @click.stop="showClickSearch" :title="$t('dashboard.panel.chartForm.filter')">
<i class="nz-icon nz-icon-funnel"></i>
</button>
<pick-time v-model="searchTime" sign="message" :default-pick="10" :refresh-data-func="getTableData" :show-empty="true" :use-chart-unit="false" :use-refresh="false"></pick-time>
<pick-time ref="pickTime" v-model="searchTime" sign="message" :default-pick="10" :refresh-data-func="getTableData" :show-empty="true" :use-chart-unit="false" :use-refresh="false"></pick-time>
<button id="roles-add" v-has="'alertMessage_view'" :title="$t('overall.exportExcel')" class="top-tool-btn margin-r-10" type="button" @click="showExportDialog">
<i class="nz-icon-download1 nz-icon"></i>
</button>
@@ -1176,7 +1176,8 @@ export default {
if (this.$refs.dataTable) {
this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0
}
this.getTableData()
// this.getTableData()
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.refresh()
},
computeDistance (str) {
let width = 0