aldehyde 0.2.127 → 0.2.128

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 (61) hide show
  1. package/lib/controls/action/utils.js +1 -1
  2. package/lib/controls/action/utils.js.map +1 -1
  3. package/lib/controls/entity-select/entity-select.d.ts +2 -0
  4. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  5. package/lib/controls/entity-select/entity-select.js +34 -12
  6. package/lib/controls/entity-select/entity-select.js.map +1 -1
  7. package/lib/controls/entry-control.d.ts.map +1 -1
  8. package/lib/controls/entry-control.js +3 -0
  9. package/lib/controls/entry-control.js.map +1 -1
  10. package/lib/controls/password-setter/index.js +1 -1
  11. package/lib/controls/password-setter/index.js.map +1 -1
  12. package/lib/controls/upload/index.js +1 -1
  13. package/lib/controls/upload/index.js.map +1 -1
  14. package/lib/form/criteria-form.d.ts.map +1 -1
  15. package/lib/form/criteria-form.js +8 -15
  16. package/lib/form/criteria-form.js.map +1 -1
  17. package/lib/import/excel-import.js +1 -1
  18. package/lib/import/excel-import.js.map +1 -1
  19. package/lib/layout/MainPage.js +1 -1
  20. package/lib/layout/MainPage.js.map +1 -1
  21. package/lib/layout/menu/menu-render.d.ts.map +1 -1
  22. package/lib/layout/menu/menu-render.js +1 -1
  23. package/lib/layout/menu/menu-render.js.map +1 -1
  24. package/lib/login/context-setter.d.ts.map +1 -1
  25. package/lib/login/context-setter.js +5 -2
  26. package/lib/login/context-setter.js.map +1 -1
  27. package/lib/table/act-table.d.ts.map +1 -1
  28. package/lib/table/act-table.js +14 -4
  29. package/lib/table/act-table.js.map +1 -1
  30. package/lib/table/query-table.d.ts.map +1 -1
  31. package/lib/table/query-table.js +36 -19
  32. package/lib/table/query-table.js.map +1 -1
  33. package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
  34. package/lib/tmpl/control-type-supportor.js +1 -0
  35. package/lib/tmpl/control-type-supportor.js.map +1 -1
  36. package/lib/tmpl/hcservice-v3.js +7 -7
  37. package/lib/tmpl/hcservice-v3.js.map +1 -1
  38. package/lib/tmpl/interface.d.ts +2 -1
  39. package/lib/tmpl/interface.d.ts.map +1 -1
  40. package/lib/tmpl/model-struc-v3.js +5 -5
  41. package/lib/tmpl/model-struc-v3.js.map +1 -1
  42. package/lib/tmpl/superagent.js +2 -2
  43. package/lib/tmpl/superagent.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/aldehyde/controls/action/utils.tsx +1 -1
  46. package/src/aldehyde/controls/entity-select/entity-select.tsx +36 -13
  47. package/src/aldehyde/controls/entry-control.tsx +9 -0
  48. package/src/aldehyde/controls/password-setter/index.js +1 -1
  49. package/src/aldehyde/controls/upload/index.tsx +1 -1
  50. package/src/aldehyde/form/criteria-form.tsx +52 -61
  51. package/src/aldehyde/import/excel-import.tsx +1 -1
  52. package/src/aldehyde/layout/MainPage.tsx +1 -1
  53. package/src/aldehyde/layout/menu/menu-render.tsx +1 -11
  54. package/src/aldehyde/login/context-setter.tsx +6 -3
  55. package/src/aldehyde/table/act-table.tsx +22 -11
  56. package/src/aldehyde/table/query-table.tsx +66 -45
  57. package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
  58. package/src/aldehyde/tmpl/hcservice-v3.tsx +7 -7
  59. package/src/aldehyde/tmpl/interface.tsx +2 -1
  60. package/src/aldehyde/tmpl/model-struc-v3.tsx +5 -5
  61. package/src/aldehyde/tmpl/superagent.js +2 -2
@@ -30,6 +30,7 @@ interface InnerEntitySelectProps extends EControlProps {
30
30
  maxSelected?: number;
31
31
  onEntityClick?: (code: string) => void;
32
32
  baseCriteria: object;
33
+ valueOnly?:boolean;
33
34
  }
34
35
 
35
36
  interface InnerEntitySelectState {
@@ -67,6 +68,7 @@ export default class EntitySelect extends React.PureComponent<
67
68
  > {
68
69
  static defaultProps = {
69
70
  maxSelected: 100,
71
+ valueOnly:false,
70
72
  };
71
73
 
72
74
  state = {
@@ -276,10 +278,15 @@ export default class EntitySelect extends React.PureComponent<
276
278
  let valueArray = this.toArray(value);
277
279
  for (let v of valueArray) {
278
280
  if (v) {
279
- let vs = v.split("@R@");
280
- if (vs[1] != "null") {
281
- result.push(vs[0]);
281
+ if(this.props.valueOnly){
282
+ result.push(v);
283
+ }else{
284
+ let vs = v.split("@R@");
285
+ if (vs[1] != "null") {
286
+ result.push(vs[0]);
287
+ }
282
288
  }
289
+
283
290
  }
284
291
  }
285
292
  return result;
@@ -301,17 +308,22 @@ export default class EntitySelect extends React.PureComponent<
301
308
  };
302
309
 
303
310
  toOptions = (value, onEntityClick) => {
304
- const { fieldConfig } = this.props;
311
+ const { fieldConfig ,valueOnly} = this.props;
305
312
  let options: object[] = [];
306
313
  //console.log('options value', value);
307
314
 
308
315
  let valueArray: string[] = this.toArray(value);
309
316
  for (let v of valueArray) {
310
317
  if (v) {
311
- let vs = v.split("@R@");
312
- if (vs[1] != "null") {
313
- options.push(this.toOption(vs[0], vs[1], onEntityClick));
318
+ if(valueOnly){
319
+ options.push(this.toOption(v, v, onEntityClick));
320
+ }else{
321
+ let vs = v.split("@R@");
322
+ if (vs[1] != "null") {
323
+ options.push(this.toOption(vs[0], vs[1], onEntityClick));
324
+ }
314
325
  }
326
+
315
327
  }
316
328
  }
317
329
 
@@ -382,7 +394,7 @@ export default class EntitySelect extends React.PureComponent<
382
394
  ltmplConfig_ = await this.loadLtmplConfig();
383
395
  }
384
396
  if (!ltmplConfig_) {
385
- message.error("请配置正确查询页面");
397
+ message.error("请配置正确查询页面",5);
386
398
  return;
387
399
  }
388
400
  let pageInfo = {
@@ -463,17 +475,28 @@ export default class EntitySelect extends React.PureComponent<
463
475
 
464
476
  onChange = (values: any[]) => {
465
477
  const { codeLabel } = this.state;
478
+ const { maxSelected,valueOnly } = this.props;
466
479
  let newValues: Array<string> = [...values];
467
- if (values && values.length > this.props.maxSelected) {
480
+ if (values && values.length > maxSelected) {
468
481
  newValues.shift();
469
482
  }
470
483
  let formValues: Array<string> = [];
484
+
471
485
  newValues.forEach((c) => {
472
- if (c.indexOf("@R@") > 0) {
473
- formValues.push(c);
474
- } else {
475
- formValues.push(c + "@R@" + codeLabel[c]);
486
+ if(valueOnly){
487
+ if (c.indexOf("@R@") > 0) {
488
+ formValues.push(c.split("@R@")[1]);
489
+ } else {
490
+ formValues.push(codeLabel[c]);
491
+ }
492
+ }else{
493
+ if (c.indexOf("@R@") > 0) {
494
+ formValues.push(c);
495
+ } else {
496
+ formValues.push(c + "@R@" + codeLabel[c]);
497
+ }
476
498
  }
499
+
477
500
  });
478
501
  this.props.onChange(formValues);
479
502
  };
@@ -372,6 +372,15 @@ function renderControl(
372
372
  />
373
373
  );
374
374
  break;
375
+ case "relselectvalue":
376
+ entryControl = (
377
+ <EntitySelect valueOnly={true}
378
+ baseCriteria={fieldConfig.baseCriteria}
379
+ maxSelected={1}
380
+ {...controlProps}
381
+ />
382
+ );
383
+ break;
375
384
  case "table-entity-select":
376
385
  entryControl = (
377
386
  <PopoverEntitySelect
@@ -18,7 +18,7 @@ export default class SetPasswords extends React.Component {
18
18
  if (oldPass === values.oldpass) {
19
19
  this.props.setNewPass(values.newpass);
20
20
  } else {
21
- message.error("原登录密码不正确!");
21
+ message.error("原登录密码不正确!",6);
22
22
  }
23
23
  }
24
24
  });
@@ -64,7 +64,7 @@ export default class Upload extends React.PureComponent<
64
64
 
65
65
  const isLt5M = file.size / 1024 / 1024 < 40;
66
66
  if (!isLt5M) {
67
- message.error(translate("${超过40M限制 不允许上传~}"));
67
+ message.error(translate("${超过40M限制 不允许上传~}"),5);
68
68
  return false;
69
69
  } else {
70
70
  return true;
@@ -339,74 +339,65 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
339
339
  onFinish={searchSubmit}
340
340
  style={{ width: "100%" }}
341
341
  >
342
- {buttons.includes("drilling") &&
343
- open &&
344
- (drillingParams.length > 0 || hasDimension() || ltmplConfig.showDim) ? (
345
- // <Collapse style={{ width: "100%" }} defaultActiveKey={["1"]}>
346
- // <Panel header={""} key="1">
347
- <Card>
342
+
343
+ {/*// <Collapse style={{ width: "100%" }} defaultActiveKey={["1"]}>*/}
344
+ {/*// <Panel header={""} key="1">*/}
345
+ <Card size={'small'} style={{ display: open ? "block" : "none", width: "100%" }}>
348
346
  <Row>
349
347
  <Col>
350
348
  <Space size={"small"} wrap>
351
- {renderCriteria(drillingParams)}
352
- {renderDrillDimension()}
349
+ {buttons.includes("drilling") &&
350
+ open &&
351
+ (drillingParams.length > 0 || hasDimension() || ltmplConfig.showDim) ?
352
+ <>{renderCriteria(drillingParams)}
353
+ {renderDrillDimension()}</>
354
+ : null}
355
+ {showQueryButton ||
356
+ (updrillButtonConfigs && updrillButtonConfigs.length > 0)
357
+ ? renderCriteria(criterias)
358
+ : null}
359
+ <Space className="btns">
360
+ {showQueryButton ? (
361
+ <Button type="primary" htmlType="submit">
362
+ {translate("${查询}")}
363
+ </Button>
364
+ ) : (
365
+ ""
366
+ )}
367
+ {showDeleteButton ? (
368
+ <Popconfirm
369
+ placement="rightBottom"
370
+ title={translate("${确定要[删除]选中数据吗}?")}
371
+ onConfirm={() => {
372
+ doDelete();
373
+ }}
374
+ okText={translate("${确定}")}
375
+ cancelText={translate("${取消}")}
376
+ okType={"danger"}
377
+ >
378
+ <Button danger disabled={deleteButtonDisabled}>
379
+ {translate("${删除选中}")}
380
+ </Button>
381
+ </Popconfirm>
382
+ ) : (
383
+ ""
384
+ )}
385
+ {renderAction()}
386
+ {renderJump()}
387
+ {renderCQuery()}
388
+ {renderUpdrill()}
389
+ </Space>
353
390
  </Space>
354
391
  </Col>
355
392
  </Row>
356
393
  </Card>
357
- ) : (
358
- // </Panel>
359
- // </Collapse>
360
- ""
361
- )}
362
- <Card
363
- className="hoverable"
364
- style={{ display: open ? "block" : "none", width: "100%" }}
365
- headStyle={{ background: "#f2f4f5" }}
366
- >
367
- <Row>
368
- <Col>
369
- <Space size={"small"} wrap>
370
- {showQueryButton ||
371
- (updrillButtonConfigs && updrillButtonConfigs.length > 0)
372
- ? renderCriteria(criterias)
373
- : null}
374
-
375
- <Space className="btns">
376
- {showQueryButton ? (
377
- <Button type="primary" htmlType="submit">
378
- {translate("${查询}")}
379
- </Button>
380
- ) : (
381
- ""
382
- )}
383
- {showDeleteButton ? (
384
- <Popconfirm
385
- placement="rightBottom"
386
- title={translate("${确定要[删除]选中数据吗}?")}
387
- onConfirm={() => {
388
- doDelete();
389
- }}
390
- okText={translate("${确定}")}
391
- cancelText={translate("${取消}")}
392
- okType={"danger"}
393
- >
394
- <Button danger disabled={deleteButtonDisabled}>
395
- {translate("${删除选中}")}
396
- </Button>
397
- </Popconfirm>
398
- ) : (
399
- ""
400
- )}
401
- {renderAction()}
402
- {renderJump()}
403
- {renderCQuery()}
404
- {renderUpdrill()}
405
- </Space>
406
- </Space>
407
- </Col>
408
- </Row>
409
- </Card>
394
+ {/*<Card size={'small'}*/}
395
+ {/* className="hoverable"*/}
396
+ {/* style={{ display: open ? "block" : "none", width: "100%" }}*/}
397
+ {/* headStyle={{ background: "#f2f4f5" }}*/}
398
+ {/*>*/}
399
+ {/* */}
400
+ {/*</Card>*/}
410
401
  </AntdForm>
411
402
  );
412
403
  };
@@ -124,7 +124,7 @@ export default class ExcelImport extends React.PureComponent<
124
124
  });
125
125
  this.timerId = setInterval(() => this.handleStatus(res.importId), 500);
126
126
  } else {
127
- message.error(translate("${失败}!"));
127
+ message.error(translate("${失败}!"),5);
128
128
  this.setState({
129
129
  importStatus: "fail",
130
130
  });
@@ -303,7 +303,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
303
303
  overflow: "initial",
304
304
  minHeight: "calc(100vh)",
305
305
  minWidth: 760,
306
- maxWidth: 1960,
306
+ // maxWidth: 3060,
307
307
  paddingBottom: "8px",
308
308
  }}
309
309
  >
@@ -8,14 +8,12 @@ import translate from "../../locale/translate";
8
8
 
9
9
 
10
10
  export default {
11
-
12
11
  getMenu(blockMenu: BlockMenu , target, basePath = ""){
13
12
  if(blockMenu.l1Menus){
14
13
  return this.toL1Menu(blockMenu.l1Menus, target, basePath = "")
15
14
  }else{
16
15
  return this.toSubMenu(blockMenu.items, target, basePath = "");
17
16
  }
18
-
19
17
  },
20
18
 
21
19
  toL1Menu(subMenus: (Level1Menu)[], target, basePath = "") {
@@ -49,20 +47,18 @@ export default {
49
47
  menu.children = this.toSubMenu(subItems, target, basePath);
50
48
  } else {
51
49
  let i:Level2Menu=item as Level2Menu;
52
-
53
50
  if(i.disabled ){
54
51
  if(i.hiddenOnDisabled){
55
52
  menu=null;
56
53
  }else{
57
54
  menu.disabled=i.disabled;
58
55
  if(i.tip){
59
- menu.label= <Tooltip placement="top" title={i.tip} >
56
+ menu.label= <Tooltip placement="top" title={translate('${' + i.tip + '}')} >
60
57
  {translate('${' + i.title + '}')}
61
58
  </Tooltip>
62
59
  }else{
63
60
  menu.label=translate('${' + i.title + '}');
64
61
  }
65
-
66
62
  }
67
63
  }else{
68
64
  menu.label = this.toL2MenuTitle(i , target, basePath);
@@ -107,18 +103,14 @@ export default {
107
103
  codeSource = '&codeSource=listop';
108
104
  break;
109
105
  }
110
-
111
106
  return `${basePath}/${menu.id}/${routePath}?menuId=${menu.id}${codeSource}${defaultCriteriaData}`;
112
-
113
107
  }
114
108
  return null;
115
109
  },
116
110
  toL2MenuTitle(item: Level2Menu & {path?: string}, target, basePath = "") {
117
-
118
111
  if(!item){
119
112
  return null;
120
113
  }
121
-
122
114
  let delimiter = "/";
123
115
  let customPath = item.customPath;
124
116
  if (customPath) {
@@ -166,8 +158,6 @@ export default {
166
158
 
167
159
  }
168
160
  }
169
-
170
-
171
161
  return openL2MenuId;
172
162
  }
173
163
  }
@@ -4,6 +4,7 @@ import {Button, Col, Form, FormInstance, Modal, Row} from "antd";
4
4
  import EntryControl from "../controls/entry-control";
5
5
  import HCserviceV3 from "../tmpl/hcservice-v3";
6
6
  import withRouter from "../routable/withroute";
7
+ import {LocaleContext} from "../locale/LocaleProvider";
7
8
 
8
9
  //以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
9
10
 
@@ -27,7 +28,8 @@ class ContextSetter extends React.PureComponent<ContextSetterProps, ContextSette
27
28
  }
28
29
  formRef = React.createRef<FormInstance>();
29
30
  static defaultProps = {}
30
-
31
+ static contextType = LocaleContext;
32
+ context: React.ContextType<typeof LocaleContext>;
31
33
  async componentDidMount() {
32
34
 
33
35
  let config = await HCserviceV3.getContextSourceConfig();
@@ -73,9 +75,10 @@ class ContextSetter extends React.PureComponent<ContextSetterProps, ContextSette
73
75
 
74
76
 
75
77
  render() {
78
+ const { translate} = this.context;
76
79
  const {config,loading,context}=this.state;
77
80
  const {serverKey}=this.props;
78
- return <Modal title="全局配置" closable={false} open={true} footer={[]}>
81
+ return <Modal title={translate("${全局配置}")} closable={false} open={true} footer={[]}>
79
82
  <Row justify="center" align="middle" >
80
83
  <Col>
81
84
  <Form style={{width: 350}} ref={this.formRef}
@@ -111,7 +114,7 @@ class ContextSetter extends React.PureComponent<ContextSetterProps, ContextSette
111
114
  <Form.Item>
112
115
  <Button type="primary" style={{width: '100%'}} loading={loading} onClick={this.handleSubmit}
113
116
  className="login-form-button">
114
- 确 定
117
+ {translate("${确定}")}
115
118
  </Button>
116
119
  </Form.Item>
117
120
  </Form>
@@ -262,7 +262,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
262
262
  let s = 0;
263
263
  let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
264
264
 
265
- let currentDataColIndex=0;
265
+ let currentDataColIndex = 0;
266
266
 
267
267
  colConfigs.forEach((item) => {
268
268
  let column = {};
@@ -274,6 +274,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
274
274
  if (item["colWidth"]) column["width"] = item["colWidth"];
275
275
  if (item["statColType"]) column["statColType"] = item["statColType"];
276
276
  if (item["aggFunc"]) column["cal"] = item["aggFunc"];
277
+ if (item["order"]) column["order"] = Number(item["order"]);
277
278
  // column['ellipsis']= true;
278
279
  s++;
279
280
  let itemType = SupportInputTypes.getSupportControlType(item);
@@ -285,7 +286,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
285
286
  //特殊列处理
286
287
  //序号
287
288
  if (item.title === "序号") {
288
- column["width"] = item.colWidth?item.colWidth:40;
289
+ column["width"] = item.colWidth ? item.colWidth : 50;
290
+ column["title"] = translate("${序号}");
289
291
  //item.fixed='left';
290
292
  column["render"] = (text, record, index) => <label>{index + 1}</label>;
291
293
  item["sorter"] = undefined;
@@ -336,7 +338,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
336
338
  } else if (item.title === "操作") {
337
339
  column["fixed"] = "right";
338
340
  column["align"] = "center";
339
- column["width"] = item.colWidth?item.colWidth:160;
341
+ column["width"] = item.colWidth ? item.colWidth : 160;
340
342
  column["className"] = "opsColumn";
341
343
  column["title"] = <>{translate("${操作}")}</>;
342
344
  column["render"] = (text, record) => (
@@ -524,12 +526,20 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
524
526
  currentDataColIndex++;
525
527
  column["className"] = "opsColumn";
526
528
  column["title"] = translate("${" + item.title + "}");
527
- column["width"]=item.colWidth?item.colWidth:160;
528
- column["ellipsis"]={showTitle:true}
529
- if(ltmplConfig.leftFixedCols && ltmplConfig.leftFixedCols>=currentDataColIndex){
530
- column["fixed"]="left";
531
- }else{
532
- column["fixed"]= item.fixed ? item.fixed =='right'?"right":"left":false;
529
+ column["width"] = item.colWidth ? item.colWidth : 160;
530
+ column["ellipsis"] = { showTitle: true };
531
+ column["align"]=item.valueAlign?item.valueAlign:"left";
532
+ if (
533
+ ltmplConfig.leftFixedCols &&
534
+ ltmplConfig.leftFixedCols >= currentDataColIndex
535
+ ) {
536
+ column["fixed"] = "left";
537
+ } else {
538
+ column["fixed"] = item.colFixed
539
+ ? item.colFixed == "right"
540
+ ? "right"
541
+ : "left"
542
+ : false;
533
543
  }
534
544
  column["render"] = (text, record) => {
535
545
  return (
@@ -1093,9 +1103,10 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1093
1103
 
1094
1104
  criteriaFormUseful = () => {
1095
1105
  const { ltmplConfig } = this.props;
1096
- let { buttons, criterias,updrillButtonConfigs } = ltmplConfig;
1106
+ let { buttons, criterias, updrillButtonConfigs } = ltmplConfig;
1097
1107
  if (
1098
- ((buttons.includes("query") || updrillButtonConfigs && updrillButtonConfigs.length>0) &&
1108
+ ((buttons.includes("query") ||
1109
+ (updrillButtonConfigs && updrillButtonConfigs.length > 0)) &&
1099
1110
  ((criterias && criterias.length > 0) ||
1100
1111
  buttons.includes("drilling"))) ||
1101
1112
  this.checkBoxUseful()