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

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.
@@ -14,7 +14,6 @@ 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
16
  var typeMap = {
17
- BUYER_MESSAGE_NOTICE: 'buyerMessageNotice',
18
17
  RADIO: 'radio'
19
18
  };
20
19
  var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
@@ -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) => BasicRadio | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsExchange | BsReissue | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
3
+ export declare const factory: (type: string, options: PickOption) => BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsExchange | BsReissue | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
@@ -24,6 +24,7 @@ export var factory = function factory(type, options) {
24
24
  case "DATETIME":
25
25
  return new BasicDataTime(options);
26
26
  case "SELECT":
27
+ case 'BUYER_MESSAGE_NOTICE':
27
28
  return new BasicSelect(options);
28
29
  case "PICTURE":
29
30
  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-alpha.1",
3
+ "version": "0.8.15-alpha.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "7dfa5c1a4e86ef9ab482cd3dd611eb41e7ac2400"
43
+ "gitHead": "df18be404ad2cdf504f587b5c375d980bff1f8f7"
44
44
  }