vite-uni-dev-tool 0.0.48 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +20 -0
  2. package/dist/const.cjs +1 -0
  3. package/dist/const.d.ts +78 -161
  4. package/dist/const.d.ts.map +1 -1
  5. package/dist/const.js +1 -47
  6. package/dist/core-shared.d.ts +44 -0
  7. package/dist/core-shared.d.ts.map +1 -0
  8. package/dist/core-shared.js +1 -0
  9. package/dist/core.d.ts +2 -40
  10. package/dist/core.d.ts.map +1 -1
  11. package/dist/core.js +4 -159
  12. package/dist/i18n/index.cjs +1 -0
  13. package/dist/i18n/index.d.ts +9 -0
  14. package/dist/i18n/index.d.ts.map +1 -0
  15. package/dist/i18n/index.js +1 -0
  16. package/dist/i18n/instance.cjs +1 -0
  17. package/dist/i18n/instance.d.ts +15 -0
  18. package/dist/i18n/instance.d.ts.map +1 -0
  19. package/dist/i18n/instance.js +1 -0
  20. package/dist/i18n/locales/en.cjs +1 -0
  21. package/dist/i18n/locales/en.d.ts +470 -0
  22. package/dist/i18n/locales/en.d.ts.map +1 -0
  23. package/dist/i18n/locales/en.js +1 -0
  24. package/dist/i18n/locales/zh-Hans.cjs +1 -0
  25. package/dist/i18n/locales/zh-Hans.d.ts +476 -0
  26. package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
  27. package/dist/i18n/locales/zh-Hans.js +1 -0
  28. package/dist/index.cjs +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/modules/devConsole/index.cjs +4 -0
  32. package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
  33. package/dist/modules/devConsole/index.d.ts.map +1 -0
  34. package/dist/modules/devConsole/index.js +4 -0
  35. package/dist/modules/devEvent/index.cjs +5 -0
  36. package/dist/modules/devEvent/index.d.ts +115 -0
  37. package/dist/modules/devEvent/index.d.ts.map +1 -0
  38. package/dist/modules/devEvent/index.js +5 -0
  39. package/dist/modules/devIntercept/index.cjs +13 -0
  40. package/dist/modules/devIntercept/index.d.ts +71 -0
  41. package/dist/modules/devIntercept/index.d.ts.map +1 -0
  42. package/dist/modules/devIntercept/index.js +13 -0
  43. package/dist/modules/devStore/index.cjs +1 -0
  44. package/dist/modules/devStore/index.d.ts +159 -0
  45. package/dist/modules/devStore/index.d.ts.map +1 -0
  46. package/dist/modules/devStore/index.js +1 -0
  47. package/dist/modules/devToolInfo/index.cjs +1 -0
  48. package/dist/modules/devToolInfo/index.d.ts +27 -0
  49. package/dist/modules/devToolInfo/index.d.ts.map +1 -0
  50. package/dist/modules/devToolInfo/index.js +1 -0
  51. package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
  52. package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
  53. package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
  54. package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
  55. package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
  56. package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
  57. package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
  58. package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
  59. package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
  60. package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
  61. package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
  62. package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
  63. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
  64. package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
  65. package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
  66. package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
  67. package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
  68. package/dist/plugins/uniParseStock/index.d.ts +10 -0
  69. package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
  70. package/dist/plugins/utils/index.cjs +2 -0
  71. package/dist/plugins/utils/index.d.ts +1 -3
  72. package/dist/plugins/utils/index.d.ts.map +1 -1
  73. package/dist/plugins/utils/index.js +2 -2
  74. package/dist/shims-uni.d.ts +140 -0
  75. package/dist/type.d.ts +174 -16
  76. package/dist/type.d.ts.map +1 -1
  77. package/dist/utils/array.cjs +1 -0
  78. package/dist/utils/array.d.ts.map +1 -1
  79. package/dist/utils/array.js +1 -12
  80. package/dist/utils/date.cjs +1 -0
  81. package/dist/utils/date.d.ts.map +1 -1
  82. package/dist/utils/date.js +1 -59
  83. package/dist/utils/file.cjs +1 -0
  84. package/dist/utils/file.d.ts.map +1 -1
  85. package/dist/utils/file.js +1 -85
  86. package/dist/utils/function.cjs +1 -0
  87. package/dist/utils/function.d.ts +13 -0
  88. package/dist/utils/function.d.ts.map +1 -1
  89. package/dist/utils/function.js +1 -68
  90. package/dist/utils/index.cjs +1 -0
  91. package/dist/utils/index.d.ts.map +1 -1
  92. package/dist/utils/index.js +1 -63
  93. package/dist/utils/ip.cjs +1 -0
  94. package/dist/utils/ip.d.ts +1 -1
  95. package/dist/utils/ip.d.ts.map +1 -1
  96. package/dist/utils/ip.js +1 -45
  97. package/dist/utils/language.cjs +1 -0
  98. package/dist/utils/language.d.ts +2 -1
  99. package/dist/utils/language.d.ts.map +1 -1
  100. package/dist/utils/language.js +1 -63
  101. package/dist/utils/object.cjs +1 -0
  102. package/dist/utils/object.d.ts +4 -5
  103. package/dist/utils/object.d.ts.map +1 -1
  104. package/dist/utils/object.js +1 -136
  105. package/dist/utils/openLink.cjs +1 -0
  106. package/dist/utils/openLink.d.ts.map +1 -1
  107. package/dist/utils/openLink.js +1 -28
  108. package/dist/utils/page.cjs +1 -0
  109. package/dist/utils/page.d.ts.map +1 -1
  110. package/dist/utils/page.js +1 -7
  111. package/dist/utils/platform.cjs +1 -0
  112. package/dist/utils/platform.d.ts.map +1 -1
  113. package/dist/utils/platform.js +1 -17
  114. package/dist/utils/string.cjs +1 -0
  115. package/dist/utils/string.d.ts.map +1 -1
  116. package/dist/utils/string.js +1 -114
  117. package/dist/utils/utils.cjs +1 -0
  118. package/dist/utils/utils.d.ts +1 -1
  119. package/dist/utils/utils.d.ts.map +1 -1
  120. package/dist/utils/utils.js +1 -126
  121. package/dist/v3/AppTransition/index.vue +170 -0
  122. package/dist/v3/AutoSizer/index.vue +4 -5
  123. package/dist/v3/AutoSizer/index1.vue +4 -6
  124. package/dist/v3/AutoSizer/utils.ts +1 -1
  125. package/dist/v3/CaptureScreen/index.vue +19 -8
  126. package/dist/v3/CircularButton/index.vue +64 -13
  127. package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
  128. package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
  129. package/dist/v3/ConsoleList/index.vue +51 -35
  130. package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
  131. package/dist/v3/CustomSwiper/index.vue +104 -0
  132. package/dist/v3/DevTool/fps-collector.render.ts +148 -0
  133. package/dist/v3/DevTool/index.vue +209 -102
  134. package/dist/v3/DevToolButton/index.vue +40 -59
  135. package/dist/v3/DevToolTitle/index.vue +4 -1
  136. package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
  137. package/dist/v3/DevToolWindow/const.ts +47 -69
  138. package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
  139. package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
  140. package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
  141. package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
  142. package/dist/v3/DevToolWindow/index.css +89 -0
  143. package/dist/v3/DevToolWindow/index.vue +800 -1450
  144. package/dist/v3/DraggableContainer/index.vue +456 -0
  145. package/dist/v3/ElEvent/ElEventItem.vue +4 -3
  146. package/dist/v3/ElEvent/index.vue +26 -9
  147. package/dist/v3/Empty/index.vue +1 -0
  148. package/dist/v3/FilterInput/index.vue +8 -22
  149. package/dist/v3/FilterSelect/index.vue +37 -24
  150. package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
  151. package/dist/v3/Instance/flatten.ts +226 -0
  152. package/dist/v3/Instance/index.vue +94 -0
  153. package/dist/v3/Instance/registry.ts +49 -0
  154. package/dist/v3/Instance/transformTree.ts +375 -0
  155. package/dist/v3/Instance/transformTreeCtx.ts +268 -0
  156. package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
  157. package/dist/v3/InstanceDetail/index.vue +433 -44
  158. package/dist/v3/JsonDetail/index.vue +12 -8
  159. package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
  160. package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
  161. package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
  162. package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
  163. package/dist/v3/JsonPretty/index.vue +60 -37
  164. package/dist/v3/JsonPretty/utils/index.ts +41 -44
  165. package/dist/v3/MovableContainer/index.vue +89 -0
  166. package/dist/v3/NFCList/NFCItem.vue +14 -14
  167. package/dist/v3/NFCList/NFCTool.vue +99 -81
  168. package/dist/v3/NFCList/index.vue +14 -10
  169. package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
  170. package/dist/v3/NetworkList/InterceptItem.vue +14 -6
  171. package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
  172. package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
  173. package/dist/v3/NetworkList/NetworkItem.vue +27 -11
  174. package/dist/v3/NetworkList/NetworkSend.vue +132 -290
  175. package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
  176. package/dist/v3/NetworkList/index.vue +32 -24
  177. package/dist/v3/NetworkList/utils.ts +101 -0
  178. package/dist/v3/Performance/index.vue +495 -0
  179. package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
  180. package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
  181. package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
  182. package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
  183. package/dist/v3/Pick/index.vue +322 -0
  184. package/dist/v3/PiniaList/index.vue +38 -17
  185. package/dist/v3/RouteList/index.vue +32 -15
  186. package/dist/v3/RunJS/index.vue +30 -10
  187. package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
  188. package/dist/v3/ScanCodeList/index.vue +12 -9
  189. package/dist/v3/SettingButton/index.vue +45 -0
  190. package/dist/v3/SettingList/index.css +120 -0
  191. package/dist/v3/SettingList/index.vue +96 -537
  192. package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
  193. package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
  194. package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
  195. package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
  196. package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
  197. package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
  198. package/dist/v3/SourceCode/Line.vue +15 -2
  199. package/dist/v3/SourceCode/index.vue +25 -24
  200. package/dist/v3/SourceCode/parseCode.ts +114 -56
  201. package/dist/v3/StorageList/index.vue +33 -33
  202. package/dist/v3/Tabs/index.vue +31 -28
  203. package/dist/v3/Tag/index.vue +39 -20
  204. package/dist/v3/TransferList/TransferDetail.vue +268 -0
  205. package/dist/v3/TransferList/TransferItem.vue +125 -0
  206. package/dist/v3/TransferList/index.vue +181 -0
  207. package/dist/v3/UniEvent/UniEventItem.vue +1 -0
  208. package/dist/v3/UniEvent/index.vue +28 -29
  209. package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
  210. package/dist/v3/VirtualList/index.vue +382 -82
  211. package/dist/v3/VuexList/index.vue +38 -17
  212. package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
  213. package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
  214. package/dist/v3/WebSocket/index.vue +44 -30
  215. package/dist/v3/hooks/useNFC/index.ts +6 -6
  216. package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
  217. package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
  218. package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
  219. package/dist/v3/hooks/useNFC/utils.ts +3 -3
  220. package/dist/v3/hooks/useRequest/index.ts +2 -2
  221. package/dist/v3/hooks/useScanCode/index.ts +10 -8
  222. package/dist/v3/styles/theme.css +290 -0
  223. package/dist/v3/styles/theme.ts +12 -0
  224. package/package.json +25 -5
  225. package/dist/devConsole/index.d.ts.map +0 -1
  226. package/dist/devConsole/index.js +0 -273
  227. package/dist/devEvent/index.d.ts +0 -328
  228. package/dist/devEvent/index.d.ts.map +0 -1
  229. package/dist/devEvent/index.js +0 -697
  230. package/dist/devEventBus/index.d.ts +0 -42
  231. package/dist/devEventBus/index.d.ts.map +0 -1
  232. package/dist/devEventBus/index.js +0 -70
  233. package/dist/devIntercept/index.d.ts +0 -281
  234. package/dist/devIntercept/index.d.ts.map +0 -1
  235. package/dist/devIntercept/index.js +0 -949
  236. package/dist/devRunJS/index.d.ts +0 -67
  237. package/dist/devRunJS/index.d.ts.map +0 -1
  238. package/dist/devStore/index.d.ts +0 -199
  239. package/dist/devStore/index.d.ts.map +0 -1
  240. package/dist/devStore/index.js +0 -562
  241. package/dist/devToolInfo/index.d.ts +0 -17
  242. package/dist/devToolInfo/index.d.ts.map +0 -1
  243. package/dist/devToolInfo/index.js +0 -15
  244. package/dist/v3/AutoSizer/utils.d.ts +0 -5
  245. package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
  246. package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
  247. package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
  248. package/dist/v3/DevToolWindow/const.d.ts +0 -46
  249. package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
  250. package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
  251. package/dist/v3/InstanceTree/flatten.d.ts +0 -10
  252. package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
  253. package/dist/v3/InstanceTree/flatten.ts +0 -75
  254. package/dist/v3/InstanceTree/index.vue +0 -51
  255. package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
  256. package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
  257. package/dist/v3/InstanceTree/transformTree.ts +0 -237
  258. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
  259. package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
  260. package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
  261. package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
  262. package/dist/v3/JsonPretty/type.d.ts +0 -94
  263. package/dist/v3/JsonPretty/type.d.ts.map +0 -1
  264. package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
  265. package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
  266. package/dist/v3/NFCList/const.d.ts +0 -13
  267. package/dist/v3/NFCList/const.d.ts.map +0 -1
  268. package/dist/v3/NetworkList/const.d.ts +0 -5
  269. package/dist/v3/NetworkList/const.d.ts.map +0 -1
  270. package/dist/v3/SourceCode/parseCode.d.ts +0 -27
  271. package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
  272. package/dist/v3/UploadList/UploadDetail.vue +0 -255
  273. package/dist/v3/UploadList/UploadItem.vue +0 -122
  274. package/dist/v3/UploadList/index.vue +0 -125
  275. package/dist/v3/VirtualListPro/index.vue +0 -229
  276. package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
  277. package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
  278. package/dist/v3/hooks/useNFC/index.d.ts +0 -5
  279. package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
  280. package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
  281. package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
  282. package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
  283. package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
  284. package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
  285. package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
  286. package/dist/v3/hooks/useRequest/index.d.ts +0 -126
  287. package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
  288. package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
  289. package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
  290. package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
  291. package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
  292. /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
@@ -0,0 +1,208 @@
1
+ <template>
2
+ <view class="setting-item">
3
+ <DevToolTitle>{{ t('setting.devTool.title') }}</DevToolTitle>
4
+ <view class="setting-item-content">
5
+ <view class="setting-row">
6
+ <view>
7
+ {{ t('setting.devTool.currentVersion') }}:{{
8
+ buildInfo?.devToolVersion
9
+ }}
10
+ </view>
11
+ <view>
12
+ {{ t('setting.devTool.buildTime') }}:{{
13
+ buildInfo?.devToolBuildTime
14
+ }}
15
+ </view>
16
+ </view>
17
+ <view class="setting-row">
18
+ {{ t('setting.devTool.feedbackUrl') }}:
19
+ <text class="setting-link" @click="onOpenLink">
20
+ {{ buildInfo?.devToolGit }}
21
+ </text>
22
+ </view>
23
+ <view class="setting-tips">
24
+ {{ t('setting.devTool.slogan') }}
25
+ </view>
26
+ <view class="setting-row">
27
+ <view>{{ t('setting.devTool.tabsConfig') }}:</view>
28
+ </view>
29
+ <view class="setting-tips">
30
+ {{ t('setting.devTool.tabsConfigTip') }}
31
+ </view>
32
+ <checkbox-group class="setting-checkbox-group" @change="onCheckboxChange">
33
+ <label
34
+ v-for="item in allTabs"
35
+ :key="item.key"
36
+ class="setting-checkbox-item">
37
+ <checkbox
38
+ :value="item.key"
39
+ :checked="!hiddenTabs.includes(item.key)"
40
+ :color="themeColor"
41
+ style="transform: scale(0.8)" />
42
+ <text>{{ item.label }}</text>
43
+ </label>
44
+ </checkbox-group>
45
+ <SettingButton @click="onSaveAndRestart">
46
+ {{ t('setting.devTool.saveAndRestart') }}
47
+ </SettingButton>
48
+
49
+ <view class="setting-row">
50
+ <view>{{ t('setting.devTool.showHideButton') }}:</view>
51
+ </view>
52
+ <view class="setting-tips">
53
+ {{ t('setting.devTool.hideButtonTip') }}
54
+ </view>
55
+ <SettingButton @click="onToggleDevButton">
56
+ {{
57
+ devToolVisible
58
+ ? t('setting.devTool.hideButton')
59
+ : t('setting.devTool.showButton')
60
+ }}
61
+ </SettingButton>
62
+ <view class="setting-row">
63
+ <view>{{ t('setting.devTool.restartDevTool') }}:</view>
64
+ </view>
65
+
66
+ <view class="setting-tips">
67
+ {{ t('setting.devTool.restartDevToolTip') }}
68
+ </view>
69
+ <SettingButton @click="onRestartDevTool">
70
+ {{ t('setting.devTool.restartDevToolButton') }}
71
+ </SettingButton>
72
+
73
+ <view class="setting-row">
74
+ <view>{{ t('setting.devTool.destroyDevTool') }}:</view>
75
+ </view>
76
+
77
+ <view class="setting-tips">
78
+ {{ t('setting.devTool.destroyDevToolTip') }}
79
+ </view>
80
+ <SettingButton @click="onDestroyDevTool">
81
+ {{ t('setting.devTool.destroyDevToolButton') }}
82
+ </SettingButton>
83
+
84
+ <view class="setting-row">
85
+ <view>{{ t('setting.devTool.restartApp') }}:</view>
86
+ </view>
87
+ <view class="setting-tips">{{ t('setting.devTool.restartAppTip') }}</view>
88
+ <SettingButton @click="onRestartApp">
89
+ {{ t('setting.devTool.restartAppButton') }}
90
+ </SettingButton>
91
+
92
+ <view class="setting-row">
93
+ <view>{{ t('setting.devTool.storageUsage') }}:{{ sizeFormat }}</view>
94
+ </view>
95
+ <view class="setting-tips">
96
+ {{ t('setting.devTool.storageUsageTip') }}
97
+ </view>
98
+ <SettingButton @click="onClearCache">
99
+ {{ t('setting.devTool.clearCache') }}
100
+ </SettingButton>
101
+ </view>
102
+ </view>
103
+ </template>
104
+
105
+ <script setup lang="ts">
106
+ import { onMounted, ref, computed } from 'vue';
107
+ import DevToolTitle from '../../DevToolTitle/index.vue';
108
+ import SettingButton from '../../SettingButton/index.vue';
109
+ import { openOutLink } from '../../../utils';
110
+ import { useI18n } from '../../../i18n';
111
+ import { getTabItems } from '../../DevToolWindow/const';
112
+ import { getDevToolInfo, setDevToolInfo } from '../../../modules/devToolInfo';
113
+ import { getThemeMainColor } from '../../styles/theme';
114
+
115
+ const { t } = useI18n();
116
+
117
+ const props = defineProps<{
118
+ theme?: string;
119
+ devToolVisible?: boolean;
120
+ sizeFormat?: string;
121
+ buildInfo?: {
122
+ devToolVersion?: string;
123
+ devToolBuildTime?: string;
124
+ devToolGit?: string;
125
+ };
126
+ }>();
127
+
128
+ const themeColor = computed(() => getThemeMainColor(props.theme));
129
+
130
+ const emit = defineEmits<{
131
+ (e: 'showDevButton', show: boolean): void;
132
+ (e: 'restartDevTool'): void;
133
+ (e: 'restartApp'): void;
134
+ (e: 'clearCache'): void;
135
+ (e: 'destroyDevTool'): void;
136
+ }>();
137
+
138
+ function onOpenLink() {
139
+ openOutLink(props.buildInfo?.devToolGit);
140
+ }
141
+
142
+ function onToggleDevButton() {
143
+ emit('showDevButton', !props.devToolVisible);
144
+ }
145
+
146
+ function onRestartDevTool() {
147
+ emit('restartDevTool');
148
+ }
149
+
150
+ function onDestroyDevTool() {
151
+ emit('destroyDevTool');
152
+ }
153
+
154
+ function onRestartApp() {
155
+ emit('restartApp');
156
+ }
157
+
158
+ function onClearCache() {
159
+ emit('clearCache');
160
+ }
161
+
162
+ const allTabs = getTabItems(t).filter((item) => item.key !== 'Setting');
163
+ const hiddenTabs = ref<string[]>([]);
164
+
165
+ onMounted(() => {
166
+ const info = getDevToolInfo();
167
+ hiddenTabs.value = info.hiddenTabs || [
168
+ 'Performance',
169
+ 'CaptureScreen',
170
+ 'ScanCode',
171
+ 'NFC',
172
+ 'ElEvent',
173
+ 'UniEvent',
174
+ ];
175
+ });
176
+
177
+ function onCheckboxChange(e: any) {
178
+ const checkedKeys = e.detail.value;
179
+ hiddenTabs.value = allTabs
180
+ .map((item) => item.key)
181
+ .filter((key) => !checkedKeys.includes(key));
182
+ }
183
+
184
+ function onSaveAndRestart() {
185
+ setDevToolInfo({
186
+ hiddenTabs: hiddenTabs.value,
187
+ });
188
+ // 重启应用使配置生效
189
+ emit('restartApp');
190
+ }
191
+ </script>
192
+
193
+ <style scoped>
194
+ @import '../index.css';
195
+
196
+ .setting-checkbox-group {
197
+ display: flex;
198
+ flex-wrap: wrap;
199
+ margin-bottom: 10px;
200
+ }
201
+
202
+ .setting-checkbox-item {
203
+ display: flex;
204
+ align-items: center;
205
+ margin-bottom: 5px;
206
+ min-width: 33.33%;
207
+ }
208
+ </style>
@@ -0,0 +1,119 @@
1
+ <template>
2
+ <view class="setting-item">
3
+ <DevToolTitle>{{ t('setting.info.title') }}</DevToolTitle>
4
+ <view class="setting-item-content">
5
+ <view class="setting-row">{{ t('setting.info.viewWindow') }}:</view>
6
+ <view class="setting-tips">
7
+ {{ t('setting.info.viewWindowTip') }}
8
+ </view>
9
+ <SettingButton @click="onLookWindowInfo">
10
+ {{ t('setting.info.viewWindow') }}
11
+ </SettingButton>
12
+
13
+ <view class="setting-row">{{ t('setting.info.viewDevice') }}:</view>
14
+ <view class="setting-tips">
15
+ {{ t('setting.info.viewDeviceTip') }}
16
+ </view>
17
+ <SettingButton @click="onLookDeviceInfo">
18
+ {{ t('setting.info.viewDevice') }}
19
+ </SettingButton>
20
+
21
+ <view class="setting-row">{{ t('setting.info.viewSystem') }}:</view>
22
+ <view class="setting-tips">
23
+ {{ t('setting.info.viewSystemTip') }}
24
+ </view>
25
+ <SettingButton @click="onLookSystemInfo">
26
+ {{ t('setting.info.viewSystem') }}
27
+ </SettingButton>
28
+
29
+ <view class="setting-row">{{ t('setting.info.viewAppInfo') }}:</view>
30
+ <view class="setting-tips">
31
+ {{ t('setting.info.viewAppInfoTip') }}
32
+ </view>
33
+ <SettingButton @click="onLookAppInfo">
34
+ {{ t('setting.info.viewAppInfo') }}
35
+ </SettingButton>
36
+ </view>
37
+ </view>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import DevToolTitle from '../../DevToolTitle/index.vue';
42
+ import SettingButton from '../../SettingButton/index.vue';
43
+ import { useI18n } from '../../../i18n';
44
+
45
+ const { t } = useI18n();
46
+
47
+ defineProps<{
48
+ theme?: string;
49
+ }>();
50
+
51
+ const emit = defineEmits<{
52
+ (e: 'openJson', data: { title: string; data: any }): void;
53
+ }>();
54
+
55
+ function onLookWindowInfo() {
56
+ if (uni.getWindowInfo) {
57
+ const windowInfo = uni.getWindowInfo();
58
+ emit('openJson', {
59
+ title: 'windowInfo',
60
+ data: windowInfo,
61
+ });
62
+ } else {
63
+ uni.showToast({
64
+ title: `${t('setting.info.notSupported')} uni.getWindowInfo`,
65
+ });
66
+ }
67
+ }
68
+ function onLookDeviceInfo() {
69
+ if (uni.getDeviceInfo) {
70
+ const deviceInfo = uni.getDeviceInfo();
71
+ emit('openJson', {
72
+ title: 'deviceInfo',
73
+ data: deviceInfo,
74
+ });
75
+ } else {
76
+ uni.showToast({
77
+ title: `${t('setting.info.notSupported')} uni.getDeviceInfo`,
78
+ });
79
+ }
80
+ }
81
+ async function onLookSystemInfo() {
82
+ if (uni.getSystemInfo) {
83
+ const systemInfo = await uni.getSystemInfo();
84
+ emit('openJson', {
85
+ title: 'systemInfo',
86
+ data: systemInfo,
87
+ });
88
+ } else {
89
+ uni.showToast({
90
+ title: `${t('setting.info.notSupported')} uni.getSystemInfo`,
91
+ });
92
+ }
93
+ }
94
+ function onLookAppInfo() {
95
+ if (uni.getAppBaseInfo) {
96
+ let appInfo = uni.getAppBaseInfo();
97
+
98
+ if (uni.getAppAuthorizeSetting) {
99
+ appInfo = {
100
+ ...appInfo,
101
+ ...uni.getAppAuthorizeSetting(),
102
+ };
103
+ }
104
+
105
+ emit('openJson', {
106
+ title: 'appInfo',
107
+ data: appInfo,
108
+ });
109
+ } else {
110
+ uni.showToast({
111
+ title: `${t('setting.info.notSupported')} uni.getAppInfo`,
112
+ });
113
+ }
114
+ }
115
+ </script>
116
+
117
+ <style scoped>
118
+ @import '../index.css';
119
+ </style>
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <view class="setting-item">
3
+ <DevToolTitle>{{ t('setting.devTool.language') }}</DevToolTitle>
4
+ <view class="setting-item-content">
5
+ <view class="setting-row">
6
+ <view>{{ t('setting.devTool.languageTip') }}:</view>
7
+ <Pick
8
+ :modelValue="selectedLanguage"
9
+ :options="languageOptions"
10
+ :readonly="true"
11
+ customStyle="width: 100px; flex: none;"
12
+ @change="onLanguageChange" />
13
+ </view>
14
+ <SettingButton @click="onConfirm" style="margin-top: 10px">
15
+ {{ t('setting.devTool.confirmLanguage') }}
16
+ </SettingButton>
17
+ </view>
18
+ </view>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { computed, ref } from 'vue';
23
+ import DevToolTitle from '../../DevToolTitle/index.vue';
24
+ import Pick from '../../Pick/index.vue';
25
+ import SettingButton from '../../SettingButton/index.vue';
26
+ import { useI18n } from '../../../i18n';
27
+
28
+ const { t, locale, setLocale } = useI18n();
29
+
30
+ defineProps<{
31
+ theme?: string;
32
+ }>();
33
+
34
+ const emit = defineEmits<{
35
+ (e: 'restartApp'): void;
36
+ }>();
37
+
38
+ const selectedLanguage = ref(locale.value);
39
+
40
+ const languageOptions = computed(() => [
41
+ {
42
+ label: '中文',
43
+ value: 'zh-Hans',
44
+ },
45
+ {
46
+ label: 'English',
47
+ value: 'en',
48
+ },
49
+ ]);
50
+
51
+ function onLanguageChange(item: { label: string; value: any }) {
52
+ selectedLanguage.value = item.value;
53
+ }
54
+
55
+ function onConfirm() {
56
+ if (selectedLanguage.value === locale.value) return;
57
+
58
+ setLocale(selectedLanguage.value);
59
+
60
+ uni.showToast({
61
+ title: t('setting.devTool.confirmLanguageTip'),
62
+ icon: 'none',
63
+ duration: 1500,
64
+ });
65
+
66
+ setTimeout(() => {
67
+ emit('restartApp');
68
+ }, 1500);
69
+ }
70
+ </script>
71
+
72
+ <style scoped>
73
+ @import '../index.css';
74
+ </style>
@@ -0,0 +1,230 @@
1
+ <template>
2
+ <view class="setting-item" style="padding-bottom: 16px">
3
+ <DevToolTitle>{{ t('setting.log.title') }}</DevToolTitle>
4
+ <view class="setting-item-content">
5
+ <checkbox-group @change="onToggleCacheConsole">
6
+ <label class="setting-row">
7
+ <view>{{ t('setting.log.cacheConsoleLog') }}:</view>
8
+ <checkbox
9
+ :checked="cacheConsoleLog"
10
+ value="true"
11
+ :color="themeColor"
12
+ style="transform: scale(0.8)" />
13
+ </label>
14
+ </checkbox-group>
15
+ <view class="setting-tips">
16
+ {{ t('setting.log.cacheConsoleLogTip') }}
17
+ </view>
18
+ </view>
19
+ <checkbox-group @change="onChangeSetting">
20
+ <view class="setting-item-content">
21
+ <view class="setting-row">
22
+ <view>{{ t('setting.log.exportLog') }}:</view>
23
+ <checkbox
24
+ :checked="setting.exportLog"
25
+ :color="themeColor"
26
+ value="exportLog"
27
+ style="transform: scale(0.8)" />
28
+ </view>
29
+ <view class="setting-tips">{{ t('setting.log.exportLogTip') }}</view>
30
+ <view class="setting-row">
31
+ <view>{{ t('setting.log.exportNetwork') }}:</view>
32
+ <checkbox
33
+ :checked="setting.exportNetwork"
34
+ value="exportNetwork"
35
+ :color="themeColor"
36
+ style="transform: scale(0.8)" />
37
+ </view>
38
+ <view class="setting-tips">
39
+ {{ t('setting.log.exportNetworkTip') }}
40
+ </view>
41
+ <view class="setting-row">
42
+ <view>{{ t('setting.log.exportTransfer') }}:</view>
43
+ <checkbox
44
+ :checked="setting.exportTransfer"
45
+ value="exportTransfer"
46
+ :color="themeColor"
47
+ style="transform: scale(0.8)" />
48
+ </view>
49
+ <view class="setting-tips">
50
+ {{ t('setting.log.exportTransferTip') }}
51
+ </view>
52
+ <view class="setting-row">
53
+ <view>{{ t('setting.log.exportWebsocket') }}:</view>
54
+ <checkbox
55
+ :checked="setting.exportWebsocket"
56
+ value="exportWebsocket"
57
+ :color="themeColor"
58
+ style="transform: scale(0.8)" />
59
+ </view>
60
+ <view class="setting-tips">
61
+ {{ t('setting.log.exportWebsocketTip') }}
62
+ </view>
63
+ <view class="setting-row">
64
+ <view>{{ t('setting.log.exportStorage') }}:</view>
65
+ <checkbox
66
+ :checked="setting.exportStorage"
67
+ value="exportStorage"
68
+ :color="themeColor"
69
+ style="transform: scale(0.8)" />
70
+ </view>
71
+ <view class="setting-tips">
72
+ {{ t('setting.log.exportStorageTip') }}
73
+ </view>
74
+ <view class="setting-row">
75
+ <view>{{ t('setting.log.exportWindow') }}:</view>
76
+ <checkbox
77
+ :checked="setting.exportWindow"
78
+ value="exportWindow"
79
+ :color="themeColor"
80
+ style="transform: scale(0.8)" />
81
+ </view>
82
+ <view class="setting-tips">{{ t('setting.log.exportWindowTip') }}</view>
83
+
84
+ <view class="setting-row">
85
+ <view>{{ t('setting.log.exportDevice') }}:</view>
86
+ <checkbox
87
+ :checked="setting.exportDevice"
88
+ value="exportDevice"
89
+ :color="themeColor"
90
+ style="transform: scale(0.8)" />
91
+ </view>
92
+ <view class="setting-tips">{{ t('setting.log.exportDeviceTip') }}</view>
93
+
94
+ <view class="setting-row">
95
+ <view>{{ t('setting.log.exportSystem') }}:</view>
96
+ <checkbox
97
+ :checked="setting.exportSystem"
98
+ value="exportSystem"
99
+ :color="themeColor"
100
+ style="transform: scale(0.8)" />
101
+ </view>
102
+ <view class="setting-tips">{{ t('setting.log.exportSystemTip') }}</view>
103
+
104
+ <view class="setting-row">
105
+ <view>{{ t('setting.log.exportUniEvent') }}:</view>
106
+ <checkbox
107
+ :checked="setting.exportUniEvent"
108
+ value="exportUniEvent"
109
+ :color="themeColor"
110
+ style="transform: scale(0.8)" />
111
+ </view>
112
+ <view class="setting-tips">
113
+ {{ t('setting.log.exportUniEventTip') }}
114
+ </view>
115
+
116
+ <view class="setting-row">
117
+ <view>{{ t('setting.log.exportElEvent') }}:</view>
118
+ <checkbox
119
+ :checked="setting.exportElEvent"
120
+ value="exportElEvent"
121
+ :color="themeColor"
122
+ style="transform: scale(0.8)" />
123
+ </view>
124
+ <view class="setting-tips">
125
+ {{ t('setting.log.exportElEventTip') }}
126
+ </view>
127
+
128
+ <view class="setting-row">
129
+ <view>{{ t('setting.log.exportScanCodeList') }}:</view>
130
+ <checkbox
131
+ :checked="setting.exportScanCodeList"
132
+ value="exportScanCodeList"
133
+ :color="themeColor"
134
+ style="transform: scale(0.8)" />
135
+ </view>
136
+ <view class="setting-tips">
137
+ {{ t('setting.log.exportScanCodeListTip') }}
138
+ </view>
139
+
140
+ <view class="setting-row">
141
+ <view>{{ t('setting.log.exportNfcList') }}:</view>
142
+ <checkbox
143
+ :checked="setting.exportNfcList"
144
+ value="exportNfcList"
145
+ :color="themeColor"
146
+ style="transform: scale(0.8)" />
147
+ </view>
148
+ <view class="setting-tips">
149
+ {{ t('setting.log.exportNfcListTip') }}
150
+ </view>
151
+
152
+ <SettingButton @click="onExportLog">
153
+ {{ t('setting.log.export') }}
154
+ </SettingButton>
155
+ </view>
156
+ </checkbox-group>
157
+ </view>
158
+ </template>
159
+
160
+ <script setup lang="ts">
161
+ import { computed, reactive } from 'vue';
162
+ import DevToolTitle from '../../DevToolTitle/index.vue';
163
+ import SettingButton from '../../SettingButton/index.vue';
164
+ import { useI18n } from '../../../i18n';
165
+ import { getThemeMainColor } from '../../styles/theme';
166
+
167
+ const { t } = useI18n();
168
+ const themeColor = computed(() => getThemeMainColor(props.theme));
169
+
170
+ const setting = reactive({
171
+ exportLog: false,
172
+ exportNetwork: false,
173
+ exportTransfer: false,
174
+ exportStorage: false,
175
+ exportWebsocket: false,
176
+ exportWindow: false,
177
+ exportDevice: false,
178
+ exportSystem: false,
179
+ exportUniEvent: false,
180
+ exportElEvent: false,
181
+ exportScanCodeList: false,
182
+ exportNfcList: false,
183
+ });
184
+
185
+ const props = defineProps<{
186
+ theme?: string;
187
+ cacheConsoleLog?: boolean;
188
+ }>();
189
+
190
+ const emit = defineEmits<{
191
+ (e: 'exportLog', params: any): void;
192
+ (e: 'change-cache-console-log', value: boolean): void;
193
+ }>();
194
+
195
+ function onToggleCacheConsole() {
196
+ emit('change-cache-console-log', !props.cacheConsoleLog);
197
+ }
198
+
199
+ function onExportLog() {
200
+ if (
201
+ setting.exportLog ||
202
+ setting.exportNetwork ||
203
+ setting.exportStorage ||
204
+ setting.exportTransfer
205
+ ) {
206
+ emit('exportLog', { ...setting });
207
+ }
208
+ }
209
+
210
+ function onChangeSetting(e: any) {
211
+ const value = e.detail?.value ?? [];
212
+
213
+ setting.exportLog = value.includes('exportLog');
214
+ setting.exportNetwork = value.includes('exportNetwork');
215
+ setting.exportStorage = value.includes('exportStorage');
216
+ setting.exportWebsocket = value.includes('exportWebsocket');
217
+ setting.exportTransfer = value.includes('exportTransfer');
218
+ setting.exportWindow = value.includes('exportWindow');
219
+ setting.exportDevice = value.includes('exportDevice');
220
+ setting.exportSystem = value.includes('exportSystem');
221
+ setting.exportUniEvent = value.includes('exportUniEvent');
222
+ setting.exportElEvent = value.includes('exportElEvent');
223
+ setting.exportScanCodeList = value.includes('exportScanCodeList');
224
+ setting.exportNfcList = value.includes('exportNfcList');
225
+ }
226
+ </script>
227
+
228
+ <style scoped>
229
+ @import '../index.css';
230
+ </style>