clear cache data

This commit is contained in:
Qiuxia Fan 2022-07-29 11:31:41 +08:00
parent 08a4b54188
commit a830ca27f7
4 changed files with 8 additions and 5 deletions

View File

@ -53,7 +53,8 @@ export const logStore = defineStore({
setLogCondition(data: any) {
this.conditions = { ...this.conditions, ...data };
},
resetCondition() {
resetState() {
this.logs = [];
this.conditions = {
queryDuration: useAppStoreWithOut().durationTime,
paging: { pageNum: 1, pageSize: 15 },

View File

@ -63,7 +63,10 @@ export const traceStore = defineStore({
setTraceSpans(spans: Span) {
this.traceSpans = spans;
},
resetCondition() {
resetState() {
this.traceSpans = [];
this.traceList = [];
this.currentTrace = {};
this.conditions = {
queryDuration: useAppStoreWithOut().durationTime,
paging: { pageNum: 1, pageSize: 20 },

View File

@ -343,7 +343,7 @@ function removeExcludeContent(index: number) {
excludingContentStr.value = "";
}
onUnmounted(() => {
logStore.resetCondition();
logStore.resetState();
const item = {
...props.data,
filters: undefined,
@ -380,7 +380,6 @@ watch(
watch(
() => props.data.filters,
(newJson, oldJson) => {
console.log(props.data.filters);
if (props.data.filters) {
if (JSON.stringify(newJson) === JSON.stringify(oldJson)) {
return;

View File

@ -235,7 +235,7 @@ async function searchEndpoints(keyword: string) {
}
}
onUnmounted(() => {
traceStore.resetCondition();
traceStore.resetState();
const item = {
...props.data,
filters: undefined,