fix: update style

This commit is contained in:
Qiuxia Fan 2022-03-04 11:38:29 +08:00
parent f7c2c8549b
commit d71cd66fa1
4 changed files with 38 additions and 26 deletions

View File

@ -50,7 +50,7 @@ limitations under the License. -->
</div>
<div class="tab-layout">
<grid-layout
v-if="dashboardStore.currentTabItems.length"
v-if="dashboardStore.currentTabItems"
v-model:layout="dashboardStore.currentTabItems"
:col-num="24"
:row-height="10"
@ -106,9 +106,11 @@ export default defineComponent({
const activeTabIndex = ref<number>(0);
const activeTabWidget = ref<string>("");
const editTabIndex = ref<number>(NaN); // edit tab item name
const l = dashboardStore.layout.findIndex(
(d: LayoutConfig) => d.i === props.data.i
);
dashboardStore.setCurrentTabItems(
dashboardStore.layout[props.data.i].children[activeTabIndex.value]
.children
dashboardStore.layout[l].children[activeTabIndex.value].children
);
function clickTabs(e: Event, idx: number) {
@ -117,9 +119,11 @@ export default defineComponent({
dashboardStore.activeGridItem(props.data.i);
dashboardStore.selectWidget(props.data);
dashboardStore.setActiveTabIndex(idx);
const l = dashboardStore.layout.findIndex(
(d: LayoutConfig) => d.i === props.data.i
);
dashboardStore.setCurrentTabItems(
dashboardStore.layout[props.data.i].children[activeTabIndex.value]
.children
dashboardStore.layout[l].children[activeTabIndex.value].children
);
}
function removeTab(e: Event) {
@ -150,8 +154,13 @@ export default defineComponent({
`${props.data.i}-${activeTabIndex.value}-${item.i}`
);
}
function layoutUpdatedEvent(newLayout: LayoutConfig[]) {
dashboardStore.setCurrentTabItems(newLayout);
function layoutUpdatedEvent() {
const l = dashboardStore.layout.findIndex(
(d: LayoutConfig) => d.i === props.data.i
);
dashboardStore.setCurrentTabItems(
dashboardStore.layout[l].children[activeTabIndex.value].children
);
}
document.body.addEventListener("click", handleClick, false);
watch(

View File

@ -128,10 +128,10 @@ export default defineComponent({
watch(
() => [props.data.metricTypes, props.data.metrics],
() => {
if (!dashboardStore.selectedGrid) {
return;
}
if (props.data.i !== dashboardStore.selectedGrid.i) {
if (
dashboardStore.selectedGrid &&
props.data.i !== dashboardStore.selectedGrid.i
) {
return;
}
if (TableChartTypes.includes(dashboardStore.selectedGrid.graph.type)) {

View File

@ -73,11 +73,8 @@ function loadTrees(l: boolean) {
.t-loading {
text-align: center;
position: absolute;
width: 100%;
height: 70px;
margin-top: 40px;
line-height: 88px;
overflow: hidden;
height: calc(50% - 50px);
}
</style>

View File

@ -35,16 +35,18 @@ limitations under the License. -->
{{ t("analyze") }}
</el-button>
</div>
<Table
:data="profileStore.segmentSpans"
:traceId="
profileStore.currentSegment.traceIds &&
profileStore.currentSegment.traceIds[0]
"
:showBtnDetail="true"
headerType="profile"
@select="selectSpan"
/>
<div class="profile-table">
<Table
:data="profileStore.segmentSpans"
:traceId="
profileStore.currentSegment.traceIds &&
profileStore.currentSegment.traceIds[0]
"
:showBtnDetail="true"
headerType="profile"
@select="selectSpan"
/>
</div>
</div>
</template>
<script lang="ts" setup>
@ -158,10 +160,14 @@ function updateTimeRange() {
padding: 5px;
flex-shrink: 0;
height: 50%;
overflow: auto;
width: 100%;
}
.profile-table {
height: calc(100% - 30px);
overflow: auto;
}
.profile-trace-detail-wrapper {
padding: 5px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);