aldehyde 0.2.498 → 0.2.500
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/lib/controls/direct-file-view/index.d.ts.map +1 -1
- package/lib/controls/direct-file-view/index.js +35 -5
- package/lib/controls/direct-file-view/index.js.map +1 -1
- package/lib/controls/file-view/index.js +1 -1
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/layout2/components/search-menu.d.ts.map +1 -1
- package/lib/layout2/components/search-menu.js +5 -1
- package/lib/layout2/components/search-menu.js.map +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +7 -3
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/sider.d.ts.map +1 -1
- package/lib/layout2/sider.js +5 -1
- package/lib/layout2/sider.js.map +1 -1
- package/lib/layout3/header.d.ts.map +1 -1
- package/lib/layout3/header.js +7 -3
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout3/sider.d.ts.map +1 -1
- package/lib/layout3/sider.js +5 -1
- package/lib/layout3/sider.js.map +1 -1
- package/lib/layout4/header.d.ts.map +1 -1
- package/lib/layout4/header.js +7 -3
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout4/sider.d.ts.map +1 -1
- package/lib/layout4/sider.js +5 -1
- package/lib/layout4/sider.js.map +1 -1
- package/lib/layout5/header.d.ts.map +1 -1
- package/lib/layout5/header.js +7 -3
- package/lib/layout5/header.js.map +1 -1
- package/lib/layout5/sider.d.ts.map +1 -1
- package/lib/layout5/sider.js +5 -1
- package/lib/layout5/sider.js.map +1 -1
- package/lib/lowcode-components/assets/utils.d.ts +2 -0
- package/lib/lowcode-components/assets/utils.d.ts.map +1 -0
- package/lib/lowcode-components/assets/utils.js +13 -0
- package/lib/lowcode-components/assets/utils.js.map +1 -0
- package/lib/lowcode-components/base-text/index.d.ts +1 -0
- package/lib/lowcode-components/base-text/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-text/index.js +12 -6
- package/lib/lowcode-components/base-text/index.js.map +1 -1
- package/lib/lowcode-components/base-text/index.less +19 -19
- package/lib/lowcode-components/lowcode-view/component/component-container.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/component-container.js +50 -15
- package/lib/lowcode-components/lowcode-view/component/component-container.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/interface.d.ts +6 -0
- package/lib/lowcode-components/lowcode-view/interface.d.ts.map +1 -1
- package/lib/table/act-table.d.ts +2 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +32 -19
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts +1 -1
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +8 -5
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/index.css +28 -12
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +20 -6
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/resizable-table.js +3 -3
- package/lib/table/resizable-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +7 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/welcome/HCWelcome.js +9 -7
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/components/page-card.d.ts +1 -0
- package/lib/welcome/components/page-card.d.ts.map +1 -1
- package/lib/welcome/components/page-card.js +4 -1
- package/lib/welcome/components/page-card.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/direct-file-view/index.tsx +40 -8
- package/src/aldehyde/controls/file-view/index.tsx +1 -1
- package/src/aldehyde/layout2/components/search-menu.tsx +5 -1
- package/src/aldehyde/layout2/header.tsx +7 -3
- package/src/aldehyde/layout2/sider.tsx +6 -1
- package/src/aldehyde/layout3/header.tsx +7 -3
- package/src/aldehyde/layout3/sider.tsx +5 -1
- package/src/aldehyde/layout4/header.tsx +7 -3
- package/src/aldehyde/layout4/sider.tsx +5 -1
- package/src/aldehyde/layout5/header.tsx +7 -3
- package/src/aldehyde/layout5/sider.tsx +5 -1
- package/src/aldehyde/lowcode-components/assets/utils.ts +11 -0
- package/src/aldehyde/lowcode-components/base-text/index.less +19 -19
- package/src/aldehyde/lowcode-components/base-text/index.tsx +14 -12
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +60 -7
- package/src/aldehyde/lowcode-components/lowcode-view/interface.ts +6 -0
- package/src/aldehyde/table/act-table.tsx +37 -23
- package/src/aldehyde/table/column/column-builder.tsx +6 -5
- package/src/aldehyde/table/index.css +28 -12
- package/src/aldehyde/table/query-table.tsx +19 -5
- package/src/aldehyde/table/resizable-table.tsx +2 -2
- package/src/aldehyde/tmpl/interface.tsx +8 -1
- package/src/aldehyde/welcome/HCWelcome.js +9 -7
- package/src/aldehyde/welcome/components/page-card.tsx +5 -1
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import React, {
|
|
3
|
-
CSSProperties,
|
|
4
|
-
ForwardedRef,
|
|
5
|
-
forwardRef,
|
|
6
|
-
useImperativeHandle,
|
|
7
|
-
useState
|
|
8
|
-
} from 'react';
|
|
2
|
+
import React, { CSSProperties, ForwardedRef, forwardRef, useImperativeHandle, useMemo, useState } from 'react';
|
|
9
3
|
import { useLocale } from "../../locale/useLocale";
|
|
4
|
+
import { handleExpandStyle } from "../assets/utils";
|
|
10
5
|
import './index.less';
|
|
11
6
|
|
|
12
7
|
export interface BaseTextComponentStyle {
|
|
@@ -20,6 +15,7 @@ export interface BaseTextComponentStyle {
|
|
|
20
15
|
strokeColor?: string;
|
|
21
16
|
letterSpacing?: number;
|
|
22
17
|
lineHeight?: number;
|
|
18
|
+
expandStyle?: string; // 扩展样式
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
export interface BaseTextComponentProps {
|
|
@@ -41,15 +37,21 @@ const BaseTextComponent = forwardRef((props: BaseTextComponentProps, ref: Forwar
|
|
|
41
37
|
updateConfig: (newConfig) => setConfig({ ...newConfig }),
|
|
42
38
|
}));
|
|
43
39
|
|
|
44
|
-
const strokeStyle: CSSProperties = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
const strokeStyle: CSSProperties = useMemo(() => {
|
|
41
|
+
const { strokeWidth, strokeColor } = style || {};
|
|
42
|
+
return {
|
|
43
|
+
WebkitTextStrokeWidth: strokeWidth,
|
|
44
|
+
WebkitTextStrokeColor: strokeColor,
|
|
45
|
+
}
|
|
46
|
+
}, [style]);
|
|
47
|
+
|
|
48
|
+
// 扩展样式处理
|
|
49
|
+
const expandStyle = useMemo(() => handleExpandStyle(style?.expandStyle), [style]);
|
|
48
50
|
|
|
49
51
|
return (
|
|
50
52
|
<div
|
|
51
53
|
className={'base-text-component'}
|
|
52
|
-
style={{ ...style, ...strokeStyle }}
|
|
54
|
+
style={{ ...style, ...strokeStyle, ...expandStyle }}
|
|
53
55
|
>
|
|
54
56
|
{data?.staticData ? translate("${" + data.staticData + "}") : ""}
|
|
55
57
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, Suspense, useEffect, useRef, useState, useContext } from "react";
|
|
1
|
+
import React, { memo, Suspense, useEffect, useRef, useState, useContext, useMemo } from "react";
|
|
2
2
|
import Loading from "./loading";
|
|
3
3
|
import { ILayerItem, LayerManagerDataType } from "../interface";
|
|
4
4
|
import ComponentController from "./component-controller";
|
|
@@ -6,6 +6,53 @@ import abstractDesignerLoader from "./abstract-designer-loader";
|
|
|
6
6
|
import { useNavigate } from "react-router-dom";
|
|
7
7
|
import { ControllerContext } from "../index";
|
|
8
8
|
|
|
9
|
+
/** 静态 style,避免每次 render 重新创建对象 */
|
|
10
|
+
const BASE_OUTER_STYLE: React.CSSProperties = {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
transformOrigin: 'center',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const BASE_INNER_STYLE: React.CSSProperties = {
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%',
|
|
18
|
+
transformOrigin: 'center',
|
|
19
|
+
position: 'relative',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 根据 layer 数据统一计算外层 2D transform 与内层 3D transform。
|
|
24
|
+
* 外层只承载 translate/2D-rotate(供 moveable 操作),内层承载 rotateX/Y/Z。
|
|
25
|
+
* 职责分离,避免 moveable 将 3D 值写入 layer.transform 导致重复叠加。
|
|
26
|
+
*/
|
|
27
|
+
const resolveTransforms = (
|
|
28
|
+
layer: ILayerItem,
|
|
29
|
+
): { outerTransform: string; innerTransform?: string; has3D: boolean; perspective?: number } => {
|
|
30
|
+
const { rotateX, rotateY, rotateZ, perspective } = layer.transform3D || {};
|
|
31
|
+
const has3D = !!(rotateX || rotateY || rotateZ); // 是否存在3D转换
|
|
32
|
+
const baseTransform = layer.transform || `translate(${layer.x}px, ${layer.y}px)`;
|
|
33
|
+
// --- 外层 2D transform ---
|
|
34
|
+
let outerTransform: string;
|
|
35
|
+
if (has3D) {
|
|
36
|
+
// 仅提取 translate + 2D rotate,剥离可能混入的 3D 部分
|
|
37
|
+
const translateMatch = baseTransform.match(/translate\([^)]+\)/);
|
|
38
|
+
const translate = translateMatch ? translateMatch[0] : `translate(${layer.x}px, ${layer.y}px)`;
|
|
39
|
+
const rotateMatch = baseTransform.match(/\brotate\([^)]+\)/);
|
|
40
|
+
outerTransform = rotateMatch ? `${translate} ${rotateMatch[0]}` : translate;
|
|
41
|
+
} else {
|
|
42
|
+
outerTransform = baseTransform;
|
|
43
|
+
}
|
|
44
|
+
// --- 内层 3D transform ---
|
|
45
|
+
let innerTransform: string | undefined;
|
|
46
|
+
if (has3D) {
|
|
47
|
+
const parts: string[] = [];
|
|
48
|
+
if (rotateX) parts.push(`rotateX(${rotateX}deg)`);
|
|
49
|
+
if (rotateY) parts.push(`rotateY(${rotateY}deg)`);
|
|
50
|
+
if (rotateZ) parts.push(`rotateZ(${rotateZ}deg)`);
|
|
51
|
+
innerTransform = parts.join(' ');
|
|
52
|
+
}
|
|
53
|
+
return { outerTransform, innerTransform, has3D, perspective };
|
|
54
|
+
};
|
|
55
|
+
|
|
9
56
|
const registerProxy = (compId: string, controller: ComponentController) => {
|
|
10
57
|
controller.changeData = new Proxy(controller.changeData, {
|
|
11
58
|
apply(target, thisArg, argus) {
|
|
@@ -61,6 +108,11 @@ const ComponentContainer = memo((props: ComponentContainerProps) => {
|
|
|
61
108
|
}
|
|
62
109
|
}, []);
|
|
63
110
|
|
|
111
|
+
const { outerTransform, innerTransform, has3D, perspective } = useMemo(
|
|
112
|
+
() => resolveTransforms(layer),
|
|
113
|
+
[layer.transform, layer.x, layer.y, layer.transform3D],
|
|
114
|
+
);
|
|
115
|
+
|
|
64
116
|
return (
|
|
65
117
|
<Suspense fallback={<Loading />}>
|
|
66
118
|
<div
|
|
@@ -70,18 +122,19 @@ const ComponentContainer = memo((props: ComponentContainerProps) => {
|
|
|
70
122
|
data-hide={layer.hide}
|
|
71
123
|
key={layer.id + ''}
|
|
72
124
|
style={{
|
|
125
|
+
...BASE_OUTER_STYLE,
|
|
73
126
|
width: layer.width,
|
|
74
127
|
height: layer.height,
|
|
75
|
-
transform:
|
|
76
|
-
|
|
77
|
-
|
|
128
|
+
transform: outerTransform,
|
|
129
|
+
perspective: (has3D && perspective) ? `${perspective}px` : undefined,
|
|
130
|
+
transformStyle: has3D ? 'preserve-3d' : undefined,
|
|
131
|
+
visibility: layer.hide ? 'hidden' : 'visible',
|
|
78
132
|
border: 'none'
|
|
79
133
|
}} className={"lc-comp-item"}>
|
|
80
134
|
<div ref={ref} style={{
|
|
81
|
-
|
|
82
|
-
|
|
135
|
+
...BASE_INNER_STYLE,
|
|
136
|
+
transform: innerTransform,
|
|
83
137
|
pointerEvents: 'auto',
|
|
84
|
-
position: 'relative'
|
|
85
138
|
}} />
|
|
86
139
|
</div>
|
|
87
140
|
</Suspense>
|
|
@@ -33,6 +33,12 @@ export interface ILayerItem {
|
|
|
33
33
|
next?: string;
|
|
34
34
|
// 旋转
|
|
35
35
|
transform?: string;
|
|
36
|
+
transform3D?: { // 3D变换
|
|
37
|
+
rotateX?: number;
|
|
38
|
+
rotateY?: number;
|
|
39
|
+
rotateZ?: number;
|
|
40
|
+
perspective?: number;
|
|
41
|
+
};
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
export interface LayerManagerDataType {
|
|
@@ -123,6 +123,7 @@ interface ActTableStat {
|
|
|
123
123
|
pageSizeOptions?: number[]; // 设备分页数
|
|
124
124
|
customDrawerSize?: number | string; // 自定义页面抽屉宽度
|
|
125
125
|
tableNumber?: number; // 添加多表格-显示表格数量
|
|
126
|
+
isQuery?: boolean; // 是否为查询状态(配置默认不查询使用)
|
|
126
127
|
}
|
|
127
128
|
let serial_number = new Date().getTime();
|
|
128
129
|
let busyReminderTime = 0;
|
|
@@ -161,7 +162,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
161
162
|
pageSizeOptions: defPageSizeOptions,
|
|
162
163
|
customDrawerSize: undefined,
|
|
163
164
|
tableNumber: 0,
|
|
164
|
-
showTableAdd: undefined
|
|
165
|
+
showTableAdd: undefined,
|
|
166
|
+
isQuery: true, // 是否查询数据(配置默认不查询使用)
|
|
165
167
|
};
|
|
166
168
|
|
|
167
169
|
static contextType = LocaleContext;
|
|
@@ -500,28 +502,31 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
500
502
|
|
|
501
503
|
|
|
502
504
|
async componentDidMount() {
|
|
503
|
-
const { ltmplConfig, tableType, userPageConfig, defShowType, onUpdatePageSizeOptions, setUserPageConfig,
|
|
505
|
+
const { ltmplConfig, tableType, userPageConfig, defShowType, onUpdatePageSizeOptions, setUserPageConfig, criteriaData } = this.props;
|
|
504
506
|
const { sortedColIds } = userPageConfig || {};
|
|
505
507
|
const { translate } = this.context;
|
|
506
508
|
let sortedColConfigs = undefined;
|
|
507
509
|
if (ltmplConfig) {
|
|
508
|
-
|
|
510
|
+
const { notAutoQuery, columns, showType, rowCardCount } = ltmplConfig;
|
|
511
|
+
sortedColConfigs = tableType == 'report' ? columns : [
|
|
509
512
|
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
510
513
|
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
511
|
-
...
|
|
514
|
+
...columns,
|
|
512
515
|
];
|
|
513
516
|
if (sortedColIds) { // 使用缓存的列排序
|
|
514
517
|
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
515
518
|
}
|
|
516
|
-
const temViewModels = userPageConfig?.["viewModels"] || [defShowType ||
|
|
519
|
+
const temViewModels = userPageConfig?.["viewModels"] || [defShowType || showType || "table"];
|
|
517
520
|
this.setState({ viewModels: temViewModels });
|
|
518
521
|
if (onUpdatePageSizeOptions && temViewModels.includes("cardList")) { // 初始化是卡片视图,则更新父组件中分页数组
|
|
519
|
-
const temPageSizes = Array.from({ length: 7 }, (_, i) =>
|
|
522
|
+
const temPageSizes = Array.from({ length: 7 }, (_, i) => rowCardCount * Math.pow(2, i));
|
|
520
523
|
onUpdatePageSizeOptions(temPageSizes);
|
|
521
524
|
if (setUserPageConfig && !(userPageConfig?.pageSize >= 0)) setUserPageConfig({ pageSize: 1 });
|
|
522
525
|
this.setState({ pageSizeOptions: temPageSizes, sortedColConfigs });
|
|
523
|
-
} else {
|
|
526
|
+
} else if (!notAutoQuery) { // notAutoQuery页面加载时不默认请求数据
|
|
524
527
|
this.loadData(userPageConfig?.hiddenColIds || defaultDisabledColIds, [], sortedColConfigs);
|
|
528
|
+
} else {
|
|
529
|
+
this.setState({ sortedColConfigs, userCriteriaData: criteriaData, loading: false, isQuery: false });
|
|
525
530
|
}
|
|
526
531
|
}
|
|
527
532
|
this.getTabsOptions();
|
|
@@ -550,8 +555,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
550
555
|
|
|
551
556
|
async componentDidUpdate(prevProps, prevState) {
|
|
552
557
|
const { sourceId, criteriaData, ltmplConfig, tableType, pageSize, pageNo, userPageConfig, defShowType } = this.props;
|
|
553
|
-
|
|
554
|
-
const { userCriteriaData } = this.state;
|
|
558
|
+
const { userCriteriaData, isQuery } = this.state;
|
|
555
559
|
const { translate } = this.context;
|
|
556
560
|
let {
|
|
557
561
|
ltmplConfig: preLtmplConfig,
|
|
@@ -562,7 +566,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
562
566
|
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
563
567
|
return false;
|
|
564
568
|
}
|
|
565
|
-
|
|
569
|
+
if (isQuery === false) { // 默认不可请求数据
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
566
572
|
if (prePageSize != pageSize || pageNo != prePageNo) {
|
|
567
573
|
this.setState({
|
|
568
574
|
pageInfo: { pageNo, pageSize },
|
|
@@ -1293,6 +1299,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1293
1299
|
|
|
1294
1300
|
actTableDoSearch = (data: object) => {
|
|
1295
1301
|
const { ltreeData } = this.state;
|
|
1302
|
+
this.setState({ isQuery: true });
|
|
1296
1303
|
this.doSearch_(data, ltreeData);
|
|
1297
1304
|
}
|
|
1298
1305
|
|
|
@@ -1509,18 +1516,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1509
1516
|
renderAggregates() { // 统计数据渲染
|
|
1510
1517
|
const { aggregateVO } = this.state;
|
|
1511
1518
|
const { ltmplConfig } = this.props;
|
|
1519
|
+
const { columns, totalViewMode } = ltmplConfig;
|
|
1512
1520
|
const aggregates = aggregateVO?.aggregates || [];
|
|
1513
|
-
const columns = ltmplConfig?.columns || [];
|
|
1514
1521
|
return aggregates?.length ? <div className="aggregates">{aggregates.map(item => {
|
|
1515
|
-
const column = columns
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
}
|
|
1519
|
-
const { dataUnit, themeColor, themeIcon } = column;
|
|
1520
|
-
return <Card className="aggregate-card" hoverable styles={{ body: { padding: 20 } }}>
|
|
1522
|
+
const column = columns?.find(r => r.id === item.fieldId);
|
|
1523
|
+
const { dataUnit, themeColor, themeIcon } = column || {};
|
|
1524
|
+
const renderDefCard = <Card className="aggregate-card" hoverable styles={{ body: { padding: totalViewMode === "card" ? 20 : 8 } }}>
|
|
1521
1525
|
<div style={{ display: "flex", alignItems: "start", justifyContent: "space-between" }}>
|
|
1522
1526
|
<div style={{ width: "calc(100% - 40px)" }}>
|
|
1523
|
-
<p className="title">{item.fieldTitle}</p>
|
|
1527
|
+
<p className="title" style={{ marginBottom: totalViewMode === "card" ? "16px" : "0px" }}>{item.fieldTitle}</p>
|
|
1524
1528
|
<div className="value">
|
|
1525
1529
|
<Text
|
|
1526
1530
|
style={{ maxWidth: "100%" }}
|
|
@@ -1532,12 +1536,22 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1532
1536
|
</div>
|
|
1533
1537
|
</div>
|
|
1534
1538
|
{themeIcon ?
|
|
1535
|
-
<div className="icon" style={{ color: themeColor, background: `${themeColor}26` }}>
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
+
<div className="icon" style={{ color: themeColor, background: `${themeColor}26` }}><Icon type={themeIcon} /></div> : ""}
|
|
1540
|
+
</div>
|
|
1541
|
+
</Card>;
|
|
1542
|
+
const renderSimple = <Card className="aggregate-card" hoverable styles={{ body: { padding: "6px 12px", display: "flex", alignItems: "center" } }}>
|
|
1543
|
+
<div style={{ whiteSpace: "nowrap" }}>{item.fieldTitle}:</div>
|
|
1544
|
+
<div className="value">
|
|
1545
|
+
<Text
|
|
1546
|
+
style={{ maxWidth: "100%" }}
|
|
1547
|
+
ellipsis={{ tooltip: item.value }}
|
|
1548
|
+
>
|
|
1549
|
+
<span className="number">{item.value}</span>
|
|
1550
|
+
</Text>
|
|
1551
|
+
{dataUnit ? <span className="unit">{dataUnit}</span> : ""}
|
|
1539
1552
|
</div>
|
|
1540
|
-
</Card
|
|
1553
|
+
</Card>;
|
|
1554
|
+
return totalViewMode === "simple" ? renderSimple : renderDefCard;
|
|
1541
1555
|
}).filter(Boolean)
|
|
1542
1556
|
}</div > : "";
|
|
1543
1557
|
}
|
|
@@ -158,15 +158,16 @@ export default {
|
|
|
158
158
|
column["fixed"] = "right";
|
|
159
159
|
column["align"] = "left";
|
|
160
160
|
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
161
|
-
column["className"] = "opsColumn";
|
|
161
|
+
if (ltmplConfig.tableLayout !== "auto") column["className"] = "opsColumn"; // 表格非自适应设置
|
|
162
162
|
column["title"] = <>{translate("${操作}")}</>;
|
|
163
|
-
column["render"] = (text, record) => this.renderAction(props, record);
|
|
163
|
+
column["render"] = (text, record) => this.renderAction(props, record, ltmplConfig.tableLayout !== "auto");
|
|
164
164
|
} else {
|
|
165
165
|
currentDataColIndex++;
|
|
166
|
-
column["className"] = "opsColumn";
|
|
166
|
+
if (ltmplConfig.tableLayout !== "auto") column["className"] = "opsColumn"; // 表格非自适应设置
|
|
167
167
|
// column["title"] = item.tip? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
168
168
|
// <Button icon={<QuestionCircleOutlined />} /></Tooltip> </>: title1;
|
|
169
169
|
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
170
|
+
column["onCell"] = () => ({ style: { maxWidth: item.maxColWidth || undefined, minWidth: item.minColWidth || undefined } });
|
|
170
171
|
column["ellipsis"] = { showTitle: true };
|
|
171
172
|
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
172
173
|
if (
|
|
@@ -544,7 +545,7 @@ export default {
|
|
|
544
545
|
}).filter(Boolean);
|
|
545
546
|
return actionButtons?.length ? <div className="column-action"><Space wrap size={4}>{actionButtons}</Space></div> : undefined;
|
|
546
547
|
},
|
|
547
|
-
renderAction(props: ActionRenderProps, record: DtmplData) { // 操作列按钮渲染
|
|
548
|
+
renderAction(props: ActionRenderProps, record: DtmplData, isWrap = true) { // 操作列按钮渲染
|
|
548
549
|
const { ltmplConfig, showView,
|
|
549
550
|
doEdit,
|
|
550
551
|
doRAction,
|
|
@@ -872,7 +873,7 @@ export default {
|
|
|
872
873
|
</Popover>
|
|
873
874
|
);
|
|
874
875
|
}
|
|
875
|
-
return <Space size={[0, 4]} wrap>
|
|
876
|
+
return <Space size={[0, 4]} wrap={isWrap}>
|
|
876
877
|
{showButtons}
|
|
877
878
|
</Space>
|
|
878
879
|
}
|
|
@@ -110,6 +110,34 @@
|
|
|
110
110
|
gap: 16px;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/* >= 640px: 2列 */
|
|
114
|
+
@media (min-width: 640px) {
|
|
115
|
+
.aggregates {
|
|
116
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* >= 768px: 3列 */
|
|
121
|
+
@media (min-width: 768px) {
|
|
122
|
+
.aggregates {
|
|
123
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* >= 1024px: 4列 */
|
|
128
|
+
@media (min-width: 1024px) {
|
|
129
|
+
.aggregates {
|
|
130
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* >= 1280px: 5列 */
|
|
135
|
+
@media (min-width: 1280px) {
|
|
136
|
+
.aggregates {
|
|
137
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
113
141
|
.aggregate-card .title {
|
|
114
142
|
margin-bottom: 16px;
|
|
115
143
|
font-size: 14px;
|
|
@@ -170,18 +198,6 @@
|
|
|
170
198
|
flex: 0 0 auto;
|
|
171
199
|
}
|
|
172
200
|
|
|
173
|
-
@media (min-width: 768px) {
|
|
174
|
-
.aggregates {
|
|
175
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@media (min-width: 1024px) {
|
|
180
|
-
.aggregates {
|
|
181
|
-
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
201
|
/* 用户自定义配置按钮样式 */
|
|
186
202
|
.page-config-menu-item {
|
|
187
203
|
display: flex;
|
|
@@ -89,6 +89,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
89
89
|
const { queryKey, pageInfo } = this.props;
|
|
90
90
|
if (queryKey) {
|
|
91
91
|
await this.loadData(queryKey.key, pageInfo);
|
|
92
|
+
} else {
|
|
93
|
+
this.setState({ loading: false });
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
|
|
@@ -124,7 +126,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
124
126
|
);
|
|
125
127
|
|
|
126
128
|
DraggableBodyRow = ({ className, style, ...restProps }) => {
|
|
127
|
-
const { dataSource } = this.state;
|
|
129
|
+
const { dataSource = [] } = this.state;
|
|
128
130
|
if (dataSource) {
|
|
129
131
|
const index = dataSource.findIndex(
|
|
130
132
|
(x) => x.key === restProps["data-row-key"]
|
|
@@ -544,6 +546,20 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
544
546
|
);
|
|
545
547
|
}
|
|
546
548
|
|
|
549
|
+
// 表格空状态显示
|
|
550
|
+
const renderEmptyText = () => {
|
|
551
|
+
if (showEmpty === false) {
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
if (errorText) {
|
|
555
|
+
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={errorText} styles={{ description: { color: "#ff4d4f" } }} />;
|
|
556
|
+
}
|
|
557
|
+
if (!queryKey) {
|
|
558
|
+
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={translate("${请点击查询按钮查看数据}")} />;
|
|
559
|
+
}
|
|
560
|
+
return undefined;
|
|
561
|
+
}
|
|
562
|
+
|
|
547
563
|
return (
|
|
548
564
|
<>
|
|
549
565
|
{/*{viewModels.includes("table") ? (*/}
|
|
@@ -578,6 +594,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
578
594
|
{/*)}*/}
|
|
579
595
|
{viewModels.includes("table") ? (
|
|
580
596
|
<ResizableTable
|
|
597
|
+
tableLayout={ltmplConfig.tableLayout || "fixed"}
|
|
581
598
|
size={tableProps.size ? tableProps.size : undefined}
|
|
582
599
|
rowSelection={this.getRowSelection()}
|
|
583
600
|
columns={current_cols}
|
|
@@ -602,9 +619,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
602
619
|
},
|
|
603
620
|
}}
|
|
604
621
|
onChange={this.onChange.bind(this)}
|
|
605
|
-
locale={{
|
|
606
|
-
emptyText: errorText ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={errorText} styles={{ description: { color: "#ff4d4f" } }} /> : undefined
|
|
607
|
-
}}
|
|
622
|
+
locale={{ emptyText: renderEmptyText() }}
|
|
608
623
|
expandable={isTreeTable ? {
|
|
609
624
|
onExpand: (expanded, record) => {
|
|
610
625
|
if (expanded && !record.children?.length) { // 展开且没有子节点数据,请求子节点数据
|
|
@@ -613,7 +628,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
613
628
|
}
|
|
614
629
|
} : undefined}
|
|
615
630
|
onChangeResize={onChangeResize}
|
|
616
|
-
showEmpty={showEmpty}
|
|
617
631
|
/>
|
|
618
632
|
) : (
|
|
619
633
|
""
|
|
@@ -43,7 +43,7 @@ const ResizableTitle = props => {
|
|
|
43
43
|
|
|
44
44
|
const ResizableTable = props => {
|
|
45
45
|
|
|
46
|
-
const { columns: columns_, components: components_, onChangeResize,
|
|
46
|
+
const { columns: columns_, components: components_, onChangeResize, tableLayout, ...other } = props
|
|
47
47
|
// const [columns, setColumns] = useState(columns_.map((col) => {
|
|
48
48
|
// col['onHeaderCell']=(col) => ({
|
|
49
49
|
// ...col['onHeaderCell'],
|
|
@@ -90,7 +90,7 @@ const ResizableTable = props => {
|
|
|
90
90
|
header: { cell: ResizableTitle }
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
return <Table components={components} columns={columns} {...other}
|
|
93
|
+
return <Table components={tableLayout === "auto" ? components_ : components} columns={columns} {...other} tableLayout={tableLayout} size="small" />;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export default ResizableTable;
|
|
@@ -296,6 +296,8 @@ export interface ColumnConfig extends FieldConfig {
|
|
|
296
296
|
upperColumnTitle?: string,
|
|
297
297
|
rowEditable?: boolean,
|
|
298
298
|
columnGroupName?: string, // 列分组
|
|
299
|
+
maxColWidth?: number, // 最大列宽
|
|
300
|
+
minColWidth?: number, // 最小列宽
|
|
299
301
|
}
|
|
300
302
|
|
|
301
303
|
export type CodeSource = "new" | "listop" | "listop-new" | undefined;
|
|
@@ -680,7 +682,7 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
680
682
|
// 日历配置
|
|
681
683
|
calendarDateColumnConfig?: ColumnConfig;
|
|
682
684
|
calendarShowType?: "month" | "year";
|
|
683
|
-
calendarDateSelectorUsable?: boolean;
|
|
685
|
+
calendarDateSelectorUsable?: boolean; // 日历配置end
|
|
684
686
|
strongDeleteConfirmText?: string; // 强确认删除文本
|
|
685
687
|
splitTabShowType?: "tab" | "tag" | "radio"; // Tab拆解条件
|
|
686
688
|
showSplitTabDataCount?: boolean; // tab拆解条件是否显示统计数据
|
|
@@ -689,6 +691,11 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
689
691
|
defTableSize?: number; // 添加多表格默认表格数
|
|
690
692
|
singleTableSpan?: number; // 展示多表格-单表格占用列数
|
|
691
693
|
copyMode?: "copyOnly" | "copyEdit" | "editCopy"; // 复制模式
|
|
694
|
+
totalViewMode?: "simple" | "compactCard" | "card"; // 聚合函数展示类型
|
|
695
|
+
showTotalNumInTotalView?: boolean; // 是否在聚合视图中显示总数
|
|
696
|
+
totalNumInTotalViewTitle?: string; // 聚合视图中显示总数的标题
|
|
697
|
+
notAutoQuery?: boolean; // 页面是否默认查询
|
|
698
|
+
tableLayout?: "auto" | "fixed"; // 表格布局(自适应列宽/固定列宽)
|
|
692
699
|
}
|
|
693
700
|
|
|
694
701
|
export interface EnumItem {
|
|
@@ -334,6 +334,7 @@ const HCWelcome = (props) => {
|
|
|
334
334
|
const [menus, setMenus] = useState([]);
|
|
335
335
|
const [leafMenus, setLeafMenus] = useState([]);
|
|
336
336
|
const [themeConfig, setThemeConfig] = useState();
|
|
337
|
+
const [showRightSidebar, setShowRightSidebar] = useState(true);
|
|
337
338
|
|
|
338
339
|
const initUserConfig = async () => {
|
|
339
340
|
let userInfo = await Units.getCurrentUserInfo();
|
|
@@ -378,7 +379,7 @@ const HCWelcome = (props) => {
|
|
|
378
379
|
</Col>
|
|
379
380
|
<Col span={24}>
|
|
380
381
|
<Row gutter={16}>
|
|
381
|
-
<Col span={16}>
|
|
382
|
+
<Col span={showRightSidebar ? 16 : 24}>
|
|
382
383
|
<Row gutter={[0, 16]}>
|
|
383
384
|
{(themeConfig?.allowUserConfig || themeConfig?.allowUsermenu) ?
|
|
384
385
|
<Col span={24}><UserMenus menus={menus} leafMenus={leafMenus} themeConfig={themeConfig} /></Col> : ""}
|
|
@@ -386,12 +387,13 @@ const HCWelcome = (props) => {
|
|
|
386
387
|
<Col span={24}><MenuCard menus={menus} /></Col>
|
|
387
388
|
</Row>
|
|
388
389
|
</Col>
|
|
389
|
-
|
|
390
|
-
<
|
|
391
|
-
<
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
390
|
+
{showRightSidebar ?
|
|
391
|
+
<Col span={8}>
|
|
392
|
+
<Row gutter={[16, 16]}>
|
|
393
|
+
<Col span={24}><PageCard fastMenu="RightSidebar01" layoutRootPath={layoutRootPath} menus={menus} menuOrder={1} setShowRightSidebar={setShowRightSidebar} /></Col>
|
|
394
|
+
<Col span={24}><PageCard fastMenu="RightSidebar02" layoutRootPath={layoutRootPath} menus={menus} menuOrder={2} /></Col>
|
|
395
|
+
</Row>
|
|
396
|
+
</Col> : ""}
|
|
395
397
|
</Row>
|
|
396
398
|
</Col>
|
|
397
399
|
</Row>
|
|
@@ -51,10 +51,11 @@ interface Props {
|
|
|
51
51
|
fastMenu: string;
|
|
52
52
|
menus: MenuType[];
|
|
53
53
|
menuOrder: number;
|
|
54
|
+
setShowRightSidebar?: (val: boolean) => void;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
const Index = (props: Props) => {
|
|
57
|
-
const { layoutRootPath, fastMenu, menus, menuOrder } = props;
|
|
58
|
+
const { layoutRootPath, fastMenu, menus, menuOrder, setShowRightSidebar } = props;
|
|
58
59
|
const [l2Menu, setL2Menu] = useState<MenuType>();
|
|
59
60
|
const navigate = useNavigate();
|
|
60
61
|
const { translate } = useLocale();
|
|
@@ -62,6 +63,9 @@ const Index = (props: Props) => {
|
|
|
62
63
|
|
|
63
64
|
const getL2Menu = async () => {
|
|
64
65
|
let temData: Level2Menu[] = await HCDataSource.fastMenu(fastMenu);
|
|
66
|
+
if (!temData && setShowRightSidebar && fastMenu === "RightSidebar01") {
|
|
67
|
+
setShowRightSidebar(false);
|
|
68
|
+
}
|
|
65
69
|
const itemMenu = temData?.[0];
|
|
66
70
|
if (itemMenu && !itemMenu.disabled) {
|
|
67
71
|
const { id, pageType, defaultCriteriaValue, customPath, dragDropPageId, fullScreen } = itemMenu;
|