@kmkf-fe-packages/services-components 2.0.19-beta.60 → 2.0.19-beta.61
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.
- package/dist/esm/components/BS/common/BsHeaderChild.d.ts +4 -4
- package/dist/esm/components/BS/common/BsHeaderChild.js +8 -10
- package/dist/esm/components/Common/index.module.less +0 -50
- package/dist/esm/components/PicturePro/PictureUrl.d.ts +30 -0
- package/dist/esm/components/PicturePro/PictureUrl.js +132 -0
- package/dist/esm/components/PicturePro/index.d.ts +1 -0
- package/dist/esm/components/PicturePro/index.js +74 -10
- package/dist/esm/components/PicturePro/index.less +63 -0
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/type.d.ts +14 -14
- package/package.json +3 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ALignType, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class BsHeaderChild implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
|
-
componentConfig: ComponentInterface[
|
|
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[
|
|
15
|
+
dataType: ComponentInterface['dataType'];
|
|
16
16
|
parentName?: string;
|
|
17
17
|
transformValue: (val: any, record?: any, parentName?: string) => any;
|
|
18
18
|
export: (val: any, record?: any, parentName?: string) => any;
|
|
@@ -11,9 +11,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
13
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
-
import React from
|
|
14
|
+
import React from 'react';
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
-
import { isNull } from
|
|
16
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
17
|
var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
18
18
|
var _this = this;
|
|
19
19
|
_classCallCheck(this, BsHeaderChild);
|
|
@@ -37,7 +37,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
|
37
37
|
return val;
|
|
38
38
|
});
|
|
39
39
|
_defineProperty(this, "getParentId", function () {
|
|
40
|
-
var _this$id$split = _this.id.split(
|
|
40
|
+
var _this$id$split = _this.id.split('_'),
|
|
41
41
|
_this$id$split2 = _slicedToArray(_this$id$split, 3),
|
|
42
42
|
key = _this$id$split2[0],
|
|
43
43
|
name = _this$id$split2[1],
|
|
@@ -53,7 +53,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
|
53
53
|
});
|
|
54
54
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
55
55
|
var _this$getComponentVal;
|
|
56
|
-
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal :
|
|
56
|
+
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
|
|
57
57
|
});
|
|
58
58
|
_defineProperty(this, "renderLog", function (r) {
|
|
59
59
|
var id = _this.getParentId();
|
|
@@ -68,8 +68,8 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
|
68
68
|
});
|
|
69
69
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
70
70
|
var _this$getComponentExp;
|
|
71
|
-
var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp :
|
|
72
|
-
return typeof val ===
|
|
71
|
+
var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : '--';
|
|
72
|
+
return typeof val === 'number' ? val + '' : val;
|
|
73
73
|
});
|
|
74
74
|
_defineProperty(this, "editRender", function () {
|
|
75
75
|
return null;
|
|
@@ -86,11 +86,11 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
|
86
86
|
this.parentName = options.parentName;
|
|
87
87
|
}
|
|
88
88
|
this.componentConfig = options.componentConfig;
|
|
89
|
-
this.align =
|
|
89
|
+
this.align = 'left';
|
|
90
90
|
this.width = (options === null || options === void 0 ? void 0 : options.width) || 100;
|
|
91
91
|
this.isCombinationComponent = false;
|
|
92
92
|
this.canSort = false;
|
|
93
|
-
this.dataType =
|
|
93
|
+
this.dataType = 'string';
|
|
94
94
|
this.children = [];
|
|
95
95
|
if (options.transformValue) {
|
|
96
96
|
this.transformValue = options.transformValue;
|
|
@@ -98,7 +98,5 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
|
98
98
|
if (options.renderExport) {
|
|
99
99
|
this.export = options.renderExport;
|
|
100
100
|
}
|
|
101
|
-
// this.export = (options as any).renderExport;
|
|
102
101
|
});
|
|
103
|
-
|
|
104
102
|
export default BsHeaderChild;
|
|
@@ -20,53 +20,3 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.pictureProClient {
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-wrap: wrap;
|
|
26
|
-
.copyText {
|
|
27
|
-
color: #1890ff;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.pictureProBox {
|
|
32
|
-
position: relative;
|
|
33
|
-
display: flex;
|
|
34
|
-
width: 280px;
|
|
35
|
-
height: 105px;
|
|
36
|
-
padding: 8px;
|
|
37
|
-
margin-bottom: 8px;
|
|
38
|
-
margin-right: 8px;
|
|
39
|
-
border-radius: 5px;
|
|
40
|
-
background-color: rgba(240,241,242,0.72);
|
|
41
|
-
.pictureProLeft {
|
|
42
|
-
width: 80px;
|
|
43
|
-
height: 80px;
|
|
44
|
-
border-radius: 5px;
|
|
45
|
-
margin-right: 8px;
|
|
46
|
-
flex:none;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.pictureProText {
|
|
50
|
-
text-overflow: ellipsis;
|
|
51
|
-
display: -webkit-box;
|
|
52
|
-
-webkit-box-orient: vertical;
|
|
53
|
-
-webkit-line-clamp: 2;
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
word-break: break-all;
|
|
56
|
-
&:hover {
|
|
57
|
-
color: #1890ff;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
.pictureProOperate {
|
|
61
|
-
position: absolute;
|
|
62
|
-
right: 8px;
|
|
63
|
-
bottom: 8px;
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: flex-end;
|
|
66
|
-
align-items: center;
|
|
67
|
-
margin-top: 8px;
|
|
68
|
-
.downloadIcon {
|
|
69
|
-
color: #1890ff;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class BsHeaderChild 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 BsHeaderChild;
|
|
@@ -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
|
+
var hostUrl = "https://kefu.kuaimai.com";
|
|
20
|
+
var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
|
|
21
|
+
var _this = this;
|
|
22
|
+
_classCallCheck(this, BsHeaderChild);
|
|
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 BsHeaderChild;
|
|
@@ -12,10 +12,13 @@ import React from "react";
|
|
|
12
12
|
import { ApaasUploadProAsync } from "@kmkf-fe-packages/basic-components";
|
|
13
13
|
import GetFormItem from "../GetFormItem";
|
|
14
14
|
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
-
import
|
|
15
|
+
import PictureUrl from "./PictureUrl";
|
|
16
16
|
import BsHeaderPic from "../BS/common/BsHeaderPic";
|
|
17
17
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
|
-
import
|
|
18
|
+
import "./index.less";
|
|
19
|
+
import { Image, Tooltip, message } from "antd";
|
|
20
|
+
import { DownloadOutlined } from "@ant-design/icons";
|
|
21
|
+
import copy from "copy-to-clipboard";
|
|
19
22
|
var hostUrl = "https://kefu.kuaimai.com";
|
|
20
23
|
var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options) {
|
|
21
24
|
var _this = this,
|
|
@@ -42,10 +45,68 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
42
45
|
if (!(value !== null && value !== void 0 && value.length)) {
|
|
43
46
|
return null;
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
var copyText = value.map(function (item) {
|
|
49
|
+
return item.name;
|
|
50
|
+
}).join(",");
|
|
51
|
+
var onCopy = function onCopy() {
|
|
52
|
+
copy(copyText);
|
|
53
|
+
message.success("图片名称复制成功");
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "pictureProClient"
|
|
57
|
+
}, value.map(function (item) {
|
|
58
|
+
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");
|
|
59
|
+
var showImage = /^pic\/[\s\S]*$/.test(item.url) ? "".concat(hostUrl, "/").concat(item.url) : item.url;
|
|
60
|
+
var downloadHandle = function downloadHandle() {
|
|
61
|
+
if (_this.currenEnv === "pc") {
|
|
62
|
+
try {
|
|
63
|
+
fetch("".concat(hostUrl, "/").concat(item.url)).then(function (res) {
|
|
64
|
+
return res.blob();
|
|
65
|
+
}).then(function (blob) {
|
|
66
|
+
var a = document.createElement("a");
|
|
67
|
+
document.body.appendChild(a);
|
|
68
|
+
a.style.display = "none";
|
|
69
|
+
var url = window.URL.createObjectURL(blob);
|
|
70
|
+
a.href = url;
|
|
71
|
+
a.download = item.name;
|
|
72
|
+
a.click();
|
|
73
|
+
document.body.removeChild(a);
|
|
74
|
+
window.URL.revokeObjectURL(url);
|
|
75
|
+
});
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(error);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
copy(item.url);
|
|
81
|
+
message.success("图片链接复制成功");
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
key: item.url,
|
|
86
|
+
className: "pictureProBox"
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "pictureProLeft"
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
90
|
+
src: finalImage,
|
|
91
|
+
preview: {
|
|
92
|
+
src: showImage
|
|
93
|
+
},
|
|
94
|
+
width: "100%",
|
|
95
|
+
height: "100%"
|
|
96
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
97
|
+
title: item.name
|
|
98
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: "pictureProText"
|
|
100
|
+
}, item.name)), /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "pictureProOperate"
|
|
102
|
+
}, /*#__PURE__*/React.createElement(DownloadOutlined, {
|
|
103
|
+
className: "downloadIcon",
|
|
104
|
+
onClick: downloadHandle
|
|
105
|
+
}))));
|
|
106
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
107
|
+
className: "copyText",
|
|
108
|
+
onClick: onCopy
|
|
109
|
+
}, "\u590D\u5236"));
|
|
49
110
|
});
|
|
50
111
|
_defineProperty(this, "renderPc", function () {
|
|
51
112
|
return null;
|
|
@@ -87,6 +148,7 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
87
148
|
_defineProperty(this, "filterConfig", function () {
|
|
88
149
|
return [];
|
|
89
150
|
});
|
|
151
|
+
console.log("options", options);
|
|
90
152
|
this.name = options.name;
|
|
91
153
|
this.id = options.id;
|
|
92
154
|
this.sortField = "".concat(options.id, "_pictureProList");
|
|
@@ -94,14 +156,16 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
94
156
|
this.type = options.type;
|
|
95
157
|
this.componentConfig = options.componentConfig;
|
|
96
158
|
this.rules = [];
|
|
97
|
-
this.isCombinationComponent =
|
|
159
|
+
this.isCombinationComponent = true;
|
|
98
160
|
this.canSort = true;
|
|
99
|
-
this.children = [new
|
|
161
|
+
this.children = [new PictureUrl(_objectSpread(_objectSpread({}, options), {}, {
|
|
100
162
|
name: "图片名称",
|
|
101
|
-
id: "".concat(options.id, "_pictureProList_name")
|
|
163
|
+
id: "".concat(options.id, "_pictureProList_name"),
|
|
164
|
+
width: 250
|
|
102
165
|
})), new BsHeaderPic(_objectSpread(_objectSpread({}, options), {}, {
|
|
103
166
|
name: "图片详情",
|
|
104
|
-
id: "".concat(options.id, "_pictureProList_url")
|
|
167
|
+
id: "".concat(options.id, "_pictureProList_url"),
|
|
168
|
+
width: 200
|
|
105
169
|
}))];
|
|
106
170
|
this.dataType = "object";
|
|
107
171
|
this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.pictureProClient {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
.copyText {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
color: #1890ff;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.pictureProBox {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
width: 280px;
|
|
14
|
+
height: 105px;
|
|
15
|
+
padding: 8px;
|
|
16
|
+
margin-bottom: 8px;
|
|
17
|
+
margin-right: 8px;
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
background-color: rgba(240,241,242,0.72);
|
|
20
|
+
.pictureProLeft {
|
|
21
|
+
width: 80px;
|
|
22
|
+
height: 80px;
|
|
23
|
+
border-radius: 5px;
|
|
24
|
+
margin-right: 8px;
|
|
25
|
+
flex:none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pictureProText {
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
display: -webkit-box;
|
|
31
|
+
-webkit-box-orient: vertical;
|
|
32
|
+
-webkit-line-clamp: 2;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
word-break: break-all;
|
|
35
|
+
&:hover {
|
|
36
|
+
color: #1890ff;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.pictureProOperate {
|
|
40
|
+
position: absolute;
|
|
41
|
+
right: 8px;
|
|
42
|
+
bottom: 8px;
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
align-items: center;
|
|
46
|
+
margin-top: 8px;
|
|
47
|
+
.downloadIcon {
|
|
48
|
+
color: #1890ff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pictruePc {
|
|
54
|
+
.downloadIcon {
|
|
55
|
+
visibility: hidden;
|
|
56
|
+
}
|
|
57
|
+
&:hover {
|
|
58
|
+
color: #1890ff;
|
|
59
|
+
.downloadIcon {
|
|
60
|
+
visibility: visible;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -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 |
|
|
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;
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FormInstance } from
|
|
3
|
-
import { SYMBOL } from
|
|
2
|
+
import type { FormInstance } from 'antd';
|
|
3
|
+
import { SYMBOL } from './constant';
|
|
4
4
|
export declare type ShowHeaderObjType = {
|
|
5
5
|
title: string;
|
|
6
6
|
dataIndex: string;
|
|
7
7
|
show?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare type DataType =
|
|
10
|
-
export declare type ALignType =
|
|
9
|
+
export declare type DataType = 'string' | 'number' | 'array' | 'dateArray' | 'date' | 'tradeId';
|
|
10
|
+
export declare type ALignType = 'left' | 'right' | 'center';
|
|
11
11
|
export declare type QuerySymbol = keyof typeof SYMBOL;
|
|
12
12
|
export declare type Record = {
|
|
13
13
|
[props in string]: any;
|
|
@@ -32,7 +32,7 @@ export declare type FilterConfigType = {
|
|
|
32
32
|
filterFn?: (p: any) => (r: Record) => unknown;
|
|
33
33
|
formatFilterValue?: (p: any) => any;
|
|
34
34
|
};
|
|
35
|
-
export declare type FilterComponentType =
|
|
35
|
+
export declare type FilterComponentType = 'MultipleSelect' | 'Input' | 'Date' | 'Cascader' | 'ShopList' | 'Rate' | 'SelectInput';
|
|
36
36
|
export interface ComponentInterface {
|
|
37
37
|
transformValue?: (val: any, record?: any, parentName?: string) => any;
|
|
38
38
|
id: string;
|
|
@@ -53,8 +53,8 @@ export interface ComponentInterface {
|
|
|
53
53
|
rules?: any[];
|
|
54
54
|
width?: number;
|
|
55
55
|
align?: ALignType;
|
|
56
|
-
dataType:
|
|
57
|
-
format?:
|
|
56
|
+
dataType: 'string' | 'number' | 'boolean' | 'array' | 'range' | 'object' | 'weakenArray' | 'arrayObject';
|
|
57
|
+
format?: 'dateTime' | 'date' | 'time' | 'cascader' | 'shopInput' | 'staffGroup' | 'object';
|
|
58
58
|
options?: Array<any>;
|
|
59
59
|
optionsMap?: Record;
|
|
60
60
|
templateId?: string;
|
|
@@ -99,7 +99,7 @@ export interface ComponentInterface {
|
|
|
99
99
|
/**
|
|
100
100
|
* @description 显示字段名称
|
|
101
101
|
*/
|
|
102
|
-
showField?:
|
|
102
|
+
showField?: 'EXPRESS_COMPANY' | 'EXPRESS_WAYBILL_CODE' | 'EXPRESS_SNAPSHOT' | 'all' | 'bs' | 'workOrder' | 'logisticsCompany' | 'logisticsCode' | string;
|
|
103
103
|
/**
|
|
104
104
|
* @description 是否选择SKU
|
|
105
105
|
*/
|
|
@@ -119,7 +119,7 @@ export interface ComponentInterface {
|
|
|
119
119
|
/**
|
|
120
120
|
* @description 备注状态
|
|
121
121
|
*/
|
|
122
|
-
associatedType?:
|
|
122
|
+
associatedType?: 'APPEND';
|
|
123
123
|
isAssociated?: boolean;
|
|
124
124
|
isShowFlag?: boolean;
|
|
125
125
|
/**
|
|
@@ -160,7 +160,7 @@ export interface ComponentInterface {
|
|
|
160
160
|
* @description 时间初始值
|
|
161
161
|
*/
|
|
162
162
|
dateTime?: string;
|
|
163
|
-
dateType?:
|
|
163
|
+
dateType?: 'DATE' | 'DATE_TIME' | 'DATE_RANGE' | 'DATE_TIME_RANGE';
|
|
164
164
|
maxSize?: number;
|
|
165
165
|
basicGrade?: number;
|
|
166
166
|
range?: number;
|
|
@@ -275,13 +275,13 @@ export interface ComponentInterface {
|
|
|
275
275
|
getComponentValue: (r: Record) => any;
|
|
276
276
|
formDataTransform?: (r: any) => any;
|
|
277
277
|
}
|
|
278
|
-
export declare type PickOption = Pick<ComponentInterface,
|
|
278
|
+
export declare type PickOption = Pick<ComponentInterface, 'name' | 'id' | 'type' | 'componentConfig' | 'effects' | 'columnHeader' | 'templateId' | 'workOrderUniqueKey' | 'platform' | 'parentName' | 'width' | 'flowTemplateKey' | 'transformValue' | 'renderExport'>;
|
|
279
279
|
export declare type ColumnConfig = {
|
|
280
280
|
id: string;
|
|
281
281
|
name: string;
|
|
282
282
|
type: string;
|
|
283
283
|
subKey?: string;
|
|
284
|
-
mode?:
|
|
285
|
-
config?: ComponentInterface[
|
|
286
|
-
templateConfig?: ComponentInterface[
|
|
284
|
+
mode?: 'multiple';
|
|
285
|
+
config?: ComponentInterface['componentConfig'];
|
|
286
|
+
templateConfig?: ComponentInterface['componentConfig'];
|
|
287
287
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "2.0.19-beta.
|
|
3
|
+
"version": "2.0.19-beta.61",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "2.0.19-beta.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "2.0.19-beta.61",
|
|
25
25
|
"@kmkf-fe-packages/kmkf-utils": "2.0.19-beta.60",
|
|
26
26
|
"b64-to-blob": "^1.2.19",
|
|
27
27
|
"html2canvas": "^1.4.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "5bc3ab0d1f1a362556e3bf3019b6ea824d8354e2",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|