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) { setLogCondition(data: any) {
this.conditions = { ...this.conditions, ...data }; this.conditions = { ...this.conditions, ...data };
}, },
resetCondition() { resetState() {
this.logs = [];
this.conditions = { this.conditions = {
queryDuration: useAppStoreWithOut().durationTime, queryDuration: useAppStoreWithOut().durationTime,
paging: { pageNum: 1, pageSize: 15 }, paging: { pageNum: 1, pageSize: 15 },

View File

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

View File

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

View File

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