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