style(接口测试): 将协议过滤和展示请求收到两个icon里

This commit is contained in:
teukkk 2024-06-26 15:23:38 +08:00 committed by Craftsman
parent 7a018b2402
commit b31568a240
9 changed files with 53 additions and 49 deletions

View File

@ -1,7 +1,7 @@
@font-face {
font-family: iconfont; /* Project id 3462279 */
src: url('iconfont.woff2?t=1718876831031') format('woff2'), url('iconfont.woff?t=1718876831031') format('woff'),
url('iconfont.ttf?t=1718876831031') format('truetype'), url('iconfont.svg?t=1718876831031#iconfont') format('svg');
src: url('iconfont.woff2?t=1719382977144') format('woff2'), url('iconfont.woff?t=1719382977144') format('woff'),
url('iconfont.ttf?t=1719382977144') format('truetype'), url('iconfont.svg?t=1719382977144#iconfont') format('svg');
}
.iconfont {
font-size: 16px;
@ -10,6 +10,9 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-icon_visible_outlined1::before {
content: '\e7eb';
}
.icon-icon_test_set1::before {
content: '\e7ea';
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "DE、MS项目icon管理",
"glyphs": [
{
"icon_id": "40877565",
"name": "icon_visible_outlined",
"font_class": "icon_visible_outlined1",
"unicode": "e7eb",
"unicode_decimal": 59371
},
{
"icon_id": "40794959",
"name": "icon_test_set",

View File

@ -14,6 +14,8 @@
/>
<missing-glyph />
<glyph glyph-name="icon_visible_outlined1" unicode="&#59371;" d="M509.632 106.688c137.728 0 265.216 87.872 383.36 277.888-115.136 189.312-242.304 276.8-383.36 276.8-140.992 0-267.712-87.424-382.08-276.8 117.44-190.08 244.48-277.888 382.08-277.888zM63.872 346.048a76.288 76.288 0 0 0 0.96 78.4c123.52 214.848 271.744 322.24 444.8 322.24 173.76 0 322.88-108.288 447.488-324.864l1.152-2.048c12.608-22.144 12.544-49.472-0.384-71.424-127.872-217.984-277.312-327.04-448.256-327.04-170.432 0-318.976 108.288-445.76 324.736z m446.4-132.672A170.368 170.368 0 0 0 340.224 384a170.368 170.368 0 0 0 170.048 170.688A170.368 170.368 0 0 0 680.384 384a170.368 170.368 0 0 0-170.112-170.624z m0 85.312c46.976 0 85.12 38.208 85.12 85.312 0 47.168-38.144 85.376-85.12 85.376-46.976 0-85.056-38.208-85.056-85.376 0-47.104 38.08-85.312 85.12-85.312z" horiz-adv-x="1024" />
<glyph glyph-name="icon_test_set1" unicode="&#59370;" d="M128 682.666667a42.666667 42.666667 0 0 0 42.666667-42.666667v-597.333333h640a42.666667 42.666667 0 0 0 0-85.333334H128a42.666667 42.666667 0 0 0-42.666667 42.666667V640a42.666667 42.666667 0 0 0 42.666667 42.666667z m768 170.666666a42.666667 42.666667 0 0 0 42.666667-42.666666v-640a42.666667 42.666667 0 0 0-42.666667-42.666667H298.666667a42.666667 42.666667 0 0 0-42.666667 42.666667V810.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h597.333333z m-42.666667-85.333333H341.333333v-554.666667h512V768z m-128-341.333333a42.666667 42.666667 0 0 0 0-85.333334h-298.666666a42.666667 42.666667 0 0 0 0 85.333334h298.666666z m-128 170.666666a42.666667 42.666667 0 0 0 0-85.333333h-170.666666a42.666667 42.666667 0 1 0 0 85.333333h170.666666z" horiz-adv-x="1024" />
<glyph glyph-name="icon_test_set" unicode="&#59369;" d="M896 512a42.666667 42.666667 0 0 0 42.666667-42.666667v-512a42.666667 42.666667 0 0 0-42.666667-42.666666H128a42.666667 42.666667 0 0 0-42.666667 42.666666V469.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h768z m-42.666667-85.333333H170.666667v-426.666667h682.666666V426.666667zM213.333333 682.666667h597.333334a42.666667 42.666667 0 0 0 0-85.333334H213.333333a42.666667 42.666667 0 1 0 0 85.333334z m42.666667 170.666666h512a42.666667 42.666667 0 0 0 0-85.333333H256a42.666667 42.666667 0 1 0 0 85.333333z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 510 KiB

View File

@ -7,56 +7,44 @@
@set-active-folder="(val: string) => emit('setActiveFolder', val)"
>
<template #expandLeft>
<a-dropdown v-model:popup-visible="visible" :hide-on-select="false">
<!-- 显示请求icon -->
<a-tooltip :content="!isExpandApi ? t('apiTestManagement.expandApi') : t('apiTestManagement.collapseApi')">
<MsButton
v-show="!props.notShowOperation"
v-show="!props.notShowOperation && showExpandApi"
type="icon"
status="secondary"
class="!mr-[4px] p-[4px]"
@click="visible = !visible"
@click="changeApiExpand"
>
<MsIcon :type="`${showExpandApi ? 'icon-icon_more_outlined' : 'icon-icon_protocol'}`" />
<MsIcon :type="`${!isExpandApi ? 'icon-icon_visible_outlined1' : 'icon-icon_preview_close_one'}`" />
</MsButton>
</a-tooltip>
<!-- 协议icon -->
<a-dropdown v-model:popup-visible="visible" :hide-on-select="false">
<a-tooltip :content="t('ms.paramsInput.protocol')">
<MsButton
v-show="!props.notShowOperation"
type="icon"
status="secondary"
:class="`!mr-[4px] p-[4px] ${visible ? 'bg-[rgb(var(--primary-1))] !text-[rgb(var(--primary-4))]' : ''}`"
@click="visible = !visible"
>
<MsIcon type="icon-icon_protocol" />
</MsButton>
</a-tooltip>
<template #content>
<!-- 展开请求的开关 -->
<template v-if="showExpandApi">
<a-doption class="api-expend w-full">
{{ t('apiScenario.api') }}
<a-switch v-model:model-value="isExpandApi" size="small" @click.stop @change="changeApiExpand" />
</a-doption>
<a-dsubmenu>
<template #default>{{ t('ms.paramsInput.protocol') }}</template>
<template #content>
<a-checkbox
class="checkbox-all"
:model-value="isCheckedAll"
:indeterminate="indeterminate"
@change="handleChangeAll"
>{{ t('common.all') }}
</a-checkbox>
<a-checkbox-group direction="vertical" :model-value="selectedProtocols" @change="handleGroupChange">
<a-checkbox v-for="item in allProtocolList" :key="item" :value="item">
{{ item }}
</a-checkbox>
</a-checkbox-group>
</template>
</a-dsubmenu>
</template>
<!-- 没有 展开请求的开关 -->
<template v-else>
<a-checkbox
class="checkbox-all"
:model-value="isCheckedAll"
:indeterminate="indeterminate"
@change="handleChangeAll"
>{{ t('common.all') }}
<a-checkbox
class="checkbox-all"
:model-value="isCheckedAll"
:indeterminate="indeterminate"
@change="handleChangeAll"
>{{ t('common.all') }}
</a-checkbox>
<a-checkbox-group direction="vertical" :model-value="selectedProtocols" @change="handleGroupChange">
<a-checkbox v-for="item in allProtocolList" :key="item" :value="item">
{{ item }}
</a-checkbox>
<a-checkbox-group direction="vertical" :model-value="selectedProtocols" @change="handleGroupChange">
<a-checkbox v-for="item in allProtocolList" :key="item" :value="item">
{{ item }}
</a-checkbox>
</a-checkbox-group>
</template>
</a-checkbox-group>
</template>
</a-dropdown>
</template>
@ -132,9 +120,12 @@
}
}
function changeApiExpand(value: string | number | boolean) {
setLocalStorage('isExpandApi', value);
emit('changeApiExpand');
function changeApiExpand() {
isExpandApi.value = !isExpandApi.value;
nextTick(() => {
setLocalStorage('isExpandApi', isExpandApi.value);
emit('changeApiExpand');
});
}
watch(

View File

@ -192,6 +192,7 @@
import useModal from '@/hooks/useModal';
import useAppStore from '@/store/modules/app';
import { characterLimit, mapTree } from '@/utils';
import { getLocalStorage } from '@/utils/local-storage';
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
import { ApiDefinitionGetModuleParams } from '@/models/apiTest/management';
@ -348,7 +349,7 @@
const allFileCount = computed(() => modulesCount.value.all || 0);
const isExpandAll = ref(props.isExpandAll);
const rootModulesName = ref<string[]>([]); //
const isExpandApi = ref(false);
const isExpandApi = ref(getLocalStorage('isExpandApi') === 'true');
const lastModuleCountParam = ref<ApiDefinitionGetModuleParams>({
projectId: appStore.currentProjectId,
keyword: '',