Commit 0142042f7a8c6a81d12b91cd4648d45d19a994ed

Authored by 邢晴晴
1 parent 9586b1dd

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

... ... @@ -2,12 +2,12 @@ import "antd/es/button/style";
2 2 import _Button from "antd/es/button";
3 3 import "antd/es/space/style";
4 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 8 import "antd/es/popconfirm/style";
9 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 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 6 import _Button from "antd/es/button";
7 7 import "antd/es/space/style";
8 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 11 import "antd/es/popconfirm/style";
12 12 import _Popconfirm from "antd/es/popconfirm";
13 13 var _excluded = ["buttons"],
... ...
1 1 import "antd/es/button/style";
2 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 6 import "antd/es/popconfirm/style";
7 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 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 4 import _Button from "antd/es/button";
5 5 import "antd/es/space/style";
6 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 9 import "antd/es/popconfirm/style";
10 10 import _Popconfirm from "antd/es/popconfirm";
11 11 var _excluded = ["buttons"],
... ...
1 1 import "antd/es/button/style";
2 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 4 import "antd/es/table/style";
5 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 8 import "antd/es/popconfirm/style";
9 9 import _Popconfirm from "antd/es/popconfirm";
10 10 var _excluded = ["scrollY", "summary"];
... ... @@ -80,17 +80,20 @@ var VirtualList = function VirtualList(_ref) {
80 80 index: idx
81 81 };
82 82 });
83   - var columns = [];
84   - children.map(function (child) {
  83 + var columns = children.map(function (child) {
85 84 var item = flatten[child];
86 85 var schema = item && item.schema || {};
87   - columns.push({
  86 + return {
88 87 dataIndex: child,
89 88 width: schema.width || FIELD_LENGTH,
90 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 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 97 render: function render(value, record, index) {
95 98 // Check: record.index 似乎是antd自己会给的,不错哦
96 99 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]);
... ... @@ -102,7 +105,7 @@ var VirtualList = function VirtualList(_ref) {
102 105 dataIndex: childIndex
103 106 });
104 107 }
105   - });
  108 + };
106 109 });
107 110
108 111 if (!props.hideDelete || Array.isArray(itemProps.buttons)) {
... ...
... ... @@ -63,7 +63,7 @@ var RenderList = function RenderList(_ref) {
63 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 68 var changeList = function changeList(newList) {
69 69 onItemChange(dataPath, newList);
... ...
... ... @@ -2,7 +2,7 @@ import "antd/es/input/style";
2 2 import _Input from "antd/es/input";
3 3 import "antd/es/popover/style";
4 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 6 var _excluded = ["value"];
7 7
8 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 2 import _Upload from "antd/es/upload";
3 3 import "antd/es/button/style";
4 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 6 import "antd/es/message/style";
7 7 import _message from "antd/es/message";
8 8
... ...
... ... @@ -100,17 +100,20 @@ var VirtualList = function VirtualList(_ref) {
100 100 index: idx
101 101 };
102 102 });
103   - var columns = [];
104   - children.map(function (child) {
  103 + var columns = children.map(function (child) {
105 104 var item = flatten[child];
106 105 var schema = item && item.schema || {};
107   - columns.push({
  106 + return {
108 107 dataIndex: child,
109 108 width: schema.width || FIELD_LENGTH,
110 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 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 117 render: function render(value, record, index) {
115 118 // Check: record.index 似乎是antd自己会给的,不错哦
116 119 var childIndex = [].concat(_toConsumableArray(dataIndex), [record.index]);
... ... @@ -122,7 +125,7 @@ var VirtualList = function VirtualList(_ref) {
122 125 dataIndex: childIndex
123 126 });
124 127 }
125   - });
  128 + };
126 129 });
127 130
128 131 if (!props.hideDelete || Array.isArray(itemProps.buttons)) {
... ...
... ... @@ -79,7 +79,7 @@ var RenderList = function RenderList(_ref) {
79 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 84 var changeList = function changeList(newList) {
85 85 onItemChange(dataPath, newList);
... ...
1 1 {
2 2 "name": "form-render",
3   - "version": "1.7.4",
  3 + "version": "1.7.5",
4 4 "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
5 5 "repository": {
6 6 "type": "git",
... ...