@kmkf-fe-packages/services-components 0.8.15 → 0.8.16-alpha.1

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.
@@ -10,7 +10,7 @@ declare class BasicRadio implements ComponentInterface {
10
10
  sortField: string;
11
11
  type: string;
12
12
  rules: any[];
13
- componentConfig: ComponentInterface["componentConfig"];
13
+ componentConfig: ComponentInterface['componentConfig'];
14
14
  isCombinationComponent: boolean;
15
15
  formField: string;
16
16
  canSort: boolean;
@@ -26,6 +26,7 @@ declare class BasicRadio implements ComponentInterface {
26
26
  other: any;
27
27
  };
28
28
  renderExport: (value: any, record: Record) => string;
29
+ getKeyByComponentType: (type: string) => any;
29
30
  renderClient: (record: Record) => React.JSX.Element | null;
30
31
  editRender: (p: any) => React.JSX.Element;
31
32
  filterConfig: (item: ColumnConfig) => {
@@ -13,6 +13,9 @@ import ItemView from "../../commonComponents/ItemView";
13
13
  import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
14
14
  import get from 'lodash/get';
15
15
  import { SYMBOL } from "../../constant";
16
+ var typeMap = {
17
+ RADIO: 'radio'
18
+ };
16
19
  var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
17
20
  var _this = this,
18
21
  _this$componentConfig3,
@@ -32,29 +35,36 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
32
35
  _defineProperty(this, "options", void 0);
33
36
  _defineProperty(this, "render", function (value) {
34
37
  var _value$value;
35
- return /*#__PURE__*/React.createElement("span", null, value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : value.value) && (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other) && "(".concat(value === null || value === void 0 ? void 0 : value.other, ")"));
38
+ return /*#__PURE__*/React.createElement("span", null, value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : value.value) && typeof value.value === 'string' && (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other) && "(".concat(value === null || value === void 0 ? void 0 : value.other, ")"));
36
39
  });
37
40
  _defineProperty(this, "renderPc", function (value, record) {
38
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined && (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]) === undefined) {
41
+ var type = _this.type;
42
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) === undefined && (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type], "Other")]) === undefined) {
39
43
  return /*#__PURE__*/React.createElement("span", null, "--");
40
44
  }
41
- return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]);
45
+ return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])], record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type], "Other")]);
42
46
  });
43
47
  _defineProperty(this, "renderLog", function (r) {
44
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radio")]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radioOther")])) return null;
48
+ var type = _this.type;
49
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type], "Other")])) return null;
45
50
  return _this.renderPc(undefined, r);
46
51
  });
47
52
  _defineProperty(this, "getComponentValue", function (r) {
53
+ var type = _this.type;
48
54
  return {
49
- value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radio")],
50
- other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radioOther")]
55
+ value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])],
56
+ other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type], "Other")]
51
57
  };
52
58
  });
53
59
  _defineProperty(this, "renderExport", function (value, record) {
54
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined) {
60
+ var type = _this.type;
61
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) === undefined) {
55
62
  return '--';
56
63
  }
57
- return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], " ").concat(get(record, "".concat(_this.id, "_radioOther"), ''));
64
+ return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])], " ").concat(get(record, "".concat(_this.id, "_").concat(typeMap[type], "Other"), ''));
65
+ });
66
+ _defineProperty(this, "getKeyByComponentType", function (type) {
67
+ return typeMap[type] || '';
58
68
  });
59
69
  _defineProperty(this, "renderClient", function (record) {
60
70
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -78,10 +88,11 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
78
88
  });
79
89
  _defineProperty(this, "filterConfig", function (item) {
80
90
  var _item$config, _item$config2, _item$config2$options, _item$config3;
91
+ var key = _this.getKeyByComponentType(item.type);
81
92
  return {
82
93
  searchDefaultConditions: SYMBOL.in,
83
94
  type: item.type,
84
- id: "".concat(item.id, "_radio"),
95
+ id: "".concat(item.id, "_").concat(key),
85
96
  // 过滤组件id
86
97
  name: item.name,
87
98
  // 过滤组件名称
@@ -94,7 +105,7 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
94
105
  },
95
106
  filterFn: function filterFn(value) {
96
107
  return function (i) {
97
- return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'radio'));
108
+ return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, key));
98
109
  };
99
110
  } // 第一个为选中值,第二个参数为表格行记录值
100
111
  };
@@ -107,8 +118,8 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
107
118
  this.type = options.type;
108
119
  this.isCombinationComponent = false;
109
120
  this.canSort = true;
110
- this.sortField = "".concat(options.id, "_radio");
111
- this.formField = "".concat(options.id, "_radio");
121
+ this.sortField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
122
+ this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
112
123
  this.children = [];
113
124
  this.componentConfig = options.componentConfig;
114
125
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
@@ -6,7 +6,7 @@ declare class BasicSelect implements ComponentInterface {
6
6
  sortField: string;
7
7
  type: string;
8
8
  rules: any[];
9
- componentConfig: ComponentInterface["componentConfig"];
9
+ componentConfig: ComponentInterface['componentConfig'];
10
10
  isCombinationComponent: boolean;
11
11
  formField: string;
12
12
  canSort: boolean;
@@ -14,6 +14,7 @@ declare class BasicSelect implements ComponentInterface {
14
14
  dataType: ComponentInterface['dataType'];
15
15
  options: ComponentInterface['options'];
16
16
  constructor(options: PickOption);
17
+ getKeyByComponentType: (type: string) => any;
17
18
  editRender: (p: any) => React.JSX.Element;
18
19
  renderClient: (record: any) => React.JSX.Element | null;
19
20
  renderPc: (value: any, record: Record) => React.JSX.Element;
@@ -12,6 +12,10 @@ import GetFormItem from "../GetFormItem";
12
12
  import ItemView from "../../commonComponents/ItemView";
13
13
  import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
14
14
  import { SYMBOL } from "../../constant";
15
+ var typeMap = {
16
+ BUYER_MESSAGE_NOTICE: 'buyerMessageNotice',
17
+ SELECT: 'select'
18
+ };
15
19
  var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
16
20
  var _this = this,
17
21
  _this$componentConfig3;
@@ -28,6 +32,9 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
28
32
  _defineProperty(this, "children", void 0);
29
33
  _defineProperty(this, "dataType", void 0);
30
34
  _defineProperty(this, "options", void 0);
35
+ _defineProperty(this, "getKeyByComponentType", function (type) {
36
+ return typeMap[type] || '';
37
+ });
31
38
  _defineProperty(this, "editRender", function (p) {
32
39
  var _this$componentConfig, _this$componentConfig2;
33
40
  return /*#__PURE__*/React.createElement(GetFormItem, {
@@ -52,25 +59,30 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
52
59
  });
53
60
  _defineProperty(this, "renderPc", function (value, record) {
54
61
  var _record;
55
- return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_select")]) !== null && _record !== void 0 ? _record : '--');
62
+ var type = _this.type;
63
+ return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record !== void 0 ? _record : '--');
56
64
  });
57
65
  _defineProperty(this, "renderLog", function (r) {
58
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_select")])) return null;
66
+ var type = _this.type;
67
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])])) return null;
59
68
  return _this.renderPc(undefined, r);
60
69
  });
61
70
  _defineProperty(this, "getComponentValue", function (r) {
62
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_select")];
71
+ var type = _this.type;
72
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])];
63
73
  });
64
74
  _defineProperty(this, "renderExport", function (value, record) {
65
75
  var _record2;
66
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_select")]) !== null && _record2 !== void 0 ? _record2 : '--';
76
+ var type = _this.type;
77
+ return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 : '--';
67
78
  });
68
79
  _defineProperty(this, "filterConfig", function (item) {
69
80
  var _item$config;
81
+ var key = _this.getKeyByComponentType(item.type);
70
82
  return {
71
83
  searchDefaultConditions: SYMBOL.in,
72
84
  type: item.type,
73
- id: "".concat(item.id, "_select"),
85
+ id: "".concat(item.id, "_").concat(key),
74
86
  // 过滤组件id
75
87
  name: item.name,
76
88
  // 过滤组件名称
@@ -80,15 +92,15 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
80
92
  },
81
93
  filterFn: function filterFn(value) {
82
94
  return function (i) {
83
- return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'select'));
95
+ return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, key));
84
96
  };
85
97
  } // 第一个为选中值,第二个参数为表格行记录值
86
98
  };
87
99
  });
88
100
  this.name = options.name;
89
101
  this.id = options.id;
90
- this.sortField = "".concat(options.id, "_select");
91
- this.formField = "".concat(options.id, "_select");
102
+ this.sortField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
103
+ this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
92
104
  this.type = options.type;
93
105
  this.componentConfig = options.componentConfig;
94
106
  this.rules = [];
@@ -1,3 +1,3 @@
1
1
  import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsExchange | BsGoods | BsReissue | JstLogistics | BasicPosting | BasicRadio | BasicSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSendGood | JstSupply | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
3
+ export declare const factory: (type: string, options: PickOption) => ActualPayment | BsExchange | BsGoods | BsReissue | BuyerNick | BasicCascader | ItemEnCode | ItemId | ItemSelect | ErpTradeId | BasicFile | FlowStatusSelect | FlowWorkOrderId | BasicInput | JstItemSelect | JstLogistics | JstSendGood | JstSupply | LogisticsTrajectory | Payment | BasicPicture | BasicPosting | BasicRadio | BasicRate | ReceiverAddress | ReceiverMobile | ReceiverName | BasicSelect | ThirdItemSelect | BasicDataTime | TradeDateTime | TradeId | WorkOrderId | BasicAddress | BasicCheckbox | BasicTextArea | BasicMultSelect | BasicGrade | CommonDataTime | ShopName | Logistics | ReturnLogistics | ERemark | AliPay | SystemOrderNo | Ordinary | TemplateSelect | LogisticsInterception | PlatForm | ShopInput | Submitter | Handler | CompletedUser;
@@ -23,6 +23,7 @@ export var factory = function factory(type, options) {
23
23
  case "DATETIME":
24
24
  return new BasicDataTime(options);
25
25
  case "SELECT":
26
+ case 'BUYER_MESSAGE_NOTICE':
26
27
  return new BasicSelect(options);
27
28
  case "PICTURE":
28
29
  return new BasicPicture(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.8.15",
3
+ "version": "0.8.16-alpha.1",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.8.9",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.8.9"
29
+ "@kmkf-fe-packages/basic-components": "^0.8.15-alpha.1",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.15-alpha.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@ant-design/icons": "^4.7.0",
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "ae567bf609056af8b9270ac03f39f2e52a9d6b5d"
43
+ "gitHead": "d9ecce8ad0928598c0c7de9cdbdfeeafeec8c121"
44
44
  }