All files / components/popup DeletePopupV2.vue

76.66% Statements 46/60
100% Branches 0/0
0% Functions 0/1
76.66% Lines 46/60

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 611x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                             1x  
<template>
    <q-dialog v-model="open" @hide="onHide(false)" transition-show="scale" transition-hide="scale">
      <q-card class="height-auto" style="border-radius: 20px">
        <div class="center">
          <q-icon :name="`img:/${popupFlag(status).img}`" class="q-mt-sm" size="150px"/>
          <q-card-section class="q-pa-none">
            <div class="text-h3 text-25 text-bold w-90">{{popupFlag(status).title}}</div>
          </q-card-section>
          <q-card-section class="q-pa-none">
            <div class="content">{{popupFlag(status).body}}</div>
          </q-card-section>
          <q-card-actions align="between" flat class="w-78 q-pt-lg q-pb-lg">
            <q-btn 
              class="btn" 
              :class="popupFlag(status).class" 
              flat 
              @click="isApprove(status)"
              :label="popupFlag(status).label" 
              v-close-popup
            />
            <q-btn 
              flat
              class="btn q-ml-lg" 
              :class="status=='approve'?'green-border':'red-border'" 
              label="Cancel" 
              @click="onHide(false)"
              v-close-popup/>
          </q-card-actions>
        </div>
      </q-card>
    </q-dialog>
  </template>
  
  <script lang="ts">
import { popupFlag } from "@/common/function";
  export default {
      props: {
          open: Boolean,
          status: String
      },
      emits:[
        'on-change',
        'on-hide'
      ],
      setup(props:any,context:any){
          return{
            popupFlag,
            onHide(e:any){
              context.emit('on-hide', e)
            },
            isApprove(status:string){
              if(status=='reject'){
                context.emit('on-change', false)
              }else
               context.emit('on-change', true)
            }
          }
      }
  }
  </script>