Build lightweight AI agent admin

This commit is contained in:
Codex
2026-06-08 18:14:59 +08:00
commit e164840f43
2530 changed files with 435693 additions and 0 deletions
@@ -0,0 +1,34 @@
import { onMounted, onBeforeUnmount, watch } from 'vue';
import type { DrawData } from '../types';
import { useDrawStore } from '../store/draw-store';
export function useDrawEngine(opts: {
initialData?: DrawData | null;
readonly?: boolean;
}) {
const store = useDrawStore();
onMounted(() => {
store.init();
if (opts.initialData) {
store.loadDrawData(opts.initialData);
}
store.requestRender();
});
watch(
() => opts.readonly,
(val) => {
store.viewModeEnabled = !!val;
store.requestRender();
},
);
onBeforeUnmount(() => {
store.destroy();
});
return { store };
}