forked from TencentBlueKing/blueking-dbm
-
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.
feat(frontend): 添加全局及业务下的资源标签管理功能 TencentBlueKing#7285
# Reviewed, transaction id: 22019
- Loading branch information
1 parent
068b26e
commit 8a13f75
Showing
90 changed files
with
3,989 additions
and
592 deletions.
There are no files selected for viewing
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
155 changes: 155 additions & 0 deletions
155
dbm-ui/frontend/src/components/review-data-dialog/Index.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,155 @@ | ||
<!-- | ||
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
* | ||
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
* the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<template> | ||
<BkDialog | ||
class="review-data-dialog" | ||
:is-loading="props.loading" | ||
:is-show="isShow" | ||
:title="props.title" | ||
@closed="handleClose"> | ||
<div class="container"> | ||
<div class="tip"> | ||
{{ props.tip }} | ||
</div> | ||
<div class="selected-wrapper"> | ||
<div class="selected-title"> | ||
{{ t('已选择以下') }} <span class="selected-count">{{ props.selected.length }}</span> {{ t('台主机') }} | ||
</div> | ||
<div class="selected-content"> | ||
<div | ||
v-for="item in props.selected" | ||
:key="item" | ||
class="selected-item"> | ||
{{ item }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<template #footer> | ||
<div class="footer"> | ||
<BkButton | ||
style="width: 88px" | ||
theme="primary" | ||
@click="handleConfirm" | ||
>{{ t('确定') }}</BkButton | ||
> | ||
<BkButton | ||
class="ml-9 operation-btn" | ||
style="width: 88px" | ||
@click="handleClose" | ||
>{{ t('取消') }}</BkButton | ||
> | ||
</div> | ||
</template> | ||
</BkDialog> | ||
</template> | ||
|
||
<script setup lang="tsx"> | ||
import { useI18n } from 'vue-i18n'; | ||
interface Props { | ||
title: string; | ||
tip: string; | ||
loading: boolean; | ||
selected: string[]; | ||
} | ||
interface Emits { | ||
(e: 'confirm'): void; | ||
(e: 'cancel'): void; | ||
} | ||
const props = defineProps<Props>(); | ||
const emits = defineEmits<Emits>(); | ||
const isShow = defineModel('isShow', { | ||
default: false, | ||
type: Boolean, | ||
}); | ||
const { t } = useI18n(); | ||
const handleConfirm = () => { | ||
emits('confirm'); | ||
isShow.value = false; | ||
}; | ||
const handleClose = () => { | ||
emits('cancel'); | ||
isShow.value = false; | ||
}; | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.container { | ||
font-size: 14px; | ||
.tip { | ||
background: #f5f6fa; | ||
border-radius: 2px; | ||
padding: 12px 16px; | ||
margin-bottom: 8px; | ||
} | ||
.selected-wrapper { | ||
border: 1px solid #eaebf0; | ||
border-radius: 2px; | ||
max-height: 192px; | ||
overflow-y: auto; | ||
.selected-title { | ||
width: 100%; | ||
padding: 5px 16px; | ||
background: #f0f1f5; | ||
color: #313238; | ||
position: sticky; | ||
top: 0; | ||
.selected-count { | ||
font-weight: 700; | ||
} | ||
} | ||
.selected-content { | ||
font-size: 12px; | ||
.selected-item { | ||
padding: 6px 16px; | ||
&:nth-child(even) { | ||
background-color: #fafbfd; | ||
} | ||
&:nth-child(odd) { | ||
background-color: #ffffff; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
.footer { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
</style> | ||
|
||
<style lang="less"> | ||
.review-data-dialog { | ||
.bk-dialog-footer { | ||
background-color: #fff !important; | ||
border: none !important; | ||
padding-top: 0 !important; | ||
padding-bottom: 24px !important; | ||
} | ||
} | ||
</style> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
* | ||
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at https://opensource.org/licenses/MIT | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
* the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { reactive } from 'vue'; | ||
|
||
export function useFormModel<T extends object>(initialState: T) { | ||
const formModel = reactive({ ...initialState }) as T; | ||
|
||
function resetForm() { | ||
Object.assign(formModel, initialState); | ||
} | ||
|
||
function setForm(values: Partial<T>) { | ||
Object.assign(formModel, values); | ||
} | ||
|
||
return { | ||
formModel, | ||
resetForm, | ||
setForm, | ||
}; | ||
} |
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
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.