vite-uni-dev-tool 0.0.48 → 1.0.0
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 +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
|
@@ -1,334 +1,420 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Uncaught TypeError: Cannot read property '$' of undefined at uni-app-view.umd.js:7
|
|
18
|
-
-->
|
|
19
|
-
|
|
20
|
-
<Tabs
|
|
21
|
-
v-model="activeTab"
|
|
22
|
-
:items="tabItems"
|
|
23
|
-
:scroll-left="tabScrollLeft"
|
|
24
|
-
@close="onCloseWindow"
|
|
25
|
-
@scroll="debounceScrollTabs"
|
|
26
|
-
@change="onChangeTabs"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<swiper
|
|
30
|
-
class="dev-tool-window-container"
|
|
31
|
-
:current="activeTab"
|
|
32
|
-
@change="onChangeSwiper"
|
|
33
|
-
>
|
|
34
|
-
<!-- <swiper-item>
|
|
35
|
-
<InstanceDetail v-if="activeTab == 0" :contentHeight="contentHeight" />
|
|
36
|
-
</swiper-item> -->
|
|
37
|
-
<swiper-item>
|
|
38
|
-
<ConsoleList
|
|
39
|
-
v-if="swiperShow(tabIndex.Console)"
|
|
40
|
-
:currentConsoleType="currentConsoleType"
|
|
41
|
-
:consoleList="consoleList"
|
|
42
|
-
:sourceFileServers="sourceFileServers"
|
|
43
|
-
:mode="mode"
|
|
44
|
-
:useDevSource="useDevSource"
|
|
45
|
-
:zIndex="zIndex + 1"
|
|
46
|
-
:contentHeight="contentHeight"
|
|
47
|
-
v-model="searchConsole"
|
|
48
|
-
@choose="onConsoleChoose"
|
|
49
|
-
@search="onSearchConsole"
|
|
50
|
-
@run="onRunJS"
|
|
51
|
-
@openCode="onOpenCode"
|
|
52
|
-
@openJson="onOpenJson"
|
|
53
|
-
/>
|
|
54
|
-
</swiper-item>
|
|
55
|
-
<swiper-item>
|
|
56
|
-
<NetworkList
|
|
57
|
-
v-if="swiperShow(tabIndex.Network)"
|
|
58
|
-
v-model="searchNetwork"
|
|
59
|
-
:mode="mode"
|
|
60
|
-
:zIndex="zIndex + 1"
|
|
61
|
-
:networkList="networkList"
|
|
62
|
-
:useDevSource="useDevSource"
|
|
63
|
-
:currentNetworkType="currentNetworkType"
|
|
64
|
-
:currentNetworkSort="currentNetworkSort"
|
|
65
|
-
:contentHeight="contentHeight"
|
|
66
|
-
@choose="onNetworkChoose"
|
|
67
|
-
@search="onSearchNetwork"
|
|
68
|
-
@sort="onSortNetwork"
|
|
69
|
-
@openCode="onOpenCode"
|
|
70
|
-
@openSend="onOpenNetworkSend"
|
|
71
|
-
@openDetail="onOpenNetworkDetail"
|
|
72
|
-
@openIntercept="onOpenNetworkIntercept"
|
|
73
|
-
/>
|
|
74
|
-
</swiper-item>
|
|
75
|
-
<swiper-item>
|
|
76
|
-
<UploadList
|
|
77
|
-
v-if="swiperShow(tabIndex.Upload)"
|
|
78
|
-
:currentUploadType="currentUploadType"
|
|
79
|
-
:uploadList="uploadList"
|
|
80
|
-
:zIndex="zIndex + 1"
|
|
81
|
-
:mode="mode"
|
|
82
|
-
:useDevSource="useDevSource"
|
|
83
|
-
:contentHeight="contentHeight"
|
|
84
|
-
v-model="searchUpload"
|
|
85
|
-
@choose="onUploadChoose"
|
|
86
|
-
@search="onSearchUpload"
|
|
87
|
-
@openDetail="onOpenUploadDetail"
|
|
88
|
-
@openCode="onOpenCode"
|
|
89
|
-
/>
|
|
90
|
-
</swiper-item>
|
|
91
|
-
<swiper-item>
|
|
92
|
-
<WebSocket
|
|
93
|
-
v-if="swiperShow(tabIndex.WebSocket)"
|
|
94
|
-
:wsList="wsList"
|
|
95
|
-
:currentWebSocketType="currentWebSocketType"
|
|
96
|
-
:zIndex="zIndex + 1"
|
|
97
|
-
:contentHeight="contentHeight"
|
|
98
|
-
v-model="searchWs"
|
|
99
|
-
@choose="onWebSocketChoose"
|
|
100
|
-
@search="onSearchWs"
|
|
101
|
-
@openDetail="onOpenWebSocketDetail"
|
|
102
|
-
@openCode="onOpenCode"
|
|
103
|
-
/>
|
|
104
|
-
</swiper-item>
|
|
105
|
-
<swiper-item>
|
|
106
|
-
<RouteList
|
|
107
|
-
v-if="swiperShow(tabIndex.Route)"
|
|
108
|
-
:routeList="routeList"
|
|
109
|
-
:contentHeight="contentHeight"
|
|
110
|
-
v-model="searchRoute"
|
|
111
|
-
@search="onSearchRoute"
|
|
112
|
-
@routeRefresh="onRouteRefresh"
|
|
113
|
-
/>
|
|
114
|
-
</swiper-item>
|
|
115
|
-
<swiper-item>
|
|
116
|
-
<ElEvent
|
|
117
|
-
v-if="swiperShow(tabIndex.ElEvent)"
|
|
118
|
-
:elEventList="elEventList"
|
|
119
|
-
:zIndex="zIndex + 1"
|
|
120
|
-
:contentHeight="contentHeight"
|
|
121
|
-
@clear="onElEventClear"
|
|
122
|
-
@openJson="onOpenJson"
|
|
123
|
-
/>
|
|
124
|
-
</swiper-item>
|
|
125
|
-
<swiper-item>
|
|
126
|
-
<UniEvent
|
|
127
|
-
v-if="swiperShow(tabIndex.UniEvent)"
|
|
128
|
-
:mode="mode"
|
|
129
|
-
:uniEventList="uniEventList"
|
|
130
|
-
:eventCount="eventCount"
|
|
131
|
-
:zIndex="zIndex + 1"
|
|
132
|
-
:useDevSource="useDevSource"
|
|
133
|
-
:sourceFileServers="sourceFileServers"
|
|
134
|
-
:contentHeight="contentHeight"
|
|
135
|
-
@clear="onUniEventClear"
|
|
136
|
-
@openCode="onOpenCode"
|
|
137
|
-
/>
|
|
138
|
-
</swiper-item>
|
|
139
|
-
<swiper-item>
|
|
140
|
-
<CaptureScreen
|
|
141
|
-
v-if="swiperShow(tabIndex.CaptureScreen)"
|
|
142
|
-
:screenList="screenList"
|
|
143
|
-
@clear="onCaptureScreenClear"
|
|
144
|
-
/>
|
|
145
|
-
</swiper-item>
|
|
146
|
-
<swiper-item>
|
|
147
|
-
<ScanCodeList
|
|
148
|
-
v-if="swiperShow(tabIndex.ScanCode)"
|
|
149
|
-
:mode="mode"
|
|
150
|
-
:useDevSource="useDevSource"
|
|
151
|
-
:scanCodeList="scanCodeList"
|
|
152
|
-
:contentHeight="contentHeight"
|
|
153
|
-
@clear="onScanCodeListClear"
|
|
154
|
-
@openCode="onOpenCode"
|
|
155
|
-
@openJson="onOpenJson"
|
|
156
|
-
/>
|
|
157
|
-
</swiper-item>
|
|
158
|
-
<swiper-item>
|
|
159
|
-
<NFCList
|
|
160
|
-
v-if="swiperShow(tabIndex.NFC)"
|
|
161
|
-
:mode="mode"
|
|
162
|
-
:useDevSource="useDevSource"
|
|
163
|
-
:nfcList="nfcList"
|
|
164
|
-
:contentHeight="contentHeight"
|
|
165
|
-
@clear="onNfcClear"
|
|
166
|
-
@openCode="onOpenCode"
|
|
167
|
-
@openJson="onOpenJson"
|
|
168
|
-
@openTool="onOpenNfcTool"
|
|
169
|
-
/>
|
|
170
|
-
</swiper-item>
|
|
171
|
-
<swiper-item>
|
|
172
|
-
<StorageList
|
|
173
|
-
v-if="swiperShow(tabIndex.Storage)"
|
|
174
|
-
v-model:storage-list="storageList"
|
|
175
|
-
v-model="searchStorage"
|
|
176
|
-
:theme="theme"
|
|
177
|
-
@choose="onStorageChoose"
|
|
178
|
-
@remove="onStorageRemove"
|
|
179
|
-
@change="onChangeStorage"
|
|
180
|
-
@search="onSearchStorage"
|
|
181
|
-
/>
|
|
182
|
-
</swiper-item>
|
|
183
|
-
<swiper-item>
|
|
184
|
-
<VuexList
|
|
185
|
-
v-if="swiperShow(tabIndex.Vuex)"
|
|
186
|
-
v-model:vuexList="vuexList"
|
|
187
|
-
:theme="theme"
|
|
188
|
-
:contentHeight="contentHeight"
|
|
189
|
-
@change="onChangeVuex"
|
|
190
|
-
/>
|
|
191
|
-
</swiper-item>
|
|
192
|
-
<swiper-item>
|
|
193
|
-
<PiniaList
|
|
194
|
-
v-if="swiperShow(tabIndex.Pinia)"
|
|
195
|
-
v-model:pinia-list="piniaList"
|
|
196
|
-
:theme="theme"
|
|
197
|
-
:contentHeight="contentHeight"
|
|
198
|
-
@diff-value="onChangePinia"
|
|
199
|
-
/>
|
|
200
|
-
</swiper-item>
|
|
201
|
-
<swiper-item>
|
|
202
|
-
<SettingList
|
|
203
|
-
v-if="swiperShow(tabIndex.Setting)"
|
|
204
|
-
:devToolVisible="devToolVisible"
|
|
205
|
-
:sizeFormat="sizeFormat"
|
|
206
|
-
:theme="theme"
|
|
207
|
-
:buildInfo="buildInfo"
|
|
208
|
-
:cacheInterceptConfig="cacheInterceptConfig"
|
|
209
|
-
:netWorkStatus="netWorkStatus"
|
|
210
|
-
@showDevButton="onShowDevButton"
|
|
211
|
-
@restartDevTool="onRestartDevTool"
|
|
212
|
-
@restartApp="onRestartApp"
|
|
213
|
-
@exportLog="onExportLog"
|
|
214
|
-
@screenshot="onScreenshot"
|
|
215
|
-
@clearCache="onClearCache"
|
|
216
|
-
@destroyDevTool="onDestroyDevTool"
|
|
217
|
-
@changeTheme="onChangeTheme"
|
|
218
|
-
@changeCacheInterceptConfig="onChangeCacheInterceptConfig"
|
|
219
|
-
@openJson="onOpenJson"
|
|
220
|
-
/>
|
|
221
|
-
</swiper-item>
|
|
222
|
-
</swiper>
|
|
223
|
-
|
|
224
|
-
<!-- 源码查看 -->
|
|
225
|
-
<SourceCode
|
|
226
|
-
v-if="openCode"
|
|
227
|
-
:url="stack"
|
|
228
|
-
:mode="mode"
|
|
2
|
+
<AppTransition
|
|
3
|
+
:show="open"
|
|
4
|
+
name="reveal"
|
|
5
|
+
:duration="300"
|
|
6
|
+
:zIndex="zIndex"
|
|
7
|
+
:origin="origin"
|
|
8
|
+
:animated="useTransition"
|
|
9
|
+
@after-enter="onAfterEnter"
|
|
10
|
+
@after-leave="onAfterLeave">
|
|
11
|
+
<DraggableContainer
|
|
12
|
+
ref="draggableRef"
|
|
13
|
+
:x="windowX"
|
|
14
|
+
:y="windowY"
|
|
15
|
+
:width="windowWidth"
|
|
16
|
+
:height="windowHeight"
|
|
229
17
|
:zIndex="zIndex"
|
|
18
|
+
:resizable="true"
|
|
19
|
+
:isFullScreen="isFullScreen"
|
|
20
|
+
:maxWidth="100"
|
|
21
|
+
handle=".drag-handle"
|
|
22
|
+
@update:x="onUpdateWindowX"
|
|
23
|
+
@update:y="onUpdateWindowY"
|
|
24
|
+
@update:width="onUpdateWindowWidth"
|
|
25
|
+
@update:height="onUpdateWindowHeight"
|
|
26
|
+
@change="onWindowChange">
|
|
27
|
+
<view
|
|
28
|
+
:style="dynamicWindowStyle"
|
|
29
|
+
:class="[
|
|
30
|
+
'dev-tool-window',
|
|
31
|
+
isFullScreen ? 'is-full-screen' : 'is-window',
|
|
32
|
+
]">
|
|
33
|
+
<view class="dev-tool-window-bg"></view>
|
|
34
|
+
|
|
35
|
+
<view
|
|
36
|
+
class="window-header drag-handle"
|
|
37
|
+
data-drag-handle="1"
|
|
38
|
+
@touchstart="onInitDrag"
|
|
39
|
+
@mousedown="onInitDrag">
|
|
40
|
+
<view
|
|
41
|
+
class="drag-indicator"
|
|
42
|
+
v-if="!isFullScreen"
|
|
43
|
+
data-drag-handle="1"></view>
|
|
44
|
+
|
|
45
|
+
<!--
|
|
46
|
+
你能想象,没有这条注释会报错???
|
|
47
|
+
我甚至都不知道错在哪里???
|
|
48
|
+
凸(艹皿艹 )
|
|
49
|
+
总有一些莫名其妙的错误
|
|
50
|
+
Uncaught TypeError: Cannot read property 'children' of null at uni-app-view.umd.js:7
|
|
51
|
+
Uncaught TypeError: Cannot read property '$' of undefined at uni-app-view.umd.js:7
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
<Tabs
|
|
55
|
+
data-drag-handle="1"
|
|
56
|
+
:model-value="activeTab"
|
|
57
|
+
:items="tabItems"
|
|
58
|
+
:scroll-left="tabScrollLeft"
|
|
59
|
+
@close="onCloseWindow"
|
|
60
|
+
@scroll="debounceScrollTabs"
|
|
61
|
+
@change="onChangeTabs">
|
|
62
|
+
<template #extra>
|
|
63
|
+
<CircularButton
|
|
64
|
+
:text="isFullScreen ? '❐' : '⛶'"
|
|
65
|
+
@click="toggleFullScreen" />
|
|
66
|
+
</template>
|
|
67
|
+
</Tabs>
|
|
68
|
+
</view>
|
|
69
|
+
|
|
70
|
+
<CustomSwiper
|
|
71
|
+
v-if="isReady"
|
|
72
|
+
:model-value="activeTab"
|
|
73
|
+
:item-count="tabItems.length"
|
|
74
|
+
class="dev-tool-window-container"
|
|
75
|
+
@change="onChangeTabs">
|
|
76
|
+
<!-- Console -->
|
|
77
|
+
<CustomSwiperItem
|
|
78
|
+
v-if="isTabVisible('Console')"
|
|
79
|
+
:key="tabIndex.Console"
|
|
80
|
+
style="width: 100%; height: 100%">
|
|
81
|
+
<ConsoleList
|
|
82
|
+
v-if="swiperShow(tabIndex.Console)"
|
|
83
|
+
:contentHeight="dynamicContentHeight"
|
|
84
|
+
:currentConsoleType="currentConsoleType"
|
|
85
|
+
:consoleList="consoleList"
|
|
86
|
+
:sourceFileServers="sourceFileServers"
|
|
87
|
+
:mode="mode"
|
|
88
|
+
:useDevSource="useDevSource"
|
|
89
|
+
:zIndex="zIndex + 1"
|
|
90
|
+
:model-value="searchConsole"
|
|
91
|
+
@choose="onConsoleChoose"
|
|
92
|
+
@search="onSearchConsole"
|
|
93
|
+
@run="onRunJS"
|
|
94
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
95
|
+
@openJson="overlay.handlers.onOpenJson"
|
|
96
|
+
@update:model-value="onUpdateSearchConsole" />
|
|
97
|
+
</CustomSwiperItem>
|
|
98
|
+
|
|
99
|
+
<!-- Network -->
|
|
100
|
+
<CustomSwiperItem
|
|
101
|
+
v-if="isTabVisible('Network')"
|
|
102
|
+
:key="tabIndex.Network"
|
|
103
|
+
style="width: 100%; height: 100%">
|
|
104
|
+
<NetworkList
|
|
105
|
+
v-if="swiperShow(tabIndex.Network)"
|
|
106
|
+
:contentHeight="dynamicContentHeight"
|
|
107
|
+
:model-value="searchNetwork"
|
|
108
|
+
:mode="mode"
|
|
109
|
+
:zIndex="zIndex + 1"
|
|
110
|
+
:networkList="networkList"
|
|
111
|
+
:useDevSource="useDevSource"
|
|
112
|
+
:currentNetworkType="currentNetworkType"
|
|
113
|
+
:currentNetworkSort="currentNetworkSort"
|
|
114
|
+
@search="onSearchNetwork"
|
|
115
|
+
@choose="onNetworkChoose"
|
|
116
|
+
@sort="onSortNetwork"
|
|
117
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
118
|
+
@openSend="overlay.handlers.onOpenNetworkSend"
|
|
119
|
+
@openDetail="overlay.handlers.onOpenNetworkDetail"
|
|
120
|
+
@openIntercept="overlay.handlers.onOpenNetworkIntercept"
|
|
121
|
+
@update:model-value="onUpdateSearchNetwork" />
|
|
122
|
+
</CustomSwiperItem>
|
|
123
|
+
|
|
124
|
+
<!-- Transfer -->
|
|
125
|
+
<CustomSwiperItem
|
|
126
|
+
v-if="isTabVisible('Transfer')"
|
|
127
|
+
:key="tabIndex.Transfer"
|
|
128
|
+
style="width: 100%; height: 100%">
|
|
129
|
+
<TransferList
|
|
130
|
+
v-if="swiperShow(tabIndex.Transfer)"
|
|
131
|
+
:contentHeight="dynamicContentHeight"
|
|
132
|
+
:currentType="currentTransferType"
|
|
133
|
+
:currentCategory="currentTransferCategory"
|
|
134
|
+
:list="transferList"
|
|
135
|
+
:type="'upload'"
|
|
136
|
+
:zIndex="zIndex + 1"
|
|
137
|
+
:mode="mode"
|
|
138
|
+
:useDevSource="useDevSource"
|
|
139
|
+
:model-value="searchTransfer"
|
|
140
|
+
@choose="onTransferChoose"
|
|
141
|
+
@chooseCategory="handlers.onTransferCategoryChoose"
|
|
142
|
+
@search="onSearchTransfer"
|
|
143
|
+
@openDetail="overlay.handlers.onOpenTransferDetail"
|
|
144
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
145
|
+
@update:model-value="onUpdateSearchTransfer" />
|
|
146
|
+
</CustomSwiperItem>
|
|
147
|
+
|
|
148
|
+
<!-- WebSocket -->
|
|
149
|
+
<CustomSwiperItem
|
|
150
|
+
v-if="isTabVisible('WebSocket')"
|
|
151
|
+
:key="tabIndex.WebSocket"
|
|
152
|
+
style="width: 100%; height: 100%">
|
|
153
|
+
<WebSocket
|
|
154
|
+
v-if="swiperShow(tabIndex.WebSocket)"
|
|
155
|
+
:contentHeight="dynamicContentHeight"
|
|
156
|
+
:wsList="wsList"
|
|
157
|
+
:currentWebSocketType="currentWebSocketType"
|
|
158
|
+
:zIndex="zIndex + 1"
|
|
159
|
+
:model-value="searchWs"
|
|
160
|
+
@search="onSearchWs"
|
|
161
|
+
@choose="onWebSocketChoose"
|
|
162
|
+
@openDetail="
|
|
163
|
+
overlay.handlers.onOpenWebSocketDetail($event, currentWebSocket)
|
|
164
|
+
"
|
|
165
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
166
|
+
@update:model-value="onUpdateSearchWs" />
|
|
167
|
+
</CustomSwiperItem>
|
|
168
|
+
|
|
169
|
+
<!-- Route -->
|
|
170
|
+
<CustomSwiperItem
|
|
171
|
+
v-if="isTabVisible('Route')"
|
|
172
|
+
:key="tabIndex.Route"
|
|
173
|
+
style="width: 100%; height: 100%">
|
|
174
|
+
<RouteList
|
|
175
|
+
v-if="swiperShow(tabIndex.Route)"
|
|
176
|
+
:contentHeight="dynamicContentHeight"
|
|
177
|
+
:routeList="routeList"
|
|
178
|
+
:model-value="searchRoute"
|
|
179
|
+
@search="onSearchRoute"
|
|
180
|
+
@routeRefresh="onRouteRefresh"
|
|
181
|
+
@update:model-value="onUpdateSearchRoute" />
|
|
182
|
+
</CustomSwiperItem>
|
|
183
|
+
|
|
184
|
+
<!-- Instance -->
|
|
185
|
+
<CustomSwiperItem
|
|
186
|
+
v-if="isTabVisible('Instance')"
|
|
187
|
+
:key="tabIndex.Instance"
|
|
188
|
+
style="width: 100%; height: 100%">
|
|
189
|
+
<InstanceDetail
|
|
190
|
+
v-if="swiperShow(tabIndex.Instance)"
|
|
191
|
+
:contentHeight="dynamicContentHeight"
|
|
192
|
+
:theme="theme"
|
|
193
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
194
|
+
@openJson="overlay.handlers.onOpenJson" />
|
|
195
|
+
</CustomSwiperItem>
|
|
196
|
+
|
|
197
|
+
<!-- ElEvent -->
|
|
198
|
+
<CustomSwiperItem
|
|
199
|
+
v-if="isTabVisible('ElEvent')"
|
|
200
|
+
:key="tabIndex.ElEvent"
|
|
201
|
+
style="width: 100%; height: 100%">
|
|
202
|
+
<ElEvent
|
|
203
|
+
v-if="swiperShow(tabIndex.ElEvent)"
|
|
204
|
+
:contentHeight="dynamicContentHeight"
|
|
205
|
+
:elEventList="elEventList"
|
|
206
|
+
:zIndex="zIndex + 1"
|
|
207
|
+
@clear="onElEventClear"
|
|
208
|
+
@openJson="overlay.handlers.onOpenJson" />
|
|
209
|
+
</CustomSwiperItem>
|
|
210
|
+
|
|
211
|
+
<!-- UniEvent -->
|
|
212
|
+
<CustomSwiperItem
|
|
213
|
+
v-if="isTabVisible('UniEvent')"
|
|
214
|
+
:key="tabIndex.UniEvent"
|
|
215
|
+
style="width: 100%; height: 100%">
|
|
216
|
+
<UniEvent
|
|
217
|
+
v-if="swiperShow(tabIndex.UniEvent)"
|
|
218
|
+
:contentHeight="dynamicContentHeight"
|
|
219
|
+
:mode="mode"
|
|
220
|
+
:uniEventList="uniEventList"
|
|
221
|
+
:eventCount="eventCount"
|
|
222
|
+
:zIndex="zIndex + 1"
|
|
223
|
+
:useDevSource="useDevSource"
|
|
224
|
+
:sourceFileServers="sourceFileServers"
|
|
225
|
+
@clear="onUniEventClear"
|
|
226
|
+
@openCode="overlay.handlers.onOpenCode" />
|
|
227
|
+
</CustomSwiperItem>
|
|
228
|
+
|
|
229
|
+
<!-- Performance -->
|
|
230
|
+
<CustomSwiperItem
|
|
231
|
+
v-if="isTabVisible('Performance')"
|
|
232
|
+
:key="tabIndex.Performance"
|
|
233
|
+
style="width: 100%; height: 100%">
|
|
234
|
+
<Performance
|
|
235
|
+
v-if="swiperShow(tabIndex.Performance)"
|
|
236
|
+
:contentHeight="dynamicContentHeight"
|
|
237
|
+
:theme="theme"
|
|
238
|
+
:mode="'tab'" />
|
|
239
|
+
</CustomSwiperItem>
|
|
240
|
+
|
|
241
|
+
<!-- CaptureScreen -->
|
|
242
|
+
<CustomSwiperItem
|
|
243
|
+
v-if="isTabVisible('CaptureScreen')"
|
|
244
|
+
:key="tabIndex.CaptureScreen"
|
|
245
|
+
style="width: 100%; height: 100%">
|
|
246
|
+
<CaptureScreen
|
|
247
|
+
v-if="swiperShow(tabIndex.CaptureScreen)"
|
|
248
|
+
:screenList="screenList"
|
|
249
|
+
@clear="onCaptureScreenClear" />
|
|
250
|
+
</CustomSwiperItem>
|
|
251
|
+
|
|
252
|
+
<!-- ScanCode -->
|
|
253
|
+
<CustomSwiperItem
|
|
254
|
+
v-if="isTabVisible('ScanCode')"
|
|
255
|
+
:key="tabIndex.ScanCode"
|
|
256
|
+
style="width: 100%; height: 100%">
|
|
257
|
+
<ScanCodeList
|
|
258
|
+
v-if="swiperShow(tabIndex.ScanCode)"
|
|
259
|
+
:contentHeight="dynamicContentHeight"
|
|
260
|
+
:mode="mode"
|
|
261
|
+
:useDevSource="useDevSource"
|
|
262
|
+
:scanCodeList="scanCodeList"
|
|
263
|
+
@clear="onScanCodeListClear"
|
|
264
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
265
|
+
@openJson="overlay.handlers.onOpenJson" />
|
|
266
|
+
</CustomSwiperItem>
|
|
267
|
+
|
|
268
|
+
<!-- NFC -->
|
|
269
|
+
<CustomSwiperItem
|
|
270
|
+
v-if="isTabVisible('NFC')"
|
|
271
|
+
:key="tabIndex.NFC"
|
|
272
|
+
style="width: 100%; height: 100%">
|
|
273
|
+
<NFCList
|
|
274
|
+
v-if="swiperShow(tabIndex.NFC)"
|
|
275
|
+
:contentHeight="dynamicContentHeight"
|
|
276
|
+
:mode="mode"
|
|
277
|
+
:useDevSource="useDevSource"
|
|
278
|
+
:nfcList="nfcList"
|
|
279
|
+
@clear="onNfcClear"
|
|
280
|
+
@openCode="overlay.handlers.onOpenCode"
|
|
281
|
+
@openJson="overlay.handlers.onOpenJson"
|
|
282
|
+
@openTool="overlay.handlers.onOpenNfcTool" />
|
|
283
|
+
</CustomSwiperItem>
|
|
284
|
+
|
|
285
|
+
<!-- Storage -->
|
|
286
|
+
<CustomSwiperItem
|
|
287
|
+
v-if="isTabVisible('Storage')"
|
|
288
|
+
:key="tabIndex.Storage"
|
|
289
|
+
style="width: 100%; height: 100%">
|
|
290
|
+
<StorageList
|
|
291
|
+
v-if="swiperShow(tabIndex.Storage)"
|
|
292
|
+
:theme="theme"
|
|
293
|
+
:storageList="storageList"
|
|
294
|
+
:model-value="searchStorage"
|
|
295
|
+
@choose="onStorageChoose"
|
|
296
|
+
@remove="onStorageRemove"
|
|
297
|
+
@change="onChangeStorage"
|
|
298
|
+
@search="onSearchStorage"
|
|
299
|
+
@update:storageList="onUpdateStorageList"
|
|
300
|
+
@update:model-value="onUpdateSearchStorage" />
|
|
301
|
+
</CustomSwiperItem>
|
|
302
|
+
|
|
303
|
+
<!-- Vuex -->
|
|
304
|
+
<CustomSwiperItem
|
|
305
|
+
v-if="isTabVisible('Vuex')"
|
|
306
|
+
:key="tabIndex.Vuex"
|
|
307
|
+
style="width: 100%; height: 100%">
|
|
308
|
+
<VuexList
|
|
309
|
+
v-if="swiperShow(tabIndex.Vuex)"
|
|
310
|
+
:contentHeight="dynamicContentHeight"
|
|
311
|
+
:theme="theme"
|
|
312
|
+
:vuexList="vuexList"
|
|
313
|
+
@change="onChangeVuex"
|
|
314
|
+
@update:vuexList="onUpdateVuexList" />
|
|
315
|
+
</CustomSwiperItem>
|
|
316
|
+
|
|
317
|
+
<!-- Pinia -->
|
|
318
|
+
<CustomSwiperItem
|
|
319
|
+
v-if="isTabVisible('Pinia')"
|
|
320
|
+
:key="tabIndex.Pinia"
|
|
321
|
+
style="width: 100%; height: 100%">
|
|
322
|
+
<PiniaList
|
|
323
|
+
v-if="swiperShow(tabIndex.Pinia)"
|
|
324
|
+
:contentHeight="dynamicContentHeight"
|
|
325
|
+
:theme="theme"
|
|
326
|
+
:piniaList="piniaList"
|
|
327
|
+
@diff-value="onChangePinia"
|
|
328
|
+
@update:piniaList="onUpdatePiniaList" />
|
|
329
|
+
</CustomSwiperItem>
|
|
330
|
+
|
|
331
|
+
<!-- Setting -->
|
|
332
|
+
<CustomSwiperItem
|
|
333
|
+
v-if="isTabVisible('Setting')"
|
|
334
|
+
:key="tabIndex.Setting"
|
|
335
|
+
style="width: 100%; height: 100%">
|
|
336
|
+
<SettingList
|
|
337
|
+
v-if="swiperShow(tabIndex.Setting)"
|
|
338
|
+
:contentHeight="dynamicContentHeight"
|
|
339
|
+
:theme="theme"
|
|
340
|
+
:devToolVisible="devToolVisible"
|
|
341
|
+
:performanceVisible="performanceVisible"
|
|
342
|
+
:performanceShowFps="performanceShowFps"
|
|
343
|
+
:performanceShowCpu="performanceShowCpu"
|
|
344
|
+
:sizeFormat="sizeFormat"
|
|
345
|
+
:buildInfo="buildInfo"
|
|
346
|
+
:cache-intercept-config="cacheInterceptConfig"
|
|
347
|
+
:cache-network-log="cacheNetworkLog"
|
|
348
|
+
:cache-console-log="cacheConsoleLog"
|
|
349
|
+
:use-transition="useTransition"
|
|
350
|
+
:base-font-size="baseFontSize"
|
|
351
|
+
:tag-font-size="tagFontSize"
|
|
352
|
+
:tips-font-size="tipsFontSize"
|
|
353
|
+
:font-family="fontFamily"
|
|
354
|
+
:font-weight="fontWeight"
|
|
355
|
+
:net-work-status="netWorkStatus"
|
|
356
|
+
@showDevButton="onShowDevButton"
|
|
357
|
+
@showPerformance="onChangePerformance"
|
|
358
|
+
@restartDevTool="onRestartDevTool"
|
|
359
|
+
@restartApp="onRestartApp"
|
|
360
|
+
@exportLog="onExportLog"
|
|
361
|
+
@screenshot="onScreenshot"
|
|
362
|
+
@clearCache="onClearCache"
|
|
363
|
+
@destroyDevTool="onDestroyDevTool"
|
|
364
|
+
@change-theme="onChangeTheme"
|
|
365
|
+
@change-cache-intercept-config="onChangeCacheInterceptConfig"
|
|
366
|
+
@change-cache-network-log="onChangeCacheNetworkLog"
|
|
367
|
+
@change-cache-console-log="onChangeCacheConsoleLog"
|
|
368
|
+
@change-use-transition="onChangeUseTransition"
|
|
369
|
+
@changeFont="onChangeFontSize"
|
|
370
|
+
@onChangePerformanceShowFps="onChangePerformanceShowFps"
|
|
371
|
+
@onChangePerformanceShowCpu="onChangePerformanceShowCpu"
|
|
372
|
+
@openJson="overlay.handlers.onOpenJson" />
|
|
373
|
+
</CustomSwiperItem>
|
|
374
|
+
</CustomSwiper>
|
|
375
|
+
</view>
|
|
376
|
+
</DraggableContainer>
|
|
377
|
+
<DevToolOverlay
|
|
378
|
+
v-if="isReady"
|
|
379
|
+
:overlayState="overlay.state"
|
|
380
|
+
:overlayHandlers="overlay.handlers"
|
|
381
|
+
:mode="mode"
|
|
382
|
+
:zIndex="zIndex + 10"
|
|
230
383
|
:sourceFileServers="sourceFileServers"
|
|
231
384
|
:contentHeight="contentHeight"
|
|
232
385
|
:customStyle="customStyle"
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<!-- 发起请求 -->
|
|
237
|
-
<NetworkSend
|
|
238
|
-
v-if="showNetworkSend"
|
|
239
|
-
:zIndex="zIndex"
|
|
240
|
-
:network="network"
|
|
386
|
+
:network="overlay.network"
|
|
387
|
+
:overlay="overlay"
|
|
388
|
+
:currentWebSocket="currentWebSocket"
|
|
241
389
|
:interceptNetworkList="interceptNetworkList"
|
|
242
|
-
:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
:zIndex="zIndex"
|
|
251
|
-
:network="network"
|
|
252
|
-
:interceptNetworkList="interceptNetworkList"
|
|
253
|
-
:contentHeight="contentHeight"
|
|
254
|
-
:customStyle="customStyle"
|
|
255
|
-
@close="onCloseNetworkIntercept"
|
|
256
|
-
@remove="onRemoveInterceptConfig"
|
|
257
|
-
@openConfig="onOpenInterceptConfig"
|
|
258
|
-
/>
|
|
259
|
-
|
|
260
|
-
<!-- 拦截配置 -->
|
|
261
|
-
<InterceptConfig
|
|
262
|
-
v-if="showInterceptConfig"
|
|
263
|
-
:zIndex="zIndex"
|
|
264
|
-
:network="network"
|
|
265
|
-
:customStyle="customStyle"
|
|
266
|
-
@close="onCloseInterceptConfig"
|
|
267
|
-
@confirm="onConfirmInterceptConfig"
|
|
268
|
-
/>
|
|
269
|
-
|
|
270
|
-
<!-- 请求详情 -->
|
|
271
|
-
<NetworkDetail
|
|
272
|
-
v-if="showNetworkDetail"
|
|
273
|
-
:zIndex="zIndex"
|
|
274
|
-
:network="network"
|
|
275
|
-
:contentHeight="contentHeight"
|
|
276
|
-
:customStyle="customStyle"
|
|
277
|
-
@close="onCloseNetworkDetail"
|
|
278
|
-
/>
|
|
279
|
-
|
|
280
|
-
<!-- 上传详情 -->
|
|
281
|
-
<UploadDetail
|
|
282
|
-
v-if="showUploadDetail"
|
|
283
|
-
:upload="upload"
|
|
284
|
-
:zIndex="zIndex"
|
|
285
|
-
:contentHeight="contentHeight"
|
|
286
|
-
:customStyle="customStyle"
|
|
287
|
-
@close="onCloseUploadDetail"
|
|
288
|
-
/>
|
|
289
|
-
<!-- WebSocket详情 -->
|
|
290
|
-
<WebSocketDetail
|
|
291
|
-
v-if="showWebSocketDetail"
|
|
292
|
-
:ws="currentWebSocket"
|
|
293
|
-
:zIndex="zIndex"
|
|
294
|
-
:contentHeight="contentHeight"
|
|
295
|
-
:customStyle="customStyle"
|
|
296
|
-
@close="onCloseWebSocketDetail"
|
|
297
|
-
@clear="onClearWebSocketMessage"
|
|
298
|
-
@openJson="onOpenJson"
|
|
299
|
-
/>
|
|
300
|
-
|
|
301
|
-
<!-- Json详情 -->
|
|
302
|
-
<JsonDetail
|
|
303
|
-
v-if="showJsonDetail"
|
|
304
|
-
:data="jsonData"
|
|
305
|
-
:contentHeight="contentHeight"
|
|
306
|
-
:customStyle="customStyle"
|
|
307
|
-
@close="onCloseJson"
|
|
308
|
-
/>
|
|
309
|
-
|
|
310
|
-
<!-- NFC 工具 -->
|
|
311
|
-
<NFCTool
|
|
312
|
-
v-if="showNfcTool"
|
|
313
|
-
:contentHeight="contentHeight"
|
|
314
|
-
:customStyle="customStyle"
|
|
315
|
-
@close="onCloseNfcTool"
|
|
316
|
-
/>
|
|
317
|
-
</view>
|
|
390
|
+
:onRemoveInterceptConfig="onRemoveInterceptConfig"
|
|
391
|
+
:onConfirmInterceptConfig="onConfirmInterceptConfig"
|
|
392
|
+
:onClearWebSocketMessage="onClearWebSocketMessage"
|
|
393
|
+
:onSendWebSocket="onSendWebSocket"
|
|
394
|
+
:onOpenJson="overlay.handlers.onOpenJson"
|
|
395
|
+
:useTransition="useTransition"
|
|
396
|
+
:theme="theme" />
|
|
397
|
+
</AppTransition>
|
|
318
398
|
</template>
|
|
319
399
|
|
|
400
|
+
<script lang="ts">
|
|
401
|
+
export default {
|
|
402
|
+
__devTool: true,
|
|
403
|
+
};
|
|
404
|
+
</script>
|
|
405
|
+
|
|
320
406
|
<script setup lang="ts">
|
|
321
407
|
import { onShow, onTabItemTap } from '@dcloudio/uni-app';
|
|
322
408
|
import {
|
|
323
|
-
ref,
|
|
324
|
-
shallowRef,
|
|
325
409
|
onMounted,
|
|
326
|
-
reactive,
|
|
327
410
|
computed,
|
|
328
411
|
nextTick,
|
|
329
412
|
onBeforeMount,
|
|
330
413
|
onUnmounted,
|
|
414
|
+
ref,
|
|
415
|
+
watch,
|
|
331
416
|
} from 'vue';
|
|
417
|
+
import AppTransition from '../AppTransition/index.vue';
|
|
332
418
|
import Tabs from '../Tabs/index.vue';
|
|
333
419
|
import ConsoleList from '../ConsoleList/index.vue';
|
|
334
420
|
import NetworkList from '../NetworkList/index.vue';
|
|
@@ -337,168 +423,32 @@ import RouteList from '../RouteList/index.vue';
|
|
|
337
423
|
import SettingList from '../SettingList/index.vue';
|
|
338
424
|
import VuexList from '../VuexList/index.vue';
|
|
339
425
|
import PiniaList from '../PiniaList/index.vue';
|
|
426
|
+
import Performance from '../Performance/index.vue';
|
|
340
427
|
import WebSocket from '../WebSocket/index.vue';
|
|
341
|
-
import
|
|
428
|
+
import TransferList from '../TransferList/index.vue';
|
|
342
429
|
import ElEvent from '../ElEvent/index.vue';
|
|
343
430
|
import UniEvent from '../UniEvent/index.vue';
|
|
344
|
-
|
|
345
431
|
import CaptureScreen from '../CaptureScreen/index.vue';
|
|
346
|
-
import SourceCode from '../SourceCode/index.vue';
|
|
347
432
|
import ScanCodeList from '../ScanCodeList/index.vue';
|
|
348
433
|
import NFCList from '../NFCList/index.vue';
|
|
349
|
-
import
|
|
350
|
-
|
|
351
|
-
import
|
|
352
|
-
import
|
|
353
|
-
import
|
|
354
|
-
import
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
import
|
|
358
|
-
import
|
|
359
|
-
|
|
360
|
-
// import InstanceDetail from '../InstanceDetail/index.vue';
|
|
361
|
-
|
|
362
|
-
import {
|
|
363
|
-
DEV_BUTTON_SHOW_OR_HIDE,
|
|
364
|
-
DEV_CONSOLE_CLEAR,
|
|
365
|
-
DEV_DESTROY,
|
|
366
|
-
DEV_EXPORT_LOG,
|
|
367
|
-
DEV_LOG_CACHE_CLEAR,
|
|
368
|
-
DEV_NETWORK_CLEAR,
|
|
369
|
-
DEV_PINIA_CHANGE,
|
|
370
|
-
DEV_RESTART_APP,
|
|
371
|
-
DEV_RESTART_DEBUGGER,
|
|
372
|
-
DEV_ROUTE_REFRESH,
|
|
373
|
-
DEV_STORAGE_ADD,
|
|
374
|
-
DEV_STORAGE_CLEAR,
|
|
375
|
-
DEV_STORAGE_REFRESH,
|
|
376
|
-
DEV_STORAGE_REMOVE,
|
|
377
|
-
DEV_STORAGE_UPDATE,
|
|
378
|
-
DEV_UPLOAD_CLEAR,
|
|
379
|
-
DEV_VUEX_CHANGE,
|
|
380
|
-
DEV_WEBSOCKET_CLEAR,
|
|
381
|
-
DEV_APP_MESSAGE,
|
|
382
|
-
DEV_UNI_EVENT_CLEAR,
|
|
383
|
-
DEV_RUN_JS,
|
|
384
|
-
DEV_CAPTURE_SCREEN_CLEAR,
|
|
385
|
-
DEV_INTERCEPT_NETWORK_UPDATE,
|
|
386
|
-
DEV_INTERCEPT_NETWORK_REMOVE,
|
|
387
|
-
DEV_CHANGE_CACHE_INTERCEPT_CONFIG,
|
|
388
|
-
DEV_WEBSOCKET_CLEAR_MESSAGE,
|
|
389
|
-
DEV_BOTTOM_TAB_CHANGE,
|
|
390
|
-
DEV_EL_EVENT_CLEAR,
|
|
391
|
-
DEV_SCAN_CODE_CLEAR,
|
|
392
|
-
DEV_NFC_CLEAR,
|
|
393
|
-
} from '../../const';
|
|
394
|
-
import {
|
|
395
|
-
debounce,
|
|
396
|
-
getCurrentPagePath,
|
|
397
|
-
hightLight,
|
|
398
|
-
isAndroid,
|
|
399
|
-
isMockWX,
|
|
400
|
-
} from '../../utils/index';
|
|
434
|
+
import InstanceDetail from '../InstanceDetail/index.vue';
|
|
435
|
+
import DevToolOverlay from './DevToolOverlay.vue';
|
|
436
|
+
import CustomSwiper from '../CustomSwiper/index.vue';
|
|
437
|
+
import CustomSwiperItem from '../CustomSwiper/CustomSwiperItem.vue';
|
|
438
|
+
import DraggableContainer from '../DraggableContainer/index.vue';
|
|
439
|
+
import CircularButton from '../CircularButton/index.vue';
|
|
440
|
+
import { useI18n } from '../../i18n';
|
|
441
|
+
|
|
442
|
+
import { DEV_CORE_MESSAGE, MSG_TYPE, CMD_TYPE } from '../../const';
|
|
443
|
+
import { getCurrentPagePath } from '../../utils/index';
|
|
401
444
|
import type { DevTool } from '../../type';
|
|
402
|
-
import {
|
|
403
|
-
import {
|
|
404
|
-
import { tabItems, emptyNetwork, tabIndex } from './const';
|
|
405
|
-
|
|
406
|
-
const backup: {
|
|
407
|
-
consoleList: DevTool.ConsoleItem[];
|
|
408
|
-
networkList: DevTool.NetworkItem[];
|
|
409
|
-
storageList: DevTool.StorageItem[];
|
|
410
|
-
wsList: DevTool.WS[];
|
|
411
|
-
uploadList: DevTool.UploadItem[];
|
|
412
|
-
routeList: DevTool.Page[];
|
|
413
|
-
uniEventList: DevTool.UniEventItem[];
|
|
414
|
-
runJSList: DevTool.RunJSItem[];
|
|
415
|
-
} = {
|
|
416
|
-
consoleList: [],
|
|
417
|
-
networkList: [],
|
|
418
|
-
storageList: [],
|
|
419
|
-
wsList: [],
|
|
420
|
-
uploadList: [],
|
|
421
|
-
routeList: [],
|
|
422
|
-
uniEventList: [],
|
|
423
|
-
runJSList: [],
|
|
424
|
-
};
|
|
425
|
-
const consoleList = shallowRef<DevTool.ConsoleItem[]>([]);
|
|
426
|
-
const networkList = shallowRef<DevTool.NetworkItem[]>([]);
|
|
427
|
-
const uploadList = shallowRef<DevTool.UploadItem[]>([]);
|
|
428
|
-
const storageList = shallowRef<DevTool.StorageItem[]>([]);
|
|
429
|
-
const routeList = shallowRef<DevTool.Page[]>([]);
|
|
430
|
-
const wsList = shallowRef<DevTool.WS[]>([]);
|
|
431
|
-
const vuexList = shallowRef<Record<string, any>>({});
|
|
432
|
-
const piniaList = shallowRef<Record<string, any>>({});
|
|
433
|
-
|
|
434
|
-
const elEventList = shallowRef<DevTool.ElEventItem[]>([]);
|
|
435
|
-
const uniEventList = shallowRef<DevTool.UniEventItem[]>([]);
|
|
436
|
-
const eventCount = shallowRef<DevTool.EventCount>();
|
|
437
|
-
const screenList = shallowRef<DevTool.ScreenItem[]>([]);
|
|
438
|
-
const interceptNetworkList = shallowRef<DevTool.NetworkItem[]>([]);
|
|
439
|
-
const scanCodeList = shallowRef<DevTool.ScanCodeItem[]>([]);
|
|
440
|
-
const nfcList = shallowRef<DevTool.NFCItem[]>([]);
|
|
441
|
-
|
|
442
|
-
const netWorkStatus = ref<{
|
|
443
|
-
isConnected?: boolean;
|
|
444
|
-
networkType?: string;
|
|
445
|
-
}>({});
|
|
446
|
-
const sizeFormat = shallowRef('');
|
|
447
|
-
|
|
448
|
-
const devToolVisible = shallowRef(true);
|
|
449
|
-
|
|
450
|
-
const activeTab = shallowRef(1);
|
|
451
|
-
const tabScrollLeft = shallowRef(0);
|
|
452
|
-
const currentConsoleType = shallowRef('all');
|
|
453
|
-
const currentNetworkType = shallowRef('all');
|
|
454
|
-
const currentNetworkSort = shallowRef<1 | -1>(1);
|
|
455
|
-
const currentUploadType = shallowRef('all');
|
|
456
|
-
const currentWebSocketType = shallowRef('all');
|
|
457
|
-
|
|
458
|
-
const searchConsole = shallowRef('');
|
|
459
|
-
const searchNetwork = shallowRef('');
|
|
460
|
-
const searchUpload = shallowRef('');
|
|
461
|
-
const searchWs = shallowRef('');
|
|
462
|
-
const searchRoute = shallowRef('');
|
|
463
|
-
const searchStorage = shallowRef('');
|
|
464
|
-
const theme = shallowRef('light');
|
|
465
|
-
const openCode = shallowRef(false);
|
|
466
|
-
const stack = shallowRef('');
|
|
467
|
-
|
|
468
|
-
const network = reactive<DevTool.NetworkItem>({ ...emptyNetwork });
|
|
469
|
-
|
|
470
|
-
const showNetworkSend = shallowRef(false);
|
|
471
|
-
const showNetworkDetail = shallowRef(false);
|
|
472
|
-
const showNetworkIntercept = shallowRef(false);
|
|
473
|
-
const showInterceptConfig = shallowRef(false);
|
|
474
|
-
const cacheInterceptConfig = shallowRef(true);
|
|
475
|
-
|
|
476
|
-
const showJsonDetail = shallowRef(false);
|
|
477
|
-
const jsonData = shallowRef({});
|
|
478
|
-
const showNfcTool = shallowRef(false);
|
|
479
|
-
|
|
480
|
-
const upload = reactive<DevTool.UploadItem>({
|
|
481
|
-
index: 0,
|
|
482
|
-
status: '',
|
|
483
|
-
});
|
|
484
|
-
const showUploadDetail = shallowRef(false);
|
|
485
|
-
|
|
486
|
-
const webSocket = reactive<DevTool.WS>({
|
|
487
|
-
url: '',
|
|
488
|
-
message: [],
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
const currentWebSocket = computed(() => {
|
|
492
|
-
return wsList.value.find((item) => item.url === webSocket.url);
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
const showWebSocketDetail = shallowRef(false);
|
|
445
|
+
import { getDevToolInfo, setDevToolInfo } from '../../modules/devToolInfo';
|
|
446
|
+
import { getTabItems, tabIndex } from './const';
|
|
496
447
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
});
|
|
448
|
+
// 引入 Hooks
|
|
449
|
+
import { useDevToolData } from './hooks/useDevToolData';
|
|
450
|
+
import { useDevToolHandlers } from './hooks/useDevToolHandlers';
|
|
451
|
+
import { useDevToolOverlay } from './hooks/useDevToolOverlay';
|
|
502
452
|
|
|
503
453
|
const props = withDefaults(
|
|
504
454
|
defineProps<{
|
|
@@ -510,6 +460,7 @@ const props = withDefaults(
|
|
|
510
460
|
zIndex?: number;
|
|
511
461
|
contentHeight: number;
|
|
512
462
|
customStyle?: Record<string, any>;
|
|
463
|
+
origin?: { x: number; y: number };
|
|
513
464
|
}>(),
|
|
514
465
|
{
|
|
515
466
|
zIndex: 1000,
|
|
@@ -519,1054 +470,468 @@ const props = withDefaults(
|
|
|
519
470
|
const emits = defineEmits<{
|
|
520
471
|
(e: 'close'): void;
|
|
521
472
|
(e: 'sendMessage', data: { type: string; data: Record<string, any> }): void;
|
|
473
|
+
(e: 'changeTheme', theme: string): void;
|
|
522
474
|
}>();
|
|
523
475
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
return show;
|
|
530
|
-
}
|
|
476
|
+
const { t } = useI18n();
|
|
477
|
+
const hiddenTabs = ref<string[]>([]);
|
|
478
|
+
const tabItems = computed(() =>
|
|
479
|
+
getTabItems(t).filter((item) => !hiddenTabs.value.includes(item.key)),
|
|
480
|
+
);
|
|
531
481
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
)
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
482
|
+
// 初始化 Hooks
|
|
483
|
+
const data = useDevToolData(props);
|
|
484
|
+
const handlers = useDevToolHandlers(props, emits, data);
|
|
485
|
+
const overlay = useDevToolOverlay(props);
|
|
486
|
+
|
|
487
|
+
// 解构常用状态
|
|
488
|
+
const {
|
|
489
|
+
activeTab,
|
|
490
|
+
tabScrollLeft,
|
|
491
|
+
theme,
|
|
492
|
+
consoleList,
|
|
493
|
+
networkList,
|
|
494
|
+
transferList,
|
|
495
|
+
storageList,
|
|
496
|
+
routeList,
|
|
497
|
+
wsList,
|
|
498
|
+
vuexList,
|
|
499
|
+
piniaList,
|
|
500
|
+
elEventList,
|
|
501
|
+
uniEventList,
|
|
502
|
+
eventCount,
|
|
503
|
+
screenList,
|
|
504
|
+
interceptNetworkList,
|
|
505
|
+
scanCodeList,
|
|
506
|
+
nfcList,
|
|
507
|
+
netWorkStatus,
|
|
508
|
+
sizeFormat,
|
|
509
|
+
devToolVisible,
|
|
510
|
+
buildInfo,
|
|
511
|
+
cacheInterceptConfig,
|
|
512
|
+
cacheNetworkLog,
|
|
513
|
+
cacheConsoleLog,
|
|
514
|
+
currentConsoleType,
|
|
515
|
+
currentNetworkType,
|
|
516
|
+
currentNetworkSort,
|
|
517
|
+
currentTransferType,
|
|
518
|
+
currentTransferCategory,
|
|
519
|
+
currentWebSocketType,
|
|
520
|
+
searchConsole,
|
|
521
|
+
searchNetwork,
|
|
522
|
+
searchTransfer,
|
|
523
|
+
searchWs,
|
|
524
|
+
searchRoute,
|
|
525
|
+
searchStorage,
|
|
526
|
+
useTransition,
|
|
527
|
+
baseFontSize,
|
|
528
|
+
tagFontSize,
|
|
529
|
+
tipsFontSize,
|
|
530
|
+
fontFamily,
|
|
531
|
+
fontWeight,
|
|
532
|
+
performanceVisible,
|
|
533
|
+
performanceShowFps,
|
|
534
|
+
performanceShowCpu,
|
|
535
|
+
isFullScreen,
|
|
536
|
+
windowX,
|
|
537
|
+
windowY,
|
|
538
|
+
windowWidth,
|
|
539
|
+
windowHeight,
|
|
540
|
+
} = data;
|
|
541
|
+
|
|
542
|
+
const draggableRef = ref();
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
|
-
*
|
|
546
|
-
* @param list
|
|
547
|
-
* @param startTime
|
|
548
|
-
* @param endTime
|
|
545
|
+
* 初始化拖拽
|
|
549
546
|
*/
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
startTime: number,
|
|
553
|
-
endTime: number,
|
|
554
|
-
): DevTool.NetworkItem[] => {
|
|
555
|
-
const total = endTime - startTime;
|
|
556
|
-
|
|
557
|
-
return (
|
|
558
|
-
list?.map((item) => {
|
|
559
|
-
const width =
|
|
560
|
-
(
|
|
561
|
-
(((item.endTime ?? Date.now()) - item.startTime) / total) *
|
|
562
|
-
100
|
|
563
|
-
).toFixed(2) + '%';
|
|
564
|
-
|
|
565
|
-
const left =
|
|
566
|
-
(((item.startTime - startTime) / total) * 100).toFixed(2) + '%';
|
|
567
|
-
|
|
568
|
-
return {
|
|
569
|
-
...item,
|
|
570
|
-
width,
|
|
571
|
-
left,
|
|
572
|
-
};
|
|
573
|
-
}) ?? []
|
|
574
|
-
);
|
|
575
|
-
};
|
|
576
|
-
/**
|
|
577
|
-
* 禁止在该方法中 禁用调用已拦截的方法,防止递归调用
|
|
578
|
-
* - 禁用 uni.setStorage
|
|
579
|
-
* - 禁用 uni.request
|
|
580
|
-
* - 禁用 uni.upload
|
|
581
|
-
* - 禁用导入的 console
|
|
582
|
-
*/
|
|
583
|
-
const listenPostMessage = (data: DevTool.WindowData) => {
|
|
584
|
-
if (!props.open) return;
|
|
585
|
-
if (!isActive) return;
|
|
586
|
-
|
|
587
|
-
devToolVisible.value = data.devToolVisible ?? false;
|
|
588
|
-
|
|
589
|
-
cacheInterceptConfig.value = data.cacheInterceptConfig ?? false;
|
|
590
|
-
|
|
591
|
-
if (data.consoleList) {
|
|
592
|
-
consoleList.value = [...(data.consoleList ?? [])]
|
|
593
|
-
.filter((item) => {
|
|
594
|
-
if (currentConsoleType.value === 'all') return item;
|
|
595
|
-
if (currentConsoleType.value !== 'clear') {
|
|
596
|
-
return item.type === currentConsoleType.value;
|
|
597
|
-
}
|
|
598
|
-
return item;
|
|
599
|
-
})
|
|
600
|
-
.filter((item) => {
|
|
601
|
-
return (
|
|
602
|
-
item.args?.some(
|
|
603
|
-
(arg) =>
|
|
604
|
-
arg.type === 'string' &&
|
|
605
|
-
arg.value?.includes?.(searchConsole.value),
|
|
606
|
-
) ||
|
|
607
|
-
item.position.includes(searchConsole.value) ||
|
|
608
|
-
item?.stack?.includes(searchConsole.value)
|
|
609
|
-
);
|
|
610
|
-
})
|
|
611
|
-
?.map((item) => {
|
|
612
|
-
return {
|
|
613
|
-
...item,
|
|
614
|
-
position: hightLight(item.position, searchConsole.value),
|
|
615
|
-
stack: hightLight(item.stack, searchConsole.value),
|
|
616
|
-
args: item.args.map((arg) => {
|
|
617
|
-
if (arg.type === 'string') {
|
|
618
|
-
return {
|
|
619
|
-
type: 'string',
|
|
620
|
-
value: hightLight(arg.value, searchConsole.value),
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
return arg;
|
|
624
|
-
}),
|
|
625
|
-
};
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
backup.consoleList = [...data.consoleList];
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
if (data.networkList) {
|
|
632
|
-
const { startTime, endTime } = calcLineStartAndEnd(data.networkList);
|
|
633
|
-
|
|
634
|
-
const list = calcNetworkTimeline(data.networkList, startTime, endTime);
|
|
635
|
-
|
|
636
|
-
networkList.value = list
|
|
637
|
-
.filter((item) => {
|
|
638
|
-
if (currentNetworkType.value === 'all') return item;
|
|
639
|
-
if (currentNetworkType.value !== 'clear') {
|
|
640
|
-
return item.method === currentNetworkType.value;
|
|
641
|
-
}
|
|
642
|
-
return item;
|
|
643
|
-
})
|
|
644
|
-
?.filter((item) => item?.url?.includes(searchNetwork.value))
|
|
645
|
-
?.map((item) => {
|
|
646
|
-
return {
|
|
647
|
-
...item,
|
|
648
|
-
url: hightLight(item.url, searchNetwork.value),
|
|
649
|
-
};
|
|
650
|
-
})
|
|
651
|
-
?.sort((a, b) => {
|
|
652
|
-
if (currentNetworkSort.value === 1) {
|
|
653
|
-
return b.startTime - a.startTime;
|
|
654
|
-
} else {
|
|
655
|
-
return a.startTime - b.startTime;
|
|
656
|
-
}
|
|
657
|
-
});
|
|
658
|
-
|
|
659
|
-
backup.networkList = [...data.networkList];
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
if (data.uploadList) {
|
|
663
|
-
uploadList.value = [...(data.uploadList ?? [])]
|
|
664
|
-
.filter((item) => {
|
|
665
|
-
if (currentUploadType.value === 'all') return item;
|
|
666
|
-
if (currentUploadType.value !== 'clear') {
|
|
667
|
-
return item.status === currentUploadType.value;
|
|
668
|
-
}
|
|
669
|
-
return item;
|
|
670
|
-
})
|
|
671
|
-
.filter((item) => {
|
|
672
|
-
return item.url?.includes(searchUpload.value);
|
|
673
|
-
})
|
|
674
|
-
?.map((item) => {
|
|
675
|
-
return {
|
|
676
|
-
...item,
|
|
677
|
-
url: hightLight(item.url, searchUpload.value),
|
|
678
|
-
};
|
|
679
|
-
});
|
|
680
|
-
backup.uploadList = [...data.uploadList];
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
if (data.storageList) {
|
|
684
|
-
storageList.value = [...(data.storageList ?? [])]
|
|
685
|
-
?.filter((item) => item._oldKey.includes(searchStorage.value))
|
|
686
|
-
?.map((item) => {
|
|
687
|
-
return {
|
|
688
|
-
...item,
|
|
689
|
-
_oldKey: hightLight(item._oldKey, searchStorage.value),
|
|
690
|
-
};
|
|
691
|
-
});
|
|
692
|
-
backup.storageList = [...data.storageList];
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
if (data.wsList) {
|
|
696
|
-
wsList.value = [...(data.wsList ?? [])]
|
|
697
|
-
.filter((item) => {
|
|
698
|
-
if (currentWebSocketType.value === 'all') return item;
|
|
699
|
-
return item.readyState === currentWebSocketType.value;
|
|
700
|
-
})
|
|
701
|
-
.filter((item) => item.url.includes(searchWs.value))
|
|
702
|
-
?.map((item) => {
|
|
703
|
-
return {
|
|
704
|
-
...item,
|
|
705
|
-
url: hightLight(item.url, searchWs.value),
|
|
706
|
-
};
|
|
707
|
-
});
|
|
708
|
-
backup.wsList = [...data.wsList];
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
if (data.routeList) {
|
|
712
|
-
routeList.value = [...(data.routeList ?? [])]
|
|
713
|
-
?.filter(
|
|
714
|
-
(item) =>
|
|
715
|
-
item.path.includes(searchRoute.value) ||
|
|
716
|
-
item.name?.includes(searchRoute.value),
|
|
717
|
-
)
|
|
718
|
-
?.map((item) => {
|
|
719
|
-
return {
|
|
720
|
-
...item,
|
|
721
|
-
name: hightLight(item.name, searchRoute.value),
|
|
722
|
-
path: hightLight(item.path, searchRoute.value),
|
|
723
|
-
};
|
|
724
|
-
});
|
|
725
|
-
backup.routeList = [...data.routeList];
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
if (data.elEventList) {
|
|
729
|
-
elEventList.value = [...data.elEventList];
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
if (data.uniEventList) {
|
|
733
|
-
uniEventList.value = [...data.uniEventList];
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
if (data.eventCount) {
|
|
737
|
-
eventCount.value = { ...data.eventCount };
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
if (data.vuexList) {
|
|
741
|
-
vuexList.value = data.vuexList;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
if (data.piniaList) {
|
|
745
|
-
piniaList.value = data.piniaList;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
if (data.netWorkStatus) {
|
|
749
|
-
netWorkStatus.value = data.netWorkStatus;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
if (data.sizeFormat) {
|
|
753
|
-
sizeFormat.value = data.sizeFormat;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
if (data.screenList) {
|
|
757
|
-
screenList.value = [...data.screenList];
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
if (data.interceptNetworkMap) {
|
|
761
|
-
interceptNetworkList.value = Array.from(data.interceptNetworkMap.values());
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
if (data.devToolVersion || data.devToolBuildTime || data.devToolGit) {
|
|
765
|
-
Object.assign(buildInfo, {
|
|
766
|
-
devToolVersion: data.devToolVersion,
|
|
767
|
-
devToolBuildTime: data.devToolBuildTime,
|
|
768
|
-
devToolGit: data.devToolGit,
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
if (data.scanCodeList) {
|
|
773
|
-
scanCodeList.value = [...data.scanCodeList];
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
if (data.nfcList) {
|
|
777
|
-
nfcList.value = [...data.nfcList];
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
let isActive = false;
|
|
782
|
-
onMounted(() => {
|
|
783
|
-
const devToolInfo = getDevToolInfo();
|
|
784
|
-
|
|
785
|
-
if (devToolInfo) {
|
|
786
|
-
currentConsoleType.value = devToolInfo?.currentConsoleType || 'all';
|
|
787
|
-
currentNetworkType.value = devToolInfo?.currentNetworkType || 'all';
|
|
788
|
-
tabScrollLeft.value = devToolInfo?.tabScrollLeft || 0;
|
|
789
|
-
theme.value = devToolInfo?.theme || 'light';
|
|
790
|
-
|
|
791
|
-
// 延迟设置,避免页面加载时
|
|
792
|
-
// TypeError: Cannot read properties of null (reading 'scrollHeight')
|
|
793
|
-
nextTick(() => {
|
|
794
|
-
activeTab.value = devToolInfo?.activeTab || 0;
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
if (props.data) {
|
|
798
|
-
listenPostMessage(props.data);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
if (uni.onThemeChange) {
|
|
802
|
-
uni.onThemeChange((res) => {
|
|
803
|
-
theme.value = res.theme;
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
});
|
|
807
|
-
|
|
808
|
-
onBeforeMount(() => {
|
|
809
|
-
isActive = true;
|
|
810
|
-
devToolEventBus?.on(DEV_APP_MESSAGE, listenPostMessage);
|
|
811
|
-
});
|
|
812
|
-
onUnmounted(() => {
|
|
813
|
-
isActive = false;
|
|
814
|
-
devToolEventBus?.off(DEV_APP_MESSAGE, listenPostMessage);
|
|
815
|
-
});
|
|
816
|
-
|
|
817
|
-
onShow(() => {
|
|
818
|
-
isActive = true;
|
|
819
|
-
|
|
820
|
-
// H5 APP-PLUS 已经被uni.navigateBack 监听,所以这里只有微信用 onShow 模拟
|
|
821
|
-
// 微信小程序 onBackPress 不知道为什么不能触发,临时用 onShow 模拟
|
|
822
|
-
// #ifdef MP-WEIXIN
|
|
823
|
-
const path = getCurrentPagePath();
|
|
824
|
-
basicSendMessage({
|
|
825
|
-
type: DEV_BOTTOM_TAB_CHANGE,
|
|
826
|
-
data: { path },
|
|
827
|
-
});
|
|
828
|
-
// #endif
|
|
829
|
-
});
|
|
830
|
-
|
|
831
|
-
// H5 APP-PLUS 已经被uni.switchTab 监听,所以这里只有微信小程序 监听
|
|
832
|
-
// 微信小程序,支付宝 小程序 底部tab切换 switchTab 无法监听到,需要实现该事件进行监听
|
|
833
|
-
|
|
834
|
-
onTabItemTap((option) => {
|
|
835
|
-
isActive &&
|
|
836
|
-
basicSendMessage({
|
|
837
|
-
type: DEV_BOTTOM_TAB_CHANGE,
|
|
838
|
-
data: { path: option.pagePath },
|
|
839
|
-
});
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
// onHide(() => {
|
|
843
|
-
// isActive = false;
|
|
844
|
-
|
|
845
|
-
// setDevToolInfo({
|
|
846
|
-
// devToolWindowVisible: false,
|
|
847
|
-
// });
|
|
848
|
-
// });
|
|
849
|
-
|
|
850
|
-
/** 发送消息给 uniapp */
|
|
851
|
-
function basicSendMessage(message: {
|
|
852
|
-
type: string;
|
|
853
|
-
data: Record<string, any>;
|
|
854
|
-
}) {
|
|
855
|
-
emits('sendMessage', message);
|
|
547
|
+
function onInitDrag(e: MouseEvent | TouchEvent) {
|
|
548
|
+
draggableRef.value?.initDrag(e);
|
|
856
549
|
}
|
|
857
550
|
|
|
858
|
-
function
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
currentConsoleType: currentConsoleType.value,
|
|
862
|
-
currentNetworkType: currentNetworkType.value,
|
|
863
|
-
currentWebSocketType: currentWebSocketType.value,
|
|
864
|
-
tabScrollLeft: tabScrollLeft.value,
|
|
865
|
-
cacheInterceptConfig: cacheInterceptConfig.value,
|
|
866
|
-
interceptNetworkList: interceptNetworkList.value,
|
|
867
|
-
});
|
|
551
|
+
function toggleFullScreen() {
|
|
552
|
+
isFullScreen.value = !isFullScreen.value;
|
|
553
|
+
saveSettings();
|
|
868
554
|
}
|
|
869
555
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}
|
|
876
|
-
function onChangeTabs() {
|
|
877
|
-
setWindowInfo();
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
function onChangeSwiper({
|
|
881
|
-
detail,
|
|
882
|
-
}: {
|
|
883
|
-
detail: { current: number; source: any };
|
|
556
|
+
function onWindowChange(detail: {
|
|
557
|
+
x: number;
|
|
558
|
+
y: number;
|
|
559
|
+
width: number;
|
|
560
|
+
height: number;
|
|
884
561
|
}) {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
tabScrollLeft.value = e.detail.scrollLeft;
|
|
891
|
-
debounceSetWindowInfo();
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
const debounceScrollTabs = debounce(onScrollTabs, 200);
|
|
895
|
-
|
|
896
|
-
function onConsoleChoose(
|
|
897
|
-
type: 'all' | 'log' | 'info' | 'warn' | 'error' | 'clear',
|
|
898
|
-
) {
|
|
899
|
-
if (type === 'clear') {
|
|
900
|
-
consoleList.value = [];
|
|
901
|
-
backup.consoleList = [];
|
|
902
|
-
basicSendMessage({
|
|
903
|
-
type: DEV_CONSOLE_CLEAR,
|
|
904
|
-
data: {},
|
|
905
|
-
});
|
|
906
|
-
return;
|
|
907
|
-
} else if (type === 'all') {
|
|
908
|
-
currentConsoleType.value = type;
|
|
909
|
-
consoleList.value = backup.consoleList;
|
|
910
|
-
} else {
|
|
911
|
-
currentConsoleType.value = type;
|
|
912
|
-
consoleList.value = backup.consoleList.filter((item) => item.type === type);
|
|
913
|
-
}
|
|
914
|
-
setWindowInfo();
|
|
562
|
+
windowX.value = detail.x;
|
|
563
|
+
windowY.value = detail.y;
|
|
564
|
+
windowWidth.value = detail.width;
|
|
565
|
+
windowHeight.value = detail.height;
|
|
566
|
+
saveSettings();
|
|
915
567
|
}
|
|
916
568
|
|
|
917
|
-
function
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
569
|
+
function saveSettings() {
|
|
570
|
+
setDevToolInfo({
|
|
571
|
+
windowSettings: {
|
|
572
|
+
isFullScreen: isFullScreen.value,
|
|
573
|
+
x: windowX.value,
|
|
574
|
+
y: windowY.value,
|
|
575
|
+
width: windowWidth.value,
|
|
576
|
+
height: windowHeight.value,
|
|
922
577
|
},
|
|
923
578
|
});
|
|
924
579
|
}
|
|
925
580
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
item.args.some(
|
|
931
|
-
(arg) => arg.type === 'string' && arg.value.includes(value),
|
|
932
|
-
) ||
|
|
933
|
-
item.position.includes(value) ||
|
|
934
|
-
item?.stack?.includes(value)
|
|
935
|
-
);
|
|
936
|
-
})
|
|
937
|
-
?.map((item) => {
|
|
938
|
-
return {
|
|
939
|
-
...item,
|
|
940
|
-
position: hightLight(item.position, searchConsole.value),
|
|
941
|
-
stack: hightLight(item.stack, searchConsole.value),
|
|
942
|
-
args: item.args.map((arg) => {
|
|
943
|
-
if (arg.type === 'string') {
|
|
944
|
-
return {
|
|
945
|
-
type: 'string',
|
|
946
|
-
value: hightLight(arg.value, value),
|
|
947
|
-
};
|
|
948
|
-
}
|
|
949
|
-
return arg;
|
|
950
|
-
}),
|
|
951
|
-
};
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
function onNetworkChoose(type: string) {
|
|
956
|
-
if (type === 'clear') {
|
|
957
|
-
networkList.value = [];
|
|
958
|
-
backup.networkList = [];
|
|
959
|
-
basicSendMessage({
|
|
960
|
-
type: DEV_NETWORK_CLEAR,
|
|
961
|
-
data: {},
|
|
962
|
-
});
|
|
963
|
-
return;
|
|
964
|
-
} else if (type === 'all') {
|
|
965
|
-
currentNetworkType.value = type;
|
|
966
|
-
networkList.value = backup.networkList;
|
|
967
|
-
} else if (type === 'error') {
|
|
968
|
-
currentNetworkType.value = type;
|
|
969
|
-
networkList.value = backup.networkList.filter((item) => {
|
|
970
|
-
return item.status === 'error' || /[4,5]\d{2,}/.test(item.status + '');
|
|
971
|
-
});
|
|
972
|
-
} else {
|
|
973
|
-
currentNetworkType.value = type;
|
|
974
|
-
networkList.value = backup.networkList.filter(
|
|
975
|
-
(item) => item.method === type,
|
|
976
|
-
);
|
|
977
|
-
}
|
|
581
|
+
const dynamicContentHeight = computed(() => {
|
|
582
|
+
if (isFullScreen.value) return props.contentHeight;
|
|
583
|
+
return windowHeight.value - 32;
|
|
584
|
+
});
|
|
978
585
|
|
|
979
|
-
|
|
980
|
-
|
|
586
|
+
const dynamicWindowStyle = computed(() => {
|
|
587
|
+
if (isFullScreen.value) return props.customStyle;
|
|
588
|
+
return {
|
|
589
|
+
width: '100%',
|
|
590
|
+
height: '100%',
|
|
591
|
+
paddingTop: 0,
|
|
592
|
+
paddingBottom: 0,
|
|
593
|
+
};
|
|
594
|
+
});
|
|
981
595
|
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
596
|
+
const {
|
|
597
|
+
onCloseWindow,
|
|
598
|
+
onChangeTabs,
|
|
599
|
+
debounceScrollTabs,
|
|
600
|
+
onConsoleChoose,
|
|
601
|
+
onRunJS,
|
|
602
|
+
onSearchConsole,
|
|
603
|
+
onNetworkChoose,
|
|
604
|
+
onSearchNetwork,
|
|
605
|
+
onSortNetwork,
|
|
606
|
+
onTransferChoose,
|
|
607
|
+
onSearchTransfer,
|
|
608
|
+
onWebSocketChoose,
|
|
609
|
+
onSearchWs,
|
|
610
|
+
onStorageChoose,
|
|
611
|
+
onStorageRemove,
|
|
612
|
+
onChangeStorage,
|
|
613
|
+
onSearchStorage,
|
|
614
|
+
onElEventClear,
|
|
615
|
+
onUniEventClear,
|
|
616
|
+
onCaptureScreenClear,
|
|
617
|
+
onScanCodeListClear,
|
|
618
|
+
onNfcClear,
|
|
619
|
+
onRouteRefresh,
|
|
620
|
+
onSearchRoute,
|
|
621
|
+
onShowDevButton,
|
|
622
|
+
onRestartDevTool,
|
|
623
|
+
onRestartApp,
|
|
624
|
+
onExportLog,
|
|
625
|
+
onScreenshot,
|
|
626
|
+
onClearCache,
|
|
627
|
+
onDestroyDevTool,
|
|
628
|
+
onChangeTheme,
|
|
629
|
+
onChangeCacheInterceptConfig,
|
|
630
|
+
onChangeCacheNetworkLog,
|
|
631
|
+
onChangeCacheConsoleLog,
|
|
632
|
+
onChangeVuex,
|
|
633
|
+
onChangePinia,
|
|
634
|
+
onClearWebSocketMessage,
|
|
635
|
+
onSendWebSocket,
|
|
636
|
+
onConfirmInterceptConfig,
|
|
637
|
+
onRemoveInterceptConfig,
|
|
638
|
+
onChangeUseTransition,
|
|
639
|
+
onChangeFontSize,
|
|
640
|
+
onChangePerformance,
|
|
641
|
+
onChangePerformanceShowFps,
|
|
642
|
+
onChangePerformanceShowCpu,
|
|
643
|
+
basicSendMessage,
|
|
644
|
+
} = handlers;
|
|
999
645
|
|
|
1000
646
|
/**
|
|
1001
|
-
*
|
|
1002
|
-
* @param sort -1 降序 1 升序
|
|
647
|
+
* 更新窗口 X 坐标
|
|
1003
648
|
*/
|
|
1004
|
-
function
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
const list = networkList.value.sort((a, b) => {
|
|
1008
|
-
if (sort === 1) {
|
|
1009
|
-
return b.startTime - a.startTime;
|
|
1010
|
-
} else {
|
|
1011
|
-
return a.startTime - b.startTime;
|
|
1012
|
-
}
|
|
1013
|
-
});
|
|
1014
|
-
networkList.value = [...list];
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
function onUploadChoose(type: string) {
|
|
1018
|
-
if (type === 'clear') {
|
|
1019
|
-
uploadList.value = [];
|
|
1020
|
-
backup.uploadList = [];
|
|
1021
|
-
basicSendMessage({
|
|
1022
|
-
type: DEV_UPLOAD_CLEAR,
|
|
1023
|
-
data: {},
|
|
1024
|
-
});
|
|
1025
|
-
return;
|
|
1026
|
-
} else if (type === 'all') {
|
|
1027
|
-
currentUploadType.value = type;
|
|
1028
|
-
uploadList.value = backup.uploadList;
|
|
1029
|
-
} else {
|
|
1030
|
-
currentUploadType.value = type;
|
|
1031
|
-
uploadList.value = backup.uploadList.filter((item) => item.status === type);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
function onSearchUpload(value: string) {
|
|
1036
|
-
uploadList.value = backup.uploadList
|
|
1037
|
-
.filter((item) => {
|
|
1038
|
-
if (currentUploadType.value === 'all') return item;
|
|
1039
|
-
if (currentUploadType.value !== 'clear') {
|
|
1040
|
-
return item.status === currentUploadType.value;
|
|
1041
|
-
}
|
|
1042
|
-
return item;
|
|
1043
|
-
})
|
|
1044
|
-
.filter((item) => {
|
|
1045
|
-
return item.url?.includes(value);
|
|
1046
|
-
})
|
|
1047
|
-
?.map((item) => {
|
|
1048
|
-
return {
|
|
1049
|
-
...item,
|
|
1050
|
-
url: hightLight(item.url, value),
|
|
1051
|
-
};
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
function onWebSocketChoose(type: string) {
|
|
1056
|
-
if (type === 'clear') {
|
|
1057
|
-
wsList.value = [];
|
|
1058
|
-
backup.wsList = [];
|
|
1059
|
-
basicSendMessage({
|
|
1060
|
-
type: DEV_WEBSOCKET_CLEAR,
|
|
1061
|
-
data: {},
|
|
1062
|
-
});
|
|
1063
|
-
return;
|
|
1064
|
-
} else if (type === 'all') {
|
|
1065
|
-
currentWebSocketType.value = type;
|
|
1066
|
-
wsList.value = backup.wsList;
|
|
1067
|
-
} else {
|
|
1068
|
-
currentWebSocketType.value = type;
|
|
1069
|
-
wsList.value = backup.wsList.filter((item) => item.readyState === type);
|
|
1070
|
-
}
|
|
1071
|
-
setWindowInfo();
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
function onSearchWs(value: string) {
|
|
1075
|
-
wsList.value = backup.wsList
|
|
1076
|
-
.filter((item) => {
|
|
1077
|
-
if (currentWebSocketType.value === 'all') return item;
|
|
1078
|
-
return item.readyState === currentWebSocketType.value;
|
|
1079
|
-
})
|
|
1080
|
-
.filter((item) => item.url.includes(value))
|
|
1081
|
-
?.map((item) => {
|
|
1082
|
-
return {
|
|
1083
|
-
...item,
|
|
1084
|
-
url: hightLight(item.url, value),
|
|
1085
|
-
};
|
|
1086
|
-
});
|
|
649
|
+
function onUpdateWindowX(val: number) {
|
|
650
|
+
windowX.value = val;
|
|
1087
651
|
}
|
|
1088
652
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
type: DEV_STORAGE_CLEAR,
|
|
1095
|
-
data: {},
|
|
1096
|
-
});
|
|
1097
|
-
} else if (type === 'refresh') {
|
|
1098
|
-
basicSendMessage({
|
|
1099
|
-
type: DEV_STORAGE_REFRESH,
|
|
1100
|
-
data: {},
|
|
1101
|
-
});
|
|
1102
|
-
} else if (type === 'add') {
|
|
1103
|
-
const key = '_new_' + Date.now();
|
|
1104
|
-
const newItem = {
|
|
1105
|
-
key,
|
|
1106
|
-
_oldKey: key,
|
|
1107
|
-
value: JSON.stringify(''),
|
|
1108
|
-
};
|
|
1109
|
-
backup.storageList.unshift(newItem);
|
|
1110
|
-
storageList.value.unshift(newItem);
|
|
1111
|
-
basicSendMessage({
|
|
1112
|
-
type: DEV_STORAGE_ADD,
|
|
1113
|
-
data: {
|
|
1114
|
-
key,
|
|
1115
|
-
value: JSON.stringify(''),
|
|
1116
|
-
},
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
function onStorageRemove(key: string) {
|
|
1122
|
-
backup.storageList = backup.storageList.filter((item) => item.key !== key);
|
|
1123
|
-
storageList.value = backup.storageList;
|
|
1124
|
-
basicSendMessage({
|
|
1125
|
-
type: DEV_STORAGE_REMOVE,
|
|
1126
|
-
data: { key },
|
|
1127
|
-
});
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
function onChangeStorage(data: DevTool.StorageItem) {
|
|
1131
|
-
basicSendMessage({
|
|
1132
|
-
type: DEV_STORAGE_UPDATE,
|
|
1133
|
-
data,
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
function onSearchStorage(value: string) {
|
|
1138
|
-
storageList.value = backup.storageList
|
|
1139
|
-
.filter((item) => item._oldKey.includes(value))
|
|
1140
|
-
?.map((item) => {
|
|
1141
|
-
return {
|
|
1142
|
-
...item,
|
|
1143
|
-
_oldKey: hightLight(item._oldKey, value),
|
|
1144
|
-
};
|
|
1145
|
-
});
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
function onElEventClear() {
|
|
1149
|
-
elEventList.value = [];
|
|
1150
|
-
basicSendMessage({
|
|
1151
|
-
type: DEV_EL_EVENT_CLEAR,
|
|
1152
|
-
data: {},
|
|
1153
|
-
});
|
|
653
|
+
/**
|
|
654
|
+
* 更新窗口 Y 坐标
|
|
655
|
+
*/
|
|
656
|
+
function onUpdateWindowY(val: number) {
|
|
657
|
+
windowY.value = val;
|
|
1154
658
|
}
|
|
1155
659
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
emit: 0,
|
|
1162
|
-
off: 0,
|
|
1163
|
-
};
|
|
1164
|
-
basicSendMessage({
|
|
1165
|
-
type: DEV_UNI_EVENT_CLEAR,
|
|
1166
|
-
data: {},
|
|
1167
|
-
});
|
|
660
|
+
/**
|
|
661
|
+
* 更新窗口宽度
|
|
662
|
+
*/
|
|
663
|
+
function onUpdateWindowWidth(val: number) {
|
|
664
|
+
windowWidth.value = val;
|
|
1168
665
|
}
|
|
1169
666
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
});
|
|
667
|
+
/**
|
|
668
|
+
* 更新窗口高度
|
|
669
|
+
*/
|
|
670
|
+
function onUpdateWindowHeight(val: number) {
|
|
671
|
+
windowHeight.value = val;
|
|
1176
672
|
}
|
|
1177
673
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
});
|
|
674
|
+
/**
|
|
675
|
+
* 更新控制台搜索关键词
|
|
676
|
+
*/
|
|
677
|
+
function onUpdateSearchConsole(val: string) {
|
|
678
|
+
searchConsole.value = val;
|
|
1184
679
|
}
|
|
1185
680
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
});
|
|
681
|
+
/**
|
|
682
|
+
* 更新网络请求搜索关键词
|
|
683
|
+
*/
|
|
684
|
+
function onUpdateSearchNetwork(val: string) {
|
|
685
|
+
searchNetwork.value = val;
|
|
1192
686
|
}
|
|
1193
687
|
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
688
|
+
/**
|
|
689
|
+
* 更新文件传输搜索关键词
|
|
690
|
+
*/
|
|
691
|
+
function onUpdateSearchTransfer(val: string) {
|
|
692
|
+
searchTransfer.value = val;
|
|
1199
693
|
}
|
|
1200
694
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
...item,
|
|
1207
|
-
name: hightLight(item.name, searchRoute.value),
|
|
1208
|
-
path: hightLight(item.path, searchRoute.value),
|
|
1209
|
-
};
|
|
1210
|
-
});
|
|
695
|
+
/**
|
|
696
|
+
* 更新 WebSocket 搜索关键词
|
|
697
|
+
*/
|
|
698
|
+
function onUpdateSearchWs(val: string) {
|
|
699
|
+
searchWs.value = val;
|
|
1211
700
|
}
|
|
1212
701
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
},
|
|
1219
|
-
});
|
|
702
|
+
/**
|
|
703
|
+
* 更新路由搜索关键词
|
|
704
|
+
*/
|
|
705
|
+
function onUpdateSearchRoute(val: string) {
|
|
706
|
+
searchRoute.value = val;
|
|
1220
707
|
}
|
|
1221
708
|
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
709
|
+
/**
|
|
710
|
+
* 更新本地存储搜索关键词
|
|
711
|
+
*/
|
|
712
|
+
function onUpdateSearchStorage(val: string) {
|
|
713
|
+
searchStorage.value = val;
|
|
1227
714
|
}
|
|
1228
715
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
716
|
+
/**
|
|
717
|
+
* 更新本地存储列表
|
|
718
|
+
*/
|
|
719
|
+
function onUpdateStorageList(val: DevTool.StorageItem[]) {
|
|
720
|
+
storageList.value = val;
|
|
1234
721
|
}
|
|
1235
722
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
basicSendMessage({
|
|
1242
|
-
type: DEV_EXPORT_LOG,
|
|
1243
|
-
data: {
|
|
1244
|
-
...exports,
|
|
1245
|
-
},
|
|
1246
|
-
});
|
|
723
|
+
/**
|
|
724
|
+
* 更新 Vuex 数据
|
|
725
|
+
*/
|
|
726
|
+
function onUpdateVuexList(val: Record<string, any>) {
|
|
727
|
+
vuexList.value = val;
|
|
1247
728
|
}
|
|
1248
729
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
730
|
+
/**
|
|
731
|
+
* 更新 Pinia 数据
|
|
732
|
+
*/
|
|
733
|
+
function onUpdatePiniaList(val: Record<string, any>) {
|
|
734
|
+
piniaList.value = val;
|
|
1254
735
|
}
|
|
1255
736
|
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
data: {},
|
|
1260
|
-
});
|
|
1261
|
-
}
|
|
737
|
+
const currentWebSocket = computed(() => {
|
|
738
|
+
return wsList.value.find((item) => item.url === overlay.webSocket.url);
|
|
739
|
+
});
|
|
1262
740
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
data: {},
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
741
|
+
// 记录上一个 Tab,用于平滑卸载
|
|
742
|
+
const lastActiveTab = ref(activeTab.value);
|
|
743
|
+
const isReady = ref(props.open);
|
|
1269
744
|
|
|
1270
|
-
|
|
1271
|
-
|
|
745
|
+
watch(
|
|
746
|
+
() => props.open,
|
|
747
|
+
(val) => {
|
|
748
|
+
// 如果没有开启过渡动画,直接设置为 ready
|
|
749
|
+
if (val && !useTransition.value) {
|
|
750
|
+
isReady.value = true;
|
|
751
|
+
}
|
|
752
|
+
// 每次窗口打开时重新读取 hiddenTabs 配置
|
|
753
|
+
if (val) {
|
|
754
|
+
const devToolInfo = getDevToolInfo();
|
|
755
|
+
hiddenTabs.value = devToolInfo?.hiddenTabs || [];
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
{ immediate: true },
|
|
759
|
+
);
|
|
1272
760
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
});
|
|
761
|
+
function onAfterEnter() {
|
|
762
|
+
isReady.value = true;
|
|
1276
763
|
}
|
|
1277
764
|
|
|
1278
|
-
function
|
|
1279
|
-
|
|
1280
|
-
cacheInterceptConfig: value,
|
|
1281
|
-
interceptNetworkList: value ? interceptNetworkList.value : [],
|
|
1282
|
-
});
|
|
1283
|
-
|
|
1284
|
-
basicSendMessage({
|
|
1285
|
-
type: DEV_CHANGE_CACHE_INTERCEPT_CONFIG,
|
|
1286
|
-
data: {
|
|
1287
|
-
cacheInterceptConfig: value,
|
|
1288
|
-
},
|
|
1289
|
-
});
|
|
765
|
+
function onAfterLeave() {
|
|
766
|
+
isReady.value = false;
|
|
1290
767
|
}
|
|
1291
768
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
}
|
|
769
|
+
watch(activeTab, (val, oldVal) => {
|
|
770
|
+
if (val !== oldVal) {
|
|
771
|
+
lastActiveTab.value = oldVal;
|
|
772
|
+
}
|
|
773
|
+
});
|
|
1298
774
|
|
|
1299
|
-
function
|
|
1300
|
-
|
|
1301
|
-
type: DEV_PINIA_CHANGE,
|
|
1302
|
-
data: value,
|
|
1303
|
-
});
|
|
775
|
+
function isTabVisible(key: string) {
|
|
776
|
+
return !hiddenTabs.value.includes(key);
|
|
1304
777
|
}
|
|
1305
778
|
|
|
1306
|
-
function
|
|
1307
|
-
|
|
1308
|
-
|
|
779
|
+
function swiperShow(index: number) {
|
|
780
|
+
if (!isReady.value) return false;
|
|
781
|
+
const currentTab = tabItems.value[activeTab.value];
|
|
782
|
+
return currentTab && currentTab.index === index;
|
|
1309
783
|
}
|
|
1310
|
-
function onOpenCode(value?: string) {
|
|
1311
|
-
if (!value) return;
|
|
1312
784
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
785
|
+
onMounted(() => {
|
|
786
|
+
const devToolInfo = getDevToolInfo();
|
|
787
|
+
if (devToolInfo) {
|
|
788
|
+
currentConsoleType.value = devToolInfo?.currentConsoleType || 'all';
|
|
789
|
+
currentNetworkType.value = devToolInfo?.currentNetworkType || 'all';
|
|
790
|
+
theme.value = devToolInfo?.theme || 'light';
|
|
791
|
+
cacheInterceptConfig.value =
|
|
792
|
+
devToolInfo?.cacheInterceptConfig !== undefined
|
|
793
|
+
? devToolInfo.cacheInterceptConfig
|
|
794
|
+
: true;
|
|
795
|
+
cacheNetworkLog.value = devToolInfo?.cacheNetworkLog || false;
|
|
796
|
+
cacheConsoleLog.value = devToolInfo?.cacheConsoleLog || false;
|
|
797
|
+
useTransition.value =
|
|
798
|
+
devToolInfo?.useTransition !== undefined
|
|
799
|
+
? devToolInfo.useTransition
|
|
800
|
+
: true;
|
|
801
|
+
baseFontSize.value = devToolInfo?.baseFontSize || 12;
|
|
802
|
+
tagFontSize.value = devToolInfo?.tagFontSize || 10;
|
|
803
|
+
tipsFontSize.value = devToolInfo?.tipsFontSize || 10;
|
|
804
|
+
fontFamily.value = devToolInfo?.fontFamily || '';
|
|
805
|
+
fontWeight.value = devToolInfo?.fontWeight || 'normal';
|
|
806
|
+
hiddenTabs.value = devToolInfo?.hiddenTabs || [
|
|
807
|
+
'Performance',
|
|
808
|
+
'CaptureScreen',
|
|
809
|
+
'ScanCode',
|
|
810
|
+
'NFC',
|
|
811
|
+
'ElEvent',
|
|
812
|
+
'UniEvent',
|
|
813
|
+
];
|
|
814
|
+
|
|
815
|
+
// 延迟恢复滚动位置,确保布局已渲染
|
|
816
|
+
setTimeout(() => {
|
|
817
|
+
tabScrollLeft.value = devToolInfo?.tabScrollLeft || 0;
|
|
818
|
+
nextTick(() => {
|
|
819
|
+
// 确保恢复的索引在当前可见 Tab 的范围内
|
|
820
|
+
const savedTab = devToolInfo?.activeTab || 0;
|
|
821
|
+
activeTab.value = savedTab < tabItems.value.length ? savedTab : 0;
|
|
822
|
+
});
|
|
823
|
+
}, 150);
|
|
824
|
+
|
|
825
|
+
if (devToolInfo.windowSettings) {
|
|
826
|
+
isFullScreen.value = devToolInfo.windowSettings.isFullScreen ?? true;
|
|
827
|
+
windowX.value = devToolInfo.windowSettings.x ?? 10;
|
|
828
|
+
windowY.value = devToolInfo.windowSettings.y ?? 100;
|
|
829
|
+
windowWidth.value = devToolInfo.windowSettings.width ?? 375;
|
|
830
|
+
windowHeight.value = devToolInfo.windowSettings.height ?? 450;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
if (props.data) {
|
|
834
|
+
data.listenPostMessage(props.data);
|
|
835
|
+
}
|
|
836
|
+
if (uni.onThemeChange) {
|
|
837
|
+
uni.onThemeChange((res) => {
|
|
838
|
+
theme.value = res.theme;
|
|
1322
839
|
});
|
|
1323
|
-
return;
|
|
1324
840
|
}
|
|
841
|
+
});
|
|
1325
842
|
|
|
1326
|
-
|
|
843
|
+
/**
|
|
844
|
+
* 处理来自核心模块的消息
|
|
845
|
+
*/
|
|
846
|
+
function handleCoreMessage(msg: any) {
|
|
847
|
+
let type, msgData;
|
|
848
|
+
try {
|
|
849
|
+
const payload = typeof msg === 'string' ? JSON.parse(msg) : msg;
|
|
850
|
+
type = payload.type;
|
|
851
|
+
msgData = payload.data;
|
|
852
|
+
} catch (e) {
|
|
853
|
+
console.error('DevToolWindow parse error', e);
|
|
1327
854
|
return;
|
|
1328
855
|
}
|
|
1329
856
|
|
|
1330
|
-
if (
|
|
1331
|
-
|
|
1332
|
-
openCode.value = true;
|
|
1333
|
-
} else {
|
|
1334
|
-
uni.showToast({
|
|
1335
|
-
icon: 'none',
|
|
1336
|
-
title: '[DevTool] sourceFileServers 配置异常',
|
|
1337
|
-
});
|
|
1338
|
-
console?.warn('[DevTool] sourceFileServers 配置异常');
|
|
1339
|
-
}
|
|
1340
|
-
} else {
|
|
1341
|
-
openCode.value = true;
|
|
857
|
+
if (type === MSG_TYPE.DATA_UPDATE) {
|
|
858
|
+
data.listenPostMessage(msgData);
|
|
1342
859
|
}
|
|
1343
860
|
}
|
|
1344
861
|
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
function onOpenJson(data: { title: string; data: Record<string, any> }) {
|
|
1350
|
-
showJsonDetail.value = true;
|
|
1351
|
-
jsonData.value = data;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
function onOpenNfcTool() {
|
|
1355
|
-
showNfcTool.value = true;
|
|
1356
|
-
}
|
|
1357
|
-
function onCloseNfcTool() {
|
|
1358
|
-
showNfcTool.value = false;
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
function onOpenNetworkDetail(ni?: DevTool.NetworkItem) {
|
|
1362
|
-
Object.assign(network, emptyNetwork);
|
|
1363
|
-
Object.assign(network, ni);
|
|
1364
|
-
showNetworkDetail.value = true;
|
|
1365
|
-
}
|
|
1366
|
-
function onCloseNetworkDetail() {
|
|
1367
|
-
showNetworkDetail.value = false;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
function onOpenNetworkSend(ni?: DevTool.NetworkItem) {
|
|
1371
|
-
Object.assign(network, emptyNetwork);
|
|
1372
|
-
Object.assign(network, ni);
|
|
1373
|
-
showNetworkSend.value = true;
|
|
1374
|
-
}
|
|
1375
|
-
function onCloseNetworkSend() {
|
|
1376
|
-
showNetworkSend.value = false;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
function onOpenNetworkIntercept() {
|
|
1380
|
-
showNetworkIntercept.value = true;
|
|
1381
|
-
}
|
|
1382
|
-
function onCloseNetworkIntercept() {
|
|
1383
|
-
showNetworkIntercept.value = false;
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
function onOpenInterceptConfig(ni?: DevTool.NetworkItem) {
|
|
1387
|
-
Object.assign(network, emptyNetwork);
|
|
1388
|
-
|
|
1389
|
-
ni && Object.assign(network, ni);
|
|
1390
|
-
|
|
1391
|
-
showInterceptConfig.value = true;
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
function onCloseInterceptConfig() {
|
|
1395
|
-
showInterceptConfig.value = false;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
function onRemoveInterceptConfig(ni: DevTool.NetworkItem) {
|
|
1399
|
-
basicSendMessage({
|
|
1400
|
-
type: DEV_INTERCEPT_NETWORK_REMOVE,
|
|
1401
|
-
data: ni,
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
function onConfirmInterceptConfig(ni: DevTool.NetworkItem) {
|
|
1406
|
-
const index = interceptNetworkList.value.findIndex((item) => {
|
|
1407
|
-
const key = `${item.method?.toUpperCase()}|${item.url?.split('?')[0]}`;
|
|
1408
|
-
const niKey = `${ni.method?.toUpperCase()}|${ni.url?.split('?')[0]}`;
|
|
1409
|
-
return key === niKey;
|
|
1410
|
-
});
|
|
1411
|
-
const list = [...interceptNetworkList.value];
|
|
862
|
+
onBeforeMount(() => {
|
|
863
|
+
data.setIsActive(true);
|
|
864
|
+
uni.$on(DEV_CORE_MESSAGE, handleCoreMessage);
|
|
865
|
+
});
|
|
1412
866
|
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
list.unshift(ni);
|
|
1417
|
-
}
|
|
867
|
+
onUnmounted(() => {
|
|
868
|
+
uni.$off(DEV_CORE_MESSAGE, handleCoreMessage);
|
|
869
|
+
});
|
|
1418
870
|
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
interceptNetworkList: cacheInterceptConfig.value ? list : [],
|
|
1422
|
-
});
|
|
871
|
+
onShow(() => {
|
|
872
|
+
// #ifdef MP-WEIXIN
|
|
1423
873
|
basicSendMessage({
|
|
1424
|
-
type:
|
|
1425
|
-
data:
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
function onOpenUploadDetail(up?: DevTool.UploadItem) {
|
|
1430
|
-
Object.assign(upload, up);
|
|
1431
|
-
showUploadDetail.value = true;
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
function onCloseUploadDetail() {
|
|
1435
|
-
showUploadDetail.value = false;
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
function onOpenWebSocketDetail(ws?: DevTool.WS) {
|
|
1439
|
-
Object.assign(webSocket, ws);
|
|
1440
|
-
|
|
1441
|
-
nextTick(() => {
|
|
1442
|
-
if (currentWebSocket.value) {
|
|
1443
|
-
showWebSocketDetail.value = true;
|
|
1444
|
-
} else {
|
|
1445
|
-
//
|
|
1446
|
-
}
|
|
874
|
+
type: CMD_TYPE.TAB_CHANGE,
|
|
875
|
+
data: { path: getCurrentPagePath() },
|
|
1447
876
|
});
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
function onCloseWebSocketDetail() {
|
|
1451
|
-
showWebSocketDetail.value = false;
|
|
1452
|
-
}
|
|
877
|
+
// #endif
|
|
878
|
+
});
|
|
1453
879
|
|
|
1454
|
-
|
|
880
|
+
onTabItemTap((option) => {
|
|
1455
881
|
basicSendMessage({
|
|
1456
|
-
type:
|
|
1457
|
-
data:
|
|
882
|
+
type: CMD_TYPE.TAB_CHANGE,
|
|
883
|
+
data: { path: option.pagePath },
|
|
1458
884
|
});
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
// 防止滚动穿透
|
|
1462
|
-
function onTouchMove(e: TouchEvent) {
|
|
1463
|
-
/* #ifdef H5 */
|
|
1464
|
-
|
|
1465
|
-
// 为了防止滚动穿透 浏览器抛出错误
|
|
1466
|
-
// [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
|
|
1467
|
-
// 在需要滑动的容器上加入 @touchmove.stop
|
|
1468
|
-
e.preventDefault();
|
|
1469
|
-
|
|
1470
|
-
e.stopPropagation();
|
|
1471
|
-
/* #endif */
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
function onWheel(e: WheelEvent) {
|
|
1475
|
-
/* #ifdef H5 */
|
|
1476
|
-
|
|
1477
|
-
e.preventDefault();
|
|
1478
|
-
|
|
1479
|
-
e.stopPropagation();
|
|
1480
|
-
/* #endif */
|
|
1481
|
-
}
|
|
885
|
+
});
|
|
1482
886
|
</script>
|
|
1483
|
-
|
|
1484
887
|
<style scoped>
|
|
1485
888
|
.dev-tool-window {
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
--dev-tool-warn-bg-color: rgba(247, 214, 114, 0.2);
|
|
1490
|
-
--dev-tool-error-color: #ff4d4f;
|
|
1491
|
-
--dev-tool-error-bg-color: rgba(251, 183, 185, 0.2);
|
|
1492
|
-
--dev-tool-success-color: #bae637;
|
|
1493
|
-
--dev-tool-success-bg-color: #fcffe6;
|
|
1494
|
-
|
|
1495
|
-
--dev-tool-base-font-size: 12px;
|
|
1496
|
-
--dev-tool-tag-font-size: 10px;
|
|
1497
|
-
--dev-tool-tips-font-size: 10px;
|
|
1498
|
-
|
|
1499
|
-
--dev-tool-text-color-placeholder: #909090;
|
|
1500
|
-
|
|
1501
|
-
--dev-tool-active-bg-color: rgba(0, 0, 0, 0.05);
|
|
1502
|
-
|
|
1503
|
-
-webkit-tap-highlight-color: transparent;
|
|
1504
|
-
|
|
1505
|
-
position: fixed;
|
|
1506
|
-
top: 0;
|
|
1507
|
-
left: 0;
|
|
1508
|
-
z-index: 998;
|
|
1509
|
-
/* #ifdef H5 || APP-PLUS */
|
|
1510
|
-
/* padding: 50px 0; */
|
|
1511
|
-
/* #endif */
|
|
1512
|
-
|
|
1513
|
-
width: 100vw;
|
|
1514
|
-
height: 100vh;
|
|
1515
|
-
font-size: 14px;
|
|
889
|
+
position: relative;
|
|
890
|
+
width: 100%;
|
|
891
|
+
height: 100%;
|
|
1516
892
|
color: var(--dev-tool-text-color);
|
|
1517
893
|
box-sizing: border-box;
|
|
1518
|
-
transition:
|
|
894
|
+
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
|
|
895
|
+
pointer-events: auto;
|
|
1519
896
|
}
|
|
1520
897
|
|
|
1521
|
-
.
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
--dev-tool-text-color: #000;
|
|
1527
|
-
|
|
1528
|
-
--dev-tool-border-color: #f0f0f0;
|
|
1529
|
-
--dev-tool-info-color: #9c9c9c;
|
|
1530
|
-
--dev-tool-log-color: #f9f9f9;
|
|
1531
|
-
--dev-tool-nil-color: #020201;
|
|
1532
|
-
--dev-tool-number-color: #1d8ce0;
|
|
1533
|
-
--dev-tool-boolean-color: #1d8ce0;
|
|
1534
|
-
--dev-tool-symbol-color: bisque;
|
|
1535
|
-
--dev-tool-active-bg-color: #f0f0f0;
|
|
1536
|
-
--dev-tool-time-line-color: #9254de;
|
|
1537
|
-
|
|
1538
|
-
--dev-tool-note-color: #9c9c9c;
|
|
1539
|
-
|
|
1540
|
-
--dev-tool-keyword-color: #9254de;
|
|
1541
|
-
--dev-tool-bracket-color: #9c9c9c;
|
|
1542
|
-
--dev-tool-quotation-color: #91e76a;
|
|
1543
|
-
--dev-tool-string-color: #91e76a;
|
|
1544
|
-
--dev-tool-function-color: #1d8ce0;
|
|
1545
|
-
--dev-tool-attribute-color: #ef66ba;
|
|
1546
|
-
--dev-tool-operator-color: #50d3eb;
|
|
898
|
+
.is-window {
|
|
899
|
+
border-radius: 12px;
|
|
900
|
+
overflow: hidden;
|
|
901
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
|
|
902
|
+
border: 1px solid var(--dev-tool-border-color);
|
|
1547
903
|
}
|
|
1548
|
-
.dev-tool-window-dark {
|
|
1549
|
-
--dev-tool-bg-color: rgba(0, 0, 0, 0.8);
|
|
1550
|
-
--dev-tool-bg2-color: rgba(43, 43, 43, 0.8);
|
|
1551
|
-
--dev-tool-bg3-color: rgba(43, 43, 43, 0.999);
|
|
1552
904
|
|
|
1553
|
-
|
|
1554
|
-
|
|
905
|
+
.is-window .dev-tool-window-bg {
|
|
906
|
+
border-radius: 12px;
|
|
907
|
+
}
|
|
1555
908
|
|
|
1556
|
-
|
|
1557
|
-
|
|
909
|
+
.is-full-screen {
|
|
910
|
+
border-radius: 0;
|
|
911
|
+
}
|
|
1558
912
|
|
|
1559
|
-
|
|
913
|
+
.window-header {
|
|
914
|
+
width: 100%;
|
|
915
|
+
cursor: move;
|
|
916
|
+
display: flex;
|
|
917
|
+
flex-direction: column;
|
|
918
|
+
}
|
|
1560
919
|
|
|
1561
|
-
|
|
920
|
+
.drag-indicator {
|
|
921
|
+
display: flex;
|
|
922
|
+
justify-content: center;
|
|
923
|
+
align-items: center;
|
|
924
|
+
height: 6px;
|
|
925
|
+
padding-top: 4px;
|
|
926
|
+
}
|
|
1562
927
|
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
--dev-tool-
|
|
1568
|
-
|
|
1569
|
-
|
|
928
|
+
.drag-indicator::after {
|
|
929
|
+
content: '';
|
|
930
|
+
width: 32px;
|
|
931
|
+
height: 4px;
|
|
932
|
+
background-color: var(--dev-tool-text-color);
|
|
933
|
+
border-radius: 2px;
|
|
934
|
+
opacity: 0.15;
|
|
1570
935
|
}
|
|
1571
936
|
|
|
1572
937
|
.dev-tool-window-bg {
|
|
@@ -1574,39 +939,24 @@ function onWheel(e: WheelEvent) {
|
|
|
1574
939
|
z-index: -1;
|
|
1575
940
|
top: 0;
|
|
1576
941
|
left: 0;
|
|
1577
|
-
width:
|
|
1578
|
-
height:
|
|
1579
|
-
background-color: var(--dev-tool-
|
|
942
|
+
width: 100%;
|
|
943
|
+
height: 100%;
|
|
944
|
+
background-color: var(--dev-tool-bg3-color);
|
|
1580
945
|
backdrop-filter: blur(6px);
|
|
1581
|
-
transition:
|
|
946
|
+
transition: all 0.3s;
|
|
1582
947
|
}
|
|
948
|
+
|
|
1583
949
|
.dev-tool-window-container {
|
|
1584
950
|
height: calc(100% - 32px);
|
|
1585
|
-
overflow:
|
|
951
|
+
overflow: hidden;
|
|
952
|
+
position: relative;
|
|
1586
953
|
}
|
|
1587
954
|
|
|
1588
|
-
/* #ifdef H5 || APP-PLUS */
|
|
1589
|
-
.dev-tool-window-container ::-webkit-scrollbar {
|
|
1590
|
-
display: none;
|
|
1591
|
-
width: 0;
|
|
1592
|
-
height: 0;
|
|
1593
|
-
background-color: transparent;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
.dev-tool-window-container ::-webkit-scrollbar-thumb {
|
|
1597
|
-
width: 0;
|
|
1598
|
-
height: 0;
|
|
1599
|
-
background-color: transparent;
|
|
1600
|
-
}
|
|
1601
|
-
/* #endif */
|
|
1602
|
-
|
|
1603
955
|
.dev-tool-window::after {
|
|
1604
956
|
content: '';
|
|
1605
957
|
}
|
|
958
|
+
|
|
1606
959
|
.dev-tool-window ::-webkit-scrollbar {
|
|
1607
960
|
display: none;
|
|
1608
|
-
width: 0;
|
|
1609
|
-
height: 0;
|
|
1610
|
-
color: transparent;
|
|
1611
961
|
}
|
|
1612
962
|
</style>
|