Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#10177 from vhwweng/issue_10114
Browse files Browse the repository at this point in the history
bug: 代码库-触发事件流水线名称改成流水线ID搜索 TencentBlueKing#10114
  • Loading branch information
bkci-bot committed Apr 8, 2024
2 parents 75bcfe7 + a275d3e commit 74789a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
}"
:shortcuts="shortcuts"
:key="repoId"
@clear="handleClearDaterange"
@change="handleChangeDaterange"
@pick-success="handlePickSuccess"
>
</bk-date-picker>
<search-select
Expand Down Expand Up @@ -56,6 +58,7 @@
</section>
<EmptyTableStatus
v-else
v-bkloading="{ isLoading: pageLoading }"
:type="isSearch ? 'search-empty' : 'empty'"
@clear="resetFilter"
/>
Expand Down Expand Up @@ -113,6 +116,7 @@
eventList: [],
timelineMap: {},
searchValue: [],
daterangeCache: [],
daterange: setDefaultDaterange(),
page: 1,
pageSize: 20,
Expand Down Expand Up @@ -352,23 +356,32 @@
this.getListData()
},
handleClearDaterange () {
this.daterange = ['', '']
},
handleChangeDaterange (date, type) {
const startTime = new Date(`${date[0]} 00:00:00`).getTime() || ''
const endTime = new Date(`${date[1]} 23:59:59`).getTime() || ''
this.daterange = [startTime, endTime]
const startTime = new Date(date[0]).getTime() || ''
const endTime = new Date(date[1]).getTime() || ''
this.daterangeCache = [startTime, endTime]
},
handlePickSuccess () {
this.daterange = this.daterangeCache
},
async handleRefresh () {
this.page = 1
this.pageLoading = true
this.hasLoadEnd = false
this.daterange = this.setDefaultDaterange()
// await this.getListData()
await this.getListData()
},
replayEvent () {
this.pageLoading = true
this.hasLoadEnd = false
setTimeout(() => {
this.handleRefresh()
this.daterange = this.setDefaultDaterange()
}, 1000)
}
}
Expand All @@ -394,8 +407,8 @@
cursor: pointer;
}
.date-picker {
max-width: 300px;
min-width: 200px;
max-width: 400px;
min-width: 340px;
}
.search-select {
width: 100%;
Expand Down
18 changes: 4 additions & 14 deletions src/frontend/devops-codelib/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,6 @@
sortType = this.sortType
) {
if (!this.userId) this.isLoading = true
this.$router.push({
query: {
...this.$route.query,
sortBy,
sortType
}
})
await this.requestList({
projectId,
aliasName,
Expand Down Expand Up @@ -352,13 +345,10 @@
this.sortBy = sortBy
this.sortType = sortType
this.refreshCodelibList()
if (sortBy && sortType) {
localStorage.setItem('codelibSortType', sortType)
localStorage.setItem('codelibSortBy', sortBy)
} else {
localStorage.removeItem('codelibSortType')
localStorage.removeItem('codelibSortBy')
}
localStorage.setItem('codelibSortType', sortType)
localStorage.setItem('codelibSortBy', sortBy)
const queryKeys = Object.keys(this.$route?.query || {})
if (!queryKeys.length) return
this.$router.push({
query: {
...this.$route.query,
Expand Down

0 comments on commit 74789a4

Please sign in to comment.