Skip to content

Commit

Permalink
fix(frontend): mysql部分格子表使用最新组件替换 TencentBlueKing#7261
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 20157
  • Loading branch information
jinquantianxia committed Oct 10, 2024
1 parent c242435 commit b1b92cb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
export interface IListItem {
value: IKey;
label: string;
[x: string]: any;
}
</script>
<script setup lang="ts">
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import { useTimeZoneFormat } from '@hooks';
import TableEditDateTime from '@views/db-manage/tendb-cluster/common/edit/DateTime.vue';
import TableEditDateTime from '@components/render-table/columns/DateTime.vue';
interface Props {
startTime?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
:placeholder="t('请选择')"
:rules="rules"
@change="(value) => handleChange(value as string)">
<template #option="{ optionItem }">
<div :style="{ ...centerStyle, justifyContent: 'space-between' }">
<span>{{ optionItem.name }}</span>
<span :style="{ ...centerStyle, ...numberStyle }">{{ optionItem.count }}</span>
<template #default="{ optionItem }">
<div class="option-item">
<span>{{ optionItem.label }}</span>
<span class="option-count">{{ optionItem.count }}</span>
</div>
</template>
</TableEditSelect>
Expand All @@ -33,7 +33,7 @@
import { getHostTopo } from '@services/source/ipchooser';
import TableEditSelect from '@views/db-manage/tendb-cluster/common/edit/Select.vue';
import TableEditSelect from '@components/render-table/columns/select/index.vue';
interface Props {
modelValue: string;
Expand All @@ -52,18 +52,6 @@
const { t } = useI18n();
const centerStyle = {
display: 'flex',
alignItems: 'center',
};
const numberStyle = {
width: '23px',
height: '17px',
background: '#EAEBF0',
borderRadius: '2px',
justifyContent: 'center',
};
const bizId = window.PROJECT_CONFIG.BIZ_ID;
const rules = [
{
Expand All @@ -76,8 +64,8 @@
const localValue = ref('');
const list = ref([
{
id: 'idle',
name: t('业务空闲机'),
value: 'idle',
label: t('业务空闲机'),
count: 0,
},
]);
Expand Down Expand Up @@ -123,3 +111,21 @@
},
});
</script>
<style lang="less" scoped>
.option-item {
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
.option-count {
display: flex;
align-items: center;
width: 23px;
height: 17px;
background: #eaebf0;
border-radius: 2px;
justify-content: center;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
-->

<template>
<BkLoading :loading="isLoading">
<TableEditInput
ref="editInputRef"
:model-value="localInstanceData?.master_domain"
:placeholder="t('根据实例生成')"
readonly />
</BkLoading>
<RenderText
ref="editInputRef"
:data="localInstanceData?.master_domain"
:is-loading="isLoading"
:placeholder="t('根据实例生成')" />
</template>
<script setup lang="ts">
import { shallowRef } from 'vue';
Expand All @@ -29,7 +27,7 @@
import { useGlobalBizs } from '@stores';
import TableEditInput from '@views/db-manage/tendb-cluster/common/edit/Input.vue';
import RenderText from '@components/render-table/columns/text-plain/index.vue';
import type { IDataRow } from './Row.vue';
Expand Down

0 comments on commit b1b92cb

Please sign in to comment.