fix: 树组件调整&接口场景删除文案限制长度

This commit is contained in:
baiqi 2024-07-22 18:00:32 +08:00 committed by 刘瑞斌
parent 73a797f578
commit 4152e6fded
3 changed files with 19 additions and 6 deletions

View File

@ -41,6 +41,7 @@
fixedSize: true, fixedSize: true,
buffer: 15, // 10 padding buffer: 15, // 10 padding
}" }"
hide-switcher-if-no-children
@check="onSelect" @check="onSelect"
> >
<template #title="nodeData"> <template #title="nodeData">
@ -158,6 +159,7 @@
key: itemKey, key: itemKey,
label: itemTitle, label: itemTitle,
children: itemChildren ? travel(itemChildren) : [], children: itemChildren ? travel(itemChildren) : [],
expanded: true,
}); });
} }
}); });
@ -187,6 +189,11 @@
.arco-transfer-view-header { .arco-transfer-view-header {
@apply bg-white; @apply bg-white;
} }
.arco-transfer-view-body {
.ms-tree-container {
padding-left: 16px;
}
}
} }
.arco-transfer-operations { .arco-transfer-operations {
.arco-btn-secondary { .arco-btn-secondary {

View File

@ -31,7 +31,7 @@
<icon-caret-down v-if="_props.expanded" class="text-[var(--color-text-4)]" /> <icon-caret-down v-if="_props.expanded" class="text-[var(--color-text-4)]" />
<icon-caret-right v-else class="text-[var(--color-text-4)]" /> <icon-caret-right v-else class="text-[var(--color-text-4)]" />
</div> </div>
<div v-else class="h-full w-[16px]"></div> <div v-else-if="!props.hideSwitcherIfNoChildren" class="h-full w-[16px]"></div>
</template> </template>
<a-tooltip <a-tooltip
v-if="$slots['title']" v-if="$slots['title']"
@ -126,6 +126,7 @@
actionOnNodeClick?: 'expand'; // actionOnNodeClick?: 'expand'; //
nodeHighlightClass?: string; // nodeHighlightClass?: string; //
hideSwitcher?: boolean; // hideSwitcher?: boolean; //
hideSwitcherIfNoChildren?: boolean; //
handleDrop?: boolean; // handleDrop?: boolean; //
// 使 // 使
// (使 data filterTreeData slot node data使 data filterTreeData ) // (使 data filterTreeData slot node data使 data filterTreeData )
@ -160,6 +161,7 @@
}), }),
disabledTitleTooltip: false, disabledTitleTooltip: false,
useMapData: true, useMapData: true,
hideSwitcherIfNoChildren: false,
} }
); );
@ -275,9 +277,11 @@
}); });
filterTreeData.value = val; filterTreeData.value = val;
} }
if (props.defaultExpandAll && treeRef.value) { nextTick(() => {
treeRef.value.expandAll(true); if (props.defaultExpandAll && treeRef.value) {
} treeRef.value.expandAll(true);
}
});
} else { } else {
updateDebouncedSearch(); updateDebouncedSearch();
} }
@ -303,7 +307,9 @@
}); });
filterTreeData.value = data.value; filterTreeData.value = data.value;
} }
treeRef.value?.expandAll(false); nextTick(() => {
treeRef.value?.expandAll(false);
});
} else { } else {
updateDebouncedSearch(); updateDebouncedSearch();
} }

View File

@ -965,7 +965,7 @@
* 删除接口 * 删除接口
*/ */
function deleteScenario(record?: ApiScenarioTableItem, isBatch?: boolean, params?: ApiScenarioBatchParam) { function deleteScenario(record?: ApiScenarioTableItem, isBatch?: boolean, params?: ApiScenarioBatchParam) {
let title = t('api_scenario.table.deleteScenarioTipTitle', { name: record?.name }); let title = t('api_scenario.table.deleteScenarioTipTitle', { name: characterLimit(record?.name) });
let selectIds = [record?.id || '']; let selectIds = [record?.id || ''];
if (isBatch) { if (isBatch) {
title = t('api_scenario.table.batchDeleteScenarioTip', { title = t('api_scenario.table.batchDeleteScenarioTip', {