kts-components-document-access-point 1.1.16 → 1.1.17

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/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { createElement, useState, useEffect, useCallback, useMemo, useRef, createContext } from 'react';
2
- import { Breadcrumb as Breadcrumb$1, Button, Select, Input, Form, Drawer, Space, Radio, Switch, Table, Popconfirm, Tooltip, DatePicker, Collapse, Divider, message, Menu, ConfigProvider, PageHeader as PageHeader$1, Card, Row, Col, Modal as Modal$1 } from 'kts-components-antd-x4';
2
+ import { Breadcrumb as Breadcrumb$1, Button, Select, Input, Form, Drawer, Space, Radio, Switch, Table, Popconfirm, Tooltip, DatePicker, Collapse, message, Divider, Menu, ConfigProvider, PageHeader as PageHeader$1, Card, Row, Col, Modal as Modal$1 } from 'kts-components-antd-x4';
3
3
  import GreyReactBox from 'grey-react-box';
4
4
  import { v4 } from 'uuid';
5
5
  import Icon, { InfoCircleOutlined } from '@ant-design/icons';
@@ -655,7 +655,8 @@ var editProperties = /*#__PURE__*/(function () {
655
655
  return _context.abrupt("return");
656
656
 
657
657
  case 2:
658
- editProperties = options.editProperties, properties = options.properties, current = options.current; // 对象数据
658
+ editProperties = options.editProperties, properties = options.properties, current = options.current;
659
+ debugger; // 对象数据
659
660
 
660
661
  current.properties[properties.$name].alias = properties.title;
661
662
  current.properties[properties.$name].detailed = properties.description; // 修改了类型 清空规则
@@ -696,11 +697,13 @@ var editProperties = /*#__PURE__*/(function () {
696
697
  title: properties.items.title,
697
698
  properties: pro
698
699
  });
700
+ } else {
701
+ delete s.schema.definitions[editProperties.ref.$name]['items'];
699
702
  }
700
703
 
701
704
  s.schema = _objectSpread2({}, s.schema);
702
705
 
703
- case 12:
706
+ case 13:
704
707
  case "end":
705
708
  return _context.stop();
706
709
  }
@@ -867,6 +870,7 @@ var Breadcrumb = (function () {
867
870
  };
868
871
  }())();
869
872
  }, []);
873
+ if (breadcrumbState.length === 0) return /*#__PURE__*/React.createElement("span", null);
870
874
  return /*#__PURE__*/React.createElement(Breadcrumb$1, {
871
875
  separator: ">"
872
876
  }, /*#__PURE__*/React.createElement(Breadcrumb$1.Item, {
@@ -1195,6 +1199,7 @@ var propertyColumns = [{
1195
1199
  }
1196
1200
  }, {
1197
1201
  title: '是否必填',
1202
+ width: 80,
1198
1203
  render: function render(_, v) {
1199
1204
  return /*#__PURE__*/React.createElement(MySpan, null, v.required.indexOf(v.value.$name) >= 0 ? '是' : '否');
1200
1205
  }
@@ -1206,6 +1211,7 @@ var propertyColumns = [{
1206
1211
  }, {
1207
1212
  title: '是否已添加校验规则',
1208
1213
  key: 'isRules',
1214
+ width: 130,
1209
1215
  render: function render(_, v) {
1210
1216
  return /*#__PURE__*/React.createElement(MySpan, null, v.ref.rules ? v.ref.rules.length > 0 ? '是' : '否' : '否');
1211
1217
  }
@@ -1413,7 +1419,7 @@ function styleInject(css, ref) {
1413
1419
  }
1414
1420
  }
1415
1421
 
1416
- var css_248z = ".kts-documents-edit-property-table-button-list .ktsAntX-btn-link {\n padding: 4px;\n}\n";
1422
+ var css_248z = ".kts-documents-edit-property-table-button-list .ktsAntX-btn-link {\n padding: 4px !important;\n}\n";
1417
1423
  styleInject(css_248z);
1418
1424
 
1419
1425
  var useTableProps = (function () {
@@ -1472,7 +1478,7 @@ var PropertyTable = (function () {
1472
1478
  rowKey: "$name",
1473
1479
  pagination: false,
1474
1480
  scroll: {
1475
- y: 240,
1481
+ y: '100%',
1476
1482
  x: true
1477
1483
  }
1478
1484
  }, useTableProps()));
@@ -1700,8 +1706,10 @@ var EditProperty = (function () {
1700
1706
  help: isChangeType ? "修改类型后,系统将自动清空该字段的校验规则。" : undefined,
1701
1707
  validateStatus: isChangeType ? "warning" : ''
1702
1708
  }, /*#__PURE__*/React.createElement(Select, {
1703
- onSelect: function onSelect() {
1704
- setIsChangeType(true);
1709
+ onChange: function onChange(e) {
1710
+ var _editProperties$ref$t;
1711
+
1712
+ setIsChangeType(e !== getType((_editProperties$ref$t = editProperties === null || editProperties === void 0 ? void 0 : editProperties.ref.type) !== null && _editProperties$ref$t !== void 0 ? _editProperties$ref$t : ''));
1705
1713
  }
1706
1714
  }, /*#__PURE__*/React.createElement(Option$1, {
1707
1715
  key: "00",
@@ -2308,7 +2316,7 @@ var EditRule = (function () {
2308
2316
  }())();
2309
2317
  }, [controller]);
2310
2318
  var onSubmit = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
2311
- var formList, sum, i;
2319
+ var formList, sum, i, ms;
2312
2320
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
2313
2321
  while (1) {
2314
2322
  switch (_context3.prev = _context3.next) {
@@ -2323,8 +2331,8 @@ var EditRule = (function () {
2323
2331
  case 2:
2324
2332
  formList = controller.state.ruleState.formList;
2325
2333
  sum = [];
2326
- _context3.prev = 4;
2327
2334
  i = 0;
2335
+ _context3.prev = 5;
2328
2336
 
2329
2337
  case 6:
2330
2338
  if (!(i < formList.length)) {
@@ -2384,20 +2392,25 @@ var EditRule = (function () {
2384
2392
  }())();
2385
2393
 
2386
2394
  case 21:
2387
- _context3.next = 26;
2395
+ _context3.next = 28;
2388
2396
  break;
2389
2397
 
2390
2398
  case 23:
2391
2399
  _context3.prev = 23;
2392
- _context3.t6 = _context3["catch"](4);
2393
- console.error('===> 表单有错', _context3.t6);
2400
+ _context3.t6 = _context3["catch"](5);
2401
+ ms = "[\u89C4\u5219".concat(i + 1, "] ").concat(_context3.t6.errorFields[0].errors[0]);
2402
+ message.error({
2403
+ key: ms,
2404
+ content: ms
2405
+ });
2406
+ console.error('===> 表单有错', _context3.t6.errorFields[0].errors[0], i);
2394
2407
 
2395
- case 26:
2408
+ case 28:
2396
2409
  case "end":
2397
2410
  return _context3.stop();
2398
2411
  }
2399
2412
  }
2400
- }, _callee3, null, [[4, 23]]);
2413
+ }, _callee3, null, [[5, 23]]);
2401
2414
  })), [controller, operatorMap, ruleProperties]);
2402
2415
  return /*#__PURE__*/React.createElement(Drawer, {
2403
2416
  title: "\u7F16\u8F91\u9A8C\u8BC1\u89C4\u5219",
@@ -2474,7 +2487,7 @@ function algorithmFormat(operator, operatorMap, type) {
2474
2487
  return operator;
2475
2488
  }
2476
2489
 
2477
- var css_248z$2 = ".kts-documents-edit .kts-documents-edit-head {\n display: flex;\n margin-bottom: 10px;\n}\n.kts-documents-edit .kts-documents-edit-head .ktsAntX-space-item:first-child {\n flex: 1;\n}\n";
2490
+ var css_248z$2 = ".kts-documents-edit {\n min-height: 600px;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.kts-documents-edit .kts-documents-edit-head {\n display: flex;\n margin-bottom: 10px;\n}\n.kts-documents-edit .kts-documents-edit-head .ktsAntX-space-item:first-child {\n flex: 1;\n}\n.kts-documents-edit .kts-documents-edit-property {\n flex: 1;\n overflow: auto;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-spin-container,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-spin-nested-loading,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-wrapper {\n height: 100%;\n overflow: auto;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container {\n height: 100%;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container .ktsAntX-table-header {\n flex: none;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container .ktsAntX-table-body {\n flex: 1;\n overflow: auto;\n}\n";
2478
2491
  styleInject(css_248z$2);
2479
2492
 
2480
2493
  /** 发票组件的上下文 */
@@ -2661,10 +2674,7 @@ var Main = function Main(props) {
2661
2674
  return /*#__PURE__*/React.createElement(DocumentsEditContext.Provider, {
2662
2675
  value: controller
2663
2676
  }, /*#__PURE__*/React.createElement("div", {
2664
- className: "kts-documents-edit",
2665
- style: {
2666
- minHeight: 600
2667
- }
2677
+ className: "kts-documents-edit"
2668
2678
  }, /*#__PURE__*/React.createElement(Space, {
2669
2679
  className: "kts-documents-edit-head"
2670
2680
  }, /*#__PURE__*/React.createElement(Breadcrumb, null), /*#__PURE__*/React.createElement(AddPropertyButton, null)), /*#__PURE__*/React.createElement("div", {
package/dist/index.js CHANGED
@@ -669,7 +669,8 @@ var editProperties = /*#__PURE__*/(function () {
669
669
  return _context.abrupt("return");
670
670
 
671
671
  case 2:
672
- editProperties = options.editProperties, properties = options.properties, current = options.current; // 对象数据
672
+ editProperties = options.editProperties, properties = options.properties, current = options.current;
673
+ debugger; // 对象数据
673
674
 
674
675
  current.properties[properties.$name].alias = properties.title;
675
676
  current.properties[properties.$name].detailed = properties.description; // 修改了类型 清空规则
@@ -710,11 +711,13 @@ var editProperties = /*#__PURE__*/(function () {
710
711
  title: properties.items.title,
711
712
  properties: pro
712
713
  });
714
+ } else {
715
+ delete s.schema.definitions[editProperties.ref.$name]['items'];
713
716
  }
714
717
 
715
718
  s.schema = _objectSpread2({}, s.schema);
716
719
 
717
- case 12:
720
+ case 13:
718
721
  case "end":
719
722
  return _context.stop();
720
723
  }
@@ -881,6 +884,7 @@ var Breadcrumb = (function () {
881
884
  };
882
885
  }())();
883
886
  }, []);
887
+ if (breadcrumbState.length === 0) return /*#__PURE__*/React__default['default'].createElement("span", null);
884
888
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Breadcrumb, {
885
889
  separator: ">"
886
890
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Breadcrumb.Item, {
@@ -1209,6 +1213,7 @@ var propertyColumns = [{
1209
1213
  }
1210
1214
  }, {
1211
1215
  title: '是否必填',
1216
+ width: 80,
1212
1217
  render: function render(_, v) {
1213
1218
  return /*#__PURE__*/React__default['default'].createElement(MySpan, null, v.required.indexOf(v.value.$name) >= 0 ? '是' : '否');
1214
1219
  }
@@ -1220,6 +1225,7 @@ var propertyColumns = [{
1220
1225
  }, {
1221
1226
  title: '是否已添加校验规则',
1222
1227
  key: 'isRules',
1228
+ width: 130,
1223
1229
  render: function render(_, v) {
1224
1230
  return /*#__PURE__*/React__default['default'].createElement(MySpan, null, v.ref.rules ? v.ref.rules.length > 0 ? '是' : '否' : '否');
1225
1231
  }
@@ -1427,7 +1433,7 @@ function styleInject(css, ref) {
1427
1433
  }
1428
1434
  }
1429
1435
 
1430
- var css_248z = ".kts-documents-edit-property-table-button-list .ktsAntX-btn-link {\n padding: 4px;\n}\n";
1436
+ var css_248z = ".kts-documents-edit-property-table-button-list .ktsAntX-btn-link {\n padding: 4px !important;\n}\n";
1431
1437
  styleInject(css_248z);
1432
1438
 
1433
1439
  var useTableProps = (function () {
@@ -1486,7 +1492,7 @@ var PropertyTable = (function () {
1486
1492
  rowKey: "$name",
1487
1493
  pagination: false,
1488
1494
  scroll: {
1489
- y: 240,
1495
+ y: '100%',
1490
1496
  x: true
1491
1497
  }
1492
1498
  }, useTableProps()));
@@ -1714,8 +1720,10 @@ var EditProperty = (function () {
1714
1720
  help: isChangeType ? "修改类型后,系统将自动清空该字段的校验规则。" : undefined,
1715
1721
  validateStatus: isChangeType ? "warning" : ''
1716
1722
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
1717
- onSelect: function onSelect() {
1718
- setIsChangeType(true);
1723
+ onChange: function onChange(e) {
1724
+ var _editProperties$ref$t;
1725
+
1726
+ setIsChangeType(e !== getType((_editProperties$ref$t = editProperties === null || editProperties === void 0 ? void 0 : editProperties.ref.type) !== null && _editProperties$ref$t !== void 0 ? _editProperties$ref$t : ''));
1719
1727
  }
1720
1728
  }, /*#__PURE__*/React__default['default'].createElement(Option$1, {
1721
1729
  key: "00",
@@ -2322,7 +2330,7 @@ var EditRule = (function () {
2322
2330
  }())();
2323
2331
  }, [controller]);
2324
2332
  var onSubmit = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
2325
- var formList, sum, i;
2333
+ var formList, sum, i, ms;
2326
2334
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
2327
2335
  while (1) {
2328
2336
  switch (_context3.prev = _context3.next) {
@@ -2337,8 +2345,8 @@ var EditRule = (function () {
2337
2345
  case 2:
2338
2346
  formList = controller.state.ruleState.formList;
2339
2347
  sum = [];
2340
- _context3.prev = 4;
2341
2348
  i = 0;
2349
+ _context3.prev = 5;
2342
2350
 
2343
2351
  case 6:
2344
2352
  if (!(i < formList.length)) {
@@ -2398,20 +2406,25 @@ var EditRule = (function () {
2398
2406
  }())();
2399
2407
 
2400
2408
  case 21:
2401
- _context3.next = 26;
2409
+ _context3.next = 28;
2402
2410
  break;
2403
2411
 
2404
2412
  case 23:
2405
2413
  _context3.prev = 23;
2406
- _context3.t6 = _context3["catch"](4);
2407
- console.error('===> 表单有错', _context3.t6);
2414
+ _context3.t6 = _context3["catch"](5);
2415
+ ms = "[\u89C4\u5219".concat(i + 1, "] ").concat(_context3.t6.errorFields[0].errors[0]);
2416
+ ktsComponentsAntdX4.message.error({
2417
+ key: ms,
2418
+ content: ms
2419
+ });
2420
+ console.error('===> 表单有错', _context3.t6.errorFields[0].errors[0], i);
2408
2421
 
2409
- case 26:
2422
+ case 28:
2410
2423
  case "end":
2411
2424
  return _context3.stop();
2412
2425
  }
2413
2426
  }
2414
- }, _callee3, null, [[4, 23]]);
2427
+ }, _callee3, null, [[5, 23]]);
2415
2428
  })), [controller, operatorMap, ruleProperties]);
2416
2429
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Drawer, {
2417
2430
  title: "\u7F16\u8F91\u9A8C\u8BC1\u89C4\u5219",
@@ -2488,7 +2501,7 @@ function algorithmFormat(operator, operatorMap, type) {
2488
2501
  return operator;
2489
2502
  }
2490
2503
 
2491
- var css_248z$2 = ".kts-documents-edit .kts-documents-edit-head {\n display: flex;\n margin-bottom: 10px;\n}\n.kts-documents-edit .kts-documents-edit-head .ktsAntX-space-item:first-child {\n flex: 1;\n}\n";
2504
+ var css_248z$2 = ".kts-documents-edit {\n min-height: 600px;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.kts-documents-edit .kts-documents-edit-head {\n display: flex;\n margin-bottom: 10px;\n}\n.kts-documents-edit .kts-documents-edit-head .ktsAntX-space-item:first-child {\n flex: 1;\n}\n.kts-documents-edit .kts-documents-edit-property {\n flex: 1;\n overflow: auto;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-spin-container,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-spin-nested-loading,\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-wrapper {\n height: 100%;\n overflow: auto;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container {\n height: 100%;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container .ktsAntX-table-header {\n flex: none;\n}\n.kts-documents-edit .kts-documents-edit-property .ktsAntX-table-container .ktsAntX-table-body {\n flex: 1;\n overflow: auto;\n}\n";
2492
2505
  styleInject(css_248z$2);
2493
2506
 
2494
2507
  /** 发票组件的上下文 */
@@ -2675,10 +2688,7 @@ var Main = function Main(props) {
2675
2688
  return /*#__PURE__*/React__default['default'].createElement(DocumentsEditContext.Provider, {
2676
2689
  value: controller
2677
2690
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2678
- className: "kts-documents-edit",
2679
- style: {
2680
- minHeight: 600
2681
- }
2691
+ className: "kts-documents-edit"
2682
2692
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Space, {
2683
2693
  className: "kts-documents-edit-head"
2684
2694
  }, /*#__PURE__*/React__default['default'].createElement(Breadcrumb, null), /*#__PURE__*/React__default['default'].createElement(AddPropertyButton, null)), /*#__PURE__*/React__default['default'].createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-components-document-access-point",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "dumi dev",
@@ -7,6 +7,8 @@ export default async (s: DocumentsEditControllerState, options: any) => {
7
7
 
8
8
  const { editProperties, properties, current } = options;
9
9
 
10
+ debugger;
11
+
10
12
  // 对象数据
11
13
  current.properties[properties.$name].alias = properties.title;
12
14
  current.properties[properties.$name].detailed = properties.description;
@@ -29,7 +31,7 @@ export default async (s: DocumentsEditControllerState, options: any) => {
29
31
  return editProperties.ref.properties;
30
32
  }
31
33
  })()
32
-
34
+
33
35
  // 设置数据
34
36
  s.schema.definitions[editProperties.ref.$name] = {
35
37
  ...editProperties.ref,
@@ -47,6 +49,8 @@ export default async (s: DocumentsEditControllerState, options: any) => {
47
49
  title: properties.items.title,
48
50
  properties: pro,
49
51
  }
52
+ } else {
53
+ delete s.schema.definitions[editProperties.ref.$name]['items']
50
54
  }
51
55
 
52
56
  s.schema = { ...s.schema };
@@ -8,19 +8,19 @@ const { createSchema } = DocumentsEdit;
8
8
 
9
9
  export default () => {
10
10
 
11
- const [schema, setScheme] = React.useState(createSchema('对账单'));
11
+ const [schema, setScheme] = React.useState<any>();
12
12
 
13
13
  const onChange = React.useCallback((schema: ISchema) => {
14
- console.log(schema);
14
+ console.log('===> onChange', schema);
15
15
  }, [])
16
16
 
17
17
  return (
18
18
  <div>
19
19
  <Button onClick={() => { setScheme(createSchema('对账单')) }} >更新文档</Button>
20
- <DocumentsEdit
21
- schema={schema} // 初始化文档
22
- onChange={onChange} // 文档变化事件
23
- />
20
+ {schema && <DocumentsEdit
21
+ schema={schema} // 初始化文档
22
+ onChange={onChange} // 文档变化事件
23
+ />}
24
24
  </div>
25
25
  );
26
26
  };
@@ -25,6 +25,7 @@ const propertyColumns: ColumnType<any>[] = [
25
25
  },
26
26
  {
27
27
  title: '是否必填',
28
+ width: 80,
28
29
  render: (_, v) => {
29
30
  return <MySpan>{v.required.indexOf(v.value.$name) >= 0 ? '是' : '否'}</MySpan>;
30
31
  },
@@ -38,6 +39,7 @@ const propertyColumns: ColumnType<any>[] = [
38
39
  {
39
40
  title: '是否已添加校验规则',
40
41
  key: 'isRules',
42
+ width: 130,
41
43
  render: (_, v) => {
42
44
  return <MySpan>{v.ref.rules ? v.ref.rules.length > 0 ? '是' : '否' : '否'}</MySpan>;
43
45
  },
@@ -1,4 +1,10 @@
1
1
  .kts-documents-edit {
2
+
3
+ min-height: 600px;
4
+ height: 100%;
5
+ display: flex;
6
+ flex-direction: column;
7
+
2
8
  .kts-documents-edit-head {
3
9
  display: flex;
4
10
  margin-bottom: 10px;
@@ -7,4 +13,33 @@
7
13
  flex: 1;
8
14
  }
9
15
  }
16
+
17
+ .kts-documents-edit-property {
18
+ flex: 1;
19
+ overflow: auto;
20
+
21
+ .ktsAntX-table,
22
+ .ktsAntX-spin-container,
23
+ .ktsAntX-spin-nested-loading,
24
+ .ktsAntX-table-wrapper{
25
+ height: 100%;
26
+ overflow: auto;
27
+ }
28
+
29
+ .ktsAntX-table-container{
30
+ height: 100%;
31
+ overflow: auto;
32
+ display: flex;
33
+ flex-direction: column;
34
+
35
+ .ktsAntX-table-header{
36
+ flex: none;
37
+ }
38
+
39
+ .ktsAntX-table-body{
40
+ flex: 1;
41
+ overflow: auto;
42
+ }
43
+ }
44
+ }
10
45
  }
@@ -101,7 +101,7 @@ const Main = (props: IDocumentsEdit) => {
101
101
 
102
102
  return (
103
103
  <DocumentsEditContext.Provider value={controller}>
104
- <div className="kts-documents-edit" style={{ minHeight: 600 }} >
104
+ <div className="kts-documents-edit" >
105
105
  <Space className="kts-documents-edit-head">
106
106
  <Breadcrumb />
107
107
  <AddPropertyButton />
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Breadcrumb, Button } from 'kts-components-antd-x4';
3
3
  import DocumentsEdit from '../../';
4
- import IProperties from '../../DocumentsEditController/DocumentsEditControllerState/IProperties';
4
+ // import IProperties from '../../DocumentsEditController/DocumentsEditControllerState/IProperties';
5
5
  import { IDataSource } from '../../../DocumentsEdit/DocumentsEditController/DocumentsEditControllerState';
6
6
 
7
7
  export default () => {
8
8
 
9
9
  const controller = DocumentsEdit.useDocumentsEditController();
10
10
 
11
- const title = controller.useMemo(s=>s.schema.title, [])
11
+ const title = controller.useMemo(s => s.schema.title, [])
12
12
 
13
13
  const breadcrumbState = controller.useMemo(s => s.breadcrumbState, []);
14
14
 
@@ -30,6 +30,8 @@ export default () => {
30
30
  })()
31
31
  }, [])
32
32
 
33
+ if (breadcrumbState.length === 0) return <span></span>;
34
+
33
35
  return (
34
36
  <Breadcrumb separator=">">
35
37
  <Breadcrumb.Item key="root" >
@@ -162,7 +162,7 @@ export default () => {
162
162
  help={isChangeType ? "修改类型后,系统将自动清空该字段的校验规则。" : undefined}
163
163
  validateStatus={isChangeType ? "warning" : ''}
164
164
  >
165
- <Select onSelect={() => { setIsChangeType(true) }} >
165
+ <Select onChange={e => { setIsChangeType(e !== tools.getType(editProperties?.ref.type ?? '')) }} >
166
166
  <Option key="00" value="string">{tools.getTypeName('string')}</Option>
167
167
  <Option key="01" value="string|date">{tools.getTypeName('string|date')}</Option>
168
168
  <Option key="02" value="string|time">{tools.getTypeName('string|time')}</Option>
@@ -5,6 +5,7 @@ import {
5
5
  Drawer,
6
6
  Space,
7
7
  Divider,
8
+ message,
8
9
  } from 'kts-components-antd-x4';
9
10
  import DocumentsEdit from '../../';
10
11
  import AddRuleButton from './ui/AddRuleButton';
@@ -30,7 +31,7 @@ export default () => {
30
31
 
31
32
  /** 正在编辑规则的字段 */
32
33
  const rules = controller.useMemo(s => s.ruleState.ruleProperties?.ref?.rules ?? [], []);
33
-
34
+
34
35
  const onClose = React.useCallback(() => { controller.pipeline(async s => s.ruleState.ruleProperties = undefined)() }, [controller]);
35
36
 
36
37
  const onSubmit = React.useCallback(async () => {
@@ -38,8 +39,9 @@ export default () => {
38
39
 
39
40
  const formList = controller.state.ruleState.formList;
40
41
  const sum: any[] = [];
42
+ let i = 0
41
43
  try {
42
- for (let i = 0; i < formList.length; i++) {
44
+ for (; i < formList.length; i++) {
43
45
  sum.push(algorithmFormat(await formList[i].validateFields(), operatorMap, ruleProperties.ref.type))
44
46
  }
45
47
  await controller.pipeline(async s => {
@@ -48,8 +50,10 @@ export default () => {
48
50
  s.schema = { ...s.schema };
49
51
  s.ruleState.ruleProperties = undefined;
50
52
  })()
51
- } catch (error) {
52
- console.error('===> 表单有错', error)
53
+ } catch (error: any) {
54
+ const ms = `[规则${i + 1}] ${error.errorFields[0].errors[0]}`
55
+ message.error({ key: ms, content: ms });
56
+ console.error('===> 表单有错', error.errorFields[0].errors[0], i);
53
57
  }
54
58
  }, [controller, operatorMap, ruleProperties])
55
59
 
@@ -1,5 +1,5 @@
1
1
  .kts-documents-edit-property-table-button-list{
2
2
  .ktsAntX-btn-link{
3
- padding: 4px;
3
+ padding: 4px !important;
4
4
  }
5
5
  }
@@ -11,7 +11,7 @@ export default () => {
11
11
  size="small"
12
12
  rowKey="$name"
13
13
  pagination={false}
14
- scroll={{ y: 240, x: true }}
14
+ scroll={{ y: '100%', x: true }}
15
15
  {...useTableProps()}
16
16
  />
17
17
  );