diff --git a/draggable-panels/config.json b/draggable-panels/config.json
index 4465315..92a80f1 100644
--- a/draggable-panels/config.json
+++ b/draggable-panels/config.json
@@ -16,7 +16,7 @@
"materialId": "DesignComponentList"
}
],
- "activeTabId": "6hfm9ux"
+ "activeTabId": "up60643"
},
"centerPanel": {
"id": "center",
@@ -26,12 +26,6 @@
"title": "设计中心",
"content": "新窗口内容",
"materialId": "DesignCenter"
- },
- {
- "id": "rdp9iuv",
- "title": "测试组件A",
- "content": "新窗口内容",
- "materialId": "TestWidget1"
}
],
"activeTabId": "j70ckww"
@@ -147,5 +141,5 @@
"activeTabId": "mxfx11j"
}
},
- "lastUpdated": "2025-12-21T12:24:13.100Z"
+ "lastUpdated": "2025-12-21T13:24:40.794Z"
}
\ No newline at end of file
diff --git a/draggable-panels/design-state.json b/draggable-panels/design-state.json
index 1de3092..0a02733 100644
--- a/draggable-panels/design-state.json
+++ b/draggable-panels/design-state.json
@@ -52,8 +52,20 @@
"列3"
]
}
+ },
+ {
+ "id": "jy87mdv",
+ "componentId": "RadioSelect",
+ "name": "单选器 2",
+ "props": {
+ "options": [
+ "选项1",
+ "选项2",
+ "选项3"
+ ]
+ }
}
],
- "selectedId": "xazr6j9",
- "lastUpdated": "2025-12-21T12:22:52.464Z"
+ "selectedId": "jy87mdv",
+ "lastUpdated": "2025-12-21T13:23:32.873Z"
}
\ No newline at end of file
diff --git a/draggable-panels/src/fauto/components/Footer.vue b/draggable-panels/src/fauto/components/Footer.vue
index 4a1eb84..00fe009 100644
--- a/draggable-panels/src/fauto/components/Footer.vue
+++ b/draggable-panels/src/fauto/components/Footer.vue
@@ -1,5 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/draggable-panels/src/fauto/materials/DesignCenter/index.vue b/draggable-panels/src/fauto/materials/DesignCenter/index.vue
index 9c2aff0..540a7da 100644
--- a/draggable-panels/src/fauto/materials/DesignCenter/index.vue
+++ b/draggable-panels/src/fauto/materials/DesignCenter/index.vue
@@ -2,6 +2,7 @@
import { defineAsyncComponent, markRaw, computed, watch } from 'vue'
import { useDesignStore } from '../../stores/designStore'
import { useVueFileStore } from '../../stores/vueFileStore'
+import InteractiveWrapper from './InteractiveWrapper.vue'
import config from './index.json'
const designStore = useDesignStore()
@@ -72,9 +73,9 @@ watch(() => vueFileStore.selectedFilePath, (newPath) => {
-
+
-
+
diff --git a/draggable-panels/src/fauto/materials/DesignComponentList/index.vue b/draggable-panels/src/fauto/materials/DesignComponentList/index.vue
index ced8265..b2ace1a 100644
--- a/draggable-panels/src/fauto/materials/DesignComponentList/index.vue
+++ b/draggable-panels/src/fauto/materials/DesignComponentList/index.vue
@@ -1,9 +1,12 @@
@@ -28,7 +58,9 @@ const handleAddComponent = (componentId: string) => {
v-for="meta in designStore.componentMetas"
:key="meta.id"
class="component-item"
- @click="handleAddComponent(meta.id)"
+ @click="handleClick(meta.id, meta.name)"
+ @mouseenter="handleMouseEnter(meta.id, meta.name)"
+ @mouseleave="handleMouseLeave"
>
📦
diff --git a/draggable-panels/src/fauto/plugins/index.ts b/draggable-panels/src/fauto/plugins/index.ts
new file mode 100644
index 0000000..07a5cf5
--- /dev/null
+++ b/draggable-panels/src/fauto/plugins/index.ts
@@ -0,0 +1,27 @@
+/**
+ * Fauto 插件系统入口
+ *
+ * 提供全局交互钩子和工具函数
+ */
+
+// 导出交互Store
+export { useInteractionStore } from './interactionStore'
+export type {
+ ElementType,
+ InteractionEvent,
+ InteractionTarget,
+ InteractionState,
+ HookCallback
+} from './interactionStore'
+
+// 导出路径工具
+export {
+ parsePath,
+ buildPath,
+ calculateSiblingIndex,
+ generateElementPath,
+ getParentPath,
+ getPathDepth,
+ isAncestorPath
+} from './pathUtils'
+export type { PathNode } from './pathUtils'
diff --git a/draggable-panels/src/fauto/plugins/interactionStore.ts b/draggable-panels/src/fauto/plugins/interactionStore.ts
new file mode 100644
index 0000000..499812b
--- /dev/null
+++ b/draggable-panels/src/fauto/plugins/interactionStore.ts
@@ -0,0 +1,257 @@
+import { defineStore } from 'pinia'
+import { ref, shallowRef } from 'vue'
+
+/**
+ * 交互元素类型
+ * - er: el-row
+ * - ec: el-col
+ * - dc: design-component (设计组件)
+ */
+export type ElementType = 'er' | 'ec' | 'dc'
+
+/**
+ * 交互事件类型
+ */
+export type InteractionEvent =
+ | 'hover' // 鼠标悬停
+ | 'click' // 鼠标点击
+ | 'longpress' // 鼠标长按
+ | 'drag' // 长按并移动
+ | 'release' // 鼠标松开
+
+/**
+ * 交互目标信息
+ */
+export interface InteractionTarget {
+ type: ElementType // 元素类型
+ path: string // 结构化路径ID (如 r1c2r1c1)
+ componentId?: string // 设计组件ID (仅dc类型)
+ element?: HTMLElement // DOM元素引用
+}
+
+/**
+ * 交互状态信息
+ */
+export interface InteractionState {
+ event: InteractionEvent // 当前事件类型
+ target: InteractionTarget // 目标元素信息
+ timestamp: number // 时间戳
+}
+
+/**
+ * 钩子函数回调类型
+ */
+export type HookCallback = (state: InteractionState) => void
+
+/**
+ * 全局交互钩子插件
+ * 管理所有的鼠标交互事件和状态
+ */
+export const useInteractionStore = defineStore('interaction', () => {
+ // 当前悬停的元素
+ const hoverTarget = ref
(null)
+
+ // 当前点击/选中的元素
+ const selectedTarget = ref(null)
+
+ // 当前拖拽的元素
+ const dragTarget = ref(null)
+
+ // 拖拽放置的目标元素
+ const dropTarget = ref(null)
+
+ // 最后一次交互状态(用于Footer显示)
+ const lastInteraction = ref(null)
+
+ // 是否正在长按
+ const isLongPressing = ref(false)
+
+ // 是否正在拖拽
+ const isDragging = ref(false)
+
+ // 长按计时器
+ let longPressTimer: number | null = null
+
+ // 钩子函数注册表
+ const hooks = shallowRef