oxy-uni-ui 2.1.0 → 2.1.2
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/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +145 -100
- package/components/common/util.ts +25 -0
- package/components/composables/useDynamicVirtualScroll.ts +80 -0
- package/components/oxy-action-sheet/index.scss +6 -6
- package/components/oxy-backtop/index.scss +1 -1
- package/components/oxy-badge/index.scss +2 -2
- package/components/oxy-button/index.scss +3 -6
- package/components/oxy-calendar/index.scss +2 -2
- package/components/oxy-calendar/oxy-calendar.vue +3 -3
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +72 -37
- package/components/oxy-calendar-view/monthPanel/types.ts +43 -1
- package/components/oxy-calendar-view/types.ts +1 -1
- package/components/oxy-calendar-view/utils.ts +12 -1
- package/components/oxy-calendar-view/yearPanel/types.ts +36 -2
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +64 -45
- package/components/oxy-card/index.scss +4 -4
- package/components/oxy-cell/index.scss +1 -1
- package/components/oxy-cell-group/index.scss +2 -2
- package/components/oxy-checkbox/index.scss +87 -197
- package/components/oxy-collapse/index.scss +1 -1
- package/components/oxy-collapse-item/index.scss +2 -2
- package/components/oxy-corner/index.scss +3 -3
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-count-to/types.ts +1 -1
- package/components/oxy-date-strip-item/index.scss +4 -4
- package/components/oxy-datetime-picker/types.ts +1 -1
- package/components/oxy-datetime-picker-view/types.ts +2 -2
- package/components/oxy-fab/index.scss +1 -5
- package/components/oxy-file-list/index.scss +2 -2
- package/components/oxy-footer/index.scss +2 -2
- package/components/oxy-footer/oxy-footer.vue +2 -3
- package/components/oxy-form-item/index.scss +0 -5
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-guidance/index.scss +2 -2
- package/components/oxy-img/index.scss +2 -2
- package/components/oxy-img-cropper/index.scss +0 -2
- package/components/oxy-img-lazy/index.scss +0 -1
- package/components/oxy-index-anchor/index.scss +3 -3
- package/components/oxy-input/index.scss +2 -2
- package/components/oxy-input-number/index.scss +21 -3
- package/components/oxy-input-number/oxy-input-number.vue +9 -1
- package/components/oxy-keyboard/index.scss +1 -1
- package/components/oxy-link/index.scss +11 -10
- package/components/oxy-loading/index.scss +1 -1
- package/components/oxy-loadmore/index.scss +1 -1
- package/components/oxy-message-box/index.scss +7 -7
- package/components/oxy-navbar/index.scss +1 -1
- package/components/oxy-navbar/oxy-navbar.vue +2 -3
- package/components/oxy-password-input/index.scss +4 -4
- package/components/oxy-picker/types.ts +1 -1
- package/components/oxy-picker-view/oxy-picker-view.vue +8 -5
- package/components/oxy-picker-view/types.ts +2 -2
- package/components/oxy-progress/index.scss +2 -2
- package/components/oxy-radio/index.scss +8 -4
- package/components/oxy-radio-group/index.scss +0 -1
- package/components/oxy-rich-text/index.scss +2 -6
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +2 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +2 -1
- package/components/oxy-rich-text/mp-html/node/node.vue +23 -0
- package/components/oxy-rich-text/mp-html/parser.js +6 -6
- package/components/oxy-rich-text/oxy-rich-text.vue +23 -0
- package/components/oxy-search/index.scss +1 -1
- package/components/oxy-segmented/index.scss +4 -8
- package/components/oxy-select/index.scss +6 -6
- package/components/oxy-sidebar-item/index.scss +20 -11
- package/components/oxy-slider/index.scss +4 -5
- package/components/oxy-sort-button/index.scss +6 -9
- package/components/oxy-splitter-panel/index.scss +8 -8
- package/components/oxy-step/index.scss +9 -9
- package/components/oxy-swiper-nav/index.scss +2 -2
- package/components/oxy-switch/index.scss +3 -3
- package/components/oxy-tab/index.scss +8 -2
- package/components/oxy-tabbar/index.scss +3 -3
- package/components/oxy-tabbar/oxy-tabbar.vue +3 -3
- package/components/oxy-table/index.scss +0 -1
- package/components/oxy-table-col/index.scss +1 -2
- package/components/oxy-tabs/index.scss +3 -3
- package/components/oxy-tag/index.scss +160 -20
- package/components/oxy-tag/oxy-tag.vue +14 -2
- package/components/oxy-tag/types.ts +9 -0
- package/components/oxy-text/index.scss +1 -1
- package/components/oxy-textarea/index.scss +2 -6
- package/components/oxy-toast/index.scss +1 -1
- package/components/oxy-tree/index.scss +31 -11
- package/components/oxy-tree/oxy-tree.vue +113 -2
- package/components/oxy-tree/types.ts +1 -0
- package/components/oxy-upload/index.scss +3 -3
- package/components/oxy-video-preview/index.scss +3 -3
- package/components/oxy-virtual-scroll/index.scss +1 -1
- package/components/oxy-voice-player/index.scss +36 -36
- package/components/oxy-watermark/index.scss +1 -1
- package/dev-tools.ts +2 -0
- package/devTools/components/DevToolsOverlay.vue +56 -0
- package/devTools/components/DevToolsUiHost.vue +589 -0
- package/devTools/config.js +55 -0
- package/devTools/core/components/mpDevBubble.vue +174 -0
- package/devTools/core/libs/createH5Bubble.js +156 -0
- package/devTools/core/libs/devCache.js +151 -0
- package/devTools/core/libs/devOptions.js +163 -0
- package/devTools/core/libs/devUi.js +219 -0
- package/devTools/core/libs/drawView.js +140 -0
- package/devTools/core/libs/errorReport.js +64 -0
- package/devTools/core/libs/jsonCompress.js +334 -0
- package/devTools/core/libs/logReport.js +59 -0
- package/devTools/core/libs/pageLinkList.js +125 -0
- package/devTools/core/libs/timeFormat.js +94 -0
- package/devTools/core/proxy/console.js +430 -0
- package/devTools/core/proxy/index.js +36 -0
- package/devTools/core/proxy/request.js +495 -0
- package/devTools/core/proxy/storage.js +113 -0
- package/devTools/core/proxy/uniBus.js +153 -0
- package/devTools/core/proxy/uniListen.js +192 -0
- package/devTools/core/proxy/vueMixin.js +120 -0
- package/devTools/index.js +168 -0
- package/devTools/page/components/bottomTools.vue +1046 -0
- package/devTools/page/components/dialog/addStorage.vue +204 -0
- package/devTools/page/components/dialog/createDir.vue +366 -0
- package/devTools/page/components/dialog/editDialog.vue +192 -0
- package/devTools/page/components/dialog/routeDialog.vue +184 -0
- package/devTools/page/components/dialog/sendRequest.vue +603 -0
- package/devTools/page/components/dialog/textFileEditDialog.vue +391 -0
- package/devTools/page/components/libs/appDelDir.js +86 -0
- package/devTools/page/components/libs/dirReader.js +248 -0
- package/devTools/page/components/libs/fileSize.js +15 -0
- package/devTools/page/components/libs/getRuntimeInfo.js +134 -0
- package/devTools/page/components/listItem/consoleItem.vue +314 -0
- package/devTools/page/components/listItem/errorItem.vue +292 -0
- package/devTools/page/components/listItem/fileSysItem.vue +533 -0
- package/devTools/page/components/listItem/infoList.vue +100 -0
- package/devTools/page/components/listItem/jsRunnerItem.vue +255 -0
- package/devTools/page/components/listItem/logItem.vue +193 -0
- package/devTools/page/components/listItem/networkItem.vue +398 -0
- package/devTools/page/components/listItem/objectAnalysis.vue +651 -0
- package/devTools/page/components/listItem/pages.vue +319 -0
- package/devTools/page/components/listItem/routeItem.vue +153 -0
- package/devTools/page/components/listItem/setting.vue +734 -0
- package/devTools/page/components/listItem/storageList.vue +681 -0
- package/devTools/page/components/listItem/tools.vue +315 -0
- package/devTools/page/components/listItem/vuexList.vue +599 -0
- package/devTools/page/components/main.vue +1867 -0
- package/devTools/page/components/mixins/animationControl.js +91 -0
- package/devTools/page/components/mixins/mp.js +83 -0
- package/devTools/page/components/ui/btnTabs.vue +90 -0
- package/devTools/page/components/ui/codeHisPicker.vue +172 -0
- package/devTools/page/components/ui/h5Cell.vue +13 -0
- package/devTools/page/components/ui/menuBtn.vue +94 -0
- package/devTools/page/components/ui/mobileSwiperScroll.vue +74 -0
- package/devTools/page/components/ui/requestSpeedLimit.vue +52 -0
- package/devTools/page/components/ui/requestTimeoutMock.vue +55 -0
- package/devTools/page/components/ui/subTitleBar.vue +101 -0
- package/devTools/page/static/copy.png +0 -0
- package/devTools/page/static/delete.png +0 -0
- package/devTools/page/static/fileSys/AI.png +0 -0
- package/devTools/page/static/fileSys/DWG.png +0 -0
- package/devTools/page/static/fileSys/EXE.png +0 -0
- package/devTools/page/static/fileSys/GIF.png +0 -0
- package/devTools/page/static/fileSys/HTML.png +0 -0
- package/devTools/page/static/fileSys/PSD.png +0 -0
- package/devTools/page/static/fileSys/RVT.png +0 -0
- package/devTools/page/static/fileSys/SKP.png +0 -0
- package/devTools/page/static/fileSys/SVG.png +0 -0
- package/devTools/page/static/fileSys/excel.png +0 -0
- package/devTools/page/static/fileSys/pdf.png +0 -0
- package/devTools/page/static/fileSys/pptl.png +0 -0
- package/devTools/page/static/fileSys/shipin.png +0 -0
- package/devTools/page/static/fileSys/tupian.png +0 -0
- package/devTools/page/static/fileSys/txt.png +0 -0
- package/devTools/page/static/fileSys/weizhiwenjian.png +0 -0
- package/devTools/page/static/fileSys/wenjianjia.png +0 -0
- package/devTools/page/static/fileSys/word.png +0 -0
- package/devTools/page/static/fileSys/yasuo.png +0 -0
- package/devTools/page/static/fileSys/yinpin.png +0 -0
- package/devTools/page/static/fold.png +0 -0
- package/devTools/page/static/menu.png +0 -0
- package/devTools/page/static/refresh.png +0 -0
- package/devTools/page/static/unfold.png +0 -0
- package/devTools/tools.vue +25 -0
- package/devTools/type/devTools.d.ts +406 -0
- package/oxy-dev-tools/components/DevToolsUiHost.vue +555 -0
- package/oxy-dev-tools/config.js +61 -0
- package/oxy-dev-tools/core/components/mpDevBubble.vue +176 -0
- package/oxy-dev-tools/core/libs/createH5Bubble.js +156 -0
- package/oxy-dev-tools/core/libs/devCache.js +149 -0
- package/oxy-dev-tools/core/libs/devOptions.js +160 -0
- package/oxy-dev-tools/core/libs/devUi.js +219 -0
- package/oxy-dev-tools/core/libs/drawView.js +144 -0
- package/oxy-dev-tools/core/libs/errorReport.js +60 -0
- package/oxy-dev-tools/core/libs/jsonCompress.js +328 -0
- package/oxy-dev-tools/core/libs/logReport.js +55 -0
- package/oxy-dev-tools/core/libs/pageLinkList.js +121 -0
- package/oxy-dev-tools/core/libs/timeFormat.js +93 -0
- package/oxy-dev-tools/core/proxy/console.js +398 -0
- package/oxy-dev-tools/core/proxy/index.js +33 -0
- package/oxy-dev-tools/core/proxy/request.js +473 -0
- package/oxy-dev-tools/core/proxy/storage.js +96 -0
- package/oxy-dev-tools/core/proxy/uniBus.js +148 -0
- package/oxy-dev-tools/core/proxy/uniListen.js +190 -0
- package/oxy-dev-tools/core/proxy/vueMixin.js +115 -0
- package/oxy-dev-tools/index.ts +183 -0
- package/oxy-dev-tools/oxy-dev-tools.vue +62 -0
- package/oxy-dev-tools/page/components/bottomTools.vue +933 -0
- package/oxy-dev-tools/page/components/dialog/addStorage.vue +184 -0
- package/oxy-dev-tools/page/components/dialog/createDir.vue +352 -0
- package/oxy-dev-tools/page/components/dialog/editDialog.vue +178 -0
- package/oxy-dev-tools/page/components/dialog/routeDialog.vue +170 -0
- package/oxy-dev-tools/page/components/dialog/sendRequest.vue +530 -0
- package/oxy-dev-tools/page/components/dialog/textFileEditDialog.vue +379 -0
- package/oxy-dev-tools/page/components/libs/appDelDir.js +77 -0
- package/oxy-dev-tools/page/components/libs/dirReader.js +239 -0
- package/oxy-dev-tools/page/components/libs/fileSize.js +15 -0
- package/oxy-dev-tools/page/components/libs/getRuntimeInfo.js +132 -0
- package/oxy-dev-tools/page/components/listItem/consoleItem.vue +292 -0
- package/oxy-dev-tools/page/components/listItem/errorItem.vue +268 -0
- package/oxy-dev-tools/page/components/listItem/fileSysItem.vue +511 -0
- package/oxy-dev-tools/page/components/listItem/infoList.vue +89 -0
- package/oxy-dev-tools/page/components/listItem/jsRunnerItem.vue +236 -0
- package/oxy-dev-tools/page/components/listItem/logItem.vue +185 -0
- package/oxy-dev-tools/page/components/listItem/networkItem.vue +362 -0
- package/oxy-dev-tools/page/components/listItem/objectAnalysis.vue +642 -0
- package/oxy-dev-tools/page/components/listItem/pages.vue +285 -0
- package/oxy-dev-tools/page/components/listItem/routeItem.vue +140 -0
- package/oxy-dev-tools/page/components/listItem/setting.vue +687 -0
- package/oxy-dev-tools/page/components/listItem/storageList.vue +623 -0
- package/oxy-dev-tools/page/components/listItem/tools.vue +273 -0
- package/oxy-dev-tools/page/components/listItem/vuexList.vue +559 -0
- package/oxy-dev-tools/page/components/main.vue +1824 -0
- package/oxy-dev-tools/page/components/mixins/animationControl.js +80 -0
- package/oxy-dev-tools/page/components/mixins/mp.js +76 -0
- package/oxy-dev-tools/page/components/ui/btnTabs.vue +77 -0
- package/oxy-dev-tools/page/components/ui/codeHisPicker.vue +161 -0
- package/oxy-dev-tools/page/components/ui/h5Cell.vue +13 -0
- package/oxy-dev-tools/page/components/ui/menuBtn.vue +87 -0
- package/oxy-dev-tools/page/components/ui/mobileSwiperScroll.vue +71 -0
- package/oxy-dev-tools/page/components/ui/requestSpeedLimit.vue +47 -0
- package/oxy-dev-tools/page/components/ui/requestTimeoutMock.vue +50 -0
- package/oxy-dev-tools/page/components/ui/subTitleBar.vue +87 -0
- package/oxy-dev-tools/page/static/copy.png +0 -0
- package/oxy-dev-tools/page/static/delete.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/AI.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/DWG.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/EXE.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/GIF.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/HTML.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/PSD.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/RVT.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/SKP.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/SVG.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/excel.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/pdf.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/pptl.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/shipin.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/tupian.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/txt.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/weizhiwenjian.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/wenjianjia.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/word.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/yasuo.png +0 -0
- package/oxy-dev-tools/page/static/fileSys/yinpin.png +0 -0
- package/oxy-dev-tools/page/static/fold.png +0 -0
- package/oxy-dev-tools/page/static/menu.png +0 -0
- package/oxy-dev-tools/page/static/refresh.png +0 -0
- package/oxy-dev-tools/page/static/unfold.png +0 -0
- package/oxy-dev-tools/tools.vue +22 -0
- package/oxy-dev-tools/type/devTools.d.ts +406 -0
- package/package.json +1 -1
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="networkItem"
|
|
4
|
+
:class="['type-' + item.type]"
|
|
5
|
+
>
|
|
6
|
+
<view class="card">
|
|
7
|
+
<view class="content">
|
|
8
|
+
<view class="head">
|
|
9
|
+
<view
|
|
10
|
+
class="method"
|
|
11
|
+
:class="'type-' + item.method"
|
|
12
|
+
>
|
|
13
|
+
<text
|
|
14
|
+
class="methodText"
|
|
15
|
+
:class="'type-' + item.method"
|
|
16
|
+
>
|
|
17
|
+
{{ item.method }}
|
|
18
|
+
</text>
|
|
19
|
+
</view>
|
|
20
|
+
<view class="path">
|
|
21
|
+
<text class="pageText">{{ getPath(item.url) }}</text>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<objectAnalysis
|
|
25
|
+
:data="getItem(item)"
|
|
26
|
+
:width="670"
|
|
27
|
+
/>
|
|
28
|
+
<view class="msgBar">
|
|
29
|
+
<text
|
|
30
|
+
class="status"
|
|
31
|
+
:class="'s-' + item.type"
|
|
32
|
+
>
|
|
33
|
+
{{ getTypeName(item.type) }}
|
|
34
|
+
</text>
|
|
35
|
+
<text
|
|
36
|
+
class="time"
|
|
37
|
+
:style="{ color: getTimeColor }"
|
|
38
|
+
>
|
|
39
|
+
{{ item.useTime }}s
|
|
40
|
+
</text>
|
|
41
|
+
<text class="data">
|
|
42
|
+
{{ item.date }}
|
|
43
|
+
</text>
|
|
44
|
+
<text
|
|
45
|
+
v-if="item.type == 1"
|
|
46
|
+
class="size"
|
|
47
|
+
:style="{ color: getSizeColor }"
|
|
48
|
+
>
|
|
49
|
+
{{ getByteSize }}
|
|
50
|
+
</text>
|
|
51
|
+
</view>
|
|
52
|
+
<view class="actionBar">
|
|
53
|
+
<view
|
|
54
|
+
class="actionBtn"
|
|
55
|
+
@click.stop="$emit('goSendRequest', item)"
|
|
56
|
+
>
|
|
57
|
+
<text class="actionText">重发</text>
|
|
58
|
+
</view>
|
|
59
|
+
<view
|
|
60
|
+
class="actionBtn"
|
|
61
|
+
@click.stop="$emit('goOpenRequest', item)"
|
|
62
|
+
>
|
|
63
|
+
<text class="actionText">编辑</text>
|
|
64
|
+
</view>
|
|
65
|
+
<view
|
|
66
|
+
class="actionBtn"
|
|
67
|
+
@click.stop="copyItem"
|
|
68
|
+
>
|
|
69
|
+
<text class="actionText">复制</text>
|
|
70
|
+
</view>
|
|
71
|
+
<view
|
|
72
|
+
class="actionBtn more"
|
|
73
|
+
@click.stop="openMenu"
|
|
74
|
+
>
|
|
75
|
+
<text class="actionText">更多</text>
|
|
76
|
+
</view>
|
|
77
|
+
</view>
|
|
78
|
+
</view>
|
|
79
|
+
</view>
|
|
80
|
+
</view>
|
|
81
|
+
</template>
|
|
82
|
+
<script>
|
|
83
|
+
import objectAnalysis from "./objectAnalysis.vue";
|
|
84
|
+
import devUi from "../../../core/libs/devUi.js";
|
|
85
|
+
export default {
|
|
86
|
+
components: {
|
|
87
|
+
objectAnalysis,
|
|
88
|
+
},
|
|
89
|
+
props: {
|
|
90
|
+
/**
|
|
91
|
+
* console单行数据
|
|
92
|
+
*/
|
|
93
|
+
item: {
|
|
94
|
+
type: Object,
|
|
95
|
+
default() {
|
|
96
|
+
return {
|
|
97
|
+
id: 0, //请求id
|
|
98
|
+
type: 0, // 0发起请求中 1请求成功 2请求失败
|
|
99
|
+
date: "", //请求日期
|
|
100
|
+
sendTime: 0, //发送请求的时间
|
|
101
|
+
responseTime: 0, //响应时间
|
|
102
|
+
useTime: 0, //请求总耗时
|
|
103
|
+
|
|
104
|
+
url: "", //请求地址
|
|
105
|
+
header: "", //请求头
|
|
106
|
+
method: "get", //请求方式
|
|
107
|
+
data: "", //请求参数
|
|
108
|
+
|
|
109
|
+
responseBody: "", //响应主体
|
|
110
|
+
responseHeader: "", //响应头
|
|
111
|
+
responseStatus: "", //响应编码
|
|
112
|
+
responseMsg: "", //响应报错信息
|
|
113
|
+
responseBodySize: 0, //请求主体大小
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
computed: {
|
|
119
|
+
/**
|
|
120
|
+
* 获取请求时间的颜色
|
|
121
|
+
*/
|
|
122
|
+
getTimeColor() {
|
|
123
|
+
if (this.item.useTime == 0) {
|
|
124
|
+
return "#eeeeee";
|
|
125
|
+
} else if (this.item.useTime > 3) {
|
|
126
|
+
return "#fa3534";
|
|
127
|
+
} else if (this.item.useTime > 1) {
|
|
128
|
+
return "#ff9900";
|
|
129
|
+
} else {
|
|
130
|
+
return "#909399";
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* 获取字节大小,b转kb mb
|
|
135
|
+
*/
|
|
136
|
+
getByteSize() {
|
|
137
|
+
let size = Number(this.item.responseBodySize);
|
|
138
|
+
if (null == size || size == "") return "0.00 KB";
|
|
139
|
+
var unitArr = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
140
|
+
var index = 0;
|
|
141
|
+
var srcsize = parseFloat(size);
|
|
142
|
+
index = Math.floor(Math.log(srcsize) / Math.log(1024));
|
|
143
|
+
size = srcsize / Math.pow(1024, index);
|
|
144
|
+
size = size.toFixed(2); //保留的小数位数
|
|
145
|
+
if (Number(this.item.responseBodySize) < 1024) {
|
|
146
|
+
return (size / 1000).toFixed(2) + "KB";
|
|
147
|
+
}
|
|
148
|
+
return size + unitArr[index];
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* 获取响应大小的颜色
|
|
152
|
+
*/
|
|
153
|
+
getSizeColor() {
|
|
154
|
+
let size = this.item.responseBodySize;
|
|
155
|
+
if (size == 0) {
|
|
156
|
+
return "#fa3534";
|
|
157
|
+
} else if (size > 256 * 1024) {
|
|
158
|
+
return "#ff9900";
|
|
159
|
+
} else if (size > 1024 * 1024) {
|
|
160
|
+
return "#fa3534";
|
|
161
|
+
} else {
|
|
162
|
+
return "#909399";
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
methods: {
|
|
167
|
+
/**
|
|
168
|
+
* 通过url获取路径
|
|
169
|
+
*/
|
|
170
|
+
getPath(url) {
|
|
171
|
+
if (!url) return "无";
|
|
172
|
+
function getPathFromUrl(url) {
|
|
173
|
+
const pathStart = url.indexOf("//") + 2;
|
|
174
|
+
const pathEnd = url.indexOf("?", pathStart) >= 0 ? url.indexOf("?", pathStart) : url.length;
|
|
175
|
+
return url.substring(url.indexOf("/", pathStart), pathEnd);
|
|
176
|
+
}
|
|
177
|
+
return getPathFromUrl(url);
|
|
178
|
+
},
|
|
179
|
+
/**
|
|
180
|
+
* 获取请求类型名称
|
|
181
|
+
*/
|
|
182
|
+
getTypeName(type) {
|
|
183
|
+
return ["请求中...", "请求完成", "请求失败"][Number(type)];
|
|
184
|
+
},
|
|
185
|
+
/**
|
|
186
|
+
* 精简item
|
|
187
|
+
*/
|
|
188
|
+
getItem(item) {
|
|
189
|
+
return {
|
|
190
|
+
data: item.data,
|
|
191
|
+
responseMsg: item.responseMsg,
|
|
192
|
+
responseStatus: item.responseStatus,
|
|
193
|
+
method: item.method,
|
|
194
|
+
url: item.url,
|
|
195
|
+
header: item.header,
|
|
196
|
+
responseBody: item.responseBody,
|
|
197
|
+
responseHeader: item.responseHeader,
|
|
198
|
+
responseBodySize: this.getByteSize,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
copyItem() {
|
|
202
|
+
this.copyToClipboard(JSON.stringify(this.item));
|
|
203
|
+
},
|
|
204
|
+
copyToClipboard(data) {
|
|
205
|
+
uni.setClipboardData({
|
|
206
|
+
data,
|
|
207
|
+
success: () => {
|
|
208
|
+
devUi.showToast({
|
|
209
|
+
title: "复制成功",
|
|
210
|
+
icon: "success",
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
/**
|
|
216
|
+
* 更多菜单
|
|
217
|
+
*/
|
|
218
|
+
openMenu() {
|
|
219
|
+
let that = this;
|
|
220
|
+
|
|
221
|
+
let menu = [
|
|
222
|
+
{
|
|
223
|
+
text: `重发此请求`,
|
|
224
|
+
click() {
|
|
225
|
+
that.$emit("goSendRequest", that.item);
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
text: `复制请求日志信息`,
|
|
230
|
+
click() {
|
|
231
|
+
that.copyToClipboard(JSON.stringify(that.item));
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
text: `在请求构建工具中打开`,
|
|
236
|
+
click() {
|
|
237
|
+
that.$emit("goOpenRequest", that.item);
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
text: `删除此记录`,
|
|
242
|
+
click() {
|
|
243
|
+
uni.$emit("devTools_delNetworkItemById", that.item.id);
|
|
244
|
+
devUi.showToast({
|
|
245
|
+
title: "删除成功!",
|
|
246
|
+
icon: "success",
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
];
|
|
251
|
+
|
|
252
|
+
devUi.showActionSheet({
|
|
253
|
+
itemList: menu.map((x) => x.text),
|
|
254
|
+
success({ tapIndex }) {
|
|
255
|
+
menu[tapIndex].click();
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
</script>
|
|
262
|
+
<style lang="scss" scoped>
|
|
263
|
+
.networkItem {
|
|
264
|
+
width: 100%;
|
|
265
|
+
box-sizing: border-box;
|
|
266
|
+
padding: 10rpx 20rpx;
|
|
267
|
+
.card {
|
|
268
|
+
width: 100%;
|
|
269
|
+
box-sizing: border-box;
|
|
270
|
+
border-radius: 16rpx;
|
|
271
|
+
padding: 14rpx 16rpx 12rpx;
|
|
272
|
+
border: 1px solid rgba(148, 163, 184, 0.22);
|
|
273
|
+
background: #fff;
|
|
274
|
+
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.05);
|
|
275
|
+
}
|
|
276
|
+
&.type-0 .card {
|
|
277
|
+
border-color: rgba(245, 158, 11, 0.4);
|
|
278
|
+
background: #fffbf2;
|
|
279
|
+
}
|
|
280
|
+
&.type-2 .card {
|
|
281
|
+
border-color: rgba(239, 68, 68, 0.36);
|
|
282
|
+
background: #fff5f5;
|
|
283
|
+
}
|
|
284
|
+
.content {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-direction: column;
|
|
287
|
+
gap: 8rpx;
|
|
288
|
+
.head {
|
|
289
|
+
display: flex;
|
|
290
|
+
flex-direction: row;
|
|
291
|
+
align-items: center;
|
|
292
|
+
margin-bottom: 2rpx;
|
|
293
|
+
.method {
|
|
294
|
+
background-color: #eef2ff;
|
|
295
|
+
color: #333;
|
|
296
|
+
padding: 4rpx 10rpx;
|
|
297
|
+
border-radius: 999rpx;
|
|
298
|
+
&.type-get {
|
|
299
|
+
background-color: rgba(59, 130, 246, 0.14);
|
|
300
|
+
}
|
|
301
|
+
&.type-post {
|
|
302
|
+
background-color: rgba(16, 185, 129, 0.14);
|
|
303
|
+
}
|
|
304
|
+
.methodText {
|
|
305
|
+
color: #0f172a;
|
|
306
|
+
font-size: 20rpx;
|
|
307
|
+
line-height: 24rpx;
|
|
308
|
+
font-weight: 600;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
.path {
|
|
312
|
+
flex: 1;
|
|
313
|
+
min-width: 0;
|
|
314
|
+
lines: 1;
|
|
315
|
+
margin-left: 10rpx;
|
|
316
|
+
overflow: hidden;
|
|
317
|
+
display: -webkit-box;
|
|
318
|
+
-webkit-box-orient: vertical;
|
|
319
|
+
-webkit-line-clamp: 1;
|
|
320
|
+
.pageText {
|
|
321
|
+
font-size: 22rpx;
|
|
322
|
+
color: #334155;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
.context {
|
|
327
|
+
font-size: 20rpx;
|
|
328
|
+
color: #333;
|
|
329
|
+
line-height: 24rpx;
|
|
330
|
+
}
|
|
331
|
+
.msgBar {
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: row;
|
|
334
|
+
align-items: center;
|
|
335
|
+
flex-wrap: wrap;
|
|
336
|
+
gap: 10rpx;
|
|
337
|
+
.data {
|
|
338
|
+
font-size: 20rpx;
|
|
339
|
+
color: #64748b;
|
|
340
|
+
}
|
|
341
|
+
.time {
|
|
342
|
+
font-size: 20rpx;
|
|
343
|
+
color: #334155;
|
|
344
|
+
}
|
|
345
|
+
.size {
|
|
346
|
+
font-size: 20rpx;
|
|
347
|
+
}
|
|
348
|
+
.status {
|
|
349
|
+
font-size: 20rpx;
|
|
350
|
+
line-height: 28rpx;
|
|
351
|
+
padding: 2rpx 10rpx;
|
|
352
|
+
border-radius: 999rpx;
|
|
353
|
+
background: #f1f5f9;
|
|
354
|
+
&.s-0 {
|
|
355
|
+
color: #a16207;
|
|
356
|
+
background: #fef3c7;
|
|
357
|
+
}
|
|
358
|
+
&.s-1 {
|
|
359
|
+
color: #065f46;
|
|
360
|
+
background: #d1fae5;
|
|
361
|
+
}
|
|
362
|
+
&.s-2 {
|
|
363
|
+
color: #b91c1c;
|
|
364
|
+
background: #fee2e2;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
.actionBar {
|
|
369
|
+
margin-top: 4rpx;
|
|
370
|
+
display: flex;
|
|
371
|
+
flex-direction: row;
|
|
372
|
+
justify-content: flex-end;
|
|
373
|
+
gap: 10rpx;
|
|
374
|
+
.actionBtn {
|
|
375
|
+
height: 42rpx;
|
|
376
|
+
border-radius: 999rpx;
|
|
377
|
+
border: 1px solid #bfdbfe;
|
|
378
|
+
background: #eff6ff;
|
|
379
|
+
padding: 0 14rpx;
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
&:active {
|
|
383
|
+
background: #dbeafe;
|
|
384
|
+
}
|
|
385
|
+
&.more {
|
|
386
|
+
border-color: #cbd5e1;
|
|
387
|
+
background: #f8fafc;
|
|
388
|
+
}
|
|
389
|
+
.actionText {
|
|
390
|
+
font-size: 20rpx;
|
|
391
|
+
color: #1e3a8a;
|
|
392
|
+
line-height: 20rpx;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
</style>
|