CN-1457 fix: 实体列表检索新增时间筛选框

This commit is contained in:
刘洪洪
2023-11-08 14:28:37 +08:00
parent 02a9f35070
commit 78105475fb
6 changed files with 46 additions and 32 deletions

View File

@@ -4,8 +4,16 @@
:class="{'entity-explorer--show-list': showList}">
<!-- 顶部工具栏在列表页显示 -->
<div class="explorer-top-tools explorer-top-tools-new" style="margin: 2px 0;" v-show="showList">
<div class="explorer-detection-top-tools">
<div class="explorer-entity-top-tools">
<div class="explorer-top-tools-title" style="padding: 0;margin-left: -10px;">{{$t('network.entity')}}</div>
<date-time-range
class="date-time-range"
:start-time="timeFilter.startTime"
:end-time="timeFilter.endTime"
:date-range="timeFilter.dateRangeValue"
ref="dateTimeRange"
@change="reload"
/>
</div>
</div>
<!-- 搜索组件 -->
@@ -176,6 +184,7 @@ import { handleErrorTip } from '@/components/advancedSearch/meta/error'
import { columnList } from '@/utils/static-data'
import { useRoute } from 'vue-router'
import { columnType } from '@/components/advancedSearch/meta/meta'
import DateTimeRange from '@/components/common/TimeRange/DateTimeRange'
export default {
name: 'entity-explorer',
@@ -183,7 +192,8 @@ export default {
Loading,
ExplorerSearch,
EntityFilter,
EntityList
EntityList,
DateTimeRange
},
data () {
return {
@@ -202,13 +212,6 @@ export default {
entityIpNew: '-',
entityIpActive: '-',
// pageObj: {
// pageNo: 1,
// // 是否重置pageNo在执行新搜索时是true
// resetPageNo: true,
// pageSize: defaultPageSize,
// total: 0
// },
newFilterData: [
{
icon: 'cn-icon cn-icon-registration-country',
@@ -286,7 +289,7 @@ export default {
initFlag: true, // 初始化标志避免初始化时pageSize和pageNo会调用搜索
timer: null, // 初始化标志的延时器,需要销毁
summaryCount: {
total: 0,
totalCount: 0,
domainCount: 0,
ipCount: 0,
appCount: 0
@@ -552,8 +555,8 @@ export default {
const queryParams = {
pageSize: params.pageSize,
pageNo: params.pageNo,
// startTime: getSecond(params.startTime),
// endTime: getSecond(params.endTime),
startTime: getSecond(params.startTime),
endTime: getSecond(params.endTime),
resource: params.q || ''
}
axios.get(api.entity.entityList.list, { params: queryParams }).then(response => {
@@ -561,7 +564,6 @@ export default {
this.listData = []
this.$nextTick(() => {
this.listData = response.data.data.list
this.pageObj.total = response.data.data.total
})
} else {
this.$message.error(response.data.message)
@@ -574,19 +576,20 @@ export default {
queryCount (params) {
this.loadingCount = true
const queryParams = {
// startTime: getSecond(params.startTime),
// endTime: getSecond(params.endTime),
startTime: getSecond(params.startTime),
endTime: getSecond(params.endTime),
resource: params.q || ''
}
axios.get(api.entity.entityList.summaryCount, { params: queryParams }).then(response => {
if (response.status === 200) {
this.summaryCount = response.data.data
this.pageObj.total = response.data.data.totalCount
} else {
this.summaryCount = { total: 0, domainCount: 0, ipCount: 0, appCount: 0 }
this.summaryCount = { totalCount: 0, domainCount: 0, ipCount: 0, appCount: 0 }
}
}).catch(e => {
console.error(e)
this.summaryCount = { total: 0, domainCount: 0, ipCount: 0, appCount: 0 }
this.summaryCount = { totalCount: 0, domainCount: 0, ipCount: 0, appCount: 0 }
}).finally(() => {
this.loadingCount = false
})
@@ -751,6 +754,8 @@ export default {
}
})
this.keywordList = keyList
} else {
this.keywordList = []
}
},
getKeyValue (str) {

View File

@@ -216,7 +216,7 @@ import Chart from '@/views/charts/Chart'
import _ from 'lodash'
import axios from 'axios'
import relatedServer from '@/mixins/relatedServer'
import { dateFormatByAppearance, getMillisecond } from '@/utils/date-util'
import { dateFormatByAppearance, getMillisecond, getSecond } from '@/utils/date-util'
import Loading from '@/components/common/Loading'
import { ref } from 'vue'
@@ -322,6 +322,8 @@ export default {
dateFormatByAppearance,
getQueryParams () {
return {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
resource: this.entity.entityValue
}
},

View File

@@ -325,15 +325,10 @@ export default {
getMillisecond,
dateFormatByAppearance,
getQueryParams () {
return {
resource: this.entity.entityValue
}
},
getQueryParamsWithTime () {
return {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
domain: this.entity.entityValue
resource: this.entity.entityValue
}
},
getPerformanceQueryParams () {
@@ -355,7 +350,7 @@ export default {
})
},
getBasicProperties () {
axios.get(this.basicProperties, { params: this.getQueryParamsWithTime() }).then(response => {
axios.get(this.basicProperties, { params: this.getQueryParams() }).then(response => {
if (response.status === 200) {
this.entityData = {
...this.entityData,

View File

@@ -251,7 +251,7 @@ import { valueToRangeValue } from '@/utils/unit-convert'
import Chart from '@/views/charts/Chart'
import _ from 'lodash'
import relatedServer from '@/mixins/relatedServer'
import { dateFormatByAppearance, getMillisecond } from '@/utils/date-util'
import { dateFormatByAppearance, getMillisecond, getSecond } from '@/utils/date-util'
import Loading from '@/components/common/Loading'
import axios from 'axios'
@@ -406,6 +406,8 @@ export default {
dateFormatByAppearance,
getQueryParams () {
return {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
resource: this.entity.entityValue
}
},
@@ -433,8 +435,8 @@ export default {
},
getOpenPort () {
const params = {
// startTime: getSecond(this.timeFilter.startTime),
// endTime: getSecond(this.timeFilter.endTime),
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
resource: this.entity.entityValue
}

View File

@@ -141,8 +141,8 @@ export default {
},
getQueryParams () {
return {
// startTime: getSecond(this.timeFilter.startTime),
// endTime: getSecond(this.timeFilter.endTime),
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
resource: this.entityType
}
},