aldehyde 0.2.437 → 0.2.439

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.
Files changed (169) hide show
  1. package/lib/controls/2dEditor/components/card.d.ts.map +1 -1
  2. package/lib/controls/2dEditor/components/card.js +2 -1
  3. package/lib/controls/2dEditor/components/card.js.map +1 -1
  4. package/lib/controls/2dEditor/components/html-box.js +1 -1
  5. package/lib/controls/date-picker/index.d.ts.map +1 -1
  6. package/lib/controls/date-picker/index.js +3 -1
  7. package/lib/controls/date-picker/index.js.map +1 -1
  8. package/lib/controls/direct-upload/index.js +2 -2
  9. package/lib/controls/direct-upload/index.js.map +1 -1
  10. package/lib/controls/entity-select/popover-entity-select.d.ts +4 -1
  11. package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
  12. package/lib/controls/entity-select/popover-entity-select.js +7 -7
  13. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  14. package/lib/controls/qr-code/index.d.ts.map +1 -1
  15. package/lib/controls/qr-code/index.js +3 -1
  16. package/lib/controls/qr-code/index.js.map +1 -1
  17. package/lib/layout2/main.d.ts +2 -0
  18. package/lib/layout2/main.d.ts.map +1 -1
  19. package/lib/layout2/main.js +2 -2
  20. package/lib/layout2/main.js.map +1 -1
  21. package/lib/layout2/page.js +1 -1
  22. package/lib/layout2/page.js.map +1 -1
  23. package/lib/layout2/tabs/tabs-layout.d.ts +5 -1
  24. package/lib/layout2/tabs/tabs-layout.d.ts.map +1 -1
  25. package/lib/layout2/tabs/tabs-layout.js +5 -2
  26. package/lib/layout2/tabs/tabs-layout.js.map +1 -1
  27. package/lib/layout3/components/tabs-layout.d.ts +5 -1
  28. package/lib/layout3/components/tabs-layout.d.ts.map +1 -1
  29. package/lib/layout3/components/tabs-layout.js +6 -2
  30. package/lib/layout3/components/tabs-layout.js.map +1 -1
  31. package/lib/layout3/main.d.ts +2 -0
  32. package/lib/layout3/main.d.ts.map +1 -1
  33. package/lib/layout3/main.js +2 -2
  34. package/lib/layout3/main.js.map +1 -1
  35. package/lib/layout3/page.js +1 -1
  36. package/lib/layout3/page.js.map +1 -1
  37. package/lib/layout4/components/tabs-layout.d.ts +5 -1
  38. package/lib/layout4/components/tabs-layout.d.ts.map +1 -1
  39. package/lib/layout4/components/tabs-layout.js +6 -2
  40. package/lib/layout4/components/tabs-layout.js.map +1 -1
  41. package/lib/layout4/main.d.ts +2 -0
  42. package/lib/layout4/main.d.ts.map +1 -1
  43. package/lib/layout4/main.js +2 -2
  44. package/lib/layout4/main.js.map +1 -1
  45. package/lib/layout4/page.js +1 -1
  46. package/lib/layout4/page.js.map +1 -1
  47. package/lib/layout5/page.js +1 -1
  48. package/lib/layout5/page.js.map +1 -1
  49. package/lib/lowcode-components/act-table/index.d.ts +1 -0
  50. package/lib/lowcode-components/act-table/index.d.ts.map +1 -1
  51. package/lib/lowcode-components/act-table/index.js +5 -3
  52. package/lib/lowcode-components/act-table/index.js.map +1 -1
  53. package/lib/lowcode-components/bar-chart/index.d.ts +1 -1
  54. package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
  55. package/lib/lowcode-components/bar-chart/index.js +5 -2
  56. package/lib/lowcode-components/bar-chart/index.js.map +1 -1
  57. package/lib/lowcode-components/base-button/index.d.ts.map +1 -1
  58. package/lib/lowcode-components/base-button/index.js +3 -1
  59. package/lib/lowcode-components/base-button/index.js.map +1 -1
  60. package/lib/lowcode-components/base-radio/index.d.ts.map +1 -1
  61. package/lib/lowcode-components/base-radio/index.js +12 -2
  62. package/lib/lowcode-components/base-radio/index.js.map +1 -1
  63. package/lib/lowcode-components/base-table/index.d.ts +1 -0
  64. package/lib/lowcode-components/base-table/index.d.ts.map +1 -1
  65. package/lib/lowcode-components/base-table/index.js +5 -4
  66. package/lib/lowcode-components/base-table/index.js.map +1 -1
  67. package/lib/lowcode-components/base-tabs/index.d.ts.map +1 -1
  68. package/lib/lowcode-components/base-tabs/index.js +3 -1
  69. package/lib/lowcode-components/base-tabs/index.js.map +1 -1
  70. package/lib/lowcode-components/base-text/index.d.ts.map +1 -1
  71. package/lib/lowcode-components/base-text/index.js +3 -1
  72. package/lib/lowcode-components/base-text/index.js.map +1 -1
  73. package/lib/lowcode-components/capsule-bar-chart/index.d.ts.map +1 -1
  74. package/lib/lowcode-components/capsule-bar-chart/index.js +4 -1
  75. package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -1
  76. package/lib/lowcode-components/carousel/index.d.ts.map +1 -1
  77. package/lib/lowcode-components/carousel/index.js +6 -5
  78. package/lib/lowcode-components/carousel/index.js.map +1 -1
  79. package/lib/lowcode-components/column-3d-chart/index.d.ts.map +1 -1
  80. package/lib/lowcode-components/column-3d-chart/index.js +4 -1
  81. package/lib/lowcode-components/column-3d-chart/index.js.map +1 -1
  82. package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
  83. package/lib/lowcode-components/column-chart/index.js +4 -1
  84. package/lib/lowcode-components/column-chart/index.js.map +1 -1
  85. package/lib/lowcode-components/data-number/index.d.ts.map +1 -1
  86. package/lib/lowcode-components/data-number/index.js +4 -2
  87. package/lib/lowcode-components/data-number/index.js.map +1 -1
  88. package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
  89. package/lib/lowcode-components/line-bar-chart/index.js +4 -1
  90. package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
  91. package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
  92. package/lib/lowcode-components/line-chart/index.js +5 -1
  93. package/lib/lowcode-components/line-chart/index.js.map +1 -1
  94. package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
  95. package/lib/lowcode-components/pie-chart/index.js +4 -1
  96. package/lib/lowcode-components/pie-chart/index.js.map +1 -1
  97. package/lib/lowcode-components/search-form/index.d.ts.map +1 -1
  98. package/lib/lowcode-components/search-form/index.js +4 -2
  99. package/lib/lowcode-components/search-form/index.js.map +1 -1
  100. package/lib/lowcode-components/stroke-animation/index.d.ts.map +1 -1
  101. package/lib/lowcode-components/stroke-animation/index.js +3 -1
  102. package/lib/lowcode-components/stroke-animation/index.js.map +1 -1
  103. package/lib/lowcode-components/text-scroller/index.d.ts.map +1 -1
  104. package/lib/lowcode-components/text-scroller/index.js +3 -1
  105. package/lib/lowcode-components/text-scroller/index.js.map +1 -1
  106. package/lib/table/act-table.d.ts +2 -0
  107. package/lib/table/act-table.d.ts.map +1 -1
  108. package/lib/table/act-table.js +6 -5
  109. package/lib/table/act-table.js.map +1 -1
  110. package/lib/table/page-config-button.d.ts.map +1 -1
  111. package/lib/table/page-config-button.js +8 -7
  112. package/lib/table/page-config-button.js.map +1 -1
  113. package/lib/table/query-table.d.ts +1 -0
  114. package/lib/table/query-table.d.ts.map +1 -1
  115. package/lib/table/query-table.js +3 -2
  116. package/lib/table/query-table.js.map +1 -1
  117. package/lib/table/report-table.d.ts.map +1 -1
  118. package/lib/table/report-table.js +2 -1
  119. package/lib/table/report-table.js.map +1 -1
  120. package/lib/table/resizable-table.js +3 -3
  121. package/lib/table/resizable-table.js.map +1 -1
  122. package/lib/table/select-table.d.ts.map +1 -1
  123. package/lib/table/select-table.js +5 -2
  124. package/lib/table/select-table.js.map +1 -1
  125. package/lib/tmpl/interface.d.ts +3 -0
  126. package/lib/tmpl/interface.d.ts.map +1 -1
  127. package/lib/tmpl/interface.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/aldehyde/controls/2dEditor/components/card.tsx +2 -1
  130. package/src/aldehyde/controls/2dEditor/components/html-box.tsx +1 -1
  131. package/src/aldehyde/controls/date-picker/index.tsx +4 -1
  132. package/src/aldehyde/controls/direct-upload/index.tsx +2 -2
  133. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +13 -7
  134. package/src/aldehyde/controls/qr-code/index.tsx +3 -1
  135. package/src/aldehyde/layout2/main.tsx +4 -2
  136. package/src/aldehyde/layout2/page.tsx +1 -1
  137. package/src/aldehyde/layout2/tabs/tabs-layout.tsx +10 -2
  138. package/src/aldehyde/layout3/components/tabs-layout.tsx +12 -2
  139. package/src/aldehyde/layout3/main.tsx +4 -2
  140. package/src/aldehyde/layout3/page.tsx +1 -1
  141. package/src/aldehyde/layout4/components/tabs-layout.tsx +11 -2
  142. package/src/aldehyde/layout4/main.tsx +4 -2
  143. package/src/aldehyde/layout4/page.tsx +1 -1
  144. package/src/aldehyde/layout5/page.tsx +1 -1
  145. package/src/aldehyde/lowcode-components/act-table/index.tsx +5 -1
  146. package/src/aldehyde/lowcode-components/bar-chart/index.tsx +6 -3
  147. package/src/aldehyde/lowcode-components/base-button/index.tsx +3 -1
  148. package/src/aldehyde/lowcode-components/base-radio/index.tsx +12 -2
  149. package/src/aldehyde/lowcode-components/base-table/index.tsx +6 -3
  150. package/src/aldehyde/lowcode-components/base-tabs/index.tsx +3 -1
  151. package/src/aldehyde/lowcode-components/base-text/index.tsx +3 -1
  152. package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +4 -1
  153. package/src/aldehyde/lowcode-components/carousel/index.tsx +6 -5
  154. package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +4 -1
  155. package/src/aldehyde/lowcode-components/column-chart/index.tsx +4 -1
  156. package/src/aldehyde/lowcode-components/data-number/index.tsx +4 -2
  157. package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +4 -1
  158. package/src/aldehyde/lowcode-components/line-chart/index.tsx +5 -1
  159. package/src/aldehyde/lowcode-components/pie-chart/index.tsx +4 -1
  160. package/src/aldehyde/lowcode-components/search-form/index.tsx +4 -3
  161. package/src/aldehyde/lowcode-components/stroke-animation/index.tsx +3 -1
  162. package/src/aldehyde/lowcode-components/text-scroller/index.tsx +3 -1
  163. package/src/aldehyde/table/act-table.tsx +7 -3
  164. package/src/aldehyde/table/page-config-button.tsx +7 -3
  165. package/src/aldehyde/table/query-table.tsx +4 -1
  166. package/src/aldehyde/table/report-table.tsx +2 -0
  167. package/src/aldehyde/table/resizable-table.tsx +2 -2
  168. package/src/aldehyde/table/select-table.tsx +9 -3
  169. package/src/aldehyde/tmpl/interface.tsx +3 -0
@@ -1,14 +1,16 @@
1
1
  import React from "react";
2
2
  import { Layout } from "antd";
3
3
  import TabsLayout from "./tabs/tabs-layout";
4
+ import { MenuType } from "./type/layout-type";
4
5
 
5
6
 
6
7
  type MainPropsType = {
7
8
  style?: any;
8
9
  children?: React.ReactNode;
10
+ menuList?: MenuType[];
9
11
  };
10
12
 
11
- const Main: React.FC<MainPropsType> = ({ style, children }) => {
13
+ const Main: React.FC<MainPropsType> = ({ style, children, menuList }) => {
12
14
  return (
13
15
  <Layout.Content style={{ background: "#fff", overflow: "auto", paddingBottom: 10, ...style }}>
14
16
  <div
@@ -19,7 +21,7 @@ const Main: React.FC<MainPropsType> = ({ style, children }) => {
19
21
  padding: 10,
20
22
  }}
21
23
  >
22
- {children ? children : <TabsLayout />}
24
+ {children ? children : <TabsLayout menuList={menuList} />}
23
25
  </div>
24
26
  </Layout.Content>
25
27
  );
@@ -247,7 +247,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
247
247
  <Header themeConfig={themeConfig} logoImg={logo || systemLogo} systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
248
248
  <Layout>
249
249
  <Sider themeConfig={themeConfig} menuList={menu} collapsed={getSiderCollapsed()}></Sider>
250
- <Main>{props.children}</Main>
250
+ <Main menuList={menu}>{props.children}</Main>
251
251
  </Layout>
252
252
  </Layout>
253
253
  </ConfigProvider>
@@ -9,10 +9,15 @@ import Units from '../../units';
9
9
  import { useLocale } from "../../locale/useLocale";
10
10
  import "../css/tabs-layout.less";
11
11
  import QueueAnim from 'rc-queue-anim';
12
+ import { MenuType } from "../type/layout-type";
12
13
  // import {arrayMove} from "react-sortable-hoc";
13
14
 
15
+ interface Props {
16
+ menuList?: MenuType[];
17
+ }
14
18
 
15
- const TabsLayout: React.FC = (props) => {
19
+ const TabsLayout = (props: Props) => {
20
+ const { menuList } = props;
16
21
 
17
22
  const { translate } = useLocale();
18
23
  const {
@@ -79,6 +84,9 @@ const TabsLayout: React.FC = (props) => {
79
84
  }, [menuItems]);
80
85
 
81
86
  const tabItems = useMemo(() => {
87
+ if (!menuList.length) { // 无菜单不显示
88
+ return [];
89
+ }
82
90
  return tabs.map(tab => {
83
91
  return {
84
92
  key: tab.routePath,
@@ -101,7 +109,7 @@ const TabsLayout: React.FC = (props) => {
101
109
  closable: tabs.length > 1, // 剩最后一个就不能删除了
102
110
  }
103
111
  })
104
- }, [tabs]);
112
+ }, [tabs, menuList]);
105
113
  //let tabItems=tabItemsf();
106
114
 
107
115
  let navigate = useNavigate();
@@ -8,13 +8,20 @@ import { useNavigate } from 'react-router-dom';
8
8
  import QueueAnim from 'rc-queue-anim';
9
9
  import Units from '../../units';
10
10
  import { useLocale } from "../../locale/useLocale";
11
+ import { MenuType } from "../../layout2/type/layout-type";
11
12
  import "../css/tabs-layout.less";
12
13
 
13
14
  const getIcon = (icon?: string): React.ReactElement | undefined => {
14
15
  return icon && antdIcons[icon] && React.createElement(antdIcons[icon]);
15
16
  }
16
17
 
17
- const TabsLayout: React.FC = () => {
18
+ interface Props {
19
+ menuList?: MenuType[];
20
+ }
21
+
22
+
23
+ const TabsLayout = (props: Props) => {
24
+ const { menuList } = props;
18
25
  const { translate } = useLocale();
19
26
  const navigate = useNavigate();
20
27
  const { activeTabRoutePath, tabs = [], closeTab, refreshTab, closeOtherTab } = useTabs();
@@ -59,6 +66,9 @@ const TabsLayout: React.FC = () => {
59
66
  }, [menuItems]);
60
67
 
61
68
  const tabItems = useMemo(() => {
69
+ if (!menuList.length) { // 无菜单不显示
70
+ return [];
71
+ }
62
72
  return tabs.map(tab => ({
63
73
  key: tab.routePath,
64
74
  label: renderTabTitle(tab),
@@ -73,7 +83,7 @@ const TabsLayout: React.FC = () => {
73
83
  ),
74
84
  closable: tabs.length > 1, // 剩最后一个就不能删除了
75
85
  }))
76
- }, [tabs]);
86
+ }, [tabs, menuList]);
77
87
 
78
88
  const onTabsChange = useCallback((tabKey: string) => {
79
89
  const tab = tabs.find(r => r.routePath === tabKey);
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
2
  import { Layout } from "antd";
3
3
  import TabsLayout from "./components/tabs-layout";
4
+ import { MenuType } from "../layout2/type/layout-type";
4
5
 
5
6
  type MainPropsType = {
6
7
  style?: any;
7
8
  children?: React.ReactNode;
9
+ menuList?: MenuType[];
8
10
  };
9
11
 
10
- const Main: React.FC<MainPropsType> = ({ style, children }) => {
12
+ const Main: React.FC<MainPropsType> = ({ style, children, menuList }) => {
11
13
  return (
12
14
  <Layout.Content style={{ overflow: "auto", ...style }}>
13
15
  <div
@@ -18,7 +20,7 @@ const Main: React.FC<MainPropsType> = ({ style, children }) => {
18
20
  padding: "0 12px 12px 12px",
19
21
  }}
20
22
  >
21
- {children ? children : <TabsLayout />}
23
+ {children ? children : <TabsLayout menuList={menuList} />}
22
24
  </div>
23
25
  </Layout.Content>
24
26
  );
@@ -75,7 +75,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
75
75
  <Header themeConfig={themeConfig} systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
76
76
  <Layout>
77
77
  <Sider themeConfig={themeConfig} menuList={menu} collapsed={getSiderCollapsed()}></Sider>
78
- <Main>{props.children}</Main>
78
+ <Main menuList={menu} >{props.children}</Main>
79
79
  </Layout>
80
80
  </Layout>
81
81
  </ConfigProvider>
@@ -8,13 +8,19 @@ import { useNavigate } from 'react-router-dom';
8
8
  import QueueAnim from 'rc-queue-anim';
9
9
  import Units from '../../units';
10
10
  import { useLocale } from "../../locale/useLocale";
11
+ import { MenuType } from "../../layout2/type/layout-type";
11
12
  import "../css/tabs-layout.less";
12
13
 
13
14
  const getIcon = (icon?: string): React.ReactElement | undefined => {
14
15
  return icon && antdIcons[icon] && React.createElement(antdIcons[icon]);
15
16
  }
16
17
 
17
- const TabsLayout: React.FC = () => {
18
+ interface Props {
19
+ menuList?: MenuType[];
20
+ }
21
+
22
+ const TabsLayout = (props: Props) => {
23
+ const { menuList } = props;
18
24
  const { translate } = useLocale();
19
25
  const navigate = useNavigate();
20
26
  const { activeTabRoutePath, tabs = [], closeTab, refreshTab, closeOtherTab } = useTabs();
@@ -59,6 +65,9 @@ const TabsLayout: React.FC = () => {
59
65
  }, [menuItems]);
60
66
 
61
67
  const tabItems = useMemo(() => {
68
+ if (!menuList.length) { // 无菜单不显示
69
+ return [];
70
+ }
62
71
  return tabs.map(tab => ({
63
72
  key: tab.routePath,
64
73
  label: renderTabTitle(tab),
@@ -73,7 +82,7 @@ const TabsLayout: React.FC = () => {
73
82
  ),
74
83
  closable: tabs.length > 1, // 剩最后一个就不能删除了
75
84
  }))
76
- }, [tabs]);
85
+ }, [tabs, menuList]);
77
86
 
78
87
  const onTabsChange = useCallback((tabKey: string) => {
79
88
  const tab = tabs.find(r => r.routePath === tabKey);
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
2
  import { Layout } from "antd";
3
3
  import TabsLayout from "./components/tabs-layout";
4
+ import { MenuType } from "../layout2/type/layout-type";
4
5
 
5
6
  type MainPropsType = {
6
7
  style?: any;
7
8
  children?: React.ReactNode;
9
+ menuList?: MenuType[];
8
10
  };
9
11
 
10
- const Main: React.FC<MainPropsType> = ({ style, children }) => {
12
+ const Main: React.FC<MainPropsType> = ({ style, children, menuList }) => {
11
13
  return (
12
14
  <Layout.Content style={{ overflow: "auto", ...style }}>
13
15
  <div
@@ -18,7 +20,7 @@ const Main: React.FC<MainPropsType> = ({ style, children }) => {
18
20
  padding: "0 12px 12px 12px",
19
21
  }}
20
22
  >
21
- {children ? children : <TabsLayout />}
23
+ {children ? children : <TabsLayout menuList={menuList} />}
22
24
  </div>
23
25
  </Layout.Content>
24
26
  );
@@ -90,7 +90,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
90
90
  <Header themeConfig={themeConfig} logoImg={logo || systemLogo} systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
91
91
  <Layout>
92
92
  <Sider themeConfig={themeConfig} menuList={menu} collapsed={getSiderCollapsed()}></Sider>
93
- <Main>{props.children}</Main>
93
+ <Main menuList={menu}>{props.children}</Main>
94
94
  </Layout>
95
95
  </Layout>
96
96
  </ConfigProvider>
@@ -71,7 +71,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
71
71
  <Sider themeConfig={themeConfig} logoImg={logo || systemLogo} menuList={menu} collapsed={getSiderCollapsed()} systemName={systemName ? systemName : Units.programName_NavLeft()} />
72
72
  <Layout>
73
73
  <Header themeConfig={themeConfig} menuList={menu} />
74
- <Main>{props.children}</Main>
74
+ <Main menuList={menu}>{props.children}</Main>
75
75
  </Layout>
76
76
  </Layout>
77
77
  </ConfigProvider>
@@ -3,6 +3,7 @@ import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useSta
3
3
  import { ConfigProvider } from "antd";
4
4
  import { LtmplConfig } from "../../tmpl/interface";
5
5
  import HydrocarbonService from "../../tmpl/hcservice-v3";
6
+ import { useLocale } from "../../locale/useLocale";
6
7
  import ActTable from "../../table/act-table";
7
8
  import { DataConfigProps } from "../data";
8
9
  import './index.less';
@@ -22,6 +23,7 @@ export interface ComponentStyle {
22
23
  body?: {
23
24
  background?: string;
24
25
  color?: string;
26
+ showEmpty?: boolean;
25
27
  };
26
28
  border?: {
27
29
  show?: boolean;
@@ -46,6 +48,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
46
48
  const [ltmplConfig, setLtmplConfig] = useState<LtmplConfig>();
47
49
  const [pageInfo, setPageInfo] = useState({ pageNo: 1, pageSize: style?.table?.pageSize || 10 });
48
50
  const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
51
+ const { translate } = useLocale();
49
52
 
50
53
  useImperativeHandle(ref, () => ({
51
54
  updateConfig: (newConfig) => {
@@ -125,9 +128,10 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
125
128
  pageSize={pageInfo.pageSize}
126
129
  onChangePage={(pageNo, pageSize) => setPageInfo({ pageNo, pageSize })}
127
130
  criteriaData={initSearchParams || {}}
131
+ showEmpty={config?.body?.showEmpty}
128
132
  />
129
133
  </ConfigProvider> :
130
- <div className='empty' style={{ color: config?.body?.color }}>暂无数据</div>
134
+ <div className='empty' style={{ color: config?.body?.color }}>{translate("${暂无数据}")}</div>
131
135
  }
132
136
  </div>
133
137
  );
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
2
2
  import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
3
  import _ from 'lodash';
4
4
  import { Spin } from "antd";
5
+ import { useLocale } from "../../locale/useLocale";
5
6
  import HydrocarbonService from "../../tmpl/hcservice-v3";
6
7
  import { DataConfigProps } from "../data";
7
8
 
@@ -13,7 +14,7 @@ const defOption = {
13
14
  show: false, // 无数据时显示
14
15
  },
15
16
  tooltip: { trigger: "axis" },
16
- grid: { top: 30, let: 30, right: 20, bottom: 30 },
17
+ grid: { top: 30, left: 30, right: 20, bottom: 30 },
17
18
  yAxis: {
18
19
  type: 'category',
19
20
  boundaryGap: true,
@@ -52,7 +53,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
52
53
  const temData = data.map((r) => {
53
54
  const { config, value } = r;
54
55
  const isD = Object.keys(config).some(r => r.includes("d"));
55
- const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
56
+ const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
56
57
  return isD ? {
57
58
  name: config.d1,
58
59
  data: vNames.map((r) => ({
@@ -69,7 +70,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
69
70
  export interface ComponentStyle {
70
71
  tooltip?: { show: boolean };
71
72
  color?: string[];
72
- grid?: { top: number, let: number, right: number, bottom: number };
73
+ grid?: { top: number, left: number, right: number, bottom: number };
73
74
  xAxis?: { [key: string]: any };
74
75
  yAxis?: { [key: string]: any };
75
76
  legend?: { [key: string]: any };
@@ -104,6 +105,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
104
105
  const chartRef = useRef<HTMLDivElement>(null);
105
106
  const chart = useRef<any>(null);
106
107
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
108
+ const { translate } = useLocale();
107
109
 
108
110
  const handleDestroy = () => {
109
111
  pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
@@ -222,6 +224,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
222
224
  option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
223
225
  option.yAxis = { ...option.yAxis, ...yAxis };
224
226
  option.dataZoom = dataZoom ? [{ type: "inside", disabled: false, orient: "vertical" }] : [];
227
+ option.title.text = translate("${暂无数据}");
225
228
  option.title.show = !temData?.length;
226
229
  option.series = temData.map((r, index) => ({
227
230
  type: "bar",
@@ -1,6 +1,7 @@
1
1
 
2
2
  import React, { ForwardedRef, forwardRef, useImperativeHandle, useState, useMemo, useEffect } from 'react';
3
3
  import { Button } from "antd";
4
+ import { useLocale } from "../../locale/useLocale";
4
5
  import HydrocarbonService from "../../tmpl/hcservice-v3";
5
6
  import ProgramConfig from "../../units";
6
7
  import LowcodeConstant from "../assets/lowcode-constant";
@@ -112,6 +113,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
112
113
  const { style, navigate, isDesignMode } = props;
113
114
  const [config, setConfig] = useState<ComponentStyle>(style || {});
114
115
  const [localImgDel, setLocalImgDel] = useState<boolean>(false);
116
+ const { translate } = useLocale();
115
117
 
116
118
  useImperativeHandle(ref, () => ({
117
119
  updateConfig: (newConfig) => { // 组件更新配置
@@ -188,7 +190,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
188
190
  onClick={onClick}
189
191
  >
190
192
  {isDesignMode && localImgDel ? <div style={{ position: "absolute", width: "100%", height: "100%", backgroundColor: "rgba(0,0,0,0.5)", display: "flex", justifyContent: "center", alignItems: "center", color: "red" }}>背景图片已删除,请重新上传</div> : null}
191
- {config.text || ""}
193
+ {config.text ? translate("${" + config.text + "}") : ""}
192
194
  </Button>
193
195
  );
194
196
  });
@@ -2,6 +2,7 @@
2
2
  import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
3
3
  import { Radio, ConfigProvider } from 'antd';
4
4
  import dayjs from 'dayjs';
5
+ import { useLocale } from "../../locale/useLocale";
5
6
  import "./index.less";
6
7
 
7
8
  const handleTimes = (type: string) => {
@@ -34,6 +35,14 @@ const handleTimes = (type: string) => {
34
35
  }
35
36
  }
36
37
 
38
+ // 翻译
39
+ const handleTranslate = (arr: { label: string, value: string }[], translate: any) => {
40
+ if (!arr) {
41
+ return [];
42
+ }
43
+ const temArr = arr.map(r => ({ value: r.value, label: translate("${" + r.label + "}") }));
44
+ return temArr;
45
+ }
37
46
 
38
47
  export interface ComponentStyle {
39
48
  optionType?: "default" | "button",
@@ -68,8 +77,9 @@ export interface ComponentRef {
68
77
 
69
78
  const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
70
79
  const { style, setSearchParams } = props;
80
+ const { translate } = useLocale();
71
81
  const [config, setConfig] = useState<ComponentStyle>({ ...style });
72
- const [options, setOptions] = useState<{ label: string, value: string }[]>(style?.searchConfig?.options || []);
82
+ const [options, setOptions] = useState<{ label: string, value: string }[]>(handleTranslate(style?.searchConfig?.options, translate));
73
83
  const [currentValue, setCurrentValue] = useState<string>(style?.searchConfig?.defaultValue || "");
74
84
 
75
85
  useImperativeHandle(ref, () => ({
@@ -77,7 +87,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
77
87
  const { style: newStyle } = newConfig;
78
88
  const { searchConfig } = newStyle;
79
89
  setConfig({ ...newStyle });
80
- setOptions(searchConfig?.options || []);
90
+ setOptions(handleTranslate(searchConfig?.options, translate));
81
91
  setCurrentValue(searchConfig?.defaultValue || "");
82
92
  },
83
93
  }));
@@ -4,6 +4,7 @@ import { ConfigProvider, Empty } from "antd";
4
4
  import HcserviceV3 from "../../tmpl/hcservice-v3";
5
5
  import { DataConfigProps } from "../data";
6
6
  import { ViewControl } from "../../index";
7
+ import { useLocale } from "../../locale/useLocale";
7
8
  import './index.less';
8
9
 
9
10
  const defColumns = [
@@ -42,6 +43,7 @@ export interface ITableBodyStyle {
42
43
  fontWeight?: number;
43
44
  fontFamily?: string;
44
45
  pageSize?: number;
46
+ showEmpty?: boolean; // 空状态显隐
45
47
  }
46
48
 
47
49
  export interface ComponentStyle {
@@ -68,8 +70,8 @@ export interface ComponentRef {
68
70
 
69
71
  const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
70
72
  const { style, isDesignMode, data: propsData, request } = props;
71
- const [headerStyle, setHeaderStyle] = useState<ITableHeaderStyle>({ ...style?.header });
72
- const [bodyStyle, setBodyStyle] = useState<ITableBodyStyle>({ ...style?.body });
73
+ const [headerStyle, setHeaderStyle] = useState<ITableHeaderStyle>({ ...(style?.header || {}) });
74
+ const [bodyStyle, setBodyStyle] = useState<ITableBodyStyle>({ ...(style?.body || {}) });
73
75
  const [borderStyle, setBorderStyle] = useState<{ show?: boolean, color?: string }>({ ...(style?.border || {}) });
74
76
  const [carousel, setCarousel] = useState<{ speed: number, enable: boolean }>({ ...style?.carousel });
75
77
  const [dataConfig, setDataConfig] = useState<DataConfigProps>({ ...propsData });
@@ -81,6 +83,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
81
83
  const resizeObserverRef = useRef<ResizeObserver | null>(null);
82
84
  const contentHeightRef = useRef<number>(0);
83
85
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
86
+ const { translate } = useLocale();
84
87
 
85
88
  const handleDestroy = () => {
86
89
  resizeObserverRef.current && resizeObserverRef.current.disconnect();
@@ -202,7 +205,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
202
205
  }
203
206
  }, [dataConfig?.sourceType, dataConfig?.sourceId, initSearchParams]);
204
207
 
205
- const renderEmpty = () => <div className={'base-table-empty'} style={{ ...bodyStyle }}><Empty styles={{ description: { color: bodyStyle.color || "#000000" } }} image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" /></div>;
208
+ const renderEmpty = () => <div className={'base-table-empty'} style={{ ...bodyStyle }}>{bodyStyle?.showEmpty !== false ? <Empty styles={{ description: { color: bodyStyle.color || "#000000" } }} image={Empty.PRESENTED_IMAGE_SIMPLE} description={translate("${暂无数据}")} /> : ""}</div>;
206
209
 
207
210
  return (
208
211
  <div className={'base-table'} ref={tableRef} style={carousel.enable ? { overflowX: "auto" } : { overflow: "auto" }}>
@@ -4,6 +4,7 @@ import { Button, Space } from "antd";
4
4
  import HydrocarbonService from "../../tmpl/hcservice-v3";
5
5
  import ProgramConfig from "../../units";
6
6
  import LowcodeConstant from "../assets/lowcode-constant";
7
+ import { useLocale } from "../../locale/useLocale";
7
8
  import './index.less';
8
9
 
9
10
  const { serverKey, sourceId } = LowcodeConstant.fileUpload;
@@ -111,6 +112,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
111
112
  const [defaultStyle, setDefaultStyle] = useState<ItemStyle>({ ...style.defaultStyle });
112
113
  const [activeStyle, setActiveStyle] = useState<ItemStyle>({ ...style.activeStyle });
113
114
  const [localImgDel, setLocalImgDel] = useState<{ active: boolean, default: boolean }>({ active: false, default: false });
115
+ const { translate } = useLocale();
114
116
 
115
117
  useImperativeHandle(ref, () => ({
116
118
  updateConfig: (newConfig) => { // 组件更新配置
@@ -173,7 +175,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
173
175
  onClick={() => onClick({ ...item, key: `key${index}` })}
174
176
  >
175
177
  {isDesignMode && (activeKey === `key${index}` ? localImgDel.active : localImgDel.default) ? <div style={{ position: "absolute", width: "100%", height: "100%", backgroundColor: "rgba(0,0,0,0.5)", display: "flex", justifyContent: "center", alignItems: "center", color: "red" }}>背景图片已删除,请重新上传</div> : null}
176
- {item.text || ""}
178
+ {item.text ? translate("${" + item.text + "}") : ""}
177
179
  </Button>)}
178
180
  </Space>
179
181
  );
@@ -6,6 +6,7 @@ import React, {
6
6
  useImperativeHandle,
7
7
  useState
8
8
  } from 'react';
9
+ import { useLocale } from "../../locale/useLocale";
9
10
  import './index.less';
10
11
 
11
12
  export interface BaseTextComponentStyle {
@@ -32,6 +33,7 @@ export interface BaseTextComponentRef {
32
33
  }
33
34
 
34
35
  const BaseTextComponent = forwardRef((props: BaseTextComponentProps, ref: ForwardedRef<BaseTextComponentRef>) => {
36
+ const { translate } = useLocale();
35
37
  const [config, setConfig] = useState<BaseTextComponentProps>({ ...props });
36
38
  const { style, data } = config;
37
39
 
@@ -49,7 +51,7 @@ const BaseTextComponent = forwardRef((props: BaseTextComponentProps, ref: Forwar
49
51
  className={'base-text-component'}
50
52
  style={{ ...style, ...strokeStyle }}
51
53
  >
52
- {data?.staticData}
54
+ {data?.staticData ? translate("${" + data.staticData + "}") : ""}
53
55
  </div>
54
56
  );
55
57
  });
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
2
2
  import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
3
  import _ from 'lodash';
4
4
  import { Spin } from "antd";
5
+ import { useLocale } from "../../locale/useLocale";
5
6
  import HydrocarbonService from "../../tmpl/hcservice-v3";
6
7
  import { DataConfigProps } from "../data";
7
8
 
@@ -69,7 +70,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
69
70
  const temData = data.map((r) => {
70
71
  const { config, value } = r;
71
72
  const isD = Object.keys(config).some(r => r.includes("d"));
72
- const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
73
+ const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
73
74
  return isD ? {
74
75
  name: config.d1,
75
76
  data: vNames.map((r) => ({
@@ -122,6 +123,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
122
123
  const chartRef = useRef<HTMLDivElement>(null);
123
124
  const chart = useRef<any>(null);
124
125
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
126
+ const { translate } = useLocale();
125
127
 
126
128
  const handleDestroy = () => {
127
129
  pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
@@ -240,6 +242,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
240
242
  option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
241
243
  option.yAxis = { ...option.yAxis, ...yAxis, axisTick: { show: yAxis?.axisLine?.show } };
242
244
  option.dataZoom = dataZoom ? [{ type: "inside", disabled: false, orient: "vertical" }] : [];
245
+ option.title.text = translate("${暂无数据}");
243
246
  option.title.show = !temData?.length;
244
247
  option.series = temData.map((r) => ({
245
248
  type: "bar",
@@ -1,13 +1,13 @@
1
1
  import React, { ForwardedRef, forwardRef, useImperativeHandle, useState, useEffect, useRef } from 'react';
2
2
  import { Carousel, Image } from 'antd';
3
3
  import HydrocarbonService from "../../tmpl/hcservice-v3";
4
+ import { useLocale } from "../../locale/useLocale";
4
5
  import ProgramConfig from "../../units";
5
6
  import { DataConfigProps, OssConfig } from "../data";
6
- import Units from "../../units";
7
7
 
8
8
  const defServerKey = "LowCodeOss";
9
9
 
10
- const renderEmpty = (height) => <div style={{
10
+ const renderEmpty = (height, translate) => <div style={{
11
11
  color: '#9a9a9a',
12
12
  height,
13
13
  width: '100%',
@@ -15,7 +15,7 @@ const renderEmpty = (height) => <div style={{
15
15
  justifyContent: 'center',
16
16
  alignItems: 'center'
17
17
  }}>
18
- <div>暂无数据</div>
18
+ <div>{translate("${暂无数据}")}</div>
19
19
  </div>;
20
20
 
21
21
  // 处理本地图片地址
@@ -101,9 +101,10 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
101
101
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
102
102
  const [size, setSize] = useState<{ width: number, height: number }>(propsBase);
103
103
  const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
104
+ const { translate } = useLocale();
104
105
 
105
106
  const getOssConfig = (serverKey: string) => {
106
- const { accessKeyId, accessKeySecret, bucket, endpoint } = Units.getExtendServers(serverKey) || {};
107
+ const { accessKeyId, accessKeySecret, bucket, endpoint } = ProgramConfig.getExtendServers(serverKey) || {};
107
108
  const temObj = { accessKeyId, accessKeySecret, bucket, endpoint }
108
109
  return temObj;
109
110
  }
@@ -200,7 +201,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
200
201
 
201
202
  return <Carousel adaptiveHeight={true} {...config} autoplaySpeed={(config.autoplaySpeed || 3) * 1000}>
202
203
  {data.length && data.map((r, index) => <div key={index}> <Image style={{ width: size.width, height: size.height }} src={r} preview={isDesignMode ? false : config.preview} /></div>)}
203
- {!data.length && <div>{renderEmpty(size.height)}</div>}
204
+ {!data.length && <div>{renderEmpty(size.height, translate)}</div>}
204
205
  </Carousel>;
205
206
  });
206
207
 
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
2
2
  import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
3
  import _ from 'lodash';
4
4
  import { Spin } from "antd";
5
+ import { useLocale } from "../../locale/useLocale";
5
6
  import HydrocarbonService from "../../tmpl/hcservice-v3";
6
7
  import { DataConfigProps } from "../data";
7
8
 
@@ -49,7 +50,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
49
50
  const temData = data.map((r) => {
50
51
  const { config, value } = r;
51
52
  const isD = Object.keys(config).some(r => r.includes("d"));
52
- const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
53
+ const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
53
54
  return isD ? {
54
55
  name: config.d1,
55
56
  data: vNames.map((r) => ({
@@ -158,6 +159,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
158
159
  const chartRef = useRef<HTMLDivElement>(null);
159
160
  const chart = useRef<any>(null);
160
161
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
162
+ const { translate } = useLocale();
161
163
 
162
164
  const handleDestroy = () => {
163
165
  pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
@@ -285,6 +287,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
285
287
  option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
286
288
  option.yAxis = { ...option.yAxis, ...yAxis };
287
289
  option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
290
+ option.title.text = translate("${暂无数据}");
288
291
  option.title.show = !temData?.length;
289
292
  option.series = [{
290
293
  type: 'custom',
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
2
2
  import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
3
  import _ from 'lodash';
4
4
  import { Spin } from "antd";
5
+ import { useLocale } from "../../locale/useLocale";
5
6
  import HydrocarbonService from "../../tmpl/hcservice-v3";
6
7
  import { DataConfigProps } from "../data";
7
8
 
@@ -74,7 +75,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
74
75
  const temData = data.map((r) => {
75
76
  const { config, value } = r;
76
77
  const isD = Object.keys(config).some(r => r.includes("d"));
77
- const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
78
+ const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
78
79
  return isD ? {
79
80
  name: config.d1,
80
81
  data: vNames.map((r) => ({
@@ -126,6 +127,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
126
127
  const chartRef = useRef<HTMLDivElement>(null);
127
128
  const chart = useRef<any>(null);
128
129
  const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
130
+ const { translate } = useLocale();
129
131
 
130
132
  // 组件销毁
131
133
  const handleDestroy = () => {
@@ -244,6 +246,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
244
246
  option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
245
247
  option.yAxis = { ...option.yAxis, ...yAxis };
246
248
  option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
249
+ option.title.text = translate("${暂无数据}");
247
250
  option.title.show = !temData?.length;
248
251
  option.series = temData.map((r, index) => ({
249
252
  type: "bar",