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
| <template>
| <el-dialog class="ztzf-dialog-mange" append-to-body v-model="props.isShowView" :title="props.title"
| :width="props.width" :close-on-click-modal="false" :destroy-on-close="true" @close="cancel">
| <slot name="default" />
| <template #footer v-if="props.addEditView !== 'view'">
| <div class="dialog-footer">
| <el-button v-if="props.addEditView === 'add'" type="primary" @click="submit" :icon="CirclePlus">保存</el-button>
| <el-button v-else type="primary" @click="submit" :icon="CircleCheck">确认</el-button>
| <el-button @click="cancel" :icon="CircleClose">取消</el-button>
| </div>
| </template>
| </el-dialog>
| </template>
| <script setup>
| import { ElMessage } from 'element-plus'
| import { Delete, Search, CircleCheck, CircleClose, CirclePlus } from '@element-plus/icons-vue'
| import { defineEmits } from 'vue';
|
| const emit = defineEmits(['cancel', 'confirm']);
|
| const props = defineProps({
| width: {
| type: String,
| default: '800'
| },
| isShowView: {
| type: Boolean,
| default: false
| },
| addEditView: {
| type: String,
| default: 'add'
| },
| title:{
| type: String,
| default: ''
| }
| })
|
| function submit() {
| emit('submit')
| }
| function cancel() {
| emit('cancel')
| }
| </script>
| <style scoped lang="scss">
| </style>
|
|