12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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<Function, { name: string, icon: string }>([
- [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,
- }
- }
|