uni-oaview 1.4.2 → 1.5.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.
@@ -3,6 +3,7 @@
3
3
  <uni-collapse-item
4
4
  v-for="meta in audioLogMetas"
5
5
  :key="meta.id"
6
+ :name="meta.id"
6
7
  :title="meta.title"
7
8
  :class="{
8
9
  'uni-collapse-item-error': meta.isError,
@@ -41,7 +42,7 @@
41
42
  </template>
42
43
 
43
44
  <script lang="ts" setup>
44
- import { nextTick, onBeforeUnmount, ref, shallowRef } from 'vue';
45
+ import { nextTick, onBeforeUnmount, ref, shallowRef, watch } from 'vue';
45
46
  import awesomeDisplayInfo from './awesome-display-info.vue';
46
47
  import { audioSubject, getAudioLogs } from 'uniapp-log-sdk';
47
48
 
@@ -119,7 +120,8 @@
119
120
  const durationStr = duration > 0 ? duration.toFixed(2) : '-';
120
121
  return {
121
122
  id: buildAudioLogId(log),
122
- title: `[${shortTime}] ${action} - ${shortSrc} (${durationStr}s)`,
123
+ // ✅ 加入 [实例N] 标识,让用户清晰地看出不同实例的日志
124
+ title: `[实例${id}] [${shortTime}] ${action} - ${shortSrc} (${durationStr}s)`,
123
125
  instanceId: id,
124
126
  src,
125
127
  duration,
@@ -174,20 +176,26 @@
174
176
  upsertLogs(data);
175
177
  });
176
178
 
177
- // 展开项变化时刷新 collapse 高度缓存(小程序端必须手动调用,否则内容高度可能为 0)
178
- const unwatch = ref(() => {});
179
- unwatch.value = (() => {
180
- let lastActiveNames = getActiveNameList().join('|');
181
- return () => {
182
- const currentActiveNames = getActiveNameList().join('|');
183
- if (currentActiveNames !== lastActiveNames) {
184
- // #ifdef MP
185
- nextTick(() => collapseRef.value?.resize?.());
186
- // #endif
187
- lastActiveNames = currentActiveNames;
188
- }
189
- };
190
- })();
179
+ // 展开项变化时刷新 collapse 高度缓存(小程序端必须手动调用,否则内容高度可能为 0)
180
+ watch(
181
+ () => getActiveNameList().join('|'),
182
+ () => {
183
+ // #ifdef MP
184
+ nextTick(() => collapseRef.value?.resize?.());
185
+ // #endif
186
+ },
187
+ );
188
+
189
+ // 列表更新时,如果有已展开项(内容高度可能变化),同步刷新高度缓存
190
+ watch(
191
+ () => audioLogMetas.value,
192
+ () => {
193
+ // #ifdef MP
194
+ if (getActiveNameList().length) nextTick(() => collapseRef.value?.resize?.());
195
+ // #endif
196
+ },
197
+ { deep: false },
198
+ );
191
199
 
192
200
  onBeforeUnmount(() => {
193
201
  stop?.unsubscribe();
package/dist/index.d.ts CHANGED
@@ -319,6 +319,11 @@ declare function useCookieTempFileUrl(url: string): {
319
319
  tempUrl: _mp_rt1_vue___Ref<string>;
320
320
  };
321
321
 
322
+ /** 插件配置选项 */
323
+ interface PluginOptions {
324
+ /** 是否启用启动参数日志上报,默认 true */
325
+ enableLaunchLog?: boolean;
326
+ }
322
327
  declare const plugin: Plugin;
323
328
  /**
324
329
  * 向客户端获取数据
@@ -329,4 +334,4 @@ declare const plugin: Plugin;
329
334
  */
330
335
  declare function getDataByApp(eventName: string, params: Record<string, any>, immediate?: boolean): Promise<any>;
331
336
 
332
- export { CreateModalReturn, Message, MessageBox, ModalBaseEvents, ModalCloseReason, ModalHeaderEvents, ModalHeaderOptions, ModalOptions, RouteMethodName, VersionCheckRuntimeOptions, VersionCheckRuntimeState, VersionCheckSource, VersionCheckTriggerContext, closeAllModals, compareVersions, createDebounceFn, createModal, createVersionCheckRuntime, plugin as default, getAppVersion, getDataByApp, getTempFilePathForCookie, isCurrentVersionHigher, sendLaunchAppParamsLog, useCookieTempFileUrl, versionCheckRuntime };
337
+ export { CreateModalReturn, Message, MessageBox, ModalBaseEvents, ModalCloseReason, ModalHeaderEvents, ModalHeaderOptions, ModalOptions, PluginOptions, RouteMethodName, VersionCheckRuntimeOptions, VersionCheckRuntimeState, VersionCheckSource, VersionCheckTriggerContext, closeAllModals, compareVersions, createDebounceFn, createModal, createVersionCheckRuntime, plugin as default, getAppVersion, getDataByApp, getTempFilePathForCookie, isCurrentVersionHigher, sendLaunchAppParamsLog, useCookieTempFileUrl, versionCheckRuntime };
package/dist/index.esm.js CHANGED
@@ -3909,9 +3909,18 @@ function useCookieTempFileUrl(url) {
3909
3909
  }
3910
3910
 
3911
3911
  var install = function install(app) {
3912
+ for (var _len = arguments.length, options = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3913
+ options[_key - 1] = arguments[_key];
3914
+ }
3915
+ var _options$ = options[0],
3916
+ _options$2 = _options$ === void 0 ? {} : _options$,
3917
+ _options$2$enableLaun = _options$2.enableLaunchLog,
3918
+ enableLaunchLog = _options$2$enableLaun === void 0 ? true : _options$2$enableLaun;
3912
3919
  app.mixin({
3913
3920
  onLaunch: function onLaunch(params) {
3914
- sendLaunchAppParamsLog(params);
3921
+ if (enableLaunchLog) {
3922
+ sendLaunchAppParamsLog(params);
3923
+ }
3915
3924
  }
3916
3925
  });
3917
3926
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-oaview",
3
- "version": "1.4.02",
3
+ "version": "1.5.00",
4
4
  "description": "uniapp小程序组件库",
5
5
  "main": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "rollup-plugin-typescript2": "^0.27.2",
52
52
  "rollup-plugin-vue": "^6.0.0",
53
53
  "typescript": "^4.0.2",
54
- "uniapp-log-sdk": "^1.7.00"
54
+ "uniapp-log-sdk": "^1.7.1"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@dcloudio/uni-ui": "^1.5.11",
package/src/index.ts CHANGED
@@ -4,10 +4,20 @@ import { sendLaunchAppParamsLog } from './utils';
4
4
  export * from './utils';
5
5
  export * from './composables';
6
6
 
7
- const install = (app: App) => {
7
+ /** 插件配置选项 */
8
+ export interface PluginOptions {
9
+ /** 是否启用启动参数日志上报,默认 true */
10
+ enableLaunchLog?: boolean;
11
+ }
12
+
13
+ const install = (app: App, ...options: any[]) => {
14
+ const [{ enableLaunchLog = true } = {}] = options;
15
+
8
16
  app.mixin({
9
17
  onLaunch(params: any) {
10
- sendLaunchAppParamsLog(params);
18
+ if (enableLaunchLog) {
19
+ sendLaunchAppParamsLog(params);
20
+ }
11
21
  },
12
22
  });
13
23
  };