ls-pro-common 1.0.26 → 1.0.29

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.
@@ -259,7 +259,7 @@ function useSingle(inParam) {
259
259
 
260
260
  case 20:
261
261
  if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
262
- showSuccess(result.flag.retMsg);
262
+ showSuccess(result.flag.retMsg || '删除成功');
263
263
 
264
264
  if (tableRef.current) {
265
265
  tableRef.current.reload(false);
@@ -317,69 +317,83 @@ function useSingle(inParam) {
317
317
 
318
318
  obj[statusField] = auditStatus;
319
319
  return obj;
320
- }); // beforeAudit 强式终止
320
+ });
321
+ _context4.prev = 7;
322
+ _context4.next = 10;
323
+ return showConfirm('确认要审核选中的数据?', '审核提示');
324
+
325
+ case 10:
326
+ _context4.next = 16;
327
+ break;
328
+
329
+ case 12:
330
+ _context4.prev = 12;
331
+ _context4.t0 = _context4["catch"](7);
332
+ console.log(_context4.t0);
333
+ return _context4.abrupt("return");
321
334
 
322
- _context4.t0 = beforeAudit;
335
+ case 16:
336
+ _context4.t1 = beforeAudit;
323
337
 
324
- if (!_context4.t0) {
325
- _context4.next = 13;
338
+ if (!_context4.t1) {
339
+ _context4.next = 22;
326
340
  break;
327
341
  }
328
342
 
329
- _context4.next = 11;
343
+ _context4.next = 20;
330
344
  return beforeAudit(rows);
331
345
 
332
- case 11:
333
- _context4.t1 = _context4.sent;
334
- _context4.t0 = _context4.t1 === false;
346
+ case 20:
347
+ _context4.t2 = _context4.sent;
348
+ _context4.t1 = _context4.t2 === false;
335
349
 
336
- case 13:
337
- if (!_context4.t0) {
338
- _context4.next = 15;
350
+ case 22:
351
+ if (!_context4.t1) {
352
+ _context4.next = 24;
339
353
  break;
340
354
  }
341
355
 
342
356
  return _context4.abrupt("return");
343
357
 
344
- case 15:
345
- _context4.prev = 15;
346
- _context4.next = 18;
358
+ case 24:
359
+ _context4.prev = 24;
360
+ _context4.next = 27;
347
361
  return service.audit(rows);
348
362
 
349
- case 18:
363
+ case 27:
350
364
  result = _context4.sent;
351
365
 
352
366
  if (!afterAudit) {
353
- _context4.next = 22;
367
+ _context4.next = 31;
354
368
  break;
355
369
  }
356
370
 
357
371
  afterAudit(result, rows);
358
372
  return _context4.abrupt("return");
359
373
 
360
- case 22:
374
+ case 31:
361
375
  if ((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0') {
362
- showSuccess(result.flag.retMsg);
376
+ showSuccess(result.flag.retMsg || '审核成功');
363
377
 
364
378
  if (tableRef.current) {
365
379
  tableRef.current.reload(false);
366
380
  }
367
381
  }
368
382
 
369
- _context4.next = 28;
383
+ _context4.next = 37;
370
384
  break;
371
385
 
372
- case 25:
373
- _context4.prev = 25;
374
- _context4.t2 = _context4["catch"](15);
375
- console.log(_context4.t2);
386
+ case 34:
387
+ _context4.prev = 34;
388
+ _context4.t3 = _context4["catch"](24);
389
+ console.log(_context4.t3);
376
390
 
377
- case 28:
391
+ case 37:
378
392
  case "end":
379
393
  return _context4.stop();
380
394
  }
381
395
  }
382
- }, _callee4, null, [[15, 25]]);
396
+ }, _callee4, null, [[7, 12], [24, 34]]);
383
397
  }));
384
398
 
385
399
  return function onAudit(_x3) {
@@ -445,7 +459,7 @@ function useSingle(inParam) {
445
459
  break;
446
460
  }
447
461
 
448
- showSuccess(result.flag.retMsg);
462
+ showSuccess(result.flag.retMsg || '操作成功');
449
463
 
450
464
  if (tableRef.current) {
451
465
  tableRef.current.reload(false);
@@ -667,6 +681,7 @@ function useSingle(inParam) {
667
681
  onClick: function onClick() {
668
682
  return onAdd(null);
669
683
  },
684
+ disabled: btnDisabled('add'),
670
685
  icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
671
686
  }, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && checkRight(4) ? /*#__PURE__*/React.createElement(_Button, {
672
687
  key: "edit",
@@ -697,6 +712,7 @@ function useSingle(inParam) {
697
712
 
698
713
  tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showImport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
699
714
  },
715
+ disabled: btnDisabled('import'),
700
716
  icon: /*#__PURE__*/React.createElement(ImportOutlined, null)
701
717
  }, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) && checkRight(256) ? /*#__PURE__*/React.createElement(_Button, {
702
718
  key: "export",
@@ -705,6 +721,7 @@ function useSingle(inParam) {
705
721
 
706
722
  tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$sh = _tableRef$current3.showExport) === null || _tableRef$current3$sh === void 0 ? void 0 : _tableRef$current3$sh.call(_tableRef$current3);
707
723
  },
724
+ disabled: btnDisabled('export'),
708
725
  icon: /*#__PURE__*/React.createElement(ExportOutlined, null)
709
726
  }, "\u5BFC\u51FA") : false].filter(function (o) {
710
727
  return o !== false;
package/es/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import DtlLayout from './components/DtlLayout';
2
2
  import InputTable from './components/InputTable';
3
3
  import Page404 from './components/404';
4
4
  import Loading from './components/Loading';
5
+ import IconSelector from './components/IconSelector';
5
6
  import BaseService from './service/BaseService';
6
7
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
7
8
  import * as utils from './utils';
@@ -13,4 +14,4 @@ import usePermission from './hooks/usePermission';
13
14
  import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
14
15
  import type { DtlLyaoutProps } from './components/DtlLayout';
15
16
  export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps };
16
- export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
17
+ export { DtlLayout, InputTable, Page404, Loading, IconSelector, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
package/es/index.js CHANGED
@@ -2,6 +2,7 @@ import DtlLayout from './components/DtlLayout';
2
2
  import InputTable from './components/InputTable';
3
3
  import Page404 from './components/404';
4
4
  import Loading from './components/Loading';
5
+ import IconSelector from './components/IconSelector';
5
6
  import BaseService from './service/BaseService';
6
7
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
7
8
  import * as utils from './utils';
@@ -10,4 +11,4 @@ import * as utils from './utils';
10
11
  import useSingle from './hooks/useSingle';
11
12
  import useDtl from './hooks/useDtl';
12
13
  import usePermission from './hooks/usePermission';
13
- export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
14
+ export { DtlLayout, InputTable, Page404, Loading, IconSelector, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
@@ -10,6 +10,8 @@ export declare type DtlLyaoutProps = Record<string, any> & {
10
10
  renderButton?: (defaultBtn: JSX.Element[]) => JSX.Element[];
11
11
  /** 审核方法 */
12
12
  onAudit?: () => void;
13
+ /**按钮状态 */
14
+ btnStatus?: (btnKey: string) => boolean | void;
13
15
  /** 保存按钮文本 */
14
16
  btnSaveText?: string;
15
17
  /** 返回按钮文本 */
@@ -36,7 +36,8 @@ function DtlLayout(props) {
36
36
  _props$btnSaveText = props.btnSaveText,
37
37
  btnSaveText = _props$btnSaveText === void 0 ? '保存' : _props$btnSaveText,
38
38
  _props$btnExitText = props.btnExitText,
39
- btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText;
39
+ btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText,
40
+ btnStatus = props.btnStatus;
40
41
  var dtlTitle = (0, _react.useMemo)(function () {
41
42
  if (title) return title;
42
43
  if (!masterObject) return '';
@@ -54,6 +55,7 @@ function DtlLayout(props) {
54
55
 
55
56
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.submit();
56
57
  },
58
+ disabled: btnStatus ? btnStatus('btnSave') || false : false,
57
59
  icon: /*#__PURE__*/_react.default.createElement(_icons.SaveOutlined, null)
58
60
  }, btnSaveText), /*#__PURE__*/_react.default.createElement(_button.default, {
59
61
  key: "btnBack",
@@ -66,6 +68,11 @@ function DtlLayout(props) {
66
68
  if (props.onAudit) {
67
69
  b.unshift( /*#__PURE__*/_react.default.createElement(_button.default, {
68
70
  key: "btnAudit",
71
+ disabled: btnStatus ? btnStatus('btnAudit') || false : false,
72
+ onClick: function onClick() {
73
+ if (!props.onAudit) return;
74
+ props.onAudit();
75
+ },
69
76
  icon: /*#__PURE__*/_react.default.createElement(_icons.CheckOutlined, null)
70
77
  }, "\u5BA1\u6838"));
71
78
  }
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { InputProps } from 'antd';
3
+ import type { ProFormItemProps } from 'ls-pro-form';
4
+ export declare type IconSelectorProps = ProFormItemProps<InputProps> & {
5
+ /** @name 图标类型 */
6
+ type: string;
7
+ /** @name 是否可上传,默认可上传 */
8
+ uploadable?: boolean;
9
+ /** @name 弹框title */
10
+ title?: string;
11
+ /** @name 弹框宽度 */
12
+ modalWidth?: string;
13
+ /**
14
+ * @name 最大值, 默认2M
15
+ */
16
+ maxSize?: number;
17
+ };
18
+ declare function IconSelector(prop: IconSelectorProps): JSX.Element;
19
+ export default IconSelector;
@@ -0,0 +1,322 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = void 0;
11
+
12
+ require("antd/es/modal/style");
13
+
14
+ var _modal = _interopRequireDefault(require("antd/es/modal"));
15
+
16
+ require("antd/es/card/style");
17
+
18
+ var _card = _interopRequireDefault(require("antd/es/card"));
19
+
20
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
21
+
22
+ require("antd/es/upload/style");
23
+
24
+ var _upload = _interopRequireDefault(require("antd/es/upload"));
25
+
26
+ require("antd/es/button/style");
27
+
28
+ var _button = _interopRequireDefault(require("antd/es/button"));
29
+
30
+ require("antd/es/input/style");
31
+
32
+ var _input = _interopRequireDefault(require("antd/es/input"));
33
+
34
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
35
+
36
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
37
+
38
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
39
+
40
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
41
+
42
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
43
+
44
+ var _react = _interopRequireWildcard(require("react"));
45
+
46
+ var _lsProForm = require("ls-pro-form");
47
+
48
+ var _icons = require("@ant-design/icons");
49
+
50
+ var _http = require("../http");
51
+
52
+ var _utils = require("../utils");
53
+
54
+ var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize"];
55
+ var fileCenter = (0, _utils.getCache)('file-center-api') || '/zuul/petrel-file-center-api/';
56
+ var pageSize = 16;
57
+
58
+ function IconSelector(prop) {
59
+ //@ts-ignore?
60
+ var _useContext = (0, _react.useContext)(_lsProForm.ProFormContext),
61
+ formRef = _useContext.formRef;
62
+
63
+ var _useState = (0, _react.useState)(false),
64
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
65
+ visible = _useState2[0],
66
+ setVisible = _useState2[1];
67
+
68
+ var _useState3 = (0, _react.useState)(''),
69
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
70
+ imgUrl = _useState4[0],
71
+ setImgUrl = _useState4[1];
72
+
73
+ var _useState5 = (0, _react.useState)(1),
74
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
75
+ page = _useState6[0],
76
+ setPage = _useState6[1];
77
+
78
+ var _useState7 = (0, _react.useState)(0),
79
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
80
+ total = _useState8[0],
81
+ setTotal = _useState8[1];
82
+
83
+ var _useState9 = (0, _react.useState)([]),
84
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
85
+ list = _useState10[0],
86
+ setList = _useState10[1];
87
+
88
+ var type = prop.type,
89
+ _prop$uploadable = prop.uploadable,
90
+ uploadable = _prop$uploadable === void 0 ? true : _prop$uploadable,
91
+ _prop$readonly = prop.readonly,
92
+ readonly = _prop$readonly === void 0 ? true : _prop$readonly,
93
+ allowClear = prop.allowClear,
94
+ _prop$title = prop.title,
95
+ title = _prop$title === void 0 ? "选择图标" : _prop$title,
96
+ _prop$modalWidth = prop.modalWidth,
97
+ modalWidth = _prop$modalWidth === void 0 ? '600px' : _prop$modalWidth,
98
+ name = prop.name,
99
+ _prop$maxSize = prop.maxSize,
100
+ maxSize = _prop$maxSize === void 0 ? 2 : _prop$maxSize,
101
+ rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
102
+ var uploadImgApi = (0, _react.useMemo)(function () {
103
+ return (0, _utils.toGatewayUrl)(fileCenter + 'file/upload/' + type);
104
+ }, [type]);
105
+ var showImgApi = (0, _react.useMemo)(function () {
106
+ return fileCenter + 'file/show/' + type;
107
+ }, [type]);
108
+
109
+ var loadData = /*#__PURE__*/function () {
110
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(pageIndex) {
111
+ var url, param, result, rows;
112
+ return _regenerator.default.wrap(function _callee$(_context) {
113
+ while (1) {
114
+ switch (_context.prev = _context.next) {
115
+ case 0:
116
+ url = "/petrel-itg-api/sysMongo/page";
117
+ param = {
118
+ "search.status": 1,
119
+ "search.collectName": type,
120
+ "page.pn": pageIndex,
121
+ "page.size": pageSize
122
+ };
123
+ _context.next = 4;
124
+ return (0, _http.httpGet)(url, param);
125
+
126
+ case 4:
127
+ result = _context.sent;
128
+ rows = result.rows || [];
129
+ setList(rows);
130
+ setTotal(result.total || 0);
131
+
132
+ case 8:
133
+ case "end":
134
+ return _context.stop();
135
+ }
136
+ }
137
+ }, _callee);
138
+ }));
139
+
140
+ return function loadData(_x) {
141
+ return _ref.apply(this, arguments);
142
+ };
143
+ }();
144
+
145
+ (0, _react.useEffect)(function () {
146
+ if (!visible) return;
147
+ loadData(page);
148
+ }, [visible, page]);
149
+ var totalPage = (0, _react.useMemo)(function () {
150
+ if (total === 0) return 1;
151
+ return Math.ceil(total / pageSize);
152
+ }, [total]); // 验证上传文件大小
153
+
154
+ var beforeUpload = function beforeUpload(file) {
155
+ var sizeLimit = file.size / 1024 / 1024 >= maxSize;
156
+
157
+ if (sizeLimit) {
158
+ (0, _utils.showError)("\u4E0A\u4F20\u7684\u6587\u4EF6\u4E0D\u80FD\u5927\u4E8E".concat(maxSize, "M"));
159
+ }
160
+
161
+ return !sizeLimit;
162
+ }; // 上传图片并调用 sysMongo 接口保存
163
+
164
+
165
+ var onUpload = function onUpload(info) {
166
+ if (info.file.status === 'done') {
167
+ var _result$flag;
168
+
169
+ var result = info.file.response;
170
+
171
+ if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
172
+ var f = result.data[0];
173
+ var data = {
174
+ collectName: type,
175
+ mongoUrl: showImgApi + "/" + f.fileId,
176
+ mongoName: f.fileName || "",
177
+ remarks: "",
178
+ status: 1
179
+ };
180
+ var url = "/petrel/petrel-itg-api/sysMongo";
181
+ (0, _http.httpPost)(url, data, true, false).then(function (res) {
182
+ if (res.flag.retCode === "0") {
183
+ (0, _utils.showSuccess)("上传成功");
184
+
185
+ if (page !== totalPage) {
186
+ setPage(totalPage);
187
+ } else {
188
+ loadData(totalPage);
189
+ }
190
+ } else {
191
+ (0, _utils.showSuccess)(result.flag.retMsg);
192
+ }
193
+ });
194
+ } else {
195
+ var _result$flag2;
196
+
197
+ (0, _utils.showError)((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retMsg) || '上传图片失败,请联系管理员');
198
+ }
199
+ } else if (info.file.status === 'error') {
200
+ (0, _utils.showError)('上传数据失败,请联系管理员');
201
+ }
202
+ };
203
+
204
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_lsProForm.ProFormText, (0, _extends2.default)({
205
+ name: name
206
+ }, rest), /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({
207
+ addonAfter: imgUrl ? /*#__PURE__*/_react.default.createElement("img", {
208
+ style: {
209
+ maxWidth: 22,
210
+ maxHeight: 22
211
+ },
212
+ src: imgUrl,
213
+ onClick: function onClick() {
214
+ return setVisible(true);
215
+ }
216
+ }) : /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, {
217
+ onClick: function onClick() {
218
+ return setVisible(true);
219
+ }
220
+ })
221
+ }, rest.fieldProps, {
222
+ readOnly: readonly,
223
+ allowClear: allowClear
224
+ }))), /*#__PURE__*/_react.default.createElement(_modal.default, {
225
+ title: title,
226
+ visible: visible,
227
+ width: modalWidth,
228
+ destroyOnClose: true,
229
+ onCancel: function onCancel() {
230
+ return setVisible(false);
231
+ },
232
+ bodyStyle: {
233
+ padding: 8
234
+ },
235
+ footer: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
236
+ style: {
237
+ display: 'inline-block',
238
+ marginRight: 8
239
+ }
240
+ }, /*#__PURE__*/_react.default.createElement(_upload.default, {
241
+ beforeUpload: beforeUpload,
242
+ onChange: onUpload,
243
+ action: uploadImgApi,
244
+ showUploadList: false,
245
+ name: "file",
246
+ maxCount: 1,
247
+ headers: {
248
+ token: localStorage.getItem('token') || ''
249
+ },
250
+ accept: ".png,.gif,.jpg,.jpeg,.bmp"
251
+ }, /*#__PURE__*/_react.default.createElement(_button.default, {
252
+ icon: /*#__PURE__*/_react.default.createElement(_icons.UploadOutlined, null)
253
+ }, "\u4E0A\u4F20\u65B0\u56FE"))), /*#__PURE__*/_react.default.createElement(_button.default, {
254
+ disabled: page === 1,
255
+ onClick: function onClick() {
256
+ setPage(page - 1);
257
+ }
258
+ }, "\u4E0A\u4E00\u9875"), /*#__PURE__*/_react.default.createElement("span", {
259
+ style: {
260
+ padding: 8
261
+ }
262
+ }, page, "/", totalPage), /*#__PURE__*/_react.default.createElement(_button.default, {
263
+ disabled: page === totalPage,
264
+ onClick: function onClick() {
265
+ setPage(page + 1);
266
+ }
267
+ }, "\u4E0B\u4E00\u9875"), /*#__PURE__*/_react.default.createElement(_button.default, {
268
+ onClick: function onClick() {
269
+ return loadData(page);
270
+ }
271
+ }, "\u5237\u65B0"))
272
+ }, list.map(function (o) {
273
+ return /*#__PURE__*/_react.default.createElement(_card.default, {
274
+ hoverable: true,
275
+ style: {
276
+ width: '125px',
277
+ height: '130px',
278
+ display: 'inline-block',
279
+ margin: '10px',
280
+ verticalAlign: 'middle'
281
+ },
282
+ bodyStyle: {
283
+ padding: '15px 8px',
284
+ textAlign: 'center'
285
+ },
286
+ onDoubleClick: function onDoubleClick() {
287
+ if (!name) {
288
+ (0, _utils.showWarn)('选择图标组件未设置name属性');
289
+ return;
290
+ }
291
+
292
+ var formVal = formRef.current.getFieldsValue();
293
+ var val = (0, _objectSpread2.default)({}, formVal); //@ts-ignore
294
+
295
+ val[name] = o.mongoUrl;
296
+ formRef.current.setFieldsValue(val);
297
+ setImgUrl((0, _utils.toGatewayUrl)(o.mongoUrl));
298
+ setVisible(false);
299
+ }
300
+ }, /*#__PURE__*/_react.default.createElement("div", {
301
+ style: {
302
+ height: 80
303
+ }
304
+ }, /*#__PURE__*/_react.default.createElement("img", {
305
+ title: o.mongoName,
306
+ style: {
307
+ maxWidth: '80px',
308
+ maxHeight: '80px'
309
+ },
310
+ src: (0, _utils.toGatewayUrl)(o.mongoUrl)
311
+ })), /*#__PURE__*/_react.default.createElement("div", {
312
+ style: {
313
+ whiteSpace: 'nowrap',
314
+ textOverflow: 'ellipsis',
315
+ overflow: 'hidden'
316
+ }
317
+ }, o.mongoName));
318
+ })));
319
+ }
320
+
321
+ var _default = IconSelector;
322
+ exports.default = _default;
@@ -43,7 +43,7 @@ var _icons = require("@ant-design/icons");
43
43
 
44
44
  var _http = require("../http");
45
45
 
46
- var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect"],
46
+ var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps"],
47
47
  _excluded2 = ["current", "pageSize"];
48
48
 
49
49
  function InputTable(prop) {
@@ -93,6 +93,7 @@ function InputTable(prop) {
93
93
  allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
94
94
  _prop$keepSelect = prop.keepSelect,
95
95
  keepSelect = _prop$keepSelect === void 0 ? false : _prop$keepSelect,
96
+ fieldProps = prop.fieldProps,
96
97
  rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
97
98
  var textNameProp = textName || name + '__text';
98
99
 
@@ -175,7 +176,6 @@ function InputTable(prop) {
175
176
  var tableDom = /*#__PURE__*/_react.default.createElement(_lsProTable.default, (0, _extends2.default)({
176
177
  columns: columns,
177
178
  request: loadData,
178
- rowKey: valueField,
179
179
  manualRequest: false,
180
180
  actionRef: tableRef,
181
181
  search: {
@@ -247,7 +247,7 @@ function InputTable(prop) {
247
247
  name: name
248
248
  })), rest.label ? /*#__PURE__*/_react.default.createElement(_lsProForm.ProFormText, (0, _extends2.default)({
249
249
  name: textNameProp
250
- }, rest), /*#__PURE__*/_react.default.createElement(_input.default, {
250
+ }, rest), /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({
251
251
  suffix: /*#__PURE__*/_react.default.createElement(_popover.default, {
252
252
  content: /*#__PURE__*/_react.default.createElement("div", {
253
253
  style: {
@@ -260,9 +260,14 @@ function InputTable(prop) {
260
260
  trigger: "click",
261
261
  visible: visible,
262
262
  onVisibleChange: setVisible
263
- }, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, null)),
263
+ }, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, {
264
+ onClick: function onClick(e) {
265
+ setVisible(true);
266
+ e.stopPropagation && e.stopPropagation();
267
+ }
268
+ })),
264
269
  onClick: function onClick() {
265
- return setVisible(true);
270
+ setVisible(true);
266
271
  },
267
272
  onInput: function onInput(e) {
268
273
  var _formRef$current6;
@@ -285,7 +290,7 @@ function InputTable(prop) {
285
290
  },
286
291
  readOnly: readonly,
287
292
  allowClear: allowClear
288
- })) : /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({
293
+ }, fieldProps))) : /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({
289
294
  suffix: /*#__PURE__*/_react.default.createElement(_popover.default, {
290
295
  content: /*#__PURE__*/_react.default.createElement("div", {
291
296
  style: {
@@ -298,9 +303,14 @@ function InputTable(prop) {
298
303
  trigger: "click",
299
304
  visible: visible,
300
305
  onVisibleChange: setVisible
301
- }, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, null)),
306
+ }, /*#__PURE__*/_react.default.createElement(_icons.MoreOutlined, {
307
+ onClick: function onClick(e) {
308
+ setVisible(true);
309
+ e.stopPropagation && e.stopPropagation();
310
+ }
311
+ })),
302
312
  onClick: function onClick() {
303
- return setVisible(true);
313
+ setVisible(true);
304
314
  },
305
315
  onInput: function onInput(e) {
306
316
  var _formRef$current8;
@@ -327,7 +337,7 @@ function InputTable(prop) {
327
337
  readOnly: readonly,
328
338
  value: text,
329
339
  allowClear: allowClear
330
- }, rest === null || rest === void 0 ? void 0 : rest.fieldProps)));
340
+ }, fieldProps)));
331
341
  }
332
342
 
333
343
  var _default = InputTable;