@kmkf-fe-packages/services-components 2.0.51 → 2.0.52

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.
Files changed (32) hide show
  1. package/dist/esm/commonComponents/GlobalContext/hook/dist/useGetHasErpData.js +52 -0
  2. package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
  3. package/dist/esm/commonComponents/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
  4. package/dist/esm/commonComponents/OperationLog/index.d.ts +2 -1
  5. package/dist/esm/commonComponents/OperationLog/index.js +6 -2
  6. package/dist/esm/components/BS/BsGoods/dist/index.js +113 -0
  7. package/dist/esm/components/BS/common/BsHeaderChild.d.ts +4 -4
  8. package/dist/esm/components/BS/common/BsHeaderChild.js +8 -10
  9. package/dist/esm/components/BS/common/BsHeaderPic.d.ts +6 -6
  10. package/dist/esm/components/BS/common/BsHeaderPic.js +7 -16
  11. package/dist/esm/components/Common/dist/index.js +1019 -0
  12. package/dist/esm/components/Common/index.d.ts +3 -2
  13. package/dist/esm/components/Common/index.js +187 -143
  14. package/dist/esm/components/Common/index.module.less +1 -0
  15. package/dist/esm/components/Picture/index.d.ts +5 -5
  16. package/dist/esm/components/Picture/index.js +19 -19
  17. package/dist/esm/components/PicturePro/PictureName.d.ts +30 -0
  18. package/dist/esm/components/PicturePro/PictureName.js +132 -0
  19. package/dist/esm/components/PicturePro/PictureUrl.d.ts +26 -0
  20. package/dist/esm/components/PicturePro/PictureUrl.js +93 -0
  21. package/dist/esm/components/PicturePro/index.d.ts +40 -0
  22. package/dist/esm/components/PicturePro/index.js +180 -0
  23. package/dist/esm/components/PicturePro/index.less +63 -0
  24. package/dist/esm/components/StatusSelect/index.js +4 -0
  25. package/dist/esm/constant.d.ts +1 -0
  26. package/dist/esm/constant.js +14 -13
  27. package/dist/esm/factory.d.ts +2 -2
  28. package/dist/esm/factory.js +4 -1
  29. package/dist/esm/index.d.ts +1 -0
  30. package/dist/esm/index.js +1 -0
  31. package/dist/esm/type.d.ts +14 -14
  32. package/package.json +4 -4
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var react_1 = require("react");
5
+ var react_redux_1 = require("react-redux");
6
+ var toolkit_1 = require("@reduxjs/toolkit");
7
+ var getTemplate = function getTemplate(companyUserConfig) {
8
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
9
+ return JSON.stringify({
10
+ hasWln: (_c = (_b = (_a = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _a === void 0 ? void 0 : _a.wln) === null || _b === void 0 ? void 0 : _b.show) !== null && _c !== void 0 ? _c : false,
11
+ hasWdt: (_f = (_e = (_d = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _d === void 0 ? void 0 : _d.wdt) === null || _e === void 0 ? void 0 : _e.show) !== null && _f !== void 0 ? _f : false,
12
+ hasBs: (_j = (_h = (_g = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _g === void 0 ? void 0 : _g.bs) === null || _h === void 0 ? void 0 : _h.show) !== null && _j !== void 0 ? _j : false,
13
+ hasE3: (_m = (_l = (_k = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _k === void 0 ? void 0 : _k.bse3) === null || _l === void 0 ? void 0 : _l.show) !== null && _m !== void 0 ? _m : false,
14
+ hasJst: (_q = (_p = (_o = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _o === void 0 ? void 0 : _o.jst) === null || _p === void 0 ? void 0 : _p.show) !== null && _q !== void 0 ? _q : false,
15
+ hasGy: (_t = (_s = (_r = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _r === void 0 ? void 0 : _r.gy) === null || _s === void 0 ? void 0 : _s.show) !== null && _t !== void 0 ? _t : false
16
+ });
17
+ };
18
+ function useGetHasErpData() {
19
+ var companyUserConfig = react_redux_1.useSelector(toolkit_1.createSelector([function (state) {
20
+ var _a, _b, _c, _d;
21
+ console.log("state--useSelector", state);
22
+ /**
23
+ * pc main
24
+ * 端 workOrder
25
+ * **/
26
+ return (_d = (_b = (_a = state === null || state === void 0 ? void 0 : state.main) === null || _a === void 0 ? void 0 : _a.userInfo) !== null && _b !== void 0 ? _b : (_c = state === null || state === void 0 ? void 0 : state.workOrder) === null || _c === void 0 ? void 0 : _c.userInfo) !== null && _d !== void 0 ? _d : {};
27
+ }], function (state) {
28
+ var _a;
29
+ var companyUserConfig = (_a = state === null || state === void 0 ? void 0 : state.companyUserConfig) !== null && _a !== void 0 ? _a : {};
30
+ if (typeof companyUserConfig === "string") {
31
+ try {
32
+ companyUserConfig = JSON.parse(companyUserConfig);
33
+ } catch (e) {
34
+ console.error("companyUserConfig转换异常", companyUserConfig);
35
+ companyUserConfig = {};
36
+ }
37
+ }
38
+ return companyUserConfig;
39
+ }));
40
+ var _a = react_1.useState(getTemplate({})),
41
+ hasErpDataJson = _a[0],
42
+ setHasErpDataJson = _a[1];
43
+ react_1.useEffect(function () {
44
+ setHasErpDataJson(getTemplate(companyUserConfig));
45
+ console.log("companyUserConfig---", companyUserConfig);
46
+ }, [companyUserConfig]);
47
+ var hasErpData = react_1.useMemo(function () {
48
+ return JSON.parse(hasErpDataJson);
49
+ }, [hasErpDataJson]);
50
+ return hasErpData;
51
+ }
52
+ exports["default"] = useGetHasErpData;
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) {
5
+ return value instanceof P ? value : new P(function (resolve) {
6
+ resolve(value);
7
+ });
8
+ }
9
+ return new (P || (P = Promise))(function (resolve, reject) {
10
+ function fulfilled(value) {
11
+ try {
12
+ step(generator.next(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ }
17
+ function rejected(value) {
18
+ try {
19
+ step(generator["throw"](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+ function step(result) {
25
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
+ }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __generator = this && this.__generator || function (thisArg, body) {
31
+ var _ = {
32
+ label: 0,
33
+ sent: function sent() {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
39
+ },
40
+ f,
41
+ y,
42
+ t,
43
+ g;
44
+ return g = {
45
+ next: verb(0),
46
+ "throw": verb(1),
47
+ "return": verb(2)
48
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49
+ return this;
50
+ }), g;
51
+ function verb(n) {
52
+ return function (v) {
53
+ return step([n, v]);
54
+ };
55
+ }
56
+ function step(op) {
57
+ if (f) throw new TypeError("Generator is already executing.");
58
+ while (_) try {
59
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
60
+ if (y = 0, t) op = [op[0] & 2, t.value];
61
+ switch (op[0]) {
62
+ case 0:
63
+ case 1:
64
+ t = op;
65
+ break;
66
+ case 4:
67
+ _.label++;
68
+ return {
69
+ value: op[1],
70
+ done: false
71
+ };
72
+ case 5:
73
+ _.label++;
74
+ y = op[1];
75
+ op = [0];
76
+ continue;
77
+ case 7:
78
+ op = _.ops.pop();
79
+ _.trys.pop();
80
+ continue;
81
+ default:
82
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
+ _ = 0;
84
+ continue;
85
+ }
86
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
+ _.label = op[1];
88
+ break;
89
+ }
90
+ if (op[0] === 6 && _.label < t[1]) {
91
+ _.label = t[1];
92
+ t = op;
93
+ break;
94
+ }
95
+ if (t && _.label < t[2]) {
96
+ _.label = t[2];
97
+ _.ops.push(op);
98
+ break;
99
+ }
100
+ if (t[2]) _.ops.pop();
101
+ _.trys.pop();
102
+ continue;
103
+ }
104
+ op = body.call(thisArg, _);
105
+ } catch (e) {
106
+ op = [6, e];
107
+ y = 0;
108
+ } finally {
109
+ f = t = 0;
110
+ }
111
+ if (op[0] & 5) throw op[1];
112
+ return {
113
+ value: op[0] ? op[1] : void 0,
114
+ done: true
115
+ };
116
+ }
117
+ };
118
+ exports.__esModule = true;
119
+ var react_1 = require("react");
120
+ var useGetHasErpData_1 = require("../hook/useGetHasErpData");
121
+ var ahooks_1 = require("ahooks");
122
+ var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
123
+ function useGetErpAddressData(notJudgedErp) {
124
+ var _this = this;
125
+ var _a = react_1.useState("loading"),
126
+ globalState = _a[0],
127
+ setGlobalState = _a[1];
128
+ var hasErpData = useGetHasErpData_1["default"]();
129
+ ahooks_1.useUpdateEffect(function () {
130
+ asyncQueryData(hasErpData, notJudgedErp);
131
+ }, [hasErpData, notJudgedErp]);
132
+ var asyncQueryData = function asyncQueryData(hasErpData, notJudgedErp) {
133
+ return __awaiter(_this, void 0, void 0, function () {
134
+ var hasBs, hasWdt, hasGy, promises, e_1;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0:
138
+ hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
139
+ promises = [];
140
+ if (hasBs || notJudgedErp) promises.push(kmkf_utils_1.servers.queryBsAddressData);
141
+ if (hasWdt || notJudgedErp) promises.push(kmkf_utils_1.servers.queryWdtAddressData);
142
+ if (hasGy || notJudgedErp) promises.push(kmkf_utils_1.servers.queryGyAddressData);
143
+ _a.label = 1;
144
+ case 1:
145
+ _a.trys.push([1, 3,, 4]);
146
+ return [4 /*yield*/, Promise.all(promises.map(function (promise) {
147
+ return promise();
148
+ }))];
149
+ case 2:
150
+ _a.sent();
151
+ setGlobalState("success");
152
+ return [3 /*break*/, 4];
153
+ case 3:
154
+ e_1 = _a.sent();
155
+ setGlobalState("failed");
156
+ return [3 /*break*/, 4];
157
+ case 4:
158
+ return [2 /*return*/];
159
+ }
160
+ });
161
+ });
162
+ };
163
+
164
+ var onReload = function onReload() {
165
+ return __awaiter(_this, void 0, void 0, function () {
166
+ return __generator(this, function (_a) {
167
+ switch (_a.label) {
168
+ case 0:
169
+ return [4 /*yield*/, asyncQueryData(hasErpData, notJudgedErp)];
170
+ case 1:
171
+ _a.sent();
172
+ return [2 /*return*/];
173
+ }
174
+ });
175
+ });
176
+ };
177
+
178
+ return [globalState, onReload];
179
+ }
180
+ exports["default"] = useGetErpAddressData;
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+
3
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) {
5
+ return value instanceof P ? value : new P(function (resolve) {
6
+ resolve(value);
7
+ });
8
+ }
9
+ return new (P || (P = Promise))(function (resolve, reject) {
10
+ function fulfilled(value) {
11
+ try {
12
+ step(generator.next(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ }
17
+ function rejected(value) {
18
+ try {
19
+ step(generator["throw"](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+ function step(result) {
25
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
+ }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __generator = this && this.__generator || function (thisArg, body) {
31
+ var _ = {
32
+ label: 0,
33
+ sent: function sent() {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
39
+ },
40
+ f,
41
+ y,
42
+ t,
43
+ g;
44
+ return g = {
45
+ next: verb(0),
46
+ "throw": verb(1),
47
+ "return": verb(2)
48
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49
+ return this;
50
+ }), g;
51
+ function verb(n) {
52
+ return function (v) {
53
+ return step([n, v]);
54
+ };
55
+ }
56
+ function step(op) {
57
+ if (f) throw new TypeError("Generator is already executing.");
58
+ while (_) try {
59
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
60
+ if (y = 0, t) op = [op[0] & 2, t.value];
61
+ switch (op[0]) {
62
+ case 0:
63
+ case 1:
64
+ t = op;
65
+ break;
66
+ case 4:
67
+ _.label++;
68
+ return {
69
+ value: op[1],
70
+ done: false
71
+ };
72
+ case 5:
73
+ _.label++;
74
+ y = op[1];
75
+ op = [0];
76
+ continue;
77
+ case 7:
78
+ op = _.ops.pop();
79
+ _.trys.pop();
80
+ continue;
81
+ default:
82
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
+ _ = 0;
84
+ continue;
85
+ }
86
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
+ _.label = op[1];
88
+ break;
89
+ }
90
+ if (op[0] === 6 && _.label < t[1]) {
91
+ _.label = t[1];
92
+ t = op;
93
+ break;
94
+ }
95
+ if (t && _.label < t[2]) {
96
+ _.label = t[2];
97
+ _.ops.push(op);
98
+ break;
99
+ }
100
+ if (t[2]) _.ops.pop();
101
+ _.trys.pop();
102
+ continue;
103
+ }
104
+ op = body.call(thisArg, _);
105
+ } catch (e) {
106
+ op = [6, e];
107
+ y = 0;
108
+ } finally {
109
+ f = t = 0;
110
+ }
111
+ if (op[0] & 5) throw op[1];
112
+ return {
113
+ value: op[0] ? op[1] : void 0,
114
+ done: true
115
+ };
116
+ }
117
+ };
118
+ exports.__esModule = true;
119
+ var react_1 = require("react");
120
+ var useGetHasErpData_1 = require("../hook/useGetHasErpData");
121
+ var ahooks_1 = require("ahooks");
122
+ var api_1 = require("../../../service/api");
123
+ function useGetErpLogisticsCompany(notJudgedErp) {
124
+ var _this = this;
125
+ var _a = react_1.useState("loading"),
126
+ globalState = _a[0],
127
+ setGlobalState = _a[1];
128
+ var hasErpData = useGetHasErpData_1["default"]();
129
+ ahooks_1.useUpdateEffect(function () {
130
+ asyncQueryData(hasErpData, notJudgedErp);
131
+ }, [hasErpData, notJudgedErp]);
132
+ var asyncQueryData = function asyncQueryData(hasErpData, notJudgedErp) {
133
+ return __awaiter(_this, void 0, void 0, function () {
134
+ var hasWdt, hasE3, hasJst, hasWln, promises, e_1;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0:
138
+ hasWdt = hasErpData.hasWdt, hasE3 = hasErpData.hasE3, hasJst = hasErpData.hasJst, hasWln = hasErpData.hasWln;
139
+ promises = [api_1.queryKMLogisticsCompany];
140
+ if (hasWdt || notJudgedErp) promises.push(api_1.queryWdtLogisticsCompany);
141
+ if (hasE3 || notJudgedErp) promises.push(api_1.queryBsE3LogisticsCompany);
142
+ if (hasJst || notJudgedErp) promises.push(api_1.queryJSTLogisticsCompany);
143
+ if (hasWln || notJudgedErp) promises.push(api_1.queryWLNLogisticsCompany);
144
+ if (!hasWdt && !hasE3 && !hasJst && !hasWln && !notJudgedErp) {
145
+ setGlobalState("success");
146
+ return [2 /*return*/];
147
+ }
148
+
149
+ _a.label = 1;
150
+ case 1:
151
+ _a.trys.push([1, 3,, 4]);
152
+ return [4 /*yield*/, Promise.all(promises.map(function (promise) {
153
+ return promise();
154
+ }))];
155
+ case 2:
156
+ _a.sent();
157
+ setGlobalState("success");
158
+ return [3 /*break*/, 4];
159
+ case 3:
160
+ e_1 = _a.sent();
161
+ setGlobalState("failed");
162
+ return [3 /*break*/, 4];
163
+ case 4:
164
+ return [2 /*return*/];
165
+ }
166
+ });
167
+ });
168
+ };
169
+
170
+ var onReload = function onReload() {
171
+ return __awaiter(_this, void 0, void 0, function () {
172
+ return __generator(this, function (_a) {
173
+ switch (_a.label) {
174
+ case 0:
175
+ return [4 /*yield*/, asyncQueryData(hasErpData, notJudgedErp)];
176
+ case 1:
177
+ _a.sent();
178
+ return [2 /*return*/];
179
+ }
180
+ });
181
+ });
182
+ };
183
+
184
+ return [globalState, onReload];
185
+ }
186
+ exports["default"] = useGetErpLogisticsCompany;
@@ -3,6 +3,7 @@ declare type OperationLogProps = {
3
3
  content: string;
4
4
  operation: string;
5
5
  componentDtoList: any[];
6
+ plat: any;
6
7
  };
7
- declare const OperationLog: ({ content, operation, componentDtoList, }: OperationLogProps) => React.JSX.Element | null;
8
+ declare const OperationLog: ({ content, operation, componentDtoList, plat, }: OperationLogProps) => React.JSX.Element | null;
8
9
  export default OperationLog;
@@ -10,7 +10,8 @@ import { isNull, unTransField } from "@kmkf-fe-packages/kmkf-utils";
10
10
  var OperationLog = function OperationLog(_ref) {
11
11
  var content = _ref.content,
12
12
  operation = _ref.operation,
13
- componentDtoList = _ref.componentDtoList;
13
+ componentDtoList = _ref.componentDtoList,
14
+ plat = _ref.plat;
14
15
  if (!content) return null;
15
16
  try {
16
17
  //todo过滤一些固定字段 展示不确定
@@ -77,7 +78,10 @@ var OperationLog = function OperationLog(_ref) {
77
78
  id: item.uniqueKey,
78
79
  name: item.name,
79
80
  componentConfig: item.componentConfig,
80
- type: item.workOrderComponentType
81
+ type: item.workOrderComponentType,
82
+ effects: {
83
+ env: plat.platform
84
+ }
81
85
  });
82
86
  if (operation !== null && operation !== void 0 && operation.startsWith("UPDATE")) {
83
87
  return /*#__PURE__*/React.createElement("div", {
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ var __assign = this && this.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ exports.__esModule = true;
14
+ var react_1 = require("react");
15
+ var GetFormItem_1 = require("../../GetFormItem");
16
+ var Common_1 = require("../../Common");
17
+ var index_1 = require("../common/index");
18
+ var ItemView_1 = require("../../../commonComponents/ItemView");
19
+ var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
20
+ var basic_components_1 = require("@kmkf-fe-packages/basic-components");
21
+ var constant_1 = require("../../../constant");
22
+ var BsGoods = /** @class */function () {
23
+ function BsGoods(options) {
24
+ var _this = this;
25
+ var _a;
26
+ this.renderClient = function (record) {
27
+ var _a, _b;
28
+ console.log("in renderclient");
29
+ return !kmkf_utils_1.isNull(record === null || record === void 0 ? void 0 : record["" + _this.id]) ? react_1["default"].createElement(react_1["default"].Fragment, null, react_1["default"].createElement(ItemView_1["default"], {
30
+ id: _this.id,
31
+ label: _this.name,
32
+ value: react_1["default"].createElement(Common_1.BsGoodsTable, {
33
+ list: ((_a = record === null || record === void 0 ? void 0 : record["" + _this.id]) === null || _a === void 0 ? void 0 : _a.bsGoods) || [],
34
+ showHeader: ((_b = _this.componentConfig) === null || _b === void 0 ? void 0 : _b.showHeader) || []
35
+ })
36
+ })) : null;
37
+ };
38
+ this.renderPc = function () {
39
+ return null;
40
+ };
41
+ this.renderLog = function (r) {
42
+ var _a;
43
+ console.log("in renderclient");
44
+ if (kmkf_utils_1.isNull(r === null || r === void 0 ? void 0 : r[_this.id + "_bsGoods"])) return null;
45
+ return react_1["default"].createElement(Common_1.BsGoodsTable, {
46
+ list: (r === null || r === void 0 ? void 0 : r[_this.id + "_bsGoods"]) || [],
47
+ showHeader: ((_a = _this.componentConfig) === null || _a === void 0 ? void 0 : _a.showHeader) || []
48
+ });
49
+ };
50
+ this.getComponentValue = function (r) {
51
+ return r === null || r === void 0 ? void 0 : r[_this.id + "_bsGoods"];
52
+ };
53
+ this.renderExport = function () {
54
+ return null;
55
+ };
56
+ this.editRender = function (p) {
57
+ var _a, _b, _c, _d, _e, _f;
58
+ console.log("in renderclient");
59
+ return react_1["default"].createElement(GetFormItem_1["default"], {
60
+ title: _this.name,
61
+ name: _this.id,
62
+ rules: _this.rules,
63
+ required: false,
64
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
65
+ display: p === null || p === void 0 ? void 0 : p.display,
66
+ tooltip: ((_a = _this.componentConfig) === null || _a === void 0 ? void 0 : _a.showTooltip) ? (_b = _this.componentConfig) === null || _b === void 0 ? void 0 : _b.tooltip : "",
67
+ component: react_1["default"].createElement(basic_components_1.BsGoods, __assign({}, _this.componentConfig, {
68
+ maxLength: ((_c = _this.componentConfig) === null || _c === void 0 ? void 0 : _c.maxLength) || 20,
69
+ shopId: (_d = _this.effects) === null || _d === void 0 ? void 0 : _d.shopId,
70
+ shopList: ((_e = _this.effects) === null || _e === void 0 ? void 0 : _e.shopList) || [],
71
+ companyKey: (_f = _this.effects) === null || _f === void 0 ? void 0 : _f.companyKey,
72
+ width: "90%"
73
+ }))
74
+ });
75
+ };
76
+ this.filterConfig = function (item) {
77
+ return [{
78
+ searchDefaultConditions: constant_1.SYMBOL.like,
79
+ type: item.type,
80
+ id: item.id + "_bsGoods",
81
+ name: item.name,
82
+ filterComponentType: "Input"
83
+ }];
84
+ };
85
+ this.name = options.name;
86
+ this.id = options.id;
87
+ this.sortField = options.id + "_bsGoods";
88
+ this.formField = options.id + "_bsGoods";
89
+ this.type = options.type;
90
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
91
+ this.isCombinationComponent = true;
92
+ this.canSort = false;
93
+ this.bsGoods = new index_1.BsHeaderGood(__assign(__assign({}, options), {
94
+ id: options.id + "_bsGoods",
95
+ name: "商品信息"
96
+ }));
97
+ this.children = [this.bsGoods];
98
+ this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
99
+ this.rules = ((_a = this === null || this === void 0 ? void 0 : this.componentConfig) === null || _a === void 0 ? void 0 : _a.required) ? [{
100
+ required: true,
101
+ validator: function validator(_, value) {
102
+ var _a;
103
+ if (!value || !((_a = value === null || value === void 0 ? void 0 : value.bsGoods) === null || _a === void 0 ? void 0 : _a.length)) {
104
+ return Promise.reject(new Error("请选择bs商品"));
105
+ }
106
+ return Promise.resolve();
107
+ }
108
+ }] : [];
109
+ this.dataType = "object";
110
+ }
111
+ return BsGoods;
112
+ }();
113
+ exports["default"] = BsGoods;
@@ -1,18 +1,18 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
3
  declare class BsHeaderChild implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
- componentConfig: ComponentInterface["componentConfig"];
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["dataType"];
15
+ dataType: ComponentInterface['dataType'];
16
16
  parentName?: string;
17
17
  transformValue: (val: any, record?: any, parentName?: string) => any;
18
18
  export: (val: any, record?: any, parentName?: string) => any;
@@ -11,9 +11,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
11
11
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- import React from "react";
14
+ import React from 'react';
15
15
  import ItemView from "../../../commonComponents/ItemView";
16
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
17
  var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
18
18
  var _this = this;
19
19
  _classCallCheck(this, BsHeaderChild);
@@ -37,7 +37,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
37
37
  return val;
38
38
  });
39
39
  _defineProperty(this, "getParentId", function () {
40
- var _this$id$split = _this.id.split("_"),
40
+ var _this$id$split = _this.id.split('_'),
41
41
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
42
42
  key = _this$id$split2[0],
43
43
  name = _this$id$split2[1],
@@ -53,7 +53,7 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
53
53
  });
54
54
  _defineProperty(this, "renderPc", function (value, record) {
55
55
  var _this$getComponentVal;
56
- return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
56
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
57
57
  });
58
58
  _defineProperty(this, "renderLog", function (r) {
59
59
  var id = _this.getParentId();
@@ -68,8 +68,8 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
68
68
  });
69
69
  _defineProperty(this, "renderExport", function (value, record) {
70
70
  var _this$getComponentExp;
71
- var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : "--";
72
- return typeof val === "number" ? val + "" : val;
71
+ var val = (_this$getComponentExp = _this.getComponentExport(record)) !== null && _this$getComponentExp !== void 0 ? _this$getComponentExp : '--';
72
+ return typeof val === 'number' ? val + '' : val;
73
73
  });
74
74
  _defineProperty(this, "editRender", function () {
75
75
  return null;
@@ -86,11 +86,11 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
86
86
  this.parentName = options.parentName;
87
87
  }
88
88
  this.componentConfig = options.componentConfig;
89
- this.align = "left";
89
+ this.align = 'left';
90
90
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 100;
91
91
  this.isCombinationComponent = false;
92
92
  this.canSort = false;
93
- this.dataType = "string";
93
+ this.dataType = 'string';
94
94
  this.children = [];
95
95
  if (options.transformValue) {
96
96
  this.transformValue = options.transformValue;
@@ -98,7 +98,5 @@ var BsHeaderChild = /*#__PURE__*/_createClass(function BsHeaderChild(options) {
98
98
  if (options.renderExport) {
99
99
  this.export = options.renderExport;
100
100
  }
101
- // this.export = (options as any).renderExport;
102
101
  });
103
-
104
102
  export default BsHeaderChild;
@@ -1,23 +1,23 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
+ import React from "react";
3
3
  declare class BsChildPic implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
- componentConfig: ComponentInterface['componentConfig'];
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['dataType'];
15
+ dataType: ComponentInterface["dataType"];
16
16
  constructor(options: PickOption);
17
17
  getParentId: () => string;
18
18
  renderClient: (record: any) => React.JSX.Element | null;
19
- renderPc: (value: unknown, record: Record) => React.JSX.Element | React.JSX.Element[];
20
- renderLog: (r: Record) => React.JSX.Element | React.JSX.Element[] | null;
19
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
20
+ renderLog: (r: Record) => React.JSX.Element | null;
21
21
  getComponentValue: (r: Record) => any;
22
22
  renderExport: (value: string, record: Record) => any;
23
23
  editRender: () => null;