forked from TencentBlueKing/bk-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request TencentBlueKing#1102 from lannoy0523/issue_1012
feat:二进制页面修改 TencentBlueKing#1012
- Loading branch information
Showing
9 changed files
with
401 additions
and
27 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
src/frontend/devops-repository/src/components/Loading/loading.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<bk-dialog | ||
:position="{ top }" | ||
header-position="left" | ||
:title="title" | ||
width="600" | ||
v-model="isShow"> | ||
<slot></slot> | ||
<div class="message"> | ||
<Icon v-if="!complete" name="loading" size="20" class="svg-loading" /> | ||
<Icon v-if="complete" name="check" size="20" class="svg-complete" /> | ||
<span>{{ message }}</span> | ||
</div> | ||
<template #footer> | ||
<slot name="footer"> | ||
<bk-button @click="isShow = false" v-if="!complete">{{$t('cancel')}}</bk-button> | ||
<bk-button theme="primary" @click="isShow = false" v-if="complete">{{$t('confirm')}}</bk-button> | ||
</slot> | ||
</template> | ||
</bk-dialog> | ||
</template> | ||
<script> | ||
import { debounce } from '@repository/utils' | ||
export default { | ||
name: 'loadingDialog', | ||
props: { | ||
heightNum: { | ||
type: [String, Number], | ||
default: 600 | ||
} | ||
}, | ||
data () { | ||
return { | ||
MODE_CONFIG, | ||
title: '', | ||
isShow: false, | ||
message: this.$t('loadingMsg'), | ||
complete: false | ||
} | ||
}, | ||
computed: { | ||
top () { | ||
return 300 | ||
} | ||
}, | ||
mounted () { | ||
this.resizeFn = debounce(this.getBodyHeight, 1000) | ||
window.addEventListener('resize', this.resizeFn) | ||
}, | ||
beforeDestroy () { | ||
this.message = this.$t('loadingMsg') | ||
window.removeEventListener('resize', this.resizeFn) | ||
}, | ||
methods: { | ||
getBodyHeight () { | ||
this.bodyHeight = document.body.getBoundingClientRect().height | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
.bk-dialog-content bk-dialog-content-drag{ | ||
width: 500px !important; | ||
} | ||
.message { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
font-size: 16px; | ||
.svg-loading { | ||
margin-right: 10px; | ||
animation: rotate-loading 1s linear infinite; | ||
} | ||
.svg-complete { | ||
margin-right: 10px; | ||
} | ||
@keyframes rotate-loading { | ||
0% { | ||
transform: rotateZ(0); | ||
} | ||
100% { | ||
transform: rotateZ(360deg); | ||
} | ||
} | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.