Commit 7ba18986 authored by 高天阳's avatar 高天阳

面板组件

parent 35ae3924
<template> <template>
<el-row type="flex"> <el-row type="flex">
<el-col :span="24" class="detail-content" style="margin:0 50px;"> <el-col :span="hmCollapse" class="detail-content" style="margin:0 auto">
<h2 class="title">面板页面</h2> <h2 class="title">面板页面</h2>
<el-card class="box-card"> <el-card class="box-card" :style="hmStyle">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix" :class="hmTitleClass">
<span>这是面板Demo</span> <span>{{hmTitle}}</span>
</div> </div>
<div style="height:100px;"> <div :style="hmPanelHeight" :class="hmContentClass">
<el-form :data="detail" label-width="110px" status-icon style="width:80%;margin:0 auto"> <span>{{hmContentText}}</span>
<el-form-item v-for="(column,index) in showColumns" :key="index" :label="column.name"> <!--<el-form :data="detail" label-width="110px" status-icon style="width:80%;margin:0 auto">-->
<div>{{detail[column.codeCamel]}}</div> <!--<el-form-item v-for="(column,index) in showColumns" :key="index" :label="column.name">-->
</el-form-item> <!--<div>{{detail[column.codeCamel]}}</div>-->
</el-form> <!--</el-form-item>-->
<!--</el-form>-->
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
...@@ -69,6 +70,34 @@ ...@@ -69,6 +70,34 @@
userId: { userId: {
type: null, type: null,
required: true required: true
},
hmTitle: {
type: null,
required: false
},
hmTitleClass: {
type: null,
required: false
},
hmContentClass: {
type: null,
required: false
},
hmContentText: {
type: null,
required: false
},
hmStyle: {
type: Object,
required: false
},
hmPanelHeight: {
type: Object,
required: false
},
hmCollapse: {
type: null,
required: false
} }
}, },
data() { data() {
...@@ -157,4 +186,7 @@ ...@@ -157,4 +186,7 @@
.title{ .title{
text-align: center; text-align: center;
} }
.center{
text-align: center;
}
</style> </style>
<template> <template>
<div> <div>
<hm-complex-panel :schema="schema['HmUser']" :userId="userId"> <hm-complex-panel :schema="schema['HmUser']" :userId="userId" :hmTitle="hmTitle" :hmTitleClass="hmTitleClass"
:hmContentText="hmContentText" :hmStyle="hmStyle" :hmPanelHeight="hmPanelHeight" :hmCollapse="collapses">
</hm-complex-panel> </hm-complex-panel>
<hm-complex-panel :schema="schema['HmUser']" :userId="userId" :columns="showUserColumns"> <hm-complex-panel :schema="schema['HmUser']" :userId="userId" :hmTitle="titleBak" :hmContentClass="hmContentClass" :showFields="showFields"
:hmContentText="hmContentTextBak" :hmStyle="styleBak" :hmPanelHeight="panelHeightBak" :hmCollapse="collapseBak">
</hm-complex-panel> </hm-complex-panel>
</div> </div>
</template> </template>
...@@ -21,7 +23,7 @@ ...@@ -21,7 +23,7 @@
}, },
data() { data() {
return { return {
showUserColumns: ['mobile', 'loginid'] showFields: ['username', 'loginid', 'password', 'mobile', 'email']
} }
}, },
computed: { computed: {
...@@ -31,6 +33,31 @@ ...@@ -31,6 +33,31 @@
created() { created() {
this.schema = schema this.schema = schema
this.userId = '0e26566e953449a7a7500c34be39fd26' this.userId = '0e26566e953449a7a7500c34be39fd26'
this.hmTitle = '面版名称'
this.hmTitleClass = 'center'
this.hmContentClass = 'center'
this.hmContentText = '面板文字'
this.hmStyle = {
width: '50%',
background: '#42b983',
margin: '0 auto'
}
this.hmPanelHeight = {
height: '100px'
}
this.collapses = 12
this.showFields = ['username', 'loginid', 'password', 'mobile', 'email']
this.titleBak = '测试面板'
this.hmContentTextBak = '我测试一下'
this.styleBak = {
width: '100%',
background: '#f56c6c',
marginBottom: '20px'
}
this.panelHeightBak = {
height: '200px'
}
this.collapseBak = 22
}, },
methods: {} methods: {}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment