Skip to content

Commit

Permalink
1. 拖拽项支持宽度设置
Browse files Browse the repository at this point in the history
  • Loading branch information
bplok20010 committed Jun 13, 2019
1 parent d9a65b1 commit f2f6788
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
6 changes: 5 additions & 1 deletion lib/panels/DesignPanel/PreviewItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ function (_React$Component) {
"droppable": isOver,
"dragging": isDragging // "drop-tips": canDrop,

})
}),
style: {
display: 'inline-block',
width: item.width || '100%'
}
}, placeholderPosition === 'top' && isOver && !isSortMode ? _react["default"].createElement(widget.PlaceholderPreview, null) : null, _react["default"].createElement("div", {
ref: connectDragSource,
className: (0, _classnames["default"])({
Expand Down
6 changes: 4 additions & 2 deletions lib/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
padding: 10px 0;
background: #efefef; }
.csos-form-designer-container .design-panel .design-layout-container {
width: 350px;
width: 800px;
height: 600px;
padding-bottom: 60px;
margin: 0 auto;
Expand Down Expand Up @@ -179,7 +179,9 @@
width: 300px;
padding: 10px;
background: #fff;
border-left: 1px solid #dedee4; }
border-left: 1px solid #dedee4;
overflow: auto;
font-size: 14px; }

.design-property-field {
margin-bottom: 15px; }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-design-core",
"version": "0.2.0",
"version": "0.3.0",
"description": "表单设计器",
"main": "lib/index.js",
"scripts": {
Expand Down
20 changes: 14 additions & 6 deletions src/panels/DesignPanel/PreviewItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,20 @@ class WidgetPreviewItem extends React.Component {
// const items = layout.getLayoutChildren(data.id);

return connectDropTarget(
<div className={cx({
"widget-preview-item-wrapper": true,
"droppable": isOver,
"dragging": isDragging,
// "drop-tips": canDrop,
})}>
<div
className={cx({
"widget-preview-item-wrapper": true,
"droppable": isOver,
"dragging": isDragging,
// "drop-tips": canDrop,
})}

style={{
display: 'inline-block',
width: item.width || '100%'
}}

>
{placeholderPosition === 'top' && isOver && !isSortMode ? <widget.PlaceholderPreview /> : null}
<div
ref={connectDragSource}
Expand Down
4 changes: 3 additions & 1 deletion src/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
background: #efefef;

.design-layout-container {
width: 350px;
width: 800px;
height: 600px;
padding-bottom: 60px;
margin: 0 auto;
Expand Down Expand Up @@ -243,6 +243,8 @@
padding: 10px;
background: #fff;
border-left: 1px solid rgb(222, 222, 228);
overflow: auto;
font-size: 14px;
}
}

Expand Down

0 comments on commit f2f6788

Please sign in to comment.