style: 断言显示问题&上传附件调整样式

This commit is contained in:
xinxin.wu 2024-04-16 11:14:17 +08:00 committed by Craftsman
parent b86e967655
commit 95aa98e29c
4 changed files with 35 additions and 20 deletions

View File

@ -12,7 +12,7 @@
:disabled="props.disabled"
:class="getAllScreenClass"
:style="{
width: props.isAllScreen ? `calc(100% - 32px)` : '',
width: props.isAllScreen ? `calc(100% - 0px)` : '',
}"
@change="handleChange"
@before-upload="beforeUpload"
@ -20,7 +20,12 @@
>
<template #upload-button>
<slot>
<div class="ms-upload-area">
<div
class="ms-upload-area"
:class="[
props.isAllScreen ? 'ms-upload-area-dotted-border h-[100vh]' : 'ms-upload-area-thin-border h-[154px]',
]"
>
<div class="ms-upload-icon-box">
<MsIcon
v-if="props.accept !== UploadAcceptEnum.none"
@ -92,7 +97,6 @@
isLimit: boolean; //
draggable: boolean; //
isAllScreen?: boolean; //
cutHeight: number; //
fileTypeTip?: string; //
limit: number; //
allowRepeat?: boolean; //
@ -161,29 +165,19 @@
emit('change', _fileList, fileItem);
}
const total = ref(''); //
const other = ref(''); //
const showDropArea = ref(!props.isAllScreen);
watch(
() => props.isAllScreen,
(val) => {
if (val) {
total.value = '100vh';
other.value = `32px`;
showDropArea.value = false;
} else {
total.value = '154px';
other.value = '0px';
showDropArea.value = true;
}
showDropArea.value = !val;
},
{ immediate: true }
);
const getAllScreenClass = computed(() => {
return props.isAllScreen
? ['!fixed', 'right-0', 'left-0', 'bottom-0', 'top-4', 'm-auto', 'z-[999]', 'opacity-90']
? ['!fixed', 'right-0', 'left-0', 'bottom-0', 'top-0', 'm-auto', 'z-[999]', 'opacity-90']
: [];
});
@ -254,8 +248,6 @@
<style lang="less" scoped>
.ms-upload-area {
height: calc(v-bind(total) - v-bind(other));
border: 1px dashed var(--color-text-input-border);
border-color: rgb(var(--primary-5)) !important;
border-radius: var(--border-radius-small);
background-color: var(--color-text-n9);
@ -287,4 +279,10 @@
line-height: 16px;
}
}
.ms-upload-area-thin-border {
border: 1px dashed var(--color-text-input-border);
}
.ms-upload-area-dotted-border {
border: 4px dashed var(--color-text-input-border);
}
</style>

View File

@ -15,7 +15,11 @@
:active-tab="activeTab"
:request-result="props.requestResult"
/>
<ResAssertion v-else-if="activeTab === 'ASSERTION'" :request-result="props.requestResult" />
<ResAssertion
v-else-if="activeTab === 'ASSERTION'"
:request-result="props.requestResult"
:scroll="{ x: '100%' }"
/>
</div>
</div>
<a-empty

View File

@ -1,6 +1,11 @@
<template>
<a-scrollbar class="overflow-y-auto" :style="{ height: '300px' }">
<MsFormTable :data="props.requestResult?.responseResult.assertions" :columns="columns" :selectable="false">
<MsFormTable
:data="props.requestResult?.responseResult.assertions"
:columns="columns"
:selectable="false"
:scroll="props.scroll"
>
<template #status="{ record }">
<MsTag :type="record.pass === true ? 'success' : 'danger'" theme="light">
{{ record.pass === true ? t('common.success') : t('common.fail') }}
@ -22,6 +27,12 @@
const { t } = useI18n();
const props = defineProps<{
requestResult?: RequestResult;
scroll?: {
x?: number | string;
y?: number | string;
maxHeight?: number | string;
minWidth?: number | string;
};
}>();
const columns: MsTableColumn = [
@ -29,6 +40,7 @@
title: 'apiTestDebug.content',
dataIndex: 'content',
showTooltip: true,
width: 300,
},
{
title: 'apiTestDebug.status',
@ -40,6 +52,7 @@
title: 'apiTestDebug.reason',
dataIndex: 'message',
showTooltip: true,
width: 300,
},
];
</script>

View File

@ -22,7 +22,7 @@
@click="showDetail(record)"
>{{ record.name }}
</div>
<a-popover :title="t('project.commonScript.publicScriptName')" position="right">
<a-popover :title="characterLimit(record.name)" position="right">
<a-button type="text" class="ml-2 px-0">{{ t('project.commonScript.preview') }}</a-button>
<template #content>
<div class="w-[436px] bg-[var(--color-bg-3)] px-2 pb-2">