index.vue
1.64 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
<template>
<el-dialog v-dialogDrag :close-on-click-modal="false"
:visible.sync="dialogVisible"
:width="width"
@close="closeDialog('ruleForm')"
:fullscreen="fullscreen"
:top="topHeight"
:lock-scroll="true"
:close-on-click-modal="false"
custom-class="dialogBox"
>
<div slot="title" class="dialog_title">
<b>{{title}}</b>
<i class="el-icon-full-screen" @click="handleFullscreen" />
</div>
<div class="dialogBox-content">
<slot></slot>
</div>
<div slot="footer" class="dialog_footer">
<el-button type="primary" size="small" @click="submitForm('ruleForm')">保存</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
<el-button size="small" @click="closeDialog('ruleForm')">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: {
width: {
type: String,
default: '70%'
},
title: {
type: String,
default: ''
},
topHeight: {
type: String,
default: '15vh'
},
},
data() {
return {
dialogVisible: false,
fullscreen: false
}
},
methods: {
isShow() {
this.dialogVisible = true;
},
isHide() {
this.dialogVisible = false;
},
handleFullscreen() {
this.fullscreen = !this.fullscreen;
},
submitForm(ruleForm) {
this.$parent.submitForm(ruleForm);
},
resetForm(ruleForm) {
this.$parent.resetForm(ruleForm);
},
closeDialog(ruleForm) {
this.$parent.closeDialog(ruleForm);
},
}
};
</script>
<style rel="stylesheet/less" lang="less">
@import "./index.less";
</style>