wujingjing
2024-08-29 19b778d2d04bed31ce2e1f167c6ff2fda9906421
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
<template>
    <el-dialog
        :destroy-on-close="destroyOnClose"
        v-model="isShow"
        draggable
        :width="width"
        :close-on-click-modal="false"
        @closed="handleClosedClick"
    >
        <template #header>
            <div style="color: #fff">
                <SvgIcon
                    v-if="showHeaderIcon || !headerIcon"
                    :name="headerIcon"
                    :size="16"
                    style="margin-right: 3px; display: inline; vertical-align: middle"
                />
                <span> {{ title }} </span>
            </div>
        </template>
        <slot></slot>
        <template #footer v-if="showFooter">
            <div>
                <el-button @click="handleCloseClick">取 消</el-button>
                <el-button type="primary" @click="handleSubmitClick">确 定</el-button>
            </div>
        </template>
    </el-dialog>
</template>
 
<script setup lang="ts">
import { computed, toRef } from 'vue';
import { useYWDialog } from '/@/components/dialog/use-yw-dialog';
import { YWDialogEmits, YWDialogProps } from '/@/components/dialog/yw-dialog';
 
const props = defineProps(YWDialogProps);
const emits = defineEmits(YWDialogEmits);
const modelValue = toRef(props, 'modelValue');
 
const isShow = computed({
    get() {
        return modelValue.value;
    },
    set(value) {
        emits('update:modelValue', value);
    },
});
const { handleCloseClick, handleSubmitClick, handleClosedClick } = useYWDialog(props, emits);
</script>
<style scoped lang="scss"></style>