diff --git a/src/components/BasicShop/BasicComponents/List/schema.ts b/src/components/BasicShop/BasicComponents/List/schema.ts index 8b91cf7..9ec72ae 100644 --- a/src/components/BasicShop/BasicComponents/List/schema.ts +++ b/src/components/BasicShop/BasicComponents/List/schema.ts @@ -33,6 +33,7 @@ const List: IListSchema = { key: 'sourceData', name: '数据源', type: 'DataList', + cropRate: 1, }, { key: 'round', diff --git a/src/components/PanelComponents/DataList/editorModal.tsx b/src/components/PanelComponents/DataList/editorModal.tsx index cfa6542..3558beb 100644 --- a/src/components/PanelComponents/DataList/editorModal.tsx +++ b/src/components/PanelComponents/DataList/editorModal.tsx @@ -23,10 +23,11 @@ export type EditorModalProps = { onCancel: ((e: React.MouseEvent) => void) | undefined; item?: TDataListDefaultTypeItem; onSave: Function; + cropRate: number; }; const EditorModal: FC = props => { - const { item, onSave, visible, onCancel } = props; + const { item, onSave, visible, onCancel, cropRate } = props; const onFinish = (values: Store) => { console.log(values); onSave && onSave(values); @@ -112,7 +113,7 @@ const EditorModal: FC = props => { valuePropName="fileList" getValueFromEvent={normFile} > - + diff --git a/src/components/PanelComponents/DataList/index.tsx b/src/components/PanelComponents/DataList/index.tsx index 1a82d23..fe3539a 100644 --- a/src/components/PanelComponents/DataList/index.tsx +++ b/src/components/PanelComponents/DataList/index.tsx @@ -129,6 +129,7 @@ const DndItem = DropTarget( export type DataListMemo = { onChange?: (v: TDataListDefaultType) => void; value?: TDataListDefaultType; + cropRate: number; }; export type DataListType = DataListMemo & { @@ -136,7 +137,7 @@ export type DataListType = DataListMemo & { }; const List = function(props: DataListType) { - const { onChange, value, connectDropTarget } = props; + const { onChange, value, connectDropTarget, cropRate } = props; const [list, setList] = useState(value); const [visible, setVisible] = useState(false); const [curItem, setCurItem] = useState(); @@ -230,7 +231,13 @@ const List = function(props: DataListType) { 添加 - + , ); }; diff --git a/src/components/PanelComponents/FormEditor/index.tsx b/src/components/PanelComponents/FormEditor/index.tsx index 26c7da1..3945838 100644 --- a/src/components/PanelComponents/FormEditor/index.tsx +++ b/src/components/PanelComponents/FormEditor/index.tsx @@ -88,7 +88,7 @@ const FormEditor = (props: FormEditorProps) => { )} {item.type === 'DataList' && ( - + )} {item.type === 'Color' && ( diff --git a/src/components/PanelComponents/FormEditor/types.ts b/src/components/PanelComponents/FormEditor/types.ts index d6536f4..4fcafcb 100644 --- a/src/components/PanelComponents/FormEditor/types.ts +++ b/src/components/PanelComponents/FormEditor/types.ts @@ -43,6 +43,7 @@ export interface IDataListConfigType { key: string; name: string; type: 'DataList'; + cropRate: number; } export type TDataListDefaultTypeItem = {