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
|
@@ -18,14 +18,19 @@
|
|
|
18
18
|
</Tag>
|
|
19
19
|
</view>
|
|
20
20
|
|
|
21
|
-
<VirtualListPro
|
|
21
|
+
<VirtualListPro
|
|
22
|
+
:data="networkList"
|
|
23
|
+
:pageSize="15"
|
|
24
|
+
:height="height"
|
|
25
|
+
className="network-list"
|
|
26
|
+
>
|
|
22
27
|
<template v-slot="{ list, start }">
|
|
23
28
|
<AutoSize
|
|
24
29
|
v-for="(item, index) in list"
|
|
25
30
|
:index="start + index"
|
|
26
31
|
:key="start + index"
|
|
27
32
|
>
|
|
28
|
-
<NetworkItem :network="item" />
|
|
33
|
+
<NetworkItem :network="item" :zIndex="zIndex" />
|
|
29
34
|
</AutoSize>
|
|
30
35
|
<Empty v-if="!networkList || networkList.length === 0" />
|
|
31
36
|
</template>
|
|
@@ -40,11 +45,13 @@ import FilterInput from '../FilterInput/index.vue';
|
|
|
40
45
|
import type { DevTool } from '../../type';
|
|
41
46
|
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
42
47
|
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
48
|
+
import { onMounted, ref } from 'vue';
|
|
43
49
|
|
|
44
50
|
defineProps<{
|
|
45
51
|
currentNetworkType: string;
|
|
46
52
|
networkList: DevTool.NetworkItem[];
|
|
47
53
|
modelValue: string;
|
|
54
|
+
zIndex?: number;
|
|
48
55
|
}>();
|
|
49
56
|
|
|
50
57
|
const emit = defineEmits<{
|
|
@@ -93,6 +100,12 @@ const networkFilterItems = [
|
|
|
93
100
|
function onChoose(type: string) {
|
|
94
101
|
emit('choose', type);
|
|
95
102
|
}
|
|
103
|
+
|
|
104
|
+
const height = ref(0);
|
|
105
|
+
onMounted(() => {
|
|
106
|
+
const { windowHeight } = uni.getWindowInfo();
|
|
107
|
+
height.value = windowHeight - 32 - 32;
|
|
108
|
+
});
|
|
96
109
|
</script>
|
|
97
110
|
<style scoped>
|
|
98
111
|
.network-content {
|
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
<Tag mode="clear" @click="onRefresh">刷新</Tag>
|
|
12
12
|
</view>
|
|
13
13
|
|
|
14
|
-
<VirtualListPro
|
|
14
|
+
<VirtualListPro
|
|
15
|
+
:data="routeList"
|
|
16
|
+
:pageSize="15"
|
|
17
|
+
:height="height"
|
|
18
|
+
className="route-list"
|
|
19
|
+
>
|
|
15
20
|
<template v-slot="{ list, start }">
|
|
16
21
|
<AutoSize
|
|
17
22
|
v-for="(item, index) in list"
|
|
@@ -47,6 +52,7 @@ import FilterInput from '../FilterInput/index.vue';
|
|
|
47
52
|
import type { DevTool } from '../../type';
|
|
48
53
|
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
49
54
|
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
55
|
+
import { onMounted, ref } from 'vue';
|
|
50
56
|
|
|
51
57
|
defineProps<{ routeList: DevTool.Page[]; modelValue?: string }>();
|
|
52
58
|
const emit = defineEmits<{
|
|
@@ -62,6 +68,11 @@ function onGoTo(page: DevTool.Page) {
|
|
|
62
68
|
function onRefresh() {
|
|
63
69
|
emit('routeRefresh');
|
|
64
70
|
}
|
|
71
|
+
const height = ref(0);
|
|
72
|
+
onMounted(() => {
|
|
73
|
+
const { windowHeight } = uni.getWindowInfo();
|
|
74
|
+
height.value = windowHeight - 32 - 32;
|
|
75
|
+
});
|
|
65
76
|
</script>
|
|
66
77
|
<style scoped>
|
|
67
78
|
.route-content {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<view class="setting-row">
|
|
7
7
|
<view>显示调试按钮:</view>
|
|
8
8
|
<Checkbox
|
|
9
|
-
|
|
9
|
+
:modelValue="devToolVisible"
|
|
10
10
|
@change="onChangeShowDevButton"
|
|
11
11
|
/>
|
|
12
12
|
</view>
|
|
@@ -122,13 +122,11 @@ import { reactive } from 'vue';
|
|
|
122
122
|
import Checkbox from '../Checkbox/index.vue';
|
|
123
123
|
import DButton from '../Button/index.vue';
|
|
124
124
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
125
|
-
|
|
125
|
+
defineProps<{
|
|
126
126
|
devToolVisible?: boolean;
|
|
127
127
|
sizeFormat?: string;
|
|
128
128
|
}>();
|
|
129
129
|
const setting = reactive({
|
|
130
|
-
showDevButton: props.devToolVisible,
|
|
131
|
-
|
|
132
130
|
restartDevTool: false,
|
|
133
131
|
restartApp: false,
|
|
134
132
|
exportLog: false,
|
|
@@ -166,7 +164,6 @@ function onChangeShowDevButton(show: boolean) {
|
|
|
166
164
|
emit('showDevButton', show);
|
|
167
165
|
}
|
|
168
166
|
function onRestartDevTool(restart: boolean) {
|
|
169
|
-
console.log('restart: ', restart);
|
|
170
167
|
restart && emit('restartDevTool');
|
|
171
168
|
}
|
|
172
169
|
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="dev-tool-code" :style="{ zIndex: zIndex }">
|
|
3
|
+
<view class="dev-tool-code-control">
|
|
4
|
+
<FilterInput
|
|
5
|
+
v-model="modelValue"
|
|
6
|
+
style="width: 100%"
|
|
7
|
+
@search="onSearch"
|
|
8
|
+
/>
|
|
9
|
+
<CloseButton style="margin-left: auto" @click="onClose" />
|
|
10
|
+
</view>
|
|
11
|
+
<view class="dev-tool-code-title">{{ fileName }}</view>
|
|
12
|
+
<scroll-view
|
|
13
|
+
scroll-y="true"
|
|
14
|
+
scroll-x="true"
|
|
15
|
+
class="dev-tool-code-list"
|
|
16
|
+
scroll-with-animation="true"
|
|
17
|
+
:scroll-top="scrollTop"
|
|
18
|
+
:scroll-into-view="scrollIntoView"
|
|
19
|
+
>
|
|
20
|
+
<view
|
|
21
|
+
v-for="(code, index) in codes"
|
|
22
|
+
:id="`dev-tool-code-item-${index}`"
|
|
23
|
+
:key="index"
|
|
24
|
+
:class="`dev-tool-code-item ${index === activeRowCol.activeRow ? 'dev-tool-code-item-active' : ''}`"
|
|
25
|
+
>
|
|
26
|
+
<view class="dev-tool-code-item-index">
|
|
27
|
+
{{ start + index + 1 }}
|
|
28
|
+
</view>
|
|
29
|
+
|
|
30
|
+
<view class="dev-tool-code-item-content" v-html="code"></view>
|
|
31
|
+
</view>
|
|
32
|
+
<Empty v-if="!codes || codes.length === 0" />
|
|
33
|
+
</scroll-view>
|
|
34
|
+
</view>
|
|
35
|
+
</template>
|
|
36
|
+
<script lang="ts" setup>
|
|
37
|
+
import { computed, ref, nextTick, onMounted } from 'vue';
|
|
38
|
+
import FilterInput from '../FilterInput/index.vue';
|
|
39
|
+
import CloseButton from '../CloseButton/index.vue';
|
|
40
|
+
import Empty from '../Empty/index.vue';
|
|
41
|
+
import { escapeHTML, hightLight, isAndroid, parseStock } from '../../utils';
|
|
42
|
+
|
|
43
|
+
const props = defineProps<{
|
|
44
|
+
url: string;
|
|
45
|
+
sourceFileServers?: string[];
|
|
46
|
+
mode?: string;
|
|
47
|
+
zIndex?: number;
|
|
48
|
+
}>();
|
|
49
|
+
|
|
50
|
+
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
51
|
+
|
|
52
|
+
const modelValue = ref('');
|
|
53
|
+
const scrollTop = ref(0);
|
|
54
|
+
const fileName = computed(() => {
|
|
55
|
+
const name =
|
|
56
|
+
props?.url?.split('/')?.pop()?.replace(/\)|\(/, '') ?? '文件名称未知';
|
|
57
|
+
return name;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const activeRowCol = ref({ row: -1, col: -1, activeRow: -1 });
|
|
61
|
+
|
|
62
|
+
let backupCodes: string[] = [];
|
|
63
|
+
|
|
64
|
+
const codes = ref<string[]>([]);
|
|
65
|
+
|
|
66
|
+
const scrollIntoView = ref('');
|
|
67
|
+
|
|
68
|
+
const start = computed(() => {
|
|
69
|
+
return activeRowCol.value.row - 20 > 0 ? activeRowCol.value.row - 20 : 0;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function onClose() {
|
|
73
|
+
emit('close');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function onSearch(value: string) {
|
|
77
|
+
codes.value = backupCodes.map((code) => {
|
|
78
|
+
return hightLight(code, value);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let index = 0;
|
|
83
|
+
function getCode(url: string, i: number = 0) {
|
|
84
|
+
let allUrl = url;
|
|
85
|
+
// 平台判断
|
|
86
|
+
if (isAndroid()) {
|
|
87
|
+
if (!props.sourceFileServers?.[i]) {
|
|
88
|
+
index = 0;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
allUrl = props.sourceFileServers?.[i] + '/src/' + url;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
uni.showLoading({ mask: true });
|
|
96
|
+
uni.request({
|
|
97
|
+
url: allUrl,
|
|
98
|
+
success: (res) => {
|
|
99
|
+
if (typeof res.data === 'string') {
|
|
100
|
+
// 为什么要注释掉?
|
|
101
|
+
// 在 Android 识别到标签后会进行重启,导致代码无法显示
|
|
102
|
+
// TODO: 还有其它原因导致重启
|
|
103
|
+
const str = res.data
|
|
104
|
+
?.replace(/<jscript/, '// [DevTool] 注释 <javascript')
|
|
105
|
+
?.replace(/<\/script>/, '// [DevTool] 注释 </javascript>')
|
|
106
|
+
?.replace(/<style/, '// [DevTool] 注释 <style')
|
|
107
|
+
?.replace(/<\/style>/, '// [DevTool] 注释 </style>');
|
|
108
|
+
backupCodes = escapeHTML(str ?? '')
|
|
109
|
+
.toString()
|
|
110
|
+
.split('\n');
|
|
111
|
+
|
|
112
|
+
const start =
|
|
113
|
+
activeRowCol.value.row - 20 > 0 ? activeRowCol.value.row - 20 : 0;
|
|
114
|
+
|
|
115
|
+
const end =
|
|
116
|
+
activeRowCol.value.row + 20 > backupCodes.length
|
|
117
|
+
? backupCodes.length
|
|
118
|
+
: activeRowCol.value.row + 20;
|
|
119
|
+
|
|
120
|
+
// backupCodes.slice(start, end);
|
|
121
|
+
|
|
122
|
+
codes.value = backupCodes.slice(start, end);
|
|
123
|
+
|
|
124
|
+
activeRowCol.value.activeRow = activeRowCol.value.row - start;
|
|
125
|
+
|
|
126
|
+
nextTick(() => {
|
|
127
|
+
scrollIntoView.value = `dev-tool-code-item-${activeRowCol.value.activeRow}`;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
fail: (err) => {
|
|
132
|
+
index++;
|
|
133
|
+
getCode(url, index);
|
|
134
|
+
uni.showToast({ icon: 'none', title: '正在重新尝试中...' });
|
|
135
|
+
},
|
|
136
|
+
complete: () => {
|
|
137
|
+
uni.hideLoading();
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** 开发环境获取源代码 */
|
|
143
|
+
function getSourceCodeDev(url: string) {
|
|
144
|
+
if (!url) {
|
|
145
|
+
uni.showToast({ icon: 'none', title: '[DevTool] url 处理异常' });
|
|
146
|
+
uni?.__dev__console?.log('[DevTool] url 处理异常');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
getCode(url, index);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
onMounted(() => {
|
|
154
|
+
let url = props?.url;
|
|
155
|
+
|
|
156
|
+
const { path, col, row } = parseStock(props?.url ?? '');
|
|
157
|
+
|
|
158
|
+
if (path) {
|
|
159
|
+
url = path;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
activeRowCol.value.col = col;
|
|
163
|
+
activeRowCol.value.row = row;
|
|
164
|
+
|
|
165
|
+
if (props.mode === 'development') {
|
|
166
|
+
// 开发环境查看源码
|
|
167
|
+
getSourceCodeDev(url);
|
|
168
|
+
} else if (props.mode === 'production') {
|
|
169
|
+
// TODO 生产环境查看源码
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
173
|
+
<style scoped>
|
|
174
|
+
.dev-tool-code {
|
|
175
|
+
position: fixed;
|
|
176
|
+
width: 100vw;
|
|
177
|
+
height: 100vh;
|
|
178
|
+
z-index: 1001;
|
|
179
|
+
top: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
padding: 0 16px;
|
|
182
|
+
|
|
183
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
184
|
+
box-sizing: border-box;
|
|
185
|
+
color: #000;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.dev-tool-code-control {
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
gap: 12px;
|
|
192
|
+
height: 32px;
|
|
193
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
194
|
+
box-sizing: border-box;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.dev-tool-code-title {
|
|
198
|
+
height: 32px;
|
|
199
|
+
line-height: 32px;
|
|
200
|
+
margin-bottom: 4px;
|
|
201
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
overflow: auto;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.dev-tool-code-list {
|
|
208
|
+
height: calc(100% - 68px);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.dev-tool-code-item {
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
height: 28px;
|
|
215
|
+
}
|
|
216
|
+
.dev-tool-code-item-active {
|
|
217
|
+
color: #fff;
|
|
218
|
+
background-color: var(--dev-tool-main-color);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.dev-tool-code-item-index {
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
width: 20px;
|
|
224
|
+
margin-right: 8px;
|
|
225
|
+
text-align: right;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.dev-tool-code-item-content {
|
|
229
|
+
white-space: pre;
|
|
230
|
+
}
|
|
231
|
+
</style>
|
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
ref="tabsRef"
|
|
6
6
|
scroll-x="true"
|
|
7
7
|
enable-flex="true"
|
|
8
|
+
scroll-with-animation
|
|
8
9
|
:scrollLeft="scrollLeft"
|
|
10
|
+
:scroll-into-view="scrollIntoView"
|
|
9
11
|
@scroll="onScroll"
|
|
10
12
|
>
|
|
11
13
|
<view
|
|
12
14
|
v-for="item in items"
|
|
13
15
|
:key="item.key"
|
|
14
16
|
:class="`tabs-item ${
|
|
15
|
-
item.
|
|
17
|
+
item.index === modelValue ? 'tabs-item-active' : ''
|
|
16
18
|
} `"
|
|
19
|
+
:id="`tabs-item-${item.index}`"
|
|
17
20
|
@click="onChangeTabs(item)"
|
|
18
21
|
>
|
|
19
22
|
{{ item.label }}
|
|
@@ -27,12 +30,12 @@
|
|
|
27
30
|
</template>
|
|
28
31
|
|
|
29
32
|
<script setup lang="ts">
|
|
30
|
-
import { ref } from 'vue';
|
|
33
|
+
import { computed, ref } from 'vue';
|
|
31
34
|
import CloseButton from '../CloseButton/index.vue';
|
|
32
35
|
// const activeKey = ref("Console");
|
|
33
|
-
defineProps<{
|
|
34
|
-
modelValue:
|
|
35
|
-
items: { label: string; key: string; value: any }[];
|
|
36
|
+
const props = defineProps<{
|
|
37
|
+
modelValue: number;
|
|
38
|
+
items: { label: string; key: string; value: any; index: number }[];
|
|
36
39
|
scrollLeft?: number;
|
|
37
40
|
}>();
|
|
38
41
|
|
|
@@ -40,14 +43,24 @@ const tabsRef = ref();
|
|
|
40
43
|
|
|
41
44
|
const emit = defineEmits<{
|
|
42
45
|
(e: 'close'): void;
|
|
43
|
-
(e: 'update:modelValue', value:
|
|
44
|
-
(e: 'change', value:
|
|
46
|
+
(e: 'update:modelValue', value: number): void;
|
|
47
|
+
(e: 'change', value: number): void;
|
|
45
48
|
(e: 'scroll', value: any): void;
|
|
46
49
|
}>();
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
const scrollIntoView = computed(() => {
|
|
52
|
+
return `tabs-item-${props.modelValue}`;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
function onChangeTabs(item: {
|
|
56
|
+
label: string;
|
|
57
|
+
key: string;
|
|
58
|
+
value: any;
|
|
59
|
+
index: number;
|
|
60
|
+
}) {
|
|
48
61
|
// activeKey.value = item.key;
|
|
49
|
-
emit('update:modelValue', item.
|
|
50
|
-
emit('change', item.
|
|
62
|
+
emit('update:modelValue', item.index);
|
|
63
|
+
emit('change', item.index);
|
|
51
64
|
}
|
|
52
65
|
function onClose() {
|
|
53
66
|
emit('close');
|
|
@@ -24,18 +24,19 @@
|
|
|
24
24
|
{{ eventItem.stack }}
|
|
25
25
|
</view>
|
|
26
26
|
|
|
27
|
-
<
|
|
27
|
+
<SourceCode
|
|
28
28
|
v-if="openCode && eventItem.stack"
|
|
29
29
|
:url="eventItem.stack"
|
|
30
30
|
:sourceFileServers="sourceFileServers"
|
|
31
31
|
:mode="mode"
|
|
32
|
+
:zIndex="zIndex"
|
|
32
33
|
@close="onCloseCode"
|
|
33
34
|
/>
|
|
34
35
|
</view>
|
|
35
36
|
</template>
|
|
36
37
|
<script lang="ts" setup>
|
|
37
38
|
import Tag from '../Tag/index.vue';
|
|
38
|
-
import
|
|
39
|
+
import SourceCode from '../SourceCode/index.vue';
|
|
39
40
|
import type { DevTool } from '../../type';
|
|
40
41
|
import { computed, ref } from 'vue';
|
|
41
42
|
import { isAndroid, isMockWX } from '../../utils';
|
|
@@ -45,6 +46,7 @@ const props = defineProps<{
|
|
|
45
46
|
mode?: string;
|
|
46
47
|
useDevSource?: boolean;
|
|
47
48
|
sourceFileServers?: string[];
|
|
49
|
+
zIndex?: number;
|
|
48
50
|
}>();
|
|
49
51
|
|
|
50
52
|
const openCode = ref(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="uni-event-content">
|
|
3
|
-
<DevToolTitle
|
|
3
|
+
<DevToolTitle innerStyle="padding: 0 16px">事件触发统计</DevToolTitle>
|
|
4
4
|
<view class="uni-event-statistics">
|
|
5
5
|
<view class="uni-event-statistics-item">
|
|
6
6
|
<view>on: </view>
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
</Tag>
|
|
28
28
|
</view>
|
|
29
29
|
</view>
|
|
30
|
-
<DevToolTitle
|
|
31
|
-
|
|
30
|
+
<DevToolTitle innerStyle="padding: 0 16px">
|
|
31
|
+
事件触发列表
|
|
32
32
|
|
|
33
33
|
<Tag mode="clear" style="margin-left: auto" @click="emit('clear')">
|
|
34
34
|
清空
|
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
:mode="mode"
|
|
42
42
|
:useDevSource="useDevSource"
|
|
43
43
|
:sourceFileServers="sourceFileServers"
|
|
44
|
+
:zIndex="zIndex"
|
|
44
45
|
/>
|
|
46
|
+
<Empty v-if="!eventList || eventList.length === 0"> </Empty>
|
|
45
47
|
</view>
|
|
46
48
|
</view>
|
|
47
49
|
</template>
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
50
52
|
import UniEventItem from './UniEventItem.vue';
|
|
51
53
|
import Tag from '../Tag/index.vue';
|
|
54
|
+
import Empty from '../Empty/index.vue';
|
|
52
55
|
import type { DevTool } from '@/dev/type';
|
|
53
56
|
|
|
54
57
|
defineProps<{
|
|
@@ -57,6 +60,7 @@ defineProps<{
|
|
|
57
60
|
useDevSource?: boolean;
|
|
58
61
|
mode?: string;
|
|
59
62
|
sourceFileServers?: string[];
|
|
63
|
+
zIndex?: number;
|
|
60
64
|
}>();
|
|
61
65
|
|
|
62
66
|
const emit = defineEmits<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="upload-detail">
|
|
2
|
+
<view class="upload-detail" :style="{ zIndex: zIndex }">
|
|
3
3
|
<view class="upload-detail-control">
|
|
4
4
|
<Tag
|
|
5
5
|
v-for="item in selectItems"
|
|
@@ -82,7 +82,7 @@ import Tag from '../Tag/index.vue';
|
|
|
82
82
|
import Empty from '../Empty/index.vue';
|
|
83
83
|
import CloseButton from '../CloseButton/index.vue';
|
|
84
84
|
import type { DevTool } from '../../type';
|
|
85
|
-
const props = defineProps<{ upload: DevTool.UploadItem }>();
|
|
85
|
+
const props = defineProps<{ upload: DevTool.UploadItem; zIndex?: number }>();
|
|
86
86
|
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
87
87
|
const selectItems = [
|
|
88
88
|
{
|
|
@@ -156,14 +156,10 @@ function onClose() {
|
|
|
156
156
|
position: fixed;
|
|
157
157
|
width: 100vw;
|
|
158
158
|
height: 100vh;
|
|
159
|
-
z-index:
|
|
159
|
+
z-index: 1001;
|
|
160
160
|
top: 0;
|
|
161
161
|
left: 0;
|
|
162
162
|
padding: 0 16px;
|
|
163
|
-
/* #ifdef H5 */
|
|
164
|
-
padding: 50px 16px;
|
|
165
|
-
/* #endif */
|
|
166
|
-
|
|
167
163
|
background-color: rgba(255, 255, 255, 0.95);
|
|
168
164
|
box-sizing: border-box;
|
|
169
165
|
}
|
|
@@ -37,7 +37,12 @@
|
|
|
37
37
|
</view>
|
|
38
38
|
</view>
|
|
39
39
|
<!-- <Transition name="slide-fade"> -->
|
|
40
|
-
<UploadDetail
|
|
40
|
+
<UploadDetail
|
|
41
|
+
v-if="showDetail"
|
|
42
|
+
:upload="upload"
|
|
43
|
+
:zIndex="zIndex"
|
|
44
|
+
@close="onClose"
|
|
45
|
+
/>
|
|
41
46
|
<!-- </Transition> -->
|
|
42
47
|
</template>
|
|
43
48
|
|
|
@@ -49,6 +54,7 @@ import { formatDate } from '../../utils';
|
|
|
49
54
|
import type { DevTool } from '../../type';
|
|
50
55
|
defineProps<{
|
|
51
56
|
upload: DevTool.UploadItem;
|
|
57
|
+
zIndex?: number;
|
|
52
58
|
}>();
|
|
53
59
|
const showDetail = ref(false);
|
|
54
60
|
|
|
@@ -17,14 +17,19 @@
|
|
|
17
17
|
{{ item.label }}
|
|
18
18
|
</Tag>
|
|
19
19
|
</view>
|
|
20
|
-
<VirtualListPro
|
|
20
|
+
<VirtualListPro
|
|
21
|
+
:data="uploadList"
|
|
22
|
+
:pageSize="15"
|
|
23
|
+
:height="height"
|
|
24
|
+
className="upload-list"
|
|
25
|
+
>
|
|
21
26
|
<template v-slot="{ list, start }">
|
|
22
27
|
<AutoSize
|
|
23
28
|
v-for="(item, index) in list"
|
|
24
29
|
:index="start + index"
|
|
25
30
|
:key="start + index"
|
|
26
31
|
>
|
|
27
|
-
<UploadItem :upload="item" />
|
|
32
|
+
<UploadItem :upload="item" :zIndex="zIndex" />
|
|
28
33
|
</AutoSize>
|
|
29
34
|
<Empty v-if="!uploadList || uploadList.length === 0" />
|
|
30
35
|
</template>
|
|
@@ -39,11 +44,13 @@ import FilterInput from '../FilterInput/index.vue';
|
|
|
39
44
|
import type { DevTool } from '../../type';
|
|
40
45
|
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
41
46
|
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
47
|
+
import { onMounted, ref } from 'vue';
|
|
42
48
|
|
|
43
49
|
defineProps<{
|
|
44
50
|
currentUploadType: string;
|
|
45
51
|
uploadList: DevTool.UploadItem[];
|
|
46
52
|
modelValue: string;
|
|
53
|
+
zIndex: number;
|
|
47
54
|
}>();
|
|
48
55
|
|
|
49
56
|
const emit = defineEmits<{
|
|
@@ -82,6 +89,12 @@ const uploadFilterItems = [
|
|
|
82
89
|
function onChoose(type: string) {
|
|
83
90
|
emit('choose', type);
|
|
84
91
|
}
|
|
92
|
+
|
|
93
|
+
const height = ref(0);
|
|
94
|
+
onMounted(() => {
|
|
95
|
+
const { windowHeight } = uni.getWindowInfo();
|
|
96
|
+
height.value = windowHeight - 32 - 32;
|
|
97
|
+
});
|
|
85
98
|
</script>
|
|
86
99
|
<style scoped>
|
|
87
100
|
.upload-content {
|