@kmkf-fe-packages/services-components 0.8.9-alpha.9 → 0.8.13-alpha.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.
@@ -6,8 +6,9 @@ declare type Shop = {
6
6
  shopSource: string | number;
7
7
  };
8
8
  declare type ShopListProps = {
9
+ disabledList?: string[];
9
10
  shopList: Shop[];
10
11
  [prop: string]: any;
11
12
  };
12
- declare const ShopList: ({ shopList, valueMapping, onChange, setShopId, ...prop }: ShopListProps) => React.JSX.Element;
13
+ declare const ShopList: ({ disabledList, shopList, valueMapping, onChange, setShopId, ...prop }: ShopListProps) => React.JSX.Element;
13
14
  export default ShopList;
@@ -1,4 +1,4 @@
1
- var _excluded = ["shopList", "valueMapping", "onChange", "setShopId"];
1
+ var _excluded = ["disabledList", "shopList", "valueMapping", "onChange", "setShopId"];
2
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
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -8,7 +8,9 @@ import PlatformAvatar from "../PlatformAvatar";
8
8
  import { PlatData } from '@kmkf-fe-packages/kmkf-utils';
9
9
  var ShopList = function ShopList(_ref) {
10
10
  var _shopList$filter;
11
- var shopList = _ref.shopList,
11
+ var _ref$disabledList = _ref.disabledList,
12
+ disabledList = _ref$disabledList === void 0 ? [] : _ref$disabledList,
13
+ shopList = _ref.shopList,
12
14
  _ref$valueMapping = _ref.valueMapping,
13
15
  valueMapping = _ref$valueMapping === void 0 ? "shopId" : _ref$valueMapping,
14
16
  onChange = _ref.onChange,
@@ -29,6 +31,7 @@ var ShopList = function ShopList(_ref) {
29
31
  return plat.platformType === item.shopSource;
30
32
  });
31
33
  return /*#__PURE__*/React.createElement(Select.Option, {
34
+ disabled: item.disabled || disabledList.includes(item === null || item === void 0 ? void 0 : item[valueMapping]),
32
35
  value: item === null || item === void 0 ? void 0 : item[valueMapping],
33
36
  label: item.shopName
34
37
  }, /*#__PURE__*/React.createElement(PlatformAvatar, {
@@ -0,0 +1,38 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
2
+ import React from 'react';
3
+ declare class BuyerMessageNotice implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ type: string;
8
+ rules: any[];
9
+ componentConfig: ComponentInterface['componentConfig'];
10
+ isCombinationComponent: boolean;
11
+ formField: string;
12
+ canSort: boolean;
13
+ children: ComponentInterface[];
14
+ dataType: ComponentInterface['dataType'];
15
+ options: ComponentInterface['options'];
16
+ constructor(options: PickOption);
17
+ renderPc: (value: any, record: Record) => React.JSX.Element;
18
+ renderLog: (r: Record) => React.JSX.Element | null;
19
+ getComponentValue: (r: Record) => {
20
+ value: any;
21
+ };
22
+ renderExport: (value: any, record: Record) => string;
23
+ renderClient: (record: Record) => React.JSX.Element | null;
24
+ editRender: (p: any) => React.JSX.Element;
25
+ filterConfig: (item: ColumnConfig) => {
26
+ searchDefaultConditions: "in";
27
+ type: string;
28
+ id: string;
29
+ name: string;
30
+ filterComponentType: "MultipleSelect";
31
+ props: {
32
+ options: any[];
33
+ };
34
+ filterFn: (value: string) => (i: Record) => boolean;
35
+ };
36
+ formDataTransform: (v: string) => string;
37
+ }
38
+ export default BuyerMessageNotice;
@@ -0,0 +1,105 @@
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 _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
+ 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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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 { ApaasRadio } from '@kmkf-fe-packages/basic-components';
10
+ import GetFormItem from "../GetFormItem";
11
+ import ItemView from "../../commonComponents/ItemView";
12
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
13
+ import { SYMBOL } from "../../constant";
14
+ var BuyerMessageNotice = /*#__PURE__*/_createClass(function BuyerMessageNotice(options) {
15
+ var _this = this,
16
+ _this$componentConfig3;
17
+ _classCallCheck(this, BuyerMessageNotice);
18
+ _defineProperty(this, "name", void 0);
19
+ _defineProperty(this, "id", void 0);
20
+ _defineProperty(this, "sortField", void 0);
21
+ _defineProperty(this, "type", void 0);
22
+ _defineProperty(this, "rules", void 0);
23
+ _defineProperty(this, "componentConfig", void 0);
24
+ _defineProperty(this, "isCombinationComponent", void 0);
25
+ _defineProperty(this, "formField", void 0);
26
+ _defineProperty(this, "canSort", void 0);
27
+ _defineProperty(this, "children", void 0);
28
+ _defineProperty(this, "dataType", void 0);
29
+ _defineProperty(this, "options", void 0);
30
+ _defineProperty(this, "renderPc", function (value, record) {
31
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_buyerMessageNotice")]) === undefined) {
32
+ return /*#__PURE__*/React.createElement("span", null, "--");
33
+ }
34
+ return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_buyerMessageNotice")]);
35
+ });
36
+ _defineProperty(this, "renderLog", function (r) {
37
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_buyerMessageNotice")])) return null;
38
+ return _this.renderPc(undefined, r);
39
+ });
40
+ _defineProperty(this, "getComponentValue", function (r) {
41
+ return {
42
+ value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_buyerMessageNotice")]
43
+ };
44
+ });
45
+ _defineProperty(this, "renderExport", function (value, record) {
46
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_buyerMessageNotice")]) === undefined) {
47
+ return '--';
48
+ }
49
+ return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_buyerMessageNotice")]);
50
+ });
51
+ _defineProperty(this, "renderClient", function (record) {
52
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
53
+ id: _this.id,
54
+ label: _this.name,
55
+ value: (record === null || record === void 0 ? void 0 : record[_this.id]) || ''
56
+ }) : null;
57
+ });
58
+ _defineProperty(this, "editRender", function (p) {
59
+ var _this$componentConfig, _this$componentConfig2;
60
+ return /*#__PURE__*/React.createElement(GetFormItem, {
61
+ title: _this.name,
62
+ name: _this.id,
63
+ rules: _this.rules,
64
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
65
+ required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
66
+ component: /*#__PURE__*/React.createElement(ApaasRadio, _this.componentConfig)
67
+ });
68
+ });
69
+ _defineProperty(this, "filterConfig", function (item) {
70
+ var _item$config;
71
+ return {
72
+ searchDefaultConditions: SYMBOL.in,
73
+ type: item.type,
74
+ id: "".concat(item.id, "_buyerMessageNotice"),
75
+ // 过滤组件id
76
+ name: item.name,
77
+ // 过滤组件名称
78
+ filterComponentType: 'MultipleSelect',
79
+ props: {
80
+ options: (item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.options) || []
81
+ },
82
+ filterFn: function filterFn(value) {
83
+ return function (i) {
84
+ return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'buyerMessageNotice'));
85
+ };
86
+ } // 第一个为选中值,第二个参数为表格行记录值
87
+ };
88
+ });
89
+ _defineProperty(this, "formDataTransform", function (v) {
90
+ return v;
91
+ });
92
+ this.name = options.name;
93
+ this.id = options.id;
94
+ this.type = options.type;
95
+ this.isCombinationComponent = false;
96
+ this.canSort = true;
97
+ this.sortField = "".concat(options.id, "_buyerMessageNotice");
98
+ this.formField = "".concat(options.id, "_buyerMessageNotice");
99
+ this.children = [];
100
+ this.componentConfig = options.componentConfig;
101
+ this.rules = [];
102
+ this.dataType = 'string';
103
+ this.options = ((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.options) || [];
104
+ });
105
+ export default BuyerMessageNotice;
@@ -26,4 +26,5 @@ export declare const BsGoodsTable: ({ list, showHeader, text, }: {
26
26
  showHeader: string[];
27
27
  text?: string | undefined;
28
28
  }) => React.JSX.Element;
29
+ export declare const FileRender: ({ fileList }: any) => React.JSX.Element;
29
30
  export {};
@@ -8,9 +8,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
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
9
  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; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table } from "antd";
11
+ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message } from "antd";
12
12
  import React, { useState, useMemo } from "react";
13
13
  import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
14
+ import { CopyToClipboard } from "react-copy-to-clipboard";
14
15
  import styles from "./index.module.less";
15
16
  import defaultImg from "./img/default-img.png";
16
17
  export var getFormItem = function getFormItem(_ref) {
@@ -319,7 +320,7 @@ export var BsGoodsTable = function BsGoodsTable(_ref9) {
319
320
  title: "".concat(text, "\u540D\u79F0"),
320
321
  align: "center",
321
322
  ellipsis: true,
322
- width: 100
323
+ width: 200
323
324
  }, {
324
325
  dataIndex: "code",
325
326
  title: "".concat(text, "\u7F16\u7801"),
@@ -386,4 +387,84 @@ export var BsGoodsTable = function BsGoodsTable(_ref9) {
386
387
  emptyText: "暂无数据"
387
388
  }
388
389
  });
390
+ };
391
+ export var FileRender = function FileRender(_ref10) {
392
+ var _ref10$fileList = _ref10.fileList,
393
+ fileList = _ref10$fileList === void 0 ? [] : _ref10$fileList;
394
+ var _useState3 = useState(false),
395
+ _useState4 = _slicedToArray(_useState3, 2),
396
+ visible = _useState4[0],
397
+ setVisible = _useState4[1];
398
+ var _useState5 = useState(""),
399
+ _useState6 = _slicedToArray(_useState5, 2),
400
+ fileUrl = _useState6[0],
401
+ setFileUrl = _useState6[1];
402
+ var _useState7 = useState(""),
403
+ _useState8 = _slicedToArray(_useState7, 2),
404
+ fileType = _useState8[0],
405
+ setFileType = _useState8[1];
406
+ var _useState9 = useState(""),
407
+ _useState10 = _slicedToArray(_useState9, 2),
408
+ fileName = _useState10[0],
409
+ setFileName = _useState10[1];
410
+ var handleCancel = function handleCancel() {
411
+ setFileUrl("");
412
+ setFileName("");
413
+ setVisible(false);
414
+ };
415
+ var onPreview = function onPreview(file) {
416
+ var _file$url;
417
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split(".");
418
+ var fileType = fileArr[fileArr.length - 1];
419
+ if (["png", "jpg", "jpeg", "gif", "bmp", "svg"].includes(fileType.toLowerCase())) {
420
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
421
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
422
+ setFileType("pic");
423
+ setVisible(true);
424
+ } else if (["mp4", "avi", "mpeg", "asf", "mov", "3gp", "wmv", "rmvb"].includes(fileType.toLowerCase())) {
425
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
426
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
427
+ setFileType("video");
428
+ setVisible(true);
429
+ } else {
430
+ window.open(file === null || file === void 0 ? void 0 : file.url);
431
+ }
432
+ };
433
+ return /*#__PURE__*/React.createElement(React.Fragment, null, fileList.map(function (item) {
434
+ return /*#__PURE__*/React.createElement("div", {
435
+ style: {
436
+ color: "#1890ff",
437
+ cursor: "pointer"
438
+ },
439
+ onClick: function onClick() {
440
+ return onPreview(item);
441
+ }
442
+ }, item.name);
443
+ }), /*#__PURE__*/React.createElement(Modal, {
444
+ visible: visible,
445
+ title: fileName,
446
+ footer: null,
447
+ onCancel: handleCancel
448
+ }, /*#__PURE__*/React.createElement(CopyToClipboard, {
449
+ text: fileUrl,
450
+ onCopy: function onCopy() {
451
+ message.success("复制成功");
452
+ }
453
+ }, /*#__PURE__*/React.createElement(Button, {
454
+ type: "link"
455
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === "pic" ? /*#__PURE__*/React.createElement("img", {
456
+ alt: "example",
457
+ style: {
458
+ width: "100%"
459
+ },
460
+ src: fileUrl
461
+ }) : /*#__PURE__*/React.createElement("video", {
462
+ style: {
463
+ width: "100%",
464
+ height: "100%"
465
+ },
466
+ autoPlay: true,
467
+ controls: true,
468
+ src: fileUrl
469
+ })));
389
470
  };
@@ -17,6 +17,7 @@ import { ApaasUploadFile } from "@kmkf-fe-packages/basic-components";
17
17
  import GetFormItem from "../GetFormItem";
18
18
  import ItemView from "../../commonComponents/ItemView";
19
19
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
20
+ import { FileRender } from "../Common";
20
21
  var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
21
22
  var _this = this;
22
23
  _classCallCheck(this, BasicFile);
@@ -54,21 +55,14 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
54
55
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_file")];
55
56
  });
56
57
  _defineProperty(this, "renderClient", function (record) {
57
- var _record$id;
58
58
  var _this$id$split = _this.id.split("_"),
59
59
  _this$id$split2 = _slicedToArray(_this$id$split, 1),
60
60
  id = _this$id$split2[0];
61
61
  return !isNull(record === null || record === void 0 ? void 0 : record[id]) ? /*#__PURE__*/React.createElement(ItemView, {
62
62
  id: _this.id,
63
63
  label: _this.name,
64
- value: record === null || record === void 0 ? void 0 : (_record$id = record[id]) === null || _record$id === void 0 ? void 0 : _record$id.map(function (file) {
65
- return /*#__PURE__*/React.createElement("a", {
66
- href: file.url,
67
- target: "_blank",
68
- style: {
69
- display: "block"
70
- }
71
- }, file.name);
64
+ value: /*#__PURE__*/React.createElement(FileRender, {
65
+ fileList: record === null || record === void 0 ? void 0 : record[id]
72
66
  })
73
67
  }) : null;
74
68
  });
@@ -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) => {
@@ -1,4 +1,5 @@
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 _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); }
2
3
  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
4
  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
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -12,6 +13,10 @@ import ItemView from "../../commonComponents/ItemView";
12
13
  import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
13
14
  import get from 'lodash/get';
14
15
  import { SYMBOL } from "../../constant";
16
+ var typeMap = {
17
+ BUYER_MESSAGE_NOTICE: 'buyerMessageNotice',
18
+ RADIO: 'radio'
19
+ };
15
20
  var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
16
21
  var _this = this,
17
22
  _this$componentConfig3,
@@ -34,26 +39,33 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
34
39
  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, ")"));
35
40
  });
36
41
  _defineProperty(this, "renderPc", function (value, record) {
37
- 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) {
42
+ var type = _this.type;
43
+ 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) {
38
44
  return /*#__PURE__*/React.createElement("span", null, "--");
39
45
  }
40
- 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")]);
46
+ 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")]);
41
47
  });
42
48
  _defineProperty(this, "renderLog", function (r) {
43
- 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;
49
+ var type = _this.type;
50
+ 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;
44
51
  return _this.renderPc(undefined, r);
45
52
  });
46
53
  _defineProperty(this, "getComponentValue", function (r) {
54
+ var type = _this.type;
47
55
  return {
48
- value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radio")],
49
- other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radioOther")]
56
+ value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])],
57
+ other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type], "Other")]
50
58
  };
51
59
  });
52
60
  _defineProperty(this, "renderExport", function (value, record) {
53
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined) {
61
+ var type = _this.type;
62
+ if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) === undefined) {
54
63
  return '--';
55
64
  }
56
- return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], " ").concat(get(record, "".concat(_this.id, "_radioOther"), ''));
65
+ 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"), ''));
66
+ });
67
+ _defineProperty(this, "getKeyByComponentType", function (type) {
68
+ return typeMap[type] || '';
57
69
  });
58
70
  _defineProperty(this, "renderClient", function (record) {
59
71
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -70,15 +82,18 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
70
82
  rules: _this.rules,
71
83
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
72
84
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
73
- component: /*#__PURE__*/React.createElement(ApaasRadio, _this.componentConfig)
85
+ component: /*#__PURE__*/React.createElement(ApaasRadio, _extends({}, _this.componentConfig, {
86
+ onChange: p === null || p === void 0 ? void 0 : p.onChange
87
+ }))
74
88
  });
75
89
  });
76
90
  _defineProperty(this, "filterConfig", function (item) {
77
91
  var _item$config, _item$config2, _item$config2$options, _item$config3;
92
+ var key = _this.getKeyByComponentType(item.type);
78
93
  return {
79
94
  searchDefaultConditions: SYMBOL.in,
80
95
  type: item.type,
81
- id: "".concat(item.id, "_radio"),
96
+ id: "".concat(item.id, "_").concat(key),
82
97
  // 过滤组件id
83
98
  name: item.name,
84
99
  // 过滤组件名称
@@ -91,7 +106,7 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
91
106
  },
92
107
  filterFn: function filterFn(value) {
93
108
  return function (i) {
94
- return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'radio'));
109
+ return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, key));
95
110
  };
96
111
  } // 第一个为选中值,第二个参数为表格行记录值
97
112
  };
@@ -104,8 +119,8 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
104
119
  this.type = options.type;
105
120
  this.isCombinationComponent = false;
106
121
  this.canSort = true;
107
- this.sortField = "".concat(options.id, "_radio");
108
- this.formField = "".concat(options.id, "_radio");
122
+ this.sortField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
123
+ this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
109
124
  this.children = [];
110
125
  this.componentConfig = options.componentConfig;
111
126
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
@@ -38,7 +38,8 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
38
38
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
39
39
  component: /*#__PURE__*/React.createElement(ApaasSelect, _extends({}, _this.componentConfig, {
40
40
  placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
41
- showSearch: true
41
+ showSearch: true,
42
+ onChange: p === null || p === void 0 ? void 0 : p.onChange
42
43
  }))
43
44
  });
44
45
  });
@@ -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) => JstLogistics | JstSendGood | 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 | JstItemSelect | JstSupply | BsGoods | BsExchange | BsReissue | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
3
+ export declare const factory: (type: string, options: PickOption) => BsExchange | BsGoods | BsReissue | BasicFile | BasicPosting | BasicRadio | BasicSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | 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 | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
@@ -15,6 +15,7 @@ export var factory = function factory(type, options) {
15
15
  case "INPUT":
16
16
  return new BasicInput(options);
17
17
  case "RADIO":
18
+ case "BUYER_MESSAGE_NOTICE":
18
19
  return new BasicRadio(options);
19
20
  case "TEXTAREA":
20
21
  return new BasicTextArea(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.8.9-alpha.9",
3
+ "version": "0.8.13-alpha.0",
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-alpha.9",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.8.9-alpha.9"
29
+ "@kmkf-fe-packages/basic-components": "^0.8.13-alpha.0",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.13-alpha.0"
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": "a124d8ebee858486ada1ce09bc0601de9c5e2962"
43
+ "gitHead": "9ff89895b9babf0bc9e6b4d195bca2e05a1746e5"
44
44
  }