@arronqzy/abuilder-vue 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/package.json +3 -3
- package/src/index.ts +28 -0
package/README.md
CHANGED
|
@@ -95,11 +95,39 @@ validateWorkspaceData(workspace);
|
|
|
95
95
|
|------|------|----------|
|
|
96
96
|
| `workspace:add` | `AbuilderEvents.workspaceAdd` | 创建成功 |
|
|
97
97
|
| `workspace:sync` | `AbuilderEvents.workspaceSync` | 同步成功 |
|
|
98
|
+
| `workspace:delete` | `AbuilderEvents.workspaceDelete` | 删除工作区(界面删除,或调用 `deleteWorkspaceProject` / `clearWorkspaceProjects`),参数 `{ ids, nameSpace }` |
|
|
98
99
|
|
|
99
100
|
`validate*` 只检查。`parseWorkspaceData` 会补齐 `id`、时间戳和空字段。只检查视图用 `validateViewData` / `parseViewData`;只检查蓝图用 `validateBlueprintData` / `parseBlueprintData`。
|
|
100
101
|
|
|
101
102
|
`WorkspaceData` 字段与 React 版相同:`id`、`name`、`createdAt`、`updatedAt`、`panelState`、`blueprintDocument`、`blueprintMeta`、`productName`、`titleIconDataUrl`。
|
|
102
103
|
|
|
104
|
+
### 清理浏览器里的本地数据
|
|
105
|
+
|
|
106
|
+
编辑器把工作区、蓝图库、蓝图执行日志、接口集合四类数据存在 IndexedDB 里,按 `nameSpace` 隔离。以后端为准时,可以清理本地副本,避免堆积:
|
|
107
|
+
|
|
108
|
+
| 数据 | 列出 / 读取 | 删除单条 | 清空 |
|
|
109
|
+
|------|-------------|----------|------|
|
|
110
|
+
| 工作区 | `listWorkspaceProjects` / `getWorkspaceProject` | `deleteWorkspaceProject` | `clearWorkspaceProjects` |
|
|
111
|
+
| 蓝图库 | `listBlueprintLibrary` / `getBlueprintLibraryRecord` | `deleteBlueprintLibraryRecord` | `clearBlueprintLibrary` |
|
|
112
|
+
| 蓝图执行日志 | `listExecutionRunRecords` / `getExecutionRunRecord` | `deleteExecutionRunRecord` | `clearAllExecutionRunRecords` |
|
|
113
|
+
| 接口集合 | `listApiCollectionRecords` | `deleteApiCollection` | `clearApiCollections` |
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import {
|
|
117
|
+
listWorkspaceProjects,
|
|
118
|
+
deleteWorkspaceProject,
|
|
119
|
+
clearWorkspaceProjects,
|
|
120
|
+
clearAbuilderStorage,
|
|
121
|
+
} from "@arronqzy/abuilder-vue";
|
|
122
|
+
|
|
123
|
+
const items = await listWorkspaceProjects(nameSpace);
|
|
124
|
+
await deleteWorkspaceProject(items[0].id, nameSpace);
|
|
125
|
+
const removed = await clearWorkspaceProjects(nameSpace); // 返回删除数量
|
|
126
|
+
const result = await clearAbuilderStorage(nameSpace); // { workspaces, blueprints, executionRuns, apiCollections }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`nameSpace` 要和 `<App :name-space>` 一致。清空函数返回删除数量;`clearAbuilderStorage` 不动主题、字号等偏好设置。删除工作区或蓝图库后,已挂载的编辑器会自动刷新列表,删除工作区还会发出 `workspace:delete` 事件。执行日志可用 `purgeExecutionRunsOlderThan` / `trimExecutionRunRecordsToMax` 按时间或条数清理,保留策略用 `readExecutionLogSettings` / `writeExecutionLogSettings` 读写。
|
|
130
|
+
|
|
103
131
|
## 和 React 版的差别
|
|
104
132
|
|
|
105
133
|
- **没有** `getPreviewSnapshot`。要缩略图就自己截预览 DOM,不要假设有同名导出。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arronqzy/abuilder-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Abuilder Vue 3 可视化编辑器入口包",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"ant-design-vue": "^4.2.6",
|
|
16
16
|
"vue": "^3.5.13",
|
|
17
|
-
"@arronqzy/
|
|
18
|
-
"@arronqzy/
|
|
17
|
+
"@arronqzy/i18n": "0.1.17",
|
|
18
|
+
"@arronqzy/vue-view": "0.1.24"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"vue": "^3.4.0"
|
package/src/index.ts
CHANGED
|
@@ -15,16 +15,44 @@ export {
|
|
|
15
15
|
parseWorkspaceData,
|
|
16
16
|
createEmptyWorkspace,
|
|
17
17
|
createWorkspaceProjectId,
|
|
18
|
+
listWorkspaceProjects,
|
|
19
|
+
getWorkspaceProject,
|
|
20
|
+
deleteWorkspaceProject,
|
|
21
|
+
clearWorkspaceProjects,
|
|
22
|
+
listBlueprintLibrary,
|
|
23
|
+
getBlueprintLibraryRecord,
|
|
24
|
+
deleteBlueprintLibraryRecord,
|
|
25
|
+
clearBlueprintLibrary,
|
|
26
|
+
listExecutionRunRecords,
|
|
27
|
+
getExecutionRunRecord,
|
|
28
|
+
deleteExecutionRunRecord,
|
|
29
|
+
clearAllExecutionRunRecords,
|
|
30
|
+
purgeExecutionRunsOlderThan,
|
|
31
|
+
trimExecutionRunRecordsToMax,
|
|
32
|
+
readExecutionLogSettings,
|
|
33
|
+
writeExecutionLogSettings,
|
|
34
|
+
listApiCollectionRecords,
|
|
35
|
+
deleteApiCollection,
|
|
36
|
+
clearApiCollections,
|
|
37
|
+
clearAbuilderStorage,
|
|
18
38
|
addEventSubscription,
|
|
19
39
|
AbuilderEvents,
|
|
20
40
|
} from "@arronqzy/vue-view";
|
|
21
41
|
export type {
|
|
22
42
|
ParseCheckResult,
|
|
23
43
|
WorkspaceParseCheckResult,
|
|
44
|
+
WorkspaceProjectListItem,
|
|
45
|
+
AbuilderStorageClearResult,
|
|
46
|
+
BlueprintLibraryListItem,
|
|
47
|
+
BlueprintLibraryRecord,
|
|
48
|
+
ExecutionRunRecord,
|
|
49
|
+
ExecutionLogSettings,
|
|
50
|
+
ApiCollectionRecord,
|
|
24
51
|
AbuilderEventName,
|
|
25
52
|
AbuilderEventPayloadMap,
|
|
26
53
|
WorkspaceAddEventPayload,
|
|
27
54
|
WorkspaceSyncEventPayload,
|
|
55
|
+
WorkspaceDeleteEventPayload,
|
|
28
56
|
ApiCollectionUploadStartEventPayload,
|
|
29
57
|
ApiCollectionUploadSuccessEventPayload,
|
|
30
58
|
WorkspaceData,
|