|
@@ -24,20 +24,25 @@ const layouts = {
|
|
|
const { activeItem } = this.$listeners
|
|
|
const config = currentItem.__config__
|
|
|
const child = renderChildren.apply(this, arguments)
|
|
|
+ console.log('col-layout--2222--', child, config)
|
|
|
let className = this.activeId === config.formId ? 'drawing-item active-from-item' : 'drawing-item'
|
|
|
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered'
|
|
|
let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
|
|
|
if (config.showLabel === false) labelWidth = '0'
|
|
|
return (
|
|
|
- <el-col span={config.span} class={className}
|
|
|
- nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}>
|
|
|
+ <el-form-item
|
|
|
+ class={className}
|
|
|
+ label-width={labelWidth}
|
|
|
+ label={config.showLabel ? config.label : ''} required={config.required}
|
|
|
+ nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}
|
|
|
+ >
|
|
|
<render key={config.renderKey} conf={currentItem} onInput={ event => {
|
|
|
this.$set(config, 'defaultValue', event)
|
|
|
}}>
|
|
|
{child}
|
|
|
</render>
|
|
|
- {components.itemBtns.apply(this, arguments)}
|
|
|
- </el-col>
|
|
|
+ {components.itemBtns.apply(this, arguments)}
|
|
|
+ </el-form-item>
|
|
|
)
|
|
|
},
|
|
|
rowFormItem(h, currentItem, index, list) {
|
|
@@ -66,16 +71,35 @@ const layouts = {
|
|
|
</el-col>
|
|
|
)
|
|
|
},
|
|
|
- raw(h, currentItem, index, list) {
|
|
|
+ form(h, currentItem, index, list) {
|
|
|
+ const { activeItem } = this.$listeners
|
|
|
const config = currentItem.__config__
|
|
|
+ const className = this.activeId === config.formId
|
|
|
+ ? 'drawing-row-item active-from-item'
|
|
|
+ : 'drawing-row-item'
|
|
|
const child = renderChildren.apply(this, arguments)
|
|
|
- return <render key={config.renderKey} conf={currentItem} onInput={ event => {
|
|
|
- this.$set(config, 'defaultValue', event)
|
|
|
- }}>
|
|
|
- {child}
|
|
|
- </render>
|
|
|
+ console.log('child---', child, config, config.children, arguments)
|
|
|
+ return (
|
|
|
+ <el-form
|
|
|
+ size={currentItem.size}
|
|
|
+ inline={currentItem.inline}
|
|
|
+ class={`${currentItem.class} ${className}`}
|
|
|
+ nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}
|
|
|
+ >
|
|
|
+ <span class="component-name">{config.componentName}</span>
|
|
|
+ <draggable
|
|
|
+ list={config.children || []}
|
|
|
+ animation={340}
|
|
|
+ class="drag-wrapper"
|
|
|
+ group="componentsGroup"
|
|
|
+ >
|
|
|
+ {child}
|
|
|
+ </draggable>
|
|
|
+ {components.itemBtns.apply(this, arguments)}
|
|
|
+ </el-form>
|
|
|
+ )
|
|
|
},
|
|
|
- auto(h, currentItem, index, list) {
|
|
|
+ raw(h, currentItem, index, list) {
|
|
|
const config = currentItem.__config__
|
|
|
const child = renderChildren.apply(this, arguments)
|
|
|
return <render key={config.renderKey} conf={currentItem} onInput={ event => {
|
|
@@ -88,9 +112,12 @@ const layouts = {
|
|
|
|
|
|
function renderChildren(h, currentItem, index, list) {
|
|
|
const config = currentItem.__config__
|
|
|
+ console.log('render child 1', config)
|
|
|
if (!Array.isArray(config.children)) return null
|
|
|
+ console.log('render child 2', config.children)
|
|
|
return config.children.map((el, i) => {
|
|
|
const layout = layouts[el.__config__.layout]
|
|
|
+ console.log('render child 3', layout)
|
|
|
if (layout) {
|
|
|
return layout.call(this, h, el, i, config.children)
|
|
|
}
|