aldehyde 0.2.269 → 0.2.271
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/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +1 -1
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js.map +1 -1
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/upload/index.js.map +1 -1
- package/lib/controls/upload/mult-file-upload.d.ts.map +1 -1
- package/lib/controls/upload/mult-file-upload.js +41 -23
- package/lib/controls/upload/mult-file-upload.js.map +1 -1
- package/lib/detail/edit/fields-edit-card.js +1 -1
- package/lib/detail/edit/fields-edit-card.js.map +1 -1
- package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/row-edit-card.js +1 -1
- package/lib/detail/edit/row-edit-card.js.map +1 -1
- package/lib/detail/edit/row-editor.js +1 -1
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/form/criteria-form.js +1 -1
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +4 -4
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts +1 -0
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/field-group-form.js +2 -1
- package/lib/form/field-group-form.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +5 -5
- package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +11 -3
- package/lib/layout2/page.js.map +1 -1
- package/lib/lowcode-components/bar-chart/index.d.ts +36 -0
- package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/bar-chart/index.js +85 -0
- package/lib/lowcode-components/bar-chart/index.js.map +1 -0
- package/lib/lowcode-components/base-color-block/index.d.ts +17 -0
- package/lib/lowcode-components/base-color-block/index.d.ts.map +1 -0
- package/lib/lowcode-components/base-color-block/index.js +10 -0
- package/lib/lowcode-components/base-color-block/index.js.map +1 -0
- package/lib/lowcode-components/base-image/index.d.ts +14 -0
- package/lib/lowcode-components/base-image/index.d.ts.map +1 -0
- package/lib/lowcode-components/base-image/index.js +23 -0
- package/lib/lowcode-components/base-image/index.js.map +1 -0
- package/lib/lowcode-components/base-text/index.d.ts +31 -0
- package/lib/lowcode-components/base-text/index.d.ts.map +1 -0
- package/lib/lowcode-components/base-text/index.js +43 -0
- package/lib/lowcode-components/base-text/index.js.map +1 -0
- package/lib/lowcode-components/column-chart/index.d.ts +36 -0
- package/lib/lowcode-components/column-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/column-chart/index.js +85 -0
- package/lib/lowcode-components/column-chart/index.js.map +1 -0
- package/lib/lowcode-components/date-time/index.d.ts +23 -0
- package/lib/lowcode-components/date-time/index.d.ts.map +1 -0
- package/lib/lowcode-components/date-time/index.js +34 -0
- package/lib/lowcode-components/date-time/index.js.map +1 -0
- package/lib/lowcode-components/four-angle-glow-border/index.d.ts +17 -0
- package/lib/lowcode-components/four-angle-glow-border/index.d.ts.map +1 -0
- package/lib/lowcode-components/four-angle-glow-border/index.js +28 -0
- package/lib/lowcode-components/four-angle-glow-border/index.js.map +1 -0
- package/lib/lowcode-components/index.d.ts +23 -0
- package/lib/lowcode-components/index.d.ts.map +1 -0
- package/lib/lowcode-components/index.js +21 -0
- package/lib/lowcode-components/index.js.map +1 -0
- package/lib/lowcode-components/line-chart/index.d.ts +50 -0
- package/lib/lowcode-components/line-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/line-chart/index.js +94 -0
- package/lib/lowcode-components/line-chart/index.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-controller.d.ts +51 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-controller.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-controller.js +36 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-controller.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-definition.d.ts +70 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-definition.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-definition.js +12 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-definition.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-controller.d.ts +28 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-controller.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-controller.js +60 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-controller.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-loader.d.ts +15 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-loader.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-loader.js +31 -0
- package/lib/lowcode-components/lowcode-view/component/abstract-designer-loader.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts +10 -0
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js +83 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-container.d.ts +9 -0
- package/lib/lowcode-components/lowcode-view/component/component-container.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-container.js +68 -0
- package/lib/lowcode-components/lowcode-view/component/component-container.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-controller.d.ts +22 -0
- package/lib/lowcode-components/lowcode-view/component/component-controller.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-controller.js +102 -0
- package/lib/lowcode-components/lowcode-view/component/component-controller.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-definition.d.ts +12 -0
- package/lib/lowcode-components/lowcode-view/component/component-definition.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/component-definition.js +15 -0
- package/lib/lowcode-components/lowcode-view/component/component-definition.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/layer-builder.d.ts +22 -0
- package/lib/lowcode-components/lowcode-view/component/layer-builder.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/layer-builder.js +83 -0
- package/lib/lowcode-components/lowcode-view/component/layer-builder.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/loading.d.ts +4 -0
- package/lib/lowcode-components/lowcode-view/component/loading.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/component/loading.js +18 -0
- package/lib/lowcode-components/lowcode-view/component/loading.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/index.d.ts +9 -0
- package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/index.js +89 -0
- package/lib/lowcode-components/lowcode-view/index.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/interface.d.ts +139 -0
- package/lib/lowcode-components/lowcode-view/interface.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/interface.js +2 -0
- package/lib/lowcode-components/lowcode-view/interface.js.map +1 -0
- package/lib/lowcode-components/lowcode-view/lowcode-constant.d.ts +11 -0
- package/lib/lowcode-components/lowcode-view/lowcode-constant.d.ts.map +1 -0
- package/lib/lowcode-components/lowcode-view/lowcode-constant.js +10 -0
- package/lib/lowcode-components/lowcode-view/lowcode-constant.js.map +1 -0
- package/lib/module/dtmpl-edit-page.js +3 -2
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-view-drawer.d.ts.map +1 -1
- package/lib/module/dtmpl-view-drawer.js +2 -2
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +6 -1
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +10 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +126 -29
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -1
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +13 -10
- package/lib/tmpl/hc-data-source.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/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js +1 -6
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/package.json +2 -2
- package/src/aldehyde/controls/entry-control.tsx +1 -3
- package/src/aldehyde/controls/select/index.tsx +0 -1
- package/src/aldehyde/controls/upload/index.tsx +0 -1
- package/src/aldehyde/controls/upload/mult-file-upload.tsx +45 -23
- package/src/aldehyde/detail/edit/fields-edit-card.tsx +1 -1
- package/src/aldehyde/detail/edit/row-edit-card.tsx +2 -14
- package/src/aldehyde/detail/edit/row-editor.tsx +1 -1
- package/src/aldehyde/form/criteria-form.tsx +1 -1
- package/src/aldehyde/form/dtmpl-form.tsx +5 -8
- package/src/aldehyde/form/field-group-form.tsx +4 -0
- package/src/aldehyde/index.tsx +3 -0
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +6 -6
- package/src/aldehyde/layout2/page.tsx +13 -3
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +116 -0
- package/src/aldehyde/lowcode-components/base-color-block/index.tsx +32 -0
- package/src/aldehyde/lowcode-components/base-image/index.tsx +45 -0
- package/src/aldehyde/lowcode-components/base-text/index.less +20 -0
- package/src/aldehyde/lowcode-components/base-text/index.tsx +88 -0
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +116 -0
- package/src/aldehyde/lowcode-components/date-time/index.less +5 -0
- package/src/aldehyde/lowcode-components/date-time/index.tsx +65 -0
- package/src/aldehyde/lowcode-components/four-angle-glow-border/index.less +50 -0
- package/src/aldehyde/lowcode-components/four-angle-glow-border/index.tsx +53 -0
- package/src/aldehyde/lowcode-components/index.ts +36 -0
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +122 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-controller.ts +64 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-definition.ts +77 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-controller.ts +63 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-loader.ts +34 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +89 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +88 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-controller.ts +99 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-definition.ts +24 -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/FontGlobal.css +27 -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
- package/src/aldehyde/lowcode-components/lowcode-view/component/layer-builder.tsx +91 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/loading.tsx +23 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +122 -0
- package/src/aldehyde/lowcode-components/lowcode-view/index.less +12 -0
- package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +107 -0
- package/src/aldehyde/lowcode-components/lowcode-view/interface.ts +190 -0
- package/src/aldehyde/lowcode-components/lowcode-view/lowcode-constant.tsx +12 -0
- package/src/aldehyde/module/dtmpl-edit-page.tsx +3 -3
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +1 -2
- package/src/aldehyde/routable/ltmpl-route.tsx +0 -1
- package/src/aldehyde/table/act-table.tsx +6 -1
- package/src/aldehyde/table/relation-table.tsx +155 -40
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -1
- package/src/aldehyde/tmpl/hc-data-source.tsx +14 -11
- package/src/aldehyde/tmpl/interface.tsx +6 -2
- package/src/aldehyde/welcome/HCWelcome.js +1 -6
|
@@ -287,7 +287,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
287
287
|
return "";
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
let customProps = { customButton: customButton, data: customButtonData
|
|
290
|
+
let customProps = { customButton: customButton, data: customButtonData,
|
|
291
|
+
onOk:()=>{this.actTableDoSearch(null)}
|
|
292
|
+
,onclose: () => {
|
|
293
|
+
this.setState({ customButton: undefined });
|
|
294
|
+
}
|
|
295
|
+
};
|
|
291
296
|
|
|
292
297
|
let config:CustomButtonConfig= ProgramConfig.getCustomButtonConfig(customButton.id);
|
|
293
298
|
let page;
|
|
@@ -2,17 +2,17 @@ import React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Col,
|
|
5
|
-
Form,
|
|
5
|
+
Form as AntdForm,
|
|
6
6
|
message,
|
|
7
7
|
Popover,
|
|
8
8
|
Row,
|
|
9
9
|
Space,
|
|
10
10
|
Tooltip,
|
|
11
|
-
Typography, Popconfirm,
|
|
11
|
+
Typography, Popconfirm, FormInstance,
|
|
12
12
|
} from "antd";
|
|
13
13
|
import Table from "./control-table-x-axis-wrapper";
|
|
14
14
|
import {
|
|
15
|
-
AlignLeftOutlined,
|
|
15
|
+
AlignLeftOutlined, CheckOutlined, CloseCircleOutlined,
|
|
16
16
|
DeleteOutlined,
|
|
17
17
|
EditOutlined,
|
|
18
18
|
FormOutlined,
|
|
@@ -40,8 +40,10 @@ import Action from "../controls/action";
|
|
|
40
40
|
import CountingTag from "../controls/counting-tag";
|
|
41
41
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
42
42
|
import VerticalList from "../list/vertical-list";
|
|
43
|
+
import {EntryControl} from "../index";
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
|
|
46
|
+
const FormItem = AntdForm.Item;
|
|
45
47
|
const { Text } = Typography;
|
|
46
48
|
|
|
47
49
|
interface RelationTableProps {
|
|
@@ -56,6 +58,7 @@ interface RelationTableProps {
|
|
|
56
58
|
value: DtmplData[];
|
|
57
59
|
onChange?: (fieldGroupConfig: FieldGroupConfig, value: DtmplData[]) => void;
|
|
58
60
|
initCollapse?: boolean;
|
|
61
|
+
// rowEditForm?: FormInstance;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
interface RelationTableStat {
|
|
@@ -69,6 +72,8 @@ interface RelationTableStat {
|
|
|
69
72
|
filterStr?: string;
|
|
70
73
|
pageSize?: number;
|
|
71
74
|
addTmplId?: string;
|
|
75
|
+
editings?:string[];
|
|
76
|
+
uploadingFiles?:object[];
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
class RelationTable extends React.PureComponent<
|
|
@@ -86,14 +91,13 @@ class RelationTable extends React.PureComponent<
|
|
|
86
91
|
filterStr: undefined,
|
|
87
92
|
pageSize: 10,
|
|
88
93
|
addTmplId: undefined,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// current:1,
|
|
92
|
-
// title:undefined,
|
|
94
|
+
editings:[],
|
|
95
|
+
uploadingFiles:[],
|
|
93
96
|
};
|
|
94
97
|
static contextType = LocaleContext;
|
|
95
98
|
context: React.ContextType<typeof LocaleContext>;
|
|
96
99
|
static defaultProps = {};
|
|
100
|
+
formRef = React.createRef<FormInstance>();
|
|
97
101
|
|
|
98
102
|
async componentDidMount() {
|
|
99
103
|
// const {fieldGroupConfig} = this.props;
|
|
@@ -118,7 +122,6 @@ class RelationTable extends React.PureComponent<
|
|
|
118
122
|
buildDataSource = () => {
|
|
119
123
|
const { filterStr } = this.state;
|
|
120
124
|
const { value } = this.props;
|
|
121
|
-
|
|
122
125
|
let dataSource = undefined;
|
|
123
126
|
|
|
124
127
|
/** 构建 dataSource **/
|
|
@@ -136,7 +139,7 @@ class RelationTable extends React.PureComponent<
|
|
|
136
139
|
}
|
|
137
140
|
if (flag) {
|
|
138
141
|
let row = {
|
|
139
|
-
key:
|
|
142
|
+
key: item.code,
|
|
140
143
|
relationLabel: item.relationLabel,
|
|
141
144
|
code: item.code, //增加code,为了删除操作
|
|
142
145
|
...item.fieldMap,
|
|
@@ -157,9 +160,10 @@ class RelationTable extends React.PureComponent<
|
|
|
157
160
|
showRelationName,
|
|
158
161
|
relationNames,
|
|
159
162
|
disabled,
|
|
160
|
-
deleteData,
|
|
163
|
+
deleteData,addOrEditType
|
|
161
164
|
} = fieldGroupConfig;
|
|
162
165
|
const { translate } = this.context;
|
|
166
|
+
const {editings}=this.state;
|
|
163
167
|
let columns = [];
|
|
164
168
|
/** 构建column **/
|
|
165
169
|
let s = 0;
|
|
@@ -174,13 +178,23 @@ class RelationTable extends React.PureComponent<
|
|
|
174
178
|
TableUnits.sort(column, itemType);
|
|
175
179
|
}
|
|
176
180
|
column["render"] = (text, record) => {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
|
|
182
|
+
return (editings.indexOf(record.code)>=0?
|
|
183
|
+
|
|
184
|
+
<FormItem style={{margin:0}} name={record.code+"_"+item.id} key={record.code+"_"+item.id}
|
|
185
|
+
initialValue={record[item.id]} >
|
|
186
|
+
<EntryControl
|
|
187
|
+
serverKey={serverKey}
|
|
188
|
+
//holderType={"table"}
|
|
189
|
+
fieldConfig={item}
|
|
190
|
+
value={record[item.id]}
|
|
191
|
+
/></FormItem>:
|
|
192
|
+
<ViewControl
|
|
193
|
+
serverKey={serverKey}
|
|
194
|
+
holderType={"table"}
|
|
195
|
+
fieldConfig={item}
|
|
196
|
+
value={record[item.id]}
|
|
197
|
+
/>
|
|
184
198
|
);
|
|
185
199
|
};
|
|
186
200
|
});
|
|
@@ -260,8 +274,9 @@ class RelationTable extends React.PureComponent<
|
|
|
260
274
|
})
|
|
261
275
|
: ""}
|
|
262
276
|
{/*行编辑*/}
|
|
263
|
-
{rowEdit ? (
|
|
264
|
-
|
|
277
|
+
{rowEdit && editings.indexOf(record.code)<0 ? (
|
|
278
|
+
addOrEditType !== "tableRow" ?
|
|
279
|
+
<RowEditor
|
|
265
280
|
serverKey={serverKey}
|
|
266
281
|
disabled={disabled}
|
|
267
282
|
buttonIcon={<EditOutlined />}
|
|
@@ -269,10 +284,17 @@ class RelationTable extends React.PureComponent<
|
|
|
269
284
|
fieldGroupConfig={fieldGroupConfig}
|
|
270
285
|
onOk={this.handleRowEdit}
|
|
271
286
|
tooltipTitle={translate("${编辑}${当前行}")}
|
|
272
|
-
></RowEditor
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
)
|
|
287
|
+
></RowEditor>:<Button icon={<EditOutlined />} size={'small'}
|
|
288
|
+
onClick={()=>this.setState({editings:[...editings,record.code]})} >
|
|
289
|
+
</Button>
|
|
290
|
+
) : ""
|
|
291
|
+
}
|
|
292
|
+
{editings.indexOf(record.code)>=0?
|
|
293
|
+
<><Button onClick={()=>this.saveRowData(record.code)}
|
|
294
|
+
icon={<CheckOutlined />} size={'small'}></Button>
|
|
295
|
+
<Button onClick={()=>this.cancelRowEdit(record.code)}
|
|
296
|
+
icon={<CloseCircleOutlined />} size={'small'}></Button>
|
|
297
|
+
</>:""}
|
|
276
298
|
{/*删除*/}
|
|
277
299
|
{deletable ?
|
|
278
300
|
deleteData? <Popconfirm
|
|
@@ -397,6 +419,7 @@ class RelationTable extends React.PureComponent<
|
|
|
397
419
|
}
|
|
398
420
|
}
|
|
399
421
|
}
|
|
422
|
+
debugger
|
|
400
423
|
//直接删除
|
|
401
424
|
if(fieldGroupConfig.deleteData){
|
|
402
425
|
let result: boolean = await HcserviceV3.deleteByCode(serverKey, fieldGroupConfig.id, [record.code]);
|
|
@@ -521,19 +544,23 @@ class RelationTable extends React.PureComponent<
|
|
|
521
544
|
|
|
522
545
|
handleRowEdit = (dtmplData: DtmplData) => {
|
|
523
546
|
const { value, fieldGroupConfig, onChange } = this.props;
|
|
524
|
-
const { translate } = this.context;
|
|
525
547
|
let datas: DtmplData[] = [];
|
|
526
548
|
if (value) {
|
|
527
549
|
datas = [...value];
|
|
528
550
|
}
|
|
529
551
|
|
|
552
|
+
debugger
|
|
530
553
|
let isAdd = true;
|
|
531
554
|
for (let v of datas) {
|
|
532
555
|
if (v.code == dtmplData.code) {
|
|
533
556
|
isAdd = false;
|
|
534
|
-
|
|
557
|
+
if(dtmplData.editStatus){
|
|
558
|
+
v.editStatus = dtmplData.editStatus;
|
|
559
|
+
}
|
|
535
560
|
v.fieldMap = dtmplData.fieldMap;
|
|
536
|
-
|
|
561
|
+
if(dtmplData.relationLabel){
|
|
562
|
+
v.relationLabel = dtmplData.relationLabel;
|
|
563
|
+
}
|
|
537
564
|
break;
|
|
538
565
|
}
|
|
539
566
|
}
|
|
@@ -542,14 +569,11 @@ class RelationTable extends React.PureComponent<
|
|
|
542
569
|
}
|
|
543
570
|
onChange(fieldGroupConfig, datas);
|
|
544
571
|
|
|
545
|
-
//
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
message.success(translate("${已修改}"));
|
|
551
|
-
}
|
|
552
|
-
//this.hiddenRowEdit();
|
|
572
|
+
// if (isAdd) {
|
|
573
|
+
// message.success(translate("${已添加}"));
|
|
574
|
+
// } else {
|
|
575
|
+
// message.success(translate("${已修改}"));
|
|
576
|
+
// }
|
|
553
577
|
};
|
|
554
578
|
|
|
555
579
|
showAddDtmplModel = (addTmplId?: string) => {
|
|
@@ -588,11 +612,94 @@ class RelationTable extends React.PureComponent<
|
|
|
588
612
|
});
|
|
589
613
|
};
|
|
590
614
|
|
|
615
|
+
addNewRow=(defaultValue)=>{
|
|
616
|
+
const { value, fieldGroupConfig, onChange } = this.props;
|
|
617
|
+
const {editings}=this.state;
|
|
618
|
+
let datas: DtmplData[] = [];
|
|
619
|
+
if (value) {
|
|
620
|
+
datas = [...value];
|
|
621
|
+
}
|
|
622
|
+
let fieldMaps=[];
|
|
623
|
+
if(!defaultValue){
|
|
624
|
+
fieldMaps=[{}]
|
|
625
|
+
}else if(Array.isArray(defaultValue)){
|
|
626
|
+
fieldMaps=defaultValue;
|
|
627
|
+
}else{
|
|
628
|
+
fieldMaps=[defaultValue]
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
let editingCodes=[...editings];
|
|
632
|
+
let i=0;
|
|
633
|
+
debugger
|
|
634
|
+
for(let f of fieldMaps){
|
|
635
|
+
let newData: DtmplData = {};
|
|
636
|
+
newData.code=Date.now()+""+i++;
|
|
637
|
+
newData.relationLabel=fieldGroupConfig.relationNames[0]
|
|
638
|
+
newData.fieldMap=f;
|
|
639
|
+
datas.unshift(newData);
|
|
640
|
+
editingCodes.push(newData.code);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
this.setState({editings:editingCodes})
|
|
644
|
+
onChange(fieldGroupConfig, datas);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
saveRowData=async (code:string)=>{
|
|
648
|
+
let currentForm= this.formRef.current;
|
|
649
|
+
let dtmplData:DtmplData = {code};
|
|
650
|
+
dtmplData.fieldMap={};
|
|
651
|
+
dtmplData.editStatus="changed";
|
|
652
|
+
await currentForm.validateFields().then(async (values) => {
|
|
653
|
+
for (let key in values) {
|
|
654
|
+
if (values.hasOwnProperty(key) && key.startsWith(code)) {
|
|
655
|
+
dtmplData.fieldMap[key.split("_")[1]]=values[key];
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}).catch(errorInfo => {
|
|
659
|
+
})
|
|
660
|
+
this.cancelRowEdit(code);
|
|
661
|
+
this.handleRowEdit(dtmplData);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
cancelRowEdit=(code:string)=>{
|
|
665
|
+
const {editings}=this.state
|
|
666
|
+
// editings..unshift(code);
|
|
667
|
+
let arr = editings.filter(item => item !== code);
|
|
668
|
+
this.setState({editings:[...arr]});
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
uploadFiles=(values)=> {
|
|
672
|
+
|
|
673
|
+
const {batchAddFileField} = this.props.fieldGroupConfig
|
|
674
|
+
if (values) {
|
|
675
|
+
|
|
676
|
+
let uploading = false;
|
|
677
|
+
let vals=JSON.parse(values);
|
|
678
|
+
for (let value of vals) {
|
|
679
|
+
if (!value.status || value.status != "done") {
|
|
680
|
+
uploading = true;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
let datas=[];
|
|
684
|
+
if (!uploading) {
|
|
685
|
+
for (let value of vals) {
|
|
686
|
+
let data = {};
|
|
687
|
+
data[batchAddFileField.id] =JSON.stringify(value) ;
|
|
688
|
+
datas.push(data);
|
|
689
|
+
}
|
|
690
|
+
this.addNewRow(datas);
|
|
691
|
+
this.setState({uploadingFiles:[]})
|
|
692
|
+
}else{
|
|
693
|
+
this.setState({uploadingFiles:values})
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
591
698
|
buildButtons = () => {
|
|
592
699
|
const { fieldGroupConfig, viewOrEdit, value, serverKey } = this.props;
|
|
593
700
|
const { translate } = this.context;
|
|
594
|
-
const { buttons, disabled } = fieldGroupConfig;
|
|
595
|
-
const { showRowEdit } = this.state;
|
|
701
|
+
const { buttons, disabled,addOrEditType,batchAddFileField } = fieldGroupConfig;
|
|
702
|
+
const { showRowEdit,uploadingFiles } = this.state;
|
|
596
703
|
|
|
597
704
|
const buttonDisabled: boolean = disabled
|
|
598
705
|
? disabled
|
|
@@ -606,10 +713,15 @@ class RelationTable extends React.PureComponent<
|
|
|
606
713
|
<Col span={20}>
|
|
607
714
|
<Space>
|
|
608
715
|
{buttons.includes("rowAdd") ? (
|
|
716
|
+
addOrEditType=="tableRow"?
|
|
717
|
+
<>
|
|
718
|
+
<Button onClick={()=>this.addNewRow(undefined)}>{translate("${添加一行}")}</Button>
|
|
719
|
+
{batchAddFileField? <EntryControl value={uploadingFiles} onChange={this.uploadFiles} fieldConfig={{controlType:"relfile"}}/> :""}
|
|
720
|
+
</>:
|
|
609
721
|
<RowEditor
|
|
610
722
|
serverKey={serverKey}
|
|
611
723
|
disabled={buttonDisabled}
|
|
612
|
-
buttonStyle={{
|
|
724
|
+
buttonStyle={{marginBottom:10}}
|
|
613
725
|
buttonTitle={translate("${新建一行}")}
|
|
614
726
|
fieldGroupConfig={fieldGroupConfig}
|
|
615
727
|
onOk={this.handleRowEdit}
|
|
@@ -766,7 +878,10 @@ class RelationTable extends React.PureComponent<
|
|
|
766
878
|
dataSource={this.buildDataSource()}
|
|
767
879
|
columnConfigs={fieldGroupConfig?.fields}
|
|
768
880
|
serverKey={serverKey}
|
|
769
|
-
columns={this.buildColumns()}
|
|
881
|
+
columns={this.buildColumns()}/>:
|
|
882
|
+
<AntdForm
|
|
883
|
+
ref={this.formRef} component={false}>
|
|
884
|
+
<Table
|
|
770
885
|
size={"small"}
|
|
771
886
|
locale={{
|
|
772
887
|
emptyText: (
|
|
@@ -781,7 +896,7 @@ class RelationTable extends React.PureComponent<
|
|
|
781
896
|
columns={this.buildColumns()}
|
|
782
897
|
pagination={page}
|
|
783
898
|
onChange={this.tabChange}
|
|
784
|
-
|
|
899
|
+
/></AntdForm> }
|
|
785
900
|
</div>
|
|
786
901
|
</CollapseCard>
|
|
787
902
|
{buttons.includes("detail") ? (
|
|
@@ -35,7 +35,7 @@ SupportInputTypes.add('progress');
|
|
|
35
35
|
SupportInputTypes.add('password');
|
|
36
36
|
SupportInputTypes.add('preselect');
|
|
37
37
|
SupportInputTypes.add('select');
|
|
38
|
-
SupportInputTypes.add('
|
|
38
|
+
SupportInputTypes.add('select');
|
|
39
39
|
SupportInputTypes.add('checkbox');
|
|
40
40
|
SupportInputTypes.add('radio');
|
|
41
41
|
SupportInputTypes.add('yes-no-select');
|
|
@@ -428,24 +428,26 @@ HCDataSource.requestBlocks = async (l2MenuId: string, blockId: string) => {
|
|
|
428
428
|
};
|
|
429
429
|
|
|
430
430
|
HCDataSource.initfastMenu = async () => {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
431
|
+
if (!fastMenuCached) {
|
|
432
|
+
if (fastMenuCache.size < 1) {
|
|
433
|
+
let re = await HcserviceV3.requestFastMenu();
|
|
434
|
+
if (re) {
|
|
435
|
+
for (let e in re) {
|
|
436
|
+
fastMenuCache.set(e, re[e]);
|
|
437
|
+
}
|
|
437
438
|
}
|
|
439
|
+
|
|
438
440
|
}
|
|
441
|
+
fastMenuCached = true;
|
|
439
442
|
}
|
|
440
443
|
};
|
|
441
444
|
|
|
442
445
|
HCDataSource.fastMenu = async (key: string) => {
|
|
443
446
|
// let result:Map<string,Level2Menu[]> ;
|
|
444
|
-
if (!fastMenuCached) {
|
|
445
|
-
|
|
446
|
-
await HCDataSource.initfastMenu();
|
|
447
|
-
}
|
|
448
|
-
|
|
447
|
+
// if (!fastMenuCached) {
|
|
448
|
+
// fastMenuCached = true;
|
|
449
|
+
let re = await HCDataSource.initfastMenu();
|
|
450
|
+
//}
|
|
449
451
|
return fastMenuCache.get(key);
|
|
450
452
|
};
|
|
451
453
|
|
|
@@ -521,6 +523,7 @@ HCDataSource.clear = async function() {
|
|
|
521
523
|
// optionsMap.clear();
|
|
522
524
|
blocksCache.splice(0, blocksCache.length);
|
|
523
525
|
blocksCached = false;
|
|
526
|
+
fastMenuCached=false;
|
|
524
527
|
// quickEntranceCache.splice(0, quickEntranceCache.length);
|
|
525
528
|
// messageCache.splice(0, quickEntranceCache.length);
|
|
526
529
|
// workbenchCache.splice(0, workbenchCache.length);
|
|
@@ -215,6 +215,7 @@ export interface ProgramAuth extends OrderableTmplBase {}
|
|
|
215
215
|
export interface Level2Menu extends MenuBase {
|
|
216
216
|
items: (BlockMenu | Level2Menu)[];
|
|
217
217
|
customPath?: string;
|
|
218
|
+
dragDropPageId?: string;
|
|
218
219
|
displayTotal?: boolean;
|
|
219
220
|
count?: number;
|
|
220
221
|
disabled?: boolean;
|
|
@@ -326,6 +327,8 @@ export interface FieldGroupConfig extends OrderableTmplBase {
|
|
|
326
327
|
defaultCriteriaValue?: object;
|
|
327
328
|
deleteData?:boolean;
|
|
328
329
|
viewModel?:"table"|"verticalList";
|
|
330
|
+
addOrEditType?:"singleCol"|"doubleCol"|"tableRow";
|
|
331
|
+
batchAddFileField?:FieldConfig;
|
|
329
332
|
}
|
|
330
333
|
|
|
331
334
|
export type SaveJumpType = "list" | "add" | "edit";
|
|
@@ -418,7 +421,7 @@ export interface ActionRenderProps{
|
|
|
418
421
|
doRowJump?:(jump: JumpConfig, record: DtmplData)=>any,
|
|
419
422
|
blockMenuTreeDrawerOpen?:(record)=>any,
|
|
420
423
|
doRowAction?:(actionId: string, codes: string[], params: object) =>any,
|
|
421
|
-
doDeleteByCode?:(code: string)=>any,sortColumns:any
|
|
424
|
+
doDeleteByCode?:(code: string)=>any,sortColumns:any,
|
|
422
425
|
}
|
|
423
426
|
|
|
424
427
|
export interface FileRule {
|
|
@@ -557,7 +560,7 @@ export interface DtmplData {
|
|
|
557
560
|
title?: string;
|
|
558
561
|
relationLabel?: string;
|
|
559
562
|
fieldMap?: object;
|
|
560
|
-
arrayMap?: object;
|
|
563
|
+
arrayMap?: object;
|
|
561
564
|
}
|
|
562
565
|
export interface GridLayout{
|
|
563
566
|
rowSpan?:number,
|
|
@@ -745,6 +748,7 @@ export interface BlockType {
|
|
|
745
748
|
disabled?: boolean; // 是否禁用
|
|
746
749
|
hiddenOnDisabled?: boolean; // 是否隐藏
|
|
747
750
|
customPath?: string; // 自定义页面路径
|
|
751
|
+
dragDropPageId?:string;
|
|
748
752
|
pageType?: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树"|"导入"|"报表"; // 页面类型
|
|
749
753
|
defaultCriteriaValue?: { [key: string]: string }; // 一些组件参数
|
|
750
754
|
linkTarget?: HTMLAttributeAnchorTarget; // 页面跳转方式
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { Button, Card, Col, Row } from "antd";
|
|
3
|
-
import { BarChartOutlined, FilterOutlined } from "@ant-design/icons";
|
|
1
|
+
import React from "react";
|
|
4
2
|
import QuickEntrance from "./quick-entrance";
|
|
5
3
|
import Workbench from "./workbench";
|
|
6
4
|
import "./index.css";
|
|
7
5
|
import Units from "../units";
|
|
8
6
|
import withRouter from "../routable/withroute";
|
|
9
|
-
import BlockMenuAuthTree from "../tree/block-menu-auth-tree";
|
|
10
|
-
import BlockMenuAuthTreeDrawer from "../module/block-menu-tree-drawer";
|
|
11
|
-
import LtmplTable from "../module/ltmpl-table";
|
|
12
7
|
import WelcomeBg from "./img/welcome.png";
|
|
13
8
|
import { useParams } from "react-router-dom";
|
|
14
9
|
|