From 428f09acdc0daa0625377ac74593e6e3f3a23172 Mon Sep 17 00:00:00 2001 From: Xicheng Guo Date: Thu, 26 Sep 2024 10:34:53 +0800 Subject: [PATCH] update --- .gitignore | 3 +- docs/.vitepress/config.mts | 2 +- docs/inspect/InspectContainer.vue | 6 +- docs/inspect/InspectHeader.vue | 21 ++ docs/inspect/NodeTable.vue | 2 +- .../inspect-node-container/NodeCode.vue | 94 ++++++++ .../5f686585-c5d0-4057-93b2-c54832ffb393.zip | Bin 0 -> 48100 bytes package-lock.json | 215 ++++++++++++++++++ package.json | 4 + 9 files changed, 343 insertions(+), 4 deletions(-) create mode 100644 docs/inspect/inspect-node-container/NodeCode.vue create mode 100644 docs/public/5f686585-c5d0-4057-93b2-c54832ffb393.zip diff --git a/.gitignore b/.gitignore index 6455d757..7e1ca17c 100644 --- a/.gitignore +++ b/.gitignore @@ -96,4 +96,5 @@ coverage scripts/__tests__/examples/dist !scripts/__tests__/examples/dist/.gitkeep *.zip -!capture/*.zip \ No newline at end of file +!capture/*.zip +!5f686585-c5d0-4057-93b2-c54832ffb393.zip \ No newline at end of file diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 2ab53096..3b9b956a 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -18,7 +18,7 @@ export default defineConfig( { text: "首页", link: "/" }, { text: "指南", link: "/guide/intro/what-is-skip" }, { text: "进阶", link: "/advance/layout-inspect/intro" }, - // { text: "布局检查", link: "/inspect/index", target: "_blank" }, + { text: "布局检查", link: "/inspect/index", target: "_blank" }, ], sidebar: { "/guide/": [ diff --git a/docs/inspect/InspectContainer.vue b/docs/inspect/InspectContainer.vue index a6fe8389..7a8c0cc6 100644 --- a/docs/inspect/InspectContainer.vue +++ b/docs/inspect/InspectContainer.vue @@ -19,7 +19,10 @@ :style="{ width: `${nodeTreeWidth}px` }" />
- +
+ + +
@@ -28,6 +31,7 @@ import NodeTree from "./NodeTree.vue"; import NodeTable from "./NodeTable.vue"; import NodePic from "./NodePic.vue"; +import NodeCode from "./inspect-node-container/NodeCode.vue"; import { ref, onMounted, onBeforeUnmount } from "vue"; import { AccessibilityNode, AccessibilityNodeTree, AccessibilityWindow } from "./types"; diff --git a/docs/inspect/InspectHeader.vue b/docs/inspect/InspectHeader.vue index 3602d092..3456a1e2 100644 --- a/docs/inspect/InspectHeader.vue +++ b/docs/inspect/InspectHeader.vue @@ -4,6 +4,7 @@ 批量上传 批量删除 + 获取示例 @@ -50,6 +51,26 @@ const handleOnChange = async () => { }); }; +const handleGetExample = async () => { + const response = await fetch("/5f686585-c5d0-4057-93b2-c54832ffb393.zip"); + const arrayBuffer = await response.arrayBuffer(); + const { added, extractZip } = useZip(arrayBuffer); + await extractZip(); + if (added.value === true) { + emits("uploadSuccess"); + ElNotification({ + title: "示例文件添加成功", + message: "示例文件添加成功", + type: "success", + }); + } else + ElNotification({ + title: "示例文件已存在", + message: "示例文件已存在,无需重复添加", + type: "warning", + }); +}; + onMounted(() => { const el = document.querySelector(".el-upload__input")!; el.oncancel = () => { diff --git a/docs/inspect/NodeTable.vue b/docs/inspect/NodeTable.vue index 530ca2f3..84d8ab34 100644 --- a/docs/inspect/NodeTable.vue +++ b/docs/inspect/NodeTable.vue @@ -1,5 +1,5 @@