vite-uni-dev-tool 0.0.22 → 0.0.24

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.
Files changed (50) hide show
  1. package/README.md +15 -3
  2. package/dist/const.d.ts +4 -0
  3. package/dist/const.d.ts.map +1 -1
  4. package/dist/const.js +30 -29
  5. package/dist/core.d.ts +3 -3
  6. package/dist/core.d.ts.map +1 -1
  7. package/dist/core.js +47 -50
  8. package/dist/devEvent/index.d.ts.map +1 -1
  9. package/dist/devEvent/index.js +26 -18
  10. package/dist/devIntercept/index.d.ts.map +1 -1
  11. package/dist/devIntercept/index.js +140 -127
  12. package/dist/devStore/index.d.ts +5 -1
  13. package/dist/devStore/index.d.ts.map +1 -1
  14. package/dist/devStore/index.js +16 -14
  15. package/dist/type.d.ts +8 -1
  16. package/dist/type.d.ts.map +1 -1
  17. package/dist/v2/AutoSizer/index.vue +1 -1
  18. package/dist/v2/ConsoleList/ConsoleItem.vue +1 -1
  19. package/dist/v2/DevToolButton/index.vue +2 -2
  20. package/dist/v3/AutoSizer/index.vue +1 -1
  21. package/dist/v3/CaptureScreen/index.vue +5 -1
  22. package/dist/v3/ConsoleList/ConsoleItem.vue +2 -2
  23. package/dist/v3/ConsoleList/RunJSInput.vue +1 -0
  24. package/dist/v3/DevToolButton/index.vue +3 -2
  25. package/dist/v3/DevToolWindow/index.vue +94 -3
  26. package/dist/v3/JsonPretty/components/Brackets/index.vue +3 -0
  27. package/dist/v3/JsonPretty/components/Carets/index.vue +2 -3
  28. package/dist/v3/NetworkList/InterceptConfig.vue +13 -34
  29. package/dist/v3/NetworkList/NetworkDetail.vue +13 -17
  30. package/dist/v3/NetworkList/NetworkItem.vue +0 -11
  31. package/dist/v3/NetworkList/NetworkSend.vue +20 -29
  32. package/dist/v3/RunJS/index.vue +1 -1
  33. package/dist/v3/SettingList/const.d.ts +2 -0
  34. package/dist/v3/SettingList/const.d.ts.map +1 -0
  35. package/dist/v3/SettingList/index.vue +8 -1
  36. package/dist/v3/SettingList/typing.d.ts +2 -0
  37. package/dist/v3/SourceCode/Line.vue +5 -4
  38. package/dist/v3/SourceCode/index.vue +1 -1
  39. package/dist/v3/Tabs/index.vue +4 -0
  40. package/dist/v3/Tag/index.vue +1 -1
  41. package/dist/v3/UniEvent/index.vue +7 -6
  42. package/dist/v3/UploadList/UploadDetail.vue +36 -18
  43. package/dist/v3/UploadList/UploadItem.vue +38 -34
  44. package/dist/v3/UploadList/index.vue +12 -1
  45. package/dist/v3/VirtualListPro/index.vue +15 -12
  46. package/dist/v3/WebSocket/WebSocketDetail.vue +252 -0
  47. package/dist/v3/WebSocket/WebSocketItem.vue +20 -37
  48. package/dist/v3/WebSocket/index.vue +6 -1
  49. package/package.json +1 -1
  50. package/dist/v3/WebSocket/WebSocketList.vue +0 -161
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <view class="network-detail" :style="{ zIndex: zIndex }">
3
3
  <view class="network-detail-control">
4
+ <DevToolTitle style="margin-right: 16px"> 请求详情 </DevToolTitle>
4
5
  <Tag
5
6
  mode="info"
6
7
  v-for="item in selectItems"
7
8
  :active="item.value === currentSelect"
8
9
  :key="item.value"
10
+ style="margin-right: 16px"
9
11
  @click="onSelect(item)"
10
12
  >
11
13
  {{ item.label }}
@@ -20,15 +22,15 @@
20
22
  >
21
23
  <DevToolTitle> 常规 </DevToolTitle>
22
24
  <view class="net-detail-item">
23
- <view>请求地址:</view>
25
+ <view class="net-detail-item-key">请求地址:</view>
24
26
  <view>{{ network.url }}</view>
25
27
  </view>
26
28
  <view class="net-detail-item">
27
- <view>请求方法:</view>
29
+ <view class="net-detail-item-key">请求方法:</view>
28
30
  <Tag mode="info">{{ network.method }}</Tag>
29
31
  </view>
30
32
  <view class="net-detail-item">
31
- <view>状态代码:</view>
33
+ <view class="net-detail-item-key">状态代码:</view>
32
34
  {{ network.status }}
33
35
 
34
36
  <Tag v-if="network.intercepted" mode="error" style="margin-left: 6px">
@@ -36,7 +38,7 @@
36
38
  </Tag>
37
39
  </view>
38
40
  <view class="net-detail-item">
39
- <view>开始时间:</view>
41
+ <view class="net-detail-item-key">开始时间:</view>
40
42
  {{
41
43
  network.startTime
42
44
  ? formatDate(network.startTime, 'HH:mm:ss:SS')
@@ -44,7 +46,7 @@
44
46
  }}
45
47
  </view>
46
48
  <view class="net-detail-item">
47
- <view>结束时间:</view>
49
+ <view class="net-detail-item-key">结束时间:</view>
48
50
  {{
49
51
  network.endTime
50
52
  ? formatDate(network.endTime, 'HH:mm:ss:SS')
@@ -52,11 +54,11 @@
52
54
  }}
53
55
  </view>
54
56
  <view class="net-detail-item">
55
- <view>请求耗时:</view>
57
+ <view class="net-detail-item-key">请求耗时:</view>
56
58
  {{ network.time ?? '--' }}
57
59
  </view>
58
60
  <view class="net-detail-item">
59
- <view>请求大小:</view>
61
+ <view class="net-detail-item-key">请求大小:</view>
60
62
  {{ network.size ?? '--' }}
61
63
  </view>
62
64
 
@@ -67,7 +69,7 @@
67
69
  v-for="item in network.headers.requestHeader"
68
70
  :key="item.key"
69
71
  >
70
- <view>{{ item.key }}:</view>
72
+ <view class="net-detail-item-key">{{ item.key }}:</view>
71
73
  {{ item.value }}
72
74
  </view>
73
75
  </template>
@@ -82,7 +84,7 @@
82
84
  v-for="item in network.headers.responseHeader"
83
85
  :key="item.key"
84
86
  >
85
- <view>{{ item.key }}:</view>
87
+ <view class="net-detail-item-key">{{ item.key }}:</view>
86
88
  {{ item.value }}
87
89
  </view>
88
90
  </template>
@@ -220,28 +222,22 @@ onMounted(() => {
220
222
  display: flex;
221
223
  align-items: center;
222
224
  /* margin-bottom: 4px; */
223
- gap: 12px;
224
225
  height: 32px;
225
226
  border-bottom: 1px solid transparent;
226
227
  box-sizing: border-box;
227
228
  }
228
- .network-detail-control :deep(.tag) {
229
- margin-right: 16px;
230
- }
231
- .network-detail-control :deep(.tag):last-child {
232
- margin-right: 0;
233
- }
234
229
 
235
230
  .net-detail-item {
236
231
  display: flex;
237
232
  align-items: center;
238
233
  min-height: 28px;
239
234
  word-break: break-all;
235
+ font-size: 12px;
240
236
  }
241
237
  .network-detail-header {
242
238
  overflow: auto;
243
239
  }
244
- .net-detail-item > view:first-child {
240
+ .net-detail-item-key {
245
241
  white-space: nowrap;
246
242
  margin-right: 8px;
247
243
  color: var(--dev-tool-info-color);
@@ -120,17 +120,6 @@ const tagMode = computed(() => {
120
120
  color: var(--dev-tool-text-color);
121
121
  transition: color 0.3s;
122
122
  }
123
- .slide-fade-enter-active {
124
- transition: all 0.8s ease-out;
125
- }
126
- .slide-fade-leave-active {
127
- transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
128
- }
129
- .slide-fade-enter-from,
130
- .slide-fade-leave-to {
131
- transform: translateY(20px);
132
- opacity: 0;
133
- }
134
123
 
135
124
  .network-time-line {
136
125
  position: relative;
@@ -155,12 +155,17 @@
155
155
  <button
156
156
  size="mini"
157
157
  :disabled="!isFinished"
158
+ class="network-send-button"
158
159
  @click="emit('openDetail', network)"
159
160
  >
160
161
  详情
161
162
  </button>
162
- <button size="mini" @click="onReset">重置</button>
163
- <button size="mini" @click="onSend">发送</button>
163
+ <button size="mini" class="network-send-button" @click="onReset">
164
+ 重置
165
+ </button>
166
+ <button size="mini" class="network-send-button-last" @click="onSend">
167
+ 发送
168
+ </button>
164
169
  </view>
165
170
  </view>
166
171
  </template>
@@ -207,25 +212,25 @@ const state = reactive<{
207
212
 
208
213
  const defaultHeader = [
209
214
  {
210
- id: 1,
215
+ id: '1',
211
216
  key: 'Accept',
212
217
  value: '*/*',
213
218
  checked: false,
214
219
  },
215
220
  {
216
- id: 2,
221
+ id: '2',
217
222
  key: 'Accept-Language',
218
223
  value: 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
219
224
  checked: false,
220
225
  },
221
226
  {
222
- id: 3,
227
+ id: '3',
223
228
  key: 'Cache-Control',
224
229
  value: 'no-cache',
225
230
  checked: false,
226
231
  },
227
232
  {
228
- id: 4,
233
+ id: '4',
229
234
  key: 'Content-Type',
230
235
  value: 'application/json; charset=utf-8',
231
236
  checked: true,
@@ -233,7 +238,7 @@ const defaultHeader = [
233
238
  ];
234
239
 
235
240
  type PB = {
236
- id: number;
241
+ id: string;
237
242
  key: string;
238
243
  value: string;
239
244
  checked: boolean;
@@ -243,7 +248,7 @@ const headerList = reactive([...defaultHeader]);
243
248
 
244
249
  const queryList = reactive<PB[]>([
245
250
  {
246
- id: 1,
251
+ id: '1',
247
252
  key: 'a',
248
253
  value: '123',
249
254
  checked: true,
@@ -441,7 +446,7 @@ function onDeleteHeader(item: any) {
441
446
  }
442
447
 
443
448
  function onAddHeader() {
444
- const id = Date.now();
449
+ const id = Date.now().toString();
445
450
  headerList.push({
446
451
  id,
447
452
  key: '',
@@ -466,7 +471,7 @@ function onDeleteQuery(item: any) {
466
471
  queryList.splice(index, 1);
467
472
  }
468
473
  function onAddQuery() {
469
- const id = Date.now();
474
+ const id = Date.now().toString();
470
475
  queryList.push({
471
476
  id,
472
477
  key: '',
@@ -500,7 +505,7 @@ function arrayToObject(arr: any[]) {
500
505
 
501
506
  function objectToArray<T extends Record<string, any>>(obj: T) {
502
507
  return Object.entries(obj).map(([key, value]) => ({
503
- id: Date.now(),
508
+ id: Date.now().toString(),
504
509
  key,
505
510
  value,
506
511
  checked: true,
@@ -562,7 +567,7 @@ function handleResendNetwork() {
562
567
  return {
563
568
  ...item,
564
569
  checked: true,
565
- id: index,
570
+ id: index.toString(),
566
571
  };
567
572
  }) ?? [];
568
573
 
@@ -631,13 +636,6 @@ onMounted(() => {
631
636
  box-sizing: border-box;
632
637
  }
633
638
 
634
- .network-send-control :deep(.tag) {
635
- margin-right: 16px;
636
- }
637
- .network-send-control :deep(.tag):last-child {
638
- margin-right: 0;
639
- }
640
-
641
639
  .radio-group {
642
640
  display: flex;
643
641
  flex-wrap: wrap;
@@ -671,9 +669,6 @@ onMounted(() => {
671
669
  color: red;
672
670
  }
673
671
 
674
- .network-header-list {
675
- }
676
-
677
672
  .network-header-item {
678
673
  display: flex;
679
674
  align-items: center;
@@ -684,15 +679,11 @@ onMounted(() => {
684
679
  text-align: center;
685
680
  }
686
681
 
687
- .network-param-list {
688
- }
689
682
  .network-param-item {
690
683
  display: flex;
691
684
  align-items: center;
692
685
  }
693
686
 
694
- .network-body-data {
695
- }
696
687
  .network-body-data-item {
697
688
  display: flex;
698
689
  align-items: center;
@@ -707,11 +698,11 @@ onMounted(() => {
707
698
  margin-top: 12px;
708
699
  background-color: var(--dev-tool-bg3-color);
709
700
  }
710
- .network-send-buttons button {
701
+ .network-send-button {
711
702
  width: 100%;
712
703
  margin-right: 6px;
713
704
  }
714
- .network-send-buttons button:last-child {
715
- margin: 0;
705
+ .network-send-button-last {
706
+ width: 100%;
716
707
  }
717
708
  </style>
@@ -10,7 +10,7 @@
10
10
  <Tag mode="clear" @click="emit('clear')">清空</Tag>
11
11
  </view>
12
12
  <view class="run-js-list">
13
- <view class="run-js-item" v-for="item in runJSList">
13
+ <view class="run-js-item" v-for="item in runJSList" :key="item.timer">
14
14
  <view :class="`run-js-item-icon run-js-item-${item.mode}`"></view>
15
15
  <view class="run-js-item-duration" v-if="item.mode === 'output'">
16
16
  {{ item.duration }}ms
@@ -0,0 +1,2 @@
1
+ export declare const version = "";
2
+ //# sourceMappingURL=const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../dev/v3/SettingList/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,KAAK,CAAC"}
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <view class="setting-content">
3
3
  <view class="setting-item">
4
- <DevToolTitle>DevTool(v0.0.22-vue3)</DevToolTitle>
4
+ <DevToolTitle>
5
+ DevTool {{ buildInfo?.devToolVersion }}-vue3
6
+ </DevToolTitle>
5
7
  <view class="setting-item-content">
6
8
  <view class="setting-row">
7
9
  <view>显示调试按钮:</view>
@@ -183,11 +185,16 @@
183
185
  <script lang="ts" setup>
184
186
  import { reactive } from 'vue';
185
187
  import DevToolTitle from '../DevToolTitle/index.vue';
188
+
186
189
  const props = defineProps<{
187
190
  devToolVisible?: boolean;
188
191
  sizeFormat?: string;
189
192
  theme?: string;
190
193
  cacheInterceptConfig?: boolean;
194
+ buildInfo?: {
195
+ devToolVersion?: string;
196
+ devToolBuildTime?: string;
197
+ };
191
198
  }>();
192
199
  const setting = reactive({
193
200
  restartDevTool: false,
@@ -0,0 +1,2 @@
1
+ // 插件版本号
2
+ declare const __VERSION__: string;
@@ -6,7 +6,8 @@
6
6
  <view class="source-code-line-num" v-if="showNum">{{ num }}</view>
7
7
  <view :class="['source-code-line-content', line.class]">
8
8
  <view
9
- v-for="item in line.words"
9
+ v-for="(item, index) in line.words"
10
+ :key="index"
10
11
  :class="['source-code-line-word', item.class]"
11
12
  >
12
13
  {{ item.word }}
@@ -35,7 +36,7 @@ const props = withDefaults(
35
36
  .source-code-line {
36
37
  display: flex;
37
38
  align-items: center;
38
- height: 24px;
39
+ height: 20px;
39
40
  }
40
41
 
41
42
  .source-code-line-active {
@@ -49,14 +50,14 @@ const props = withDefaults(
49
50
  padding: 0 6px;
50
51
  margin-right: 6px;
51
52
  text-align: right;
52
- height: 24px;
53
+ height: 20px;
53
54
  border-right: 1px solid var(--dev-tool-border-color);
54
55
  }
55
56
 
56
57
  .source-code-line-content {
57
58
  display: flex;
58
59
  white-space: nowrap;
59
- height: 24px;
60
+ height: 20px;
60
61
  }
61
62
 
62
63
  .source-code-line-word {
@@ -217,7 +217,7 @@ onMounted(() => {
217
217
 
218
218
  width: 100vw;
219
219
  height: 100vh;
220
- font-size: 14px;
220
+ font-size: 12px;
221
221
  color: var(--dev-tool-text-color);
222
222
  box-sizing: border-box;
223
223
  transition: color 0.3s;
@@ -90,6 +90,8 @@ function onScroll(e: any) {
90
90
  white-space: nowrap;
91
91
  width: 100%;
92
92
  }
93
+
94
+ /* #ifdef H5 || APP-PLUS */
93
95
  .tabs-list ::-webkit-scrollbar {
94
96
  display: none;
95
97
  width: 0;
@@ -101,6 +103,8 @@ function onScroll(e: any) {
101
103
  height: 0;
102
104
  background-color: transparent;
103
105
  }
106
+ /* #endif */
107
+
104
108
  .tabs .tabs-item {
105
109
  display: inline-block;
106
110
  padding: 0 16px;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- :class="`tag tag-${mode} ${active ? 'tag-active' : ''}`"
3
+ :class="['tag', `tag-${mode}`, active ? 'tag-active' : '']"
4
4
  @click="onClick"
5
5
  >
6
6
  <slot></slot>
@@ -3,25 +3,25 @@
3
3
  <DevToolTitle innerStyle="padding: 0 16px">事件触发统计</DevToolTitle>
4
4
  <view class="uni-event-statistics">
5
5
  <view class="uni-event-statistics-item">
6
- <view>on: </view>
6
+ <view class="uni-event-statistics-item-name">on: </view>
7
7
  <Tag mode="log" style="flex: 1; justify-content: center">
8
8
  {{ eventCount?.on ?? 0 }}
9
9
  </Tag>
10
10
  </view>
11
11
  <view class="uni-event-statistics-item">
12
- <view>once: </view>
12
+ <view class="uni-event-statistics-item-name">once: </view>
13
13
  <Tag mode="warn" style="flex: 1; justify-content: center">
14
14
  {{ eventCount?.once ?? 0 }}
15
15
  </Tag>
16
16
  </view>
17
17
  <view class="uni-event-statistics-item">
18
- <view>emit: </view>
18
+ <view class="uni-event-statistics-item-name">emit: </view>
19
19
  <Tag mode="main" style="flex: 1; justify-content: center">
20
20
  {{ eventCount?.emit ?? 0 }}
21
21
  </Tag>
22
22
  </view>
23
23
  <view class="uni-event-statistics-item">
24
- <view>off: </view>
24
+ <view class="uni-event-statistics-item-name">off: </view>
25
25
  <Tag mode="error" style="flex: 1; justify-content: center">
26
26
  {{ eventCount?.off ?? 0 }}
27
27
  </Tag>
@@ -36,7 +36,8 @@
36
36
  </DevToolTitle>
37
37
  <view class="uni-event-list">
38
38
  <UniEventItem
39
- v-for="item in eventList"
39
+ v-for="(item, index) in eventList"
40
+ :key="index"
40
41
  :eventItem="item"
41
42
  :mode="mode"
42
43
  :useDevSource="useDevSource"
@@ -90,7 +91,7 @@ const emit = defineEmits<{
90
91
  align-items: center;
91
92
  width: 25%;
92
93
  }
93
- .uni-event-statistics-item view:first-child {
94
+ .uni-event-statistics-item-name {
94
95
  margin-right: 8px;
95
96
  }
96
97
  .uni-event-list {
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <view class="upload-detail" :style="{ zIndex: zIndex }">
3
3
  <view class="upload-detail-control">
4
+ <DevToolTitle style="margin-right: 16px">上传详情</DevToolTitle>
5
+
4
6
  <Tag
5
7
  v-for="item in selectItems"
6
8
  :active="currentSelect === item.value"
@@ -15,31 +17,42 @@
15
17
  </view>
16
18
 
17
19
  <view class="upload-detail-header" v-if="currentSelect === 'header'">
18
- <view class="upload-detail-title">常规</view>
19
- <view class="net-detail-item">
20
+ <DevToolTitle>常规</DevToolTitle>
21
+ <view class="upload-detail-item">
20
22
  <view>请求url:</view>
21
23
  <view>{{ upload.url }}</view>
22
24
  </view>
23
- <view class="net-detail-item">
25
+ <view class="upload-detail-item">
24
26
  <view>请求方法:</view>
25
27
  <Tag mode="info">{{ upload.method ?? 'POST' }}</Tag>
26
28
  </view>
27
- <view class="net-detail-item">
29
+ <view class="upload-detail-item">
28
30
  <view>状态代码:</view>
29
31
  <Tag mode="info">{{ upload.status }}</Tag>
30
32
  </view>
31
- <view class="upload-detail-title">请求头</view>
32
- <view
33
- class="net-detail-item"
34
- v-for="item in upload?.headers?.requestHeader"
35
- :key="item.key"
33
+
34
+ <DevToolTitle>请求头</DevToolTitle>
35
+ <template
36
+ v-if="
37
+ upload?.headers &&
38
+ upload?.headers?.requestHeader &&
39
+ upload?.headers?.requestHeader?.length > 0
40
+ "
36
41
  >
37
- <view>{{ item.key }}:</view>
38
- {{ item.value }}
39
- </view>
42
+ <view
43
+ class="upload-detail-item"
44
+ v-for="item in upload?.headers?.requestHeader"
45
+ :key="item.key"
46
+ >
47
+ <view class="upload-detail-item-key">{{ item.key }}:</view>
48
+ {{ item.value }}
49
+ </view>
50
+ </template>
51
+ <Empty v-else />
52
+
40
53
  <!-- <view class="upload-detail-title">响应头</view>
41
54
  <view
42
- class="net-detail-item"
55
+ class="upload-detail-item"
43
56
  v-for="item in upload?.headers?.responseHeader"
44
57
  :key="item.key"
45
58
  >
@@ -81,6 +94,7 @@ import JsonPretty from '../JsonPretty/index.vue';
81
94
  import Tag from '../Tag/index.vue';
82
95
  import Empty from '../Empty/index.vue';
83
96
  import CircularButton from '../CircularButton/index.vue';
97
+ import DevToolTitle from '../DevToolTitle/index.vue';
84
98
  import type { DevTool } from '../../type';
85
99
  const props = defineProps<{ upload: DevTool.UploadItem; zIndex?: number }>();
86
100
  const emit = defineEmits<{ (e: 'close'): void }>();
@@ -160,11 +174,14 @@ function onClose() {
160
174
  top: 0;
161
175
  left: 0;
162
176
  padding: 0 16px;
163
- background-color: var(--dev-tool-bg2-color);
177
+ /* #ifdef H5 */
178
+ padding: 50px 16px;
179
+ /* #endif */
180
+ background-color: var(--dev-tool-bg3-color);
164
181
  box-sizing: border-box;
165
182
  transform: background-color 0.3s;
166
183
  }
167
- .upload-detail .upload-detail-control {
184
+ .upload-detail-control {
168
185
  display: flex;
169
186
  align-items: center;
170
187
  margin-bottom: 4px;
@@ -174,18 +191,19 @@ function onClose() {
174
191
  box-sizing: border-box;
175
192
  }
176
193
 
177
- .upload-detail .upload-detail-header .net-detail-item {
194
+ .upload-detail-item {
178
195
  display: flex;
179
196
  align-items: center;
180
197
  min-height: 28px;
181
198
  word-break: break-all;
199
+ font-size: 12px;
182
200
  }
183
- .upload-detail .upload-detail-header .net-detail-item > view:first-child {
201
+ .upload-detail-item-key {
184
202
  white-space: nowrap;
185
203
  margin-right: 8px;
186
204
  color: var(--dev-tool-info-color);
187
205
  }
188
- .upload-detail .upload-detail-payload {
206
+ .upload-detail-payload {
189
207
  word-break: break-all;
190
208
  max-width: 100%;
191
209
  }
@@ -1,14 +1,8 @@
1
1
  <template>
2
- <view class="upload-item">
2
+ <view class="upload-item" @click="emit('openDetail', upload)">
3
3
  <view class="upload-url-row">
4
4
  <Tag mode="info">POST</Tag>
5
5
  <view class="upload-url" v-html="upload.url" />
6
- <Tag
7
- mode="main"
8
- class="upload-detail-icon"
9
- @click="showDetail = !showDetail"
10
- >详情</Tag
11
- >
12
6
  </view>
13
7
  <view class="upload-info">
14
8
  <view>
@@ -28,39 +22,53 @@
28
22
  <view>进度: {{ upload.progress }}%</view>
29
23
  <view>
30
24
  开始:
31
- {{ upload.startTime ? formatDate(upload.startTime, ' HH:mm:ss') : '-' }}
25
+ {{
26
+ upload.startTime
27
+ ? formatDate(upload.startTime, ' HH:mm:ss:SS')
28
+ : '--:--:--:---'
29
+ }}
32
30
  </view>
33
31
  <view>
34
32
  结束:
35
- {{ upload.endTime ? formatDate(upload.endTime, ' HH:mm:ss') : '-' }}
33
+ {{
34
+ upload.endTime
35
+ ? formatDate(upload.endTime, ' HH:mm:ss:SS')
36
+ : '--:--:--:---'
37
+ }}
36
38
  </view>
37
39
  </view>
40
+ <view
41
+ :class="['upload-stock ', isUseDevSource ? 'upload-stock-link' : '']"
42
+ @click.stop="emit('openCode', upload.stack)"
43
+ >
44
+ {{ upload?.stack }}
45
+ </view>
38
46
  </view>
39
- <!-- <Transition name="slide-fade"> -->
40
- <UploadDetail
41
- v-if="showDetail"
42
- :upload="upload"
43
- :zIndex="zIndex"
44
- @close="onClose"
45
- />
46
- <!-- </Transition> -->
47
47
  </template>
48
48
 
49
49
  <script lang="ts" setup>
50
- import { ref } from 'vue';
50
+ import { computed } from 'vue';
51
51
  import Tag from '../Tag/index.vue';
52
- import UploadDetail from './UploadDetail.vue';
53
- import { formatDate } from '../../utils';
52
+ import { formatDate, isMockWX } from '../../utils';
54
53
  import type { DevTool } from '../../type';
55
- defineProps<{
54
+ const props = defineProps<{
56
55
  upload: DevTool.UploadItem;
57
56
  zIndex?: number;
57
+ mode?: string;
58
+ useDevSource?: boolean;
59
+ }>();
60
+ const emit = defineEmits<{
61
+ (e: 'openDetail', value: DevTool.UploadItem): void;
62
+ (e: 'openCode', value?: string): void;
58
63
  }>();
59
- const showDetail = ref(false);
60
64
 
61
- function onClose() {
62
- showDetail.value = false;
63
- }
65
+ const isUseDevSource = computed(() => {
66
+ return (
67
+ !isMockWX(props?.upload?.stack ?? '') &&
68
+ props.mode === 'development' &&
69
+ props.useDevSource
70
+ );
71
+ });
64
72
  </script>
65
73
  <style scoped>
66
74
  .upload-item {
@@ -103,15 +111,11 @@ function onClose() {
103
111
  color: var(--dev-tool-text-color);
104
112
  }
105
113
 
106
- .slide-fade-enter-active {
107
- transition: all 0.8s ease-out;
108
- }
109
- .slide-fade-leave-active {
110
- transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
114
+ .upload-stock {
115
+ text-align: right;
116
+ word-wrap: break-word;
111
117
  }
112
- .slide-fade-enter-from,
113
- .slide-fade-leave-to {
114
- transform: translateY(20px);
115
- opacity: 0;
118
+ .upload-stock-link {
119
+ text-decoration: underline;
116
120
  }
117
121
  </style>