vite-uni-dev-tool 1.1.0 → 1.2.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 +8 -0
- package/dist/const.cjs +1 -1
- package/dist/const.d.ts +1 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/i18n/locales/en.cjs +1 -1
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.cjs +1 -1
- package/dist/i18n/locales/zh-Hans.d.ts +5 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/modules/devIntercept/index.cjs +9 -9
- package/dist/modules/devIntercept/index.d.ts +1 -1
- package/dist/modules/devIntercept/index.d.ts.map +1 -1
- package/dist/modules/devIntercept/index.js +9 -9
- package/dist/modules/devStore/index.cjs +1 -1
- package/dist/modules/devStore/index.d.ts.map +1 -1
- package/dist/modules/devStore/index.js +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -3
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts +2 -1
- 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 +31 -25
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +2 -1
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +30 -24
- package/dist/plugins/uniDevTool/uniDevTool.cjs +3 -3
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/type.d.ts +3 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/v3/DevTool/components/BluetoothList/BluetoothItem.vue +199 -199
- package/dist/v3/DevTool/components/BluetoothList/BluetoothTool.vue +730 -730
- package/dist/v3/DevTool/components/BluetoothList/index.vue +167 -167
- package/dist/v3/DevTool/components/CaptureScreen/index.vue +109 -109
- package/dist/v3/DevTool/components/ConsoleList/ConsoleItem.vue +230 -225
- package/dist/v3/DevTool/components/ConsoleList/RunJSInput.vue +247 -247
- package/dist/v3/DevTool/components/ConsoleList/index.vue +171 -171
- package/dist/v3/DevTool/components/ConsoleList/staticTips.ts +1145 -1145
- package/dist/v3/DevTool/components/DevToolTitle/index.vue +24 -24
- package/dist/v3/DevTool/components/DevToolWindow/DevToolOverlay.vue +197 -197
- package/dist/v3/DevTool/components/DevToolWindow/hooks/dataUtils.ts +48 -48
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolData.ts +387 -387
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolHandlers.ts +629 -629
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolOverlay.ts +201 -197
- package/dist/v3/DevTool/components/ElEvent/ElEventItem.vue +105 -105
- package/dist/v3/DevTool/components/ElEvent/index.vue +106 -106
- package/dist/v3/DevTool/components/Instance/components/InstanceTreeNode.vue +265 -265
- package/dist/v3/DevTool/components/Instance/flatten.ts +226 -226
- package/dist/v3/DevTool/components/Instance/index.vue +94 -94
- package/dist/v3/DevTool/components/Instance/registry.ts +49 -49
- package/dist/v3/DevTool/components/Instance/transformTree.ts +375 -375
- package/dist/v3/DevTool/components/Instance/transformTreeCtx.ts +268 -268
- package/dist/v3/DevTool/components/Instance/typing.d.ts +43 -43
- package/dist/v3/DevTool/components/InstanceDetail/index.vue +485 -485
- package/dist/v3/DevTool/components/JsonDetail/index.vue +70 -70
- package/dist/v3/DevTool/components/NFCList/NFCItem.vue +112 -112
- package/dist/v3/DevTool/components/NFCList/NFCTool.vue +454 -454
- package/dist/v3/DevTool/components/NFCList/const.ts +56 -56
- package/dist/v3/DevTool/components/NFCList/index.vue +94 -94
- package/dist/v3/DevTool/components/NetworkList/InterceptConfig.vue +624 -624
- package/dist/v3/DevTool/components/NetworkList/InterceptItem.vue +140 -140
- package/dist/v3/DevTool/components/NetworkList/NetworkDetail.vue +287 -287
- package/dist/v3/DevTool/components/NetworkList/NetworkIntercept.vue +88 -88
- package/dist/v3/DevTool/components/NetworkList/NetworkItem.vue +163 -163
- package/dist/v3/DevTool/components/NetworkList/NetworkSend.vue +589 -589
- package/dist/v3/DevTool/components/NetworkList/const.ts +4 -4
- package/dist/v3/DevTool/components/NetworkList/hooks/useNetworkForm.ts +86 -86
- package/dist/v3/DevTool/components/NetworkList/index.vue +160 -160
- package/dist/v3/DevTool/components/NetworkList/utils.ts +101 -101
- package/dist/v3/DevTool/components/Performance/index.vue +498 -498
- package/dist/v3/DevTool/components/Performance/modules/PerformanceMetrics.vue +153 -153
- package/dist/v3/DevTool/components/Performance/modules/usePerformanceChart.ts +460 -460
- package/dist/v3/DevTool/components/Performance/modules/usePerformanceData.ts +258 -258
- package/dist/v3/DevTool/components/PiniaList/index.vue +93 -93
- package/dist/v3/DevTool/components/RunJS/index.vue +148 -148
- package/dist/v3/DevTool/components/ScanCodeList/ScanCodeItem.vue +97 -97
- package/dist/v3/DevTool/components/ScanCodeList/index.vue +100 -100
- package/dist/v3/DevTool/components/SettingButton/index.vue +45 -45
- package/dist/v3/DevTool/components/SettingList/index.vue +218 -218
- package/dist/v3/DevTool/components/SettingList/modules/SettingBarrage.vue +304 -304
- package/dist/v3/DevTool/components/SettingList/modules/SettingDevTool.vue +212 -212
- package/dist/v3/DevTool/components/SettingList/modules/SettingInfo.vue +157 -157
- package/dist/v3/DevTool/components/SettingList/modules/SettingLanguage.vue +74 -74
- package/dist/v3/DevTool/components/SettingList/modules/SettingLog.vue +230 -230
- package/dist/v3/DevTool/components/SettingList/typing.d.ts +2 -2
- package/dist/v3/DevTool/components/SourceCode/Line.vue +127 -127
- package/dist/v3/DevTool/components/SourceCode/parseCode.ts +609 -609
- package/dist/v3/DevTool/components/StorageList/index.vue +174 -174
- package/dist/v3/DevTool/components/TransferList/TransferDetail.vue +268 -268
- package/dist/v3/DevTool/components/VuexList/index.vue +84 -84
- package/dist/v3/DevTool/index.vue +1 -0
- package/dist/v3/components/AppTransition/index.vue +176 -176
- package/dist/v3/components/AutoSizer/index.vue +192 -192
- package/dist/v3/components/AutoSizer/index1.vue +184 -184
- package/dist/v3/components/AutoSizer/utils.ts +49 -49
- package/dist/v3/components/Barrage/BarrageItem.vue +137 -137
- package/dist/v3/components/Barrage/index.vue +202 -202
- package/dist/v3/components/CircularButton/index.vue +84 -84
- package/dist/v3/components/CustomSwiper/CustomSwiperItem.vue +49 -49
- package/dist/v3/components/CustomSwiper/index.vue +104 -104
- package/dist/v3/components/DevErrorBoundary/index.vue +380 -0
- package/dist/v3/components/Empty/index.vue +29 -29
- package/dist/v3/components/FilterSelect/index.vue +179 -179
- package/dist/v3/components/JsonPretty/components/Brackets/index.vue +27 -27
- package/dist/v3/components/JsonPretty/components/Carets/index.vue +59 -59
- package/dist/v3/components/JsonPretty/components/CheckController/index.vue +136 -136
- package/dist/v3/components/JsonPretty/components/TreeNode/index.vue +387 -387
- package/dist/v3/components/JsonPretty/hooks/useClipboard.ts +21 -21
- package/dist/v3/components/JsonPretty/hooks/useError.ts +21 -21
- package/dist/v3/components/JsonPretty/type.ts +127 -127
- package/dist/v3/components/JsonPretty/utils/index.ts +169 -169
- package/dist/v3/components/MovableContainer/index.vue +8 -4
- package/dist/v3/components/Pick/index.vue +322 -322
- package/dist/v3/components/Tag/index.vue +113 -113
- package/dist/v3/components/VirtualList/AutoSize.vue +40 -40
- package/dist/v3/components/VirtualList/index.vue +416 -416
- package/dist/v3/hooks/useBluetooth/index.ts +561 -561
- package/dist/v3/hooks/useContainerStyle.ts +153 -153
- package/dist/v3/hooks/useNFC/index.ts +107 -107
- package/dist/v3/hooks/useNFC/typing.d.ts +396 -396
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +966 -966
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +812 -812
- package/dist/v3/hooks/useNFC/utils.ts +754 -754
- package/dist/v3/hooks/useRequest/index.ts +586 -586
- package/dist/v3/hooks/useRequest/utils.ts +267 -267
- package/dist/v3/hooks/useScanCode/index.ts +206 -206
- package/dist/v3/hooks/useWebsocket/index.ts +253 -253
- package/dist/v3/styles/theme.ts +12 -12
- package/package.json +9 -1
|
@@ -1,197 +1,201 @@
|
|
|
1
|
-
import { ref, reactive, shallowRef, nextTick } from 'vue';
|
|
2
|
-
import type { DevTool } from '../../../../../type';
|
|
3
|
-
import { isMockWX, isAndroid } from '../../../../../utils/index';
|
|
4
|
-
import { emptyNetwork } from '../const';
|
|
5
|
-
|
|
6
|
-
export function useDevToolOverlay(props: any) {
|
|
7
|
-
const openCode = ref(false);
|
|
8
|
-
const stack = ref('');
|
|
9
|
-
const showNetworkSend = ref(false);
|
|
10
|
-
const showNetworkDetail = ref(false);
|
|
11
|
-
const showNetworkIntercept = ref(false);
|
|
12
|
-
const showInterceptConfig = ref(false);
|
|
13
|
-
const showJsonDetail = ref(false);
|
|
14
|
-
const jsonData = shallowRef<
|
|
15
|
-
{ title?: string; data: Record<string, any> } | undefined
|
|
16
|
-
>();
|
|
17
|
-
const showNfcTool = ref(false);
|
|
18
|
-
const showTransferDetail = ref(false);
|
|
19
|
-
const showWebSocketDetail = ref(false);
|
|
20
|
-
const showBluetoothTool = ref(false);
|
|
21
|
-
const bluetoothDevice = shallowRef<DevTool.BluetoothItem | null>(null);
|
|
22
|
-
|
|
23
|
-
const network = reactive<DevTool.NetworkItem>({ ...emptyNetwork });
|
|
24
|
-
const transfer = reactive<DevTool.TransferItem>({
|
|
25
|
-
index: 0,
|
|
26
|
-
status: '',
|
|
27
|
-
type: 'upload',
|
|
28
|
-
});
|
|
29
|
-
const webSocket = reactive<DevTool.WS>({ url: '', message: [] });
|
|
30
|
-
|
|
31
|
-
function onCloseCode() {
|
|
32
|
-
openCode.value = false;
|
|
33
|
-
stack.value = '';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function onOpenCode(value?: string) {
|
|
37
|
-
if (!value) return;
|
|
38
|
-
stack.value = value;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
showJsonDetail.value =
|
|
71
|
-
jsonData.value =
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
1
|
+
import { ref, reactive, shallowRef, nextTick } from 'vue';
|
|
2
|
+
import type { DevTool } from '../../../../../type';
|
|
3
|
+
import { isMockWX, isAndroid } from '../../../../../utils/index';
|
|
4
|
+
import { emptyNetwork } from '../const';
|
|
5
|
+
|
|
6
|
+
export function useDevToolOverlay(props: any) {
|
|
7
|
+
const openCode = ref(false);
|
|
8
|
+
const stack = ref('');
|
|
9
|
+
const showNetworkSend = ref(false);
|
|
10
|
+
const showNetworkDetail = ref(false);
|
|
11
|
+
const showNetworkIntercept = ref(false);
|
|
12
|
+
const showInterceptConfig = ref(false);
|
|
13
|
+
const showJsonDetail = ref(false);
|
|
14
|
+
const jsonData = shallowRef<
|
|
15
|
+
{ title?: string; data: Record<string, any> } | undefined
|
|
16
|
+
>();
|
|
17
|
+
const showNfcTool = ref(false);
|
|
18
|
+
const showTransferDetail = ref(false);
|
|
19
|
+
const showWebSocketDetail = ref(false);
|
|
20
|
+
const showBluetoothTool = ref(false);
|
|
21
|
+
const bluetoothDevice = shallowRef<DevTool.BluetoothItem | null>(null);
|
|
22
|
+
|
|
23
|
+
const network = reactive<DevTool.NetworkItem>({ ...emptyNetwork });
|
|
24
|
+
const transfer = reactive<DevTool.TransferItem>({
|
|
25
|
+
index: 0,
|
|
26
|
+
status: '',
|
|
27
|
+
type: 'upload',
|
|
28
|
+
});
|
|
29
|
+
const webSocket = reactive<DevTool.WS>({ url: '', message: [] });
|
|
30
|
+
|
|
31
|
+
function onCloseCode() {
|
|
32
|
+
openCode.value = false;
|
|
33
|
+
stack.value = '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function onOpenCode(value?: string) {
|
|
37
|
+
if (!value) return;
|
|
38
|
+
stack.value = value;
|
|
39
|
+
|
|
40
|
+
// 微信小程序下的虚拟路径,只能在小程序真机调试下打开
|
|
41
|
+
if (isMockWX(value)) {
|
|
42
|
+
uni.showToast({
|
|
43
|
+
icon: 'none',
|
|
44
|
+
title: '[DevTool] 请在小程序真机调试模式下查看源码',
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const isDev = props.mode === 'development';
|
|
50
|
+
const isUseDevSource = props.useDevSource;
|
|
51
|
+
|
|
52
|
+
// 非开发环境且未显式开启 useDevSource,不打开源码面板
|
|
53
|
+
if (!isDev && !isUseDevSource) return;
|
|
54
|
+
|
|
55
|
+
if (isAndroid()) {
|
|
56
|
+
if (props.sourceFileServers && props.sourceFileServers?.length > 0) {
|
|
57
|
+
openCode.value = true;
|
|
58
|
+
} else {
|
|
59
|
+
uni.showToast({
|
|
60
|
+
icon: 'none',
|
|
61
|
+
title: '[DevTool] sourceFileServers 配置异常',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
openCode.value = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function onOpenJson(data?: { title?: string; data: Record<string, any> }) {
|
|
70
|
+
showJsonDetail.value = true;
|
|
71
|
+
jsonData.value = data;
|
|
72
|
+
}
|
|
73
|
+
function onCloseJson() {
|
|
74
|
+
showJsonDetail.value = false;
|
|
75
|
+
jsonData.value = undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function onOpenNfcTool() {
|
|
79
|
+
showNfcTool.value = true;
|
|
80
|
+
}
|
|
81
|
+
function onCloseNfcTool() {
|
|
82
|
+
showNfcTool.value = false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function onOpenBluetoothTool(device: DevTool.BluetoothItem) {
|
|
86
|
+
bluetoothDevice.value = device;
|
|
87
|
+
showBluetoothTool.value = true;
|
|
88
|
+
}
|
|
89
|
+
function onCloseBluetoothTool() {
|
|
90
|
+
showBluetoothTool.value = false;
|
|
91
|
+
bluetoothDevice.value = null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function onOpenNetworkDetail(ni?: DevTool.NetworkItem) {
|
|
95
|
+
Object.assign(network, emptyNetwork);
|
|
96
|
+
Object.assign(network, ni);
|
|
97
|
+
showNetworkDetail.value = true;
|
|
98
|
+
}
|
|
99
|
+
function onCloseNetworkDetail() {
|
|
100
|
+
showNetworkDetail.value = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function onOpenNetworkSend(ni?: DevTool.NetworkItem) {
|
|
104
|
+
Object.assign(network, emptyNetwork);
|
|
105
|
+
Object.assign(network, ni);
|
|
106
|
+
showNetworkSend.value = true;
|
|
107
|
+
}
|
|
108
|
+
function onCloseNetworkSend() {
|
|
109
|
+
showNetworkSend.value = false;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function onOpenNetworkIntercept() {
|
|
113
|
+
showNetworkIntercept.value = true;
|
|
114
|
+
}
|
|
115
|
+
function onCloseNetworkIntercept() {
|
|
116
|
+
showNetworkIntercept.value = false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function onOpenInterceptConfig(ni?: DevTool.NetworkItem) {
|
|
120
|
+
Object.assign(network, emptyNetwork);
|
|
121
|
+
if (ni) Object.assign(network, ni);
|
|
122
|
+
showInterceptConfig.value = true;
|
|
123
|
+
}
|
|
124
|
+
function onCloseInterceptConfig() {
|
|
125
|
+
showInterceptConfig.value = false;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function onOpenTransferDetail(item?: DevTool.TransferItem) {
|
|
129
|
+
if ((item as any).formData) {
|
|
130
|
+
delete (transfer as any).formData;
|
|
131
|
+
}
|
|
132
|
+
if ((item as any).filePath) {
|
|
133
|
+
delete (transfer as any).filePath;
|
|
134
|
+
}
|
|
135
|
+
Object.assign(transfer, item);
|
|
136
|
+
showTransferDetail.value = true;
|
|
137
|
+
}
|
|
138
|
+
function onCloseTransferDetail() {
|
|
139
|
+
showTransferDetail.value = false;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function onOpenWebSocketDetail(ws?: DevTool.WS, currentWebSocket?: any) {
|
|
143
|
+
Object.assign(webSocket, ws);
|
|
144
|
+
nextTick(() => {
|
|
145
|
+
// 兼容直接传入对象或传入 Ref 的情况
|
|
146
|
+
if (
|
|
147
|
+
currentWebSocket === undefined ||
|
|
148
|
+
currentWebSocket?.value ||
|
|
149
|
+
currentWebSocket
|
|
150
|
+
) {
|
|
151
|
+
showWebSocketDetail.value = true;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function onCloseWebSocketDetail() {
|
|
156
|
+
showWebSocketDetail.value = false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
state: reactive({
|
|
161
|
+
openCode,
|
|
162
|
+
stack,
|
|
163
|
+
showNetworkSend,
|
|
164
|
+
showNetworkDetail,
|
|
165
|
+
showNetworkIntercept,
|
|
166
|
+
showInterceptConfig,
|
|
167
|
+
showJsonDetail,
|
|
168
|
+
jsonData,
|
|
169
|
+
showNfcTool,
|
|
170
|
+
showTransferDetail,
|
|
171
|
+
showWebSocketDetail,
|
|
172
|
+
showBluetoothTool,
|
|
173
|
+
bluetoothDevice,
|
|
174
|
+
}),
|
|
175
|
+
network,
|
|
176
|
+
transfer,
|
|
177
|
+
webSocket,
|
|
178
|
+
handlers: {
|
|
179
|
+
onCloseCode,
|
|
180
|
+
onOpenCode,
|
|
181
|
+
onOpenJson,
|
|
182
|
+
onCloseJson,
|
|
183
|
+
onOpenNfcTool,
|
|
184
|
+
onCloseNfcTool,
|
|
185
|
+
onOpenNetworkDetail,
|
|
186
|
+
onCloseNetworkDetail,
|
|
187
|
+
onOpenNetworkSend,
|
|
188
|
+
onCloseNetworkSend,
|
|
189
|
+
onOpenNetworkIntercept,
|
|
190
|
+
onCloseNetworkIntercept,
|
|
191
|
+
onOpenInterceptConfig,
|
|
192
|
+
onCloseInterceptConfig,
|
|
193
|
+
onOpenTransferDetail,
|
|
194
|
+
onCloseTransferDetail,
|
|
195
|
+
onOpenWebSocketDetail,
|
|
196
|
+
onCloseWebSocketDetail,
|
|
197
|
+
onOpenBluetoothTool,
|
|
198
|
+
onCloseBluetoothTool,
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="el-event-item" @click.stop="onOpenJSon">
|
|
3
|
-
<!-- <view class="el-event-item-row"> {{ eventItem.eventName }} </view> -->
|
|
4
|
-
<view class="el-event-item-row">
|
|
5
|
-
<Tag mode="main" v-if="eventItem.type == 'click'">
|
|
6
|
-
{{ eventItem.type }}
|
|
7
|
-
</Tag>
|
|
8
|
-
<Tag mode="main" v-else-if="eventItem.type == 'tap'">
|
|
9
|
-
{{ eventItem.type }}
|
|
10
|
-
</Tag>
|
|
11
|
-
<Tag mode="success" v-else-if="eventItem.type == 'touchstart'">
|
|
12
|
-
{{ eventItem.type }}
|
|
13
|
-
</Tag>
|
|
14
|
-
<Tag mode="warn" v-else-if="eventItem.type == 'touchmove'">
|
|
15
|
-
{{ eventItem.type }}
|
|
16
|
-
</Tag>
|
|
17
|
-
<Tag mode="error" v-else-if="eventItem.type == 'touchend'">
|
|
18
|
-
{{ eventItem.type }}
|
|
19
|
-
</Tag>
|
|
20
|
-
<Tag mode="main" v-else>
|
|
21
|
-
{{ eventItem.type }}
|
|
22
|
-
</Tag>
|
|
23
|
-
|
|
24
|
-
<view class="el-event-item-right">
|
|
25
|
-
{{
|
|
26
|
-
eventItem.timer
|
|
27
|
-
? formatDate(eventItem.timer, 'YYYY-MM-DD HH:mm:SS')
|
|
28
|
-
: ''
|
|
29
|
-
}}
|
|
30
|
-
</view>
|
|
31
|
-
</view>
|
|
32
|
-
|
|
33
|
-
<view class="el-event-item-page">{{ eventItem?.path }}</view>
|
|
34
|
-
|
|
35
|
-
<view
|
|
36
|
-
class="el-event-item-position"
|
|
37
|
-
v-for="(point, index) in eventItem.touches"
|
|
38
|
-
:key="index">
|
|
39
|
-
<view>cx:{{ point.clientX }}</view>
|
|
40
|
-
<view>cy:{{ point.clientY }}</view>
|
|
41
|
-
<view>px:{{ point.pageX }}</view>
|
|
42
|
-
<view>py:{{ point.pageY }}</view>
|
|
43
|
-
</view>
|
|
44
|
-
</view>
|
|
45
|
-
</template>
|
|
46
|
-
<script lang="ts" setup>
|
|
47
|
-
import Tag from '../../../components/Tag/index.vue';
|
|
48
|
-
import type { DevTool } from '../../../../type';
|
|
49
|
-
import { formatDate } from '../../../../utils';
|
|
50
|
-
|
|
51
|
-
const props = defineProps<{
|
|
52
|
-
eventItem: DevTool.ElEventItem;
|
|
53
|
-
}>();
|
|
54
|
-
|
|
55
|
-
const emit = defineEmits<{
|
|
56
|
-
(e: 'openJson', value?: { title?: string; data: Record<string, any> }): void;
|
|
57
|
-
}>();
|
|
58
|
-
|
|
59
|
-
function onOpenJSon() {
|
|
60
|
-
emit('openJson', {
|
|
61
|
-
title: '事件详情',
|
|
62
|
-
data: props.eventItem,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style scoped>
|
|
68
|
-
.el-event-item {
|
|
69
|
-
padding: 16px;
|
|
70
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.el-event-item-row {
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: space-between;
|
|
78
|
-
height: 28px;
|
|
79
|
-
word-break: break-all;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.el-event-item-right {
|
|
83
|
-
text-align: right;
|
|
84
|
-
word-break: break-all;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.link {
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
text-decoration: underline;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.el-event-item-page {
|
|
93
|
-
text-align: right;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.el-event-item-position {
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
min-height: 24px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.el-event-item-position > view {
|
|
103
|
-
width: 25%;
|
|
104
|
-
}
|
|
105
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="el-event-item" @click.stop="onOpenJSon">
|
|
3
|
+
<!-- <view class="el-event-item-row"> {{ eventItem.eventName }} </view> -->
|
|
4
|
+
<view class="el-event-item-row">
|
|
5
|
+
<Tag mode="main" v-if="eventItem.type == 'click'">
|
|
6
|
+
{{ eventItem.type }}
|
|
7
|
+
</Tag>
|
|
8
|
+
<Tag mode="main" v-else-if="eventItem.type == 'tap'">
|
|
9
|
+
{{ eventItem.type }}
|
|
10
|
+
</Tag>
|
|
11
|
+
<Tag mode="success" v-else-if="eventItem.type == 'touchstart'">
|
|
12
|
+
{{ eventItem.type }}
|
|
13
|
+
</Tag>
|
|
14
|
+
<Tag mode="warn" v-else-if="eventItem.type == 'touchmove'">
|
|
15
|
+
{{ eventItem.type }}
|
|
16
|
+
</Tag>
|
|
17
|
+
<Tag mode="error" v-else-if="eventItem.type == 'touchend'">
|
|
18
|
+
{{ eventItem.type }}
|
|
19
|
+
</Tag>
|
|
20
|
+
<Tag mode="main" v-else>
|
|
21
|
+
{{ eventItem.type }}
|
|
22
|
+
</Tag>
|
|
23
|
+
|
|
24
|
+
<view class="el-event-item-right">
|
|
25
|
+
{{
|
|
26
|
+
eventItem.timer
|
|
27
|
+
? formatDate(eventItem.timer, 'YYYY-MM-DD HH:mm:SS')
|
|
28
|
+
: ''
|
|
29
|
+
}}
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
|
|
33
|
+
<view class="el-event-item-page">{{ eventItem?.path }}</view>
|
|
34
|
+
|
|
35
|
+
<view
|
|
36
|
+
class="el-event-item-position"
|
|
37
|
+
v-for="(point, index) in eventItem.touches"
|
|
38
|
+
:key="index">
|
|
39
|
+
<view>cx:{{ point.clientX }}</view>
|
|
40
|
+
<view>cy:{{ point.clientY }}</view>
|
|
41
|
+
<view>px:{{ point.pageX }}</view>
|
|
42
|
+
<view>py:{{ point.pageY }}</view>
|
|
43
|
+
</view>
|
|
44
|
+
</view>
|
|
45
|
+
</template>
|
|
46
|
+
<script lang="ts" setup>
|
|
47
|
+
import Tag from '../../../components/Tag/index.vue';
|
|
48
|
+
import type { DevTool } from '../../../../type';
|
|
49
|
+
import { formatDate } from '../../../../utils';
|
|
50
|
+
|
|
51
|
+
const props = defineProps<{
|
|
52
|
+
eventItem: DevTool.ElEventItem;
|
|
53
|
+
}>();
|
|
54
|
+
|
|
55
|
+
const emit = defineEmits<{
|
|
56
|
+
(e: 'openJson', value?: { title?: string; data: Record<string, any> }): void;
|
|
57
|
+
}>();
|
|
58
|
+
|
|
59
|
+
function onOpenJSon() {
|
|
60
|
+
emit('openJson', {
|
|
61
|
+
title: '事件详情',
|
|
62
|
+
data: props.eventItem,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style scoped>
|
|
68
|
+
.el-event-item {
|
|
69
|
+
padding: 16px;
|
|
70
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.el-event-item-row {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
height: 28px;
|
|
79
|
+
word-break: break-all;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.el-event-item-right {
|
|
83
|
+
text-align: right;
|
|
84
|
+
word-break: break-all;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.link {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.el-event-item-page {
|
|
93
|
+
text-align: right;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.el-event-item-position {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
min-height: 24px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.el-event-item-position > view {
|
|
103
|
+
width: 25%;
|
|
104
|
+
}
|
|
105
|
+
</style>
|