@kmkf-fe-packages/services-components 2.3.0-rc.0 → 2.5.0-rc.0

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.
@@ -1,18 +1,18 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
+ import React from "react";
3
3
  declare class BsHeaderChild implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
- componentConfig: ComponentInterface['componentConfig'];
8
+ componentConfig: ComponentInterface["componentConfig"];
9
9
  align: ALignType;
10
10
  width: number;
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface['dataType'];
15
+ dataType: ComponentInterface["dataType"];
16
16
  parentName?: string;
17
17
  transformValue: (val: any, record?: any, parentName?: string) => any;
18
18
  export: (val: any, record?: any, parentName?: string) => any;
@@ -11,9 +11,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
11
11
  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; }
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  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); }
14
- import React from 'react';
14
+ import React from "react";
15
15
  import ItemView from "../../../commonComponents/ItemView";
16
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
16
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
17
  var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
18
18
  var _this = this;
19
19
  _classCallCheck(this, BsHeaderChild);
@@ -37,7 +37,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
37
37
  return val;
38
38
  });
39
39
  _defineProperty(this, "getParentId", function () {
40
- var _this$id$split = _this.id.split('_'),
40
+ var _this$id$split = _this.id.split("_"),
41
41
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
42
42
  key = _this$id$split2[0],
43
43
  name = _this$id$split2[1],
@@ -53,7 +53,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
53
53
  });
54
54
  _defineProperty(this, "renderPc", function (value, record) {
55
55
  var _this$getComponentVal;
56
- return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
56
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
57
57
  });
58
58
  _defineProperty(this, "renderLog", function (r) {
59
59
  var id = _this.getParentId();
@@ -68,8 +68,8 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
68
68
  });
69
69
  _defineProperty(this, "renderExport", function (value, record) {
70
70
  var _this$getComponentExp;
71
- var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : '--';
72
- return typeof val === 'number' ? val + '' : val;
71
+ var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : "--";
72
+ return typeof val === "number" ? val + "" : val;
73
73
  });
74
74
  _defineProperty(this, "editRender", function () {
75
75
  return null;
@@ -86,11 +86,11 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
86
86
  this.parentName = options.parentName;
87
87
  }
88
88
  this.componentConfig = options.componentConfig;
89
- this.align = 'left';
89
+ this.align = "left";
90
90
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 100;
91
91
  this.isCombinationComponent = false;
92
92
  this.canSort = false;
93
- this.dataType = 'string';
93
+ this.dataType = "string";
94
94
  this.children = [];
95
95
  if (options.transformValue) {
96
96
  this.transformValue = options.transformValue;
@@ -12,8 +12,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  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); }
14
14
  import React from "react";
15
- import { Image } from "antd";
16
15
  import ItemView from "../../../commonComponents/ItemView";
16
+ import { BsGoodPic } from "../../Common";
17
17
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
18
18
  var BsChildPic = /*#__PURE__*/_createClass(function BsChildPic(options) {
19
19
  var _this = this;
@@ -46,14 +46,9 @@ var BsChildPic = /*#__PURE__*/_createClass(function BsChildPic(options) {
46
46
  }) : null;
47
47
  });
48
48
  _defineProperty(this, "renderPc", function (value, record) {
49
- return /*#__PURE__*/React.createElement("span", {
50
- onClick: function onClick(e) {
51
- return e.stopPropagation();
52
- }
53
- }, /*#__PURE__*/React.createElement(Image, {
54
- width: 60,
55
- src: _this.getComponentValue(record)
56
- }));
49
+ var picValue = _this.getComponentValue(record);
50
+ var imgList = picValue ? picValue === null || picValue === void 0 ? void 0 : picValue.split(",") : [];
51
+ return BsGoodPic(imgList);
57
52
  });
58
53
  _defineProperty(this, "renderLog", function (r) {
59
54
  var id = _this.getParentId();
@@ -31,7 +31,7 @@ export declare const BsGoodImage: ({ item, index }: {
31
31
  index: number;
32
32
  }) => React.JSX.Element;
33
33
  export declare const BsExchangeList: ({ list, showHeader }: any) => React.JSX.Element;
34
- export declare const BsGoodPic: (list: string[]) => React.JSX.Element[];
34
+ export declare const BsGoodPic: (list: string[]) => React.JSX.Element;
35
35
  export declare const BsGoodsTable: ({ list, showHeader, text, type, }: {
36
36
  list: any[];
37
37
  showHeader: (string | ShowHeaderObjType)[];
@@ -448,12 +448,17 @@ export var BsExchangeList = function BsExchangeList(_ref10) {
448
448
  };
449
449
  //bs图片展示
450
450
  export var BsGoodPic = function BsGoodPic(list) {
451
- return list.map(function (t) {
452
- return /*#__PURE__*/React.createElement(Image, {
451
+ return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, list.map(function (t) {
452
+ var finalSrc = t !== null && t !== void 0 && t.startsWith("http") ? t : "https://kefu.kuaimai.com/".concat(t);
453
+ return /*#__PURE__*/React.createElement("span", {
454
+ onClick: function onClick(e) {
455
+ return e.stopPropagation();
456
+ }
457
+ }, /*#__PURE__*/React.createElement(Image, {
453
458
  width: 60,
454
- src: t
455
- });
456
- });
459
+ src: finalSrc
460
+ }));
461
+ }));
457
462
  };
458
463
  export var BsGoodsTable = function BsGoodsTable(_ref11) {
459
464
  var list = _ref11.list,
@@ -0,0 +1,49 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
2
+ import React from "react";
3
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
+ declare type subConfigType = {
5
+ isEdit: boolean;
6
+ isRequired: boolean;
7
+ isShow: boolean;
8
+ key: string;
9
+ name: string;
10
+ workOrderComponentType: string;
11
+ width: number;
12
+ dataIndex: string;
13
+ title: string;
14
+ widget: string;
15
+ settingName?: string;
16
+ };
17
+ declare class OrderSubForm implements ComponentInterface {
18
+ name: string;
19
+ id: string;
20
+ sortField: string;
21
+ type: string;
22
+ rules: any[];
23
+ componentConfig: ComponentInterface["componentConfig"];
24
+ effects: ComponentInterface["effects"];
25
+ isCombinationComponent: boolean;
26
+ formField: string;
27
+ canSort: boolean;
28
+ expressDateInstance: InstanceType<typeof ExpressData>;
29
+ children: ComponentInterface[];
30
+ dataType: ComponentInterface["dataType"];
31
+ constructor(options: PickOption);
32
+ renderTransformItem: (item: subConfigType, val: any) => any;
33
+ getNewTableHeader: () => any;
34
+ renderTabel: (list: any) => React.JSX.Element;
35
+ renderPc: () => null;
36
+ renderLog: (r: Record) => React.JSX.Element | null;
37
+ getComponentValue: (r: Record) => any;
38
+ renderExport: () => null;
39
+ renderClient: (record: Record) => React.JSX.Element | null;
40
+ editRender: (p: any) => React.JSX.Element;
41
+ filterConfig: (item: ColumnConfig) => {
42
+ searchDefaultConditions: "like";
43
+ type: string;
44
+ id: string;
45
+ name: string;
46
+ filterComponentType: "Input";
47
+ }[];
48
+ }
49
+ export default OrderSubForm;
@@ -0,0 +1,268 @@
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ 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."); }
5
+ 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); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ 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); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
+ 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; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
+ 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); }
17
+ import moment from "moment";
18
+ import React from "react";
19
+ import { Table } from "antd";
20
+ import { OrderSubForm as SubFormComponent } from "@kmkf-fe-packages/basic-components";
21
+ import BsHeaderChild from "../BS/common/BsHeaderChild";
22
+ import BsHeaderPic from "../BS/common/BsHeaderPic";
23
+ import GetFormItem from "../GetFormItem";
24
+ import ItemView from "../../commonComponents/ItemView";
25
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
26
+ import { difference } from "lodash";
27
+ import { SYMBOL } from "../../constant";
28
+ import { OrderSubFormUtils, orderSubFormConstants } from "@kmkf-fe-packages/basic-components";
29
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
30
+ var renderDetailItem = OrderSubFormUtils.renderDetailItem;
31
+ var getSelectWidgetMap = orderSubFormConstants.getSelectWidgetMap,
32
+ getOrderSubformColumns = orderSubFormConstants.getOrderSubformColumns;
33
+ var OrderSubForm = /*#__PURE__*/_createClass(
34
+ // workOrderUniqueKey?: string;
35
+ function OrderSubForm(options) {
36
+ var _this = this;
37
+ _classCallCheck(this, OrderSubForm);
38
+ _defineProperty(this, "name", void 0);
39
+ _defineProperty(this, "id", void 0);
40
+ _defineProperty(this, "sortField", void 0);
41
+ _defineProperty(this, "type", void 0);
42
+ _defineProperty(this, "rules", void 0);
43
+ _defineProperty(this, "componentConfig", void 0);
44
+ _defineProperty(this, "effects", void 0);
45
+ _defineProperty(this, "isCombinationComponent", void 0);
46
+ _defineProperty(this, "formField", void 0);
47
+ _defineProperty(this, "canSort", void 0);
48
+ _defineProperty(this, "expressDateInstance", void 0);
49
+ _defineProperty(this, "children", void 0);
50
+ _defineProperty(this, "dataType", void 0);
51
+ _defineProperty(this, "renderTransformItem", function (item, val) {
52
+ var _getSelectWidgetMap;
53
+ var mapValue = (_getSelectWidgetMap = getSelectWidgetMap(_this.expressDateInstance)) === null || _getSelectWidgetMap === void 0 ? void 0 : _getSelectWidgetMap[item.dataIndex];
54
+ var selectValue;
55
+ if (mapValue && typeof mapValue === "function") {
56
+ selectValue = mapValue === null || mapValue === void 0 ? void 0 : mapValue(val);
57
+ } else {
58
+ selectValue = mapValue === null || mapValue === void 0 ? void 0 : mapValue[val];
59
+ }
60
+ return selectValue;
61
+ });
62
+ _defineProperty(this, "getNewTableHeader", function () {
63
+ var _this$componentConfig, _ref2;
64
+ var orderSubformColumns = getOrderSubformColumns();
65
+ var orderSubformColumnMap = orderSubformColumns.reduce(function (prv, next) {
66
+ prv[next.dataIndex] = next;
67
+ return prv;
68
+ }, {});
69
+ var _ref = ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.subConfig) || {},
70
+ _ref$correlationList = _ref.correlationList,
71
+ correlationList = _ref$correlationList === void 0 ? [] : _ref$correlationList;
72
+ var columns = correlationList && correlationList !== null && correlationList !== void 0 && correlationList.length ? correlationList.map(function (t) {
73
+ return orderSubformColumnMap[t.dataIndex];
74
+ }) : orderSubformColumns;
75
+ return (_ref2 = columns || []) === null || _ref2 === void 0 ? void 0 : _ref2.reduce(function (prv, item) {
76
+ var _this$componentConfig2, _this$componentConfig3;
77
+ var t = ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : (_this$componentConfig3 = _this$componentConfig2.tableHeader) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.find(function (v) {
78
+ return v.key === item.dataIndex;
79
+ })) || {
80
+ isShow: true,
81
+ isEdit: false,
82
+ isRequired: false,
83
+ width: Number(item === null || item === void 0 ? void 0 : item.width) || 150
84
+ };
85
+ if (t.isShow) {
86
+ prv.push(_objectSpread(_objectSpread({}, item), t));
87
+ }
88
+ return prv;
89
+ }, []);
90
+ });
91
+ _defineProperty(this, "renderTabel", function (list) {
92
+ var _ref3, _ref3$filter;
93
+ var columns = [{
94
+ dataIndex: "",
95
+ title: "序号",
96
+ align: "center",
97
+ ellipsis: true,
98
+ width: 50,
99
+ render: function render(val, record, index) {
100
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
101
+ }
102
+ }].concat(_toConsumableArray(((_ref3 = _this.getNewTableHeader() || []) === null || _ref3 === void 0 ? void 0 : (_ref3$filter = _ref3.filter(function (t) {
103
+ return t.isShow;
104
+ })) === null || _ref3$filter === void 0 ? void 0 : _ref3$filter.map(function (item) {
105
+ return _objectSpread(_objectSpread({}, item), {}, {
106
+ align: "center",
107
+ ellipsis: true,
108
+ title: (item === null || item === void 0 ? void 0 : item.settingName) || item.title,
109
+ render: function render(val) {
110
+ return renderDetailItem({
111
+ item: item,
112
+ val: val
113
+ });
114
+ }
115
+ });
116
+ })) || []));
117
+ return /*#__PURE__*/React.createElement(Table, {
118
+ columns: columns,
119
+ dataSource: list,
120
+ rowKey: "uuid",
121
+ size: "small",
122
+ pagination: false,
123
+ scroll: {
124
+ x: "100%"
125
+ },
126
+ locale: {
127
+ emptyText: "暂无数据"
128
+ }
129
+ });
130
+ });
131
+ _defineProperty(this, "renderPc", function () {
132
+ return null;
133
+ });
134
+ _defineProperty(this, "renderLog", function (r) {
135
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_subOrderList")])) return null;
136
+ return _this.renderTabel(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_subOrderList")]);
137
+ });
138
+ _defineProperty(this, "getComponentValue", function (r) {
139
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_subOrderList")];
140
+ });
141
+ _defineProperty(this, "renderExport", function () {
142
+ return null;
143
+ });
144
+ _defineProperty(this, "renderClient", function (record) {
145
+ var _record;
146
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
147
+ id: _this.id,
148
+ label: _this.name,
149
+ value: _this.renderTabel(record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.subOrderList)
150
+ }) : null;
151
+ });
152
+ _defineProperty(this, "editRender", function (p) {
153
+ var _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7;
154
+ return /*#__PURE__*/React.createElement(GetFormItem, {
155
+ title: _this.name,
156
+ name: _this.id,
157
+ rules: _this.rules,
158
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
159
+ display: p === null || p === void 0 ? void 0 : p.display,
160
+ required: (_this$componentConfig4 = (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.required) !== null && _this$componentConfig4 !== void 0 ? _this$componentConfig4 : false,
161
+ tooltip: (_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.showTooltip ? (_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.tooltip : "",
162
+ component: /*#__PURE__*/React.createElement(SubFormComponent, _extends({
163
+ effects: _this.effects
164
+ }, _this.componentConfig, {
165
+ platform: p === null || p === void 0 ? void 0 : p.platform
166
+ }))
167
+ });
168
+ });
169
+ _defineProperty(this, "filterConfig", function (item) {
170
+ return [{
171
+ searchDefaultConditions: SYMBOL.like,
172
+ type: item.type,
173
+ id: "".concat(item.id, "_subOrderList"),
174
+ // 过滤组件id
175
+ name: item.name,
176
+ // 过滤组件名称
177
+ filterComponentType: "Input"
178
+ }];
179
+ });
180
+ this.name = options.name;
181
+ this.id = options.id;
182
+ this.sortField = "".concat(options.id, "_subOrderList");
183
+ this.formField = "".concat(options.id, "_subOrderList");
184
+ this.type = options.type;
185
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
186
+ this.componentConfig = options.componentConfig;
187
+ // this.workOrderUniqueKey = options?.workOrderUniqueKey;
188
+ this.rules = [{
189
+ validator: function validator(_, value) {
190
+ var _value$subOrderList, _this$componentConfig8, _this$componentConfig9, _value$subOrderList2;
191
+ if (!(value !== null && value !== void 0 && (_value$subOrderList = value.subOrderList) !== null && _value$subOrderList !== void 0 && _value$subOrderList.length)) {
192
+ return Promise.reject(new Error("请填写子订单"));
193
+ }
194
+ var result = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : (_this$componentConfig9 = _this$componentConfig8.tableHeader) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.reduce(function (prv, next) {
195
+ if (next.isRequired && next.isShow && !next.isEdit) {
196
+ prv[next.key] = "".concat(next.name, "\u5FC5\u586B");
197
+ }
198
+ return prv;
199
+ }, {});
200
+ // TODO: 补充确省字段
201
+ var fillKeysValue = value === null || value === void 0 ? void 0 : (_value$subOrderList2 = value.subOrderList) === null || _value$subOrderList2 === void 0 ? void 0 : _value$subOrderList2.map(function (item) {
202
+ var _this$componentConfig10, _this$componentConfig11;
203
+ var lostKeys = difference((_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.map(function (item) {
204
+ return item.key;
205
+ }), Object.keys(item));
206
+ if (!isNull(lostKeys)) {
207
+ return lostKeys.reduce(function (prv, next) {
208
+ return _objectSpread(_objectSpread({}, prv), {}, _defineProperty({}, next, undefined));
209
+ }, item);
210
+ }
211
+ return item;
212
+ });
213
+ var msg = (fillKeysValue || []).reduce(function (prv, next) {
214
+ Object.keys(next).forEach(function (key) {
215
+ if (result[key] && isNull(next[key])) {
216
+ prv = result[key];
217
+ }
218
+ });
219
+ return prv;
220
+ }, "");
221
+ if (msg) {
222
+ return Promise.reject(new Error(msg));
223
+ }
224
+ return Promise.resolve();
225
+ }
226
+ }];
227
+ this.isCombinationComponent = true;
228
+ this.canSort = false;
229
+ this.children = (this.getNewTableHeader() || []).map(function (item) {
230
+ if (item.widget === "upload") {
231
+ return new BsHeaderPic(_objectSpread(_objectSpread({}, options), {}, {
232
+ name: item.title,
233
+ id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex)
234
+ }));
235
+ } else if (item.widget === "select") {
236
+ return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
237
+ name: item.title,
238
+ id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex),
239
+ transformValue: function transformValue(val) {
240
+ return _this.renderTransformItem(item, val);
241
+ },
242
+ renderExport: function renderExport(val) {
243
+ return _this.renderTransformItem(item, val);
244
+ }
245
+ }));
246
+ } else if (item.widget === "datePicker") {
247
+ return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
248
+ name: item.title,
249
+ id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex),
250
+ transformValue: function transformValue(val) {
251
+ return val ? moment(val).format("YYYY-MM-DD HH:mm:ss") : "";
252
+ },
253
+ renderExport: function renderExport(val) {
254
+ return val ? moment(val).format("YYYY-MM-DD HH:mm:ss") : "";
255
+ }
256
+ }));
257
+ } else {
258
+ return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
259
+ name: item.title,
260
+ id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex)
261
+ }));
262
+ }
263
+ });
264
+ this.dataType = "object";
265
+ this.expressDateInstance = ExpressData.getInstance();
266
+ console.log("componentConfig", this.componentConfig);
267
+ });
268
+ export default OrderSubForm;
@@ -31,6 +31,9 @@ var typeMap = {
31
31
  },
32
32
  EXECUTE_ACTION_TYPE: {
33
33
  key: "executeActionType"
34
+ },
35
+ ERP_ORDER_STATUS: {
36
+ key: "erpOrderStatus"
34
37
  }
35
38
  };
36
39
  var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
@@ -1,3 +1,3 @@
1
- import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption } from "./index";
1
+ import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption, OrderSubForm } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => ActualPayment | AfterSalesOrderId | BsGoods | BsLogistics | BsSystemOrder | BsE3Goods | BsE3Reissue | BuyerNick | BasicCascader | BasicCheckbox | CommonMultiStatus | CommonSystemOrder | ItemEnCode | BasicFile | FlowStatusSelect | FlowTag | FlowWorkOrderId | FlowWorkOrderStatus | GyGoods | GyReissue | GyReturn | BasicInput | JstItemSelect | JstSendGood | JstSupply | KmVideo | Label | Logistics | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | MemberLevel | MsgStatus | BasicMultSelect | BasicPicture | BasicPicturePro | BasicPosting | AsyncSelect | PublicExchange | PublicGoods | PublicReissueGoods | BasicRadio | ReceiverAddress | ReceiverName | ReissueLogistics | ERemark | BasicSelect | BasicSelectOption | ShopName | SkxGoods | SkxIdInputSelect | StatusSelect | SubForm | BasicTextArea | ThirdItemSelect | BasicDataTime | TradeDateTime | TradeId | BasicTypeInput | WdtShopSelect | WlnGoods | BasicAddress | BasicGrade | BasicRate | CommonDataTime | ReceiverMobile | ReturnLogistics | AliPay | ItemSelect | ItemId | SystemOrderNo | Ordinary | Payment | BsExchange | BsReissue | BsReturn | FlowMarkSelect | TemplateSelect | WorkOrderId | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | Calculation | NodeDeadLine | HandlerDeadLine | NodeStayDuration | BsPosting | NodeInput | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | BsSystemOrder | FlowTag | GyGoods | GyReissue | GyReturn | JstSendGood | MsgStatus | OrderSubForm | PublicGoods | BasicSelect | SkxGoods | SkxIdInputSelect | BasicInput | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelectOption | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsGoods | BsE3Goods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | AsyncSelect;
@@ -1,6 +1,6 @@
1
1
  import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect,
2
2
  // CommonTradeId,
3
- CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption } from "./index";
3
+ CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption, OrderSubForm } from "./index";
4
4
  export var factory = function factory(type, options) {
5
5
  var _options$componentCon;
6
6
  switch (type) {
@@ -34,6 +34,7 @@ export var factory = function factory(type, options) {
34
34
  case "ORDER_TYPE":
35
35
  case "REFUND_TYPE":
36
36
  case "EXECUTE_ACTION_TYPE":
37
+ case "ERP_ORDER_STATUS":
37
38
  return new BasicSelect(options);
38
39
  case "PICTURE":
39
40
  return new BasicPicture(options);
@@ -286,6 +287,8 @@ export var factory = function factory(type, options) {
286
287
  return new BasicTypeInput(options);
287
288
  case "SKX_GOODS":
288
289
  return new SkxGoods(options);
290
+ case "ORDER_SUBFORM":
291
+ return new OrderSubForm(options);
289
292
  default:
290
293
  return new BasicInput(options);
291
294
  }
@@ -100,6 +100,7 @@ export { default as GyReturn } from "./components/GY/GyReturn";
100
100
  export { default as AsyncSelect } from "./components/Public/AsyncSelect";
101
101
  export { default as SkxIdInputSelect } from "./components/SKX/SkxIdInputSelect";
102
102
  export { default as SkxGoods } from "./components/SKX/SkxGoods";
103
+ export { default as OrderSubForm } from "./components/OrderSubForm";
103
104
  export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
104
105
  export { factory } from "./factory";
105
106
  export { default as PlatformAvatar } from "./commonComponents/PlatformAvatar";
@@ -111,3 +112,4 @@ export { default as GetFormItem } from "./components/GetFormItem";
111
112
  export { default as Global } from "./commonComponents/GlobalContext";
112
113
  export * as ErpScenes from "./commonComponents/ErpContext";
113
114
  export * as servers from "./service/api";
115
+ export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
package/dist/esm/index.js CHANGED
@@ -100,6 +100,7 @@ export { default as GyReturn } from "./components/GY/GyReturn";
100
100
  export { default as AsyncSelect } from "./components/Public/AsyncSelect";
101
101
  export { default as SkxIdInputSelect } from "./components/SKX/SkxIdInputSelect";
102
102
  export { default as SkxGoods } from "./components/SKX/SkxGoods";
103
+ export { default as OrderSubForm } from "./components/OrderSubForm";
103
104
  // TODO: ERP 打款工单使用
104
105
  export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
105
106
  export { factory } from "./factory";
@@ -113,4 +114,5 @@ export { default as Global } from "./commonComponents/GlobalContext";
113
114
  import * as _ErpScenes from "./commonComponents/ErpContext";
114
115
  export { _ErpScenes as ErpScenes };
115
116
  import * as _servers from "./service/api";
116
- export { _servers as servers };
117
+ export { _servers as servers };
118
+ export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.3.0-rc.0",
3
+ "version": "2.5.0-rc.0",
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": "2.3.0-rc.0",
25
- "@kmkf-fe-packages/kmkf-utils": "2.3.0-rc.0",
24
+ "@kmkf-fe-packages/basic-components": "2.5.0-rc.0",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.5.0-rc.0",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "b9e1cb4129ec1a4874fbd5db7bc9f6d026badd2c",
44
+ "gitHead": "dd823f96804157434b7aee9febe5b37f9ab6bea7",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }