feat: quick add support sort (#1175)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1175
This commit is contained in:
sealday 2024-06-13 05:21:03 +08:00
parent 45edb084b7
commit 7118423925

View File

@ -207,11 +207,15 @@ export const InternalTabs = observer((props) => {
{options.length ? ( {options.length ? (
<Tabs <Tabs
tabPosition="left" tabPosition="left"
items={options.map((item) => ({ items={options
.sort((a, b) => (a.sort != null ? a.sort - b.sort : a.id - b.id))
.map((item) => ({
...item, ...item,
children: ( children: (
<Space style={{ maxHeight: '30vh', overflow: 'auto', padding: '10px 0px 20px 0px' }}> <Space style={{ maxHeight: '30vh', overflow: 'auto', padding: '10px 0px 20px 0px' }}>
{item?.childrenItems?.map((childrenitem, index) => ( {item?.childrenItems
?.sort((a, b) => (a.sort != null ? a.sort - b.sort : a.id - b.id))
.map((childrenitem, index) => (
<Button <Button
key={index} key={index}
onClick={() => { onClick={() => {