import { useDraw } from "../use-draw.ts"; export const revoke = () => { } export const recover = () => { } export const clear = () => { } export const rotate = () => { } export const full = () => { } export const aiImport = () => { } export const setBGImage = () => { } export const gotoVR = () => { } export const saveData = () => { } export const exportData = () => { } export const gotoDrawing = () => { } import bgImage from '../../assets/WX20241031-111850.png' export const useHeaderFunds = () => { const draw = useDraw() const setBGImage = () => { draw.value!.addShape('image', { url: bgImage, width: 1, height: 1 }, {x: window.innerWidth / 2, y: window.innerHeight / 2}, true ); } const toggleHit = () => { draw.value?.toggleHit() } const describes = new Map([ [revoke, {name: '撤销', icon: ''}], [recover, {name: '撤销', icon: ''}], [rotate, {name: '旋转', icon: ''}], [clear, {name: '清除', icon: ''}], [full, {name: '全屏', icon: ''}], [aiImport, {name: 'ai导入', icon: ''}], [ setBGImage, {name: '背景图', icon: ''} ], [gotoVR, {name: 'VR', icon: ''}], [saveData, {name: '保存', icon: ''}], [exportData, {name: '导出', icon: ''}], [gotoDrawing, {name: '图纸', icon: ''}], ]) if (import.meta.env.DEV) { describes.set(toggleHit, {name: '显示hit', icon: ''}) } return { revoke, recover, rotate, clear, full, aiImport, setBGImage, gotoVR, saveData, exportData, gotoDrawing, toggleHit, describes, } }