zmdms-webui 1.9.6 → 1.9.8
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 +3 -1
- package/dist/es/button/buttonFullScreen.d.ts +9 -0
- package/dist/es/button/buttonFullScreen.js +28 -0
- package/dist/es/button/interface.d.ts +3 -0
- package/dist/es/dynamicsetting/index.css +1 -1
- package/dist/es/table/components/TableMenu.js +19 -13
- package/dist/es/table/excel.js +128 -39
- package/dist/es/table/hooks.js +10 -1
- package/dist/es/table/index.css +1 -1
- package/dist/es/table/interface.d.ts +12 -1
- package/dist/es/table/table.js +5 -2
- package/dist/es/table/useColumns.js +11 -1
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/package.json +1 -1
|
@@ -237,7 +237,14 @@ interface IColumnType<RecordType> extends Omit<ColumnType<RecordType>, "render">
|
|
|
237
237
|
* 表头背景色
|
|
238
238
|
*/
|
|
239
239
|
headerBgColor?: string;
|
|
240
|
+
/**
|
|
241
|
+
* 表头字体颜色
|
|
242
|
+
*/
|
|
243
|
+
headerFontColor?: string;
|
|
240
244
|
};
|
|
245
|
+
dateFormat?: string;
|
|
246
|
+
precision?: number;
|
|
247
|
+
thousand?: boolean;
|
|
241
248
|
}
|
|
242
249
|
interface IRenderOptions {
|
|
243
250
|
insertTableFromClipboard: IFuncInsertTableFromClipboard;
|
|
@@ -296,7 +303,11 @@ interface ITableRefHandel {
|
|
|
296
303
|
/**
|
|
297
304
|
* 导出excel
|
|
298
305
|
*/
|
|
299
|
-
exportExcel?: (fileName: string
|
|
306
|
+
exportExcel?: (fileName: string, config?: {
|
|
307
|
+
topDescription?: string;
|
|
308
|
+
time?: string;
|
|
309
|
+
topDescriptionRowHeight?: number;
|
|
310
|
+
}) => void;
|
|
300
311
|
}
|
|
301
312
|
interface ITableProps<RecordType> extends Omit<TableProps<RecordType>, "columns"> {
|
|
302
313
|
/**
|
package/dist/es/table/table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest, __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { memo, useState, useMemo,
|
|
3
|
+
import { memo, useRef, useState, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
4
4
|
import { Table as Table$1 } from 'antd';
|
|
5
5
|
import { BasicBodyRow, MoveBodyRow } from './components/EnhanceBodyRow.js';
|
|
6
6
|
import EnhanceCell from './components/EnhanceBodyCell.js';
|
|
@@ -45,6 +45,7 @@ var Table = function (props) {
|
|
|
45
45
|
var classes = classNames("ztxk-table", className, {
|
|
46
46
|
"ztxk-table--flex": isFlex,
|
|
47
47
|
});
|
|
48
|
+
var tableMenuRef = useRef();
|
|
48
49
|
var menuId = useState(isContextMenu
|
|
49
50
|
? "menuId-" + Math.floor(Math.random() * 100000000)
|
|
50
51
|
: undefined)[0];
|
|
@@ -313,6 +314,8 @@ var Table = function (props) {
|
|
|
313
314
|
exportExcel: exportExcel,
|
|
314
315
|
/** 获取表格容器 */
|
|
315
316
|
getContainer: function () { return tableRef.current; },
|
|
317
|
+
/** 全屏展示表格 */
|
|
318
|
+
toggleFullScreen: function () { var _a; return (_a = tableMenuRef.current) === null || _a === void 0 ? void 0 : _a.toggleFullscreen(); },
|
|
316
319
|
};
|
|
317
320
|
});
|
|
318
321
|
// 表格
|
|
@@ -336,7 +339,7 @@ var Table = function (props) {
|
|
|
336
339
|
overflow: "hidden",
|
|
337
340
|
marginTop: isMarginTop ? 10 : 0,
|
|
338
341
|
marginBottom: isMarginBottom ? 10 : 0,
|
|
339
|
-
}, ref: tableRef, id: tableId }, { children: [isMove ? (jsx(DndProvider, __assign({ backend: HTML5Backend, context: window }, { children: SingleTable }))) : (SingleTable), dynamicKey ? (jsx(DynamicSetting, { parentDynamicKey: TABLE_DYNAMIC_KEY, dynamicKey: dynamicKey, defaultList: defaultDynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: true, isMore: true, isFixed: true, isDimensionDynamic: isDimensionDynamic })) : null, menuId ? (jsx(TableMenu, { menuId: menuId, tableRef: tableRef, isFullscreenHandle: isFullscreenHandle })) : null] })));
|
|
342
|
+
}, ref: tableRef, id: tableId, className: "ztxk-table--wrapper-container" }, { children: [isMove ? (jsx(DndProvider, __assign({ backend: HTML5Backend, context: window }, { children: SingleTable }))) : (SingleTable), dynamicKey ? (jsx(DynamicSetting, { parentDynamicKey: TABLE_DYNAMIC_KEY, dynamicKey: dynamicKey, defaultList: defaultDynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: true, isMore: true, isFixed: true, isDimensionDynamic: isDimensionDynamic })) : null, menuId ? (jsx(TableMenu, { menuId: menuId, tableRef: tableRef, isFullscreenHandle: isFullscreenHandle, tableMenuRef: tableMenuRef })) : null] })));
|
|
340
343
|
};
|
|
341
344
|
var MemoTable = memo(Table);
|
|
342
345
|
MemoTable.displayName = "ZTXK_WEBUI_Table";
|
|
@@ -15,6 +15,8 @@ import FilterDropdown, { createFilterValue, filterHandle } from './components/Fi
|
|
|
15
15
|
import Badge from './components/Badge.js';
|
|
16
16
|
import { PLACEHOLDER_NULL } from '../config/constant.js';
|
|
17
17
|
import { useMergeAddAndDel } from './hooks.js';
|
|
18
|
+
import dayjs from 'dayjs';
|
|
19
|
+
import { exactRound, addThousedSeparator } from 'zmdms-utils';
|
|
18
20
|
import SearchOutlined from '../node_modules/@ant-design/icons/es/icons/SearchOutlined.js';
|
|
19
21
|
import ModalComponent from '../modal/modal.js';
|
|
20
22
|
|
|
@@ -317,7 +319,15 @@ function useColumns(columns, options) {
|
|
|
317
319
|
if (typeof text === "object") {
|
|
318
320
|
return PLACEHOLDER_NULL;
|
|
319
321
|
}
|
|
320
|
-
|
|
322
|
+
if (text == null || text === "")
|
|
323
|
+
return PLACEHOLDER_NULL;
|
|
324
|
+
if (_column.dateFormat)
|
|
325
|
+
return dayjs(text).format(_column.dateFormat);
|
|
326
|
+
if (_column.precision)
|
|
327
|
+
text = exactRound(text, _column.precision);
|
|
328
|
+
if (_column.thousand)
|
|
329
|
+
text = addThousedSeparator(text);
|
|
330
|
+
return text;
|
|
321
331
|
};
|
|
322
332
|
}
|
|
323
333
|
if (_column.render) {
|