Merge branch 'dev-3.5' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.6

# Conflicts:
#	nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss
#	nezha-fronted/src/components/common/mixin/routerPathParams.js
This commit is contained in:
zhangyu
2022-11-15 13:57:25 +08:00
61 changed files with 810 additions and 4093 deletions

View File

@@ -15,7 +15,7 @@
>
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-slot>
<alertRuleEvalLogTable
<recordRuleEvalLogTable
ref="dataTable"
:orderByFa="'id'"
v-my-loading="tools.loading"
@@ -30,7 +30,7 @@
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"></alertRuleEvalLogTable>
@selectionChange="selectionChange"></recordRuleEvalLogTable>
</template>
<template v-slot:pagination>
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
@@ -42,7 +42,7 @@
import dataListMixin from '@/components/common/mixin/dataList'
import subDataListMixin from '@/components/common/mixin/subDataList'
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import alertRuleEvalLogTable from '@/components/common/table/alert/alertRuleEvalLogTable'
import recordRuleEvalLogTable from '@/components/common/table/settings/recordRuleEvalLogTable'
import detailViewRightMixin from '@/components/common/mixin/detailViewRightMixin'
export default {
@@ -50,7 +50,7 @@ export default {
mixins: [dataListMixin, subDataListMixin, detailViewRightMixin],
components: {
nzBottomDataList,
alertRuleEvalLogTable
recordRuleEvalLogTable
},
props: {
obj: Object,

View File

@@ -1,7 +1,6 @@
<template>
<nz-bottom-data-list
:showTitle='showTitle'
:tableId="tableId"
:obj='obj'
:layout="[]"
:tabs="tabs"
@@ -51,10 +50,10 @@ export default {
calcTime () {
return function (time) {
if (this.obj.startTime) {
const startTime = new Date(this.obj.startTime).getTime()
const startTime = new Date(this.utcTimeToTimezoneStr(this.obj.startTime)).getTime()
if (startTime) {
const thisTime = startTime + time
return this.dateFormat(thisTime)
return this.momentTz(thisTime)
}
}
return '-'

View File

@@ -6,7 +6,6 @@
:tabs="tabs"
:targetTab="targetTab"
@changeTab="changeTab"
:tableId="tableId"
:title="'Session ID'"
>
<template v-slot:title><span :title="obj.uuid.substring(0, 8).toUpperCase()">{{obj.uuid.substring(0, 8).toUpperCase()}}</span></template>

View File

@@ -2,7 +2,6 @@
<nz-bottom-data-list
:showTitle='showTitle'
:obj='obj'
:tableId="tableId"
:layout="[]"
:tabs="tabs"
:targetTab="targetTab"

View File

@@ -28,7 +28,7 @@
:terminaLogTab="true"
@del="del"
@edit="edit"
@orderBy="tableDataSort"
@tableDataSort="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"></assetVsysTable>
</template>
@@ -65,7 +65,9 @@ export default {
searchLabelList: []
},
searchLabel: {},
tableData: []
tableData: [],
orderBy: { order: 'ascending', prop: 'id' }
}
},
methods: {
@@ -75,7 +77,7 @@ export default {
this.$get(this.url, this.searchLabel).then(response => {
this.tools.loading = false
if (response.code === 200) {
this.tableData = response.data.list
this.tableData = this.filterShowData(response.data.list, this.orderBy)
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
this.$nextTick(() => {
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
@@ -84,6 +86,22 @@ export default {
}
}
})
},
// 数据排序
tableDataSort (item) {
this.orderBy = item
this.filterShowData(this.tableData, item)
},
filterShowData (source, ord) {
let orderBy = null
orderBy = ord
if (orderBy.order === 'ascending') {
source = source.sort(this.$tableSet.asce(orderBy.prop))
}
if (orderBy.order === 'descending') {
source = source.sort(this.$tableSet.desc(orderBy.prop))
}
return source
}
}
}