vite-uni-dev-tool 0.0.10 → 0.0.12
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 +65 -1
- package/dev/components/AppInfo/index.vue +36 -0
- package/dev/components/CaptureScreen/index.vue +62 -0
- package/dev/components/Code/index.vue +7 -4
- package/dev/components/ConsoleList/ConsoleItem.vue +24 -3
- package/dev/components/ConsoleList/RunJSInput.vue +180 -2
- package/dev/components/ConsoleList/index.vue +17 -2
- package/dev/components/ConsoleList/staticTips.ts +1145 -0
- package/dev/components/DevTool/index.vue +37 -31
- package/dev/components/DevToolButton/index.vue +9 -12
- package/dev/components/DevToolTitle/index.vue +2 -2
- package/dev/components/DevToolWindow/index.vue +230 -112
- package/dev/components/JsonPretty/components/Carets/index.vue +10 -14
- package/dev/components/JsonPretty/index.vue +2 -0
- package/dev/components/NetworkList/NetworkDetail.vue +3 -6
- package/dev/components/NetworkList/NetworkItem.vue +21 -8
- package/dev/components/NetworkList/index.vue +15 -2
- package/dev/components/RouteList/index.vue +12 -1
- package/dev/components/SettingList/index.vue +2 -5
- package/dev/components/SourceCode/index.vue +231 -0
- package/dev/components/Tabs/index.vue +23 -10
- package/dev/components/UniEvent/UniEventItem.vue +4 -2
- package/dev/components/UniEvent/index.vue +7 -3
- package/dev/components/UploadList/UploadDetail.vue +3 -7
- package/dev/components/UploadList/UploadItem.vue +7 -1
- package/dev/components/UploadList/index.vue +15 -2
- package/dev/components/VirtualListPro/index.vue +72 -3
- package/dev/components/VuexList/index.vue +2 -2
- package/dev/components/WebSocket/WebSocketItem.vue +7 -2
- package/dev/components/WebSocket/WebSocketList.vue +3 -6
- package/dev/components/WebSocket/index.vue +15 -2
- package/dev/const.ts +10 -14
- package/dev/devEvent/index.ts +49 -18
- package/dev/devIntercept/index.ts +18 -0
- package/dev/devStore/index.ts +60 -13
- package/dev/devToolInfo/index.ts +26 -0
- package/dev/plugins/uniDevTool/uniDevTool.d.ts +9 -1
- package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dev/plugins/uniDevTool/uniDevTool.js +36 -36
- package/dev/plugins/uniGlobalComponents/uniGlobalComponents.js +7 -7
- package/dev/type.ts +34 -0
- package/dev/utils/index.ts +5 -0
- package/dev/utils/language.ts +8 -3
- package/dev/utils/object.ts +10 -2
- package/package.json +1 -1
|
@@ -16,99 +16,143 @@
|
|
|
16
16
|
<view style="margin-left: 6px">{{ sizeFormat }}</view>
|
|
17
17
|
</template> -->
|
|
18
18
|
</Tabs>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
19
|
+
<swiper
|
|
20
|
+
class="dev-tool-window-container"
|
|
21
|
+
:current="activeTab"
|
|
22
|
+
@change="onChangeSwiper"
|
|
23
|
+
>
|
|
24
|
+
<swiper-item>
|
|
25
|
+
<ConsoleList
|
|
26
|
+
v-if="swiperShow(0)"
|
|
27
|
+
:currentConsoleType="currentConsoleType"
|
|
28
|
+
:consoleList="consoleList"
|
|
29
|
+
:sourceFileServers="sourceFileServers"
|
|
30
|
+
:mode="mode"
|
|
31
|
+
:useDevSource="useDevSource"
|
|
32
|
+
:zIndex="zIndex + 1"
|
|
33
|
+
v-model="searchConsole"
|
|
34
|
+
@choose="onConsoleChoose"
|
|
35
|
+
@search="onSearchConsole"
|
|
36
|
+
@run="onRunJS"
|
|
37
|
+
/>
|
|
38
|
+
</swiper-item>
|
|
39
|
+
<swiper-item>
|
|
40
|
+
<Connection v-if="swiperShow(1)" :netWorkStatus="netWorkStatus" />
|
|
41
|
+
</swiper-item>
|
|
42
|
+
<swiper-item>
|
|
43
|
+
<NetworkList
|
|
44
|
+
v-if="swiperShow(2)"
|
|
45
|
+
:currentNetworkType="currentNetworkType"
|
|
46
|
+
:networkList="networkList"
|
|
47
|
+
:zIndex="zIndex + 1"
|
|
48
|
+
v-model="searchNetwork"
|
|
49
|
+
@choose="onNetworkChoose"
|
|
50
|
+
@search="onSearchNetwork"
|
|
51
|
+
/>
|
|
52
|
+
</swiper-item>
|
|
53
|
+
<swiper-item>
|
|
54
|
+
<UploadList
|
|
55
|
+
v-if="swiperShow(3)"
|
|
56
|
+
:currentUploadType="currentUploadType"
|
|
57
|
+
:uploadList="uploadList"
|
|
58
|
+
:zIndex="zIndex + 1"
|
|
59
|
+
v-model="searchUpload"
|
|
60
|
+
@choose="onUploadChoose"
|
|
61
|
+
@search="onSearchUpload"
|
|
62
|
+
/>
|
|
63
|
+
</swiper-item>
|
|
64
|
+
<swiper-item>
|
|
65
|
+
<WebSocket
|
|
66
|
+
v-if="swiperShow(4)"
|
|
67
|
+
:wsList="wsList"
|
|
68
|
+
:currentWebSocketType="currentWebSocketType"
|
|
69
|
+
:zIndex="zIndex + 1"
|
|
70
|
+
v-model="searchWs"
|
|
71
|
+
@choose="onWebSocketChoose"
|
|
72
|
+
@search="onSearchWs"
|
|
73
|
+
/>
|
|
74
|
+
</swiper-item>
|
|
75
|
+
<swiper-item>
|
|
76
|
+
<RouteList
|
|
77
|
+
v-if="swiperShow(5)"
|
|
78
|
+
:routeList="routeList"
|
|
79
|
+
v-model="searchRoute"
|
|
80
|
+
@goTo="onGoTo"
|
|
81
|
+
@search="onSearchRoute"
|
|
82
|
+
@routeRefresh="onRouteRefresh"
|
|
83
|
+
/>
|
|
84
|
+
</swiper-item>
|
|
85
|
+
<swiper-item>
|
|
86
|
+
<UniEvent
|
|
87
|
+
v-if="swiperShow(6)"
|
|
88
|
+
:eventList="eventList"
|
|
89
|
+
:eventCount="eventCount"
|
|
90
|
+
:mode="mode"
|
|
91
|
+
:useDevSource="useDevSource"
|
|
92
|
+
:sourceFileServers="sourceFileServers"
|
|
93
|
+
:zIndex="zIndex + 1"
|
|
94
|
+
@clear="onUniEventClear"
|
|
95
|
+
/>
|
|
96
|
+
</swiper-item>
|
|
97
|
+
<swiper-item>
|
|
98
|
+
<CaptureScreen
|
|
99
|
+
v-if="swiperShow(7)"
|
|
100
|
+
:captureScreenList="captureScreenList"
|
|
101
|
+
@clear="onCaptureScreenClear"
|
|
102
|
+
/>
|
|
103
|
+
</swiper-item>
|
|
104
|
+
<swiper-item>
|
|
105
|
+
<StorageList
|
|
106
|
+
v-if="swiperShow(8)"
|
|
107
|
+
v-model:storage-list="storageList"
|
|
108
|
+
v-model="searchStorage"
|
|
109
|
+
@choose="onStorageChoose"
|
|
110
|
+
@remove="onStorageRemove"
|
|
111
|
+
@diff-value="onChangeStorage"
|
|
112
|
+
@search="onSearchStorage"
|
|
113
|
+
/>
|
|
114
|
+
</swiper-item>
|
|
115
|
+
<swiper-item>
|
|
116
|
+
<VuexList
|
|
117
|
+
v-if="swiperShow(9)"
|
|
118
|
+
v-model:vuexList="vuexList"
|
|
119
|
+
@diff-value="onChangeVuex"
|
|
120
|
+
/>
|
|
121
|
+
</swiper-item>
|
|
122
|
+
<swiper-item>
|
|
123
|
+
<PiniaList
|
|
124
|
+
v-if="swiperShow(10)"
|
|
125
|
+
v-model:pinia-list="piniaList"
|
|
126
|
+
@diff-value="onChangePinia"
|
|
127
|
+
/>
|
|
128
|
+
</swiper-item>
|
|
129
|
+
<swiper-item>
|
|
130
|
+
<WindowInfo v-if="swiperShow(11)" :windowInfo="windowInfo" />
|
|
131
|
+
</swiper-item>
|
|
132
|
+
<swiper-item>
|
|
133
|
+
<DeviceInfo v-if="swiperShow(12)" :deviceInfo="deviceInfo" />
|
|
134
|
+
</swiper-item>
|
|
135
|
+
<swiper-item>
|
|
136
|
+
<SystemInfo v-if="swiperShow(13)" :systemInfo="systemInfo" />
|
|
137
|
+
</swiper-item>
|
|
138
|
+
<swiper-item>
|
|
139
|
+
<AppInfo v-if="swiperShow(14)" :appInfo="appInfo" />
|
|
140
|
+
</swiper-item>
|
|
141
|
+
<swiper-item>
|
|
142
|
+
<SettingList
|
|
143
|
+
v-if="swiperShow(15)"
|
|
144
|
+
:devToolVisible="devToolVisible"
|
|
145
|
+
:sizeFormat="sizeFormat"
|
|
146
|
+
@showDevButton="onShowDevButton"
|
|
147
|
+
@restartDevTool="onRestartDevTool"
|
|
148
|
+
@restartApp="onRestartApp"
|
|
149
|
+
@exportLog="onExportLog"
|
|
150
|
+
@screenshot="onScreenshot"
|
|
151
|
+
@clearCache="onClearCache"
|
|
152
|
+
@destroyDevTool="onDestroyDevTool"
|
|
153
|
+
/>
|
|
154
|
+
</swiper-item>
|
|
155
|
+
</swiper>
|
|
112
156
|
</view>
|
|
113
157
|
</template>
|
|
114
158
|
|
|
@@ -130,7 +174,8 @@ import WindowInfo from '../WindowInfo/index.vue';
|
|
|
130
174
|
import WebSocket from '../WebSocket/index.vue';
|
|
131
175
|
import UploadList from '../UploadList/index.vue';
|
|
132
176
|
import UniEvent from '../UniEvent/index.vue';
|
|
133
|
-
import
|
|
177
|
+
import AppInfo from '../AppInfo/index.vue';
|
|
178
|
+
import CaptureScreen from '../CaptureScreen/index.vue';
|
|
134
179
|
import {
|
|
135
180
|
DEV_BUTTON_SHOW_OR_HIDE,
|
|
136
181
|
DEV_CONSOLE_CLEAR,
|
|
@@ -151,87 +196,113 @@ import {
|
|
|
151
196
|
DEV_UPLOAD_CLEAR,
|
|
152
197
|
DEV_VUEX_CHANGE,
|
|
153
198
|
DEV_WEBSOCKET_CLEAR,
|
|
154
|
-
DEV_WINDOW_INFO,
|
|
155
199
|
DEV_APP_MESSAGE,
|
|
156
200
|
DEV_UNI_EVENT_CLEAR,
|
|
157
|
-
DEV_RUN_JS_CLEAR,
|
|
158
201
|
DEV_RUN_JS,
|
|
202
|
+
DEV_CAPTURE_SCREEN_CLEAR,
|
|
159
203
|
} from '../../const';
|
|
160
204
|
import { debounce, hightLight } from '../../utils/index';
|
|
161
205
|
import type { DevTool } from '../../type';
|
|
162
206
|
import { eventBus } from '../../core';
|
|
207
|
+
import { getDevToolInfo, setDevToolInfo } from '../../devToolInfo';
|
|
163
208
|
|
|
164
209
|
const items = [
|
|
165
210
|
{
|
|
166
211
|
key: 'Console',
|
|
167
212
|
label: 'Console',
|
|
168
213
|
value: 'Console',
|
|
214
|
+
index: 0,
|
|
169
215
|
},
|
|
170
216
|
{
|
|
171
217
|
key: 'Connection',
|
|
172
218
|
label: 'Connection',
|
|
173
219
|
value: 'Connection',
|
|
220
|
+
index: 1,
|
|
174
221
|
},
|
|
175
222
|
{
|
|
176
223
|
key: 'Network',
|
|
177
224
|
label: 'Network',
|
|
178
225
|
value: 'NetWork',
|
|
226
|
+
index: 2,
|
|
179
227
|
},
|
|
180
228
|
{
|
|
181
229
|
key: 'Upload',
|
|
182
230
|
label: 'Upload',
|
|
183
231
|
value: 'Upload',
|
|
232
|
+
index: 3,
|
|
184
233
|
},
|
|
185
234
|
{
|
|
186
235
|
key: 'WebSocket',
|
|
187
236
|
label: 'WebSocket',
|
|
188
237
|
value: 'WebSocket',
|
|
238
|
+
index: 4,
|
|
189
239
|
},
|
|
190
240
|
{
|
|
191
241
|
key: 'Route',
|
|
192
242
|
label: 'Route',
|
|
193
243
|
value: 'Route',
|
|
244
|
+
index: 5,
|
|
194
245
|
},
|
|
195
246
|
{
|
|
196
247
|
key: 'UniEvent',
|
|
197
248
|
label: 'UniEvent',
|
|
198
249
|
value: 'UniEvent',
|
|
250
|
+
index: 6,
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
key: 'CaptureScreen',
|
|
254
|
+
label: 'CaptureScreen',
|
|
255
|
+
value: 'CaptureScreen',
|
|
256
|
+
index: 7,
|
|
199
257
|
},
|
|
200
258
|
{
|
|
201
259
|
key: 'Storage',
|
|
202
260
|
label: 'Storage',
|
|
203
261
|
value: 'Storage',
|
|
262
|
+
index: 8,
|
|
204
263
|
},
|
|
205
264
|
|
|
206
265
|
{
|
|
207
266
|
key: 'Vuex',
|
|
208
267
|
label: 'Vuex',
|
|
209
268
|
value: 'Vuex',
|
|
269
|
+
index: 9,
|
|
210
270
|
},
|
|
211
271
|
{
|
|
212
272
|
key: 'Pinia',
|
|
213
273
|
label: 'Pinia',
|
|
214
274
|
value: 'Pinia',
|
|
275
|
+
index: 10,
|
|
215
276
|
},
|
|
216
277
|
{
|
|
217
278
|
key: 'Window',
|
|
218
279
|
label: 'Window',
|
|
219
280
|
value: 'Window',
|
|
281
|
+
index: 11,
|
|
220
282
|
},
|
|
221
283
|
{
|
|
222
284
|
key: 'Device',
|
|
223
285
|
label: 'Device',
|
|
224
286
|
value: 'Device',
|
|
287
|
+
index: 12,
|
|
225
288
|
},
|
|
226
289
|
{
|
|
227
290
|
key: 'System',
|
|
228
291
|
label: 'System',
|
|
229
292
|
value: 'System',
|
|
293
|
+
index: 13,
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
key: 'AppInfo',
|
|
297
|
+
label: 'AppInfo',
|
|
298
|
+
value: 'AppInfo',
|
|
299
|
+
index: 14,
|
|
230
300
|
},
|
|
231
301
|
{
|
|
232
302
|
key: 'Setting',
|
|
233
303
|
label: 'Setting',
|
|
234
304
|
value: 'Setting',
|
|
305
|
+
index: 15,
|
|
235
306
|
},
|
|
236
307
|
];
|
|
237
308
|
|
|
@@ -267,6 +338,8 @@ const deviceInfo = ref<Record<string, any>>({});
|
|
|
267
338
|
const windowInfo = ref<Record<string, any>>({});
|
|
268
339
|
const eventList = ref<DevTool.EventItem[]>([]);
|
|
269
340
|
const eventCount = ref<DevTool.EventCount>();
|
|
341
|
+
const appInfo = ref<Record<string, any>>({});
|
|
342
|
+
const captureScreenList = ref<DevTool.CaptureScreenItem[]>([]);
|
|
270
343
|
|
|
271
344
|
const netWorkStatus = ref<{
|
|
272
345
|
isConnected?: boolean;
|
|
@@ -276,7 +349,7 @@ const sizeFormat = ref('');
|
|
|
276
349
|
|
|
277
350
|
const devToolVisible = ref(true);
|
|
278
351
|
|
|
279
|
-
const activeTab = ref(
|
|
352
|
+
const activeTab = ref(0);
|
|
280
353
|
const tabScrollLeft = ref(0);
|
|
281
354
|
const currentConsoleType = ref('all');
|
|
282
355
|
const currentNetworkType = ref('all');
|
|
@@ -290,19 +363,33 @@ const searchWs = ref('');
|
|
|
290
363
|
const searchRoute = ref('');
|
|
291
364
|
const searchStorage = ref('');
|
|
292
365
|
|
|
293
|
-
const props =
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
366
|
+
const props = withDefaults(
|
|
367
|
+
defineProps<{
|
|
368
|
+
open?: boolean;
|
|
369
|
+
data?: DevTool.WindowData;
|
|
370
|
+
sourceFileServers?: string[];
|
|
371
|
+
mode?: string;
|
|
372
|
+
useDevSource?: boolean;
|
|
373
|
+
zIndex?: number;
|
|
374
|
+
}>(),
|
|
375
|
+
{
|
|
376
|
+
zIndex: 1000,
|
|
377
|
+
},
|
|
378
|
+
);
|
|
300
379
|
|
|
301
380
|
const emits = defineEmits<{
|
|
302
381
|
(e: 'close'): void;
|
|
303
382
|
(e: 'sendMessage', data: { type: string; data: Record<string, any> }): void;
|
|
304
383
|
}>();
|
|
305
384
|
|
|
385
|
+
function swiperShow(index: number) {
|
|
386
|
+
const show =
|
|
387
|
+
index == activeTab.value - 1 ||
|
|
388
|
+
index == activeTab.value ||
|
|
389
|
+
index == activeTab.value + 1;
|
|
390
|
+
return show;
|
|
391
|
+
}
|
|
392
|
+
|
|
306
393
|
const listenPostMessage = (data: DevTool.WindowData) => {
|
|
307
394
|
if (!props.open) return;
|
|
308
395
|
if (!isActive) return;
|
|
@@ -467,16 +554,25 @@ const listenPostMessage = (data: DevTool.WindowData) => {
|
|
|
467
554
|
if (data.sizeFormat) {
|
|
468
555
|
sizeFormat.value = data.sizeFormat;
|
|
469
556
|
}
|
|
557
|
+
|
|
558
|
+
if (data.appInfo) {
|
|
559
|
+
appInfo.value = data.appInfo;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (data.captureScreenList) {
|
|
563
|
+
captureScreenList.value = data.captureScreenList;
|
|
564
|
+
}
|
|
470
565
|
};
|
|
471
566
|
|
|
472
567
|
let isActive = false;
|
|
473
568
|
onMounted(() => {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
569
|
+
const devToolInfo = getDevToolInfo();
|
|
570
|
+
|
|
571
|
+
if (devToolInfo) {
|
|
572
|
+
activeTab.value = devToolInfo?.activeTab || 0;
|
|
573
|
+
currentConsoleType.value = devToolInfo?.currentConsoleType || 'all';
|
|
574
|
+
currentNetworkType.value = devToolInfo?.currentNetworkType || 'all';
|
|
575
|
+
tabScrollLeft.value = devToolInfo?.tabScrollLeft || 0;
|
|
480
576
|
}
|
|
481
577
|
if (props.data) {
|
|
482
578
|
listenPostMessage(props.data);
|
|
@@ -497,6 +593,10 @@ onShow(() => {
|
|
|
497
593
|
});
|
|
498
594
|
onHide(() => {
|
|
499
595
|
isActive = false;
|
|
596
|
+
|
|
597
|
+
setDevToolInfo({
|
|
598
|
+
devToolWindowVisible: false,
|
|
599
|
+
});
|
|
500
600
|
});
|
|
501
601
|
|
|
502
602
|
/** 发送消息给 uniapp */
|
|
@@ -508,7 +608,7 @@ function basicSendMessage(message: {
|
|
|
508
608
|
}
|
|
509
609
|
|
|
510
610
|
function setWindowInfo() {
|
|
511
|
-
|
|
611
|
+
setDevToolInfo({
|
|
512
612
|
activeTab: activeTab.value,
|
|
513
613
|
currentConsoleType: currentConsoleType.value,
|
|
514
614
|
currentNetworkType: currentNetworkType.value,
|
|
@@ -527,6 +627,15 @@ function onChangeTabs() {
|
|
|
527
627
|
setWindowInfo();
|
|
528
628
|
}
|
|
529
629
|
|
|
630
|
+
function onChangeSwiper({
|
|
631
|
+
detail,
|
|
632
|
+
}: {
|
|
633
|
+
detail: { current: number; source: any };
|
|
634
|
+
}) {
|
|
635
|
+
activeTab.value = detail.current;
|
|
636
|
+
setWindowInfo();
|
|
637
|
+
}
|
|
638
|
+
|
|
530
639
|
function onScrollTabs(e: any) {
|
|
531
640
|
tabScrollLeft.value = e.detail.scrollLeft;
|
|
532
641
|
debounceSetWindowInfo();
|
|
@@ -783,6 +892,14 @@ function onUniEventClear() {
|
|
|
783
892
|
});
|
|
784
893
|
}
|
|
785
894
|
|
|
895
|
+
function onCaptureScreenClear() {
|
|
896
|
+
captureScreenList.value = [];
|
|
897
|
+
basicSendMessage({
|
|
898
|
+
type: DEV_CAPTURE_SCREEN_CLEAR,
|
|
899
|
+
data: {},
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
|
|
786
903
|
function onGoTo(page: DevTool.Page) {
|
|
787
904
|
basicSendMessage({
|
|
788
905
|
type: DEV_PAGE_JUMP,
|
|
@@ -889,7 +1006,7 @@ function onChangePinia(value: Record<string, any>) {
|
|
|
889
1006
|
position: fixed;
|
|
890
1007
|
top: 0;
|
|
891
1008
|
left: 0;
|
|
892
|
-
z-index:
|
|
1009
|
+
z-index: 1001;
|
|
893
1010
|
/* #ifdef H5 */
|
|
894
1011
|
padding: 50px 0;
|
|
895
1012
|
/* #endif */
|
|
@@ -929,6 +1046,7 @@ function onChangePinia(value: Record<string, any>) {
|
|
|
929
1046
|
height: 0;
|
|
930
1047
|
background-color: transparent;
|
|
931
1048
|
}
|
|
1049
|
+
|
|
932
1050
|
.dev-tool-window::after {
|
|
933
1051
|
content: '';
|
|
934
1052
|
}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
|
-
v-if="isOpen
|
|
3
|
+
v-if="isOpen || isClose"
|
|
4
4
|
:class="`json-pretty-carets json-pretty-carets-${
|
|
5
5
|
isOpen ? 'open' : 'close'
|
|
6
6
|
}`"
|
|
7
7
|
@click="onClick"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
10
|
-
viewBox="0 0 1024 1024"
|
|
11
|
-
focusable="false"
|
|
12
|
-
data-icon="caret-down"
|
|
13
|
-
width="1em"
|
|
14
|
-
height="1em"
|
|
15
|
-
fill="currentColor"
|
|
16
|
-
aria-hidden="true"
|
|
17
|
-
>
|
|
18
|
-
<path
|
|
19
|
-
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
|
|
20
|
-
></path>
|
|
21
|
-
</svg>
|
|
9
|
+
<view class="json-pretty-caret-down"></view>
|
|
22
10
|
</view>
|
|
23
11
|
</template>
|
|
24
12
|
<script lang="ts" setup>
|
|
@@ -60,4 +48,12 @@ function onClick(e: MouseEvent) {
|
|
|
60
48
|
.json-pretty-carets-close {
|
|
61
49
|
transform: rotate(-90deg);
|
|
62
50
|
}
|
|
51
|
+
|
|
52
|
+
.json-pretty-caret-down {
|
|
53
|
+
margin: 7px 4px;
|
|
54
|
+
border: 3px solid #000;
|
|
55
|
+
border-top-color: transparent;
|
|
56
|
+
border-left-color: transparent;
|
|
57
|
+
transform: rotate(45deg);
|
|
58
|
+
}
|
|
63
59
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="network-detail">
|
|
2
|
+
<view class="network-detail" :style="{ zIndex: zIndex }">
|
|
3
3
|
<view class="network-detail-control">
|
|
4
4
|
<Tag
|
|
5
5
|
mode="info"
|
|
@@ -81,7 +81,7 @@ import Tag from '../Tag/index.vue';
|
|
|
81
81
|
import Empty from '../Empty/index.vue';
|
|
82
82
|
import CloseButton from '../CloseButton/index.vue';
|
|
83
83
|
import type { DevTool } from '../../type';
|
|
84
|
-
const props = defineProps<{ network: DevTool.NetworkItem }>();
|
|
84
|
+
const props = defineProps<{ network: DevTool.NetworkItem; zIndex?: number }>();
|
|
85
85
|
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
86
86
|
const selectItems = [
|
|
87
87
|
{
|
|
@@ -151,13 +151,10 @@ function onClose() {
|
|
|
151
151
|
position: fixed;
|
|
152
152
|
width: 100vw;
|
|
153
153
|
height: 100vh;
|
|
154
|
-
z-index:
|
|
154
|
+
z-index: 1001;
|
|
155
155
|
top: 0;
|
|
156
156
|
left: 0;
|
|
157
157
|
padding: 0 16px;
|
|
158
|
-
/* #ifdef H5 */
|
|
159
|
-
padding: 50px 16px;
|
|
160
|
-
/* #endif */
|
|
161
158
|
|
|
162
159
|
background-color: rgba(255, 255, 255, 0.95);
|
|
163
160
|
box-sizing: border-box;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<view class="network-url-row">
|
|
4
4
|
<Tag mode="info">{{ network.method }}</Tag>
|
|
5
5
|
|
|
6
|
-
<view class="network-url" v-html="
|
|
6
|
+
<view class="network-url" v-html="lastUrl"> </view>
|
|
7
7
|
|
|
8
8
|
<Tag
|
|
9
9
|
mode="main"
|
|
@@ -46,20 +46,32 @@
|
|
|
46
46
|
</view>
|
|
47
47
|
</view>
|
|
48
48
|
<!-- <Transition name="slide-fade"> -->
|
|
49
|
-
<NetworkDetail
|
|
49
|
+
<NetworkDetail
|
|
50
|
+
v-if="showDetail"
|
|
51
|
+
:network="network"
|
|
52
|
+
:zIndex="zIndex"
|
|
53
|
+
@close="onClose"
|
|
54
|
+
/>
|
|
50
55
|
<!-- </Transition> -->
|
|
51
56
|
</template>
|
|
52
57
|
|
|
53
58
|
<script lang="ts" setup>
|
|
54
|
-
import { ref } from 'vue';
|
|
59
|
+
import { computed, ref } from 'vue';
|
|
55
60
|
import Tag from '../Tag/index.vue';
|
|
56
61
|
import NetworkDetail from './NetworkDetail.vue';
|
|
57
62
|
import { formatDate } from '../../utils';
|
|
58
63
|
import type { DevTool } from '../../type';
|
|
59
|
-
defineProps<{
|
|
64
|
+
const props = defineProps<{
|
|
60
65
|
network: DevTool.NetworkItem;
|
|
66
|
+
zIndex?: number;
|
|
61
67
|
}>();
|
|
62
68
|
const showDetail = ref(false);
|
|
69
|
+
|
|
70
|
+
const lastUrl = computed(() => {
|
|
71
|
+
const start = props.network.url.lastIndexOf('/');
|
|
72
|
+
return props.network.url.slice(start + 1);
|
|
73
|
+
});
|
|
74
|
+
|
|
63
75
|
function onClose() {
|
|
64
76
|
showDetail.value = false;
|
|
65
77
|
}
|
|
@@ -70,22 +82,23 @@ function onClose() {
|
|
|
70
82
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
71
83
|
font-size: var(--dev-tool-base-font-size);
|
|
72
84
|
}
|
|
73
|
-
.network-
|
|
85
|
+
.network-url-row {
|
|
74
86
|
display: flex;
|
|
75
87
|
align-items: center;
|
|
76
88
|
}
|
|
77
89
|
|
|
78
|
-
.network-
|
|
90
|
+
.network-url {
|
|
79
91
|
margin-left: 4px;
|
|
80
92
|
flex: 1;
|
|
93
|
+
white-space: nowrap;
|
|
81
94
|
overflow: hidden;
|
|
82
95
|
text-overflow: ellipsis;
|
|
83
96
|
}
|
|
84
|
-
.network-
|
|
97
|
+
.network-detail-icon {
|
|
85
98
|
margin-left: auto;
|
|
86
99
|
}
|
|
87
100
|
|
|
88
|
-
.network-
|
|
101
|
+
.network-info {
|
|
89
102
|
display: flex;
|
|
90
103
|
align-items: center;
|
|
91
104
|
justify-content: space-between;
|