| | |
| | | <template> |
| | | <div :class="bem()" class="flex px-2 py-1.5 items-center"> |
| | | <div :class="bem()" class="flex mb-1 px-2 py-1.5 items-center"> |
| | | <slot name="headerTitle" v-if="slots.headerTitle"></slot> |
| | | <BasicTitle :helpMessage="helpMessage" v-if="!slots.headerTitle && title"> |
| | | {{ title }} |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { type PropType, computed, ref, watch, useSlots } from 'vue'; |
| | | import { Dropdown, Menu, MenuItem, MenuDivider, InputSearch } from 'ant-design-vue'; |
| | | import { |
| | | Dropdown, |
| | | Menu, |
| | | MenuItem, |
| | | MenuDivider, |
| | | InputSearch, |
| | | type MenuProps, |
| | | } from 'ant-design-vue'; |
| | | import Icon from '@/components/Icon/Icon.vue'; |
| | | import { BasicTitle } from '/@/components/Basic'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { BasicTitle } from '@/components/Basic'; |
| | | import { useI18n } from '@/hooks/web/useI18n'; |
| | | import { useDebounceFn } from '@vueuse/core'; |
| | | import { createBEM } from '/@/utils/bem'; |
| | | import { createBEM } from '@/utils/bem'; |
| | | import { ToolbarEnum } from '../types/tree'; |
| | | |
| | | const searchValue = ref(''); |
| | |
| | | default: undefined, |
| | | }, |
| | | } as const); |
| | | const emit = defineEmits(['strictly-change', 'search', 'addHouse']); |
| | | const emit = defineEmits(['strictly-change', 'search']); |
| | | |
| | | const slots = useSlots(); |
| | | const { t } = useI18n(); |
| | |
| | | divider: checkable, |
| | | }, |
| | | ...defaultToolbarList, |
| | | // { label: t('component.tree.checkStrictly'), value: ToolbarEnum.CHECK_STRICTLY }, |
| | | // { label: t('component.tree.checkUnStrictly'), value: ToolbarEnum.CHECK_UN_STRICTLY }, |
| | | { label: t('component.tree.checkStrictly'), value: ToolbarEnum.CHECK_STRICTLY }, |
| | | { label: t('component.tree.checkUnStrictly'), value: ToolbarEnum.CHECK_UN_STRICTLY }, |
| | | ] |
| | | : defaultToolbarList; |
| | | }); |
| | | |
| | | function handleMenuClick(e: { key: ToolbarEnum }) { |
| | | const { key } = e; |
| | | const handleMenuClick: MenuProps['onClick'] = ({ key }) => { |
| | | switch (key) { |
| | | case ToolbarEnum.SELECT_ALL: |
| | | props.checkAll?.(true); |
| | |
| | | emit('strictly-change', true); |
| | | break; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | function emitChange(value?: string): void { |
| | | emit('search', value); |