Commit 11aabd8214cfb7b4e7a05c8e82aca1631153a80f

Authored by fengwotao
2 parents fc60e8ce 96fc3929

Merge branch 'main_dev' into ft

... ... @@ -292,7 +292,7 @@
292 292 }
293 293
294 294 .split-screen-mode:deep(.ant-spin-container) {
295   - height: 100% !important;
  295 + height: 100%;
296 296 }
297 297
298 298 .video-container {
... ...
... ... @@ -44,6 +44,7 @@
44 44 maxLength: 250,
45 45 ...apiTreeSelectProps,
46 46 value,
  47 + dropdownStyle: { maxHeight: '300px' },
47 48 api: async (params: OrganizationListItem) => {
48 49 try {
49 50 if (!unref(needReload)) return unref(orgList);
... ...
1 1 <template>
2   - <div class="organization-tree flex relative items-center py-4" :class="foldFlag ? '' : 'pl-4'">
  2 + <div
  3 + ref="tree"
  4 + class="organization-tree flex relative items-center py-4"
  5 + :class="foldFlag ? '' : 'pl-4'"
  6 + >
3 7 <div
4 8 class="cursor-pointer flex py-4 fold-icon absolute rounded svg:fill-gray-400 hover:bg-gray-200"
5 9 :class="foldFlag ? '' : '-right-4'"
... ... @@ -33,7 +37,9 @@
33 37 import { BasicTree, TreeItem } from '/@/components/Tree';
34 38 import { getOrganizationList } from '/@/api/system/system';
35 39 import { CaretRightOutlined } from '@ant-design/icons-vue';
  40 + import { getBoundingClientRect } from '/@/utils/domUtils';
36 41
  42 + const tree = ref<Nullable<HTMLDivElement>>();
37 43 const emit = defineEmits(['select']);
38 44 const treeData = ref<TreeItem[]>([]);
39 45 const selectedKeys = ref<string[]>();
... ... @@ -57,11 +63,23 @@
57 63 foldFlag.value = !unref(foldFlag);
58 64 };
59 65
  66 + const setTreeHeight = () => {
  67 + const rect = getBoundingClientRect(unref(tree)!);
  68 + if (rect) {
  69 + const { y } = rect as DOMRect;
  70 + const clientHight = document.documentElement.clientHeight;
  71 + const maxHeight = clientHight - y;
  72 + if (unref(tree)) unref(tree)!.style.height = `${maxHeight}px`;
  73 + }
  74 + };
  75 +
60 76 onMounted(async () => {
61 77 treeData.value = (await getOrganizationList()) as unknown as TreeItem[];
62 78 const getAllIds = findForAllId(treeData.value as any, []);
63 79 //设置要展开的id
64 80 treeExpandData.value = getAllIds;
  81 +
  82 + setTreeHeight();
65 83 });
66 84 defineExpose({
67 85 resetOrganization,
... ... @@ -70,6 +88,8 @@
70 88
71 89 <style scoped lang="less">
72 90 .organization-tree {
  91 + max-height: 100vh;
  92 +
73 93 .expand {
74 94 opacity: 0;
75 95 }
... ...
... ... @@ -145,6 +145,7 @@
145 145 onChange(value: string, option: Recordable) {
146 146 handleEmit(FormFieldsEnum.ORGANIZATION, value, option);
147 147 },
  148 + dropdownStyle: { maxHeight: '300px' },
148 149 getPopupContainer: () => document.body,
149 150 };
150 151 },
... ...