aldehyde 0.2.461 → 0.2.462
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/2dEditor/components/component.less +3 -1
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.js.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +2 -0
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.js +4 -6
- package/lib/controls/cquery/cquick-button.js.map +1 -1
- package/lib/controls/direct-file-view/drawer-file-view.d.ts +1 -1
- package/lib/controls/direct-file-view/drawer-file-view.d.ts.map +1 -1
- package/lib/controls/direct-file-view/drawer-file-view.js +4 -3
- package/lib/controls/direct-file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +1 -2
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +1 -2
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/index.css +5 -3
- package/lib/controls/entity-select/popover-entity-select.d.ts +5 -2
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +9 -7
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
- package/lib/controls/file-view/drawer-file-view.js +4 -3
- package/lib/controls/file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/qr-code/index.js +1 -1
- package/lib/controls/qr-code/index.js.map +1 -1
- package/lib/controls/qr-code/index.less +2 -1
- package/lib/controls/relation-existion/index.css +3 -3
- package/lib/controls/relation-existion/index.js +1 -1
- package/lib/controls/relation-existion/index.js.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts +1 -0
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.js +1 -0
- package/lib/controls/text/ellipsis-text.js.map +1 -1
- package/lib/controls/text/index.less +5 -0
- package/lib/detail/view/snapshot-timeline.d.ts +4 -0
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.js +6 -6
- package/lib/detail/view/snapshot-timeline.js.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts +0 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +9 -8
- package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +2 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +14 -17
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout2/components/search-menu.js +14 -3
- package/lib/layout2/components/search-menu.js.map +1 -1
- package/lib/layout2/components/user-button.js +13 -2
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/page.js +1 -1
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/sider.d.ts.map +1 -1
- package/lib/layout2/sider.js +16 -13
- package/lib/layout2/sider.js.map +1 -1
- package/lib/layout3/css/main.less +7 -3
- package/lib/layout3/page.js +1 -1
- package/lib/layout3/page.js.map +1 -1
- package/lib/layout3/sider.d.ts.map +1 -1
- package/lib/layout3/sider.js +16 -13
- package/lib/layout3/sider.js.map +1 -1
- package/lib/layout4/css/main.less +7 -3
- package/lib/layout4/page.js +1 -1
- package/lib/layout4/page.js.map +1 -1
- package/lib/layout4/sider.d.ts.map +1 -1
- package/lib/layout4/sider.js +16 -13
- package/lib/layout4/sider.js.map +1 -1
- package/lib/layout5/page.js +1 -1
- package/lib/layout5/page.js.map +1 -1
- package/lib/layout5/sider.d.ts.map +1 -1
- package/lib/layout5/sider.js +16 -13
- package/lib/layout5/sider.js.map +1 -1
- package/lib/list/gantt/index.less +1 -0
- package/lib/lowcode-components/lowcode-view/index.less +1 -0
- package/lib/module/block-menu-tree-drawer.d.ts +2 -0
- package/lib/module/block-menu-tree-drawer.d.ts.map +1 -1
- package/lib/module/block-menu-tree-drawer.js +9 -7
- package/lib/module/block-menu-tree-drawer.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +4 -0
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +26 -14
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-view-drawer.d.ts +4 -1
- package/lib/module/dtmpl-view-drawer.d.ts.map +1 -1
- package/lib/module/dtmpl-view-drawer.js +10 -9
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/module/ltmpl-drawer.d.ts +5 -1
- package/lib/module/ltmpl-drawer.d.ts.map +1 -1
- package/lib/module/ltmpl-drawer.js +21 -4
- package/lib/module/ltmpl-drawer.js.map +1 -1
- package/lib/module/ltmpl-table.d.ts +2 -0
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +5 -6
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +6 -7
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/splitview-ltmpl-route.d.ts.map +1 -1
- package/lib/routable/splitview-ltmpl-route.js +2 -4
- package/lib/routable/splitview-ltmpl-route.js.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 +5 -4
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts +1 -0
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +78 -10
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/column/index.less +30 -2
- package/lib/tmpl/interface.d.ts +3 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/web-socket.js +1 -1
- package/lib/tmpl/web-socket.js.map +1 -1
- package/lib/welcome/components/user-menus.d.ts.map +1 -1
- package/lib/welcome/components/user-menus.js +2 -1
- package/lib/welcome/components/user-menus.js.map +1 -1
- package/package.json +3 -4
- package/src/aldehyde/controls/2dEditor/components/component.less +3 -1
- package/src/aldehyde/controls/chemstruc/graph.tsx +32 -32
- package/src/aldehyde/controls/cquery/cquick-button.tsx +7 -7
- package/src/aldehyde/controls/direct-file-view/drawer-file-view.tsx +6 -3
- package/src/aldehyde/controls/entity-select/entity-select.tsx +2 -4
- package/src/aldehyde/controls/entity-select/index.css +5 -3
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +12 -9
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +6 -3
- package/src/aldehyde/controls/qr-code/index.less +2 -1
- package/src/aldehyde/controls/qr-code/index.tsx +1 -1
- package/src/aldehyde/controls/relation-existion/index.css +3 -3
- package/src/aldehyde/controls/relation-existion/index.tsx +1 -1
- package/src/aldehyde/controls/text/ellipsis-text.tsx +4 -2
- package/src/aldehyde/controls/text/index.less +5 -0
- package/src/aldehyde/detail/view/snapshot-timeline.tsx +15 -9
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +27 -31
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +25 -33
- package/src/aldehyde/layout2/components/search-menu.tsx +3 -3
- package/src/aldehyde/layout2/components/user-button.tsx +2 -2
- package/src/aldehyde/layout2/page.tsx +1 -1
- package/src/aldehyde/layout2/sider.tsx +21 -20
- package/src/aldehyde/layout3/css/main.less +7 -3
- package/src/aldehyde/layout3/page.tsx +1 -1
- package/src/aldehyde/layout3/sider.tsx +19 -16
- package/src/aldehyde/layout4/css/main.less +7 -3
- package/src/aldehyde/layout4/page.tsx +1 -1
- package/src/aldehyde/layout4/sider.tsx +19 -16
- package/src/aldehyde/layout5/page.tsx +1 -1
- package/src/aldehyde/layout5/sider.tsx +19 -16
- package/src/aldehyde/list/gantt/index.less +1 -0
- package/src/aldehyde/lowcode-components/lowcode-view/index.less +1 -0
- package/src/aldehyde/module/block-menu-tree-drawer.tsx +15 -10
- package/src/aldehyde/module/dtmpl-edit-page.tsx +50 -33
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +12 -12
- package/src/aldehyde/module/ltmpl-drawer.tsx +12 -10
- package/src/aldehyde/module/ltmpl-table.tsx +7 -13
- package/src/aldehyde/routable/ltmpl-route.tsx +8 -10
- package/src/aldehyde/routable/splitview-ltmpl-route.tsx +4 -5
- package/src/aldehyde/table/act-table.tsx +7 -3
- package/src/aldehyde/table/column/column-builder.tsx +134 -26
- package/src/aldehyde/table/column/index.less +30 -2
- package/src/aldehyde/tmpl/interface.tsx +3 -0
- package/src/aldehyde/tmpl/web-socket.ts +1 -1
- package/src/aldehyde/welcome/components/user-menus.tsx +4 -0
|
@@ -12,7 +12,7 @@ interface LtmplDrawPageProps extends LtmplTableProps {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface LtmplDrawPageState {
|
|
15
|
-
|
|
15
|
+
drawerSize?: number | string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export default class LtmplDrawer extends React.PureComponent<LtmplDrawPageProps, LtmplDrawPageState> {
|
|
@@ -27,30 +27,32 @@ export default class LtmplDrawer extends React.PureComponent<LtmplDrawPageProps,
|
|
|
27
27
|
placement: 'left',
|
|
28
28
|
}
|
|
29
29
|
state = {
|
|
30
|
-
|
|
30
|
+
drawerSize: 0
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
async componentDidMount() {
|
|
34
|
+
const { width } = this.props;
|
|
35
|
+
this.setState({ drawerSize: width });
|
|
36
|
+
}
|
|
33
37
|
|
|
34
38
|
render() {
|
|
35
39
|
const { title, width, onCancel, open, ...other } = this.props;
|
|
40
|
+
const { drawerSize } = this.state;
|
|
36
41
|
const placement = this.props.placement || 'left';
|
|
42
|
+
const maxSize = document.documentElement.clientWidth * 0.9;
|
|
37
43
|
|
|
38
44
|
return (<Drawer
|
|
39
45
|
title={title}
|
|
40
46
|
placement={placement}
|
|
47
|
+
resizable={{ onResize: (newSize => this.setState({ drawerSize: newSize })) }}
|
|
41
48
|
closable={true}
|
|
42
49
|
mask={false}
|
|
43
50
|
onClose={onCancel}
|
|
44
51
|
open={open}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
maxWidth: '92vw',
|
|
48
|
-
}}
|
|
49
|
-
// extra={
|
|
50
|
-
// <Space>{this.getFooter()}</Space>
|
|
51
|
-
// }
|
|
52
|
+
size={drawerSize}
|
|
53
|
+
maxSize={maxSize}
|
|
52
54
|
>
|
|
53
|
-
<LtmplTable {...other}
|
|
55
|
+
<LtmplTable {...other} />
|
|
54
56
|
</Drawer>
|
|
55
57
|
)
|
|
56
58
|
|
|
@@ -54,6 +54,7 @@ export interface LtmplTableState {
|
|
|
54
54
|
collapse?: boolean;
|
|
55
55
|
addTmplId?: string;
|
|
56
56
|
dtmplSourceId?: string;
|
|
57
|
+
drawerSize?: number | string; // 抽屉组件
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
@@ -71,6 +72,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
71
72
|
collapse: false,
|
|
72
73
|
addTmplId: undefined,
|
|
73
74
|
dtmplSourceId: undefined,
|
|
75
|
+
drawerSize: "92vw"
|
|
74
76
|
};
|
|
75
77
|
static contextType = LocaleContext;
|
|
76
78
|
context: React.ContextType<typeof LocaleContext>;
|
|
@@ -252,7 +254,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
252
254
|
ractionId,
|
|
253
255
|
showDraw,
|
|
254
256
|
collapse,
|
|
255
|
-
addTmplId, dtmplSourceId,
|
|
257
|
+
addTmplId, dtmplSourceId, drawerSize
|
|
256
258
|
} = this.state;
|
|
257
259
|
const {
|
|
258
260
|
sourceId, mainCode,
|
|
@@ -350,15 +352,13 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
350
352
|
<Drawer
|
|
351
353
|
placement={"left"}
|
|
352
354
|
title={translate("${关联查询}")}
|
|
355
|
+
resizable={{ onResize: (newSize => this.setState({ drawerSize: newSize })) }}
|
|
356
|
+
size={drawerSize}
|
|
353
357
|
closable={true}
|
|
354
358
|
mask={false}
|
|
355
359
|
onClose={this.closeDrawer}
|
|
356
360
|
open={showDraw}
|
|
357
|
-
|
|
358
|
-
rootStyle={{
|
|
359
|
-
width: "calc(100% - 280px)",
|
|
360
|
-
maxWidth: 1960,
|
|
361
|
-
}}
|
|
361
|
+
styles={{ body: { minWidth: "720px" } }}
|
|
362
362
|
extra={
|
|
363
363
|
<Space>
|
|
364
364
|
<Button onClick={this.closeDrawer}>
|
|
@@ -367,13 +367,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
367
367
|
</Space>
|
|
368
368
|
}
|
|
369
369
|
>
|
|
370
|
-
{
|
|
371
|
-
<LtmplTable
|
|
372
|
-
serverKey={serverKey}
|
|
373
|
-
sourceId={ractionId}
|
|
374
|
-
mainCode={selectedCode}
|
|
375
|
-
></LtmplTable>
|
|
376
|
-
}
|
|
370
|
+
<LtmplTable serverKey={serverKey} sourceId={ractionId} mainCode={selectedCode} />
|
|
377
371
|
</Drawer> : null}
|
|
378
372
|
</>
|
|
379
373
|
);
|
|
@@ -44,6 +44,7 @@ export interface LtmplRouteState {
|
|
|
44
44
|
userPageConfigLoading?: boolean; // 缓存配置请求状态
|
|
45
45
|
themeConfig?: ThemeConfig;
|
|
46
46
|
pageSizeOptions?: number[]; // 分页条数
|
|
47
|
+
drawerSize?: number | string; // 抽屉组件
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
@@ -73,7 +74,8 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
73
74
|
userPageConfig: undefined,
|
|
74
75
|
userPageConfigLoading: true,
|
|
75
76
|
themeConfig: undefined,
|
|
76
|
-
pageSizeOptions: []
|
|
77
|
+
pageSizeOptions: [],
|
|
78
|
+
drawerSize: "92vw"
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
async componentDidMount() {
|
|
@@ -374,7 +376,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
374
376
|
const {
|
|
375
377
|
ltmplConfigRes, showDraw, showWindowType, ractionId, selectedCode,
|
|
376
378
|
showViewDrawer, showViewModal, showEdit, editSourceId, viewSourceId, toCustomPage, userPageConfig,
|
|
377
|
-
themeConfig, pageSizeOptions, userPageConfigLoading
|
|
379
|
+
themeConfig, pageSizeOptions, userPageConfigLoading, drawerSize
|
|
378
380
|
} = this.state;
|
|
379
381
|
const { location, params, tableType, rowOperatable, defShowType } = this.props;
|
|
380
382
|
const { sourceId } = params;
|
|
@@ -427,11 +429,8 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
427
429
|
<Drawer
|
|
428
430
|
placement={"left"} title={translate("${关联查询}")} closable={true} mask={false} onClose={this.doClose}
|
|
429
431
|
open={showDraw}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
width: "calc(100% - 280px)",
|
|
433
|
-
maxWidth: 1960,
|
|
434
|
-
}}
|
|
432
|
+
resizable={{ onResize: (newSize => this.setState({ drawerSize: newSize })) }}
|
|
433
|
+
size={drawerSize}
|
|
435
434
|
extra={
|
|
436
435
|
<Space>
|
|
437
436
|
<Button onClick={this.doClose}>
|
|
@@ -439,10 +438,9 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
439
438
|
</Button>
|
|
440
439
|
</Space>
|
|
441
440
|
}
|
|
441
|
+
styles={{ body: { minWidth: "720px" } }}
|
|
442
442
|
>
|
|
443
|
-
{
|
|
444
|
-
<LtmplTable serverKey={null} sourceId={ractionId} mainCode={selectedCode}></LtmplTable>
|
|
445
|
-
}
|
|
443
|
+
<LtmplTable serverKey={null} sourceId={ractionId} mainCode={selectedCode} />
|
|
446
444
|
</Drawer>
|
|
447
445
|
) : null}
|
|
448
446
|
{showViewDrawer && selectedCode ? (
|
|
@@ -41,6 +41,7 @@ const Index = (props: Props) => {
|
|
|
41
41
|
const [userPageConfigLoading, setUserPageConfigLoading] = useState<boolean>(true);
|
|
42
42
|
const [pageSizeOptions, setPageSizeOptions] = useState<number[]>([]); // 分页条数
|
|
43
43
|
const [themeConfig, setThemeConfig] = useState<ThemeConfig>(); // 主题配置信息
|
|
44
|
+
const [drawerSize, setDrawerSize] = useState<number | string>("92vw");
|
|
44
45
|
const { sourceId } = useParams();
|
|
45
46
|
const { search } = useLocation();
|
|
46
47
|
const { translate } = useLocale();
|
|
@@ -310,11 +311,9 @@ const Index = (props: Props) => {
|
|
|
310
311
|
<Drawer
|
|
311
312
|
placement="left" title={translate("${关联查询}")} closable={true} mask={false} onClose={doCloseShowDraw}
|
|
312
313
|
open={showDraw}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
maxWidth: 1960,
|
|
317
|
-
}}
|
|
314
|
+
resizable={{ onResize: (newSize => setDrawerSize(newSize)) }}
|
|
315
|
+
size={drawerSize}
|
|
316
|
+
styles={{ body: { minWidth: "720px" } }}
|
|
318
317
|
extra={
|
|
319
318
|
<Space>
|
|
320
319
|
<Button onClick={doCloseShowDraw}>{translate("${关闭}")}</Button>
|
|
@@ -115,6 +115,7 @@ interface ActTableStat {
|
|
|
115
115
|
tabsOptions?: { key: string, value: string, label: React.ReactNode, title?: string, id?: string, ids?: string[] }[]; // tabs选项
|
|
116
116
|
tabActiveKey?: string; // Tabs选中项
|
|
117
117
|
pageSizeOptions?: number[]; // 设备分页数
|
|
118
|
+
customDrawerSize?: number | string; // 自定义页面抽屉宽度
|
|
118
119
|
}
|
|
119
120
|
let serial_number = new Date().getTime();
|
|
120
121
|
let busyReminderTime = 0;
|
|
@@ -150,7 +151,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
150
151
|
delModalOpen: false, // 强删除弹窗是否打开
|
|
151
152
|
tabsOptions: [],
|
|
152
153
|
tabActiveKey: "all",
|
|
153
|
-
pageSizeOptions: defPageSizeOptions
|
|
154
|
+
pageSizeOptions: defPageSizeOptions,
|
|
155
|
+
customDrawerSize: undefined
|
|
154
156
|
};
|
|
155
157
|
|
|
156
158
|
static contextType = LocaleContext;
|
|
@@ -381,7 +383,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
381
383
|
| "right-drawer"
|
|
382
384
|
) => {
|
|
383
385
|
const { translate } = this.context;
|
|
384
|
-
const { customButton, customButtonData } = this.state;
|
|
386
|
+
const { customButton, customButtonData, customDrawerSize } = this.state;
|
|
385
387
|
|
|
386
388
|
if (!customButton) {
|
|
387
389
|
return "";
|
|
@@ -451,10 +453,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
451
453
|
placement={
|
|
452
454
|
customButton.windowPosition == "right-drawer" ? "right" : "left"
|
|
453
455
|
}
|
|
454
|
-
|
|
456
|
+
resizable={{ onResize: (newSize => this.setState({ customDrawerSize: newSize })) }}
|
|
457
|
+
size={customDrawerSize !== undefined ? customDrawerSize : customButton.windowWidth}
|
|
455
458
|
onClose={() => {
|
|
456
459
|
this.setState({ customButton: undefined });
|
|
457
460
|
}}
|
|
461
|
+
styles={{ body: { minWidth: customButton.windowWidth } }}
|
|
458
462
|
>
|
|
459
463
|
{customElement}
|
|
460
464
|
</Drawer>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, FieldConfig } from "../../tmpl/interface";
|
|
2
|
+
import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, FieldConfig, CustomButton, CQueryConfig } from "../../tmpl/interface";
|
|
3
3
|
import TableUnits from "../table-util";
|
|
4
4
|
import SupportInputTypes from "../../tmpl/control-type-supportor";
|
|
5
5
|
import { Button, Popconfirm, Popover, Space, Tooltip, Form as AntdForm } from "antd";
|
|
@@ -25,6 +25,7 @@ import NewinFileView from "../../controls/file-view/newin-file-view";
|
|
|
25
25
|
import { EntryControl } from "../../index";
|
|
26
26
|
import TmplConfigAnalysis from "../../tmpl/tmpl-config-analysis";
|
|
27
27
|
import Icon from "../../icon/aliIcon";
|
|
28
|
+
import SelectCodeExport from "../../controls/file-export/select-code-export";
|
|
28
29
|
import "./index.less";
|
|
29
30
|
|
|
30
31
|
const FormItem = AntdForm.Item;
|
|
@@ -83,7 +84,7 @@ export default {
|
|
|
83
84
|
columnResize
|
|
84
85
|
} = props;
|
|
85
86
|
|
|
86
|
-
const { primaryColumn, primaryColumnLabel } = ltmplConfig
|
|
87
|
+
const { primaryColumn, secondColumn, primaryColumnLabel } = ltmplConfig;
|
|
87
88
|
|
|
88
89
|
let tableColumns = [];
|
|
89
90
|
let s = 0;
|
|
@@ -184,6 +185,40 @@ export default {
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
|
|
188
|
+
// 首字段渲染
|
|
189
|
+
const renderPrimaryColumn = <div className="column-table-primary">
|
|
190
|
+
<div className="primary-column" onClick={() => detailParams && showView(detailParams)}>
|
|
191
|
+
<ViewControl
|
|
192
|
+
serverKey={serverKey}
|
|
193
|
+
fieldConfig={item}
|
|
194
|
+
value={record[item.id]}
|
|
195
|
+
holderType="table"
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
{primaryColumnLabel?.id ?
|
|
199
|
+
<div className="primary-column-label" >
|
|
200
|
+
<ViewControl
|
|
201
|
+
serverKey={serverKey}
|
|
202
|
+
fieldConfig={primaryColumnLabel}
|
|
203
|
+
value={record[primaryColumnLabel.id]}
|
|
204
|
+
holderType="table"
|
|
205
|
+
/>
|
|
206
|
+
</div> :
|
|
207
|
+
""}
|
|
208
|
+
{/* 首字段操作按钮 */}
|
|
209
|
+
{this.renderColumnAction(props, record, "primary")}
|
|
210
|
+
</div>;
|
|
211
|
+
// 次字段渲染
|
|
212
|
+
const renderSecondColumn = <div className="column-table-second">
|
|
213
|
+
<ViewControl
|
|
214
|
+
serverKey={serverKey}
|
|
215
|
+
fieldConfig={item}
|
|
216
|
+
value={record[item.id]}
|
|
217
|
+
holderType="table"
|
|
218
|
+
/>
|
|
219
|
+
{this.renderColumnAction(props, record, "secondary")}
|
|
220
|
+
</div>;
|
|
221
|
+
|
|
187
222
|
return (editings.includes(record.code) || buttons.includes("multiRowEdit") ?
|
|
188
223
|
<FormItem style={{ margin: 0 }}
|
|
189
224
|
name={record.code + "_" + item.id}
|
|
@@ -197,35 +232,15 @@ export default {
|
|
|
197
232
|
/>
|
|
198
233
|
</FormItem> :
|
|
199
234
|
<div className={record['dataType'] ? record['dataType'] === "小计" ? "xiaoji" : 'heji' : ""}>
|
|
200
|
-
{primaryColumn?.id === item.id ?
|
|
201
|
-
<
|
|
202
|
-
<div className="primary-column" onClick={() => detailParams && showView(detailParams)}>
|
|
203
|
-
<ViewControl
|
|
204
|
-
serverKey={serverKey}
|
|
205
|
-
fieldConfig={item}
|
|
206
|
-
value={record[item.id]}
|
|
207
|
-
holderType="table"
|
|
208
|
-
/>
|
|
209
|
-
</div>
|
|
210
|
-
{primaryColumnLabel?.id ?
|
|
211
|
-
<div className="primary-column-label" >
|
|
212
|
-
<ViewControl
|
|
213
|
-
serverKey={serverKey}
|
|
214
|
-
fieldConfig={primaryColumnLabel}
|
|
215
|
-
value={record[primaryColumnLabel.id]}
|
|
216
|
-
holderType="table"
|
|
217
|
-
/>
|
|
218
|
-
</div> :
|
|
219
|
-
""}
|
|
220
|
-
</div>
|
|
221
|
-
: <ViewControl
|
|
235
|
+
{primaryColumn?.id === item.id ? renderPrimaryColumn : secondColumn?.id === item.id ? renderSecondColumn :
|
|
236
|
+
<ViewControl
|
|
222
237
|
serverKey={serverKey}
|
|
223
238
|
fieldConfig={item}
|
|
224
239
|
value={record[item.id]}
|
|
225
240
|
holderType="table"
|
|
226
241
|
/>
|
|
227
242
|
}
|
|
228
|
-
</div
|
|
243
|
+
</div>
|
|
229
244
|
);
|
|
230
245
|
};
|
|
231
246
|
}
|
|
@@ -423,7 +438,100 @@ export default {
|
|
|
423
438
|
}
|
|
424
439
|
return undefined;
|
|
425
440
|
},
|
|
426
|
-
|
|
441
|
+
renderColumnAction(props: ActionRenderProps, record: DtmplData, type: "primary" | "secondary") { // 主列/次列悬浮按钮渲染
|
|
442
|
+
const { ltmplConfig, serverKey, doRowAction, doRAction, doCustomButton, translate, readOnly } = props;
|
|
443
|
+
const { primaryColumnButtons, secondColumnButtons } = ltmplConfig;
|
|
444
|
+
const temButtons = type === "primary" ? primaryColumnButtons : secondColumnButtons;
|
|
445
|
+
if (readOnly || !temButtons?.length) {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
const actionButtons: any[] = temButtons.map(item => {
|
|
449
|
+
switch (item.functionType) {
|
|
450
|
+
case "action": // 操作按钮
|
|
451
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
452
|
+
return <Action
|
|
453
|
+
serverKey={serverKey}
|
|
454
|
+
iconType={"icon"}
|
|
455
|
+
key={item.id}
|
|
456
|
+
data={[record]}
|
|
457
|
+
actionConfig={item}
|
|
458
|
+
doAction={doRowAction}
|
|
459
|
+
buttonSize={"small"}
|
|
460
|
+
serial={1}
|
|
461
|
+
/>;
|
|
462
|
+
} else {
|
|
463
|
+
return undefined;
|
|
464
|
+
}
|
|
465
|
+
case "raction": // 关系按钮
|
|
466
|
+
if (ActionUtils.isShow(item?.preposes, [record], undefined)) {
|
|
467
|
+
return <Button
|
|
468
|
+
key={item.id}
|
|
469
|
+
size="small"
|
|
470
|
+
type="dashed"
|
|
471
|
+
onClick={() => doRAction(item.id, record.code)}
|
|
472
|
+
>
|
|
473
|
+
{item.icon ?
|
|
474
|
+
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
475
|
+
<Icon type={item.icon} />
|
|
476
|
+
</Tooltip>
|
|
477
|
+
: translate("${" + item.title + "}")}
|
|
478
|
+
</Button>;
|
|
479
|
+
} else {
|
|
480
|
+
return undefined;
|
|
481
|
+
}
|
|
482
|
+
case "customButton": // 自由按钮
|
|
483
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
484
|
+
return <Button
|
|
485
|
+
key={item.id}
|
|
486
|
+
size="small"
|
|
487
|
+
type={item.buttonType || "dashed"}
|
|
488
|
+
onClick={() => doCustomButton(item as unknown as CustomButton, [record])}
|
|
489
|
+
>
|
|
490
|
+
{item.icon ?
|
|
491
|
+
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
492
|
+
<Icon type={item.icon} />
|
|
493
|
+
</Tooltip>
|
|
494
|
+
: translate("${" + item.title + "}")}
|
|
495
|
+
</Button>
|
|
496
|
+
} else {
|
|
497
|
+
return undefined;
|
|
498
|
+
};
|
|
499
|
+
case "fileExport": // 文件导出
|
|
500
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
501
|
+
return <SelectCodeExport
|
|
502
|
+
serverKey={serverKey}
|
|
503
|
+
hiddenType="disabled"
|
|
504
|
+
codes={[record.code]}
|
|
505
|
+
key={item.id}
|
|
506
|
+
fileExport={item}
|
|
507
|
+
disabled={false}
|
|
508
|
+
/>;
|
|
509
|
+
} else {
|
|
510
|
+
return undefined;
|
|
511
|
+
}
|
|
512
|
+
case "customExport": // 自定义导出
|
|
513
|
+
return undefined;
|
|
514
|
+
case "cQuery": // 关联查询
|
|
515
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
516
|
+
const config: CQueryConfig = item;
|
|
517
|
+
return <CquickButton
|
|
518
|
+
serverKey={serverKey}
|
|
519
|
+
key={config.id}
|
|
520
|
+
size={"small"}
|
|
521
|
+
pageType={"drawer"}
|
|
522
|
+
cQueryConfig={config}
|
|
523
|
+
mainCode={config.mainCodeColId ? record[config.mainCodeColId] : record.code}
|
|
524
|
+
/>;
|
|
525
|
+
} else {
|
|
526
|
+
return undefined;
|
|
527
|
+
}
|
|
528
|
+
default:
|
|
529
|
+
return undefined;
|
|
530
|
+
}
|
|
531
|
+
}).filter(Boolean);
|
|
532
|
+
return actionButtons?.length ? <div className="column-action"><Space wrap size={4}>{actionButtons}</Space></div> : undefined;
|
|
533
|
+
},
|
|
534
|
+
renderAction(props: ActionRenderProps, record: DtmplData) { // 操作列按钮渲染
|
|
427
535
|
const { ltmplConfig, showView,
|
|
428
536
|
doEdit,
|
|
429
537
|
doRAction,
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.column-table-primary {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
16
|
|
|
19
17
|
.primary-column {
|
|
20
18
|
text-overflow: ellipsis;
|
|
@@ -33,4 +31,34 @@
|
|
|
33
31
|
white-space: nowrap;
|
|
34
32
|
}
|
|
35
33
|
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.column-table-primary,
|
|
37
|
+
.column-table-second {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
|
|
41
|
+
.column-action {
|
|
42
|
+
display: none;
|
|
43
|
+
position: absolute;
|
|
44
|
+
right: 8px;
|
|
45
|
+
top: 50%;
|
|
46
|
+
transform: translateY(-50%);
|
|
47
|
+
z-index: 1;
|
|
48
|
+
padding: 2px;
|
|
49
|
+
background-color: var(--ant-color-primary-bg);
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
border: 1px dashed var(--ant-color-primary-border);
|
|
52
|
+
|
|
53
|
+
button {
|
|
54
|
+
margin-right: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.column-table-primary:hover,
|
|
60
|
+
.column-table-second:hover {
|
|
61
|
+
.column-action {
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
36
64
|
}
|
|
@@ -159,6 +159,7 @@ export type ActTableMode = "simple" | "common" | "complete";
|
|
|
159
159
|
export interface ActionConfig extends ButtonConfig {
|
|
160
160
|
preposes: FieldConfig[];
|
|
161
161
|
writes: FieldConfig[];
|
|
162
|
+
functionType?: "action" | "raction" | "customButton" | "fileExport" | "cQuery" | "customExport";
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
export interface BuinButtonConfig extends ButtonConfig {
|
|
@@ -628,6 +629,8 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
628
629
|
defaultDtmplData?: DtmplData;
|
|
629
630
|
rightPercent?: number;
|
|
630
631
|
pageLayout?: "leftRightSplit" | "upDownSplit" | "quadSplit" | "none" | "leftRightSplit-21" | "leftRightSplit-12";
|
|
632
|
+
primaryColumnButtons?: ActionConfig[]; // 首字段操作按钮
|
|
633
|
+
secondColumnButtons?: ActionConfig[]; // 次字段操作按钮
|
|
631
634
|
// 甘特图配置
|
|
632
635
|
gttTableProportion?: number;
|
|
633
636
|
gttBeginTime?: ColumnConfig;
|
|
@@ -128,7 +128,7 @@ class WebSocket {
|
|
|
128
128
|
"hydrocarbon-program-token": programCode
|
|
129
129
|
},
|
|
130
130
|
onConnect: (frame) => { // 连接成功回调
|
|
131
|
-
console.log("连接成功:frame", frame);
|
|
131
|
+
// console.log("连接成功:frame", frame);
|
|
132
132
|
this.state = ConnectionState.CONNECTED;
|
|
133
133
|
this.reconnectAttempts = 0;
|
|
134
134
|
this.connectPromises.forEach(({ resolve }) => resolve());
|
|
@@ -59,6 +59,7 @@ interface PageConfig extends Level2Menu {
|
|
|
59
59
|
const RenderDrawer = (props: DrawerProps) => {
|
|
60
60
|
const { open, onClose, menus, selectMenus, onOk, btnLoading } = props;
|
|
61
61
|
const [checkMenus, setCheckMenus] = useState<string[]>([]);
|
|
62
|
+
const [drawerSize, setDrawerSize] = useState<number | string>();
|
|
62
63
|
const { translate } = useLocale();
|
|
63
64
|
|
|
64
65
|
useEffect(() => {
|
|
@@ -89,6 +90,9 @@ const RenderDrawer = (props: DrawerProps) => {
|
|
|
89
90
|
title={translate("我的菜单")}
|
|
90
91
|
onClose={onClose}
|
|
91
92
|
open={open}
|
|
93
|
+
size={drawerSize}
|
|
94
|
+
resizable={{ onResize: (newSize => setDrawerSize(newSize)) }}
|
|
95
|
+
styles={{ body: { minWidth: "280px" }, title: { whiteSpace: "nowrap" } }}
|
|
92
96
|
extra={
|
|
93
97
|
<Button loading={btnLoading} type="primary" disabled={!treeData?.length} onClick={() => onOk(checkMenus)}>{translate("${保存}")}</Button>
|
|
94
98
|
}
|