@kmkf-fe-packages/services-components 1.16.3-beta.2 → 1.16.4-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/components/Checkbox/index.js +3 -2
- package/dist/esm/components/JST/JstSupply/index.d.ts +0 -7
- package/dist/esm/components/JST/JstSupply/index.js +11 -42
- package/dist/esm/components/LogisticsInterception/index.d.ts +0 -3
- package/dist/esm/components/LogisticsInterception/index.js +4 -12
- package/package.json +4 -4
- package/dist/esm/components/LogisticsInterception/InterceptApiStatus.d.ts +0 -38
- package/dist/esm/components/LogisticsInterception/InterceptApiStatus.js +0 -113
|
@@ -7,6 +7,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
7
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
8
|
import React from 'react';
|
|
9
9
|
import intersection from 'lodash/intersection';
|
|
10
|
+
import get from 'lodash/get';
|
|
10
11
|
import { ApaasCheckbox } from '@kmkf-fe-packages/basic-components';
|
|
11
12
|
import GetFormItem from "../GetFormItem";
|
|
12
13
|
import ItemView from "../../commonComponents/ItemView";
|
|
@@ -66,11 +67,11 @@ var BasicCheckbox = /*#__PURE__*/_createClass(function BasicCheckbox(options) {
|
|
|
66
67
|
};
|
|
67
68
|
});
|
|
68
69
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
69
|
-
var
|
|
70
|
+
var _get;
|
|
70
71
|
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_checkbox")]) === undefined) {
|
|
71
72
|
return '--';
|
|
72
73
|
}
|
|
73
|
-
return "".concat(
|
|
74
|
+
return "".concat((_get = get(record, "".concat(_this.id, "_checkbox"), [])) === null || _get === void 0 ? void 0 : _get.join('/'), " ").concat((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_checkboxOther")]) || '');
|
|
74
75
|
});
|
|
75
76
|
_defineProperty(this, "renderClient", function (record) {
|
|
76
77
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -4,12 +4,6 @@ declare class JstSupply implements ComponentInterface {
|
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
|
-
sortChildField: {
|
|
8
|
-
name: string;
|
|
9
|
-
key: string;
|
|
10
|
-
dataType: string;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}[];
|
|
13
7
|
type: string;
|
|
14
8
|
rules: any[];
|
|
15
9
|
componentConfig: ComponentInterface["componentConfig"];
|
|
@@ -20,7 +14,6 @@ declare class JstSupply implements ComponentInterface {
|
|
|
20
14
|
children: ComponentInterface[];
|
|
21
15
|
dataType: ComponentInterface["dataType"];
|
|
22
16
|
constructor(options: PickOption);
|
|
23
|
-
getSortChildFields: (type: string, options: PickOption) => any;
|
|
24
17
|
renderClient: (record: Record) => React.JSX.Element | null;
|
|
25
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
26
19
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -14,15 +14,13 @@ import { JstGoods } from "@kmkf-fe-packages/basic-components";
|
|
|
14
14
|
import ItemView from "../../../commonComponents/ItemView";
|
|
15
15
|
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
16
|
import { SYMBOL } from "../../../constant";
|
|
17
|
-
var JstSupply = /*#__PURE__*/_createClass(function JstSupply(
|
|
17
|
+
var JstSupply = /*#__PURE__*/_createClass(function JstSupply(options) {
|
|
18
18
|
var _this = this,
|
|
19
|
-
_this$componentConfig3
|
|
20
|
-
_this$componentConfig4;
|
|
19
|
+
_this$componentConfig3;
|
|
21
20
|
_classCallCheck(this, JstSupply);
|
|
22
21
|
_defineProperty(this, "name", void 0);
|
|
23
22
|
_defineProperty(this, "id", void 0);
|
|
24
23
|
_defineProperty(this, "sortField", void 0);
|
|
25
|
-
_defineProperty(this, "sortChildField", void 0);
|
|
26
24
|
_defineProperty(this, "type", void 0);
|
|
27
25
|
_defineProperty(this, "rules", void 0);
|
|
28
26
|
_defineProperty(this, "componentConfig", void 0);
|
|
@@ -32,34 +30,6 @@ var JstSupply = /*#__PURE__*/_createClass(function JstSupply(_options) {
|
|
|
32
30
|
_defineProperty(this, "canSort", void 0);
|
|
33
31
|
_defineProperty(this, "children", void 0);
|
|
34
32
|
_defineProperty(this, "dataType", void 0);
|
|
35
|
-
_defineProperty(this, "getSortChildFields", function (type, options) {
|
|
36
|
-
if (!type) {
|
|
37
|
-
return [{
|
|
38
|
-
name: "jst供销商名称",
|
|
39
|
-
key: "".concat(options.id, "_supplyName"),
|
|
40
|
-
dataType: "string"
|
|
41
|
-
}, {
|
|
42
|
-
name: "jst供销商编码",
|
|
43
|
-
key: "".concat(options.id, "_supplyId"),
|
|
44
|
-
dataType: "string"
|
|
45
|
-
}];
|
|
46
|
-
}
|
|
47
|
-
if (type === "supplyName") {
|
|
48
|
-
return [{
|
|
49
|
-
name: "jst供销商名称",
|
|
50
|
-
key: "".concat(options.id, "_supplyName"),
|
|
51
|
-
dataType: "string"
|
|
52
|
-
}];
|
|
53
|
-
}
|
|
54
|
-
if (type === "supplyId") {
|
|
55
|
-
return [{
|
|
56
|
-
name: "jst供销商编码",
|
|
57
|
-
key: "".concat(options.id, "_supplyId"),
|
|
58
|
-
dataType: "string"
|
|
59
|
-
}];
|
|
60
|
-
}
|
|
61
|
-
return [];
|
|
62
|
-
});
|
|
63
33
|
_defineProperty(this, "renderClient", function (record) {
|
|
64
34
|
var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
|
|
65
35
|
return !isNull(item);
|
|
@@ -149,22 +119,21 @@ var JstSupply = /*#__PURE__*/_createClass(function JstSupply(_options) {
|
|
|
149
119
|
}
|
|
150
120
|
}];
|
|
151
121
|
});
|
|
152
|
-
this.name =
|
|
153
|
-
this.id =
|
|
154
|
-
this.sortField = "".concat(
|
|
155
|
-
this.formField = "".concat(
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
this.componentConfig = _options.componentConfig;
|
|
122
|
+
this.name = options.name;
|
|
123
|
+
this.id = options.id;
|
|
124
|
+
this.sortField = "".concat(options.id, "_jstItemList");
|
|
125
|
+
this.formField = "".concat(options.id, "_jstItemList");
|
|
126
|
+
this.type = options.type;
|
|
127
|
+
this.componentConfig = options.componentConfig;
|
|
159
128
|
this.isCombinationComponent = false;
|
|
160
129
|
this.canSort = false;
|
|
161
130
|
this.children = [];
|
|
162
131
|
this.dataType = "object";
|
|
163
|
-
this.rules = (_this$
|
|
132
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
164
133
|
required: true,
|
|
165
134
|
validator: function validator(_, value) {
|
|
166
|
-
var _this$
|
|
167
|
-
var showField = (_this === null || _this === void 0 ? void 0 : (_this$
|
|
135
|
+
var _this$componentConfig4;
|
|
136
|
+
var showField = (_this === null || _this === void 0 ? void 0 : (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "";
|
|
168
137
|
if (!value || !value.length) {
|
|
169
138
|
return Promise.reject(new Error("请选择宝贝"));
|
|
170
139
|
}
|
|
@@ -7,7 +7,6 @@ import InterceptAddress from "./InterceptAddress";
|
|
|
7
7
|
import InterceptType from "./InterceptType";
|
|
8
8
|
import InterceptStatus from "./InterceptStatus";
|
|
9
9
|
import InterceptState from "./InterceptState";
|
|
10
|
-
import InterceptApiStatus from "./InterceptApiStatus";
|
|
11
10
|
import Express from "../Express";
|
|
12
11
|
import ExpressCode from "../ExpressCode";
|
|
13
12
|
declare class Logistics implements ComponentInterface {
|
|
@@ -21,7 +20,6 @@ declare class Logistics implements ComponentInterface {
|
|
|
21
20
|
interceptAddress: InterceptAddress;
|
|
22
21
|
interceptType: InterceptType;
|
|
23
22
|
interceptLogisticsStatus: InterceptStatus;
|
|
24
|
-
interceptApiStatus: InterceptApiStatus;
|
|
25
23
|
interceptSenderMobile: InterceptSenderMobile;
|
|
26
24
|
interceptSnapshot: InterceptSnapshot;
|
|
27
25
|
interceptState: InterceptState;
|
|
@@ -45,7 +43,6 @@ declare class Logistics implements ComponentInterface {
|
|
|
45
43
|
interceptSenderMobile: any;
|
|
46
44
|
interceptType: any;
|
|
47
45
|
interceptLogisticsStatus: any;
|
|
48
|
-
interceptApiStatus: any;
|
|
49
46
|
interceptRedirectTo: {
|
|
50
47
|
province: any;
|
|
51
48
|
city: any;
|
|
@@ -18,7 +18,6 @@ import InterceptAddress from "./InterceptAddress";
|
|
|
18
18
|
import InterceptType from "./InterceptType";
|
|
19
19
|
import InterceptStatus from "./InterceptStatus";
|
|
20
20
|
import InterceptState from "./InterceptState";
|
|
21
|
-
import InterceptApiStatus from "./InterceptApiStatus";
|
|
22
21
|
import Express from "../Express";
|
|
23
22
|
import ExpressCode from "../ExpressCode";
|
|
24
23
|
import ColumnHeader from "./columnHeader";
|
|
@@ -35,7 +34,6 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
35
34
|
_defineProperty(this, "interceptAddress", void 0);
|
|
36
35
|
_defineProperty(this, "interceptType", void 0);
|
|
37
36
|
_defineProperty(this, "interceptLogisticsStatus", void 0);
|
|
38
|
-
_defineProperty(this, "interceptApiStatus", void 0);
|
|
39
37
|
_defineProperty(this, "interceptSenderMobile", void 0);
|
|
40
38
|
_defineProperty(this, "interceptSnapshot", void 0);
|
|
41
39
|
_defineProperty(this, "interceptState", void 0);
|
|
@@ -51,14 +49,10 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
51
49
|
_defineProperty(this, "effects", void 0);
|
|
52
50
|
_defineProperty(this, "dataType", void 0);
|
|
53
51
|
_defineProperty(this, "renderClient", function (record) {
|
|
54
|
-
record
|
|
55
|
-
status: '失败',
|
|
56
|
-
reason: '返回失败'
|
|
57
|
-
};
|
|
58
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record), _this.interceptSenderMobile.renderClient(record), _this.interceptType.renderClient(record), _this.interceptAddress.renderClient(record), _this.interceptLogisticsStatus.renderClient(record), _this.interceptApiStatus.renderClient(record), _this.interceptSnapshot.renderClient(record), _this.interceptState.renderClient(record));
|
|
52
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record), _this.interceptSenderMobile.renderClient(record), _this.interceptType.renderClient(record), _this.interceptAddress.renderClient(record), _this.interceptLogisticsStatus.renderClient(record), _this.interceptSnapshot.renderClient(record), _this.interceptState.renderClient(record));
|
|
59
53
|
});
|
|
60
54
|
_defineProperty(this, "renderLog", function (record) {
|
|
61
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, !isNull(_this.express.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.name, ": ", _this.express.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.expressCode.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.expressCode.name, ": ", _this.expressCode.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptSenderMobile.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptSenderMobile.name, ":", " ", _this.interceptSenderMobile.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptType.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptType.name, ": ", _this.interceptType.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptAddress.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptAddress.name, ":", " ", _this.interceptAddress.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptLogisticsStatus.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptLogisticsStatus.name, ":", " ", _this.interceptLogisticsStatus.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.
|
|
55
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, !isNull(_this.express.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.name, ": ", _this.express.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.expressCode.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.expressCode.name, ": ", _this.expressCode.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptSenderMobile.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptSenderMobile.name, ":", " ", _this.interceptSenderMobile.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptType.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptType.name, ": ", _this.interceptType.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptAddress.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptAddress.name, ":", " ", _this.interceptAddress.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptLogisticsStatus.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptLogisticsStatus.name, ":", " ", _this.interceptLogisticsStatus.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptSnapshot.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptSnapshot.name, ":", " ", _this.interceptSnapshot.renderLog(record))), /*#__PURE__*/React.createElement("div", null, !isNull(_this.interceptState.getComponentValue(record)) && /*#__PURE__*/React.createElement(React.Fragment, null, _this.interceptState.name, ":", " ", _this.interceptState.renderLog(record))));
|
|
62
56
|
});
|
|
63
57
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
64
58
|
return {
|
|
@@ -67,7 +61,6 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
67
61
|
interceptSenderMobile: _this.interceptSenderMobile.getComponentValue(r),
|
|
68
62
|
interceptType: _this.interceptType.getComponentValue(r),
|
|
69
63
|
interceptLogisticsStatus: _this.interceptLogisticsStatus.getComponentValue(r),
|
|
70
|
-
interceptApiStatus: _this.interceptApiStatus.getComponentValue(r),
|
|
71
64
|
interceptRedirectTo: _this.interceptAddress.getComponentValue(r),
|
|
72
65
|
interceptSnapshot: _this.interceptSnapshot.getComponentValue(r),
|
|
73
66
|
interceptState: _this.interceptState.getComponentValue(r)
|
|
@@ -102,7 +95,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
102
95
|
subKey: "interceptCompany"
|
|
103
96
|
})), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
|
|
104
97
|
subKey: "interceptCode"
|
|
105
|
-
})), _this.interceptSenderMobile.filterConfig(item), _this.interceptLogisticsStatus.filterConfig(item), _this.
|
|
98
|
+
})), _this.interceptSenderMobile.filterConfig(item), _this.interceptLogisticsStatus.filterConfig(item), _this.interceptType.filterConfig(item), _this.interceptSnapshot.filterConfig(item), _this.interceptState.filterConfig(item)];
|
|
106
99
|
});
|
|
107
100
|
this.name = options.name;
|
|
108
101
|
this.columnHeader = /*#__PURE__*/React.createElement(ColumnHeader, {
|
|
@@ -120,7 +113,6 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
120
113
|
this.interceptAddress = new InterceptAddress(options);
|
|
121
114
|
this.interceptType = new InterceptType(options);
|
|
122
115
|
this.interceptLogisticsStatus = new InterceptStatus(options);
|
|
123
|
-
this.interceptApiStatus = new InterceptApiStatus(options);
|
|
124
116
|
this.interceptSenderMobile = new InterceptSenderMobile(options);
|
|
125
117
|
this.interceptSnapshot = new InterceptSnapshot(options);
|
|
126
118
|
this.interceptState = new InterceptState(options);
|
|
@@ -135,7 +127,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
|
|
|
135
127
|
this.isCombinationComponent = true;
|
|
136
128
|
this.canSort = false;
|
|
137
129
|
this.dataType = "object";
|
|
138
|
-
this.children = [this.express, this.expressCode, this.interceptType, this.interceptAddress, this.interceptLogisticsStatus, this.
|
|
130
|
+
this.children = [this.express, this.expressCode, this.interceptType, this.interceptAddress, this.interceptLogisticsStatus, this.interceptSnapshot, this.interceptState];
|
|
139
131
|
this.rules = [{
|
|
140
132
|
validator: function validator(_, value) {
|
|
141
133
|
var _this$componentConfig5, _this$componentConfig6, _value$interceptAddre, _value$interceptSende;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.4-alpha.0",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "1.16.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "1.16.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "1.16.4-alpha.0",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "1.16.4-alpha.0",
|
|
26
26
|
"b64-to-blob": "^1.2.19",
|
|
27
27
|
"html2canvas": "^1.4.1",
|
|
28
28
|
"react-pdf-js": "^5.1.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0a02907a6d1a1075e0f1a4cfbe657b620715a3d7",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
|
|
2
|
-
import React from "react";
|
|
3
|
-
declare class InterceptApiStatus implements ComponentInterface {
|
|
4
|
-
name: string;
|
|
5
|
-
id: string;
|
|
6
|
-
sortField: string;
|
|
7
|
-
type: string;
|
|
8
|
-
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
-
effects: ComponentInterface["effects"];
|
|
11
|
-
align: ALignType;
|
|
12
|
-
width: number;
|
|
13
|
-
isCombinationComponent: boolean;
|
|
14
|
-
formField: string;
|
|
15
|
-
canSort: boolean;
|
|
16
|
-
children: ComponentInterface[];
|
|
17
|
-
dataType: ComponentInterface["dataType"];
|
|
18
|
-
options: ComponentInterface["options"];
|
|
19
|
-
constructor(options: PickOption);
|
|
20
|
-
getComponentValue: (r: Record) => any;
|
|
21
|
-
renderClient: (record: any) => React.JSX.Element | null;
|
|
22
|
-
renderPc: (value: any, record: Record) => React.JSX.Element | "--";
|
|
23
|
-
renderLog: (r: Record) => React.JSX.Element | "--" | null;
|
|
24
|
-
renderExport: (value: any, record: Record) => any;
|
|
25
|
-
editRender: () => null;
|
|
26
|
-
filterConfig: (item: ColumnConfig) => {
|
|
27
|
-
searchDefaultConditions: "in";
|
|
28
|
-
type: string;
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
filterComponentType: "MultipleSelect";
|
|
32
|
-
props: {
|
|
33
|
-
options: any[];
|
|
34
|
-
};
|
|
35
|
-
filterFn: (value: string) => (i: Record) => boolean;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export default InterceptApiStatus;
|
|
@@ -1,113 +0,0 @@
|
|
|
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 ItemView from "../../commonComponents/ItemView";
|
|
10
|
-
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
|
-
import { SYMBOL } from "../../constant";
|
|
12
|
-
var InterceptApiStatus = /*#__PURE__*/_createClass(function InterceptApiStatus(options) {
|
|
13
|
-
var _this = this;
|
|
14
|
-
_classCallCheck(this, InterceptApiStatus);
|
|
15
|
-
_defineProperty(this, "name", void 0);
|
|
16
|
-
_defineProperty(this, "id", void 0);
|
|
17
|
-
_defineProperty(this, "sortField", void 0);
|
|
18
|
-
_defineProperty(this, "type", void 0);
|
|
19
|
-
_defineProperty(this, "rules", void 0);
|
|
20
|
-
_defineProperty(this, "componentConfig", void 0);
|
|
21
|
-
_defineProperty(this, "effects", void 0);
|
|
22
|
-
_defineProperty(this, "align", void 0);
|
|
23
|
-
_defineProperty(this, "width", 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, "options", void 0);
|
|
30
|
-
_defineProperty(this, "getComponentValue", function (r) {
|
|
31
|
-
var _r$_this$id;
|
|
32
|
-
return r === null || r === void 0 ? void 0 : (_r$_this$id = r[_this.id]) === null || _r$_this$id === void 0 ? void 0 : _r$_this$id.status;
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(this, "renderClient", function (record) {
|
|
35
|
-
var _record$_this$id, _record$_this$id2, _record$_this$id3, _record$_this$id4, _record$_this$id5;
|
|
36
|
-
var status = record === null || record === void 0 ? void 0 : (_record$_this$id = record[_this.id]) === null || _record$_this$id === void 0 ? void 0 : _record$_this$id.status;
|
|
37
|
-
var statusColor = status === "成功" ? "#52c41a" : "#ff4d4f";
|
|
38
|
-
return !isNull(record === null || record === void 0 ? void 0 : (_record$_this$id2 = record[_this.id]) === null || _record$_this$id2 === void 0 ? void 0 : _record$_this$id2.status) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
39
|
-
id: _this.id,
|
|
40
|
-
label: _this.name,
|
|
41
|
-
value: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
style: {
|
|
43
|
-
color: statusColor
|
|
44
|
-
}
|
|
45
|
-
}, record === null || record === void 0 ? void 0 : (_record$_this$id3 = record[_this.id]) === null || _record$_this$id3 === void 0 ? void 0 : _record$_this$id3.status, record !== null && record !== void 0 && (_record$_this$id4 = record[_this.id]) !== null && _record$_this$id4 !== void 0 && _record$_this$id4.reason ? /*#__PURE__*/React.createElement("span", {
|
|
46
|
-
className: "c-red"
|
|
47
|
-
}, ",", (record === null || record === void 0 ? void 0 : (_record$_this$id5 = record[_this.id]) === null || _record$_this$id5 === void 0 ? void 0 : _record$_this$id5.reason) || "") : null))
|
|
48
|
-
}) : null;
|
|
49
|
-
});
|
|
50
|
-
_defineProperty(this, "renderPc", function (value, record) {
|
|
51
|
-
var _record$_this$id6, _record$_this$id7, _record$_this$id8, _record$_this$id9;
|
|
52
|
-
var status = record === null || record === void 0 ? void 0 : (_record$_this$id6 = record[_this.id]) === null || _record$_this$id6 === void 0 ? void 0 : _record$_this$id6.status;
|
|
53
|
-
var statusColor = status === "成功" ? "#52c41a" : "#ff4d4f";
|
|
54
|
-
return !isNull(status) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
style: {
|
|
56
|
-
color: statusColor
|
|
57
|
-
}
|
|
58
|
-
}, record === null || record === void 0 ? void 0 : (_record$_this$id7 = record[_this.id]) === null || _record$_this$id7 === void 0 ? void 0 : _record$_this$id7.status, record !== null && record !== void 0 && (_record$_this$id8 = record[_this.id]) !== null && _record$_this$id8 !== void 0 && _record$_this$id8.reason ? /*#__PURE__*/React.createElement("span", {
|
|
59
|
-
className: "c-red"
|
|
60
|
-
}, ",", (record === null || record === void 0 ? void 0 : (_record$_this$id9 = record[_this.id]) === null || _record$_this$id9 === void 0 ? void 0 : _record$_this$id9.reason) || "") : null)) : "--";
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(this, "renderLog", function (r) {
|
|
63
|
-
var _r$_this$id2;
|
|
64
|
-
if (isNull(r === null || r === void 0 ? void 0 : (_r$_this$id2 = r[_this.id]) === null || _r$_this$id2 === void 0 ? void 0 : _r$_this$id2.status)) return null;
|
|
65
|
-
return _this.renderPc(undefined, r);
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(this, "renderExport", function (value, record) {
|
|
68
|
-
var _record$_this$id$stat, _record$_this$id10;
|
|
69
|
-
return (_record$_this$id$stat = record === null || record === void 0 ? void 0 : (_record$_this$id10 = record[_this.id]) === null || _record$_this$id10 === void 0 ? void 0 : _record$_this$id10.status) !== null && _record$_this$id$stat !== void 0 ? _record$_this$id$stat : "--";
|
|
70
|
-
});
|
|
71
|
-
_defineProperty(this, "editRender", function () {
|
|
72
|
-
return null;
|
|
73
|
-
});
|
|
74
|
-
_defineProperty(this, "filterConfig", function (item) {
|
|
75
|
-
return {
|
|
76
|
-
searchDefaultConditions: SYMBOL.in,
|
|
77
|
-
type: item.type,
|
|
78
|
-
id: "".concat(item.id, "_interceptLogisticsApiStatus"),
|
|
79
|
-
name: "".concat(item.name, "-\u63A5\u53E3\u72B6\u6001"),
|
|
80
|
-
filterComponentType: "MultipleSelect",
|
|
81
|
-
props: {
|
|
82
|
-
options: _this.options || []
|
|
83
|
-
},
|
|
84
|
-
filterFn: function filterFn(value) {
|
|
85
|
-
return function (i) {
|
|
86
|
-
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, "status"));
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
this.name = "接口状态";
|
|
92
|
-
this.id = "".concat(options.id, "_interceptLogisticsApiStatus");
|
|
93
|
-
this.sortField = "".concat(options.id, "_interceptLogisticsApiStatus");
|
|
94
|
-
this.formField = "".concat(options.id, "_interceptLogisticsApiStatus");
|
|
95
|
-
this.type = options.type;
|
|
96
|
-
this.componentConfig = options.componentConfig;
|
|
97
|
-
this.rules = [];
|
|
98
|
-
this.align = "left";
|
|
99
|
-
this.width = 200;
|
|
100
|
-
this.isCombinationComponent = false;
|
|
101
|
-
this.canSort = true;
|
|
102
|
-
this.children = [];
|
|
103
|
-
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
104
|
-
this.dataType = "string";
|
|
105
|
-
this.options = [{
|
|
106
|
-
label: "成功",
|
|
107
|
-
value: "成功"
|
|
108
|
-
}, {
|
|
109
|
-
label: "失败",
|
|
110
|
-
value: "失败"
|
|
111
|
-
}];
|
|
112
|
-
});
|
|
113
|
-
export default InterceptApiStatus;
|