parent
6b1522d065
commit
0e9633ad02
@ -1,74 +1,54 @@ |
||||
<template> |
||||
<el-dialog |
||||
v-drag-dialog |
||||
v-bind="$props" |
||||
v-on="$listeners" |
||||
:visible="value" |
||||
custom-class="form-dialog" |
||||
> |
||||
<slot slot="title" name="title">{{title}}</slot> |
||||
|
||||
<div class="form-dialog-container"> |
||||
<loading-mask :show="loading"/> |
||||
<el-scrollbar> |
||||
<div class="form-dialog-body"> |
||||
<slot/> |
||||
</div> |
||||
<div style="margin-bottom: 17px"/> |
||||
</el-scrollbar> |
||||
</div> |
||||
|
||||
<slot slot="footer" name="footer"/> |
||||
</el-dialog> |
||||
</template> |
||||
|
||||
<script> |
||||
<script type="text/jsx"> |
||||
import LoadingMask from '@/components/LoadingMask' |
||||
|
||||
export default { |
||||
name: "FormDialog", |
||||
|
||||
components: {LoadingMask}, |
||||
functional: true, |
||||
|
||||
props: { |
||||
value: Boolean, |
||||
appendToBody: Boolean, |
||||
top: {type: String, default: '50px'}, |
||||
width: {type: String, default: '30%'}, |
||||
loading: {type: Boolean, default: true}, |
||||
title: String, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.form-dialog { |
||||
.el-dialog__body { |
||||
padding: 0; |
||||
} |
||||
loading: {type: Boolean, default: true}, |
||||
top: {type: String, default: '50px'}, |
||||
width: {type: String, default: '30%'} |
||||
}, |
||||
|
||||
.form-dialog-container { |
||||
position: relative; |
||||
width: 100%; |
||||
render(h, context) { |
||||
const {value, title, loading, top, width} = context.props |
||||
const l = context.listeners |
||||
|
||||
.form-dialog-body { |
||||
padding: 24px 24px 0 |
||||
function onClose() { |
||||
l.input && l.input(false) |
||||
} |
||||
|
||||
.el-form { |
||||
padding: 0; |
||||
} |
||||
|
||||
.el-upload.el-upload--picture-card { |
||||
height: 100px; |
||||
width: 100px; |
||||
line-height: 105px; |
||||
} |
||||
|
||||
.el-upload-list .el-upload-list__item { |
||||
height: 100px; |
||||
width: 100px; |
||||
} |
||||
return ( |
||||
<el-dialog |
||||
v-drag-dialog |
||||
visible={value} |
||||
custom-class="form-dialog" |
||||
top={top} |
||||
width={width} |
||||
on-close={onClose} |
||||
{...context.data} |
||||
> |
||||
<slot slot="title" name="title">{title}</slot> |
||||
|
||||
<div class="form-dialog-container"> |
||||
<LoadingMask show={loading}/> |
||||
<el-scrollbar> |
||||
<div class="form-dialog-body"> |
||||
{context.children} |
||||
</div> |
||||
<div style="margin-bottom: 17px"/> |
||||
</el-scrollbar> |
||||
</div> |
||||
|
||||
<slot slot="footer" name="footer"/> |
||||
</el-dialog> |
||||
) |
||||
} |
||||
} |
||||
</style> |
||||
</script> |
||||
|
||||
<style lang="scss" src="./style.scss"></style> |
||||
|
||||
@ -0,0 +1,29 @@ |
||||
.form-dialog { |
||||
.el-dialog__body { |
||||
padding: 0; |
||||
} |
||||
|
||||
.form-dialog-container { |
||||
position: relative; |
||||
width: 100%; |
||||
|
||||
.form-dialog-body { |
||||
padding: 24px 24px 0 |
||||
} |
||||
|
||||
.el-form { |
||||
padding: 0; |
||||
} |
||||
|
||||
.el-upload.el-upload--picture-card { |
||||
height: 100px; |
||||
width: 100px; |
||||
line-height: 105px; |
||||
} |
||||
|
||||
.el-upload-list .el-upload-list__item { |
||||
height: 100px; |
||||
width: 100px; |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue