diff --git a/frontend/src/assets/style/global.less b/frontend/src/assets/style/global.less index 3da0204fc3..81deb66444 100644 --- a/frontend/src/assets/style/global.less +++ b/frontend/src/assets/style/global.less @@ -121,3 +121,36 @@ body { background-color: rgb(var(--danger-1)); } } + +/* 参数输入框 popover */ +.ms-params-input-popover { + .arco-trigger-popup-wrapper { + .arco-popover-popup-content { + padding: 4px 8px; + } + } + + max-width: 400px; +} +.ms-params-popover-title { + @apply font-medium; + + margin-bottom: 4px; + font-size: 12px; + font-weight: 500; + line-height: 16px; + color: var(--color-text-1); +} +.ms-params-popover-subtitle { + margin-bottom: 2px; + font-size: 12px; + line-height: 16px; + color: var(--color-text-1); +} +.ms-params-popover-value { + min-width: 100px; + max-width: 280px; + font-size: 12px; + line-height: 16px; + color: var(--color-text-1); +} diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue index e5142f82fb..485869d2ac 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue @@ -28,10 +28,10 @@ class="ms-params-input-popover" > @@ -135,10 +135,10 @@ class="ms-params-input-popover" > @@ -282,10 +282,10 @@ class="ms-params-input-popover" > @@ -700,14 +700,14 @@ */ function handleFastExtractionApply( config: RegexExtract | JSONPathExtract | XPathExtract, - matchResult: Record + matchResult: string[] | string ) { condition.value.jsonPathAssertion.assertions = condition.value.jsonPathAssertion.assertions?.map((e: Param) => { if (e.id === activeRecord.value.id) { return { ...e, ...config, - expectedValue: matchResult.join(''), + expectedValue: Array.isArray(matchResult) ? JSON.stringify(matchResult) : matchResult, }; } return e; @@ -817,11 +817,6 @@ } } - /** - * 删除列表项 - */ - function deleteListItem(id: string | number) {} - function showFastExtraction(record: ExpressionConfig, type: ExpressionType) { if (props.disabled || !props.response) return; activeRecord.value = { ...record, extractType: type }; @@ -921,8 +916,4 @@ } } }; - - const handleScriptChange = (data: ExecuteConditionProcessor) => { - condition.value.script = data; - }; diff --git a/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue b/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue index 6d71e562bd..bd47282b15 100644 --- a/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue +++ b/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue @@ -767,7 +767,7 @@ */ function makeMinderParams(fullJson: MinderJson): FeatureCaseMinderUpdateParams { filterTree(fullJson.root.children, (node, nodeIndex, parent) => { - if (node.data.isNew !== false || node.data.changed === true) { + if (node.data?.type !== 'tmp' && (node.data.isNew !== false || node.data.changed === true)) { if (node.data.resource?.includes(moduleTag)) { // 处理模块节点 tempMinderParams.value.updateModuleList.push({ diff --git a/frontend/src/components/business/ms-params-input/index.vue b/frontend/src/components/business/ms-params-input/index.vue index 06fee1a725..93a23e289b 100644 --- a/frontend/src/components/business/ms-params-input/index.vue +++ b/frontend/src/components/business/ms-params-input/index.vue @@ -654,15 +654,6 @@ diff --git a/frontend/src/components/business/ms-quick-input/index.vue b/frontend/src/components/business/ms-quick-input/index.vue index e5d7692d82..3c66480940 100644 --- a/frontend/src/components/business/ms-quick-input/index.vue +++ b/frontend/src/components/business/ms-quick-input/index.vue @@ -1,10 +1,10 @@ @@ -234,10 +225,10 @@ class="ms-params-input-popover" > @@ -246,7 +237,6 @@ :disabled="props.disabledParamValue" class="ms-form-table-input" :placeholder="t('apiTestDebug.commonPlaceholder')" - size="mini" @input="() => addTableLine(rowIndex)" /> @@ -264,9 +254,7 @@ :file-save-as-source-id="props.fileSaveAsSourceId" :file-save-as-api="props.fileSaveAsApi" :file-module-options-api="props.fileModuleOptionsApi" - input-class="ms-form-table-input h-[24px]" - input-size="small" - tag-size="small" + input-class="ms-form-table-input h-[32px]" @change="(files, file) => handleFilesChange(files, record, rowIndex, file)" @delete-file="() => emitChange('deleteFile')" /> @@ -274,7 +262,6 @@ v-else v-model:value="record.value" :disabled="props.disabledParamValue" - size="mini" @change="() => addTableLine(rowIndex, columnConfig.addLineDisabled)" @dblclick="() => quickInputParams(record)" @apply="() => addTableLine(rowIndex, columnConfig.addLineDisabled)" @@ -295,9 +282,7 @@ :file-save-as-source-id="props.fileSaveAsSourceId" :file-save-as-api="props.fileSaveAsApi" :file-module-options-api="props.fileModuleOptionsApi" - input-class="ms-form-table-input h-[24px]" - input-size="small" - tag-size="small" + input-class="ms-form-table-input h-[32px]" @change="(files, file) => handleFileChange(files, record, rowIndex, file)" /> @@ -310,7 +295,6 @@ :placeholder="t('apiTestDebug.paramMin')" :min="0" class="ms-form-table-input ms-form-table-input-number" - size="mini" model-event="input" @change="() => addTableLine(rowIndex)" /> @@ -321,7 +305,6 @@ :placeholder="t('apiTestDebug.paramMax')" :min="0" class="ms-form-table-input" - size="mini" model-event="input" @change="() => addTableLine(rowIndex)" /> @@ -334,7 +317,6 @@ :disabled="props.disabledExceptParam" :max-tag-count="2" input-class="ms-form-table-input" - size="mini" @change="() => addTableLine(rowIndex)" @clear="() => addTableLine(rowIndex)" /> @@ -344,7 +326,6 @@ @@ -388,7 +369,6 @@ @@ -421,7 +401,6 @@ '!mr-[4px] !p-[4px]', ]" :disabled="props.disabledExceptParam" - size="mini" @click="toggleRequired(record, rowIndex)" >
*
@@ -429,7 +408,6 @@
{{ '-' }}
@@ -537,7 +513,6 @@ :disabled="props.disabledExceptParam" :options="Object.values(RequestContentTypeEnum).map((e) => ({ label: e, value: e }))" allow-create - size="mini" @change="(val) => addTableLine(val as number)" /> @@ -1239,20 +1214,9 @@ border-radius: var(--border-radius-small); box-shadow: 0 4px 10px -1px rgb(100 100 102 / 15%); } - .param-popover-title { - @apply font-medium; - - margin-bottom: 4px; - font-size: 12px; - font-weight: 500; - line-height: 16px; - color: var(--color-text-1); - } - .param-popover-value { - min-width: 100px; - max-width: 280px; - font-size: 12px; - line-height: 16px; - color: var(--color-text-1); + :deep(.ms-form-table-input-number) { + .arco-input { + @apply text-right; + } } diff --git a/frontend/src/views/api-test/components/requestComposition/body.vue b/frontend/src/views/api-test/components/requestComposition/body.vue index 54f0584a83..2c52e719d9 100644 --- a/frontend/src/views/api-test/components/requestComposition/body.vue +++ b/frontend/src/views/api-test/components/requestComposition/body.vue @@ -86,7 +86,25 @@ -->
+
+ Schema + + Json +
+
import { TableColumnData } from '@arco-design/web-vue'; + 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 MsJsonSchema from '@/components/pure/ms-json-schema/index.vue'; import { MsFileItem } from '@/components/pure/ms-upload/types'; import MsAddAttachment from '@/components/business/ms-add-attachment/index.vue'; import batchAddKeyVal from '@/views/api-test/components/batchAddKeyVal.vue'; @@ -284,6 +305,8 @@ } }, }); + + const jsonType = ref<'Schema' | 'Json'>('Schema'); // 当前显示的代码 const currentBodyCode = computed({ get() {