@kmkf-fe-packages/services-components 0.7.14-alpha.5 → 0.7.15-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/commonComponents/OperationLog/index.js +3 -1
- package/dist/esm/components/ActualPayment/index.d.ts +5 -3
- package/dist/esm/components/ActualPayment/index.js +38 -17
- package/dist/esm/components/BsLogistics/index.d.ts +50 -0
- package/dist/esm/components/BsLogistics/index.js +115 -0
- package/dist/esm/components/BsSendGood/index.d.ts +25 -0
- package/dist/esm/components/BsSendGood/index.js +116 -0
- package/dist/esm/components/Common/index.d.ts +5 -5
- package/dist/esm/components/CommonDataTime/index.d.ts +4 -4
- package/dist/esm/components/CommonDataTime/index.js +13 -13
- package/dist/esm/components/DataTime/ApaasDate.d.ts +2 -2
- package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +2 -2
- package/dist/esm/components/EItemId/ItemId.d.ts +2 -2
- package/dist/esm/components/EItemSelect/ItemSelect.d.ts +2 -2
- package/dist/esm/components/ExpressCompany/index.d.ts +2 -2
- package/dist/esm/components/File/index.d.ts +33 -0
- package/dist/esm/components/File/index.js +117 -0
- package/dist/esm/components/FlowStatusSelect/index.js +5 -8
- package/dist/esm/components/Input/index.d.ts +3 -3
- package/dist/esm/components/Input/index.js +28 -14
- package/dist/esm/components/Popover/index.d.ts +2 -2
- package/dist/esm/components/PostIng/index.d.ts +33 -0
- package/dist/esm/components/PostIng/index.js +144 -0
- package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +2 -2
- package/dist/esm/components/TradeDateTime/index.d.ts +5 -5
- package/dist/esm/components/TradeDateTime/index.js +28 -33
- package/dist/esm/factory.d.ts +3 -3
- package/dist/esm/factory.js +65 -51
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/type.d.ts +20 -3
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { GoodsProps } from '@kmkf-fe-packages/basic-components/dist/common/Goods';
|
|
3
|
-
declare const ItemSelect: (props: JSX.IntrinsicAttributes & GoodsProps) =>
|
|
3
|
+
declare const ItemSelect: (props: JSX.IntrinsicAttributes & GoodsProps) => JSX.Element;
|
|
4
4
|
export default ItemSelect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const ExpressCompany: (props: any) =>
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const ExpressCompany: (props: any) => JSX.Element;
|
|
3
3
|
export default ExpressCompany;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare type Value = string[] | undefined;
|
|
4
|
+
declare class BasicFile implements ComponentInterface {
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
sortField: string;
|
|
8
|
+
type: string;
|
|
9
|
+
rules: any[];
|
|
10
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
canSort: boolean;
|
|
13
|
+
children: ComponentInterface[];
|
|
14
|
+
constructor(options: PickOption);
|
|
15
|
+
formatPictures: (pictures: string) => string[];
|
|
16
|
+
render: (value: Value) => React.JSX.Element | null;
|
|
17
|
+
renderPc: (value: any, record: Record) => React.JSX.Element | React.JSX.Element[];
|
|
18
|
+
renderLog: (r: Record) => React.JSX.Element | React.JSX.Element[] | null;
|
|
19
|
+
getComponentValue: (r: Record) => any;
|
|
20
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
21
|
+
editRender: () => React.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @returns 图片类型的导出需要在导出时单独处理
|
|
25
|
+
*/
|
|
26
|
+
renderExport: () => null;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @returns 图片不支持过滤
|
|
30
|
+
*/
|
|
31
|
+
filterConfig: () => never[];
|
|
32
|
+
}
|
|
33
|
+
export default BasicFile;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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 { ApaasUploadFile } from "@kmkf-fe-packages/basic-components";
|
|
12
|
+
import { imgResize } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
|
+
import GetFormItem from "../GetFormItem";
|
|
14
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
17
|
+
var _this = this;
|
|
18
|
+
_classCallCheck(this, BasicFile);
|
|
19
|
+
_defineProperty(this, "name", void 0);
|
|
20
|
+
_defineProperty(this, "id", void 0);
|
|
21
|
+
_defineProperty(this, "sortField", void 0);
|
|
22
|
+
_defineProperty(this, "type", void 0);
|
|
23
|
+
_defineProperty(this, "rules", void 0);
|
|
24
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
25
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
26
|
+
_defineProperty(this, "canSort", void 0);
|
|
27
|
+
_defineProperty(this, "children", void 0);
|
|
28
|
+
_defineProperty(this, "formatPictures", function (pictures) {
|
|
29
|
+
pictures = pictures.replace(/[\[\]]/g, "");
|
|
30
|
+
pictures = pictures.replace(/\s/g, "");
|
|
31
|
+
return pictures ? pictures.split(",") : [];
|
|
32
|
+
});
|
|
33
|
+
_defineProperty(this, "render", function (value) {
|
|
34
|
+
if (!(value !== null && value !== void 0 && value.length)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", null, value === null || value === void 0 ? void 0 : value.map(function (pic) {
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
style: {
|
|
40
|
+
marginRight: "5px",
|
|
41
|
+
display: "inline-block"
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
44
|
+
width: 32,
|
|
45
|
+
src: imgResize(pic || ""),
|
|
46
|
+
preview: {
|
|
47
|
+
src: imgResize(pic || "", 0, 0)
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
53
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_picture")]) === undefined) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
55
|
+
}
|
|
56
|
+
var finalPictures = _this.formatPictures(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_picture")]).map(function (item) {
|
|
57
|
+
return "".concat(window.location.origin, "/").concat(item);
|
|
58
|
+
});
|
|
59
|
+
return finalPictures === null || finalPictures === void 0 ? void 0 : finalPictures.map(function (pic) {
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
style: {
|
|
62
|
+
marginRight: "5px",
|
|
63
|
+
display: "inline-block"
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
66
|
+
width: 32,
|
|
67
|
+
src: "".concat(pic, "?x-oss-process=image/resize,m_pad,h_40,w_40"),
|
|
68
|
+
preview: {
|
|
69
|
+
src: pic
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
75
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_picture")])) return null;
|
|
76
|
+
return _this.renderPc(undefined, r);
|
|
77
|
+
});
|
|
78
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
79
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_picture")];
|
|
80
|
+
});
|
|
81
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
82
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
83
|
+
id: _this.id,
|
|
84
|
+
label: _this.name,
|
|
85
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
86
|
+
}) : null;
|
|
87
|
+
});
|
|
88
|
+
_defineProperty(this, "editRender", function () {
|
|
89
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
90
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
91
|
+
title: _this.name,
|
|
92
|
+
name: _this.id,
|
|
93
|
+
rules: _this.rules,
|
|
94
|
+
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,
|
|
95
|
+
component: /*#__PURE__*/React.createElement(ApaasUploadFile, _extends({}, _this.componentConfig, {
|
|
96
|
+
uniqueKey: _this.id,
|
|
97
|
+
hostUrl: "https://kefu.kuaimai.com"
|
|
98
|
+
}))
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
_defineProperty(this, "renderExport", function () {
|
|
102
|
+
return null;
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(this, "filterConfig", function () {
|
|
105
|
+
return [];
|
|
106
|
+
});
|
|
107
|
+
this.name = options.name;
|
|
108
|
+
this.id = options.id;
|
|
109
|
+
this.sortField = "".concat(options.id, "_file");
|
|
110
|
+
this.type = options.type;
|
|
111
|
+
this.componentConfig = options.componentConfig;
|
|
112
|
+
this.rules = [];
|
|
113
|
+
this.isCombinationComponent = false;
|
|
114
|
+
this.canSort = false;
|
|
115
|
+
this.children = [];
|
|
116
|
+
});
|
|
117
|
+
export default BasicFile;
|
|
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
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
9
|
import React from 'react';
|
|
10
|
-
import { Menu } from 'antd';
|
|
10
|
+
import { Dropdown, Menu } from 'antd';
|
|
11
11
|
import { ApaasSelect } from '@kmkf-fe-packages/basic-components';
|
|
12
12
|
import { filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
13
13
|
import GetFormItem from "../GetFormItem";
|
|
@@ -51,16 +51,13 @@ var WorkOrderId = /*#__PURE__*/_createClass(function WorkOrderId(options) {
|
|
|
51
51
|
});
|
|
52
52
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
53
53
|
var status = get(_this.workOrderStatus, record === null || record === void 0 ? void 0 : record["".concat(_this.id)]);
|
|
54
|
-
return status ?
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
React.createElement("span", {
|
|
54
|
+
return status ? /*#__PURE__*/React.createElement(Dropdown, {
|
|
55
|
+
overlay: _this.renderMenu(record)
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
58
57
|
style: {
|
|
59
58
|
color: status.color
|
|
60
59
|
}
|
|
61
|
-
}, status === null || status === void 0 ? void 0 : status.label)
|
|
62
|
-
// </Dropdown>
|
|
63
|
-
: /*#__PURE__*/React.createElement("span", null, "--");
|
|
60
|
+
}, status === null || status === void 0 ? void 0 : status.label)) : /*#__PURE__*/React.createElement("span", null, "--");
|
|
64
61
|
});
|
|
65
62
|
_defineProperty(this, "renderLog", function (r) {
|
|
66
63
|
var status = get(_this.workOrderStatus, r === null || r === void 0 ? void 0 : r["".concat(_this.id)]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
3
|
declare class BasicInput implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -11,7 +11,7 @@ declare class BasicInput implements ComponentInterface {
|
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
13
13
|
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface[
|
|
14
|
+
dataType: ComponentInterface["dataType"];
|
|
15
15
|
constructor(options: PickOption);
|
|
16
16
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
17
17
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -6,16 +6,15 @@ 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
|
|
10
|
-
import { ApaasInput } from
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { ApaasInput } from "@kmkf-fe-packages/basic-components";
|
|
11
11
|
import GetFormItem from "../GetFormItem";
|
|
12
12
|
import ItemView from "../../commonComponents/ItemView";
|
|
13
|
-
import { isNull, filterFn as _filterFn } from
|
|
13
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
14
|
import { SYMBOL } from "../../constant";
|
|
15
15
|
var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
16
16
|
var _this = this,
|
|
17
|
-
_options$componentCon
|
|
18
|
-
_options$componentCon2;
|
|
17
|
+
_options$componentCon;
|
|
19
18
|
_classCallCheck(this, BasicInput);
|
|
20
19
|
_defineProperty(this, "name", void 0);
|
|
21
20
|
_defineProperty(this, "id", void 0);
|
|
@@ -30,7 +29,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
30
29
|
_defineProperty(this, "dataType", void 0);
|
|
31
30
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
32
31
|
var _record;
|
|
33
|
-
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record !== void 0 ? _record :
|
|
32
|
+
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record !== void 0 ? _record : "--");
|
|
34
33
|
});
|
|
35
34
|
_defineProperty(this, "renderLog", function (r) {
|
|
36
35
|
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_input")])) return null;
|
|
@@ -41,7 +40,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
41
40
|
});
|
|
42
41
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
43
42
|
var _record2;
|
|
44
|
-
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record2 !== void 0 ? _record2 :
|
|
43
|
+
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record2 !== void 0 ? _record2 : "--";
|
|
45
44
|
});
|
|
46
45
|
_defineProperty(this, "renderClient", function (record) {
|
|
47
46
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -71,10 +70,10 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
71
70
|
// 过滤组件id
|
|
72
71
|
name: item.name,
|
|
73
72
|
// 过滤组件名称
|
|
74
|
-
filterComponentType:
|
|
73
|
+
filterComponentType: "Input",
|
|
75
74
|
filterFn: function filterFn(value) {
|
|
76
75
|
return function (i) {
|
|
77
|
-
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
76
|
+
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, "input")).includes(value);
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
79
|
};
|
|
@@ -85,13 +84,28 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
85
84
|
this.formField = "".concat(options.id, "_input");
|
|
86
85
|
this.type = options.type;
|
|
87
86
|
this.componentConfig = options.componentConfig;
|
|
88
|
-
this.rules =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
this.rules = [{
|
|
88
|
+
validator: function validator(_, value) {
|
|
89
|
+
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
|
|
90
|
+
var number = /^(([0-9]*(\.[0-9]{1,})$)|([0-9]+$))/;
|
|
91
|
+
var mail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
|
|
92
|
+
var phone = /^1\d{10}$/;
|
|
93
|
+
var testList = [];
|
|
94
|
+
((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.isNumber) && testList.push(number);
|
|
95
|
+
((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.isMail) && testList.push(mail);
|
|
96
|
+
((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.isPhone) && testList.push(phone);
|
|
97
|
+
var isTest = testList.some(function (item) {
|
|
98
|
+
return item.test(value);
|
|
99
|
+
});
|
|
100
|
+
if (!isTest) {
|
|
101
|
+
return Promise.reject(new Error("请填写正确的格式"));
|
|
102
|
+
}
|
|
103
|
+
return Promise.resolve();
|
|
104
|
+
}
|
|
105
|
+
}];
|
|
92
106
|
this.isCombinationComponent = false;
|
|
93
107
|
this.canSort = true;
|
|
94
108
|
this.children = [];
|
|
95
|
-
this.dataType = options !== null && options !== void 0 && (_options$
|
|
109
|
+
this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? "number" : "string";
|
|
96
110
|
});
|
|
97
111
|
export default BasicInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const Popover: ({ Overlay, ShowComponent }: any) =>
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Popover: ({ Overlay, ShowComponent }: any) => JSX.Element;
|
|
3
3
|
export default Popover;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
|
+
declare class BasicInput implements ComponentInterface {
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
sortField: string;
|
|
8
|
+
type: string;
|
|
9
|
+
rules: any[];
|
|
10
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
addressDateInstance: InstanceType<typeof AddressData>;
|
|
17
|
+
constructor(options: PickOption);
|
|
18
|
+
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
19
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
+
getComponentValue: (r: Record) => {
|
|
21
|
+
province: any;
|
|
22
|
+
city: any;
|
|
23
|
+
district: any;
|
|
24
|
+
detail: any;
|
|
25
|
+
name: any;
|
|
26
|
+
mobile: any;
|
|
27
|
+
};
|
|
28
|
+
renderExport: (value: any, record: Record) => string | null;
|
|
29
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
30
|
+
editRender: (p: any) => React.JSX.Element;
|
|
31
|
+
filterConfig: (item: ColumnConfig) => never[];
|
|
32
|
+
}
|
|
33
|
+
export default BasicInput;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { ApaasPosting } from "@kmkf-fe-packages/basic-components";
|
|
10
|
+
import GetFormItem from "../GetFormItem";
|
|
11
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
12
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
|
+
import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
|
+
var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
15
|
+
var _this = this,
|
|
16
|
+
_options$componentCon;
|
|
17
|
+
_classCallCheck(this, BasicInput);
|
|
18
|
+
_defineProperty(this, "name", void 0);
|
|
19
|
+
_defineProperty(this, "id", void 0);
|
|
20
|
+
_defineProperty(this, "sortField", void 0);
|
|
21
|
+
_defineProperty(this, "type", void 0);
|
|
22
|
+
_defineProperty(this, "rules", void 0);
|
|
23
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
24
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
25
|
+
_defineProperty(this, "formField", void 0);
|
|
26
|
+
_defineProperty(this, "canSort", void 0);
|
|
27
|
+
_defineProperty(this, "children", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "addressDateInstance", void 0);
|
|
30
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
31
|
+
var _ref;
|
|
32
|
+
var province = record["".concat(_this.id, "_postingProvince")];
|
|
33
|
+
var city = record["".concat(_this.id, "_postingCity")];
|
|
34
|
+
var district = record["".concat(_this.id, "_postingDistrict")];
|
|
35
|
+
var detail = record["".concat(_this.id, "_postingDetail")];
|
|
36
|
+
var name = record["".concat(_this.id, "_postingReceiverName")];
|
|
37
|
+
var mobile = record["".concat(_this.id, "_postingReceiverMobile")];
|
|
38
|
+
if (province === undefined) {
|
|
39
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
40
|
+
}
|
|
41
|
+
var addressText = (_ref = [province, city, district]) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
|
|
42
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
43
|
+
}).join("");
|
|
44
|
+
return /*#__PURE__*/React.createElement("span", null, "".concat(addressText).concat(detail), /*#__PURE__*/React.createElement("br", null), "".concat(name, " ").concat(mobile));
|
|
45
|
+
});
|
|
46
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
47
|
+
var _ref2;
|
|
48
|
+
var _this$getComponentVal = _this.getComponentValue(r),
|
|
49
|
+
province = _this$getComponentVal.province,
|
|
50
|
+
city = _this$getComponentVal.city,
|
|
51
|
+
district = _this$getComponentVal.district,
|
|
52
|
+
detail = _this$getComponentVal.detail,
|
|
53
|
+
name = _this$getComponentVal.name,
|
|
54
|
+
mobile = _this$getComponentVal.mobile;
|
|
55
|
+
if ([province, detail, name, mobile].every(function (item) {
|
|
56
|
+
return isNull(item);
|
|
57
|
+
})) return null;
|
|
58
|
+
var addressText = (_ref2 = [province, city, district]) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (suffix) {
|
|
59
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
60
|
+
}).join("");
|
|
61
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, "".concat(addressText).concat(detail, " ").concat(name).concat(mobile));
|
|
62
|
+
});
|
|
63
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
64
|
+
return {
|
|
65
|
+
province: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingProvince")],
|
|
66
|
+
city: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingCity")],
|
|
67
|
+
district: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingDistrict")],
|
|
68
|
+
detail: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingDetail")]) || "",
|
|
69
|
+
name: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingReceiverName")]) || "",
|
|
70
|
+
mobile: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_postingReceiverMobile")]) || ""
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
74
|
+
var _ref3;
|
|
75
|
+
var _this$getComponentVal2 = _this.getComponentValue(record),
|
|
76
|
+
province = _this$getComponentVal2.province,
|
|
77
|
+
city = _this$getComponentVal2.city,
|
|
78
|
+
district = _this$getComponentVal2.district,
|
|
79
|
+
detail = _this$getComponentVal2.detail,
|
|
80
|
+
name = _this$getComponentVal2.name,
|
|
81
|
+
mobile = _this$getComponentVal2.mobile;
|
|
82
|
+
if ([province, detail, name, mobile].every(function (item) {
|
|
83
|
+
return isNull(item);
|
|
84
|
+
})) return null;
|
|
85
|
+
var addressText = (_ref3 = [province, city, district]) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (suffix) {
|
|
86
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
87
|
+
}).join("");
|
|
88
|
+
return "".concat(addressText).concat(detail, " ").concat(name).concat(mobile);
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
91
|
+
var _ref4;
|
|
92
|
+
var province = record["".concat(_this.id, "_postingProvince")];
|
|
93
|
+
var city = record["".concat(_this.id, "_postingCity")];
|
|
94
|
+
var district = record["".concat(_this.id, "_postingDistrict")];
|
|
95
|
+
var detail = record["".concat(_this.id, "_postingDetail")];
|
|
96
|
+
var name = record["".concat(_this.id, "_postingReceiverName")];
|
|
97
|
+
var mobile = record["".concat(_this.id, "_postingReceiverMobile")];
|
|
98
|
+
var addressText = (_ref4 = [province, city, district]) === null || _ref4 === void 0 ? void 0 : _ref4.map(function (suffix) {
|
|
99
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
100
|
+
}).join("");
|
|
101
|
+
var hasValue = addressText || detail || name || mobile;
|
|
102
|
+
var value = hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join("/"), /*#__PURE__*/React.createElement("br", null), [name, mobile].join("/")) : null;
|
|
103
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
104
|
+
id: _this.id,
|
|
105
|
+
label: _this.name,
|
|
106
|
+
value: value
|
|
107
|
+
}) : null;
|
|
108
|
+
});
|
|
109
|
+
_defineProperty(this, "editRender", function (p) {
|
|
110
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
111
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
112
|
+
title: _this.name,
|
|
113
|
+
name: _this.id,
|
|
114
|
+
rules: _this.rules,
|
|
115
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
116
|
+
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,
|
|
117
|
+
component: /*#__PURE__*/React.createElement(ApaasPosting, _this.componentConfig)
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
121
|
+
return [];
|
|
122
|
+
});
|
|
123
|
+
this.name = options.name;
|
|
124
|
+
this.id = options.id;
|
|
125
|
+
this.sortField = "".concat(options.id);
|
|
126
|
+
this.formField = "".concat(options.id);
|
|
127
|
+
this.type = options.type;
|
|
128
|
+
this.componentConfig = options.componentConfig;
|
|
129
|
+
this.isCombinationComponent = false;
|
|
130
|
+
this.canSort = true;
|
|
131
|
+
this.children = [];
|
|
132
|
+
this.dataType = "string";
|
|
133
|
+
this.addressDateInstance = AddressData.getInstance();
|
|
134
|
+
this.rules = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.required ? [{
|
|
135
|
+
validator: function validator(_, value) {
|
|
136
|
+
var _value$postingAddress;
|
|
137
|
+
if (!(value !== null && value !== void 0 && (_value$postingAddress = value.postingAddress) !== null && _value$postingAddress !== void 0 && _value$postingAddress.length) || !(value !== null && value !== void 0 && value.postingDetail) || !(value !== null && value !== void 0 && value.postingReceiverName) || !(value !== null && value !== void 0 && value.postingReceiverMobile)) {
|
|
138
|
+
return Promise.reject(new Error("请填写地址"));
|
|
139
|
+
}
|
|
140
|
+
return Promise.resolve();
|
|
141
|
+
}
|
|
142
|
+
}] : [];
|
|
143
|
+
});
|
|
144
|
+
export default BasicInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { GoodsProps } from '@kmkf-fe-packages/basic-components/dist/common/Goods';
|
|
3
|
-
declare const ItemEncode: (props: JSX.IntrinsicAttributes & GoodsProps) =>
|
|
3
|
+
declare const ItemEncode: (props: JSX.IntrinsicAttributes & GoodsProps) => JSX.Element;
|
|
4
4
|
export default ItemEncode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, Record, ColumnConfig } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, Record, ColumnConfig } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
3
|
declare type Value = string | string[] | undefined;
|
|
4
4
|
declare class BasicDataTime implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
@@ -14,8 +14,8 @@ declare class BasicDataTime implements ComponentInterface {
|
|
|
14
14
|
canSort: boolean;
|
|
15
15
|
children: ComponentInterface[];
|
|
16
16
|
dataMap: Record;
|
|
17
|
-
dataType: ComponentInterface[
|
|
18
|
-
format: ComponentInterface[
|
|
17
|
+
dataType: ComponentInterface["dataType"];
|
|
18
|
+
format: ComponentInterface["format"];
|
|
19
19
|
constructor(options: PickOption);
|
|
20
20
|
render: (value: Value) => React.JSX.Element;
|
|
21
21
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
@@ -24,7 +24,7 @@ declare class BasicDataTime implements ComponentInterface {
|
|
|
24
24
|
getComponentValue: (r: Record) => any;
|
|
25
25
|
renderExport: (value: unknown, record: Record) => any;
|
|
26
26
|
editRender: (p: any) => React.JSX.Element;
|
|
27
|
-
getKeyByComponentType: (type: string) =>
|
|
27
|
+
getKeyByComponentType: (type: string) => any;
|
|
28
28
|
filterConfig: (item: ColumnConfig) => {
|
|
29
29
|
searchDefaultConditions: "between";
|
|
30
30
|
type: string;
|