@@ -1,7 +1,7 @@ | |||
<template> | |||
<Modal | |||
:options="getModalOptions" | |||
:on-positive-click="handleConfirm" | |||
:on-positive-click="throttleFn" | |||
:on-negative-click="handleClose" | |||
:on-close="handleClose" | |||
> | |||
@@ -30,6 +30,7 @@ import { form, getUserOptions } from '../tools/form.js' | |||
import { defineComponent, ref, reactive, computed, toRefs } from 'vue' | |||
import Modal from '@/components/Modal/index.vue' | |||
import { assignOrder } from '@/api/order/index.js' | |||
import { throttle } from '@/utils/index.js' | |||
export default defineComponent({ | |||
name: 'UserModal', | |||
components: { Modal }, | |||
@@ -100,6 +101,8 @@ export default defineComponent({ | |||
}) | |||
} | |||
const throttleFn = throttle(handleConfirm, 5000) | |||
/* 关闭弹窗 */ | |||
const handleClose = () => { | |||
emit('update:visible', false) | |||
@@ -109,7 +112,7 @@ export default defineComponent({ | |||
formRef, | |||
getModalOptions, | |||
getFormOptions, | |||
handleConfirm, | |||
throttleFn, | |||
handleClose | |||
} | |||
} |
@@ -1,7 +1,7 @@ | |||
<template> | |||
<Modal | |||
:options="getModalOptions" | |||
:on-positive-click="handleConfirm" | |||
:on-positive-click="throttleFn" | |||
:on-negative-click="handleClose" | |||
:on-close="handleClose" | |||
> | |||
@@ -34,6 +34,7 @@ import { defineComponent, ref, reactive, computed, toRefs } from 'vue' | |||
import Modal from '@/components/Modal/index.vue' | |||
import UploadOss from '@/components/UploadOss/index.vue' | |||
import { handleOrder } from '@/api/order/index.js' | |||
import { throttle } from '@/utils/index.js' | |||
export default defineComponent({ | |||
name: 'UserModal', | |||
components: { Modal, UploadOss }, | |||
@@ -153,6 +154,8 @@ export default defineComponent({ | |||
}) | |||
} | |||
const throttleFn = throttle(handleConfirm, 5000) | |||
/* 关闭弹窗 */ | |||
const handleClose = () => { | |||
emit('update:visible', false) | |||
@@ -164,7 +167,7 @@ export default defineComponent({ | |||
getFormOptions, | |||
ossRefs, | |||
handleUploadStatus, | |||
handleConfirm, | |||
throttleFn, | |||
handleClose | |||
} | |||
} |