diff --git a/src/assets/core.scss b/src/assets/core.scss index 519b99f..cb66d30 100644 --- a/src/assets/core.scss +++ b/src/assets/core.scss @@ -384,10 +384,13 @@ } .options-list-container { - @apply overflow-auto py-1 drop-shadow absolute top-[30px]; + @apply py-2 drop-shadow absolute top-[30px]; border-radius: 0 0 0.75rem 0.75rem; background: linear-gradient(180deg, rgb(244, 247, 252) 0%, rgb(217, 232, 255) 100%); - max-height: calc(100vh - var(--app-header-header) - 300px); + .inner{ + @apply overflow-auto; + max-height: 300px; + } } .options-list { diff --git a/src/components/form/tag-select.tsx b/src/components/form/tag-select.tsx index d93ce47..68a688f 100644 --- a/src/components/form/tag-select.tsx +++ b/src/components/form/tag-select.tsx @@ -1,6 +1,6 @@ -import React, {useMemo, useState} from "react"; +import React, {useMemo, useRef} from "react"; import {Checkbox, Popover} from "antd"; -import {useBoolean} from "ahooks"; +import {useBoolean, useClickAway} from "ahooks"; import {CaretUpOutlined} from "@ant-design/icons"; const TagSelect = (props: { @@ -86,15 +86,24 @@ const TagSelect = (props: { return parentList.findIndex(s => s[1] == item.value) != -1; } + const ref = useRef(null) + useClickAway(()=>{ + set(false) + },ref) - return (
+ return (
set(!visible)} + onClick={(e) => { + e.preventDefault(); + e.stopPropagation(); + set(!visible) + }} > {checkedAll ? '全部来源' : '来源'}
+
  • @@ -110,7 +119,10 @@ const TagSelect = (props: { {(option.children && option.children.length > 0) ? + content={option.children &&
      { + e.preventDefault(); + e.stopPropagation() + }}> {option.children.map((subOption) => { const myCheckStatus = level2Checked(subOption, option) return (
    • ) })}
    +
)