diff --git a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue index 259c63d2d8..915ee96637 100644 --- a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue +++ b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue @@ -51,7 +51,7 @@ const props = withDefaults( editable: true, lfEol: true, language: '', - } + }, ); const emit = defineEmits(['update:modelValue', 'change', 'enter']); @@ -72,21 +72,21 @@ watch( if (val !== localVal.value) { editor.setValue(val); } - } + }, ); watch( () => props.language, (val) => { monaco.editor.setModelLanguage(editor.getModel() as monaco.editor.ITextModel, val); - } + }, ); watch( () => props.editable, (val) => { editor.updateOptions({ readOnly: !val }); - } + }, ); watch( @@ -95,14 +95,14 @@ watch( if (Array.isArray(val) && val.length > 0) { editorHoverProvider = useEditorVariableReplace(editor, val); } - } + }, ); watch( () => props.errorLine, () => { setErrorLine(); - } + }, ); onMounted(() => { @@ -167,9 +167,9 @@ const handleVariableList = async () => { getVariableList(bkBizId.value, { start: 0, limit: 1000 }), getUnReleasedAppVariables(bkBizId.value, appId.value), ]); - variableNameList.value = variableList.details.map((item: any) => item.spec.name); - privateVariableNameList.value = privateVariableList.details.map((item: any) => item.name); - variableNameList.value?.filter((item) => !privateVariableNameList.value!.includes(item)); + variableNameList.value = variableList.details.map((item: any) => `.${item.spec.name}`); + privateVariableNameList.value = privateVariableList.details.map((item: any) => `.${item.name}`); + variableNameList.value?.filter(item => !privateVariableNameList.value!.includes(item)); }; // 注册自定义语言 @@ -208,22 +208,18 @@ const aotoCompletion = () => { const lineContent = model.getLineContent(position.lineNumber); const charBeforeCursor = lineContent.charAt(position.column - 2); // 根据当前的文本内容和光标位置,返回自动补全的候选项列表 - const variableSuggestions = variableNameList.value!.map((item: string) => { - return { - label: item, // 候选项的显示文本 - kind: monaco.languages.CompletionItemKind.Variable, // 候选项的类型 - insertText: item, // 插入光标后的文本 - range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column), - }; - }); - const privateVariableSuggestions = privateVariableNameList.value!.map((item: string) => { - return { - label: item, - kind: monaco.languages.CompletionItemKind.Variable, - insertText: item, - range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column), - }; - }); + const variableSuggestions = variableNameList.value!.map((item: string) => ({ + label: item, // 候选项的显示文本 + kind: monaco.languages.CompletionItemKind.Variable, // 候选项的类型 + insertText: item, // 插入光标后的文本 + range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column), + })); + const privateVariableSuggestions = privateVariableNameList.value!.map((item: string) => ({ + label: item, + kind: monaco.languages.CompletionItemKind.Variable, + insertText: item, + range: new monaco.Range(position.lineNumber, position.column, position.lineNumber, position.column), + })); const suggestions = [...variableSuggestions, ...privateVariableSuggestions]; if (charBeforeCursor === '{') { return { @@ -234,9 +230,7 @@ const aotoCompletion = () => { suggestions: [], }; }, - resolveCompletionItem: (item: any) => { - return item; - }, + resolveCompletionItem: (item: any) => item, }); }; diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue index 0f1f7107a3..3f85cf09d1 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue @@ -59,7 +59,7 @@ const props = withDefaults( currentVariables: () => [], currentLanguage: '', baseVariables: () => [], - } + }, ); const textDiffRef = ref(); @@ -76,7 +76,7 @@ watch( () => { updateModel(); replaceDiffVariables(); - } + }, ); watch( @@ -84,7 +84,7 @@ watch( () => { updateModel(); replaceDiffVariables(); - } + }, ); watch( @@ -92,7 +92,7 @@ watch( () => { updateModel(); replaceDiffVariables(); - } + }, ); onMounted(() => { @@ -182,7 +182,7 @@ const replaceDiffVariables = () => { permissionDiffEditorHoverProvider = useDiffEditorVariableReplace( permissionEditor, props.currentVariables, - props.baseVariables + props.baseVariables, ); } }; diff --git a/bcs-services/bcs-bscp/ui/src/components/footer.vue b/bcs-services/bcs-bscp/ui/src/components/footer.vue index 3b1da15c22..884db5d887 100644 --- a/bcs-services/bcs-bscp/ui/src/components/footer.vue +++ b/bcs-services/bcs-bscp/ui/src/components/footer.vue @@ -12,7 +12,7 @@ import { defineComponent } from 'vue'; export default defineComponent({ - name: 'app-footer', + name: 'AppFooter', setup() { return { // @ts-ignore diff --git a/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue b/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue index 7886372498..5eb9751bc5 100644 --- a/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue +++ b/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue @@ -78,14 +78,14 @@ watch( privilegeInputVal.value = val; localVal.value = val; }, - { immediate: true } + { immediate: true }, ); // 将权限数字拆分成三个分组配置 const privilegeGroupsValue = computed(() => { const data: { [index: string]: number[] } = { 0: [], 1: [], 2: [] }; if (typeof localVal.value === 'string' && localVal.value.length > 0) { - const valArr = localVal.value.split('').map((i) => parseInt(i, 10)); + const valArr = localVal.value.split('').map(i => parseInt(i, 10)); valArr.forEach((item, index) => { data[index as keyof typeof data] = PRIVILEGE_VALUE_MAP[item as keyof typeof PRIVILEGE_VALUE_MAP]; }); diff --git a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue index e99de5a0b1..fab47d976c 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue @@ -74,7 +74,7 @@ watch( alter_scope: [], }; } - } + }, ); const loadRules = async () => { diff --git a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/rule-edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/rule-edit.vue index 349aca57e0..77eead1128 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/rule-edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/rule-edit.vue @@ -2,39 +2,45 @@
配置关联规则
可填写服务名称/文件路径,支持通配符,如:myservice/*
+可填写服务名称/文件路径,支持glob 表达式,如:myservice/**