style: 修改前后置公共脚本style&断言style

This commit is contained in:
xinxin.wu 2024-04-23 17:23:54 +08:00 committed by 刘瑞斌
parent 23a1fc0fb1
commit 0e03e09a4b
13 changed files with 32 additions and 27 deletions

View File

@ -16,7 +16,7 @@
:selectable="true"
:response="props.response"
:columns="jsonPathColumns"
:scroll="{ minWidth: '700px' }"
:scroll="{ minWidth: '100%' }"
:default-param-item="jsonPathDefaultParamItem"
@change="(data:any[],isInit?: boolean) => handleChange(data, ResponseBodyAssertionType.JSON_PATH,isInit)"
@more-action-select="(e,r)=> handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
@ -123,7 +123,7 @@
:disabled-except-param="props.disabled"
:selectable="true"
:columns="xPathColumns"
:scroll="{ minWidth: '700px' }"
:scroll="{ minWidth: '100%' }"
:default-param-item="defaultAssertParamsItem"
@change="(data:any[],isInit?: boolean) => handleChange(data, ResponseBodyAssertionType.XPATH,isInit)"
@more-action-select="(e,r)=> handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
@ -220,9 +220,7 @@
:disabled-except-param="props.disabled"
:selectable="false"
:columns="documentColumns"
:scroll="{
minWidth: '700px',
}"
:scroll="{ minWidth: '100%' }"
:height-used="580"
:default-param-item="documentDefaultParamItem"
:span-method="documentSpanMethod"
@ -272,7 +270,7 @@
:selectable="true"
:disabled-except-param="props.disabled"
:columns="regexColumns"
:scroll="{ minWidth: '700px' }"
:scroll="{ minWidth: '100%' }"
:default-param-item="regexDefaultParamItem"
@change="(data) => handleChange(data, ResponseBodyAssertionType.REGEX)"
@more-action-select="(e,r)=> handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"

View File

@ -4,7 +4,7 @@
v-model:params="condition.assertions"
:selectable="true"
:columns="columns"
:scroll="{ minWidth: '700px' }"
:scroll="{ minWidth: '100%' }"
:default-param-item="defaultParamItem"
:disabled-except-param="props.disabled"
@change="handleParamTableChange"

View File

@ -1,5 +1,11 @@
<template>
<conditionContent v-model:data="condition" :disabled="props.disabled" @delete="deleteItem" @copy="emit('copy')" />
<conditionContent
v-model:data="condition"
:disabled="props.disabled"
:script-code-editor-height="props.scriptCodeEditorHeight"
@delete="deleteItem"
@copy="emit('copy')"
/>
</template>
<script lang="ts" setup>
@ -14,6 +20,7 @@
interface ScriptTabProps {
data: any;
disabled?: boolean;
scriptCodeEditorHeight?: string; //
}
const props = defineProps<ScriptTabProps>();

View File

@ -3,7 +3,7 @@
v-model:params="condition.variableAssertionItems"
:selectable="true"
:columns="columns"
:scroll="{ minWidth: '700px' }"
:scroll="{ minWidth: '100%' }"
:default-param-item="defaultParamItem"
:disabled-except-param="props.disabled"
@change="handleParamTableChange"

View File

@ -85,6 +85,7 @@
:style="{
overflow: 'auto',
height: '100%',
width: '100%',
}"
>
<!-- 响应头 -->
@ -131,6 +132,7 @@
v-if="getCurrentItemState.assertionType === ResponseAssertionType.SCRIPT"
v-model:data="getCurrentItemState"
:disabled="props.disabled"
:script-code-editor-height="props.scriptCodeEditorHeight"
@change="handleChange"
@delete-script-item="deleteScriptItem"
@copy="copyItem"
@ -188,6 +190,7 @@
response?: string; //
disabled?: boolean; //
showExtraction?: boolean; //
scriptCodeEditorHeight?: string; //
}>();
const emit = defineEmits<{
@ -454,11 +457,11 @@
<style lang="less" scoped>
.ms-assertion {
width: 100%;
height: calc(100% - 22px);
height: 100%;
&-body {
display: flex;
margin-top: 8px;
height: calc(100% - 42px);
height: calc(100% - 52px);
flex-flow: row nowrap;
gap: 8px;
&-left {
@ -528,6 +531,7 @@
}
&-right {
display: flex;
flex: 1;
flex-grow: 1;
border-radius: 4px;
background: var(--color-text-fff);

View File

@ -141,7 +141,6 @@
v-model:params="paramsList"
:confirm-loading="confirmLoading"
:script-id="isEditId"
ok-text="project.commonScript.apply"
:enable-radio-selected="radioSelected"
@save="saveHandler"
/>
@ -387,11 +386,7 @@
await addOrUpdateCommonScriptReq(paramsObj);
showScriptDrawer.value = false;
initData();
Message.success(
form.status === 'DRAFT'
? t('project.commonScript.saveDraftSuccessfully')
: t('project.commonScript.appliedSuccessfully')
);
Message.success(form.id ? t('common.updateSuccess') : t('common.createSuccess'));
} catch (error) {
console.log(error);
} finally {

View File

@ -9,7 +9,7 @@
:ok-loading="props.confirmLoading"
:mask-closable="false"
save-continue-text="project.commonScript.saveAsDraft"
ok-text="project.commonScript.apply"
:ok-text="form.id ? t('common.update') : t('common.create')"
@confirm="handleDrawerConfirm"
@cancel="handleDrawerCancel"
>
@ -209,8 +209,8 @@
}
function handleDrawerCancel() {
emit('close');
reset();
emit('close');
}
const editScriptId = ref<string | undefined>('');

View File

@ -20,13 +20,13 @@
</div>
</div>
<div v-if="props.showType === 'commonScript'" class="flex bg-[var(--color-bg-3)]">
<div class="relative w-full">
<div class="relative h-full w-full">
<MsCodeEditor
ref="codeEditorRef"
v-model:model-value="code"
title=""
:width="expandMenu ? '100%' : '68%'"
height="460px"
:height="props.scriptCodeEditorHeight || '460px'"
theme="vs"
:language="language"
:read-only="props.disabled"
@ -95,6 +95,7 @@
disabled?: boolean;
enableRadioSelected?: boolean;
showHeader?: boolean;
scriptCodeEditorHeight?: string;
}>(),
{
showHeader: true,

View File

@ -196,6 +196,7 @@
:disabled="props.disabled"
show-type="commonScript"
:show-header="false"
:script-code-editor-height="props.scriptCodeEditorHeight"
@change="() => emit('change')"
/>
</div>
@ -535,6 +536,7 @@
showPrePostRequest?: boolean; //
totalList?: ExecuteConditionProcessor[]; //
sqlCodeEditorHeight?: string; // sql
scriptCodeEditorHeight?: string; //
}>(),
{
showAssociatedScene: false,

View File

@ -4,6 +4,7 @@
:is-definition="false"
:assertion-config="assertionConfig"
:show-extraction="true"
script-code-editor-height="calc(100vh - 340px)"
@change="emit('change')"
/>
</template>

View File

@ -225,6 +225,7 @@
:disabled="!isEditableApi"
:assertion-config="requestVModel.children[0].assertionConfig"
:show-extraction="true"
script-code-editor-height="calc(100vh - 242px)"
/>
<auth
v-else-if="requestVModel.activeTab === RequestComposition.AUTH"

View File

@ -29,6 +29,7 @@
v-model:data="activeItem"
:disabled="isReadonly"
:is-build-in="true"
script-code-editor-height="calc(100vh - 306px)"
@change="unSaved = true"
/>
</div>

View File

@ -115,7 +115,6 @@
v-model:params="paramsList"
:confirm-loading="confirmLoading"
:script-id="isEditId"
ok-text="project.commonScript.apply"
:enable-radio-selected="radioSelected"
@save="saveHandler"
/>
@ -372,11 +371,7 @@
await addOrUpdateCommonScriptReq(paramsObj);
showScriptDrawer.value = false;
initData();
Message.success(
form.status === 'DRAFT'
? t('project.commonScript.saveDraftSuccessfully')
: t('project.commonScript.appliedSuccessfully')
);
Message.success(form.id ? t('common.updateSuccess') : t('common.createSuccess'));
if (showDetailDrawer.value) {
scriptDetailDrawer.value.getDetail();
}