zmdms-webui 2.9.0 → 2.9.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/es/button/button.js +2 -1
- package/dist/es/button/index.css +1 -1
- package/dist/es/button/interface.d.ts +2 -0
- package/dist/es/config/ZtxkContext.d.ts +20 -0
- package/dist/es/config/ZtxkContext.js +5 -0
- package/dist/es/form/form.js +21 -13
- package/dist/es/form/index.css +1 -1
- package/dist/es/form/interface.d.ts +4 -0
- package/dist/es/form/toggle.js +6 -4
- package/dist/es/icon/index.js +1 -1
- package/dist/es/operationbtn/index.css +1 -0
- package/dist/es/operationbtn/interface.d.ts +13 -1
- package/dist/es/operationbtn/operationBtn.js +87 -27
- package/dist/es/table/components/ColumnDynamic.js +6 -2
- package/dist/es/table/components/FilterDropdown.js +9 -3
- package/dist/es/table/components/TitleOperation.js +1 -1
- package/dist/es/table/index.css +1 -1
- package/dist/es/table/interface.d.ts +12 -0
- package/dist/es/table/table.js +33 -16
- package/dist/es/table/useColumns.js +10 -4
- package/dist/es/table/useSummary.js +31 -20
- package/dist/es/table/useTableSummaryCollapse.js +29 -0
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/less/components/Button/style/index.less +5 -0
- package/dist/less/components/Form/style/index.less +9 -0
- package/dist/less/components/OperationBtn/style/index.less +63 -0
- package/dist/less/components/OperationBtn/style/style.less +2 -0
- package/dist/less/components/Table/style/index.less +35 -0
- package/dist/less/styles/index.less +2 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { Table } from 'antd';
|
|
5
5
|
import { plus, addThousedSeparator } from 'zmdms-utils';
|
|
6
6
|
import { IS_SUMMARY } from './constant.js';
|
|
7
7
|
|
|
8
8
|
function useSummary(summaryConfig, columns, options) {
|
|
9
|
-
var summaryFixed = options.summaryFixed, rowSelection = options.rowSelection, expandable = options.expandable, isAdd = options.isAdd, isDel = options.isDel;
|
|
9
|
+
var summaryFixed = options.summaryFixed, rowSelection = options.rowSelection, expandable = options.expandable, isAdd = options.isAdd, isDel = options.isDel, isTableSummaryCollapse = options.isTableSummaryCollapse, showSummary = options.showSummary, renderTableSummaryCollapse = options.renderTableSummaryCollapse;
|
|
10
10
|
// 是否存在选择项
|
|
11
11
|
var isRowSelection = rowSelection ? true : false;
|
|
12
12
|
// 是否存在可展开
|
|
@@ -19,24 +19,35 @@ function useSummary(summaryConfig, columns, options) {
|
|
|
19
19
|
fillNumber: fillNumber,
|
|
20
20
|
columns: columns,
|
|
21
21
|
});
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
return (jsxs(Table.Summary, __assign({ fixed: summaryFixed }, { children: [showSummary || !isTableSummaryCollapse
|
|
23
|
+
? summaryData.map(function (summary) {
|
|
24
|
+
var title = summary.title, key = summary.key, titleIndex = summary.titleIndex, list = summary.list, columnList = summary.columnList, fieldConfig = summary.fieldConfig;
|
|
25
|
+
return (jsx(Table.Summary.Row, { children: Array.isArray(list) &&
|
|
26
|
+
list.map(function (item, index) {
|
|
27
|
+
var _a;
|
|
28
|
+
// title的位置需要 算入 增减行中
|
|
29
|
+
if (titleIndex + Number(isAddOrDel) === index) {
|
|
30
|
+
return (jsx(Table.Summary.Cell, __assign({ index: index, align: "center" }, { children: title }), index));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
var column = columnList[index];
|
|
34
|
+
var columnKey = column === null || column === void 0 ? void 0 : column.key;
|
|
35
|
+
var align = (_a = fieldConfig === null || fieldConfig === void 0 ? void 0 : fieldConfig[columnKey]) === null || _a === void 0 ? void 0 : _a.align;
|
|
36
|
+
return (jsx(Table.Summary.Cell, __assign({ index: index, align: align }, { children: jsx("div", { children: item }) }), index));
|
|
37
|
+
}
|
|
38
|
+
}) }, key));
|
|
39
|
+
})
|
|
40
|
+
: null, isTableSummaryCollapse ? renderTableSummaryCollapse() : null] })));
|
|
41
|
+
}, [
|
|
42
|
+
summaryConfig,
|
|
43
|
+
fillNumber,
|
|
44
|
+
columns,
|
|
45
|
+
summaryFixed,
|
|
46
|
+
isAddOrDel,
|
|
47
|
+
showSummary,
|
|
48
|
+
isTableSummaryCollapse,
|
|
49
|
+
renderTableSummaryCollapse,
|
|
50
|
+
]);
|
|
40
51
|
return summaryConfig ? summaryHandle : undefined;
|
|
41
52
|
}
|
|
42
53
|
function recursionColumns(columns, options) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Table } from 'antd';
|
|
5
|
+
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import IconFont from '../icon/index.js';
|
|
7
|
+
|
|
8
|
+
function useTableSummaryCollapse(tableRef, isDefaultShow) {
|
|
9
|
+
if (isDefaultShow === void 0) { isDefaultShow = false; }
|
|
10
|
+
var _a = useState(isDefaultShow), showSummary = _a[0], setShowSummary = _a[1];
|
|
11
|
+
var renderTableSummaryCollapse = useMemoizedFn(function () {
|
|
12
|
+
var _a;
|
|
13
|
+
var tableWidth = ((_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
|
|
14
|
+
return (jsx(Table.Summary.Row, __assign({ className: "ztxk-table-summary-collapse", style: { width: "".concat(tableWidth - 15, "px") } }, { children: jsx("td", __assign({ style: { height: "20px", border: "none" } }, { children: jsxs("div", __assign({ className: "ztxk-table-summary-collapse-title", onClick: function () {
|
|
15
|
+
setShowSummary(!showSummary);
|
|
16
|
+
} }, { children: ["\u7EDF\u8BA1", jsx(IconFont, { type: "icon-a-lujingbiankuang", style: {
|
|
17
|
+
fontSize: 14,
|
|
18
|
+
color: "#768696",
|
|
19
|
+
transition: "transform 0.3s ease-in-out",
|
|
20
|
+
transform: "rotate(".concat(showSummary ? "180deg" : 0, ")"),
|
|
21
|
+
} })] })) })) })));
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
showSummary: showSummary,
|
|
25
|
+
renderTableSummaryCollapse: renderTableSummaryCollapse,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { useTableSummaryCollapse as default };
|