Parcourir la source

fix:增加loading解决重复提交问题

liuzhenlin il y a 1 jour
Parent
commit
45959413ca
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      src/view/entry/add.vue

+ 5 - 0
src/view/entry/add.vue

@@ -184,6 +184,8 @@
           class="w100"
           type="primary"
           round
+          :disabled="confirmDisabled"
+          :loading="confirmDisabled"
           @click="confirmAppoint"
         >
           我知道了
@@ -219,6 +221,7 @@
   const userTypeList = ref(<RowDicDataType[]>[])
   const platformApi = usePlatformApi()
   const platformList = ref()
+  const confirmDisabled = ref(false)
   const state = reactive({
     safePromise: false,
     safeRead: false,
@@ -272,7 +275,9 @@
   })
 
   const confirmAppoint = async () => {
+    confirmDisabled.value = true
     const [err]: ToResponse = await to(platformAppointApi.create(createEntryPayload.value))
+    confirmDisabled.value = false
     if (err) {
       state.needToKnowShow = false
       return