@kmkf-fe-packages/services-components 2.0.19-beta.67 → 2.0.19-beta.69
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/PicturePro/PictureName.js +2 -2
- package/dist/esm/components/PicturePro/PictureUrl.d.ts +4 -4
- package/dist/esm/components/PicturePro/PictureUrl.js +9 -7
- package/dist/esm/components/PicturePro/index.d.ts +6 -6
- package/dist/esm/components/PicturePro/index.js +25 -25
- package/dist/esm/factory.d.ts +1 -1
- package/package.json +3 -3
|
@@ -80,10 +80,10 @@ var PictureName = /*#__PURE__*/_createClass(function PictureName(options) {
|
|
|
80
80
|
};
|
|
81
81
|
return /*#__PURE__*/React.createElement(Space, {
|
|
82
82
|
className: "pictruePc"
|
|
83
|
-
}, /*#__PURE__*/React.createElement(DownloadOutlined, {
|
|
83
|
+
}, (record === null || record === void 0 ? void 0 : record["".concat(parentId, "_url")]) && /*#__PURE__*/React.createElement(DownloadOutlined, {
|
|
84
84
|
onClick: downloadHandle,
|
|
85
85
|
className: "downloadIcon"
|
|
86
|
-
}), /*#__PURE__*/React.createElement("div", null, fileName
|
|
86
|
+
}), /*#__PURE__*/React.createElement("div", null, fileName ? fileName : '--'));
|
|
87
87
|
});
|
|
88
88
|
_defineProperty(this, "renderLog", function (r) {
|
|
89
89
|
var id = _this.getParentId();
|
|
@@ -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 PictureUrl 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
|
constructor(options: PickOption);
|
|
17
17
|
getParentId: () => string;
|
|
18
18
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
@@ -11,10 +11,10 @@ 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 { Image } from
|
|
15
|
-
import React from
|
|
14
|
+
import { Image } from 'antd';
|
|
15
|
+
import React from 'react';
|
|
16
16
|
import ItemView from "../../commonComponents/ItemView";
|
|
17
|
-
import { isNull } from
|
|
17
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
18
18
|
import { hostUrl } from "../../constant";
|
|
19
19
|
var PictureUrl = /*#__PURE__*/_createClass(function PictureUrl(options) {
|
|
20
20
|
var _this = this;
|
|
@@ -32,7 +32,7 @@ var PictureUrl = /*#__PURE__*/_createClass(function PictureUrl(options) {
|
|
|
32
32
|
_defineProperty(this, "children", void 0);
|
|
33
33
|
_defineProperty(this, "dataType", void 0);
|
|
34
34
|
_defineProperty(this, "getParentId", function () {
|
|
35
|
-
var _this$id$split = _this.id.split(
|
|
35
|
+
var _this$id$split = _this.id.split('_'),
|
|
36
36
|
_this$id$split2 = _slicedToArray(_this$id$split, 3),
|
|
37
37
|
key = _this$id$split2[0],
|
|
38
38
|
name = _this$id$split2[1],
|
|
@@ -47,7 +47,9 @@ var PictureUrl = /*#__PURE__*/_createClass(function PictureUrl(options) {
|
|
|
47
47
|
}) : null;
|
|
48
48
|
});
|
|
49
49
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
50
|
-
var
|
|
50
|
+
var patchUrl = _this.getComponentValue(record);
|
|
51
|
+
if (!patchUrl) return /*#__PURE__*/React.createElement("span", null, "--");
|
|
52
|
+
var finalImage = "".concat(hostUrl, "/").concat(patchUrl);
|
|
51
53
|
return /*#__PURE__*/React.createElement("span", {
|
|
52
54
|
onClick: function onClick(e) {
|
|
53
55
|
return e.stopPropagation();
|
|
@@ -81,11 +83,11 @@ var PictureUrl = /*#__PURE__*/_createClass(function PictureUrl(options) {
|
|
|
81
83
|
this.formField = options.id;
|
|
82
84
|
this.type = options.type;
|
|
83
85
|
this.componentConfig = options.componentConfig;
|
|
84
|
-
this.align =
|
|
86
|
+
this.align = 'left';
|
|
85
87
|
this.width = 100;
|
|
86
88
|
this.isCombinationComponent = false;
|
|
87
89
|
this.canSort = false;
|
|
88
|
-
this.dataType =
|
|
90
|
+
this.dataType = 'string';
|
|
89
91
|
this.children = [];
|
|
90
92
|
});
|
|
91
93
|
export default PictureUrl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import
|
|
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[
|
|
14
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
15
15
|
isCombinationComponent: boolean;
|
|
16
16
|
formField: string;
|
|
17
17
|
canSort: boolean;
|
|
18
18
|
children: ComponentInterface[];
|
|
19
|
-
dataType: ComponentInterface[
|
|
20
|
-
currenEnv: ComponentInterface[
|
|
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,17 +8,17 @@ 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
|
|
12
|
-
import { ApaasUploadProAsync } from
|
|
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
15
|
import PictureName from "./PictureName";
|
|
16
16
|
import PictureUrl from "./PictureUrl";
|
|
17
|
-
import { isNull } from
|
|
17
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
18
|
import "./index.less";
|
|
19
|
-
import { Image, Tooltip, message } from
|
|
20
|
-
import { DownloadOutlined, CopyOutlined } from
|
|
21
|
-
import copy from
|
|
19
|
+
import { Image, Tooltip, message } from "antd";
|
|
20
|
+
import { DownloadOutlined, CopyOutlined } from "@ant-design/icons";
|
|
21
|
+
import copy from "copy-to-clipboard";
|
|
22
22
|
import { hostUrl } from "../../constant";
|
|
23
23
|
var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options) {
|
|
24
24
|
var _this = this,
|
|
@@ -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 ===
|
|
60
|
-
getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById(
|
|
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 ===
|
|
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(
|
|
71
|
+
var a = document.createElement("a");
|
|
72
72
|
document.body.appendChild(a);
|
|
73
|
-
a.style.display =
|
|
73
|
+
a.style.display = "none";
|
|
74
74
|
var url = window.URL.createObjectURL(blob);
|
|
75
75
|
a.href = url;
|
|
76
76
|
a.download = item.name;
|
|
@@ -82,8 +82,8 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
82
82
|
console.error(error);
|
|
83
83
|
}
|
|
84
84
|
} else {
|
|
85
|
-
copy(item.url);
|
|
86
|
-
message.success(
|
|
85
|
+
copy("".concat(hostUrl, "/").concat(item.url));
|
|
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
|
-
height:
|
|
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 ===
|
|
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,
|
|
@@ -166,15 +166,15 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
|
|
|
166
166
|
this.isCombinationComponent = true;
|
|
167
167
|
this.canSort = true;
|
|
168
168
|
this.children = [new PictureName(_objectSpread(_objectSpread({}, options), {}, {
|
|
169
|
-
name:
|
|
169
|
+
name: "图片名称",
|
|
170
170
|
id: "".concat(options.id, "_pictureProList_name"),
|
|
171
171
|
width: 250
|
|
172
172
|
})), new PictureUrl(_objectSpread(_objectSpread({}, options), {}, {
|
|
173
|
-
name:
|
|
173
|
+
name: "图片详情",
|
|
174
174
|
id: "".concat(options.id, "_pictureProList_url"),
|
|
175
175
|
width: 200
|
|
176
176
|
}))];
|
|
177
|
-
this.dataType =
|
|
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;
|
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) =>
|
|
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.
|
|
3
|
+
"version": "2.0.19-beta.69",
|
|
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.69",
|
|
25
25
|
"@kmkf-fe-packages/kmkf-utils": "2.0.19-beta.67",
|
|
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": "be37ed436ab8f6840f947444ad136905aed16d62",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|