amis 1.10.1-beta.0 → 1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Schema.d.ts +1 -1
- package/lib/Schema.js.map +1 -1
- package/lib/components/Avatar.d.ts +10 -10
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/Range.js +8 -2
- package/lib/components/Range.js.map +2 -2
- package/lib/components/ResultBox.d.ts +41 -40
- package/lib/components/ResultBox.js +23 -19
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/Select.js +5 -3
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Steps.d.ts +1 -0
- package/lib/components/Steps.js +8 -6
- package/lib/components/Steps.js.map +2 -2
- package/lib/components/condition-builder/index.d.ts +12 -2
- package/lib/components/condition-builder/index.js +40 -4
- package/lib/components/condition-builder/index.js.map +2 -2
- package/lib/components/formula/Editor.js +1 -1
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/VariableList.js +2 -2
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/table/index.d.ts +9 -7
- package/lib/components/table/index.js +102 -102
- package/lib/components/table/index.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +2 -2
- package/lib/renderers/Action.js +18 -11
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/ButtonGroup.d.ts +2 -2
- package/lib/renderers/ButtonGroup.js.map +1 -1
- package/lib/renderers/CRUD.js +2 -2
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/CRUD2.d.ts +213 -0
- package/lib/renderers/CRUD2.js +724 -0
- package/lib/renderers/CRUD2.js.map +13 -0
- package/lib/renderers/Card2.d.ts +1 -1
- package/lib/renderers/Card2.js +1 -2
- package/lib/renderers/Card2.js.map +2 -2
- package/lib/renderers/Cards.d.ts +3 -0
- package/lib/renderers/Cards.js +52 -5
- package/lib/renderers/Cards.js.map +2 -2
- package/lib/renderers/Form/ConditionBuilder.d.ts +10 -0
- package/lib/renderers/Form/ConditionBuilder.js +6 -2
- package/lib/renderers/Form/ConditionBuilder.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +66 -20
- package/lib/renderers/Form/Editor.d.ts +66 -20
- package/lib/renderers/Form/Item.d.ts +4 -0
- package/lib/renderers/Form/Item.js +1 -1
- package/lib/renderers/Form/Item.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +0 -1
- package/lib/renderers/Form/TreeSelect.js +1 -9
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.js +8 -4
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Icon.d.ts +1 -1
- package/lib/renderers/Icon.js +13 -8
- package/lib/renderers/Icon.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +1 -0
- package/lib/renderers/Table/index.js +19 -5
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Table-v2/index.d.ts +8 -5
- package/lib/renderers/Table-v2/index.js +83 -54
- package/lib/renderers/Table-v2/index.js.map +2 -2
- package/lib/store/combo.d.ts +72 -22
- package/lib/store/crud.d.ts +2 -0
- package/lib/store/crud.js +21 -1
- package/lib/store/crud.js.map +2 -2
- package/lib/store/form.d.ts +30 -9
- package/lib/store/form.js +28 -10
- package/lib/store/form.js.map +2 -2
- package/lib/store/formItem.d.ts +3 -1
- package/lib/store/formItem.js +3 -5
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/list.d.ts +2 -0
- package/lib/store/list.js +8 -0
- package/lib/store/list.js.map +2 -2
- package/lib/store/table.d.ts +60 -18
- package/lib/themes/ang-ie11.css +166 -19
- package/lib/themes/ang.css +166 -19
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +166 -19
- package/lib/themes/antd.css +166 -19
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +166 -19
- package/lib/themes/cxd.css +166 -19
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +166 -19
- package/lib/themes/dark.css +166 -19
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +166 -19
- package/lib/themes/default.css +166 -19
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/icon.js +7 -0
- package/lib/utils/icon.js.map +2 -2
- package/package.json +1 -1
- package/schema.json +28 -25
- package/scss/_mixins.scss +1 -1
- package/scss/components/_condition-builder.scss +11 -0
- package/scss/components/_crud.scss +8 -3
- package/scss/components/_crud2.scss +148 -0
- package/scss/components/_result-box.scss +27 -8
- package/scss/components/_steps.scss +21 -26
- package/scss/components/_table-v2.scss +1 -3
- package/scss/components/form/_select.scss +4 -0
- package/scss/themes/_common.scss +1 -0
- package/sdk/ang-ie11.css +203 -20
- package/sdk/ang.css +203 -20
- package/sdk/antd-ie11.css +203 -20
- package/sdk/antd.css +203 -20
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +203 -20
- package/sdk/cxd.css +203 -20
- package/sdk/dark-ie11.css +203 -20
- package/sdk/dark.css +203 -20
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +203 -20
- package/sdk/sdk.css +203 -20
- package/sdk/sdk.js +1344 -1340
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +1 -0
- package/src/components/Range.tsx +14 -7
- package/src/components/ResultBox.tsx +65 -54
- package/src/components/Select.tsx +6 -5
- package/src/components/Steps.tsx +60 -18
- package/src/components/condition-builder/index.tsx +107 -8
- package/src/components/formula/Editor.tsx +1 -1
- package/src/components/formula/VariableList.tsx +2 -2
- package/src/components/table/index.tsx +190 -193
- package/src/index.tsx +1 -0
- package/src/renderers/Action.tsx +22 -11
- package/src/renderers/ButtonGroup.tsx +2 -2
- package/src/renderers/CRUD.tsx +2 -1
- package/src/renderers/CRUD2.tsx +1213 -0
- package/src/renderers/Card2.tsx +2 -3
- package/src/renderers/Cards.tsx +55 -10
- package/src/renderers/Form/ConditionBuilder.tsx +19 -2
- package/src/renderers/Form/Item.tsx +11 -1
- package/src/renderers/Form/TreeSelect.tsx +14 -16
- package/src/renderers/Form/index.tsx +11 -2
- package/src/renderers/Icon.tsx +8 -1
- package/src/renderers/Table/index.tsx +21 -5
- package/src/renderers/Table-v2/index.tsx +92 -72
- package/src/store/crud.ts +23 -1
- package/src/store/form.ts +31 -24
- package/src/store/formItem.ts +65 -52
- package/src/store/list.ts +10 -0
- package/src/types.ts +2 -1
- package/src/utils/icon.tsx +9 -0
package/src/renderers/Card2.tsx
CHANGED
@@ -54,7 +54,7 @@ export interface Card2Props
|
|
54
54
|
/**
|
55
55
|
* 选择事件
|
56
56
|
*/
|
57
|
-
onCheck: (
|
57
|
+
onCheck: () => void;
|
58
58
|
|
59
59
|
/**
|
60
60
|
* 数据
|
@@ -97,8 +97,7 @@ export default class Card2<T> extends React.Component<Card2Props & T, object> {
|
|
97
97
|
|
98
98
|
@autobind
|
99
99
|
handleCheck() {
|
100
|
-
|
101
|
-
this.props.onCheck && this.props.onCheck(!selected, item);
|
100
|
+
this.props.onCheck && this.props.onCheck();
|
102
101
|
}
|
103
102
|
|
104
103
|
renderCheckbox(): JSX.Element | null {
|
package/src/renderers/Cards.tsx
CHANGED
@@ -4,13 +4,14 @@ import {Renderer, RendererProps} from '../factory';
|
|
4
4
|
import {SchemaNode, Schema, Action} from '../types';
|
5
5
|
import Button from '../components/Button';
|
6
6
|
import {ListStore, IListStore, IItem} from '../store/list';
|
7
|
-
import {observer} from 'mobx-react';
|
8
7
|
import {
|
9
8
|
anyChanged,
|
10
9
|
getScrollParent,
|
11
10
|
difference,
|
12
11
|
ucFirst,
|
13
|
-
noop
|
12
|
+
noop,
|
13
|
+
autobind,
|
14
|
+
createObject
|
14
15
|
} from '../utils/helper';
|
15
16
|
import {isPureVariable, resolveVariableAndFilter} from '../utils/tpl-builtin';
|
16
17
|
import Sortable from 'sortablejs';
|
@@ -404,6 +405,26 @@ export default class Cards extends React.Component<GridProps, object> {
|
|
404
405
|
// store.markHeaderAffix(clip.top < offsetY && (clip.top + clip.height - 40) > offsetY);
|
405
406
|
}
|
406
407
|
|
408
|
+
@autobind
|
409
|
+
doAction(action: Action, data: object, throwErrors: boolean = false) {
|
410
|
+
if (action.actionType) {
|
411
|
+
switch (action.actionType as string) {
|
412
|
+
case 'toggleSelectAll':
|
413
|
+
this.handleCheckAll();
|
414
|
+
break;
|
415
|
+
case 'selectAll':
|
416
|
+
this.handleSelectAll();
|
417
|
+
break;
|
418
|
+
case 'clearAll':
|
419
|
+
this.handleClearAll();
|
420
|
+
break;
|
421
|
+
// case 'dragStart':
|
422
|
+
// this.initDragging();
|
423
|
+
// case 'dragStop':
|
424
|
+
}
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
407
428
|
handleAction(e: React.UIEvent<any>, action: Action, ctx: object) {
|
408
429
|
const {onAction} = this.props;
|
409
430
|
|
@@ -423,14 +444,34 @@ export default class Cards extends React.Component<GridProps, object> {
|
|
423
444
|
this.syncSelected();
|
424
445
|
}
|
425
446
|
|
447
|
+
handleSelectAll() {
|
448
|
+
const {store} = this.props;
|
449
|
+
|
450
|
+
store.selectAll();
|
451
|
+
this.syncSelected();
|
452
|
+
}
|
453
|
+
|
454
|
+
handleClearAll() {
|
455
|
+
const {store} = this.props;
|
456
|
+
|
457
|
+
store.clearAll();
|
458
|
+
this.syncSelected();
|
459
|
+
}
|
460
|
+
|
426
461
|
syncSelected() {
|
427
|
-
const {store, onSelect} = this.props;
|
462
|
+
const {store, onSelect, dispatchEvent} = this.props;
|
463
|
+
const selectItems = store.selectedItems.map(item => item.data);
|
464
|
+
const unSelectItems = store.unSelectedItems.map(item => item.data);
|
465
|
+
|
466
|
+
dispatchEvent(
|
467
|
+
'selected',
|
468
|
+
createObject(store.data, {
|
469
|
+
selectItems,
|
470
|
+
unSelectItems
|
471
|
+
})
|
472
|
+
);
|
428
473
|
|
429
|
-
onSelect &&
|
430
|
-
onSelect(
|
431
|
-
store.selectedItems.map(item => item.data),
|
432
|
-
store.unSelectedItems.map(item => item.data)
|
433
|
-
);
|
474
|
+
onSelect && onSelect(selectItems, unSelectItems);
|
434
475
|
}
|
435
476
|
|
436
477
|
handleQuickChange(
|
@@ -541,6 +582,8 @@ export default class Cards extends React.Component<GridProps, object> {
|
|
541
582
|
}
|
542
583
|
|
543
584
|
initDragging() {
|
585
|
+
if (this.sortable) return;
|
586
|
+
|
544
587
|
const store = this.props.store;
|
545
588
|
const dom = findDOMNode(this) as HTMLElement;
|
546
589
|
const ns = this.props.classPrefix;
|
@@ -868,7 +911,7 @@ export default class Cards extends React.Component<GridProps, object> {
|
|
868
911
|
checkable: item.checkable,
|
869
912
|
draggable: item.draggable,
|
870
913
|
selected: item.checked,
|
871
|
-
onSelect:
|
914
|
+
onSelect: this.handleCheck,
|
872
915
|
dragging: store.dragging,
|
873
916
|
data: item.locals,
|
874
917
|
onAction: this.handleAction,
|
@@ -881,7 +924,9 @@ export default class Cards extends React.Component<GridProps, object> {
|
|
881
924
|
cardProps = {
|
882
925
|
...cardProps,
|
883
926
|
item: item.locals,
|
884
|
-
onCheck:
|
927
|
+
onCheck: () => {
|
928
|
+
this.handleCheck(item);
|
929
|
+
}
|
885
930
|
};
|
886
931
|
}
|
887
932
|
|
@@ -4,7 +4,6 @@ import {Funcs, Fields} from '../../components/condition-builder/types';
|
|
4
4
|
import {Config} from '../../components/condition-builder/config';
|
5
5
|
import ConditionBuilder from '../../components/condition-builder/index';
|
6
6
|
import {SchemaApi, SchemaTokenizeableString} from '../../Schema';
|
7
|
-
import FormulaPicker from '../../components/formula/Picker';
|
8
7
|
import {
|
9
8
|
RemoteOptionsProps,
|
10
9
|
withRemoteConfig
|
@@ -15,6 +14,7 @@ import {
|
|
15
14
|
isPureVariable,
|
16
15
|
resolveVariableAndFilter
|
17
16
|
} from '../../utils/tpl-builtin';
|
17
|
+
import {IconSchema} from '../Icon';
|
18
18
|
|
19
19
|
/**
|
20
20
|
* 条件组合控件
|
@@ -26,6 +26,16 @@ export interface ConditionBuilderControlSchema extends FormBaseControl {
|
|
26
26
|
*/
|
27
27
|
type: 'condition-builder';
|
28
28
|
|
29
|
+
/**
|
30
|
+
* 内嵌模式,默认为 true
|
31
|
+
*/
|
32
|
+
embed?: boolean;
|
33
|
+
|
34
|
+
/**
|
35
|
+
* 非内嵌模式时 弹窗触发icon
|
36
|
+
*/
|
37
|
+
pickerIcon?: IconSchema;
|
38
|
+
|
29
39
|
/**
|
30
40
|
* 函数集合
|
31
41
|
*/
|
@@ -73,8 +83,14 @@ export default class ConditionBuilderControl extends React.PureComponent<Conditi
|
|
73
83
|
data
|
74
84
|
);
|
75
85
|
}
|
86
|
+
|
87
|
+
renderPickerIcon() {
|
88
|
+
const {render, pickerIcon} = this.props;
|
89
|
+
return pickerIcon ? render('picker-icon', pickerIcon) : undefined;
|
90
|
+
}
|
91
|
+
|
76
92
|
render() {
|
77
|
-
const {className, classnames: cx, ...rest} = this.props;
|
93
|
+
const {className, classnames: cx, pickerIcon, ...rest} = this.props;
|
78
94
|
|
79
95
|
// 处理一下formula类型值的变量列表
|
80
96
|
let formula = this.props.formula ? {...this.props.formula} : undefined;
|
@@ -91,6 +107,7 @@ export default class ConditionBuilderControl extends React.PureComponent<Conditi
|
|
91
107
|
<div className={cx(`ConditionBuilderControl`, className)}>
|
92
108
|
<ConditionBuilderWithRemoteOptions
|
93
109
|
renderEtrValue={this.renderEtrValue}
|
110
|
+
pickerIcon={this.renderPickerIcon()}
|
94
111
|
{...rest}
|
95
112
|
formula={formula}
|
96
113
|
/>
|
@@ -308,6 +308,10 @@ export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
|
308
308
|
storeType?: string;
|
309
309
|
validations?: string;
|
310
310
|
strictMode?: boolean;
|
311
|
+
/**
|
312
|
+
* schema变化使视图更新的属性白名单
|
313
|
+
*/
|
314
|
+
detectProps?: Array<string>;
|
311
315
|
shouldComponentUpdate?: (props: any, prevProps: any) => boolean;
|
312
316
|
descriptionClassName?: string;
|
313
317
|
storeExtendsData?: boolean;
|
@@ -1268,7 +1272,13 @@ export function asFormItem(config: Omit<FormItemConfig, 'component'>) {
|
|
1268
1272
|
}
|
1269
1273
|
|
1270
1274
|
// 把可能会影响视图的白名单弄出来,减少重新渲染次数。
|
1271
|
-
if (
|
1275
|
+
if (
|
1276
|
+
anyChanged(
|
1277
|
+
detectProps.concat(config.detectProps || []),
|
1278
|
+
this.props,
|
1279
|
+
nextProps
|
1280
|
+
)
|
1281
|
+
) {
|
1272
1282
|
return true;
|
1273
1283
|
}
|
1274
1284
|
|
@@ -112,7 +112,6 @@ export interface TreeSelectProps extends OptionsControlProps {
|
|
112
112
|
|
113
113
|
export interface TreeSelectState {
|
114
114
|
isOpened: boolean;
|
115
|
-
isFocused: boolean;
|
116
115
|
inputValue: string;
|
117
116
|
}
|
118
117
|
|
@@ -157,8 +156,7 @@ export default class TreeSelectControl extends React.Component<
|
|
157
156
|
|
158
157
|
this.state = {
|
159
158
|
inputValue: '',
|
160
|
-
isOpened: false
|
161
|
-
isFocused: false
|
159
|
+
isOpened: false
|
162
160
|
};
|
163
161
|
|
164
162
|
this.open = this.open.bind(this);
|
@@ -206,22 +204,23 @@ export default class TreeSelectControl extends React.Component<
|
|
206
204
|
|
207
205
|
handleFocus(e: any) {
|
208
206
|
const {dispatchEvent, value, data} = this.props;
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
207
|
+
|
208
|
+
dispatchEvent(
|
209
|
+
'focus',
|
210
|
+
createObject(data, {
|
211
|
+
value
|
212
|
+
})
|
213
|
+
);
|
215
214
|
}
|
216
215
|
|
217
216
|
handleBlur(e: any) {
|
218
217
|
const {dispatchEvent, value, data} = this.props;
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
218
|
+
dispatchEvent(
|
219
|
+
'blur',
|
220
|
+
createObject(data, {
|
221
|
+
value
|
222
|
+
})
|
223
|
+
);
|
225
224
|
}
|
226
225
|
|
227
226
|
handleKeyPress(e: React.KeyboardEvent) {
|
@@ -645,7 +644,6 @@ export default class TreeSelectControl extends React.Component<
|
|
645
644
|
'TreeSelect--searchable':
|
646
645
|
searchable || isEffectiveApi(autoComplete),
|
647
646
|
'is-opened': this.state.isOpened,
|
648
|
-
'is-focused': this.state.isFocused,
|
649
647
|
'is-disabled': disabled
|
650
648
|
})}
|
651
649
|
result={
|
@@ -63,7 +63,7 @@ export interface FormSchemaHorizontal {
|
|
63
63
|
right?: number;
|
64
64
|
leftFixed?: boolean | number | 'xs' | 'sm' | 'md' | 'lg';
|
65
65
|
justify?: boolean; // 两端对齐
|
66
|
-
labelAlign?: 'left' | 'right' // label对齐方式
|
66
|
+
labelAlign?: 'left' | 'right'; // label对齐方式
|
67
67
|
}
|
68
68
|
|
69
69
|
/**
|
@@ -988,7 +988,12 @@ export default class Form extends React.Component<FormProps, object> {
|
|
988
988
|
data = store.data;
|
989
989
|
}
|
990
990
|
if (Array.isArray(action.required) && action.required.length) {
|
991
|
-
|
991
|
+
const fields = action.required.map(item => ({
|
992
|
+
name: item,
|
993
|
+
rules: {isRequired: true}
|
994
|
+
}));
|
995
|
+
|
996
|
+
return store.validateFields(fields).then(async result => {
|
992
997
|
if (!result) {
|
993
998
|
const dispatcher = await dispatchEvent(
|
994
999
|
'validateError',
|
@@ -997,6 +1002,9 @@ export default class Form extends React.Component<FormProps, object> {
|
|
997
1002
|
if (!dispatcher?.prevented) {
|
998
1003
|
env.notify('error', __('Form.validateFailed'));
|
999
1004
|
}
|
1005
|
+
|
1006
|
+
/** 抛异常是为了在dialog中catch这个错误,避免弹窗直接关闭 */
|
1007
|
+
return Promise.reject(__('Form.validateFailed'));
|
1000
1008
|
} else {
|
1001
1009
|
dispatchEvent('validateSucc', this.props.data);
|
1002
1010
|
this.handleAction(
|
@@ -1006,6 +1014,7 @@ export default class Form extends React.Component<FormProps, object> {
|
|
1006
1014
|
throwErrors,
|
1007
1015
|
delegate
|
1008
1016
|
);
|
1017
|
+
return;
|
1009
1018
|
}
|
1010
1019
|
});
|
1011
1020
|
}
|
package/src/renderers/Icon.tsx
CHANGED
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import {Renderer, RendererProps} from '../factory';
|
3
3
|
import {BaseSchema} from '../Schema';
|
4
4
|
import {BadgeSchema, withBadge} from '../components/Badge';
|
5
|
+
import {getIcon} from '../components/icons';
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Icon 图表渲染器
|
@@ -36,6 +37,11 @@ export class Icon extends React.Component<IconProps, object> {
|
|
36
37
|
render() {
|
37
38
|
const {icon, vendor, classnames: cx, className} = this.props;
|
38
39
|
|
40
|
+
let CustomIcon = getIcon(icon);
|
41
|
+
if (CustomIcon) {
|
42
|
+
return <CustomIcon className={cx(className, `icon-${icon}`)} />;
|
43
|
+
}
|
44
|
+
|
39
45
|
const isURLIcon = icon?.indexOf('.') !== -1;
|
40
46
|
let iconPrefix = '';
|
41
47
|
if (vendor === 'iconfont') {
|
@@ -47,6 +53,7 @@ export class Icon extends React.Component<IconProps, object> {
|
|
47
53
|
// 如果vendor为空,则不设置前缀,这样可以支持fontawesome v5、fontawesome v6或者其他框架
|
48
54
|
iconPrefix = `${icon}`;
|
49
55
|
}
|
56
|
+
|
50
57
|
return isURLIcon ? (
|
51
58
|
<img className={cx('Icon')} src={icon} />
|
52
59
|
) : (
|
@@ -60,4 +67,4 @@ export class Icon extends React.Component<IconProps, object> {
|
|
60
67
|
})
|
61
68
|
// @ts-ignore 类型没搞定
|
62
69
|
@withBadge
|
63
|
-
export class
|
70
|
+
export class IconRenderer extends Icon {}
|
@@ -1081,11 +1081,11 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1081
1081
|
} = (this.heights = {});
|
1082
1082
|
|
1083
1083
|
heights.header = table
|
1084
|
-
.querySelector('thead
|
1085
|
-
.getBoundingClientRect().height;
|
1086
|
-
heights.header2 = table
|
1087
|
-
.querySelector('thead>tr:first-child')!
|
1084
|
+
.querySelector('thead')!
|
1088
1085
|
.getBoundingClientRect().height;
|
1086
|
+
// heights.header2 = table
|
1087
|
+
// .querySelector('thead>tr:first-child')!
|
1088
|
+
// .getBoundingClientRect().height;
|
1089
1089
|
|
1090
1090
|
forEach(
|
1091
1091
|
table.querySelectorAll('thead>tr:last-child>th'),
|
@@ -1132,7 +1132,7 @@ export default class Table extends React.Component<TableProps, object> {
|
|
1132
1132
|
table.querySelectorAll('thead>tr:first-child>th'),
|
1133
1133
|
(item: HTMLElement) => {
|
1134
1134
|
const width = widths2[item.getAttribute('data-index') as string];
|
1135
|
-
item.style.cssText += `width: ${width}px; height: ${heights.
|
1135
|
+
item.style.cssText += `width: ${width}px; height: ${heights.header}px`;
|
1136
1136
|
totalWidth2 += width;
|
1137
1137
|
}
|
1138
1138
|
);
|
@@ -2817,6 +2817,22 @@ export class TableRenderer extends Table {
|
|
2817
2817
|
return scoped.send(subPath, values);
|
2818
2818
|
}
|
2819
2819
|
}
|
2820
|
+
|
2821
|
+
reload(subPath?: string, query?: any, ctx?: any) {
|
2822
|
+
const scoped = this.context as IScopedContext;
|
2823
|
+
const parents = scoped?.parent?.getComponents();
|
2824
|
+
|
2825
|
+
if (Array.isArray(parents) && parents.length) {
|
2826
|
+
// CRUD的name会透传给Table,这样可以保证找到CRUD
|
2827
|
+
const crud = parents.find(cmpt => cmpt?.props?.name === this.props?.name);
|
2828
|
+
|
2829
|
+
return crud?.reload?.(subPath, query, ctx);
|
2830
|
+
}
|
2831
|
+
|
2832
|
+
if (subPath) {
|
2833
|
+
return scoped.reload(subPath, ctx);
|
2834
|
+
}
|
2835
|
+
}
|
2820
2836
|
}
|
2821
2837
|
|
2822
2838
|
export {TableCell};
|