Commit 0142042f7a8c6a81d12b91cd4648d45d19a994ed

Authored by 邢晴晴
1 parent 9586b1dd

子表默认没有显示一行数据

@@ -2,12 +2,12 @@ import "antd/es/button/style"; @@ -2,12 +2,12 @@ import "antd/es/button/style";
2 import _Button from "antd/es/button"; 2 import _Button from "antd/es/button";
3 import "antd/es/space/style"; 3 import "antd/es/space/style";
4 import _Space from "antd/es/space"; 4 import _Space from "antd/es/space";
5 -import _ArrowDownOutlined from "@ant-design/icons/lib/icons/ArrowDownOutlined";  
6 -import _ArrowUpOutlined from "@ant-design/icons/lib/icons/ArrowUpOutlined";  
7 -import _CopyOutlined from "@ant-design/icons/lib/icons/CopyOutlined"; 5 +import _ArrowDownOutlined from "@ant-design/icons/es/icons/ArrowDownOutlined";
  6 +import _ArrowUpOutlined from "@ant-design/icons/es/icons/ArrowUpOutlined";
  7 +import _CopyOutlined from "@ant-design/icons/es/icons/CopyOutlined";
8 import "antd/es/popconfirm/style"; 8 import "antd/es/popconfirm/style";
9 import _Popconfirm from "antd/es/popconfirm"; 9 import _Popconfirm from "antd/es/popconfirm";
10 -import _DeleteOutlined from "@ant-design/icons/lib/icons/DeleteOutlined"; 10 +import _DeleteOutlined from "@ant-design/icons/es/icons/DeleteOutlined";
11 11
12 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 12 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13 13
@@ -6,8 +6,8 @@ import "antd/es/button/style"; @@ -6,8 +6,8 @@ import "antd/es/button/style";
6 import _Button from "antd/es/button"; 6 import _Button from "antd/es/button";
7 import "antd/es/space/style"; 7 import "antd/es/space/style";
8 import _Space from "antd/es/space"; 8 import _Space from "antd/es/space";
9 -import _ArrowDownOutlined from "@ant-design/icons/lib/icons/ArrowDownOutlined";  
10 -import _ArrowUpOutlined from "@ant-design/icons/lib/icons/ArrowUpOutlined"; 9 +import _ArrowDownOutlined from "@ant-design/icons/es/icons/ArrowDownOutlined";
  10 +import _ArrowUpOutlined from "@ant-design/icons/es/icons/ArrowUpOutlined";
11 import "antd/es/popconfirm/style"; 11 import "antd/es/popconfirm/style";
12 import _Popconfirm from "antd/es/popconfirm"; 12 import _Popconfirm from "antd/es/popconfirm";
13 var _excluded = ["buttons"], 13 var _excluded = ["buttons"],
1 import "antd/es/button/style"; 1 import "antd/es/button/style";
2 import _Button from "antd/es/button"; 2 import _Button from "antd/es/button";
3 -import _ArrowDownOutlined from "@ant-design/icons/lib/icons/ArrowDownOutlined";  
4 -import _ArrowUpOutlined from "@ant-design/icons/lib/icons/ArrowUpOutlined";  
5 -import _CopyOutlined from "@ant-design/icons/lib/icons/CopyOutlined"; 3 +import _ArrowDownOutlined from "@ant-design/icons/es/icons/ArrowDownOutlined";
  4 +import _ArrowUpOutlined from "@ant-design/icons/es/icons/ArrowUpOutlined";
  5 +import _CopyOutlined from "@ant-design/icons/es/icons/CopyOutlined";
6 import "antd/es/popconfirm/style"; 6 import "antd/es/popconfirm/style";
7 import _Popconfirm from "antd/es/popconfirm"; 7 import _Popconfirm from "antd/es/popconfirm";
8 -import _DeleteOutlined from "@ant-design/icons/lib/icons/DeleteOutlined"; 8 +import _DeleteOutlined from "@ant-design/icons/es/icons/DeleteOutlined";
9 9
10 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 10 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11 11
@@ -4,8 +4,8 @@ import "antd/es/button/style"; @@ -4,8 +4,8 @@ import "antd/es/button/style";
4 import _Button from "antd/es/button"; 4 import _Button from "antd/es/button";
5 import "antd/es/space/style"; 5 import "antd/es/space/style";
6 import _Space from "antd/es/space"; 6 import _Space from "antd/es/space";
7 -import _ArrowDownOutlined from "@ant-design/icons/lib/icons/ArrowDownOutlined";  
8 -import _ArrowUpOutlined from "@ant-design/icons/lib/icons/ArrowUpOutlined"; 7 +import _ArrowDownOutlined from "@ant-design/icons/es/icons/ArrowDownOutlined";
  8 +import _ArrowUpOutlined from "@ant-design/icons/es/icons/ArrowUpOutlined";
9 import "antd/es/popconfirm/style"; 9 import "antd/es/popconfirm/style";
10 import _Popconfirm from "antd/es/popconfirm"; 10 import _Popconfirm from "antd/es/popconfirm";
11 var _excluded = ["buttons"], 11 var _excluded = ["buttons"],
1 import "antd/es/button/style"; 1 import "antd/es/button/style";
2 import _Button from "antd/es/button"; 2 import _Button from "antd/es/button";
3 -import _PlusOutlined from "@ant-design/icons/lib/icons/PlusOutlined"; 3 +import _PlusOutlined from "@ant-design/icons/es/icons/PlusOutlined";
4 import "antd/es/table/style"; 4 import "antd/es/table/style";
5 import _Table from "antd/es/table"; 5 import _Table from "antd/es/table";
6 -import _ArrowDownOutlined from "@ant-design/icons/lib/icons/ArrowDownOutlined";  
7 -import _ArrowUpOutlined from "@ant-design/icons/lib/icons/ArrowUpOutlined"; 6 +import _ArrowDownOutlined from "@ant-design/icons/es/icons/ArrowDownOutlined";
  7 +import _ArrowUpOutlined from "@ant-design/icons/es/icons/ArrowUpOutlined";
8 import "antd/es/popconfirm/style"; 8 import "antd/es/popconfirm/style";
9 import _Popconfirm from "antd/es/popconfirm"; 9 import _Popconfirm from "antd/es/popconfirm";
10 var _excluded = ["scrollY", "summary"]; 10 var _excluded = ["scrollY", "summary"];
@@ -80,17 +80,20 @@ var VirtualList = function VirtualList(_ref) { @@ -80,17 +80,20 @@ var VirtualList = function VirtualList(_ref) {
80 index: idx 80 index: idx
81 }; 81 };
82 }); 82 });
83 - var columns = [];  
84 - children.map(function (child) { 83 + var columns = children.map(function (child) {
85 var item = flatten[child]; 84 var item = flatten[child];
86 var schema = item && item.schema || {}; 85 var schema = item && item.schema || {};
87 - columns.push({ 86 + return {
88 dataIndex: child, 87 dataIndex: child,
89 width: schema.width || FIELD_LENGTH, 88 width: schema.width || FIELD_LENGTH,
90 fixed: schema.fixed, 89 fixed: schema.fixed,
91 - title: schema.required ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", { 90 + title: /*#__PURE__*/React.createElement("div", {
  91 + style: {
  92 + width: (parseInt(schema.width) || FIELD_LENGTH) + "px"
  93 + }
  94 + }, schema.required ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
92 className: "fr-label-required" 95 className: "fr-label-required"
93 - }, " *"), /*#__PURE__*/React.createElement("span", null, schema.title)) : schema.title, 96 + }, " *"), /*#__PURE__*/React.createElement("span", null, schema.title)) : schema.title),
94 render: function render(value, record, index) { 97 render: function render(value, record, index) {
95 // Check: record.index 似乎是antd自己会给的,不错哦 98 // Check: record.index 似乎是antd自己会给的,不错哦
96 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]); 99 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]);
@@ -102,7 +105,7 @@ var VirtualList = function VirtualList(_ref) { @@ -102,7 +105,7 @@ var VirtualList = function VirtualList(_ref) {
102 dataIndex: childIndex 105 dataIndex: childIndex
103 }); 106 });
104 } 107 }
105 - }); 108 + };
106 }); 109 });
107 110
108 if (!props.hideDelete || Array.isArray(itemProps.buttons)) { 111 if (!props.hideDelete || Array.isArray(itemProps.buttons)) {
@@ -63,7 +63,7 @@ var RenderList = function RenderList(_ref) { @@ -63,7 +63,7 @@ var RenderList = function RenderList(_ref) {
63 listData = get(formData, dataPath); 63 listData = get(formData, dataPath);
64 } 64 }
65 65
66 - var displayList = Array.isArray(listData) ? listData : [{}]; 66 + var displayList = Array.isArray(listData) ? listData : [];
67 67
68 var changeList = function changeList(newList) { 68 var changeList = function changeList(newList) {
69 onItemChange(dataPath, newList); 69 onItemChange(dataPath, newList);
@@ -2,7 +2,7 @@ import "antd/es/input/style"; @@ -2,7 +2,7 @@ import "antd/es/input/style";
2 import _Input from "antd/es/input"; 2 import _Input from "antd/es/input";
3 import "antd/es/popover/style"; 3 import "antd/es/popover/style";
4 import _Popover from "antd/es/popover"; 4 import _Popover from "antd/es/popover";
5 -import _PictureOutlined from "@ant-design/icons/lib/icons/PictureOutlined"; 5 +import _PictureOutlined from "@ant-design/icons/es/icons/PictureOutlined";
6 var _excluded = ["value"]; 6 var _excluded = ["value"];
7 7
8 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 8 function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -2,7 +2,7 @@ import "antd/es/upload/style"; @@ -2,7 +2,7 @@ import "antd/es/upload/style";
2 import _Upload from "antd/es/upload"; 2 import _Upload from "antd/es/upload";
3 import "antd/es/button/style"; 3 import "antd/es/button/style";
4 import _Button from "antd/es/button"; 4 import _Button from "antd/es/button";
5 -import _UploadOutlined from "@ant-design/icons/lib/icons/UploadOutlined"; 5 +import _UploadOutlined from "@ant-design/icons/es/icons/UploadOutlined";
6 import "antd/es/message/style"; 6 import "antd/es/message/style";
7 import _message from "antd/es/message"; 7 import _message from "antd/es/message";
8 8
@@ -100,17 +100,20 @@ var VirtualList = function VirtualList(_ref) { @@ -100,17 +100,20 @@ var VirtualList = function VirtualList(_ref) {
100 index: idx 100 index: idx
101 }; 101 };
102 }); 102 });
103 - var columns = [];  
104 - children.map(function (child) { 103 + var columns = children.map(function (child) {
105 var item = flatten[child]; 104 var item = flatten[child];
106 var schema = item && item.schema || {}; 105 var schema = item && item.schema || {};
107 - columns.push({ 106 + return {
108 dataIndex: child, 107 dataIndex: child,
109 width: schema.width || FIELD_LENGTH, 108 width: schema.width || FIELD_LENGTH,
110 fixed: schema.fixed, 109 fixed: schema.fixed,
111 - title: schema.required ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", { 110 + title: /*#__PURE__*/_react.default.createElement("div", {
  111 + style: {
  112 + width: (parseInt(schema.width) || FIELD_LENGTH) + "px"
  113 + }
  114 + }, schema.required ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
112 className: "fr-label-required" 115 className: "fr-label-required"
113 - }, " *"), /*#__PURE__*/_react.default.createElement("span", null, schema.title)) : schema.title, 116 + }, " *"), /*#__PURE__*/_react.default.createElement("span", null, schema.title)) : schema.title),
114 render: function render(value, record, index) { 117 render: function render(value, record, index) {
115 // Check: record.index 似乎是antd自己会给的,不错哦 118 // Check: record.index 似乎是antd自己会给的,不错哦
116 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]); 119 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]);
@@ -122,7 +125,7 @@ var VirtualList = function VirtualList(_ref) { @@ -122,7 +125,7 @@ var VirtualList = function VirtualList(_ref) {
122 dataIndex: childIndex 125 dataIndex: childIndex
123 }); 126 });
124 } 127 }
125 - }); 128 + };
126 }); 129 });
127 130
128 if (!props.hideDelete || Array.isArray(itemProps.buttons)) { 131 if (!props.hideDelete || Array.isArray(itemProps.buttons)) {
@@ -79,7 +79,7 @@ var RenderList = function RenderList(_ref) { @@ -79,7 +79,7 @@ var RenderList = function RenderList(_ref) {
79 listData = (0, _lodashEs.get)(formData, dataPath); 79 listData = (0, _lodashEs.get)(formData, dataPath);
80 } 80 }
81 81
82 - var displayList = Array.isArray(listData) ? listData : [{}]; 82 + var displayList = Array.isArray(listData) ? listData : [];
83 83
84 var changeList = function changeList(newList) { 84 var changeList = function changeList(newList) {
85 onItemChange(dataPath, newList); 85 onItemChange(dataPath, newList);
1 { 1 {
2 "name": "form-render", 2 "name": "form-render",
3 - "version": "1.7.4", 3 + "version": "1.7.5",
4 "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成", 4 "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
5 "repository": { 5 "repository": {
6 "type": "git", 6 "type": "git",