bill 2 лет назад
Родитель
Сommit
1920991473

+ 1 - 0
src/views/draw-file/board/index.d.ts

@@ -62,6 +62,7 @@ export type Board = {
   setImage(url: string): void
   getStore(): Promise<BoardData>
   calcTableShape(data: string[][]): Promise<TableShapeData>
+  initHistory(): void;
   setDefaultTable(bottomData: TableShapeData['content'] | null, topData: setDefaultTable['content'] | null)
   export(): Promise<Blob>
   destroy(): void

+ 3 - 0
src/views/draw-file/board/index.js

@@ -125,6 +125,9 @@ export const create = (store, canvas) => {
         layer.uiControl.initTopTable(rtTable)
       }
     },
+    initHistory() {
+      history.init()
+    },
     readyAddShape(shapeType, onFine) {
       layer.uiControl.selectUI = shapeType
       layer.uiControl.updateEventNameForSelectUI()

+ 3 - 1
src/views/draw-file/eshape.tsx

@@ -248,8 +248,10 @@ export const EShape = ({ board }: EShapeProps) => {
         ["绘图时间", ""]
       ]).then(data => {
         board.setDefaultTable(data.content, null)
+        board.initHistory()
       })
-      
+    } else {
+      board.initHistory()
     }
   }, [user, board, path?.id])
 

+ 0 - 1
src/views/draw-file/header.tsx

@@ -1,4 +1,3 @@
-import { ArrowLeftOutlined } from "@ant-design/icons"
 import { Button, Form, Input, Popover } from "antd"
 import { useNavigate, fillRoutePath, RoutePath, usePathData } from "router"
 import { saveAs } from 'utils'