@kmkf-fe-packages/services-components 2.0.19-beta.65 → 2.0.19-beta.66

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,5 +1,5 @@
1
- import { ComponentInterface, PickOption, Record } from "../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, Record } from '../../type';
2
+ import React from 'react';
3
3
  declare type Value = string[] | undefined;
4
4
  declare class BasicPicture implements ComponentInterface {
5
5
  name: string;
@@ -7,13 +7,13 @@ declare class BasicPicture implements ComponentInterface {
7
7
  sortField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface["componentConfig"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
16
- currenEnv: ComponentInterface["platform"];
15
+ dataType: ComponentInterface['dataType'];
16
+ currenEnv: ComponentInterface['platform'];
17
17
  constructor(options: PickOption);
18
18
  formatPictures: (pictures: string) => string[];
19
19
  render: (value: Value) => React.JSX.Element | null;
@@ -6,14 +6,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
6
6
  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; }
7
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
8
  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); }
9
- import React from "react";
10
- import { Image } from "antd";
11
- import { ApaasUploadAsync, ApaasUpload } from "@kmkf-fe-packages/basic-components";
12
- import { imgResize } from "@kmkf-fe-packages/kmkf-utils";
9
+ import React from 'react';
10
+ import { Image } from 'antd';
11
+ import { ApaasUploadAsync, ApaasUpload } from '@kmkf-fe-packages/basic-components';
12
+ import { imgResize } from '@kmkf-fe-packages/kmkf-utils';
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import ItemView from "../../commonComponents/ItemView";
15
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
- var hostUrl = "https://kefu.kuaimai.com";
15
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
16
+ import { hostUrl } from "../../constant";
17
17
  var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
18
18
  var _this = this,
19
19
  _options$effects;
@@ -31,9 +31,9 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
31
31
  _defineProperty(this, "dataType", void 0);
32
32
  _defineProperty(this, "currenEnv", void 0);
33
33
  _defineProperty(this, "formatPictures", function (pictures) {
34
- pictures = pictures.replace(/[\[\]]/g, "");
35
- pictures = pictures.replace(/\s/g, "");
36
- return pictures ? pictures.split(",") : [];
34
+ pictures = pictures.replace(/[\[\]]/g, '');
35
+ pictures = pictures.replace(/\s/g, '');
36
+ return pictures ? pictures.split(',') : [];
37
37
  });
38
38
  _defineProperty(this, "render", function (value) {
39
39
  var _document;
@@ -41,20 +41,20 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
41
41
  return null;
42
42
  }
43
43
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Image.PreviewGroup, {
44
- preview: _this.currenEnv === "ks" ? {
45
- getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById("root")
44
+ preview: _this.currenEnv === 'ks' ? {
45
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
46
46
  } : true
47
47
  }, value === null || value === void 0 ? void 0 : value.map(function (pic) {
48
48
  return /*#__PURE__*/React.createElement("div", {
49
49
  style: {
50
- marginRight: "5px",
51
- display: "inline-block"
50
+ marginRight: '5px',
51
+ display: 'inline-block'
52
52
  }
53
53
  }, /*#__PURE__*/React.createElement(Image, {
54
54
  width: 32,
55
- src: imgResize(pic || ""),
55
+ src: imgResize(pic || ''),
56
56
  preview: {
57
- src: imgResize(pic || "", 0, 0)
57
+ src: imgResize(pic || '', 0, 0)
58
58
  }
59
59
  }));
60
60
  })));
@@ -69,8 +69,8 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
69
69
  return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, finalPictures === null || finalPictures === void 0 ? void 0 : finalPictures.map(function (pic) {
70
70
  return /*#__PURE__*/React.createElement("div", {
71
71
  style: {
72
- marginRight: "5px",
73
- display: "inline-block"
72
+ marginRight: '5px',
73
+ display: 'inline-block'
74
74
  },
75
75
  onClick: function onClick(e) {
76
76
  return e.stopPropagation();
@@ -107,7 +107,7 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
107
107
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
108
108
  display: p === null || p === void 0 ? void 0 : p.display,
109
109
  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,
110
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
110
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
111
111
  component: (_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.isSingleShop ? /*#__PURE__*/React.createElement(ApaasUpload, _this.componentConfig) : /*#__PURE__*/React.createElement(ApaasUploadAsync, _extends({}, _this.componentConfig, {
112
112
  uniqueKey: _this.id,
113
113
  hostUrl: hostUrl,
@@ -131,7 +131,7 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
131
131
  this.isCombinationComponent = false;
132
132
  this.canSort = true;
133
133
  this.children = [];
134
- this.dataType = "string";
134
+ this.dataType = 'string';
135
135
  this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
136
136
  });
137
137
  export default BasicPicture;
@@ -0,0 +1,30 @@
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../type';
2
+ import React from 'react';
3
+ declare class PictureName implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ type: string;
8
+ componentConfig: ComponentInterface['componentConfig'];
9
+ align: ALignType;
10
+ width: number;
11
+ isCombinationComponent: boolean;
12
+ formField: string;
13
+ canSort: boolean;
14
+ children: ComponentInterface[];
15
+ dataType: ComponentInterface['dataType'];
16
+ parentName?: string;
17
+ transformValue: (val: any, record?: any, parentName?: string) => any;
18
+ export: (val: any, record?: any, parentName?: string) => any;
19
+ constructor(options: PickOption);
20
+ getParentId: () => string;
21
+ renderClient: (record: any) => React.JSX.Element | null;
22
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
23
+ renderLog: (r: Record) => React.JSX.Element | null;
24
+ getComponentValue: (r: Record) => any;
25
+ getComponentExport: (r: Record) => any;
26
+ renderExport: (value: string, record: Record) => any;
27
+ editRender: () => null;
28
+ filterConfig: () => never[];
29
+ }
30
+ export default PictureName;
@@ -0,0 +1,132 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _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); }
5
+ 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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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';
15
+ import { Space } from 'antd';
16
+ import ItemView from "../../commonComponents/ItemView";
17
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
18
+ import { DownloadOutlined } from '@ant-design/icons';
19
+ import { hostUrl } from "../../constant";
20
+ var PictureName = /*#__PURE__*/_createClass(function PictureName(options) {
21
+ var _this = this;
22
+ _classCallCheck(this, PictureName);
23
+ _defineProperty(this, "name", void 0);
24
+ _defineProperty(this, "id", void 0);
25
+ _defineProperty(this, "sortField", void 0);
26
+ _defineProperty(this, "type", void 0);
27
+ _defineProperty(this, "componentConfig", void 0);
28
+ _defineProperty(this, "align", void 0);
29
+ _defineProperty(this, "width", void 0);
30
+ _defineProperty(this, "isCombinationComponent", void 0);
31
+ _defineProperty(this, "formField", void 0);
32
+ _defineProperty(this, "canSort", void 0);
33
+ _defineProperty(this, "children", void 0);
34
+ _defineProperty(this, "dataType", void 0);
35
+ _defineProperty(this, "parentName", void 0);
36
+ _defineProperty(this, "transformValue", function (val) {
37
+ return val;
38
+ });
39
+ _defineProperty(this, "export", function (val) {
40
+ return val;
41
+ });
42
+ _defineProperty(this, "getParentId", function () {
43
+ var _this$id$split = _this.id.split('_'),
44
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
45
+ key = _this$id$split2[0],
46
+ name = _this$id$split2[1],
47
+ code = _this$id$split2[2];
48
+ return "".concat(key, "_").concat(name);
49
+ });
50
+ _defineProperty(this, "renderClient", function (record) {
51
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
52
+ id: _this.id,
53
+ label: _this.name,
54
+ value: _this.getComponentValue(record)
55
+ }) : null;
56
+ });
57
+ _defineProperty(this, "renderPc", function (value, record) {
58
+ var fileName = _this.getComponentValue(record);
59
+ var parentId = _this.getParentId();
60
+ var picUrl = "".concat(hostUrl, "/").concat(record === null || record === void 0 ? void 0 : record["".concat(parentId, "_url")]);
61
+ var downloadHandle = function downloadHandle(e) {
62
+ e.stopPropagation();
63
+ try {
64
+ fetch(picUrl).then(function (res) {
65
+ return res.blob();
66
+ }).then(function (blob) {
67
+ var a = document.createElement('a');
68
+ document.body.appendChild(a);
69
+ a.style.display = 'none';
70
+ var url = window.URL.createObjectURL(blob);
71
+ a.href = url;
72
+ a.download = fileName;
73
+ a.click();
74
+ document.body.removeChild(a);
75
+ window.URL.revokeObjectURL(url);
76
+ });
77
+ } catch (error) {
78
+ console.error(error);
79
+ }
80
+ };
81
+ return /*#__PURE__*/React.createElement(Space, {
82
+ className: "pictruePc"
83
+ }, /*#__PURE__*/React.createElement(DownloadOutlined, {
84
+ onClick: downloadHandle,
85
+ className: "downloadIcon"
86
+ }), /*#__PURE__*/React.createElement("div", null, fileName !== null && fileName !== void 0 ? fileName : '--'));
87
+ });
88
+ _defineProperty(this, "renderLog", function (r) {
89
+ var id = _this.getParentId();
90
+ if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
91
+ return _this.renderPc(undefined, r);
92
+ });
93
+ _defineProperty(this, "getComponentValue", function (r) {
94
+ return _this.transformValue(r === null || r === void 0 ? void 0 : r[_this.id], r, _this.parentName);
95
+ });
96
+ _defineProperty(this, "getComponentExport", function (r) {
97
+ return _this.export(r === null || r === void 0 ? void 0 : r[_this.id], r, _this.parentName);
98
+ });
99
+ _defineProperty(this, "renderExport", function (value, record) {
100
+ var _this$getComponentExp;
101
+ var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : '--';
102
+ return typeof val === 'number' ? val + '' : val;
103
+ });
104
+ _defineProperty(this, "editRender", function () {
105
+ return null;
106
+ });
107
+ _defineProperty(this, "filterConfig", function () {
108
+ return [];
109
+ });
110
+ this.name = options.name;
111
+ this.id = options.id;
112
+ this.sortField = options.id;
113
+ this.formField = options.id;
114
+ this.type = options.type;
115
+ if (options.parentName) {
116
+ this.parentName = options.parentName;
117
+ }
118
+ this.componentConfig = options.componentConfig;
119
+ this.align = 'left';
120
+ this.width = (options === null || options === void 0 ? void 0 : options.width) || 100;
121
+ this.isCombinationComponent = false;
122
+ this.canSort = false;
123
+ this.dataType = 'string';
124
+ this.children = [];
125
+ if (options.transformValue) {
126
+ this.transformValue = options.transformValue;
127
+ }
128
+ if (options.renderExport) {
129
+ this.export = options.renderExport;
130
+ }
131
+ });
132
+ export default PictureName;
@@ -1,30 +1,26 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from "../../type";
2
- import React from "react";
3
- declare class BsHeaderChild implements ComponentInterface {
1
+ /// <reference types="react" />
2
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../type';
3
+ declare class PictureUrl 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"];
16
- parentName?: string;
17
- transformValue: (val: any, record?: any, parentName?: string) => any;
18
- export: (val: any, record?: any, parentName?: string) => any;
15
+ dataType: ComponentInterface['dataType'];
19
16
  constructor(options: PickOption);
20
17
  getParentId: () => string;
21
- renderClient: (record: any) => React.JSX.Element | null;
22
- renderPc: (value: unknown, record: Record) => React.JSX.Element;
23
- renderLog: (r: Record) => React.JSX.Element | null;
18
+ renderClient: (record: any) => import("react").JSX.Element | null;
19
+ renderPc: (value: unknown, record: Record) => import("react").JSX.Element;
20
+ renderLog: () => null;
24
21
  getComponentValue: (r: Record) => any;
25
- getComponentExport: (r: Record) => any;
26
- renderExport: (value: string, record: Record) => any;
22
+ renderExport: () => null;
27
23
  editRender: () => null;
28
24
  filterConfig: () => never[];
29
25
  }
30
- export default BsHeaderChild;
26
+ export default PictureUrl;
@@ -11,15 +11,13 @@ 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";
15
- import { Space } from "antd";
14
+ import { Image } from 'antd';
16
15
  import ItemView from "../../commonComponents/ItemView";
17
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
18
- import { DownloadOutlined } from "@ant-design/icons";
19
- var hostUrl = "https://kefu.kuaimai.com";
20
- var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { hostUrl } from "../../constant";
18
+ var PictureUrl = /*#__PURE__*/_createClass(function PictureUrl(options) {
21
19
  var _this = this;
22
- _classCallCheck(this, BsHeaderChild);
20
+ _classCallCheck(this, PictureUrl);
23
21
  _defineProperty(this, "name", void 0);
24
22
  _defineProperty(this, "id", void 0);
25
23
  _defineProperty(this, "sortField", void 0);
@@ -32,15 +30,8 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
32
30
  _defineProperty(this, "canSort", void 0);
33
31
  _defineProperty(this, "children", void 0);
34
32
  _defineProperty(this, "dataType", void 0);
35
- _defineProperty(this, "parentName", void 0);
36
- _defineProperty(this, "transformValue", function (val) {
37
- return val;
38
- });
39
- _defineProperty(this, "export", function (val) {
40
- return val;
41
- });
42
33
  _defineProperty(this, "getParentId", function () {
43
- var _this$id$split = _this.id.split("_"),
34
+ var _this$id$split = _this.id.split('_'),
44
35
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
45
36
  key = _this$id$split2[0],
46
37
  name = _this$id$split2[1],
@@ -55,51 +46,27 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
55
46
  }) : null;
56
47
  });
57
48
  _defineProperty(this, "renderPc", function (value, record) {
58
- var fileName = _this.getComponentValue(record);
59
- var parentId = _this.getParentId();
60
- var picUrl = "".concat(hostUrl, "/").concat(record === null || record === void 0 ? void 0 : record["".concat(parentId, "_url")]);
61
- var downloadHandle = function downloadHandle(e) {
62
- e.stopPropagation();
63
- try {
64
- fetch(picUrl).then(function (res) {
65
- return res.blob();
66
- }).then(function (blob) {
67
- var a = document.createElement("a");
68
- document.body.appendChild(a);
69
- a.style.display = "none";
70
- var url = window.URL.createObjectURL(blob);
71
- a.href = url;
72
- a.download = fileName;
73
- a.click();
74
- document.body.removeChild(a);
75
- window.URL.revokeObjectURL(url);
76
- });
77
- } catch (error) {
78
- console.error(error);
49
+ var finalImage = "".concat(hostUrl, "/").concat(_this.getComponentValue(record));
50
+ return /*#__PURE__*/React.createElement("span", {
51
+ onClick: function onClick(e) {
52
+ return e.stopPropagation();
53
+ }
54
+ }, /*#__PURE__*/React.createElement(Image, {
55
+ width: 40,
56
+ src: "".concat(finalImage, "?x-oss-process=image/resize,m_pad,h_40,w_40"),
57
+ preview: {
58
+ src: finalImage
79
59
  }
80
- };
81
- return /*#__PURE__*/React.createElement(Space, {
82
- className: "pictruePc"
83
- }, /*#__PURE__*/React.createElement(DownloadOutlined, {
84
- onClick: downloadHandle,
85
- className: "downloadIcon"
86
- }), /*#__PURE__*/React.createElement("div", null, fileName !== null && fileName !== void 0 ? fileName : "--"));
60
+ }));
87
61
  });
88
- _defineProperty(this, "renderLog", function (r) {
89
- var id = _this.getParentId();
90
- if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
91
- return _this.renderPc(undefined, r);
62
+ _defineProperty(this, "renderLog", function () {
63
+ return null;
92
64
  });
93
65
  _defineProperty(this, "getComponentValue", function (r) {
94
- return _this.transformValue(r === null || r === void 0 ? void 0 : r[_this.id], r, _this.parentName);
95
- });
96
- _defineProperty(this, "getComponentExport", function (r) {
97
- return _this.export(r === null || r === void 0 ? void 0 : r[_this.id], r, _this.parentName);
66
+ return r === null || r === void 0 ? void 0 : r[_this.id];
98
67
  });
99
- _defineProperty(this, "renderExport", function (value, record) {
100
- var _this$getComponentExp;
101
- var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : "--";
102
- return typeof val === "number" ? val + "" : val;
68
+ _defineProperty(this, "renderExport", function () {
69
+ return null;
103
70
  });
104
71
  _defineProperty(this, "editRender", function () {
105
72
  return null;
@@ -112,21 +79,12 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
112
79
  this.sortField = options.id;
113
80
  this.formField = options.id;
114
81
  this.type = options.type;
115
- if (options.parentName) {
116
- this.parentName = options.parentName;
117
- }
118
82
  this.componentConfig = options.componentConfig;
119
- this.align = "left";
120
- this.width = (options === null || options === void 0 ? void 0 : options.width) || 100;
83
+ this.align = 'left';
84
+ this.width = 100;
121
85
  this.isCombinationComponent = false;
122
86
  this.canSort = false;
123
- this.dataType = "string";
87
+ this.dataType = 'string';
124
88
  this.children = [];
125
- if (options.transformValue) {
126
- this.transformValue = options.transformValue;
127
- }
128
- if (options.renderExport) {
129
- this.export = options.renderExport;
130
- }
131
89
  });
132
- export default BsHeaderChild;
90
+ export default PictureUrl;
@@ -1,6 +1,6 @@
1
- import { ComponentInterface, PickOption, Record } from "../../type";
2
- import React from "react";
3
- import "./index.less";
1
+ import { ComponentInterface, PickOption, Record } from '../../type';
2
+ import React from 'react';
3
+ import './index.less';
4
4
  declare type Value = {
5
5
  url: string;
6
6
  name: string;
@@ -11,13 +11,13 @@ declare class BasicPicturePro implements ComponentInterface {
11
11
  sortField: string;
12
12
  type: string;
13
13
  rules: any[];
14
- componentConfig: ComponentInterface["componentConfig"];
14
+ componentConfig: ComponentInterface['componentConfig'];
15
15
  isCombinationComponent: boolean;
16
16
  formField: string;
17
17
  canSort: boolean;
18
18
  children: ComponentInterface[];
19
- dataType: ComponentInterface["dataType"];
20
- currenEnv: ComponentInterface["platform"];
19
+ dataType: ComponentInterface['dataType'];
20
+ currenEnv: ComponentInterface['platform'];
21
21
  constructor(options: PickOption);
22
22
  formatPictures: (pictures: string) => string[];
23
23
  render: (value: Value) => React.JSX.Element | null;
@@ -8,18 +8,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  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; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
10
  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); }
11
- import React from "react";
12
- import { ApaasUploadProAsync } from "@kmkf-fe-packages/basic-components";
11
+ import React from 'react';
12
+ import { ApaasUploadProAsync } from '@kmkf-fe-packages/basic-components';
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import ItemView from "../../commonComponents/ItemView";
15
+ import PictureName from "./PictureName";
15
16
  import PictureUrl from "./PictureUrl";
16
- import BsHeaderPic from "../BS/common/BsHeaderPic";
17
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
18
18
  import "./index.less";
19
- import { Image, Tooltip, message } from "antd";
20
- import { DownloadOutlined, CopyOutlined } from "@ant-design/icons";
21
- import copy from "copy-to-clipboard";
22
- var hostUrl = "https://kefu.kuaimai.com";
19
+ import { Image, Tooltip, message } from 'antd';
20
+ import { DownloadOutlined, CopyOutlined } from '@ant-design/icons';
21
+ import copy from 'copy-to-clipboard';
22
+ import { hostUrl } from "../../constant";
23
23
  var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options) {
24
24
  var _this = this,
25
25
  _options$effects;
@@ -37,9 +37,9 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
37
37
  _defineProperty(this, "dataType", void 0);
38
38
  _defineProperty(this, "currenEnv", void 0);
39
39
  _defineProperty(this, "formatPictures", function (pictures) {
40
- pictures = pictures.replace(/[\[\]]/g, "");
41
- pictures = pictures.replace(/\s/g, "");
42
- return pictures ? pictures.split(",") : [];
40
+ pictures = pictures.replace(/[\[\]]/g, '');
41
+ pictures = pictures.replace(/\s/g, '');
42
+ return pictures ? pictures.split(',') : [];
43
43
  });
44
44
  _defineProperty(this, "render", function (value) {
45
45
  var _document;
@@ -48,29 +48,29 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
48
48
  }
49
49
  var copyText = value.map(function (item) {
50
50
  return item.name;
51
- }).join(",");
51
+ }).join(',');
52
52
  var onCopy = function onCopy() {
53
53
  copy(copyText);
54
- message.success("图片名称复制成功");
54
+ message.success('图片名称复制成功');
55
55
  };
56
56
  return /*#__PURE__*/React.createElement("div", {
57
57
  className: "pictureProClient"
58
58
  }, /*#__PURE__*/React.createElement(Image.PreviewGroup, {
59
- preview: _this.currenEnv === "ks" ? {
60
- getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById("root")
59
+ preview: _this.currenEnv === 'ks' ? {
60
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
61
61
  } : true
62
62
  }, value.map(function (item) {
63
63
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(item.url) ? "".concat(hostUrl, "/").concat(item.url) : item.url, "?x-oss-process=image/resize,h_60,w_60");
64
64
  var showImage = /^pic\/[\s\S]*$/.test(item.url) ? "".concat(hostUrl, "/").concat(item.url) : item.url;
65
65
  var downloadHandle = function downloadHandle() {
66
- if (_this.currenEnv === "pc") {
66
+ if (_this.currenEnv === 'pc') {
67
67
  try {
68
68
  fetch("".concat(hostUrl, "/").concat(item.url)).then(function (res) {
69
69
  return res.blob();
70
70
  }).then(function (blob) {
71
- var a = document.createElement("a");
71
+ var a = document.createElement('a');
72
72
  document.body.appendChild(a);
73
- a.style.display = "none";
73
+ a.style.display = 'none';
74
74
  var url = window.URL.createObjectURL(blob);
75
75
  a.href = url;
76
76
  a.download = item.name;
@@ -83,7 +83,7 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
83
83
  }
84
84
  } else {
85
85
  copy(item.url);
86
- message.success("图片链接复制成功");
86
+ message.success('图片链接复制成功');
87
87
  }
88
88
  };
89
89
  return /*#__PURE__*/React.createElement("div", {
@@ -96,15 +96,15 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
96
96
  preview: {
97
97
  src: showImage
98
98
  },
99
- width: "100%",
100
- height: "100%"
99
+ width: '100%',
100
+ height: '100%'
101
101
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
102
102
  title: item.name
103
103
  }, /*#__PURE__*/React.createElement("div", {
104
104
  className: "pictureProText"
105
105
  }, item.name)), /*#__PURE__*/React.createElement("div", {
106
106
  className: "pictureProOperate"
107
- }, _this.currenEnv === "pc" ? /*#__PURE__*/React.createElement(DownloadOutlined, {
107
+ }, _this.currenEnv === 'pc' ? /*#__PURE__*/React.createElement(DownloadOutlined, {
108
108
  className: "downloadIcon",
109
109
  onClick: downloadHandle
110
110
  }) : /*#__PURE__*/React.createElement(CopyOutlined, {
@@ -142,7 +142,7 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
142
142
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
143
143
  display: p === null || p === void 0 ? void 0 : p.display,
144
144
  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,
145
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
145
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
146
146
  component: /*#__PURE__*/React.createElement(ApaasUploadProAsync, _extends({}, _this.componentConfig, {
147
147
  uniqueKey: _this.id,
148
148
  hostUrl: hostUrl,
@@ -165,16 +165,16 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
165
165
  this.rules = [];
166
166
  this.isCombinationComponent = true;
167
167
  this.canSort = true;
168
- this.children = [new PictureUrl(_objectSpread(_objectSpread({}, options), {}, {
169
- name: "图片名称",
168
+ this.children = [new PictureName(_objectSpread(_objectSpread({}, options), {}, {
169
+ name: '图片名称',
170
170
  id: "".concat(options.id, "_pictureProList_name"),
171
171
  width: 250
172
- })), new BsHeaderPic(_objectSpread(_objectSpread({}, options), {}, {
173
- name: "图片详情",
172
+ })), new PictureUrl(_objectSpread(_objectSpread({}, options), {}, {
173
+ name: '图片详情',
174
174
  id: "".concat(options.id, "_pictureProList_url"),
175
175
  width: 200
176
176
  }))];
177
- this.dataType = "object";
177
+ this.dataType = 'object';
178
178
  this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
179
179
  });
180
180
  export default BasicPicturePro;
@@ -13,3 +13,4 @@ export declare const SYMBOL: {
13
13
  notnull: string;
14
14
  };
15
15
  export declare const batchInput: (val: string) => string | string[];
16
+ export declare const hostUrl = "https://kefu.kuaimai.com";
@@ -1,16 +1,16 @@
1
1
  export var SYMBOL = {
2
- between: "between",
3
- eq: "eq",
4
- like: "like",
5
- gt: "gt",
6
- gte: "gte",
7
- lt: "lt",
8
- lte: "lte",
9
- ne: "ne",
10
- in: "in",
11
- nin: "nin",
12
- non: "non",
13
- notnull: "notnull"
2
+ between: 'between',
3
+ eq: 'eq',
4
+ like: 'like',
5
+ gt: 'gt',
6
+ gte: 'gte',
7
+ lt: 'lt',
8
+ lte: 'lte',
9
+ ne: 'ne',
10
+ in: 'in',
11
+ nin: 'nin',
12
+ non: 'non',
13
+ notnull: 'notnull'
14
14
  };
15
15
  export var batchInput = function batchInput(val) {
16
16
  return val ? val.split(/[,|,|\s|\n|\rn]/).filter(function (t) {
@@ -18,4 +18,5 @@ export var batchInput = function batchInput(val) {
18
18
  }).map(function (t) {
19
19
  return t.trim();
20
20
  }) : val;
21
- };
21
+ };
22
+ export var hostUrl = 'https://kefu.kuaimai.com';
@@ -1,3 +1,3 @@
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, 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 } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => JstSendGood | MsgStatus | BasicPicturePro | BasicSelect | StatusSelect | BasicDataTime | TradeDateTime | TradeId | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn;
3
+ export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AfterSalesOrderId | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BsE3Goods | BsE3Reissue | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonDataTime | CommonInput | CommonMultiStatus | CommonSystemOrder | CompletedUser | BasicDataTime | ItemEnCode | ItemId | ItemSelect | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | TradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ERemark | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSendGood | JstSupply | PublicGoods | PublicReissueGoods | PublicExchange | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | FlowWorkOrderId | StatusSelect | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | PaymentVoucherCode | Label | MemberLevel | GyGoods | GyReissue | GyReturn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.0.19-beta.65",
3
+ "version": "2.0.19-beta.66",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "96311b7d9394507c63970bc1e5f0685cf1e1411b",
44
+ "gitHead": "ed4a0b9769f05b3d69064dc80c4b54e4d123c714",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }