vue2-client 1.20.70 → 1.20.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.20.70",
3
+ "version": "1.20.72",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -31,7 +31,7 @@
31
31
  "@microsoft/fetch-event-source": "^2.0.1",
32
32
  "@vue/babel-preset-jsx": "^1.4.0",
33
33
  "animate.css": "^4.1.1",
34
- "ant-design-vue": "npm:@afwenming123/ant-design-vue@1.7.10",
34
+ "ant-design-vue": "npm:@afwenming123/ant-design-vue@1.7.12",
35
35
  "axios": "^0.27.2",
36
36
  "clipboard": "^2.0.11",
37
37
  "core-js": "^3.33.0",
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  import { shortcutManager } from '@vue2-client/base-client/utils/shortcutManager'
25
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
25
+ // import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
26
26
 
27
27
  const log = (env => {
28
28
  if (env !== 'development') return () => {}
@@ -356,23 +356,26 @@ export const shortcutMixin = {
356
356
  log('reg', `✅ 注册 ${key} → scope=${scopeId} cellRef=${cellConfig.slotRef || '-'}`)
357
357
  },
358
358
 
359
+ // createShortcutContext(cellConfig, eventConfig, eventIndex, shortcutKey) {
360
+ // return {
361
+ // ...this,
362
+ // getComponent: (ref) => this.shortcutGetComponent(ref),
363
+ // findComponent: (ref) => this.shortcutFindComponent(ref),
364
+ // cellConfig,
365
+ // eventConfig,
366
+ // eventIndex,
367
+ // slotRef: cellConfig.slotRef,
368
+ // shortcutKey, // ✅ 新增:触发的快捷键
369
+ // triggerEvent: (type, ...args) => {
370
+ // const event = cellConfig.events?.find(e => e.type === type)
371
+ // if (event?.customFunction) {
372
+ // executeStrFunctionByContext(this, event.customFunction, args)
373
+ // }
374
+ // }
375
+ // }
376
+ // },
359
377
  createShortcutContext(cellConfig, eventConfig, eventIndex, shortcutKey) {
360
- return {
361
- ...this,
362
- getComponent: (ref) => this.shortcutGetComponent(ref),
363
- findComponent: (ref) => this.shortcutFindComponent(ref),
364
- cellConfig,
365
- eventConfig,
366
- eventIndex,
367
- slotRef: cellConfig.slotRef,
368
- shortcutKey, // ✅ 新增:触发的快捷键
369
- triggerEvent: (type, ...args) => {
370
- const event = cellConfig.events?.find(e => e.type === type)
371
- if (event?.customFunction) {
372
- executeStrFunctionByContext(this, event.customFunction, args)
373
- }
374
- }
375
- }
378
+ return this
376
379
  },
377
380
 
378
381
  // ========== 组件查找 ==========
@@ -757,7 +757,7 @@ class ShortcutManager {
757
757
  if (!normalizedKey) return
758
758
 
759
759
  const entry = {
760
- action, scope, context, cellRef, isActive, instanceId,
760
+ action, scope, context, cellRef, isActive, instanceId, key,
761
761
  registeredAt: Date.now()
762
762
  }
763
763
 
@@ -918,16 +918,11 @@ class ShortcutManager {
918
918
  * @param {KeyboardEvent} keyboardEvent 原始键盘事件
919
919
  */
920
920
  executeEvent(entry, keyboardEvent) {
921
- const { action, context } = entry
921
+ const { action, context, key } = entry
922
922
  if (!action?.customFunction) return
923
923
 
924
924
  try {
925
- // 传递 keyboardEvent 和 shortcutKey
926
- executeStrFunctionByContext(
927
- context,
928
- action.customFunction,
929
- [keyboardEvent, context.shortcutKey || entry.key]
930
- )
925
+ executeStrFunctionByContext(context, action.customFunction, [keyboardEvent, key])
931
926
  } catch (err) {
932
927
  log('error', `❌ 执行失败: ${err.message}`)
933
928
  }