<template> | <template> | ||||
<Modal | <Modal | ||||
:options="getModalOptions" | :options="getModalOptions" | ||||
:on-positive-click="handleConfirm" | |||||
:on-positive-click="throttleFn" | |||||
:on-negative-click="handleClose" | :on-negative-click="handleClose" | ||||
:on-close="handleClose" | :on-close="handleClose" | ||||
> | > | ||||
import { defineComponent, ref, reactive, computed, toRefs } from 'vue' | import { defineComponent, ref, reactive, computed, toRefs } from 'vue' | ||||
import Modal from '@/components/Modal/index.vue' | import Modal from '@/components/Modal/index.vue' | ||||
import { assignOrder } from '@/api/order/index.js' | import { assignOrder } from '@/api/order/index.js' | ||||
import { throttle } from '@/utils/index.js' | |||||
export default defineComponent({ | export default defineComponent({ | ||||
name: 'UserModal', | name: 'UserModal', | ||||
components: { Modal }, | components: { Modal }, | ||||
}) | }) | ||||
} | } | ||||
const throttleFn = throttle(handleConfirm, 5000) | |||||
/* 关闭弹窗 */ | /* 关闭弹窗 */ | ||||
const handleClose = () => { | const handleClose = () => { | ||||
emit('update:visible', false) | emit('update:visible', false) | ||||
formRef, | formRef, | ||||
getModalOptions, | getModalOptions, | ||||
getFormOptions, | getFormOptions, | ||||
handleConfirm, | |||||
throttleFn, | |||||
handleClose | handleClose | ||||
} | } | ||||
} | } |
<template> | <template> | ||||
<Modal | <Modal | ||||
:options="getModalOptions" | :options="getModalOptions" | ||||
:on-positive-click="handleConfirm" | |||||
:on-positive-click="throttleFn" | |||||
:on-negative-click="handleClose" | :on-negative-click="handleClose" | ||||
:on-close="handleClose" | :on-close="handleClose" | ||||
> | > | ||||
import Modal from '@/components/Modal/index.vue' | import Modal from '@/components/Modal/index.vue' | ||||
import UploadOss from '@/components/UploadOss/index.vue' | import UploadOss from '@/components/UploadOss/index.vue' | ||||
import { handleOrder } from '@/api/order/index.js' | import { handleOrder } from '@/api/order/index.js' | ||||
import { throttle } from '@/utils/index.js' | |||||
export default defineComponent({ | export default defineComponent({ | ||||
name: 'UserModal', | name: 'UserModal', | ||||
components: { Modal, UploadOss }, | components: { Modal, UploadOss }, | ||||
}) | }) | ||||
} | } | ||||
const throttleFn = throttle(handleConfirm, 5000) | |||||
/* 关闭弹窗 */ | /* 关闭弹窗 */ | ||||
const handleClose = () => { | const handleClose = () => { | ||||
emit('update:visible', false) | emit('update:visible', false) | ||||
getFormOptions, | getFormOptions, | ||||
ossRefs, | ossRefs, | ||||
handleUploadStatus, | handleUploadStatus, | ||||
handleConfirm, | |||||
throttleFn, | |||||
handleClose | handleClose | ||||
} | } | ||||
} | } |