优化混炼示方

This commit is contained in:
geht
2026-05-26 09:52:42 +08:00
parent 72aeee0f10
commit 41f8cef462
7 changed files with 260 additions and 53 deletions

View File

@@ -10,6 +10,7 @@
size="small"
class="mixing-step-select"
popup-class-name="mixing-step-select-dropdown"
:list-height="listHeight"
:placeholder="placeholder"
:get-popup-container="getPopupContainer"
@update:value="handleChange"
@@ -19,9 +20,14 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { useMessage } from '/@/hooks/web/useMessage';
/** 下拉单项高度(与 ant-design-vue small Select 选项行高一致) */
const STEP_SELECT_ITEM_HEIGHT = 32;
/** 下拉最多可见条数 */
const STEP_SELECT_MAX_VISIBLE = 20;
const props = defineProps<{
row: Recordable;
field: string;
@@ -34,6 +40,14 @@
const { createMessage } = useMessage();
const dropdownOpen = ref(false);
//update-begin---author:cursor ---date:20260525 for【XSLMES-20260525-A57】混合步骤动作/组合下拉最多展示20条-----------
const listHeight = computed(() => {
const count = props.options?.length ?? 0;
const visibleCount = count > 0 ? Math.min(count, STEP_SELECT_MAX_VISIBLE) : STEP_SELECT_MAX_VISIBLE;
return visibleCount * STEP_SELECT_ITEM_HEIGHT;
});
//update-end---author:cursor ---date:20260525 for【XSLMES-20260525-A57】混合步骤动作/组合下拉最多展示20条-----------
function handleChange(value: string | undefined) {
props.row[props.field] = value;
}