@guo514360255/antd-lib 1.4.8 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ var _excluded = ["type", "columns", "detailRequest", "handleDetailData", "title"
12
12
  */
13
13
 
14
14
  import { findTreeNodeByKey, isEmptyValue } from "../utils/util";
15
- import { Button, Descriptions, Drawer, Modal, Spin } from 'antd';
15
+ import { Descriptions, Drawer, Image, Modal, Spin } from 'antd';
16
16
  import { isNumber, isString } from 'lodash';
17
17
  import isObject from 'lodash/isObject';
18
18
  import React, { forwardRef, useImperativeHandle, useState } from 'react';
@@ -149,14 +149,34 @@ var CustomModal = /*#__PURE__*/forwardRef(function (props, ref) {
149
149
  }
150
150
  return value;
151
151
  };
152
- var footer = [/*#__PURE__*/React.createElement(Button, {
153
- key: "cancel",
154
- size: "large",
155
- onClick: close
156
- }, "\u786E\u5B9A")];
152
+ var DescImage = function DescImage(_ref4) {
153
+ var data = _ref4.data;
154
+ console.log(data);
155
+ if (!data) return data;
156
+ var list = data;
157
+ if (typeof data === 'string') {
158
+ list = data.split(',');
159
+ }
160
+ return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, /*#__PURE__*/React.createElement("div", {
161
+ style: {
162
+ display: 'flex',
163
+ flexWrap: 'wrap',
164
+ gap: 10
165
+ }
166
+ }, list.map(function (item, index) {
167
+ return /*#__PURE__*/React.createElement(Image, {
168
+ key: index,
169
+ width: 100,
170
+ src: item.url || item,
171
+ alt: item.name || item,
172
+ style: {
173
+ marginRight: 10
174
+ }
175
+ });
176
+ })));
177
+ };
157
178
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, _extends({
158
179
  width: other.width || 600,
159
- footer: footer,
160
180
  title: "".concat(title || '', "\u8BE6\u60C5")
161
181
  }, other, {
162
182
  open: open,
@@ -169,12 +189,15 @@ var CustomModal = /*#__PURE__*/forwardRef(function (props, ref) {
169
189
  return !item.hideInDetail;
170
190
  }).map(function (item, index) {
171
191
  var _item$fieldProps;
192
+ console.log(item.type, detail[item.dataIndex]);
172
193
  return /*#__PURE__*/React.createElement(React.Fragment, {
173
194
  key: item.dataIndex
174
195
  }, /*#__PURE__*/React.createElement(Descriptions.Item, _extends({
175
196
  key: item.dataIndex,
176
197
  label: "".concat(item.title)
177
- }, ((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.descriptionsItemProps) || {}), handleDetailValue(item, detail[item.dataIndex], index) || '-'));
198
+ }, ((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.descriptionsItemProps) || {}), item.type === 'upload' ? /*#__PURE__*/React.createElement(DescImage, {
199
+ data: detail[item.dataIndex]
200
+ }) : handleDetailValue(item, detail[item.dataIndex], index) || '-'));
178
201
  }))), /*#__PURE__*/React.createElement(Spin, {
179
202
  spinning: loading,
180
203
  fullscreen: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guo514360255/antd-lib",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "react design 5 lib",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",