gd-web-core 0.0.9 → 0.0.10

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": "gd-web-core",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Vue 3 基座能力封装库 - 组件与工具函数",
5
5
  "type": "module",
6
6
  "files": [
@@ -31,7 +31,7 @@
31
31
  <script setup lang="ts">
32
32
  import { ref, reactive, onMounted, defineAsyncComponent, computed } from 'vue'
33
33
  import type { Component } from 'vue'
34
- import * as xlsx from '@/utils/xlsx'
34
+ import * as xlsx from '../../utils/xlsx'
35
35
  import '@surely-vue/table/dist/index.css';
36
36
  // import 'ant-design-vue/es/menu/style'
37
37
  // import 'ant-design-vue/es/dropdown/style'
@@ -204,7 +204,7 @@ export interface SliderCaptchaProps {
204
204
  }
205
205
 
206
206
  export interface SliderCaptchaEmits {
207
- (e: 'success'): void
207
+ (e: 'success', x: number): void
208
208
  (e: 'fail'): void
209
209
  (e: 'refresh'): void
210
210
  (e: 'close'): void
@@ -247,8 +247,8 @@ const {
247
247
  } = useSliderCaptcha({
248
248
  fetchImage: fetchImageFn,
249
249
  verify: verifyFn,
250
- onSuccess: () => {
251
- emit('success')
250
+ onSuccess: (x: number) => {
251
+ emit('success', x)
252
252
  if (isDialogMode.value) {
253
253
  setTimeout(() => {
254
254
  emit('close')
@@ -42,12 +42,6 @@ defineEmits<{
42
42
 
43
43
  function onBgLoad(event: Event) {
44
44
  img.value = event.target as HTMLImageElement
45
- console.log('onBgLoad', {
46
- width: img.value.naturalWidth,
47
- height: img.value.naturalHeight,
48
- currentWidth: img.value.width,
49
- currentHeight: img.value.height
50
- })
51
45
  }
52
46
 
53
47
  function onSliderLoad() {
@@ -4,7 +4,7 @@ import type { CaptchaData, VerifyResult } from './SliderCaptcha.vue'
4
4
  export interface UseSliderCaptchaOptions {
5
5
  fetchImage?: () => Promise<CaptchaData>
6
6
  verify?: (x: number) => Promise<VerifyResult>
7
- onSuccess?: () => void
7
+ onSuccess?: (x: number) => void
8
8
  onFail?: () => void
9
9
  getContainerWidth?: () => number
10
10
  }
@@ -213,7 +213,7 @@ export function useSliderCaptcha(options: UseSliderCaptchaOptions) {
213
213
 
214
214
  if (result) {
215
215
  state.success = true
216
- options.onSuccess?.()
216
+ options.onSuccess?.(state.offsetX)
217
217
  } else {
218
218
  // 验证失败:显示错误提示,等待1.5秒后再刷新,不显示刷新按钮
219
219
  state.error = true