@yilianjituan/yilian_dgerm 1.0.5 → 1.0.7-alpha.1
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/components/DropDownSelect/index.interface.d.ts +36 -32
- package/dist/components/DropDownSelect/index.js +4 -3
- package/dist/components/FilterRadio/index.interface.d.ts +33 -29
- package/dist/components/FilterRadio/index.js +15 -5
- package/dist/components/PageTemplate/index.interface.d.ts +3 -1
- package/dist/components/PageTemplate/index.js +22 -15
- package/dist/components/PageTemplate/resizable/index.d.ts +10 -10
- package/dist/components/PageTemplate/resizable/index.js +19 -18
- package/dist/components/TypographyText/index.interface.d.ts +1 -0
- package/dist/components/TypographyText/index.js +5 -3
- package/dist/components/YLModal/index.js +6 -1
- package/package.json +1 -1
|
@@ -1,76 +1,80 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SelectProps } from
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
3
|
export interface OptionItem {
|
|
4
4
|
/**
|
|
5
5
|
* @description 用于key
|
|
6
6
|
*/
|
|
7
7
|
id: string;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* @description 获取或者回填的值结构
|
|
10
|
+
*/
|
|
11
11
|
value: (item: any) => string;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
* @description list展示项
|
|
14
|
+
*/
|
|
15
15
|
lable: (item: any) => string | React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* @description 选项的额外属性
|
|
18
|
+
*/
|
|
19
|
+
optionProps?: (item: any) => any;
|
|
16
20
|
}
|
|
17
21
|
export interface DropDownSelectProps extends SelectProps {
|
|
18
22
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
* @description http请求
|
|
24
|
+
*/
|
|
21
25
|
http: any;
|
|
22
26
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
* @description 需要查询的接口
|
|
28
|
+
*/
|
|
25
29
|
url: string;
|
|
26
30
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
* @description http方法
|
|
32
|
+
* @default get
|
|
33
|
+
*/
|
|
30
34
|
method?: string;
|
|
31
35
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
* @description 选择后的回调,参数是传入的value
|
|
37
|
+
*/
|
|
34
38
|
handleSelect?: (value: string, option?: any) => void;
|
|
35
39
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
* @description 需要展示的和传出去的值
|
|
41
|
+
*/
|
|
38
42
|
showValue: OptionItem;
|
|
39
43
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
* @description 是否开启搜索查询
|
|
45
|
+
*/
|
|
42
46
|
customInput?: boolean;
|
|
43
47
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
* @description 输入搜索时的参数名
|
|
49
|
+
*/
|
|
46
50
|
searchValue?: string;
|
|
47
51
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
* @description 选择模式
|
|
53
|
+
*/
|
|
50
54
|
mode?: 'multiple' | 'tags' | undefined;
|
|
51
55
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
* @description 额外需要传入的字段
|
|
57
|
+
*/
|
|
54
58
|
additionalParameters?: any;
|
|
55
59
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
* @description 处理options的回调
|
|
61
|
+
*/
|
|
58
62
|
filterOptionsCallback?: (opt: any) => void;
|
|
59
63
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
* @description 选择变化的回调
|
|
65
|
+
*/
|
|
62
66
|
onChange?: (value: any) => void;
|
|
63
67
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
* @description 动态参数,执行查询需要执行之前处理的参数
|
|
69
|
+
*/
|
|
66
70
|
dynamicParameter?: any;
|
|
67
71
|
/**
|
|
68
72
|
* @description 动态参数,处理动态参数的方法
|
|
69
73
|
*/
|
|
70
74
|
beforeSearch?: (params: any) => void;
|
|
71
75
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
* @description 是否开启搜索查询
|
|
77
|
+
*/
|
|
74
78
|
changeNoSearch?: boolean;
|
|
75
79
|
/**
|
|
76
80
|
* @description 是否初始化搜索
|
|
@@ -50,7 +50,8 @@ var Index = function Index(props) {
|
|
|
50
50
|
prop = _objectWithoutProperties(props, _excluded);
|
|
51
51
|
var id = showValue.id,
|
|
52
52
|
value = showValue.value,
|
|
53
|
-
lable = showValue.lable
|
|
53
|
+
lable = showValue.lable,
|
|
54
|
+
optionProps = showValue.optionProps;
|
|
54
55
|
var _useState = useState([]),
|
|
55
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
56
57
|
storeList = _useState2[0],
|
|
@@ -210,10 +211,10 @@ var Index = function Index(props) {
|
|
|
210
211
|
})));
|
|
211
212
|
};
|
|
212
213
|
var options = storeList.map(function (item) {
|
|
213
|
-
return /*#__PURE__*/React.createElement(Option, {
|
|
214
|
+
return /*#__PURE__*/React.createElement(Option, _extends({
|
|
214
215
|
key: item[id],
|
|
215
216
|
value: value(item)
|
|
216
|
-
}, lable(item));
|
|
217
|
+
}, optionProps === null || optionProps === void 0 ? void 0 : optionProps(item)), lable(item));
|
|
217
218
|
});
|
|
218
219
|
var commonProps = _objectSpread(_objectSpread({}, prop), {}, {
|
|
219
220
|
mode: mode,
|
|
@@ -1,60 +1,64 @@
|
|
|
1
|
-
import { SizeType } from
|
|
1
|
+
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
2
2
|
export interface FilterRadioProps {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
* @description key
|
|
5
|
+
* @default key
|
|
6
|
+
*/
|
|
7
7
|
key: string;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* @description 是否有全选
|
|
10
|
+
*/
|
|
11
11
|
all: string | undefined;
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
* @description 是选项列表
|
|
14
|
+
* @default []
|
|
15
|
+
*/
|
|
16
16
|
list: {
|
|
17
17
|
id: string | number;
|
|
18
18
|
name: string;
|
|
19
19
|
}[];
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
* @description showMore
|
|
22
|
+
* @default showMore
|
|
23
|
+
*/
|
|
24
24
|
showMore?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
* @description name
|
|
27
|
+
*/
|
|
28
28
|
name?: '';
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
* @description label
|
|
31
|
+
*/
|
|
32
32
|
label?: string;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
* @description 表单配置
|
|
35
|
+
*/
|
|
36
36
|
options: FilterRadioOptions;
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
* @description 重置
|
|
39
|
+
*/
|
|
40
40
|
reset: boolean;
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
* @description 组件尺寸: large | middle | small
|
|
43
|
+
*/
|
|
44
44
|
size?: SizeType;
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
* @description defaultValue
|
|
47
|
+
* @default defaultValue
|
|
48
|
+
*/
|
|
49
49
|
defaultValue?: string | undefined;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
* @description 传入配置:all 、 list
|
|
52
|
+
*/
|
|
53
53
|
componentOptions: any;
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
* @description 反馈方法
|
|
56
|
+
*/
|
|
57
57
|
updateCallback: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* 防抖时间
|
|
60
|
+
*/
|
|
61
|
+
debounceTime?: number;
|
|
58
62
|
}
|
|
59
63
|
export interface FilterRadioOptions {
|
|
60
64
|
key: string;
|
|
@@ -4,10 +4,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import {
|
|
8
|
-
import { Form, Radio, DatePicker } from 'antd';
|
|
7
|
+
import { DatePicker, Form, Radio } from 'antd';
|
|
9
8
|
import dayjs from 'dayjs';
|
|
10
|
-
import
|
|
9
|
+
import debounce from 'lodash/debounce';
|
|
10
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
11
11
|
import "./index.scss";
|
|
12
12
|
var RangePicker = DatePicker.RangePicker;
|
|
13
13
|
var FilterRadio = function FilterRadio(props) {
|
|
@@ -19,7 +19,8 @@ var FilterRadio = function FilterRadio(props) {
|
|
|
19
19
|
all = props.all,
|
|
20
20
|
options = props.options,
|
|
21
21
|
reset = props.reset,
|
|
22
|
-
defaultValue = props.defaultValue
|
|
22
|
+
defaultValue = props.defaultValue,
|
|
23
|
+
debounceTime = props.debounceTime;
|
|
23
24
|
var key = options.key;
|
|
24
25
|
var _useState = useState(''),
|
|
25
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -30,13 +31,22 @@ var FilterRadio = function FilterRadio(props) {
|
|
|
30
31
|
useEffect(function () {
|
|
31
32
|
setTimeValue('');
|
|
32
33
|
}, [reset]);
|
|
34
|
+
var debounceUpdateCallback = useMemo(function () {
|
|
35
|
+
return debounce(function () {
|
|
36
|
+
updateCallback();
|
|
37
|
+
}, debounceTime);
|
|
38
|
+
}, [updateCallback]);
|
|
33
39
|
|
|
34
40
|
// 改变选项
|
|
35
41
|
var handleChangeRadio = function handleChangeRadio(e) {
|
|
36
42
|
if (key === 'timeType') {
|
|
37
43
|
setTimeValue(e.target.value);
|
|
38
44
|
}
|
|
39
|
-
|
|
45
|
+
if (debounceTime) {
|
|
46
|
+
debounceUpdateCallback();
|
|
47
|
+
} else {
|
|
48
|
+
updateCallback();
|
|
49
|
+
}
|
|
40
50
|
};
|
|
41
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
52
|
className: "radioInfos"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MethodEnum } from '../../commonType/globalEnum';
|
|
3
3
|
export interface IPageTemPropsData {
|
|
4
|
+
initialValues?: any;
|
|
5
|
+
formProps?: any;
|
|
4
6
|
http: any;
|
|
5
7
|
ref?: any;
|
|
6
8
|
rowKey?: string;
|
|
@@ -37,7 +39,7 @@ export interface IPageTemPropsData {
|
|
|
37
39
|
}
|
|
38
40
|
export interface IColumnsProps {
|
|
39
41
|
title: string;
|
|
40
|
-
dataIndex?:
|
|
42
|
+
dataIndex?: any;
|
|
41
43
|
render?: typeEmptyFunc | ((text: string | number, record: any, index: string | number) => any);
|
|
42
44
|
[name: string]: typeEmptyFunc | string | boolean | undefined | number | any;
|
|
43
45
|
}
|
|
@@ -37,7 +37,7 @@ import "./index.scss";
|
|
|
37
37
|
var FormItem = Form.Item;
|
|
38
38
|
var RangePicker = DatePicker.RangePicker;
|
|
39
39
|
var PageTemplate = function PageTemplate(props, ref) {
|
|
40
|
-
var _document$querySelect3;
|
|
40
|
+
var _document$querySelect3, _tableProps$scroll, _tableProps$scroll2;
|
|
41
41
|
var _Form$useForm = Form.useForm(),
|
|
42
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
43
43
|
form = _Form$useForm2[0];
|
|
@@ -56,7 +56,11 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
56
56
|
exportApi = props.exportApi,
|
|
57
57
|
_props$isScroll = props.isScroll,
|
|
58
58
|
isScroll = _props$isScroll === void 0 ? true : _props$isScroll,
|
|
59
|
-
buttonTheme = props.buttonTheme
|
|
59
|
+
buttonTheme = props.buttonTheme,
|
|
60
|
+
_props$initialValues = props.initialValues,
|
|
61
|
+
initialValues = _props$initialValues === void 0 ? {} : _props$initialValues,
|
|
62
|
+
_props$formProps = props.formProps,
|
|
63
|
+
formProps = _props$formProps === void 0 ? {} : _props$formProps;
|
|
60
64
|
var _useState = useState([]),
|
|
61
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
66
|
dataSource = _useState2[0],
|
|
@@ -152,7 +156,7 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
152
156
|
key: 'rowIndex',
|
|
153
157
|
align: 'center',
|
|
154
158
|
fixed: 'left',
|
|
155
|
-
|
|
159
|
+
width: 70,
|
|
156
160
|
ellipsis: {
|
|
157
161
|
showTitle: false
|
|
158
162
|
},
|
|
@@ -164,8 +168,9 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
164
168
|
}
|
|
165
169
|
_columns = _columns.map(function (item) {
|
|
166
170
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
167
|
-
minWidth: item.minWidth || item.title.length * 20 + 20,
|
|
168
|
-
|
|
171
|
+
minWidth: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? undefined : item.minWidth || item.title.length * 20 + 20,
|
|
172
|
+
width: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? 70 : item.width,
|
|
173
|
+
ellipsis: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? false : typeof item.ellipsis === 'boolean' ? item.ellipsis : true,
|
|
169
174
|
align: item.align || 'center',
|
|
170
175
|
fixed: item.fixed || (['action', 'operation', 'handle', 'handle_box'].includes(item.dataIndex) ? 'right' : ['rowIndex'].includes(item.key) ? 'left' : undefined)
|
|
171
176
|
});
|
|
@@ -256,9 +261,10 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
256
261
|
setReset(function (prevState) {
|
|
257
262
|
return !prevState;
|
|
258
263
|
});
|
|
259
|
-
|
|
260
264
|
// 重置后默认查询
|
|
261
265
|
setTimeout(function () {
|
|
266
|
+
var pageSize = props.pageSize;
|
|
267
|
+
pageSizeRef.current = pageSize || 20;
|
|
262
268
|
_onSearch();
|
|
263
269
|
});
|
|
264
270
|
};
|
|
@@ -383,12 +389,13 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
383
389
|
return 'actions';
|
|
384
390
|
}
|
|
385
391
|
};
|
|
386
|
-
return /*#__PURE__*/React.createElement(Form, {
|
|
392
|
+
return /*#__PURE__*/React.createElement(Form, _extends({
|
|
387
393
|
layout: "inline",
|
|
388
394
|
form: form,
|
|
389
395
|
onFinish: beforeSearch,
|
|
390
|
-
autoComplete: "off"
|
|
391
|
-
|
|
396
|
+
autoComplete: "off",
|
|
397
|
+
initialValues: initialValues
|
|
398
|
+
}, formProps), /*#__PURE__*/React.createElement("div", {
|
|
392
399
|
className: "filter-container"
|
|
393
400
|
}, /*#__PURE__*/React.createElement("div", {
|
|
394
401
|
className: "filter-box filter-box-base"
|
|
@@ -449,16 +456,16 @@ var PageTemplate = function PageTemplate(props, ref) {
|
|
|
449
456
|
style: {
|
|
450
457
|
marginTop: 10
|
|
451
458
|
},
|
|
452
|
-
scroll: {
|
|
453
|
-
x: 1500,
|
|
454
|
-
y: tableHeight || undefined
|
|
455
|
-
},
|
|
456
459
|
bordered: true,
|
|
457
460
|
dataSource: dataSource,
|
|
458
|
-
size: "small"
|
|
459
|
-
}, tableProps, {
|
|
461
|
+
size: "small",
|
|
460
462
|
columns: columns,
|
|
461
463
|
tableLayout: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.tableLayout) || 'auto'
|
|
464
|
+
}, tableProps, {
|
|
465
|
+
scroll: {
|
|
466
|
+
x: dataSource.length > 0 ? (tableProps === null || tableProps === void 0 || (_tableProps$scroll = tableProps.scroll) === null || _tableProps$scroll === void 0 ? void 0 : _tableProps$scroll.x) || 'max-content' : 1500,
|
|
467
|
+
y: dataSource.length > 0 ? (tableProps === null || tableProps === void 0 || (_tableProps$scroll2 = tableProps.scroll) === null || _tableProps$scroll2 === void 0 ? void 0 : _tableProps$scroll2.y) || 'max-content' : 1500
|
|
468
|
+
}
|
|
462
469
|
// components={{ header: { cell: ResizableTitle } }}
|
|
463
470
|
// columns={mergedColumns(columns, tableRef, (_columns) =>
|
|
464
471
|
// setColumns(_columns),
|
|
@@ -10,16 +10,16 @@ interface TitlePropsType {
|
|
|
10
10
|
isEnd?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* 设置表格列宽的初始化值
|
|
14
|
-
* ^判断初始columns中设置的width是否为number
|
|
15
|
-
* ^使用ref获取所有的列宽,存储在widthsList,如果width不为number,则取获取的dom宽或者默认为150
|
|
16
|
-
*
|
|
17
|
-
* @param columns - 初始化的columns.
|
|
18
|
-
* @param tableRef - table外层的div的ref,用于获取table的dom的列宽.
|
|
19
|
-
* @param newColumnsVoid - callback,传出新的columns.
|
|
20
|
-
* @return 给columns里的增加onResize属性,用于在Resizable进行控制.
|
|
21
|
-
*/
|
|
13
|
+
* 设置表格列宽的初始化值
|
|
14
|
+
* ^判断初始columns中设置的width是否为number
|
|
15
|
+
* ^使用ref获取所有的列宽,存储在widthsList,如果width不为number,则取获取的dom宽或者默认为150
|
|
16
|
+
*
|
|
17
|
+
* @param columns - 初始化的columns.
|
|
18
|
+
* @param tableRef - table外层的div的ref,用于获取table的dom的列宽.
|
|
19
|
+
* @param newColumnsVoid - callback,传出新的columns.
|
|
20
|
+
* @return 给columns里的增加onResize属性,用于在Resizable进行控制.
|
|
21
|
+
*/
|
|
22
22
|
declare const mergedColumns: (columns: TableColumnsType<DataType>, tableRef: RefObject<HTMLDivElement>, newColumnsVoid: (columns: any) => void) => (import("antd").TableColumnGroupType<DataType> | import("antd").TableColumnType<DataType>)[];
|
|
23
23
|
declare const ResizableTitle: React.FC<Readonly<React.HTMLAttributes<HTMLTableCellElement> & TitlePropsType>>;
|
|
24
24
|
declare const CustomTable: React.FC<TableProps<any>>;
|
|
25
|
-
export { mergedColumns, ResizableTitle
|
|
25
|
+
export { CustomTable, mergedColumns, ResizableTitle };
|
|
@@ -59,15 +59,15 @@ var handleResize = function handleResize(index, columns, newColumnsVoid) {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
|
-
* 设置表格列宽的初始化值
|
|
63
|
-
* ^判断初始columns中设置的width是否为number
|
|
64
|
-
* ^使用ref获取所有的列宽,存储在widthsList,如果width不为number,则取获取的dom宽或者默认为150
|
|
65
|
-
*
|
|
66
|
-
* @param columns - 初始化的columns.
|
|
67
|
-
* @param tableRef - table外层的div的ref,用于获取table的dom的列宽.
|
|
68
|
-
* @param newColumnsVoid - callback,传出新的columns.
|
|
69
|
-
* @return 给columns里的增加onResize属性,用于在Resizable进行控制.
|
|
70
|
-
*/
|
|
62
|
+
* 设置表格列宽的初始化值
|
|
63
|
+
* ^判断初始columns中设置的width是否为number
|
|
64
|
+
* ^使用ref获取所有的列宽,存储在widthsList,如果width不为number,则取获取的dom宽或者默认为150
|
|
65
|
+
*
|
|
66
|
+
* @param columns - 初始化的columns.
|
|
67
|
+
* @param tableRef - table外层的div的ref,用于获取table的dom的列宽.
|
|
68
|
+
* @param newColumnsVoid - callback,传出新的columns.
|
|
69
|
+
* @return 给columns里的增加onResize属性,用于在Resizable进行控制.
|
|
70
|
+
*/
|
|
71
71
|
var mergedColumns = function mergedColumns(columns, tableRef, newColumnsVoid) {
|
|
72
72
|
if (!columns || columns.length === 0) {
|
|
73
73
|
return []; // 处理columns为空或长度为0的情况
|
|
@@ -159,7 +159,7 @@ var ResizableTitle = function ResizableTitle(props) {
|
|
|
159
159
|
}, /*#__PURE__*/React.createElement("th", restProps));
|
|
160
160
|
};
|
|
161
161
|
var CustomTable = function CustomTable(props) {
|
|
162
|
-
var _document$querySelect3;
|
|
162
|
+
var _document$querySelect3, _restProps$scroll, _restProps$scroll2;
|
|
163
163
|
var components = props.components,
|
|
164
164
|
columns = props.columns,
|
|
165
165
|
dataSource = props.dataSource,
|
|
@@ -188,8 +188,9 @@ var CustomTable = function CustomTable(props) {
|
|
|
188
188
|
var _columns = _toConsumableArray(columns);
|
|
189
189
|
_columns = _columns.map(function (item) {
|
|
190
190
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
191
|
-
minWidth: item.minWidth || item.title.length * 20 + 20,
|
|
192
|
-
|
|
191
|
+
minWidth: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? undefined : item.minWidth || item.title.length * 20 + 20,
|
|
192
|
+
width: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? 70 : item.width,
|
|
193
|
+
ellipsis: ['index', 'rowIndex'].includes(item.key) || ['index', 'rowIndex'].includes(item.dataIndex) ? false : typeof item.ellipsis === 'boolean' ? item.ellipsis : true,
|
|
193
194
|
align: item.align || 'center',
|
|
194
195
|
fixed: item.fixed || (['action', 'operation', 'handle', 'handle_box'].includes(item.dataIndex) ? 'right' : ['rowIndex'].includes(item.key) ? 'left' : undefined)
|
|
195
196
|
});
|
|
@@ -206,11 +207,6 @@ var CustomTable = function CustomTable(props) {
|
|
|
206
207
|
ref: tableRef
|
|
207
208
|
}, /*#__PURE__*/React.createElement(Table, _extends({
|
|
208
209
|
size: "small"
|
|
209
|
-
}, restProps, {
|
|
210
|
-
scroll: {
|
|
211
|
-
x: 1500,
|
|
212
|
-
y: tableHeight || undefined
|
|
213
|
-
}
|
|
214
210
|
// columns={mergedColumns(column as any, tableRef, (_columns) => setColumn(_columns as any)) as any}
|
|
215
211
|
,
|
|
216
212
|
columns: column
|
|
@@ -219,6 +215,11 @@ var CustomTable = function CustomTable(props) {
|
|
|
219
215
|
components: components,
|
|
220
216
|
dataSource: dataSource || [],
|
|
221
217
|
tableLayout: tableLayout || 'auto'
|
|
218
|
+
}, restProps, {
|
|
219
|
+
scroll: {
|
|
220
|
+
x: dataSource && dataSource.length > 0 ? (restProps === null || restProps === void 0 || (_restProps$scroll = restProps.scroll) === null || _restProps$scroll === void 0 ? void 0 : _restProps$scroll.x) || 'max-content' : 1500,
|
|
221
|
+
y: dataSource && dataSource.length > 0 ? (restProps === null || restProps === void 0 || (_restProps$scroll2 = restProps.scroll) === null || _restProps$scroll2 === void 0 ? void 0 : _restProps$scroll2.y) || 'max-content' : 1500
|
|
222
|
+
}
|
|
222
223
|
})));
|
|
223
224
|
};
|
|
224
|
-
export { mergedColumns, ResizableTitle
|
|
225
|
+
export { CustomTable, mergedColumns, ResizableTitle };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["text", "rows", "copy", "type", "expandable", "ellipsis"];
|
|
2
|
+
var _excluded = ["className", "text", "rows", "copy", "type", "expandable", "ellipsis"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -21,7 +21,8 @@ import "./index.scss";
|
|
|
21
21
|
// 参考antd的Typography,只能用与Paragraph
|
|
22
22
|
/// 如果需要自定义,则手动传入ellipsis,会覆盖默认值
|
|
23
23
|
var Index = function Index(props) {
|
|
24
|
-
var
|
|
24
|
+
var className = props.className,
|
|
25
|
+
text = props.text,
|
|
25
26
|
_props$rows = props.rows,
|
|
26
27
|
rows = _props$rows === void 0 ? 1 : _props$rows,
|
|
27
28
|
_props$copy = props.copy,
|
|
@@ -41,7 +42,7 @@ var Index = function Index(props) {
|
|
|
41
42
|
var textRender = function textRender() {
|
|
42
43
|
return /*#__PURE__*/React.createElement(Typography.Paragraph, _extends({
|
|
43
44
|
// rows = 1时,需要自行设置css,否则会默认全部展示
|
|
44
|
-
className: rows === 1 && !expanded && !expandable ? 'custom_Typography_row1' : '',
|
|
45
|
+
className: "".concat(rows === 1 && !expanded && !expandable ? 'custom_Typography_row1' : '', " ").concat(className || ''),
|
|
45
46
|
style: {
|
|
46
47
|
marginBottom: 0,
|
|
47
48
|
color: '#000000'
|
|
@@ -62,6 +63,7 @@ var Index = function Index(props) {
|
|
|
62
63
|
}, rest), /*#__PURE__*/React.createElement(React.Fragment, null, text || ''));
|
|
63
64
|
};
|
|
64
65
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !expanded ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
66
|
+
className: "".concat(className || ''),
|
|
65
67
|
title: text
|
|
66
68
|
}, textRender()) : /*#__PURE__*/React.createElement(React.Fragment, null, textRender()));
|
|
67
69
|
};
|
|
@@ -12,6 +12,8 @@ import React, { useRef, useState } from 'react';
|
|
|
12
12
|
import { Modal } from 'antd';
|
|
13
13
|
import debounce from 'lodash/debounce';
|
|
14
14
|
import Draggable from 'react-draggable';
|
|
15
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
16
|
+
|
|
15
17
|
// 平台常见弹窗宽度分类
|
|
16
18
|
// 1300 审方 开户信息查询详情
|
|
17
19
|
// 1000, 订单 | 药品 | 医生认证
|
|
@@ -66,7 +68,10 @@ var YLModal = function YLModal(props) {
|
|
|
66
68
|
closable: closable,
|
|
67
69
|
maskClosable: false,
|
|
68
70
|
width: width || 700,
|
|
69
|
-
className: "yl-modal ".concat(className || '')
|
|
71
|
+
className: "yl-modal custom_modal_close_icon ".concat(className || ''),
|
|
72
|
+
closeIcon: /*#__PURE__*/React.createElement("span", {
|
|
73
|
+
className: "custom_close_icon"
|
|
74
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null), "\u5173\u95ED")
|
|
70
75
|
}, restParams, {
|
|
71
76
|
onOk: whetherDebounce && props.onOk ? React.useMemo(function () {
|
|
72
77
|
return debounce(props.onOk, debounceTimeout);
|