| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 | 
							- <template>
 
-   <!-- 对话框共用组件 -->
 
-   <v-dialog
 
-     style="z-index: var(--zIndex-dialog)"
 
-     v-model="show"
 
-     persistent
 
-     v-bind="$attrs"
 
-     :fullscreen="props.showDrawer"
 
-     :max-width="dialogWidth"
 
-     :width="dialogWidth"
 
-   >
 
-     <v-card max-height="90vh" class="d-flex flex-column">
 
-       <v-card-title :class="{'drawer': props.showDrawer}">
 
-         <!-- text-h6  h5 -->
 
-         <span class="d-flex align-center justify-space-between" :class="[props.titleClass]">
 
-           {{ props.title }}
 
-           <v-btn
 
-             icon
 
-             elevation="0"
 
-             @click="handleClose"
 
-           >
 
-             <v-icon :color="props.showDrawer ? '#fff' : '#000'">
 
-               mdi-close
 
-             </v-icon>
 
-           </v-btn>
 
-         </span>
 
-       </v-card-title>
 
-       <v-divider></v-divider>
 
-       <v-card-text class="flex-grow-1 overflow-y-auto" :class="{ 'd-flex': props.flexBox }" :style="props.bodyStyle">
 
-         <slot></slot>
 
-       </v-card-text>
 
-       <template v-if="props.footer">
 
-         <v-divider></v-divider>
 
-         <v-card-actions>
 
-           <v-spacer></v-spacer>
 
-           <v-btn
 
-             color="primary"
 
-             text
 
-             @click="handleClose"
 
-           >
 
-             取消
 
-           </v-btn>
 
-           <v-btn
 
-             color="primary"
 
-             text
 
-             @click="handleSave"
 
-           >
 
-             提交
 
-           </v-btn>
 
-         </v-card-actions>
 
-       </template>
 
-       <template v-else>
 
-         <slot name="footer"></slot>
 
-       </template>
 
-     </v-card>
 
-   </v-dialog>
 
- </template>
 
- <script setup>
 
- import { ref, defineEmits, computed, watch  } from 'vue'
 
- defineOptions({ name: 'components-ct-dialog' })
 
- const emits = defineEmits(['update:visible', 'close', 'submit'])
 
- const props = defineProps({
 
-   titleClass: {
 
-     type: String,
 
-     default: 'text-h5'
 
-   },
 
-   bodyStyle: {
 
-     type: String,
 
-     default: ''
 
-   },
 
-   widthType: {
 
-     type: [Number, String],
 
-     default: 0
 
-   },
 
-   title: {
 
-     type: String,
 
-     default: '提示'
 
-   },
 
-   visible: {
 
-     type: Boolean,
 
-     default: false
 
-   },
 
-   footer: {
 
-     type: Boolean,
 
-     default: true
 
-   },
 
-   showDrawer: {
 
-     type: Boolean,
 
-     default: false
 
-   },
 
-   flexBox: {
 
-     type: Boolean,
 
-     default: false
 
-   }
 
- })
 
- const show = ref(false)
 
- watch(() => props.visible, (newVal) => {
 
-   show.value = newVal
 
- })
 
- const dialogWidth = computed(() => {
 
-   const arr = ['900px', '1200px', '400px', '600px']
 
-   return arr[+props.widthType]
 
- })
 
- const handleClose = () => {
 
-   // emits('update:visible', false)
 
-   emits('close', false)
 
- }
 
- const handleSave = () => {
 
-   emits('submit', false)
 
- }
 
- </script>
 
- <style lang="scss" scoped>
 
- .drawer{
 
-   color: #fff;
 
-   background-color: #1976d2;
 
- }
 
- // ::v-deep .v-dialog:not(.v-dialog--fullscreen) {
 
- //   overflow: visible !important;
 
- // }
 
- </style>
 
 
  |