@kmkf-fe-packages/services-components 1.10.1-beta.5 → 1.11.0-beta.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.
package/README.md CHANGED
@@ -2,6 +2,4 @@
2
2
 
3
3
  - 针对于自定义组件的后缀,在提交的时候是以组件类型的驼峰式来命名的
4
4
 
5
- ---
6
-
7
-
5
+ ---
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryWdtLogisticsCompany" | "queryWdtSendData" | "queryLabel";
2
+ declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryWdtLogisticsCompany" | "queryWdtSendData";
3
3
  declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
4
4
  requestList?: RequestType[] | undefined;
5
5
  repeatRequestList?: Record<string, () => Promise<any>> | undefined;
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import React, { useEffect, useState } from "react";
17
17
  import { Skeleton, Result, Button } from "antd";
18
- import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryWdtLogisticsCompany, queryWdtSendData, queryAllLogisticsCompany, queryLabel } from "../../service/api";
18
+ import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryWdtLogisticsCompany, queryWdtSendData } from "../../service/api";
19
19
  import { servers } from '@kmkf-fe-packages/kmkf-utils';
20
20
  var Global = function Global(_ref) {
21
21
  var children = _ref.children,
@@ -16,10 +16,10 @@ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message, Ty
16
16
  import React, { useState, useMemo } from "react";
17
17
  import { ExpressData, WdtSendData } from "@kmkf-fe-packages/kmkf-utils";
18
18
  import { getAlipayBillReceipt } from "../../service/api";
19
- import { CopyToClipboard } from "react-copy-to-clipboard";
20
- import CopyText from "../../commonComponents/CopyText";
19
+ import { CopyToClipboard } from 'react-copy-to-clipboard';
21
20
  import styles from "./index.module.less";
22
21
  import defaultImg from "./img/default-img.png";
22
+ import CopyText from "../../commonComponents/CopyText";
23
23
  var Paragraph = Typography.Paragraph;
24
24
  export var getFormItem = function getFormItem(_ref) {
25
25
  var name = _ref.name,
@@ -11,19 +11,44 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useEffect, useState, useRef } from "react";
12
12
  import { Button, message } from "antd";
13
13
  import { LoadingOutlined } from "@ant-design/icons";
14
- import PDF from "react-pdf-js";
14
+ import { usePdf } from "react-pdf-js";
15
15
  import copy from "copy-to-clipboard";
16
+ import html2canvas from "html2canvas";
17
+ import b64toBlob from "b64-to-blob";
16
18
  import { getAlipayBillReceipt } from "../../service/api";
17
19
  var Preview = function Preview(_ref) {
18
20
  var url = _ref.url;
19
- var onDocumentComplete = function onDocumentComplete() {
20
- console.log("文件加载完成");
21
+ var canvasEl = useRef(null);
22
+ var _usePdf = usePdf({
23
+ file: url,
24
+ page: 1,
25
+ scale: 1,
26
+ canvasEl: canvasEl
27
+ }),
28
+ _usePdf2 = _slicedToArray(_usePdf, 1),
29
+ loading = _usePdf2[0];
30
+ var copy = function copy() {
31
+ html2canvas(canvasEl === null || canvasEl === void 0 ? void 0 : canvasEl.current, {
32
+ useCORS: true
33
+ }).then(function (canvas) {
34
+ var imgUrl = canvas.toDataURL("image/png");
35
+ var str = imgUrl.replace(/data:image\/png;base64,/, "");
36
+ var file = b64toBlob(str, "image/png");
37
+ var clipboardItemInput = new window.ClipboardItem({
38
+ "image/png": file
39
+ });
40
+ window.navigator.clipboard.write([clipboardItemInput]);
41
+ message.success("复制成功");
42
+ });
21
43
  };
22
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PDF, {
23
- file: url,
24
- onDocumentComplete: onDocumentComplete,
25
- page: 1,
26
- scale: 1
44
+ return /*#__PURE__*/React.createElement("div", null, !loading && /*#__PURE__*/React.createElement(Button, {
45
+ type: "link",
46
+ onClick: copy,
47
+ style: {
48
+ display: "block"
49
+ }
50
+ }, "\u590D\u5236\u51ED\u8BC1"), /*#__PURE__*/React.createElement("canvas", {
51
+ ref: canvasEl
27
52
  }));
28
53
  };
29
54
  var CopyUrl = function CopyUrl(_ref2) {
@@ -95,7 +120,7 @@ var OperatePreview = function OperatePreview(_ref3) {
95
120
  }, []);
96
121
  return /*#__PURE__*/React.createElement("div", {
97
122
  style: {
98
- maxHeight: "420px",
123
+ maxHeight: "455px",
99
124
  overflowY: "hidden"
100
125
  }
101
126
  }, url ? showPdf ? /*#__PURE__*/React.createElement(Preview, {
@@ -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, 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, KmErpSendGood, AfterSalesOrderId } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BasicCascader | StatusSelect | BasicInput | BasicAddress | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | 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 | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | 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 | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | KmErpSendGood | AfterSalesOrderId;
3
+ export declare const factory: (type: string, options: PickOption) => BasicCascader | BasicInput | BasicAddress | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | 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 | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | KmErpSendGood | AfterSalesOrderId;
@@ -141,8 +141,6 @@ export var factory = function factory(type, options) {
141
141
  return new BsPosting(options);
142
142
  case "BS_GOODS":
143
143
  return new BsGoods(options);
144
- case "WDT_GOODS":
145
- return new WdtGoods(options);
146
144
  case "BS_EXCHANGE_GOODS":
147
145
  return new BsExchange(options);
148
146
  case "WDT_EXCHANGE_GOODS":
@@ -207,6 +205,9 @@ export var factory = function factory(type, options) {
207
205
  return new CommonDataTime(options);
208
206
  case "FLOW_UPDATE_DATETIME":
209
207
  return new CommonDataTime(options);
208
+ case "WDT_GOODS":
209
+ // 万里牛商品
210
+ return new WdtGoods(options);
210
211
  case "BUSINESS_ORDER_NO":
211
212
  return new CommonInput(options);
212
213
  case "PAYMENT_VOUCHER_CODE":
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.10.1-beta.5",
3
+ "version": "1.11.0-beta.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
+ "sync": "yarn build && yalc push",
10
11
  "build": "yarn run lint && father build",
11
12
  "lint": "eslint '**/*.{ts,tsx}'",
12
- "lint:fix": "eslint --fix '**/*.{ts,tsx}'",
13
- "sync": "yarn build && yalc push"
13
+ "lint:fix": "eslint --fix '**/*.{ts,tsx}'"
14
14
  },
15
15
  "lint-staged": {
16
16
  "*.{js,jsx,less,md,json}": [
@@ -21,8 +21,10 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "1.10.1-beta.4",
25
- "@kmkf-fe-packages/kmkf-utils": "1.10.1-beta.0",
24
+ "@kmkf-fe-packages/basic-components": "1.11.0-beta.0",
25
+ "@kmkf-fe-packages/kmkf-utils": "1.11.0-beta.0",
26
+ "b64-to-blob": "^1.2.19",
27
+ "html2canvas": "^1.4.1",
26
28
  "react-pdf-js": "^5.1.0"
27
29
  },
28
30
  "devDependencies": {
@@ -34,13 +36,12 @@
34
36
  "peerDependencies": {
35
37
  "@ant-design/icons": "^4.7.0",
36
38
  "antd": "^4.21.4",
37
- "copy-to-clipboard": "^3.3.3",
38
39
  "react": "^16.8.0"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
42
43
  },
43
- "gitHead": "e818bf514c2b6aa3f5142f7b74fb063a4d1f57bb",
44
+ "gitHead": "a06a4661a58540951bb7a5dbcdb15ac224a192b4",
44
45
  "gitHooks": {
45
46
  "pre-commit": "lint-staged"
46
47
  }