diff --git a/frontend/src/components/business/ms-common-script/insertCommonScript.vue b/frontend/src/components/business/ms-common-script/insertCommonScript.vue
index e4296a1825..060bc1a04f 100644
--- a/frontend/src/components/business/ms-common-script/insertCommonScript.vue
+++ b/frontend/src/components/business/ms-common-script/insertCommonScript.vue
@@ -76,8 +76,6 @@
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
- import { RequestConditionScriptLanguage } from '@/enums/apiEnum';
-
import debounce from 'lodash-es/debounce';
const appStore = useAppStore();
@@ -86,7 +84,7 @@
const props = withDefaults(
defineProps<{
visible: boolean;
- scriptLanguage?: Language | RequestConditionScriptLanguage;
+ scriptLanguage?: Language;
enableRadioSelected?: boolean; // 是否单选开启
okText?: string;
checkedId?: string; // 单选时默认选中的id
diff --git a/frontend/src/components/business/ms-common-script/ms-script-menu.vue b/frontend/src/components/business/ms-common-script/ms-script-menu.vue
index f7d204b931..23c17281b3 100644
--- a/frontend/src/components/business/ms-common-script/ms-script-menu.vue
+++ b/frontend/src/components/business/ms-common-script/ms-script-menu.vue
@@ -43,12 +43,10 @@
import { useVModel } from '@vueuse/core';
import { Message } from '@arco-design/web-vue';
- import { Language } from '@/components/pure/ms-code-editor/types';
+ import { Language, LanguageEnum } from '@/components/pure/ms-code-editor/types';
import { useI18n } from '@/hooks/useI18n';
- import { RequestConditionScriptLanguage } from '@/enums/apiEnum';
-
import type { CommonScriptMenu } from './types';
import { getCodeTemplate, SCRIPT_MENU } from './utils';
@@ -56,7 +54,7 @@
const props = defineProps<{
expand: boolean;
- languagesType: Language | RequestConditionScriptLanguage;
+ languagesType: Language;
}>();
const emit = defineEmits<{
@@ -73,11 +71,11 @@
const innerLanguageType = useVModel(props, 'languagesType', emit);
const languages = [
- { text: 'beanshellJSR223', value: RequestConditionScriptLanguage.BEANSHELL_JSR233 },
- { text: 'beanshell', value: RequestConditionScriptLanguage.BEANSHELL },
- { text: 'python', value: RequestConditionScriptLanguage.PYTHON },
- { text: 'groovy', value: RequestConditionScriptLanguage.GROOVY },
- { text: 'javascript', value: RequestConditionScriptLanguage.JAVASCRIPT },
+ { text: 'beanshellJSR223', value: LanguageEnum.BEANSHELL_JSR233 },
+ { text: 'beanshell', value: LanguageEnum.BEANSHELL },
+ { text: 'python', value: LanguageEnum.PYTHON },
+ { text: 'groovy', value: LanguageEnum.GROOVY },
+ { text: 'javascript', value: LanguageEnum.JAVASCRIPT },
];
function expandedHandler() {
@@ -127,7 +125,7 @@
return;
}
} else {
- if (innerLanguageType.value !== 'beanshell' && innerLanguageType.value !== 'groovy') {
+ if (innerLanguageType.value !== LanguageEnum.BEANSHELL && innerLanguageType.value !== LanguageEnum.GROOVY) {
if (
obj.title === t('api_test.request.processor.code_add_report_length') ||
obj.title === t('api_test.request.processor.code_hide_report_length')
diff --git a/frontend/src/components/business/ms-common-script/scriptDefined.vue b/frontend/src/components/business/ms-common-script/scriptDefined.vue
index 7191f84c66..613aa8e776 100644
--- a/frontend/src/components/business/ms-common-script/scriptDefined.vue
+++ b/frontend/src/components/business/ms-common-script/scriptDefined.vue
@@ -28,7 +28,7 @@
:width="expandMenu ? '100%' : '68%'"
height="460px"
theme="vs"
- :language="(innerLanguagesType as Language)"
+ :language="innerLanguagesType"
:read-only="false"
:show-full-screen="false"
:show-theme-change="false"
@@ -86,14 +86,13 @@
import useAppStore from '@/store/modules/app';
import type { CommonScriptItem } from '@/models/projectManagement/commonScript';
- import { RequestConditionScriptLanguage } from '@/enums/apiEnum';
const appStore = useAppStore();
const props = withDefaults(
defineProps<{
showType: 'commonScript' | 'executionResult'; // 执行类型
- language: Language | RequestConditionScriptLanguage;
+ language: Language;
code: string;
enableRadioSelected?: boolean;
executionResult?: string; // 执行结果
@@ -104,7 +103,7 @@
}
);
const emit = defineEmits<{
- (e: 'update:language', value: Language | RequestConditionScriptLanguage): void;
+ (e: 'update:language', value: Language): void;
(e: 'update:code', value: string): void;
}>();
diff --git a/frontend/src/components/business/ms-common-script/utils.ts b/frontend/src/components/business/ms-common-script/utils.ts
index a322300c68..47715d22f4 100644
--- a/frontend/src/components/business/ms-common-script/utils.ts
+++ b/frontend/src/components/business/ms-common-script/utils.ts
@@ -1,4 +1,4 @@
-import { Language } from '@/components/pure/ms-code-editor/types';
+import { Language, LanguageEnum } from '@/components/pure/ms-code-editor/types';
import { useI18n } from '@/hooks/useI18n';
@@ -500,19 +500,19 @@ function jsCode(requestObj) {
export function getCodeTemplate(language: Language | RequestConditionScriptLanguage, requestObj: any) {
switch (language) {
- case 'groovy':
+ case LanguageEnum.GROOVY:
return groovyCode(requestObj);
- case 'python':
+ case LanguageEnum.PYTHON:
return pythonCode(requestObj);
- case 'beanshell':
+ case LanguageEnum.BEANSHELL:
return javaCode(requestObj);
- case 'nashornScript':
+ case LanguageEnum.NASHORNSCRIPT:
return jsCode(requestObj);
- case 'rhinoScript':
+ case LanguageEnum.RHINOSCRIPT:
return jsCode(requestObj);
- case 'javascript':
+ case LanguageEnum.JAVASCRIPT:
return jsCode(requestObj);
- case 'beanshell-jsr233':
+ case LanguageEnum.BEANSHELL_JSR233:
return javaCode(requestObj);
default:
return '';
diff --git a/frontend/src/components/business/ms-params-input/config.ts b/frontend/src/components/business/ms-params-input/config.ts
index d41e626c19..0d5f13996d 100644
--- a/frontend/src/components/business/ms-params-input/config.ts
+++ b/frontend/src/components/business/ms-params-input/config.ts
@@ -459,14 +459,14 @@ export const mockFunctions: MockParamItem[] = [
],
},
{
- label: 'concatconcat',
- value: 'concatconcat',
- desc: 'ms.paramsInput.concatconcatDesc',
+ label: 'concat',
+ value: 'concat',
+ desc: 'ms.paramsInput.concatDesc',
inputGroup: [
{
type: 'input',
value: '',
- label: 'ms.paramsInput.concatconcat',
+ label: 'ms.paramsInput.concat',
placeholder: 'ms.paramsInput.commonPlaceholder',
},
],
diff --git a/frontend/src/components/business/ms-params-input/index.vue b/frontend/src/components/business/ms-params-input/index.vue
index 1c9018b043..90a104fec9 100644
--- a/frontend/src/components/business/ms-params-input/index.vue
+++ b/frontend/src/components/business/ms-params-input/index.vue
@@ -166,7 +166,7 @@
{{ t('ms.paramsInput.preview') }}
diff --git a/frontend/src/components/business/ms-params-input/locale/en-US.ts b/frontend/src/components/business/ms-params-input/locale/en-US.ts
index e207d0d50d..15e1032423 100644
--- a/frontend/src/components/business/ms-params-input/locale/en-US.ts
+++ b/frontend/src/components/business/ms-params-input/locale/en-US.ts
@@ -137,8 +137,8 @@ export default {
'ms.paramsInput.substrDesc': 'Starting and ending',
'ms.paramsInput.substrStartPlaceholder': 'Starting value',
'ms.paramsInput.substrEndPlaceholder': 'Ending value',
- 'ms.paramsInput.concatconcat': 'String to end with',
- 'ms.paramsInput.concatconcatDesc': 'Ending string',
+ 'ms.paramsInput.concat': 'String to end with',
+ 'ms.paramsInput.concatDesc': 'Ending string',
'ms.paramsInput.lconcatDesc': 'Starting string',
'ms.paramsInput.lconcat': 'The string to start with',
'ms.paramsInput.sha1Desc': 'SHA1 encryption',
diff --git a/frontend/src/components/business/ms-params-input/locale/zh-CN.ts b/frontend/src/components/business/ms-params-input/locale/zh-CN.ts
index b4f964427c..10ae7d338a 100644
--- a/frontend/src/components/business/ms-params-input/locale/zh-CN.ts
+++ b/frontend/src/components/business/ms-params-input/locale/zh-CN.ts
@@ -129,8 +129,8 @@ export default {
'ms.paramsInput.substrDesc': '起止',
'ms.paramsInput.substrStartPlaceholder': '起始值',
'ms.paramsInput.substrEndPlaceholder': '结束值',
- 'ms.paramsInput.concatconcat': '要作为结尾的字符串',
- 'ms.paramsInput.concatconcatDesc': '结尾字符串',
+ 'ms.paramsInput.concat': '要作为结尾的字符串',
+ 'ms.paramsInput.concatDesc': '结尾字符串',
'ms.paramsInput.lconcatDesc': '开头字符串',
'ms.paramsInput.lconcat': '要作为开头的字符串',
'ms.paramsInput.sha1Desc': 'sha1 加密',
diff --git a/frontend/src/components/pure/ms-code-editor/index.vue b/frontend/src/components/pure/ms-code-editor/index.vue
index 0bab01de57..1e1e97c509 100644
--- a/frontend/src/components/pure/ms-code-editor/index.vue
+++ b/frontend/src/components/pure/ms-code-editor/index.vue
@@ -75,7 +75,7 @@
name: 'MonacoEditor',
props: editorProps,
emits: ['update:modelValue', 'change'],
- setup(props, { emit }) {
+ setup(props, { emit, slots }) {
const { t } = useI18n();
// 编辑器实例,每次调用组件都会创建独立的实例
let editor: monaco.editor.IStandaloneCodeEditor;
@@ -138,14 +138,14 @@
// 如果传入了语言种类数组,则过滤选项
if (props.languages.includes(e)) {
return {
- label: e,
+ label: e.toLowerCase(),
value: e,
};
}
return false;
}
return {
- label: e,
+ label: e.toLowerCase(),
value: e,
};
})
@@ -172,7 +172,9 @@
props.showThemeChange ||
props.showLanguageChange ||
props.showCharsetChange ||
- props.showFullScreen
+ props.showFullScreen ||
+ slots.leftTitle ||
+ slots.rightTitle
);
watch(
@@ -259,7 +261,7 @@
watch(
() => props.language,
(newValue) => {
- monaco.editor.setModelLanguage(editor.getModel()!, newValue);
+ monaco.editor.setModelLanguage(editor.getModel()!, newValue.toLowerCase()); // 设置语言,语言 ENUM 是大写的,但是 monaco 需要小写
}
);
diff --git a/frontend/src/components/pure/ms-code-editor/types.ts b/frontend/src/components/pure/ms-code-editor/types.ts
index 3a6bb358ec..8ae9df5657 100644
--- a/frontend/src/components/pure/ms-code-editor/types.ts
+++ b/frontend/src/components/pure/ms-code-editor/types.ts
@@ -5,25 +5,25 @@ export type Theme = 'vs' | 'hc-black' | 'vs-dark' | CustomTheme;
export type FoldingStrategy = 'auto' | 'indentation';
export type RenderLineHighlight = 'all' | 'line' | 'none' | 'gutter';
export const LanguageEnum = {
- PLAINTEXT: 'plaintext' as const,
- JAVASCRIPT: 'javascript' as const,
- TYPESCRIPT: 'typescript' as const,
- CSS: 'css' as const,
- LESS: 'less' as const,
- SASS: 'sass' as const,
- HTML: 'html' as const,
- SQL: 'sql' as const,
- JSON: 'json' as const,
- JAVA: 'java' as const,
- PYTHON: 'python' as const,
- XML: 'xml' as const,
- YAML: 'yaml' as const,
- SHELL: 'shell' as const,
- BEANSHELL: 'beanshell' as const,
- BEANSHELL_JSR233: 'beanshell-jsr233' as const,
- GROOVY: 'groovy' as const,
- NASHORNSCRIPT: 'nashornScript' as const,
- RHINOSCRIPT: 'rhinoScript' as const,
+ PLAINTEXT: 'PLAINTEXT' as const,
+ JAVASCRIPT: 'JAVASCRIPT' as const,
+ TYPESCRIPT: 'TYPESCRIPT' as const,
+ CSS: 'CSS' as const,
+ LESS: 'LESS' as const,
+ SASS: 'SASS' as const,
+ HTML: 'HTML' as const,
+ SQL: 'SQL' as const,
+ JSON: 'JSON' as const,
+ JAVA: 'JAVA' as const,
+ PYTHON: 'PYTHON' as const,
+ XML: 'XML' as const,
+ YAML: 'YAML' as const,
+ SHELL: 'SHELL' as const,
+ BEANSHELL: 'BEANSHELL' as const,
+ BEANSHELL_JSR233: 'BEANSHELL_JSR233' as const,
+ GROOVY: 'GROOVY' as const,
+ NASHORNSCRIPT: 'NASHORNSCRIPT' as const,
+ RHINOSCRIPT: 'RHINOSCRIPT' as const,
} as const;
export type Language = (typeof LanguageEnum)[keyof typeof LanguageEnum];
export interface Options {
diff --git a/frontend/src/models/apiTest/debug.ts b/frontend/src/models/apiTest/debug.ts
index 39beae2385..a6b1467464 100644
--- a/frontend/src/models/apiTest/debug.ts
+++ b/frontend/src/models/apiTest/debug.ts
@@ -1,9 +1,10 @@
+import { Language } from '@/components/pure/ms-code-editor/types';
+
import {
RequestAssertionCondition,
RequestAuthType,
RequestBodyFormat,
RequestConditionProcessor,
- RequestConditionScriptLanguage,
RequestContentTypeEnum,
RequestExtractEnvType,
RequestExtractExpressionEnum,
@@ -23,8 +24,6 @@ import {
export type ConditionType = RequestConditionProcessor;
// 断言-匹配条件规则
export type RequestAssertionConditionType = RequestAssertionCondition;
-// 前后置条件-脚本语言类型
-export type RequestConditionScriptLanguageType = RequestConditionScriptLanguage;
// 响应时间信息
export interface ResponseTiming {
dnsLookupTime: number;
@@ -157,7 +156,7 @@ export interface ScriptCommonConfig {
script: string; // 脚本内容
scriptId: string; // 脚本id
scriptName: string; // 脚本名称
- scriptLanguage: RequestConditionScriptLanguageType; // 脚本语言
+ scriptLanguage: Language; // 脚本语言
params: KeyValueParam[]; // 公共脚本参数
}
// 断言-响应体断言
diff --git a/frontend/src/views/api-test/components/batchAddKeyVal.vue b/frontend/src/views/api-test/components/batchAddKeyVal.vue
index 92072ca1dd..082e2ef01b 100644
--- a/frontend/src/views/api-test/components/batchAddKeyVal.vue
+++ b/frontend/src/views/api-test/components/batchAddKeyVal.vue
@@ -10,32 +10,31 @@
@confirm="applyBatchParams"
>
- {{ t('common.batchAdd') }}
-
-
-
- {{ t('apiTestDebug.batchAddParamsTip2') }}
- {{ t('apiTestDebug.batchAddParamsTip3') }}
-
-
+
+ {{ t('common.batchAdd') }}
+
+
+
+ {{ t('apiTestDebug.batchAddParamsTip1') }}
+ {{ t('apiTestDebug.batchAddParamsTip2') }}
+ {{ t('apiTestDebug.batchAddParamsTip3') }}
+
+
+
-
-
- {{ t('apiTestDebug.batchAddParamsTip') }}
-
-
@@ -85,7 +84,7 @@
const tempObj: Record
= {}; // 同名参数去重,保留最新的
for (let i = 0; i < arr.length; i++) {
const [key, value] = arr[i].split(':');
- if (key) {
+ if (key || value) {
tempObj[key.trim()] = {
id: new Date().getTime() + i,
...props.defaultParamItem,
diff --git a/frontend/src/views/api-test/components/condition/content.vue b/frontend/src/views/api-test/components/condition/content.vue
index 482ba911ca..b4d4765d21 100644
--- a/frontend/src/views/api-test/components/condition/content.vue
+++ b/frontend/src/views/api-test/components/condition/content.vue
@@ -51,7 +51,8 @@
import { useVModel } from '@vueuse/core';
+ import { LanguageEnum } from '@/components/pure/ms-code-editor/types';
import conditionContent from './content.vue';
import conditionList from './list.vue';
@@ -47,7 +48,7 @@
import { useI18n } from '@/hooks/useI18n';
import { ConditionType, ExecuteConditionProcessor } from '@/models/apiTest/debug';
- import { RequestConditionProcessor, RequestConditionScriptLanguage } from '@/enums/apiEnum';
+ import { RequestConditionProcessor } from '@/enums/apiEnum';
const props = defineProps<{
list: ExecuteConditionProcessor[];
@@ -94,19 +95,6 @@
emit('change');
}
- const scriptEx = ref(`2023-12-04 11:19:28 INFO 9026fd6a 1-1 Thread started: 9026fd6a 1-1
-2023-12-04 11:19:28 ERROR 9026fd6a 1-1 Problem in JSR223 script JSR223Sampler, message: {}
-In file: inline evaluation of: prev.getResponseCode() import java.net.URI; import org.apache.http.client.method . . . '' Encountered "import" at line 2, column 1.
-in inline evaluation of: prev.getResponseCode() import java.net.URI; import org.apache.http.client.method . . . '' at line number 2
-javax.script.ScriptException '' at line number 2
-javax.script.ScriptException '' at line number 2
-javax.script.ScriptException '' at line number 2
-javax.script.ScriptException '' at line number 2
-javax.script.ScriptException '' at line number 2
-javax.script.ScriptException
-org.apache.http.client.method . . . '' at line number 2
-`);
-
/**
* 添加条件
*/
@@ -120,9 +108,9 @@ org.apache.http.client.method . . . '' at line number 2
scriptName: t('apiTestDebug.preconditionScriptName'),
enableCommonScript: false,
enable: true,
- script: scriptEx.value,
+ script: '',
scriptId: '',
- scriptLanguage: RequestConditionScriptLanguage.BEANSHELL,
+ scriptLanguage: LanguageEnum.BEANSHELL,
params: [],
});
break;
@@ -134,7 +122,7 @@ org.apache.http.client.method . . . '' at line number 2
// enable: true,
// sqlSource: {
// scriptName: '',
- // script: scriptEx,
+ // script: '',
// storageType: 'column',
// params: [],
// },
diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue
index f9c188e6a4..a2c54f344d 100644
--- a/frontend/src/views/api-test/components/paramTable.vue
+++ b/frontend/src/views/api-test/components/paramTable.vue
@@ -312,7 +312,7 @@
height="300px"
:show-full-screen="false"
>
-
+
{{ t('apiTestDebug.quickInputParamsTip') }}
diff --git a/frontend/src/views/api-test/components/requestComposition/body.vue b/frontend/src/views/api-test/components/requestComposition/body.vue
index 81ae65ea89..5b526b5a6b 100644
--- a/frontend/src/views/api-test/components/requestComposition/body.vue
+++ b/frontend/src/views/api-test/components/requestComposition/body.vue
@@ -88,7 +88,7 @@
:show-full-screen="false"
:language="currentCodeLanguage"
>
-
+
{{ t('apiTestDebug.batchAddParamsTip') }}
diff --git a/frontend/src/views/api-test/components/requestComposition/index.vue b/frontend/src/views/api-test/components/requestComposition/index.vue
index 207f9c60c0..72ed487c1d 100644
--- a/frontend/src/views/api-test/components/requestComposition/index.vue
+++ b/frontend/src/views/api-test/components/requestComposition/index.vue
@@ -42,6 +42,7 @@
v-model:model-value="requestVModel.url"
:max-length="255"
:placeholder="t('apiTestDebug.urlPlaceholder')"
+ allow-clear
@change="handleUrlChange"
/>
@@ -49,7 +50,7 @@
-
- {{ t('common.save') }}
+
+
+ {{ t('common.save') }}
+
{{ t('common.save') }}
{{ t('apiTestManagement.saveAsCase') }}
-
+
{{ t('common.save') }}
(+S)
@@ -84,6 +97,7 @@
v-model:model-value="requestVModel.name"
:max-length="255"
:placeholder="t('apiTestManagement.apiNamePlaceholder')"
+ allow-clear
@change="handleActiveDebugChange"
/>
@@ -612,7 +626,7 @@
const saveModalVisible = ref(false);
const saveModalForm = ref({
name: '',
- path: requestVModel.value.url || '',
+ path: requestVModel.value.url,
moduleId: 'root',
});
const saveModalFormRef = ref();
@@ -772,6 +786,7 @@
...saveModalForm.value,
protocol: requestVModel.value.protocol,
method: isHttpProtocol.value ? requestVModel.value.method : requestVModel.value.protocol,
+ path: requestVModel.value.url || undefined,
});
requestVModel.value.id = res.id;
requestVModel.value.isNew = false;
@@ -779,6 +794,7 @@
requestVModel.value.unSaved = false;
requestVModel.value.name = saveModalForm.value.name;
requestVModel.value.label = saveModalForm.value.name;
+ requestVModel.value.url = saveModalForm.value.path;
saveLoading.value = false;
saveModalVisible.value = false;
done(true);
diff --git a/frontend/src/views/api-test/components/requestComposition/response.vue b/frontend/src/views/api-test/components/requestComposition/response.vue
index cb94755ae6..5c86c0abb9 100644
--- a/frontend/src/views/api-test/components/requestComposition/response.vue
+++ b/frontend/src/views/api-test/components/requestComposition/response.vue
@@ -109,7 +109,7 @@
:language="responseLanguage"
theme="vs"
height="100%"
- :languages="['json', 'html', 'xml', 'plaintext']"
+ :languages="[LanguageEnum.JSON, LanguageEnum.HTML, LanguageEnum.XML, LanguageEnum.PLAINTEXT]"
:show-full-screen="false"
:show-theme-change="false"
show-language-change
@@ -150,6 +150,7 @@
import MsButton from '@/components/pure/ms-button/index.vue';
import MsCodeEditor from '@/components/pure/ms-code-editor/index.vue';
+ import { LanguageEnum } from '@/components/pure/ms-code-editor/types';
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import type { Direction } from '@/components/pure/ms-split-box/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
@@ -246,15 +247,15 @@
const responseLanguage = computed(() => {
const { contentType } = props.response.requestResults[0].responseResult;
if (contentType.includes('json')) {
- return 'json';
+ return LanguageEnum.JSON;
}
if (contentType.includes('html')) {
- return 'html';
+ return LanguageEnum.HTML;
}
if (contentType.includes('xml')) {
- return 'xml';
+ return LanguageEnum.XML;
}
- return 'plaintext';
+ return LanguageEnum.PLAINTEXT;
});
const responseEditorRef = ref>();
diff --git a/frontend/src/views/api-test/debug/index.vue b/frontend/src/views/api-test/debug/index.vue
index 64d913349d..052b12a90f 100644
--- a/frontend/src/views/api-test/debug/index.vue
+++ b/frontend/src/views/api-test/debug/index.vue
@@ -69,7 +69,7 @@
v-model:model-value="curlCode"
theme="MS-text"
height="100%"
- language="plaintext"
+ :language="LanguageEnum.PLAINTEXT"
:show-theme-change="false"
:show-full-screen="false"
>
@@ -84,6 +84,7 @@
import MsCard from '@/components/pure/ms-card/index.vue';
import MsCodeEditor from '@/components/pure/ms-code-editor/index.vue';
+ import { LanguageEnum } from '@/components/pure/ms-code-editor/types';
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsEditableTab from '@/components/pure/ms-editable-tab/index.vue';
import { TabItem } from '@/components/pure/ms-editable-tab/types';
diff --git a/frontend/src/views/api-test/debug/locale/en-US.ts b/frontend/src/views/api-test/debug/locale/en-US.ts
index 60b52b0f62..4793726882 100644
--- a/frontend/src/views/api-test/debug/locale/en-US.ts
+++ b/frontend/src/views/api-test/debug/locale/en-US.ts
@@ -33,8 +33,9 @@ export default {
'apiTestDebug.encodeTip1': 'On: Use encoding',
'apiTestDebug.encodeTip2': 'Off: No encoding is used',
'apiTestDebug.apply': 'Apply',
- 'apiTestDebug.batchAddParamsTip': 'Writing format: parameter name: parameter value; such as nama: natural',
- 'apiTestDebug.batchAddParamsTip2': 'Multiple records are separated by newlines.',
+ 'apiTestDebug.batchAddParamsTip1':
+ 'Writing format: parameter name: parameter value; such as nama:natural, multiple records separated by newline',
+ 'apiTestDebug.batchAddParamsTip2': 'Added as string type by default; file type parameters cannot be edited here',
'apiTestDebug.batchAddParamsTip3':
'Parameter names in batch addition are repeated. By default, the last data is the latest data.',
'apiTestDebug.quickInputParamsTip': 'Support Mock/JMeter/Json/Text/String, etc.',
diff --git a/frontend/src/views/api-test/debug/locale/zh-CN.ts b/frontend/src/views/api-test/debug/locale/zh-CN.ts
index 43bd55b57e..f6d4a16dfc 100644
--- a/frontend/src/views/api-test/debug/locale/zh-CN.ts
+++ b/frontend/src/views/api-test/debug/locale/zh-CN.ts
@@ -33,8 +33,8 @@ export default {
'apiTestDebug.encodeTip1': '开启:使用编码',
'apiTestDebug.encodeTip2': '关闭:不使用编码',
'apiTestDebug.apply': '应用',
- 'apiTestDebug.batchAddParamsTip': '书写格式:参数名:参数值;如 nama:natural',
- 'apiTestDebug.batchAddParamsTip2': '多条记录以换行分隔;',
+ 'apiTestDebug.batchAddParamsTip1': '书写格式:参数名:参数值;如 nama:natural,多条记录以换行分隔',
+ 'apiTestDebug.batchAddParamsTip2': '默认添加为 string 类型;file 类型参数无法在此编辑',
'apiTestDebug.batchAddParamsTip3': '批量添加里的参数名重复,默认以最后一条数据为最新数据',
'apiTestDebug.quickInputParamsTip': '支持Mock/JMeter/Json/Text/String等',
'apiTestDebug.descPlaceholder': '请输入内容',
diff --git a/frontend/src/views/project-management/commonScript/components/scriptDetailDrawer.vue b/frontend/src/views/project-management/commonScript/components/scriptDetailDrawer.vue
index fa229498f7..3d83a1a27b 100644
--- a/frontend/src/views/project-management/commonScript/components/scriptDetailDrawer.vue
+++ b/frontend/src/views/project-management/commonScript/components/scriptDetailDrawer.vue
@@ -77,6 +77,7 @@
import MsButton from '@/components/pure/ms-button/index.vue';
import MsCodeEditor from '@/components/pure/ms-code-editor/index.vue';
+ import { LanguageEnum } from '@/components/pure/ms-code-editor/types';
import MsDrawer from '@/components/pure/ms-drawer/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import type { MsTableColumn } from '@/components/pure/ms-table/type';
@@ -86,7 +87,7 @@
import { getCommonScriptDetail } from '@/api/modules/project-management/commonScript';
import { useI18n } from '@/hooks/useI18n';
- import type { AddOrUpdateCommonScript, ParamsRequestType } from '@/models/projectManagement/commonScript';
+ import type { AddOrUpdateCommonScript } from '@/models/projectManagement/commonScript';
import { TableKeyEnum } from '@/enums/tableEnum';
const { t } = useI18n();
@@ -223,7 +224,7 @@
projectId: '',
params: '',
script: '',
- type: 'beanshell',
+ type: LanguageEnum.BEANSHELL,
result: '',
};
diff --git a/frontend/src/views/project-management/commonScript/utils.ts b/frontend/src/views/project-management/commonScript/utils.ts
index 3a3f8c2204..744a9783fd 100644
--- a/frontend/src/views/project-management/commonScript/utils.ts
+++ b/frontend/src/views/project-management/commonScript/utils.ts
@@ -1,4 +1,4 @@
-import { Language } from '@/components/pure/ms-code-editor/types';
+import { Language, LanguageEnum } from '@/components/pure/ms-code-editor/types';
import { useI18n } from '@/hooks/useI18n';
@@ -507,17 +507,17 @@ function jsCode(requestObj) {
export function getCodeTemplate(language: Language, requestObj: any) {
switch (language) {
- case 'groovy':
+ case LanguageEnum.GROOVY:
return groovyCode(requestObj);
- case 'python':
+ case LanguageEnum.PYTHON:
return pythonCode(requestObj);
- case 'beanshell':
+ case LanguageEnum.BEANSHELL:
return javaCode(requestObj);
- case 'nashornScript':
+ case LanguageEnum.NASHORNSCRIPT:
return jsCode(requestObj);
- case 'rhinoScript':
+ case LanguageEnum.RHINOSCRIPT:
return jsCode(requestObj);
- case 'javascript':
+ case LanguageEnum.JAVASCRIPT:
return jsCode(requestObj);
default:
return '';
diff --git a/frontend/src/views/setting/system/resourcePool/detail.vue b/frontend/src/views/setting/system/resourcePool/detail.vue
index 8ea2a90b35..9eae426bc1 100644
--- a/frontend/src/views/setting/system/resourcePool/detail.vue
+++ b/frontend/src/views/setting/system/resourcePool/detail.vue
@@ -195,7 +195,7 @@