Skip to content

Commit

Permalink
fix: 验收问题1、36、38、39、40、48、50修复 (#4092)
Browse files Browse the repository at this point in the history
  • Loading branch information
jidanjuan authored Nov 28, 2024
1 parent 9590da4 commit f0270bc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -84,10 +100,10 @@
multiple
>
<bk-option
v-for="(option, index) in stringFilterList"
:key="index"
:id="option"
:name="option"
v-for="(option) in yAxisFilterList"
:key="option.field_index"
:id="option.field_alias"
:name="option.field_alias"
>
</bk-option>
</bk-select>
Expand All @@ -102,27 +118,10 @@
multiple
>
<bk-option
v-for="(option, index) in list"
:key="index"
:id="option"
:name="option"
>
</bk-option>
</bk-select>
</div>
<div v-show="activeGraphCategory == 'line_bar'">
<div class="title">{{ this.$t('显示字段') }}</div>
<bk-select
v-model="selectedYAxis"
@change="change('yAxis', $event)"
:clearable="false"
searchable
>
<bk-option
v-for="(option, index) in list"
:key="index"
:id="option"
:name="option"
v-for="(option) in xAxisFilterList"
:key="option.field_index"
:id="option.field_alias"
:name="option.field_alias"
>
</bk-option>
</bk-select>
Expand All @@ -135,10 +134,10 @@
searchable
>
<bk-option
v-for="(option, index) in timeFilterList"
:key="index"
:id="option"
:name="option"
v-for="(option) in timeFilterList"
:key="option.field_index"
:id="option.field_alias"
:name="option.field_alias"
>
</bk-option>
</bk-select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ export default class GraphAnalysisIndex extends tsc<IProps> {
title: '',
};

basicInfoSubTitle = {
show: false,
title: '',
};

fieldList = [1];
advanceSetting = false;

Expand Down Expand Up @@ -270,7 +265,6 @@ export default class GraphAnalysisIndex extends tsc<IProps> {
<div class='basic-info-row'>
<bk-checkbox
v-model={this.basicInfoTitle.show}
checked={true}
false-value={false}
true-value={true}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default ({ refRootElement, sqlContent, onValueChange }) => {
automaticLayout: true,
minimap: { enabled: false },
scrollBeyondLastLine: false, // 避免空白行
contextmenu: false // 禁用右键菜单
});

// 监听编辑器的键盘事件
Expand Down

0 comments on commit f0270bc

Please sign in to comment.