This commit is contained in:
Fine 2025-04-10 18:08:03 +08:00
parent f80bd95bef
commit 9f1094ff2d
5 changed files with 13 additions and 8 deletions

View File

@ -43,7 +43,7 @@ limitations under the License. -->
<Table <Table
:data="profileStore.segmentSpans" :data="profileStore.segmentSpans"
:traceId="profileStore.currentSegment.traceId" :traceId="profileStore.currentSegment.traceId"
headerType="profile" :headerType="WidgetType.Profile"
@select="selectSpan" @select="selectSpan"
/> />
</div> </div>
@ -59,6 +59,7 @@ limitations under the License. -->
import type { Option } from "@/types/app"; import type { Option } from "@/types/app";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { ProfileDataMode, ProfileDisplayMode } from "./data"; import { ProfileDataMode, ProfileDisplayMode } from "./data";
import { WidgetType } from "@/views/dashboard/data";
/* global defineEmits*/ /* global defineEmits*/
const emits = defineEmits(["loading", "displayMode"]); const emits = defineEmits(["loading", "displayMode"]);

View File

@ -84,7 +84,7 @@ limitations under the License. -->
:data="traceStore.traceSpans" :data="traceStore.traceSpans"
:traceId="traceStore.currentTrace.traceIds[0].value" :traceId="traceStore.currentTrace.traceIds[0].value"
:showBtnDetail="false" :showBtnDetail="false"
HeaderType="trace" :headerType="WidgetType.Trace"
/> />
</div> </div>
</div> </div>
@ -160,6 +160,7 @@ limitations under the License. -->
appStore, appStore,
loading, loading,
traceId, traceId,
WidgetType,
}; };
}, },
}); });

View File

@ -17,7 +17,7 @@ limitations under the License. -->
<div class="trace-t-loading" v-show="loading"> <div class="trace-t-loading" v-show="loading">
<Icon iconName="spinner" size="sm" /> <Icon iconName="spinner" size="sm" />
</div> </div>
<TableContainer :tableData="tableData" :type="TraceGraphType.STATISTICS" :HeaderType="HeaderType"> <TableContainer :tableData="tableData" :type="TraceGraphType.STATISTICS" :headerType="headerType">
<div class="trace-tips" v-if="!tableData.length">{{ $t("noData") }}</div> <div class="trace-tips" v-if="!tableData.length">{{ $t("noData") }}</div>
</TableContainer> </TableContainer>
</div> </div>
@ -35,7 +35,7 @@ limitations under the License. -->
data: { type: Array as PropType<Span[]>, default: () => [] }, data: { type: Array as PropType<Span[]>, default: () => [] },
traceId: { type: String, default: "" }, traceId: { type: String, default: "" },
showBtnDetail: { type: Boolean, default: false }, showBtnDetail: { type: Boolean, default: false },
HeaderType: { type: String, default: "" }, headerType: { type: String, default: "" },
}); });
const emit = defineEmits(["load"]); const emit = defineEmits(["load"]);
const loading = ref<boolean>(true); const loading = ref<boolean>(true);

View File

@ -59,6 +59,7 @@ limitations under the License. -->
import TableItem from "./TableItem.vue"; import TableItem from "./TableItem.vue";
import { ProfileConstant, TraceConstant, StatisticsConstant } from "./data"; import { ProfileConstant, TraceConstant, StatisticsConstant } from "./data";
import { TraceGraphType } from "../constant"; import { TraceGraphType } from "../constant";
import { WidgetType } from "@/views/dashboard/data";
/* global defineProps, Nullable, defineEmits, Recordable*/ /* global defineProps, Nullable, defineEmits, Recordable*/
const props = defineProps({ const props = defineProps({
@ -74,7 +75,7 @@ limitations under the License. -->
const dragger = ref<Nullable<HTMLSpanElement>>(null); const dragger = ref<Nullable<HTMLSpanElement>>(null);
let headerData: Recordable[] = TraceConstant; let headerData: Recordable[] = TraceConstant;
if (props.headerType === "profile") { if (props.headerType === WidgetType.Profile) {
headerData = ProfileConstant; headerData = ProfileConstant;
} }
if (props.type === TraceGraphType.STATISTICS) { if (props.type === TraceGraphType.STATISTICS) {

View File

@ -118,10 +118,10 @@ limitations under the License. -->
<span>{{ data.serviceCode }}</span> <span>{{ data.serviceCode }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="application" v-show="headerType === 'profile'" @click="viewSpan($event)"> <div class="application" v-show="headerType === WidgetType.Profile" @click="viewSpan($event)">
<span>{{ t("view") }}</span> <span>{{ t("view") }}</span>
</div> </div>
<div class="application" v-show="headerType !== 'profile'"> <div class="application" v-show="headerType !== WidgetType.Profile">
<span>{{ data.attachedEvents && data.attachedEvents.length }}</span> <span>{{ data.attachedEvents && data.attachedEvents.length }}</span>
</div> </div>
</div> </div>
@ -150,6 +150,7 @@ limitations under the License. -->
import { useAppStoreWithOut } from "@/store/modules/app"; import { useAppStoreWithOut } from "@/store/modules/app";
import { Themes } from "@/constants/data"; import { Themes } from "@/constants/data";
import { TraceGraphType } from "../constant"; import { TraceGraphType } from "../constant";
import { WidgetType } from "@/views/dashboard/data";
/*global Recordable*/ /*global Recordable*/
const props = { const props = {
@ -215,7 +216,7 @@ limitations under the License. -->
function selectSpan(event: Recordable) { function selectSpan(event: Recordable) {
const dom = event.composedPath().find((d: Recordable) => d.className.includes("trace-item")); const dom = event.composedPath().find((d: Recordable) => d.className.includes("trace-item"));
selectedItem(props.data); selectedItem(props.data);
if (props.headerType === "profile") { if (props.headerType === WidgetType.Profile) {
showSelectSpan(dom); showSelectSpan(dom);
return; return;
} }
@ -264,6 +265,7 @@ limitations under the License. -->
t, t,
appStore, appStore,
TraceGraphType, TraceGraphType,
WidgetType,
}; };
}, },
}); });