
<template>
    <q-dialog v-model="dialogFlag" persistent>
        <q-card class="shadow-24">
            <!-- <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
                <div>{{ $t('delete') }}</div>
                <q-space />
                <q-btn dense flat icon="close" v-close-popup>
                    <q-tooltip content-class="bg-amber text-black shadow-4">{{ $t('index.close') }}</q-tooltip>
                </q-btn>
            </q-bar> -->
            <q-card-section class="row items-center">
                <q-avatar icon="warning" color="warning" text-color="white" />
                <div :class="'q-ml-sm ' + color">
                    {{ props.tip !== '' ? props.tip : $t('delete') }}
                </div>
            </q-card-section>
            <q-card-actions align="right">
                <q-btn flat label="取消" v-close-popup />
                <q-btn flat :label="$t('confirm')" @click="submitForm" color="primary" v-close-popup />
            </q-card-actions>
            <!-- <div style="float: right; padding: 15px 15px 15px 0">
                <q-btn color="white" text-color="black" style="margin-right: 25px"
                    @click="() => { dialogFlag = false }">{{
                        $t('cancel')
                    }}</q-btn>
                <q-btn color="primary" @click="submitForm()">{{ $t('submit') }}</q-btn>
            </div> -->
        </q-card>
    </q-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const dialogFlag = ref(false);
const emit = defineEmits(['func']);
const props = defineProps({
    tip: {
        type: String,
        default: ''
    },
    color: {
        type: String,
        default: ''
    }
});
const Obj = ref()
const open = (e?: any) => {
    dialogFlag.value = true;
    Obj.value = e
}
const submitForm = () => {
    emit('func', Obj.value)
    dialogFlag.value = false;
}
defineExpose({
    open
})
</script>