From f0270bc98a8a87ff85f251379c802378b459fab2 Mon Sep 17 00:00:00 2001 From: jidanjuan <112756875+jidanjuan@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:07:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E9=AA=8C=E6=94=B6=E9=97=AE=E9=A2=981?= =?UTF-8?q?=E3=80=8136=E3=80=8138=E3=80=8139=E3=80=8140=E3=80=8148?= =?UTF-8?q?=E3=80=8150=E4=BF=AE=E5=A4=8D=20(#4092)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graph-analysis/common/FieldSettings.vue | 71 +++++++++---------- .../graph-analysis/index.tsx | 6 -- .../graph-analysis/sql-editor/index.tsx | 1 - .../graph-analysis/sql-editor/use-editor.ts | 1 + 4 files changed, 36 insertions(+), 43 deletions(-) diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/common/FieldSettings.vue b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/common/FieldSettings.vue index 288c4849cf..033c179518 100644 --- a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/common/FieldSettings.vue +++ b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/common/FieldSettings.vue @@ -44,15 +44,31 @@ const emit = defineEmits(['update']); const selectedXAxis = ref(props.xAxis); const selectedYAxis = ref(props.yAxis); - const timeAxis = ref([]); + const timeAxis = ref(''); const hiddenField = ref([]); const list = computed(() => props.result_schema.map(item => item.field_alias)); - const stringFilterList = computed(() => - props.result_schema.filter(item => item.field_type !== 'string').map(item => item.field_alias), - ); - const timeFilterList = computed(() => - props.result_schema.filter(item => /^date/.test(item.field_type)).map(item => item.field_alias), - ); + const filterFields = ( typeCheck, excludeList) => { + return props.result_schema.filter(item => typeCheck(item)) + .filter(item => !excludeList.includes(item.field_alias)); + }; + + const xAxisFilterList = computed(() => { + return filterFields(item => true, [...selectedYAxis.value, timeAxis.value]); + }); + + const yAxisFilterList = computed(() => { + return filterFields( + item => item.field_type !== 'string', + [...selectedXAxis.value, timeAxis.value] + ); + }); + + const timeFilterList = computed(() => { + return filterFields( + item => item.field_type == 'long', + [...selectedYAxis.value, ...selectedXAxis.value] + ); + }); // 监听 props.xAxis 的变化并更新 selectedXAxis watch( () => props.xAxis, @@ -84,10 +100,10 @@ multiple > @@ -102,27 +118,10 @@ multiple > - - - -
-
{{ this.$t('显示字段') }}
- - @@ -135,10 +134,10 @@ searchable > diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/index.tsx b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/index.tsx index 41cb3e476c..e8522797e2 100644 --- a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/index.tsx +++ b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/index.tsx @@ -96,11 +96,6 @@ export default class GraphAnalysisIndex extends tsc { title: '', }; - basicInfoSubTitle = { - show: false, - title: '', - }; - fieldList = [1]; advanceSetting = false; @@ -270,7 +265,6 @@ export default class GraphAnalysisIndex extends tsc {
diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/index.tsx b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/index.tsx index 00344cfd80..7749d58e5d 100644 --- a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/index.tsx +++ b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/index.tsx @@ -37,7 +37,6 @@ import { format } from 'sql-formatter'; import BookmarkPop from '../../../search-bar/bookmark-pop.vue'; import useEditor from './use-editor'; - import './index.scss'; export default defineComponent({ diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/use-editor.ts b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/use-editor.ts index a611431e7c..da842e127b 100644 --- a/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/use-editor.ts +++ b/bklog/web/src/views/retrieve-v2/search-result-panel/graph-analysis/sql-editor/use-editor.ts @@ -55,6 +55,7 @@ export default ({ refRootElement, sqlContent, onValueChange }) => { automaticLayout: true, minimap: { enabled: false }, scrollBeyondLastLine: false, // 避免空白行 + contextmenu: false // 禁用右键菜单 }); // 监听编辑器的键盘事件