mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-06 21:40:23 +08:00
fix some style bugs
This commit is contained in:
parent
84f311982d
commit
cc21a427e0
@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { sortBy } from 'lodash-es';
|
||||
import { isArray, sortBy } from 'lodash-es';
|
||||
import {
|
||||
Table as BaseTable,
|
||||
Thead,
|
||||
@ -63,6 +63,7 @@ export const TableImpl = implementTable(
|
||||
}, [data, updateSelectedItem, updateSelectedItems]);
|
||||
|
||||
const sortedData = useMemo(() => {
|
||||
if (!isArray(data)) return [];
|
||||
if (!sortRule) return data;
|
||||
const sorted = sortBy(data, sortRule.key);
|
||||
return sortRule.desc ? sorted.reverse() : sorted;
|
||||
|
@ -153,7 +153,7 @@ export const ComponentForm: React.FC<Props> = observer(props => {
|
||||
</VStack>
|
||||
</VStack>
|
||||
<EventTraitForm component={selectedComponent} services={services} />
|
||||
{ hasFetchTrait ? <FetchTraitForm component={selectedComponent} services={services} /> : null }
|
||||
{ hasFetchTrait ? <FetchTraitForm key={selectedComponent.id} component={selectedComponent} services={services} /> : null }
|
||||
<StyleTraitForm component={selectedComponent} services={services} />
|
||||
<GeneralTraitFormList component={selectedComponent} services={services} />
|
||||
</VStack>
|
||||
|
@ -41,7 +41,7 @@ export const FetchTraitForm: React.FC<Props> = props => {
|
||||
?.properties as Static<typeof FetchTraitPropertiesSchema>;
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: fetchTrait,
|
||||
initialValues: { onComplete: [], onError: [], ...fetchTrait },
|
||||
onSubmit: values => {
|
||||
const index = component.traits.findIndex(t => t.type === 'core/v1/fetch');
|
||||
eventBus.send(
|
||||
|
@ -33,7 +33,7 @@ const ArrayField: React.FC<Props> = props => {
|
||||
<>
|
||||
{formData.map((v, idx) => {
|
||||
return (
|
||||
<Box key={idx} mb={2}>
|
||||
<Box key={idx} mb={2} border='1px solid black' borderColor='gray.200' borderRadius='4' padding='8px'>
|
||||
<ButtonGroup
|
||||
spacing={0}
|
||||
size="xs"
|
||||
|
@ -75,6 +75,7 @@ export const WarningArea: React.FC<Props> = observer(({ services }) => {
|
||||
paddingY="2"
|
||||
paddingX="4"
|
||||
boxShadow="0 0 4px rgba(0, 0, 0, 0.1)"
|
||||
background='white'
|
||||
>
|
||||
<HStack width="full" justifyContent="space-between">
|
||||
<Text fontSize="md" fontWeight="bold">
|
||||
|
Loading…
x
Reference in New Issue
Block a user