aldehyde 0.2.410 → 0.2.413
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/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +2 -1
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +1 -1
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/enum-badge/index.js +1 -1
- package/lib/controls/enum-badge/index.js.map +1 -1
- package/lib/layout2/components/theme-button.d.ts +5 -1
- package/lib/layout2/components/theme-button.d.ts.map +1 -1
- package/lib/layout2/components/theme-button.js +30 -5
- package/lib/layout2/components/theme-button.js.map +1 -1
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +20 -3
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/css/header.css +10 -6
- package/lib/layout2/css/tabs-layout.less +6 -0
- package/lib/layout2/header.d.ts +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +4 -9
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/main.js +1 -1
- package/lib/layout2/main.js.map +1 -1
- package/lib/layout2/page.d.ts +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +15 -7
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/type/layout-type.d.ts +2 -0
- package/lib/layout2/type/layout-type.d.ts.map +1 -1
- package/lib/layout3/header.js +2 -4
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout3/page.d.ts.map +1 -1
- package/lib/layout3/page.js +17 -5
- package/lib/layout3/page.js.map +1 -1
- package/lib/layout4/header.d.ts +1 -1
- package/lib/layout4/header.d.ts.map +1 -1
- package/lib/layout4/header.js +3 -6
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout4/page.d.ts +1 -1
- package/lib/layout4/page.d.ts.map +1 -1
- package/lib/layout4/page.js +21 -6
- package/lib/layout4/page.js.map +1 -1
- package/lib/layout5/css/sider.less +6 -0
- package/lib/layout5/header.js +2 -4
- package/lib/layout5/header.js.map +1 -1
- package/lib/layout5/page.d.ts +1 -1
- package/lib/layout5/page.d.ts.map +1 -1
- package/lib/layout5/page.js +21 -6
- package/lib/layout5/page.js.map +1 -1
- package/lib/layout5/sider.d.ts +1 -1
- package/lib/layout5/sider.d.ts.map +1 -1
- package/lib/layout5/sider.js +1 -2
- package/lib/layout5/sider.js.map +1 -1
- package/lib/list/card-list/index.less +6 -4
- package/lib/list/vertical-list/index.less +120 -21
- package/lib/list/vertical-list/item.d.ts.map +1 -1
- package/lib/list/vertical-list/item.js +51 -44
- package/lib/list/vertical-list/item.js.map +1 -1
- package/lib/locale/LocaleButton.d.ts +5 -1
- package/lib/locale/LocaleButton.d.ts.map +1 -1
- package/lib/locale/LocaleButton.js +13 -3
- package/lib/locale/LocaleButton.js.map +1 -1
- package/lib/login3/img/login-bg.png +0 -0
- package/lib/lowcode-components/assets/china.json +1 -99420
- package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/lib/module/dtmpl-view-modal.d.ts +1 -0
- package/lib/module/dtmpl-view-modal.d.ts.map +1 -1
- package/lib/module/dtmpl-view-modal.js +2 -1
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/index.less +5 -0
- package/lib/table/act-table.d.ts +1 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +28 -2
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +25 -7
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/column/index.less +7 -5
- package/lib/table/index.css +57 -0
- package/lib/table/query-table.d.ts +0 -4
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +7 -63
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/report-table.d.ts.map +1 -1
- package/lib/table/report-table.js +1 -1
- package/lib/table/report-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +16 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +1 -1
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/units/index.d.ts +3 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +22 -4
- package/lib/units/index.js.map +1 -1
- package/lib/welcome/HCWelcome.js +20 -3
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/components/page-card.d.ts.map +1 -1
- package/lib/welcome/components/page-card.js +4 -0
- package/lib/welcome/components/page-card.js.map +1 -1
- package/lib/welcome/components/workbench.js +2 -1
- package/lib/welcome/components/workbench.js.map +1 -1
- package/lib/welcome/img/welcome2.png +0 -0
- package/package.json +1 -1
- package/src/aldehyde/controls/color-picker/index.tsx +3 -1
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +1 -1
- package/src/aldehyde/controls/enum-badge/index.tsx +1 -1
- package/src/aldehyde/layout2/components/theme-button.tsx +17 -6
- package/src/aldehyde/layout2/components/user-button.tsx +19 -4
- package/src/aldehyde/layout2/css/header.css +10 -6
- package/src/aldehyde/layout2/css/tabs-layout.less +6 -0
- package/src/aldehyde/layout2/header.tsx +10 -14
- package/src/aldehyde/layout2/main.tsx +2 -2
- package/src/aldehyde/layout2/page.tsx +16 -8
- package/src/aldehyde/layout2/type/layout-type.ts +2 -0
- package/src/aldehyde/layout3/header.tsx +4 -4
- package/src/aldehyde/layout3/page.tsx +9 -5
- package/src/aldehyde/layout4/header.tsx +6 -7
- package/src/aldehyde/layout4/page.tsx +14 -7
- package/src/aldehyde/layout5/css/sider.less +6 -0
- package/src/aldehyde/layout5/header.tsx +4 -4
- package/src/aldehyde/layout5/page.tsx +14 -7
- package/src/aldehyde/layout5/sider.tsx +5 -8
- package/src/aldehyde/list/card-list/index.less +6 -4
- package/src/aldehyde/list/vertical-list/index.less +120 -21
- package/src/aldehyde/list/vertical-list/item.tsx +66 -60
- package/src/aldehyde/locale/LocaleButton.tsx +11 -10
- package/src/aldehyde/login3/img/login-bg.png +0 -0
- package/src/aldehyde/lowcode-components/assets/china.json +1 -99420
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk-JinBuTi.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.woff +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/PangMenZhengDaoBiaoTiTiMianFeiBan.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/YouSheBiaoTiHei.woff2 +0 -0
- package/src/aldehyde/module/dtmpl-view-modal.tsx +26 -24
- package/src/aldehyde/module/index.less +5 -0
- package/src/aldehyde/table/act-table.tsx +35 -2
- package/src/aldehyde/table/column/column-builder.tsx +28 -10
- package/src/aldehyde/table/column/index.less +7 -5
- package/src/aldehyde/table/index.css +57 -0
- package/src/aldehyde/table/query-table.tsx +6 -63
- package/src/aldehyde/table/report-table.tsx +69 -69
- package/src/aldehyde/tmpl/hcservice-v3.tsx +14 -0
- package/src/aldehyde/tmpl/interface.tsx +4 -0
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +1 -1
- package/src/aldehyde/units/index.tsx +21 -4
- package/src/aldehyde/welcome/HCWelcome.js +17 -1
- package/src/aldehyde/welcome/components/page-card.tsx +4 -0
- package/src/aldehyde/welcome/components/workbench.tsx +1 -1
- package/src/aldehyde/welcome/img/welcome2.png +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React, {useEffect, useState} from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import "./index.css"
|
|
3
|
-
import { ReportData, ReportTableProps} from "../tmpl/interface";
|
|
3
|
+
import { ReportData, ReportTableProps } from "../tmpl/interface";
|
|
4
4
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
5
|
-
import {useLocale} from "../locale/useLocale";
|
|
5
|
+
import { useLocale } from "../locale/useLocale";
|
|
6
6
|
import ColumnBuilder from "./column/column-builder";
|
|
7
7
|
import ResizableTable from "./resizable-table";
|
|
8
8
|
|
|
9
|
-
const ReportTable=(props:ReportTableProps)=> {
|
|
9
|
+
const ReportTable = (props: ReportTableProps) => {
|
|
10
10
|
|
|
11
11
|
const [loading, setLoading] = useState<boolean>(false);
|
|
12
12
|
const [dataSource, setDataSource] = useState<object[]>(undefined);
|
|
13
13
|
const [reportData, setReportData] = useState<ReportData>(undefined);
|
|
14
14
|
|
|
15
|
-
const { getServiceLangStr, translate} = useLocale();
|
|
16
|
-
const {tableProps,columns,queryKey,serverKey,leftFixedCols,hiddenColIds}=props
|
|
15
|
+
const { getServiceLangStr, translate } = useLocale();
|
|
16
|
+
const { tableProps, columns, queryKey, serverKey, leftFixedCols, hiddenColIds } = props
|
|
17
17
|
|
|
18
|
-
useEffect(
|
|
18
|
+
useEffect(() => {
|
|
19
19
|
const queryData = async () => {
|
|
20
20
|
if (queryKey) {
|
|
21
|
-
await loadData(queryKey.key,serverKey);
|
|
21
|
+
await loadData(queryKey.key, serverKey);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
queryData()
|
|
@@ -27,81 +27,81 @@ const ReportTable=(props:ReportTableProps)=> {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
const loadData = async (
|
|
30
|
-
queryKey: string,serverKey:string
|
|
30
|
+
queryKey: string, serverKey: string
|
|
31
31
|
) => {
|
|
32
32
|
setLoading(true);
|
|
33
33
|
let reportData: ReportData = await HcserviceV3.requestQueryReportData(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
setDataSource(dataSource);
|
|
56
|
-
setReportData(reportData);
|
|
57
|
-
setLoading(false);
|
|
34
|
+
serverKey,
|
|
35
|
+
queryKey, getServiceLangStr()
|
|
36
|
+
);
|
|
37
|
+
if (reportData?.key != queryKey) {
|
|
38
|
+
return;
|
|
39
|
+
} else {
|
|
40
|
+
let dataSource: object[] = [];
|
|
41
|
+
if (reportData.entities) {
|
|
42
|
+
reportData.entities.forEach((item, index) => {
|
|
43
|
+
if (item) {
|
|
44
|
+
let row = {
|
|
45
|
+
key: item.code,
|
|
46
|
+
code: item.code, //增加code,为了删除操作
|
|
47
|
+
...item.fieldMap,
|
|
48
|
+
index,
|
|
49
|
+
};
|
|
50
|
+
dataSource.push(row);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
58
53
|
}
|
|
54
|
+
|
|
55
|
+
setDataSource(dataSource);
|
|
56
|
+
setReportData(reportData);
|
|
57
|
+
setLoading(false);
|
|
58
|
+
}
|
|
59
59
|
}
|
|
60
|
-
const addColumnOnCell=(current_cols,hiddenColIds:string[])=>{
|
|
61
|
-
if(!reportData){
|
|
60
|
+
const addColumnOnCell = (current_cols, hiddenColIds: string[]) => {
|
|
61
|
+
if (!reportData) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const {rowGrids}=reportData
|
|
64
|
+
const { rowGrids } = reportData
|
|
65
65
|
current_cols.forEach((c) => {
|
|
66
66
|
debugger
|
|
67
|
-
if(rowGrids){
|
|
68
|
-
c.onCell=(record,index)=>{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
67
|
+
if (rowGrids) {
|
|
68
|
+
c.onCell = (record, index) => {
|
|
69
|
+
let rowGrid = rowGrids[record.code];
|
|
70
|
+
if (rowGrid && rowGrid.cellMap) {
|
|
71
|
+
if (rowGrid.cellMap[c.dataIndex]) {
|
|
72
|
+
let a = {
|
|
73
|
+
...rowGrid.cellMap[c.dataIndex]
|
|
74
|
+
}
|
|
75
|
+
if (a.colSpan > 1) {
|
|
76
|
+
let hiddenDim = 0;
|
|
77
|
+
if (hiddenColIds) {
|
|
78
|
+
debugger
|
|
79
|
+
hiddenColIds.forEach(id => {
|
|
80
|
+
if (rowGrid.cellMap[id]) {
|
|
81
|
+
hiddenDim++;
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
return { colSpan: a.colSpan - hiddenDim, rowSpan: 1 }
|
|
86
|
+
} else {
|
|
87
|
+
return a;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
return { colSpan: 1, rowSpan: 1 }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
let current_cols=reportData?.columnConfigs?ColumnBuilder.buildReportTableColumns({columnConfigs:[...reportData.columnConfigs],translate,leftFixedCols,hiddenColIds}):columns
|
|
99
|
-
|
|
98
|
+
let current_cols = reportData?.columnConfigs ? ColumnBuilder.buildReportTableColumns({ columnConfigs: [...reportData.columnConfigs], translate, leftFixedCols, hiddenColIds }) : columns;
|
|
99
|
+
let table_x = 20;
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
addColumnOnCell(current_cols,hiddenColIds);
|
|
101
|
+
current_cols.forEach((c) => {
|
|
102
|
+
table_x = table_x + (c.width ? c.width : 140);
|
|
103
|
+
});
|
|
104
|
+
addColumnOnCell(current_cols, hiddenColIds);
|
|
105
105
|
|
|
106
106
|
return <ResizableTable
|
|
107
107
|
size={tableProps?.size ? tableProps.size : undefined}
|
|
@@ -118,7 +118,7 @@ const ReportTable=(props:ReportTableProps)=> {
|
|
|
118
118
|
}
|
|
119
119
|
bordered
|
|
120
120
|
pagination={false}
|
|
121
|
-
style={{ display: columns ? "block" : "none" }}></ResizableTable>
|
|
121
|
+
style={{ display: columns ? "block" : "none", marginBottom: "12px" }}></ResizableTable>
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
export default ReportTable;
|
|
@@ -1333,4 +1333,18 @@ export default class HcserviceV3 {
|
|
|
1333
1333
|
return res;
|
|
1334
1334
|
}
|
|
1335
1335
|
|
|
1336
|
+
static async getThemeConfig(serverKey?: string, programCode?: string) {
|
|
1337
|
+
let res = await Super.super({
|
|
1338
|
+
url: "/v3/theme-config",
|
|
1339
|
+
header: { programCode },
|
|
1340
|
+
serverKey,
|
|
1341
|
+
method: "GET",
|
|
1342
|
+
});
|
|
1343
|
+
if (res && res.status === "success") {
|
|
1344
|
+
return res;
|
|
1345
|
+
} else {
|
|
1346
|
+
return null;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1336
1350
|
}
|
|
@@ -90,6 +90,7 @@ export interface QueryTableProps extends ReportTableProps {
|
|
|
90
90
|
ltmplConfig?: LtmplConfig;
|
|
91
91
|
showView?: (showVievParam: ShowViewParam) => void;
|
|
92
92
|
showPagination?: boolean;
|
|
93
|
+
onChangeAggregateVO?: (aggregateVO: AggregateVO) => void;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export interface AggregateVO {
|
|
@@ -454,6 +455,9 @@ export interface FieldConfig extends FieldBase {
|
|
|
454
455
|
dateControlShortcutKeys?: string[]; // 时间范围预设配置
|
|
455
456
|
placeholder?: string; // 占位符
|
|
456
457
|
appendCriteria?: CriteriaConfig; // 列查询条件配置
|
|
458
|
+
dataUnit?: string; // 单位
|
|
459
|
+
themeColor?: string; // 颜色
|
|
460
|
+
themeIcon?: string; // Icon
|
|
457
461
|
}
|
|
458
462
|
|
|
459
463
|
export interface ActionRenderProps {
|
|
@@ -45,6 +45,8 @@ const CUSTOM_COMPONENT_MAP = {};
|
|
|
45
45
|
// 主题url vx替换正则
|
|
46
46
|
const regexTheme = /(?<=#\/)vx/g;
|
|
47
47
|
|
|
48
|
+
let themeConfig = undefined; // 系统配置主题等
|
|
49
|
+
|
|
48
50
|
// let siderCollapsed:boolean = true;
|
|
49
51
|
|
|
50
52
|
export default {
|
|
@@ -1178,10 +1180,25 @@ export default {
|
|
|
1178
1180
|
};
|
|
1179
1181
|
return themes;
|
|
1180
1182
|
},
|
|
1181
|
-
toDefaultTheme() {
|
|
1182
|
-
const
|
|
1183
|
+
toDefaultTheme(defTheme?: string) {
|
|
1184
|
+
const temTheme = defTheme || ProgramConfig.getDefaultTheme();
|
|
1183
1185
|
const hash = window.location.hash;
|
|
1184
|
-
let newHash = hash.replace(regexTheme, `${
|
|
1186
|
+
let newHash = hash.replace(regexTheme, `${temTheme}/home`);
|
|
1185
1187
|
window.location.hash = newHash;
|
|
1186
|
-
}
|
|
1188
|
+
},
|
|
1189
|
+
async getThemeConfig(serverKey?: string) {
|
|
1190
|
+
if (themeConfig) {
|
|
1191
|
+
return themeConfig;
|
|
1192
|
+
}
|
|
1193
|
+
const programCode = this.programCode();
|
|
1194
|
+
const server = this.api(serverKey);
|
|
1195
|
+
const { themeConfig: temConfig } = await HcserviceV3.getThemeConfig(serverKey, programCode) || {};
|
|
1196
|
+
const loginMainPicture = temConfig?.loginMainPicture ? this.joinPath(server, `/v3/theme-files/${temConfig?.loginMainPicture}?@programToken=${programCode}`) : null;
|
|
1197
|
+
const programIcon = temConfig?.programIcon ? this.joinPath(server, `/v3/theme-files/${temConfig?.programIcon}?@programToken=${programCode}`) : null;
|
|
1198
|
+
themeConfig = { ...temConfig, loginMainPicture, programIcon };
|
|
1199
|
+
return themeConfig;
|
|
1200
|
+
},
|
|
1201
|
+
getThemeConfigInfo() {
|
|
1202
|
+
return themeConfig;
|
|
1203
|
+
},
|
|
1187
1204
|
};
|
|
@@ -298,6 +298,19 @@ const handleMenu = (arr) => {
|
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// 获取菜单的所有子节点
|
|
302
|
+
const getLeafNodes = (tree, result = []) => {
|
|
303
|
+
if (!tree || !Array.isArray(tree)) return result;
|
|
304
|
+
tree.forEach(node => {
|
|
305
|
+
if (!node.children || node.children.length === 0) {
|
|
306
|
+
result.push(node);
|
|
307
|
+
} else {
|
|
308
|
+
getLeafNodes(node.children, result);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
|
|
301
314
|
// 处理图片地址
|
|
302
315
|
const handleImgUrl = (basePath) => {
|
|
303
316
|
if (basePath.startsWith("http")) {
|
|
@@ -317,6 +330,7 @@ const HCWelcome = (props) => {
|
|
|
317
330
|
if (programCode) Units.setProgramCode(programCode);
|
|
318
331
|
const [orgHomeImg, setOrgHomeImg] = useState();
|
|
319
332
|
const [menus, setMenus] = useState([]);
|
|
333
|
+
const [leafMenus, setLeafMenus] = useState([]);
|
|
320
334
|
|
|
321
335
|
const initUserConfig = async () => {
|
|
322
336
|
let userInfo = await Units.getCurrentUserInfo();
|
|
@@ -336,7 +350,9 @@ const HCWelcome = (props) => {
|
|
|
336
350
|
const getMenus = async () => {
|
|
337
351
|
const temData = await getMenuConfig(layoutRootPath || "v2");
|
|
338
352
|
const temMenus = handleMenu(temData?.menu || []);
|
|
353
|
+
const temLeafNodes = getLeafNodes(temMenus);
|
|
339
354
|
setMenus(temMenus);
|
|
355
|
+
setLeafMenus(temLeafNodes)
|
|
340
356
|
}
|
|
341
357
|
|
|
342
358
|
useEffect(() => {
|
|
@@ -349,7 +365,7 @@ const HCWelcome = (props) => {
|
|
|
349
365
|
<div style={{ width: "100%", paddingTop: "12px" }} >
|
|
350
366
|
<Row gutter={[0]}>
|
|
351
367
|
<Col span={24}>
|
|
352
|
-
<Workbench layoutRootPath={layoutRootPath} menus={
|
|
368
|
+
<Workbench layoutRootPath={layoutRootPath} menus={leafMenus || []} />
|
|
353
369
|
</Col>
|
|
354
370
|
<Col span={24}>
|
|
355
371
|
<Row gutter={16}>
|
|
@@ -19,6 +19,10 @@ const findNthLeaf = (tree, n = 1) => {
|
|
|
19
19
|
let count = 0; // 已找到的叶子数量(从 0 开始计)
|
|
20
20
|
const dfs = (nodes) => {
|
|
21
21
|
for (const node of nodes) {
|
|
22
|
+
// 检查当前节点是否为大屏或者自定义页面
|
|
23
|
+
if (node.dragDropPageId || node.customPath) {
|
|
24
|
+
continue; // 跳过被排除的节点及其子树
|
|
25
|
+
}
|
|
22
26
|
const isLeaf = !node.children || node.children.length === 0;
|
|
23
27
|
if (isLeaf) {
|
|
24
28
|
count++;
|
|
@@ -34,7 +34,7 @@ const Workbench = (props: WorkbenchProps) => {
|
|
|
34
34
|
let temData: Level2Menu[] = await HCDataSource.fastMenu("QuickPanel");
|
|
35
35
|
let temMenu: MenuType[] = [];
|
|
36
36
|
if (!temData?.length) {
|
|
37
|
-
temMenu = menus?.slice(0, 4) || []
|
|
37
|
+
temMenu = menus.filter(r => !r.dragDropPageId && !r.customPath)?.slice(0, 4) || []
|
|
38
38
|
} else {
|
|
39
39
|
temData.forEach(item => {
|
|
40
40
|
const { id, pageType, defaultCriteriaValue, customPath, dragDropPageId, fullScreen } = item;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|