@kmkf-fe-packages/services-components 1.6.0-beta.1 → 1.6.0-beta.11

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.
@@ -1059,7 +1059,8 @@ export var MsgContent = function MsgContent(_ref14) {
1059
1059
  qq: 'QQ',
1060
1060
  qywx: '企业微信',
1061
1061
  YZDKH: '邮政拦截',
1062
- YT: '圆通拦截'
1062
+ YT: '圆通拦截',
1063
+ feishu: '飞书'
1063
1064
  };
1064
1065
  var detailContent = function detailContent(item) {
1065
1066
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { ComponentInterface, ColumnConfig, Record, PickOption } from '../../type';
1
+ import React from "react";
2
+ import { ComponentInterface, ColumnConfig, Record, PickOption } from "../../type";
3
3
  declare class Handler implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
@@ -11,9 +11,13 @@ declare class Handler implements ComponentInterface {
11
11
  formField: string;
12
12
  canSort: boolean;
13
13
  children: ComponentInterface[];
14
- dataType: ComponentInterface['dataType'];
15
- options: ComponentInterface['options'];
14
+ dataType: ComponentInterface["dataType"];
15
+ options: ComponentInterface["options"];
16
16
  constructor(options: PickOption);
17
+ newOptions: () => {
18
+ label: string;
19
+ value: string;
20
+ }[];
17
21
  renderPc: (v: unknown, record: Record) => React.JSX.Element;
18
22
  renderLog: () => null;
19
23
  getComponentValue: (r: Record) => any;
@@ -35,6 +39,7 @@ declare class Handler implements ComponentInterface {
35
39
  }[];
36
40
  };
37
41
  filterFn: (value: string) => (i: Record) => boolean;
42
+ formatFilterValue: (value: any) => unknown[];
38
43
  };
39
44
  }
40
45
  export default Handler;
@@ -1,17 +1,30 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2
14
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
15
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
17
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
18
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
19
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- import React from 'react';
9
- import intersection from 'lodash/intersection';
10
- import { filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
20
+ import React from "react";
21
+ import intersection from "lodash/intersection";
22
+ import { filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
11
23
  import { SYMBOL } from "../../constant";
24
+ import { uniq } from "lodash";
12
25
  var Handler = /*#__PURE__*/_createClass(function Handler(options) {
13
26
  var _this = this,
14
- _this$effects2;
27
+ _this$effects4;
15
28
  _classCallCheck(this, Handler);
16
29
  _defineProperty(this, "name", void 0);
17
30
  _defineProperty(this, "id", void 0);
@@ -25,12 +38,21 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
25
38
  _defineProperty(this, "children", void 0);
26
39
  _defineProperty(this, "dataType", void 0);
27
40
  _defineProperty(this, "options", void 0);
41
+ _defineProperty(this, "newOptions", function () {
42
+ var _this$effects, _this$effects2;
43
+ var groupList = (((_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.groupList) || []).map(function (item) {
44
+ return _objectSpread(_objectSpread({}, item), {}, {
45
+ value: "".concat(item.value, ":group")
46
+ });
47
+ });
48
+ return [].concat(_toConsumableArray(groupList), _toConsumableArray(((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.userList) || []));
49
+ });
28
50
  _defineProperty(this, "renderPc", function (v, record) {
29
51
  var _value$map$join, _value$map;
30
52
  var value = record === null || record === void 0 ? void 0 : record[_this.id];
31
53
  return /*#__PURE__*/React.createElement("span", null, (_value$map$join = value === null || value === void 0 ? void 0 : (_value$map = value.map(function (item) {
32
54
  return item.account;
33
- })) === null || _value$map === void 0 ? void 0 : _value$map.join('')) !== null && _value$map$join !== void 0 ? _value$map$join : '--');
55
+ })) === null || _value$map === void 0 ? void 0 : _value$map.join("")) !== null && _value$map$join !== void 0 ? _value$map$join : "--");
34
56
  });
35
57
  _defineProperty(this, "renderLog", function () {
36
58
  return null;
@@ -43,7 +65,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
43
65
  var values = record === null || record === void 0 ? void 0 : record[_this.id];
44
66
  return (_values$map$join = values === null || values === void 0 ? void 0 : (_values$map = values.map(function (item) {
45
67
  return item.account;
46
- })) === null || _values$map === void 0 ? void 0 : _values$map.join('')) !== null && _values$map$join !== void 0 ? _values$map$join : '--';
68
+ })) === null || _values$map === void 0 ? void 0 : _values$map.join("")) !== null && _values$map$join !== void 0 ? _values$map$join : "--";
47
69
  });
48
70
  _defineProperty(this, "renderClient", function () {
49
71
  return null;
@@ -52,7 +74,6 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
52
74
  return null;
53
75
  });
54
76
  _defineProperty(this, "filterConfig", function (item) {
55
- var _this$effects;
56
77
  return {
57
78
  searchDefaultConditions: SYMBOL.in,
58
79
  type: item.type,
@@ -60,9 +81,9 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
60
81
  // 过滤组件id
61
82
  name: item.name,
62
83
  // 过滤组件名称
63
- filterComponentType: 'MultipleSelect',
84
+ filterComponentType: "MultipleSelect",
64
85
  props: {
65
- options: ((_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.userList) || []
86
+ options: _this.newOptions() || []
66
87
  },
67
88
  filterFn: function filterFn(value) {
68
89
  return function (i) {
@@ -71,6 +92,27 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
71
92
  return item === null || item === void 0 ? void 0 : item.account;
72
93
  })).length > 0;
73
94
  };
95
+ },
96
+ formatFilterValue: function formatFilterValue(value) {
97
+ var useList = value.reduce(function (prv, next) {
98
+ var _next$split = next.split(":"),
99
+ _next$split2 = _slicedToArray(_next$split, 2),
100
+ val = _next$split2[0],
101
+ groupText = _next$split2[1];
102
+ if (groupText) {
103
+ var _this$effects3, _this$effects3$groupL;
104
+ var groupItem = (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : (_this$effects3$groupL = _this$effects3.groupList) === null || _this$effects3$groupL === void 0 ? void 0 : _this$effects3$groupL.find(function (item) {
105
+ return item.value === val;
106
+ });
107
+ groupItem && prv.push.apply(prv, _toConsumableArray(groupItem.relationUserList.map(function (t) {
108
+ return t.userKey;
109
+ })));
110
+ } else {
111
+ prv.push(next);
112
+ }
113
+ return prv;
114
+ }, []);
115
+ return uniq(useList);
74
116
  }
75
117
  };
76
118
  });
@@ -83,7 +125,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
83
125
  this.isCombinationComponent = false;
84
126
  this.canSort = false;
85
127
  this.children = [];
86
- this.dataType = 'string';
87
- this.options = ((_this$effects2 = this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.userList) || [];
128
+ this.dataType = "string";
129
+ this.options = ((_this$effects4 = this.effects) === null || _this$effects4 === void 0 ? void 0 : _this$effects4.userList) || [];
88
130
  });
89
131
  export default Handler;
@@ -26,7 +26,8 @@ import QueryLogisticsTrack from "../../commonComponents/QueryLogisticsTrack";
26
26
  import CopyText from "../../commonComponents/CopyText";
27
27
  var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
28
28
  var _this = this,
29
- _this$componentConfig5;
29
+ _this$componentConfig5,
30
+ _this$componentConfig6;
30
31
  _classCallCheck(this, Logistics);
31
32
  _defineProperty(this, "name", void 0);
32
33
  _defineProperty(this, "columnHeader", void 0);
@@ -58,13 +59,13 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
58
59
  return /*#__PURE__*/React.createElement(Space, {
59
60
  wrap: true
60
61
  }, list.map(function (item, index) {
61
- var _ref, _this$expressIntercep;
62
+ var _ref, _item$interceptAddres, _this$expressIntercep;
62
63
  var addressText = (_ref = item.interceptAddress || []) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
63
64
  return _this.addressDateInstance.getNameByCode(suffix);
64
65
  }).join('');
65
66
  return /*#__PURE__*/React.createElement("div", null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : '', item.interceptCompany ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u516C\u53F8\uFF1A", _this.expressDateInstance.getExpressNameByCode(item.interceptCompany) || item.interceptCompany) : null, item.interceptCode ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u5355\u53F7\uFF1A", /*#__PURE__*/React.createElement(CopyText, {
66
67
  text: item.interceptCode
67
- })) : null, item.interceptAddress.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A", addressText, item.interceptDetail, " ", item.interceptReceiverName, ' ', item.interceptReceiverMobile) : null, item.interceptType ? /*#__PURE__*/React.createElement("div", null, "\u62E6\u622A\u7C7B\u578B\uFF1A", _this.expressInterceptInstance.getTypeNameMap()[item.interceptType]) : null, item.interceptLogisticsStatus ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u72B6\u6001\uFF1A", (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus], /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
68
+ })) : null, (_item$interceptAddres = item.interceptAddress) !== null && _item$interceptAddres !== void 0 && _item$interceptAddres.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A", addressText, item.interceptDetail, " ", item.interceptReceiverName, ' ', item.interceptReceiverMobile) : null, item.interceptType ? /*#__PURE__*/React.createElement("div", null, "\u62E6\u622A\u7C7B\u578B\uFF1A", _this.expressInterceptInstance.getTypeNameMap()[item.interceptType]) : null, item.interceptLogisticsStatus ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u72B6\u6001\uFF1A", (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus], /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
68
69
  modelWidth: 500,
69
70
  interceptCompany: item.interceptCompany,
70
71
  interceptCode: item.interceptCode,
@@ -144,8 +145,8 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
144
145
  this.canSort = false;
145
146
  this.dataType = 'object';
146
147
  this.children = [this.express, this.expressCode, this.interceptType, this.interceptAddress, this.interceptLogisticsStatus, this.interceptSnapshot];
147
- this.rules = [{
148
- required: (_this$componentConfig5 = this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.required,
148
+ this.rules = (_this$componentConfig5 = this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required ? [{
149
+ required: (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required,
149
150
  validator: function validator(_, value) {
150
151
  if (value.some(function (t) {
151
152
  return !(t !== null && t !== void 0 && t.interceptCompany) || !(t !== null && t !== void 0 && t.interceptCode);
@@ -182,7 +183,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
182
183
  }
183
184
  return Promise.resolve();
184
185
  }
185
- }];
186
+ }] : [];
186
187
  this.addressDateInstance = AddressData.getInstance();
187
188
  });
188
189
  export default Logistics;
@@ -50,7 +50,8 @@ var msgTypeCh = {
50
50
  qq: 'QQ',
51
51
  qywx: '企业微信',
52
52
  YZDKH: '邮政拦截',
53
- YT: '圆通拦截'
53
+ YT: '圆通拦截',
54
+ feishu: "飞书"
54
55
  };
55
56
  var MsgStatus = /*#__PURE__*/_createClass(function MsgStatus(options) {
56
57
  var _this = this,
@@ -15,6 +15,7 @@ declare class SubForm implements ComponentInterface {
15
15
  templateId?: string;
16
16
  workOrderUniqueKey?: string;
17
17
  constructor(options: PickOption);
18
+ getNewTableHeader: () => any;
18
19
  renderTabel: (list: any) => React.JSX.Element;
19
20
  renderPc: () => null;
20
21
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -1,12 +1,12 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
6
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9
7
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -16,22 +16,14 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
16
16
  import React from "react";
17
17
  import { Table } from "antd";
18
18
  import { SubForm as SubFormComponent } from "@kmkf-fe-packages/basic-components";
19
- import Input from "../Input";
20
- import TextArea from "../TextArea";
21
19
  import BsHeaderChild from "../BS/common/BsHeaderChild";
22
20
  import GetFormItem from "../GetFormItem";
23
21
  import ItemView from "../../commonComponents/ItemView";
24
22
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
25
23
  import { SYMBOL } from "../../constant";
26
- var WidgetMap = {
27
- INPUT: Input,
28
- TEXTAREA: TextArea
29
- };
30
24
  var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
31
25
  var _this = this,
32
- _this$componentConfig7,
33
- _this$componentConfig11,
34
- _this$componentConfig12;
26
+ _this$componentConfig9;
35
27
  _classCallCheck(this, SubForm);
36
28
  _defineProperty(this, "name", void 0);
37
29
  _defineProperty(this, "id", void 0);
@@ -46,8 +38,28 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
46
38
  _defineProperty(this, "dataType", void 0);
47
39
  _defineProperty(this, "templateId", void 0);
48
40
  _defineProperty(this, "workOrderUniqueKey", void 0);
41
+ _defineProperty(this, "getNewTableHeader", function () {
42
+ var _this$componentConfig, _this$componentConfig2, _this$componentConfig3;
43
+ return (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.subConfig) === null || _this$componentConfig2 === void 0 ? void 0 : (_this$componentConfig3 = _this$componentConfig2.correlationList) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.reduce(function (prv, item) {
44
+ var _this$componentConfig4;
45
+ var t = ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tableHeader.find(function (v) {
46
+ return v.key === item.key;
47
+ })) || {
48
+ isShow: true,
49
+ isEdit: false,
50
+ isRequired: false,
51
+ isNumber: false,
52
+ precision: "nolimit",
53
+ width: 150
54
+ };
55
+ if (t.isShow) {
56
+ prv.push(_objectSpread(_objectSpread({}, item), t));
57
+ }
58
+ return prv;
59
+ }, []);
60
+ });
49
61
  _defineProperty(this, "renderTabel", function (list) {
50
- var _ref, _ref$filter, _this$componentConfig, _this$componentConfig2;
62
+ var _ref, _ref$filter;
51
63
  var columns = [{
52
64
  dataIndex: "",
53
65
  title: "序号",
@@ -57,7 +69,7 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
57
69
  render: function render(val, record, index) {
58
70
  return /*#__PURE__*/React.createElement("span", null, index + 1);
59
71
  }
60
- }].concat(_toConsumableArray(((_ref = ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.subConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.config) || []) === null || _ref === void 0 ? void 0 : (_ref$filter = _ref.filter(function (t) {
72
+ }].concat(_toConsumableArray(((_ref = _this.getNewTableHeader() || []) === null || _ref === void 0 ? void 0 : (_ref$filter = _ref.filter(function (t) {
61
73
  return t.isShow;
62
74
  })) === null || _ref$filter === void 0 ? void 0 : _ref$filter.map(function (item) {
63
75
  return {
@@ -65,7 +77,7 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
65
77
  title: item.name,
66
78
  align: "center",
67
79
  ellipsis: true,
68
- width: 200,
80
+ width: item.width,
69
81
  render: function render(val) {
70
82
  return /*#__PURE__*/React.createElement("span", null, val);
71
83
  }
@@ -106,15 +118,15 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
106
118
  }) : null;
107
119
  });
108
120
  _defineProperty(this, "editRender", function (p) {
109
- var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$componentConfig6;
121
+ var _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
110
122
  return /*#__PURE__*/React.createElement(GetFormItem, {
111
123
  title: _this.name,
112
124
  name: _this.id,
113
125
  rules: _this.rules,
114
126
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
115
127
  display: p === null || p === void 0 ? void 0 : p.display,
116
- required: (_this$componentConfig3 = (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.required) !== null && _this$componentConfig3 !== void 0 ? _this$componentConfig3 : false,
117
- tooltip: (_this$componentConfig5 = (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.tooltip) !== null && _this$componentConfig5 !== void 0 ? _this$componentConfig5 : "",
128
+ required: (_this$componentConfig5 = (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required) !== null && _this$componentConfig5 !== void 0 ? _this$componentConfig5 : false,
129
+ tooltip: (_this$componentConfig7 = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.tooltip) !== null && _this$componentConfig7 !== void 0 ? _this$componentConfig7 : "",
118
130
  component: /*#__PURE__*/React.createElement(SubFormComponent, _this.componentConfig)
119
131
  });
120
132
  });
@@ -138,10 +150,10 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
138
150
  this.componentConfig = options.componentConfig;
139
151
  this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
140
152
  this.rules = [{
141
- required: (_this$componentConfig7 = this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.required,
153
+ required: (_this$componentConfig9 = this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.required,
142
154
  validator: function validator(_, value) {
143
- var _this$componentConfig8, _this$componentConfig9, _this$componentConfig10;
144
- var result = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : (_this$componentConfig9 = _this$componentConfig8.subConfig) === null || _this$componentConfig9 === void 0 ? void 0 : (_this$componentConfig10 = _this$componentConfig9.config) === null || _this$componentConfig10 === void 0 ? void 0 : _this$componentConfig10.reduce(function (prv, next) {
155
+ var _this$componentConfig10, _this$componentConfig11;
156
+ var result = (_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : (_this$componentConfig11 = _this$componentConfig10.tableHeader) === null || _this$componentConfig11 === void 0 ? void 0 : _this$componentConfig11.reduce(function (prv, next) {
145
157
  if (next.isRequired && next.isShow && !next.isEdit) {
146
158
  prv[next.key] = "".concat(next.name, "\u4E0D\u80FD\u4E3A\u7A7A");
147
159
  }
@@ -163,7 +175,7 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
163
175
  }];
164
176
  this.isCombinationComponent = true;
165
177
  this.canSort = false;
166
- this.children = (((_this$componentConfig11 = this.componentConfig) === null || _this$componentConfig11 === void 0 ? void 0 : (_this$componentConfig12 = _this$componentConfig11.subConfig) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.config) || []).map(function (item) {
178
+ this.children = (this.getNewTableHeader() || []).map(function (item) {
167
179
  return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
168
180
  name: item.name,
169
181
  id: "".concat(options.id, "_productList_").concat(item.key)
@@ -173,18 +173,15 @@ export interface ComponentInterface {
173
173
  rulesOptions?: Array<any>;
174
174
  selectRules?: Array<string>;
175
175
  logistics?: string;
176
- repeatConfig?: {
177
- repeatRange: string;
178
- repeatComponents: any[];
179
- };
180
176
  subConfig?: {
181
- config: any;
182
- flowStatus: string[];
183
- flowTemplateKey: any;
184
- nodeId: string;
185
- workOrderTemplateId: string;
177
+ correlationList?: any;
178
+ flowStatus?: string[];
179
+ flowTemplateKey?: any;
180
+ nodeId?: string;
181
+ workOrderTemplateId?: string;
186
182
  };
187
- tooltip?: string;
183
+ needFilterShopByPermission?: boolean;
184
+ tableHeader?: any;
188
185
  };
189
186
  effects?: {
190
187
  queryWorkOrderDetail?: (r: Record) => void;
@@ -199,6 +196,11 @@ export interface ComponentInterface {
199
196
  label: string;
200
197
  value: string;
201
198
  }[];
199
+ groupList?: {
200
+ label: string;
201
+ value: string;
202
+ [key: string]: any;
203
+ }[];
202
204
  tbAppKey?: string;
203
205
  companyKey?: string;
204
206
  env?: PlatForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.6.0-beta.1",
3
+ "version": "1.6.0-beta.11",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "1.6.0-beta.0",
25
- "@kmkf-fe-packages/kmkf-utils": "1.6.0-beta.0"
24
+ "@kmkf-fe-packages/basic-components": "1.6.0-beta.11",
25
+ "@kmkf-fe-packages/kmkf-utils": "1.6.0-beta.11"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@typescript-eslint/eslint-plugin": "^5.59.2",
@@ -38,7 +38,7 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "70e138f768b36d4539f3b287200e0e7dc72b1e56",
41
+ "gitHead": "9c091ef006f04fcff953be476a3ce811841cb45f",
42
42
  "gitHooks": {
43
43
  "pre-commit": "lint-staged"
44
44
  }