Commit 1a22d103 authored by 高天阳's avatar 高天阳

面板文档

parent d26ead50
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
</div> </div>
<div :style="hmPanelHeight" :class="hmContentClass"> <div :style="hmPanelHeight" :class="hmContentClass">
<span>{{hmContentText}}</span> <span>{{hmContentText}}</span>
<hm-complex-detail :schema="schema['HmUser']" :tableId="userId" :columns="showFields"> <slot></slot>
</hm-complex-detail>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
...@@ -17,19 +16,15 @@ ...@@ -17,19 +16,15 @@
</template> </template>
<script> <script>
import HmComplexDetail from '../details/HmComplexDetail.vue'
import schema from '../../schemas/hm_org_schema'
import _ from 'lodash' import _ from 'lodash'
import request from '@/utils/request' import request from '@/utils/request'
export default { export default {
name: 'HmComplexDetail', name: 'HmComplexPanel',
// 继承其他组件 // 继承其他组件
extends: {}, extends: {},
// 使用其它组件 // 使用其它组件
components: { components: {},
'hm-complex-detail': HmComplexDetail
},
props: { props: {
/** /**
* 组件所使用的表定义schema。表定义schema,请使用 model2codejs 从pdm文件生成schema。 * 组件所使用的表定义schema。表定义schema,请使用 model2codejs 从pdm文件生成schema。
...@@ -65,39 +60,53 @@ ...@@ -65,39 +60,53 @@
return true return true
} }
}, },
/* /**
* 在详情页需要传入用户的id用来带出用户信息 * 在面板页传入面板标题
* */ */
userId: {
type: String,
required: true
},
hmTitle: { hmTitle: {
type: String, type: String,
required: false required: false
}, },
/**
* 在面板页传入标题类名
*/
hmTitleClass: { hmTitleClass: {
type: String, type: String,
required: false required: false
}, },
/**
* 在面板页传入内容类名
*/
hmContentClass: { hmContentClass: {
type: String, type: String,
required: false required: false
}, },
/**
* 在面板页传入内容
*/
hmContentText: { hmContentText: {
type: String, type: String,
required: false required: false
}, },
/**
* 在面板页传入面板样式
*/
hmStyle: { hmStyle: {
type: Object, type: Object,
required: false required: false
}, },
/**
* 在面板页传入面板内容高度
*/
hmPanelHeight: { hmPanelHeight: {
type: Object, type: Object,
required: false required: false
}, },
/**
* 在面板页传入面板宽度
*/
hmCollapse: { hmCollapse: {
type: null, type: String,
required: false required: false
}, },
showFields: { showFields: {
...@@ -116,11 +125,7 @@ ...@@ -116,11 +125,7 @@
}, },
filters: { filters: {
}, },
created() { created() {},
this.schema = schema
this.getList()
this.init()
},
methods: { methods: {
validate() { validate() {
const self = this const self = this
...@@ -189,8 +194,8 @@ ...@@ -189,8 +194,8 @@
} }
</script> </script>
<style scoped> <style scoped>
.title{ .weight{
text-align: center; font-weight: 700;
} }
.center{ .center{
text-align: center; text-align: center;
......
<template> <template>
<div> <div>
<hm-complex-panel :schema="schema['HmUser']" :userId="userId" :hmTitle="titleBak" :hmContentClass="hmContentClass" :showFields="showFields" <hm-complex-panel :schema="schema['HmUser']" :hmTitle="titleBak" :hmContentClass="hmContentClass"
:hmStyle="styleBak" :hmPanelHeight="panelHeightBak" :hmCollapse="collapseBak"> :hmStyle="styleBak" :hmPanelHeight="panelHeightBak" :hmCollapse="collapseBak">
</hm-complex-panel> </hm-complex-panel>
<hm-complex-panel :schema="schema['HmUser']" :userId="userId2" :hmTitle="hmTitle" :hmTitleClass="hmTitleClass" :showFields="showFields2" <hm-complex-panel :schema="schema['HmUser']" :hmTitle="hmTitle" :hmTitleClass="hmTitleClass"
:hmContentText="hmContentText" :hmStyle="hmStyle" :hmPanelHeight="hmPanelHeight" :hmCollapse="collapses"> :hmContentText="hmContentText" :hmStyle="hmStyle" :hmPanelHeight="hmPanelHeight" :hmCollapse="collapses">
</hm-complex-panel> </hm-complex-panel>
</div> </div>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script> <script>
import HmComplexPanel from './HmComplexPanel.vue' import HmComplexPanel from './HmComplexPanel.vue'
import schema from '../../schemas/hm_org_schema' import schema from '../../schemas/hm_org_schema'
import HmComplexDetail from '../details/HmComplexDetail.vue'
export default { export default {
name: 'HmComplexPanel', name: 'HmComplexPanel',
...@@ -19,7 +20,8 @@ ...@@ -19,7 +20,8 @@
extends: {}, extends: {},
// 使用其它组件 // 使用其它组件
components: { components: {
'hm-complex-panel': HmComplexPanel 'hm-complex-panel': HmComplexPanel,
'hm-complex-detail': HmComplexDetail
}, },
data() { data() {
return { return {
......
...@@ -28,7 +28,8 @@ const sections = [ ...@@ -28,7 +28,8 @@ const sections = [
return [ return [
'./src/views/haomo/components/tables/HmComplexTable.vue', './src/views/haomo/components/tables/HmComplexTable.vue',
'./src/views/haomo/components/forms/HmComplexForm.vue', './src/views/haomo/components/forms/HmComplexForm.vue',
'./src/views/haomo/components/details/HmComplexDetail.vue' './src/views/haomo/components/details/HmComplexDetail.vue',
'./src/views/haomo/components/panel/HmComplexPanel.vue'
] ]
} }
}, },
......
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