fix:alertMessage 添加 allTime

This commit is contained in:
zhangyu
2022-05-13 10:50:31 +08:00
parent bef3a05ba3
commit ab7fbbc1a2
4 changed files with 7 additions and 20 deletions

View File

@@ -351,7 +351,7 @@ export default {
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)
this.$set(this.searchLabel, 'state', this.state) this.$set(this.searchLabel, 'state', this.state)
if (this.searchTimeHeader && this.searchTimeHeader.length > 1) { if (this.searchTimeHeader && this.searchTimeHeader.length > 1 && this.searchTimeHeader[0] && this.searchTimeHeader[1]) {
this.$set(this.searchLabel, 'startAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[0])), 'YYYY-MM-DD HH:mm:ss')) this.$set(this.searchLabel, 'startAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[0])), 'YYYY-MM-DD HH:mm:ss'))
this.$set(this.searchLabel, 'endAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[1])), 'YYYY-MM-DD HH:mm:ss')) this.$set(this.searchLabel, 'endAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[1])), 'YYYY-MM-DD HH:mm:ss'))
} else { } else {

View File

@@ -449,7 +449,9 @@ export default {
this.isCustom = false this.isCustom = false
return false return false
} else { } else {
this.setSearchTime(val.type, val.value) if (val.id !== 12) {
this.setSearchTime(val.type, val.value)
}
const id = val.id const id = val.id
if (id === 0) { if (id === 0) {
@@ -484,7 +486,7 @@ export default {
this.isCustom = false this.isCustom = false
this.showDropdown() this.showDropdown()
if (this.showEmpty && id === 12) { if (this.showEmpty && id === 12) {
this.searchTime = [] this.searchTime = ['', '']
} }
this.$emit('change', this.searchTime) this.$emit('change', 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"> <button id="asset-filter" :class="[dataListLayout.indexOf('clickSearch') > -1?'is-focus':'' ]" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
<i class="nz-icon nz-icon-funnel"></i> <i class="nz-icon nz-icon-funnel"></i>
</button> </button>
<pick-time v-model="searchTime" sign="message" :default-pick="10" :refresh-data-func="getTableData" :show-empty="false" :use-chart-unit="false" :use-refresh="false"></pick-time> <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>
<button id="roles-add" v-has="'alertMessage_view'" :title="$t('overall.exportExcelLower')" class="top-tool-btn margin-r-10" <button id="roles-add" v-has="'alertMessage_view'" :title="$t('overall.exportExcelLower')" class="top-tool-btn margin-r-10"
type="button" @click="showExportDialog"> type="button" @click="showExportDialog">
<i class="nz-icon-download1 nz-icon"></i> <i class="nz-icon-download1 nz-icon"></i>
@@ -846,7 +846,7 @@ export default {
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)
this.$set(this.searchLabel, 'state', this.state) this.$set(this.searchLabel, 'state', this.state)
if (this.searchTime && this.searchTime.length > 1) { if (this.searchTime && this.searchTime.length > 1 && this.searchTime[0] && this.searchTime[1]) {
this.$set(this.searchLabel, 'startAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTime[0])), 'YYYY-MM-DD HH:mm:ss')) this.$set(this.searchLabel, 'startAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTime[0])), 'YYYY-MM-DD HH:mm:ss'))
this.$set(this.searchLabel, 'endAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTime[1])), 'YYYY-MM-DD HH:mm:ss')) this.$set(this.searchLabel, 'endAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTime[1])), 'YYYY-MM-DD HH:mm:ss'))
} else { } else {

View File

@@ -49,21 +49,6 @@
import chartList from '@/components/chart/chartList.vue' import chartList from '@/components/chart/chartList.vue'
import { loadI18n } from '@/components/common/i18n' import { loadI18n } from '@/components/common/i18n'
import i18nData from '@/entrance/exportHtml/i18nData' import i18nData from '@/entrance/exportHtml/i18nData'
window.dataJson = {
charts:
{ msg: 'success', code: 200, data: { pageSize: -1, list: [{ panelId: 683, groupId: 0, updateAt: 1652252320000, weight: 25, remark: '', type: 'group', buildIn: 0, unit: 2, updateBy: 1, param: { collapse: true }, children: [{ panelId: 683, groupId: 10351, updateAt: 1652249346000, weight: 24, remark: '', type: 'area', buildIn: 0, unit: 2, updateBy: 1, param: { stack: 1, legend: { values: [], show: true, placement: 'right' }, showHeader: true, link: '', thresholds: [{ color: '#e4a5ff', value: 1 }], thresholdShow: true, enable: { legend: true, thresholds: false, valueMapping: false }, valueMapping: [], nullType: 'null' }, children: [], datasource: 'metrics', elements: [{ expression: 'sum(nz_alert_nums) by (severity)', legend: '{{severity}}', type: 'expert', buildIn: 0, chartId: 10349, name: 'A', id: 16053, state: 1 }], name: 'metrics-test', x: 0, y: 0, id: 10349, panel: { name: 'export_test', id: 683 }, span: 9, height: 2, group: { name: 'group1', id: 10351 } }], datasource: 'misc', name: 'group1', x: 0, y: 36, id: 10351, panel: { weight: 27, pid: 0, type: 'dashboard', buildIn: 0, createBy: 1, name: 'export_test', id: 683, seq: '' }, span: 12, height: 1, group: { id: 0 } }, { panelId: 683, groupId: 0, updateAt: 1652252352000, weight: 26, remark: '', type: 'group', buildIn: 0, unit: 2, updateBy: 1, param: { collapse: true }, children: [{ panelId: 683, groupId: 10352, updateAt: 1652253135000, weight: 27, remark: '', type: 'stat', buildIn: 0, unit: 2, updateBy: 1, param: { legend: { values: [], show: true, placement: 'bottom' }, link: '', thresholds: [], system: 'asset', refer: 0, enable: { legend: true, thresholds: false, valueMapping: false }, datasource: [{ select: { type: 1, name: 'count', expr: 'count(1)' }, legend: '', sort: 'desc', type: 'asset', systemSelect: 'count', filter: [], name: 'System', limit: 100, systemGroup: ['asset_state'], group: [{ type: 2, name: 'asset_state', expr: 'state' }] }], valueMapping: [], text: 'value', nullType: 'null', statistics: 'last' }, children: [], datasource: 'system', name: 'system-test1', x: 0, y: 72, id: 10353, panel: { name: 'export_test', id: 683 }, span: 6, height: 4, group: { name: 'group2', id: 10352 } }], datasource: 'misc', name: 'group2', x: 0, y: 48, id: 10352, panel: { weight: 27, pid: 0, type: 'dashboard', buildIn: 0, createBy: 1, name: 'export_test', id: 683, seq: '' }, span: 12, height: 1, group: { id: 0 } }, { panelId: 683, groupId: 0, updateAt: 1652253135000, weight: 27, remark: '', type: 'stat', buildIn: 0, unit: 2, updateBy: 1, param: { legend: { values: [], show: true, placement: 'bottom' }, link: '', thresholds: [], system: 'datacenter', refer: 0, enable: { legend: true, thresholds: false, valueMapping: false }, datasource: [{ select: { type: 1, name: 'count', expr: 'count(1)' }, legend: '', sort: 'desc', type: 'module', systemSelect: 'count', filter: [], name: 'System', limit: 100, systemGroup: ['project'], group: [{ type: 2, name: 'project', expr: 'project' }] }], valueMapping: [], text: 'value', nullType: 'null', statistics: 'last' }, children: [], datasource: 'system', name: 'system-test4', x: 0, y: 72, id: 10355, panel: { weight: 27, pid: 0, type: 'dashboard', buildIn: 0, createBy: 1, name: 'export_test', id: 683, seq: '' }, span: 6, height: 4, group: { id: 0 } }, { panelId: 683, groupId: 0, updateAt: 1652252365000, weight: 28, remark: '', type: 'group', buildIn: 0, unit: 2, updateBy: 1, param: { collapse: true }, children: [{ panelId: 683, groupId: 10354, updateAt: 1652249445000, weight: 1, remark: '', type: 'log', buildIn: 0, unit: 2, updateBy: 1, param: { link: '', thresholds: [], enable: { legend: false, thresholds: false, valueMapping: false }, limit: 100, valueMapping: [] }, children: [], datasource: 'logs', elements: [{ expression: '{endpoint="NezhaLog-192.168.44.59"}', legend: '', type: 'expert', buildIn: 0, chartId: 10350, name: 'A', id: 16055, state: 1 }], name: 'logs-test', x: 3, y: 24, id: 10350, panel: { name: 'export_test', id: 683 }, span: 3, height: 3, group: { name: 'group3', id: 10354 } }], datasource: 'misc', name: 'group3', x: 0, y: 60, id: 10354, panel: { weight: 27, pid: 0, type: 'dashboard', buildIn: 0, createBy: 1, name: 'export_test', id: 683, seq: '' }, span: 12, height: 1, group: { id: 0 } }], total: 4, pages: 1, pageNo: 1 }, time: 1652343972177 },
start: 1652241021,
language: 'en',
chartsData: {
'10355_0': {
result:
[{ values: [[1652343972177, 28]], metric: { project: '7400', __name__: 'count' } }, { values: [[1652343972177, 27]], metric: { project: 'OLAP', __name__: 'count' } }, { values: [[1652343972177, 16]], metric: { project: 'Network', __name__: 'count' } }, { values: [[1652343972177, 8]], metric: { project: 'Common', __name__: 'count' } }, { values: [[1652343972177, 8]], metric: { project: 'Bifang-CM', __name__: 'count' } }, { values: [[1652343972177, 8]], metric: { project: '9140', __name__: 'count' } }, { values: [[1652343972177, 1]], metric: { project: 'TSG-9140', __name__: 'count' } }],
resultType: 'matrix'
}
},
end: 1652241321,
panel: { msg: 'success', code: 200, data: { weight: 27, pid: 0, type: 'dashboard', buildIn: 0, createBy: 1, name: 'export_test', id: 683, seq: '' }, time: 1652343971743 }
}
const dataJson = window.dataJson || {} const dataJson = window.dataJson || {}
export default { export default {
name: 'Entrance', name: 'Entrance',