ls-pro-common 1.0.32 → 1.0.35
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.
- package/dist/common.css +9 -0
- package/dist/common.js +1 -1
- package/dist/common.min.css +9 -0
- package/dist/common.min.js +1 -1
- package/es/components/IconSelector.js +8 -1
- package/es/components/InputMultiLine.d.ts +41 -0
- package/es/components/InputMultiLine.js +142 -0
- package/es/components/InputTable.d.ts +50 -2
- package/es/components/InputTable.js +12 -8
- package/es/hooks/useDtl/index.js +17 -8
- package/es/hooks/useSingle/index.js +17 -8
- package/es/http/index.js +2 -5
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/components/IconSelector.js +8 -1
- package/lib/components/InputMultiLine.d.ts +41 -0
- package/lib/components/InputMultiLine.js +165 -0
- package/lib/components/InputTable.d.ts +50 -2
- package/lib/components/InputTable.js +10 -4
- package/lib/hooks/useDtl/index.js +17 -8
- package/lib/hooks/useSingle/index.js +17 -8
- package/lib/http/index.js +2 -5
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -0
- package/package.json +3 -3
|
@@ -129,7 +129,14 @@ function IconSelector(prop) {
|
|
|
129
129
|
var totalPage = useMemo(function () {
|
|
130
130
|
if (total === 0) return 1;
|
|
131
131
|
return Math.ceil(total / pageSize);
|
|
132
|
-
}, [total]);
|
|
132
|
+
}, [total]);
|
|
133
|
+
useEffect(function () {
|
|
134
|
+
var val = formRef.current.getFieldsValue();
|
|
135
|
+
|
|
136
|
+
if (val && val[name]) {
|
|
137
|
+
setImgUrl(toGatewayUrl(val[name]));
|
|
138
|
+
}
|
|
139
|
+
}, []); // 验证上传文件大小
|
|
133
140
|
|
|
134
141
|
var beforeUpload = function beforeUpload(file) {
|
|
135
142
|
var sizeLimit = file.size / 1024 / 1024 >= maxSize;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputProps } from 'antd';
|
|
3
|
+
import type { ProFormItemProps } from 'ls-pro-form';
|
|
4
|
+
export declare type InputMultiLineProps = ProFormItemProps<InputProps> & {
|
|
5
|
+
/**@name 表单项name, 跟 form.item 的 name一致 */
|
|
6
|
+
name: string;
|
|
7
|
+
/**@name 表单值*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**@name 弹框宽度,默认为400 */
|
|
10
|
+
popWidth?: string;
|
|
11
|
+
/**@name 弹框位置,默认为bottom */
|
|
12
|
+
placement?: string;
|
|
13
|
+
/**@name 多行文本框行数 */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** @name 最大输入行数 */
|
|
16
|
+
maxRows?: number;
|
|
17
|
+
};
|
|
18
|
+
declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
19
|
+
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
20
|
+
placeholder?: string | string[] | undefined;
|
|
21
|
+
secondary?: boolean | undefined;
|
|
22
|
+
allowClear?: boolean | undefined;
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
width?: number | "sm" | "md" | "xl" | "xs" | "lg" | undefined;
|
|
25
|
+
proFieldProps?: import("../../../utils/lib").ProFieldProps | undefined;
|
|
26
|
+
footerRender?: import("../../../form/lib").LightFilterFooterRender | undefined;
|
|
27
|
+
} & Omit<import("../../../form/lib/components/FormItem").ProFormItemProps, "valueType"> & import("../../../form/lib/interface").ExtendsProps & {
|
|
28
|
+
/**@name 表单项name, 跟 form.item 的 name一致 */
|
|
29
|
+
name: string;
|
|
30
|
+
/**@name 表单值*/
|
|
31
|
+
value?: string | undefined;
|
|
32
|
+
/**@name 弹框宽度,默认为400 */
|
|
33
|
+
popWidth?: string | undefined;
|
|
34
|
+
/**@name 弹框位置,默认为bottom */
|
|
35
|
+
placement?: string | undefined;
|
|
36
|
+
/**@name 多行文本框行数 */
|
|
37
|
+
rows?: number | undefined;
|
|
38
|
+
/** @name 最大输入行数 */
|
|
39
|
+
maxRows?: number | undefined;
|
|
40
|
+
} & React.RefAttributes<unknown>>;
|
|
41
|
+
export default InputMultiLine;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import "antd/es/popover/style";
|
|
3
|
+
import _Popover from "antd/es/popover";
|
|
4
|
+
import "antd/es/input/style";
|
|
5
|
+
import _Input from "antd/es/input";
|
|
6
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
|
+
var _excluded = ["name", "rows", "maxRows", "placement", "popWidth", "fieldProps", "value", "allowClear"];
|
|
10
|
+
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
11
|
+
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
12
|
+
import { UnorderedListOutlined } from '@ant-design/icons';
|
|
13
|
+
var InputMultiLine = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
var _useContext = useContext(ProFormContext),
|
|
16
|
+
formRef = _useContext.formRef;
|
|
17
|
+
|
|
18
|
+
var _useState = useState(''),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
text = _useState2[0],
|
|
21
|
+
setText = _useState2[1];
|
|
22
|
+
|
|
23
|
+
var _useState3 = useState(''),
|
|
24
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
|
+
lineText = _useState4[0],
|
|
26
|
+
setLineText = _useState4[1];
|
|
27
|
+
|
|
28
|
+
var _useState5 = useState(false),
|
|
29
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
30
|
+
visible = _useState6[0],
|
|
31
|
+
setVisible = _useState6[1];
|
|
32
|
+
|
|
33
|
+
var inputRef = useRef();
|
|
34
|
+
useImperativeHandle(ref, function () {
|
|
35
|
+
return inputRef.current;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
var name = prop.name,
|
|
39
|
+
_prop$rows = prop.rows,
|
|
40
|
+
rows = _prop$rows === void 0 ? 12 : _prop$rows,
|
|
41
|
+
_prop$maxRows = prop.maxRows,
|
|
42
|
+
maxRows = _prop$maxRows === void 0 ? 20 : _prop$maxRows,
|
|
43
|
+
_prop$placement = prop.placement,
|
|
44
|
+
placement = _prop$placement === void 0 ? 'bottom' : _prop$placement,
|
|
45
|
+
_prop$popWidth = prop.popWidth,
|
|
46
|
+
popWidth = _prop$popWidth === void 0 ? '400px' : _prop$popWidth,
|
|
47
|
+
fieldProps = prop.fieldProps,
|
|
48
|
+
value = prop.value,
|
|
49
|
+
_prop$allowClear = prop.allowClear,
|
|
50
|
+
allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
|
|
51
|
+
rest = _objectWithoutProperties(prop, _excluded); // 设置初始值
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
if (value) {
|
|
56
|
+
setText(value);
|
|
57
|
+
} else if (name) {
|
|
58
|
+
var _formRef$current;
|
|
59
|
+
|
|
60
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
|
|
61
|
+
setText(formValue[name]);
|
|
62
|
+
}
|
|
63
|
+
}, []); // 显示多行输入时,赋值给多行文本框
|
|
64
|
+
|
|
65
|
+
useEffect(function () {
|
|
66
|
+
if (!visible) return;
|
|
67
|
+
var line = (text || '').split(',').join('\n');
|
|
68
|
+
setLineText(line);
|
|
69
|
+
}, [visible, text]); // 输入框值变化时,赋值给表单项
|
|
70
|
+
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
var _formRef$current2, _formRef$current3;
|
|
73
|
+
|
|
74
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
|
|
75
|
+
formValue[name] = text;
|
|
76
|
+
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldsValue(_objectSpread({}, formValue));
|
|
77
|
+
}, [text]);
|
|
78
|
+
|
|
79
|
+
var lineInput = function lineInput(e) {
|
|
80
|
+
var line = (e.target.value || '').split('\n').filter(function (o, i) {
|
|
81
|
+
return i <= (maxRows < 1 ? 1000 : maxRows);
|
|
82
|
+
}).join('\n');
|
|
83
|
+
var txt = line.split('\n').join(',');
|
|
84
|
+
setLineText(line);
|
|
85
|
+
setText(txt);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var textInput = function textInput(e) {
|
|
89
|
+
setText(e.target.value);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var clearValue = function clearValue(e) {
|
|
93
|
+
if (!e.target.value) {
|
|
94
|
+
setText('');
|
|
95
|
+
setLineText('');
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
var PopoverDom = useMemo(function () {
|
|
100
|
+
return /*#__PURE__*/React.createElement(_Popover, {
|
|
101
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
style: {
|
|
103
|
+
width: popWidth
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/React.createElement(_Input.TextArea, {
|
|
106
|
+
rows: rows,
|
|
107
|
+
value: lineText,
|
|
108
|
+
onInput: lineInput,
|
|
109
|
+
onKeyPress: function onKeyPress(e) {
|
|
110
|
+
if (e.key === 'Enter') e.stopPropagation();
|
|
111
|
+
}
|
|
112
|
+
})),
|
|
113
|
+
trigger: "click",
|
|
114
|
+
visible: visible,
|
|
115
|
+
onVisibleChange: setVisible
|
|
116
|
+
}, /*#__PURE__*/React.createElement(UnorderedListOutlined, {
|
|
117
|
+
onClick: function onClick(e) {
|
|
118
|
+
if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
|
|
119
|
+
setVisible(true);
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
122
|
+
}, [visible, popWidth, lineText, rest]);
|
|
123
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, rest.label && name ? /*#__PURE__*/React.createElement(ProFormText, _extends({
|
|
124
|
+
name: name
|
|
125
|
+
}, rest), /*#__PURE__*/React.createElement(_Input, _extends({
|
|
126
|
+
suffix: PopoverDom
|
|
127
|
+
}, fieldProps, {
|
|
128
|
+
onChange: clearValue,
|
|
129
|
+
onInput: textInput,
|
|
130
|
+
allowClear: allowClear,
|
|
131
|
+
ref: inputRef
|
|
132
|
+
}))) : /*#__PURE__*/React.createElement(_Input, _extends({
|
|
133
|
+
suffix: PopoverDom,
|
|
134
|
+
allowClear: allowClear
|
|
135
|
+
}, fieldProps, {
|
|
136
|
+
onChange: clearValue,
|
|
137
|
+
onInput: textInput,
|
|
138
|
+
value: text,
|
|
139
|
+
ref: inputRef
|
|
140
|
+
})));
|
|
141
|
+
});
|
|
142
|
+
export default InputMultiLine;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { InputProps } from 'antd';
|
|
3
3
|
import type { ProFormItemProps } from 'ls-pro-form';
|
|
4
4
|
export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
@@ -41,5 +41,53 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
41
41
|
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
42
42
|
afterLoad?: (rows: any[]) => void;
|
|
43
43
|
};
|
|
44
|
-
declare
|
|
44
|
+
declare const InputTable: React.ForwardRefExoticComponent<{
|
|
45
|
+
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
46
|
+
placeholder?: string | string[] | undefined;
|
|
47
|
+
secondary?: boolean | undefined;
|
|
48
|
+
allowClear?: boolean | undefined;
|
|
49
|
+
disabled?: boolean | undefined;
|
|
50
|
+
width?: number | "sm" | "md" | "xl" | "xs" | "lg" | undefined;
|
|
51
|
+
proFieldProps?: import("../../../utils/lib").ProFieldProps | undefined;
|
|
52
|
+
footerRender?: import("../../../form/lib").LightFilterFooterRender | undefined;
|
|
53
|
+
} & Omit<import("../../../form/lib/components/FormItem").ProFormItemProps, "valueType"> & import("../../../form/lib/interface").ExtendsProps & {
|
|
54
|
+
/**@name 弹框选择表格列配置 */
|
|
55
|
+
columns: any[];
|
|
56
|
+
/**@name 调用后端API地址 */
|
|
57
|
+
url: string;
|
|
58
|
+
/**@name 弹框表格高度,默认400 */
|
|
59
|
+
tableHeight?: number | undefined;
|
|
60
|
+
/**@name 弹框表格宽度,默认650*/
|
|
61
|
+
tableWidth?: number | undefined;
|
|
62
|
+
/**@name 是否支持多选 */
|
|
63
|
+
multiple?: boolean | undefined;
|
|
64
|
+
/**@name 表单项name, 跟 form.item 的 name一致 */
|
|
65
|
+
name: string;
|
|
66
|
+
/**@name 返回的值字段,表格中valueField配置的字段时返回给name */
|
|
67
|
+
valueField: string;
|
|
68
|
+
/**@name 返回输入框显示的字段,textField字段值返回给textName */
|
|
69
|
+
textField?: string | undefined;
|
|
70
|
+
/**@name 用于接收textField返回的值 */
|
|
71
|
+
textName?: string | undefined;
|
|
72
|
+
/** @name 表格的其它配置 */
|
|
73
|
+
tableConfig?: any;
|
|
74
|
+
/**@name 表单label宽度,默认70 */
|
|
75
|
+
labelWidth?: number | undefined;
|
|
76
|
+
/**@name 是否2.0接口 */
|
|
77
|
+
isV2?: boolean | undefined;
|
|
78
|
+
/**@name 是否支持跨页选择 */
|
|
79
|
+
keepSelect?: boolean | undefined;
|
|
80
|
+
/**@name 回车事件查询关键字 */
|
|
81
|
+
searchField?: string | undefined;
|
|
82
|
+
/**@name 填充其它表单项目配置 */
|
|
83
|
+
fillMap?: Record<string, string> | undefined;
|
|
84
|
+
/**@name 输入后检查数据的触发方式,默认为entry回车触发 */
|
|
85
|
+
triggerCheck?: "entry" | "blur" | undefined;
|
|
86
|
+
/**@name 选择行事件 */
|
|
87
|
+
onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
|
|
88
|
+
/**@name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
|
|
89
|
+
beforeLoad?: ((param: any) => void) | undefined;
|
|
90
|
+
/**@name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
|
|
91
|
+
afterLoad?: ((rows: any[]) => void) | undefined;
|
|
92
|
+
} & React.RefAttributes<unknown>>;
|
|
45
93
|
export default InputTable;
|
|
@@ -12,15 +12,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
13
|
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "triggerCheck"],
|
|
14
14
|
_excluded2 = ["current", "pageSize"];
|
|
15
|
-
import React from
|
|
16
|
-
import { useRef, useState, useEffect, useContext, useMemo } from 'react';
|
|
15
|
+
import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
|
|
17
16
|
import ProTable from 'ls-pro-table';
|
|
18
17
|
import { ProFormText, ProFormContext } from 'ls-pro-form';
|
|
19
18
|
import { MoreOutlined } from '@ant-design/icons';
|
|
20
19
|
import { httpGet } from '../http';
|
|
21
20
|
import { showWarn } from '../utils';
|
|
22
|
-
|
|
23
|
-
function InputTable(prop) {
|
|
21
|
+
var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
24
22
|
//@ts-ignore
|
|
25
23
|
var _useContext = useContext(ProFormContext),
|
|
26
24
|
formRef = _useContext.formRef;
|
|
@@ -42,6 +40,11 @@ function InputTable(prop) {
|
|
|
42
40
|
text = _useState6[0],
|
|
43
41
|
setText = _useState6[1];
|
|
44
42
|
|
|
43
|
+
var inputRef = useRef();
|
|
44
|
+
useImperativeHandle(ref, function () {
|
|
45
|
+
return inputRef.current;
|
|
46
|
+
});
|
|
47
|
+
|
|
45
48
|
var columns = prop.columns,
|
|
46
49
|
url = prop.url,
|
|
47
50
|
textName = prop.textName,
|
|
@@ -368,7 +371,8 @@ function InputTable(prop) {
|
|
|
368
371
|
}
|
|
369
372
|
},
|
|
370
373
|
readOnly: readonly,
|
|
371
|
-
allowClear: allowClear
|
|
374
|
+
allowClear: allowClear,
|
|
375
|
+
ref: inputRef
|
|
372
376
|
}, fieldProps))) : /*#__PURE__*/React.createElement(_Input, _extends({
|
|
373
377
|
suffix: /*#__PURE__*/React.createElement(_Popover, {
|
|
374
378
|
content: /*#__PURE__*/React.createElement("div", {
|
|
@@ -406,8 +410,8 @@ function InputTable(prop) {
|
|
|
406
410
|
onChange: clearValue,
|
|
407
411
|
readOnly: readonly,
|
|
408
412
|
value: text,
|
|
409
|
-
allowClear: allowClear
|
|
413
|
+
allowClear: allowClear,
|
|
414
|
+
ref: inputRef
|
|
410
415
|
}, fieldProps)));
|
|
411
|
-
}
|
|
412
|
-
|
|
416
|
+
});
|
|
413
417
|
export default InputTable;
|
package/es/hooks/useDtl/index.js
CHANGED
|
@@ -736,35 +736,44 @@ function useDtl(dtlParam) {
|
|
|
736
736
|
case 9:
|
|
737
737
|
result = _context8.sent;
|
|
738
738
|
|
|
739
|
+
if (!(result.data && typeof result.data === 'string')) {
|
|
740
|
+
_context8.next = 13;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
window.open(result.data);
|
|
745
|
+
return _context8.abrupt("return", true);
|
|
746
|
+
|
|
747
|
+
case 13:
|
|
739
748
|
if (!(((_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retCode) === '0')) {
|
|
740
|
-
_context8.next =
|
|
749
|
+
_context8.next = 18;
|
|
741
750
|
break;
|
|
742
751
|
}
|
|
743
752
|
|
|
744
753
|
showSuccess(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retMsg) || '导出成功');
|
|
745
754
|
return _context8.abrupt("return", true);
|
|
746
755
|
|
|
747
|
-
case
|
|
756
|
+
case 18:
|
|
748
757
|
showError(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出失败,请联系系统管理员');
|
|
749
758
|
return _context8.abrupt("return", false);
|
|
750
759
|
|
|
751
|
-
case
|
|
752
|
-
_context8.next =
|
|
760
|
+
case 20:
|
|
761
|
+
_context8.next = 27;
|
|
753
762
|
break;
|
|
754
763
|
|
|
755
|
-
case
|
|
756
|
-
_context8.prev =
|
|
764
|
+
case 22:
|
|
765
|
+
_context8.prev = 22;
|
|
757
766
|
_context8.t0 = _context8["catch"](6);
|
|
758
767
|
console.log(_context8.t0);
|
|
759
768
|
showError(_context8.t0.message);
|
|
760
769
|
return _context8.abrupt("return", false);
|
|
761
770
|
|
|
762
|
-
case
|
|
771
|
+
case 27:
|
|
763
772
|
case "end":
|
|
764
773
|
return _context8.stop();
|
|
765
774
|
}
|
|
766
775
|
}
|
|
767
|
-
}, _callee8, null, [[6,
|
|
776
|
+
}, _callee8, null, [[6, 22]]);
|
|
768
777
|
}));
|
|
769
778
|
|
|
770
779
|
return function onExportDtl(_x6, _x7) {
|
|
@@ -607,35 +607,44 @@ function useSingle(inParam) {
|
|
|
607
607
|
case 9:
|
|
608
608
|
result = _context7.sent;
|
|
609
609
|
|
|
610
|
+
if (!(result.data && typeof result.data === 'string')) {
|
|
611
|
+
_context7.next = 13;
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
window.open(result.data);
|
|
616
|
+
return _context7.abrupt("return", true);
|
|
617
|
+
|
|
618
|
+
case 13:
|
|
610
619
|
if (!(((_result$flag4 = result.flag) === null || _result$flag4 === void 0 ? void 0 : _result$flag4.retCode) === '0')) {
|
|
611
|
-
_context7.next =
|
|
620
|
+
_context7.next = 18;
|
|
612
621
|
break;
|
|
613
622
|
}
|
|
614
623
|
|
|
615
624
|
showSuccess(((_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retMsg) || '导出成功');
|
|
616
625
|
return _context7.abrupt("return", true);
|
|
617
626
|
|
|
618
|
-
case
|
|
627
|
+
case 18:
|
|
619
628
|
showError(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retMsg) || '导出失败,请联系系统管理员');
|
|
620
629
|
return _context7.abrupt("return", false);
|
|
621
630
|
|
|
622
|
-
case
|
|
623
|
-
_context7.next =
|
|
631
|
+
case 20:
|
|
632
|
+
_context7.next = 27;
|
|
624
633
|
break;
|
|
625
634
|
|
|
626
|
-
case
|
|
627
|
-
_context7.prev =
|
|
635
|
+
case 22:
|
|
636
|
+
_context7.prev = 22;
|
|
628
637
|
_context7.t0 = _context7["catch"](6);
|
|
629
638
|
console.log(_context7.t0);
|
|
630
639
|
showError(_context7.t0.message);
|
|
631
640
|
return _context7.abrupt("return", false);
|
|
632
641
|
|
|
633
|
-
case
|
|
642
|
+
case 27:
|
|
634
643
|
case "end":
|
|
635
644
|
return _context7.stop();
|
|
636
645
|
}
|
|
637
646
|
}
|
|
638
|
-
}, _callee7, null, [[6,
|
|
647
|
+
}, _callee7, null, [[6, 22]]);
|
|
639
648
|
}));
|
|
640
649
|
|
|
641
650
|
return function onExport(_x8, _x9) {
|
package/es/http/index.js
CHANGED
|
@@ -283,12 +283,9 @@ function _getDict() {
|
|
|
283
283
|
case 0:
|
|
284
284
|
showValue = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : true;
|
|
285
285
|
needGateWay = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : true;
|
|
286
|
-
api = '/lesoon-integration/sysDictDtl';
|
|
286
|
+
api = '/lesoon-integration/sysDictDtl/listByProperties';
|
|
287
287
|
param = {
|
|
288
|
-
|
|
289
|
-
dictCode: dictCode
|
|
290
|
-
},
|
|
291
|
-
ifPage: 0
|
|
288
|
+
dictCode: dictCode
|
|
292
289
|
};
|
|
293
290
|
return _context6.abrupt("return", fetchOptions(api, param, 'dictValue', 'displayName', showValue, needGateWay));
|
|
294
291
|
|
package/es/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import InputTable from './components/InputTable';
|
|
|
3
3
|
import Page404 from './components/404';
|
|
4
4
|
import Loading from './components/Loading';
|
|
5
5
|
import IconSelector from './components/IconSelector';
|
|
6
|
+
import InputMultiLine from './components/InputMultiLine';
|
|
6
7
|
import BaseService from './service/BaseService';
|
|
7
8
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
8
9
|
import * as utils from './utils';
|
|
@@ -14,4 +15,4 @@ import usePermission from './hooks/usePermission';
|
|
|
14
15
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
15
16
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
16
17
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps };
|
|
17
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
18
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, InputMultiLine, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
package/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import InputTable from './components/InputTable';
|
|
|
3
3
|
import Page404 from './components/404';
|
|
4
4
|
import Loading from './components/Loading';
|
|
5
5
|
import IconSelector from './components/IconSelector';
|
|
6
|
+
import InputMultiLine from './components/InputMultiLine';
|
|
6
7
|
import BaseService from './service/BaseService';
|
|
7
8
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
8
9
|
import * as utils from './utils';
|
|
@@ -11,4 +12,4 @@ import * as utils from './utils';
|
|
|
11
12
|
import useSingle from './hooks/useSingle';
|
|
12
13
|
import useDtl from './hooks/useDtl';
|
|
13
14
|
import usePermission from './hooks/usePermission';
|
|
14
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
15
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, InputMultiLine, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
@@ -159,7 +159,14 @@ function IconSelector(prop) {
|
|
|
159
159
|
var totalPage = (0, _react.useMemo)(function () {
|
|
160
160
|
if (total === 0) return 1;
|
|
161
161
|
return Math.ceil(total / pageSize);
|
|
162
|
-
}, [total]);
|
|
162
|
+
}, [total]);
|
|
163
|
+
(0, _react.useEffect)(function () {
|
|
164
|
+
var val = formRef.current.getFieldsValue();
|
|
165
|
+
|
|
166
|
+
if (val && val[name]) {
|
|
167
|
+
setImgUrl((0, _utils.toGatewayUrl)(val[name]));
|
|
168
|
+
}
|
|
169
|
+
}, []); // 验证上传文件大小
|
|
163
170
|
|
|
164
171
|
var beforeUpload = function beforeUpload(file) {
|
|
165
172
|
var sizeLimit = file.size / 1024 / 1024 >= maxSize;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputProps } from 'antd';
|
|
3
|
+
import type { ProFormItemProps } from 'ls-pro-form';
|
|
4
|
+
export declare type InputMultiLineProps = ProFormItemProps<InputProps> & {
|
|
5
|
+
/**@name 表单项name, 跟 form.item 的 name一致 */
|
|
6
|
+
name: string;
|
|
7
|
+
/**@name 表单值*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**@name 弹框宽度,默认为400 */
|
|
10
|
+
popWidth?: string;
|
|
11
|
+
/**@name 弹框位置,默认为bottom */
|
|
12
|
+
placement?: string;
|
|
13
|
+
/**@name 多行文本框行数 */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** @name 最大输入行数 */
|
|
16
|
+
maxRows?: number;
|
|
17
|
+
};
|
|
18
|
+
declare const InputMultiLine: React.ForwardRefExoticComponent<{
|
|
19
|
+
fieldProps?: (import("../../../form/lib/interface").FieldProps & InputProps) | undefined;
|
|
20
|
+
placeholder?: string | string[] | undefined;
|
|
21
|
+
secondary?: boolean | undefined;
|
|
22
|
+
allowClear?: boolean | undefined;
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
width?: number | "sm" | "md" | "xl" | "xs" | "lg" | undefined;
|
|
25
|
+
proFieldProps?: import("../../../utils/lib").ProFieldProps | undefined;
|
|
26
|
+
footerRender?: import("../../../form/lib").LightFilterFooterRender | undefined;
|
|
27
|
+
} & Omit<import("../../../form/lib/components/FormItem").ProFormItemProps, "valueType"> & import("../../../form/lib/interface").ExtendsProps & {
|
|
28
|
+
/**@name 表单项name, 跟 form.item 的 name一致 */
|
|
29
|
+
name: string;
|
|
30
|
+
/**@name 表单值*/
|
|
31
|
+
value?: string | undefined;
|
|
32
|
+
/**@name 弹框宽度,默认为400 */
|
|
33
|
+
popWidth?: string | undefined;
|
|
34
|
+
/**@name 弹框位置,默认为bottom */
|
|
35
|
+
placement?: string | undefined;
|
|
36
|
+
/**@name 多行文本框行数 */
|
|
37
|
+
rows?: number | undefined;
|
|
38
|
+
/** @name 最大输入行数 */
|
|
39
|
+
maxRows?: number | undefined;
|
|
40
|
+
} & React.RefAttributes<unknown>>;
|
|
41
|
+
export default InputMultiLine;
|