|
@@ -1,5 +1,5 @@
|
|
|
import { useEffect, useState } from "react"
|
|
|
-import { Form, Input, Select } from 'antd'
|
|
|
+import { Button, Form, Input, Modal, Select } from 'antd'
|
|
|
import { CloseOutlined } from '@ant-design/icons'
|
|
|
import InputColor from 'react-input-color';
|
|
|
import style from './style.module.scss'
|
|
@@ -41,23 +41,39 @@ const TextInput = ({ shape }: { shape: ExtractShape<'text'> }) => (
|
|
|
</Form.Item>
|
|
|
)
|
|
|
|
|
|
+const ContentInput = ({ shape }: { shape: ExtractShape<'content'> }) => {
|
|
|
+ const [edit, setEdit] = useState(false)
|
|
|
+ const content = shape.data.content || [[]]
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Form.Item label="内容">
|
|
|
+ <Button type="primary" onClick={() => setEdit(true)}>编辑</Button>
|
|
|
+ <Modal open={edit} onCancel={() => setEdit(false)}>
|
|
|
+ <table>
|
|
|
+ { content.map((tds, i) => (<tr key={i}>{tds.map((td, i) => <td key={i}>{td}</td>)}</tr>)) }
|
|
|
+ </table>
|
|
|
+ </Modal>
|
|
|
+ </Form.Item>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
const shapeCompontes: { [key in ShapeType]: ComponentType<{ shape: any }> } = {
|
|
|
- broken: ColorInput,
|
|
|
- text: (props) => <><ColorInput {...props} /><FontSizeInput {...props} /><TextInput {...props} /> </>,
|
|
|
- table: (props) => <><ColorInput {...props} /><FontSizeInput {...props} /> </>,
|
|
|
- rect: ColorInput,
|
|
|
- circular: ColorInput,
|
|
|
- arrow: ColorInput,
|
|
|
- icon: ColorInput,
|
|
|
- cigarette: ColorInput,
|
|
|
- fireoint: ColorInput,
|
|
|
- footPrint: ColorInput,
|
|
|
- footPrintRever: ColorInput,
|
|
|
- shoePrint: ColorInput,
|
|
|
- shoePrintRever: ColorInput,
|
|
|
- fingerPrint: ColorInput,
|
|
|
- corpse: ColorInput,
|
|
|
- theBlood: ColorInput
|
|
|
+ Wall: ColorInput,
|
|
|
+ Tag: (props) => <><ColorInput {...props} /><FontSizeInput {...props} /><TextInput {...props} /> </>,
|
|
|
+ Table: (props) => <><ColorInput {...props} /><FontSizeInput {...props} /><ContentInput {...props} /> </>,
|
|
|
+ Rectangle: ColorInput,
|
|
|
+ Circle: ColorInput,
|
|
|
+ Arrow: ColorInput,
|
|
|
+ Icon: ColorInput,
|
|
|
+ Cigaret: ColorInput,
|
|
|
+ FirePoint: ColorInput,
|
|
|
+ LeftFootPrint: ColorInput,
|
|
|
+ RightFootPrint: ColorInput,
|
|
|
+ LeftShoePrint: ColorInput,
|
|
|
+ RightShoePrint: ColorInput,
|
|
|
+ FingerPrint: ColorInput,
|
|
|
+ DeadBody: ColorInput,
|
|
|
+ BloodStain: ColorInput
|
|
|
}
|
|
|
|
|
|
export type EShapeProps = {
|