@kmkf-fe-packages/services-components 0.7.14-alpha.9 → 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.
@@ -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
- /*#__PURE__*/
56
- // <Dropdown overlay={this.renderMenu(record)}>
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 '../../type';
2
- import React from 'react';
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['dataType'];
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 'react';
10
- import { ApaasInput } from '@kmkf-fe-packages/basic-components';
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 '@kmkf-fe-packages/kmkf-utils';
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: 'Input',
73
+ filterComponentType: "Input",
75
74
  filterFn: function filterFn(value) {
76
75
  return function (i) {
77
- return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, 'input')).includes(value);
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 = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? [{
89
- pattern: /^(([0-9]*(\.[0-9]{1,})$)|([0-9]+$))/,
90
- message: '字段必须是数字'
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$componentCon2 = options.componentConfig) !== null && _options$componentCon2 !== void 0 && _options$componentCon2.isNumber ? 'number' : 'string';
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;
@@ -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,5 +1,5 @@
1
- import { ComponentInterface, PickOption, Record, ColumnConfig } from '../../type';
2
- import React from 'react';
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['dataType'];
18
- format: ComponentInterface['format'];
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) => "tradeCreateDateTime" | "tradePaymentDateTime" | "tradeDeliveryDateTime" | "tradeClosingDateTime" | undefined;
27
+ getKeyByComponentType: (type: string) => any;
28
28
  filterConfig: (item: ColumnConfig) => {
29
29
  searchDefaultConditions: "between";
30
30
  type: string;
@@ -6,13 +6,22 @@ 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 'react';
10
- import moment from 'moment';
9
+ import React from "react";
10
+ import moment from "moment";
11
11
  import { DateTime } from "../DataTime";
12
12
  import GetFormItem from "../GetFormItem";
13
13
  import ItemView from "../../commonComponents/ItemView";
14
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
14
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
15
15
  import { SYMBOL } from "../../constant";
16
+ var typeMap = {
17
+ TRADE_CREATE_DATETIME: "tradeCreateDateTime",
18
+ TRADE_PAYMENT_DATETIME: "tradePaymentDateTime",
19
+ TRADE_DELIVERY_DATETIME: "tradeDeliveryDateTime",
20
+ TRADE_CLOSING_DATETIME: "tradeClosingDateTime",
21
+ BS_SIGNING_TIME: "bsSigningTime",
22
+ BS_SEND_TIME: "bsSendTime",
23
+ BS_TRADE_PAYMENT_TIME: "bsTradePaymentTime"
24
+ };
16
25
  var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
17
26
  var _this = this;
18
27
  _classCallCheck(this, BasicDataTime);
@@ -31,7 +40,7 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
31
40
  _defineProperty(this, "dataType", void 0);
32
41
  _defineProperty(this, "format", void 0);
33
42
  _defineProperty(this, "render", function (value) {
34
- return /*#__PURE__*/React.createElement("span", null, Array.isArray(value) ? value.join('~') : /*#__PURE__*/React.createElement("span", null, value));
43
+ return /*#__PURE__*/React.createElement("span", null, Array.isArray(value) ? value.join("~") : /*#__PURE__*/React.createElement("span", null, value));
35
44
  });
36
45
  _defineProperty(this, "renderClient", function (record) {
37
46
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -43,7 +52,7 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
43
52
  _defineProperty(this, "renderPc", function (value, record) {
44
53
  var _record;
45
54
  var type = _this.type;
46
- return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(_this.dataMap[type])]) !== null && _record !== void 0 ? _record : '--');
55
+ return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(_this.dataMap[type])]) !== null && _record !== void 0 ? _record : "--");
47
56
  });
48
57
  _defineProperty(this, "renderLog", function (r) {
49
58
  var type = _this.type;
@@ -52,18 +61,12 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
52
61
  });
53
62
  _defineProperty(this, "getComponentValue", function (r) {
54
63
  var type = _this.type;
55
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(_this.dataMap[type])];
64
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])];
56
65
  });
57
66
  _defineProperty(this, "renderExport", function (value, record) {
58
67
  var _record2;
59
68
  var type = _this.type;
60
- var map = {
61
- TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
62
- TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
63
- TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
64
- TRADE_CLOSING_DATETIME: 'tradeClosingDateTime'
65
- };
66
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(map[type])]) !== null && _record2 !== void 0 ? _record2 : '--';
69
+ return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 : "--";
67
70
  });
68
71
  _defineProperty(this, "editRender", function (p) {
69
72
  var _this$componentConfig, _this$componentConfig2;
@@ -79,18 +82,7 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
79
82
  });
80
83
  });
81
84
  _defineProperty(this, "getKeyByComponentType", function (type) {
82
- if (type === 'TRADE_CLOSING_DATETIME') {
83
- return 'tradeClosingDateTime';
84
- }
85
- if (type === 'TRADE_CREATE_DATETIME') {
86
- return 'tradeCreateDateTime';
87
- }
88
- if (type === 'TRADE_PAYMENT_DATETIME') {
89
- return 'tradePaymentDateTime';
90
- }
91
- if (type === 'TRADE_DELIVERY_DATETIME') {
92
- return 'tradeDeliveryDateTime';
93
- }
85
+ return typeMap[type];
94
86
  });
95
87
  _defineProperty(this, "filterConfig", function (item) {
96
88
  var key = _this.getKeyByComponentType(item.type);
@@ -101,7 +93,7 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
101
93
  // 过滤组件id
102
94
  name: item.name,
103
95
  // 过滤组件名称
104
- filterComponentType: 'Date',
96
+ filterComponentType: "Date",
105
97
  filterFn: function filterFn(value) {
106
98
  return function (i) {
107
99
  var recordDateTime = _filterFn.filterTableListItemColumnValue(i, item.id, key);
@@ -111,7 +103,7 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
111
103
  formatFilterValue: function formatFilterValue(val) {
112
104
  if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
113
105
  return val === null || val === void 0 ? void 0 : val.map(function (v) {
114
- return moment(v).startOf('second').valueOf();
106
+ return moment(v).startOf("second").valueOf();
115
107
  });
116
108
  }
117
109
  }
@@ -123,18 +115,21 @@ var BasicDataTime = /*#__PURE__*/_createClass(function BasicDataTime(options) {
123
115
  this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
124
116
  this.type = options.type;
125
117
  this.showContains = false;
126
- this.dataType = 'string';
127
- this.format = 'dateTime';
118
+ this.dataType = "string";
119
+ this.format = "dateTime";
128
120
  this.componentConfig = options.componentConfig;
129
121
  this.rules = [];
130
122
  this.isCombinationComponent = false;
131
123
  this.canSort = true;
132
124
  this.children = [];
133
125
  this.dataMap = {
134
- TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
135
- TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
136
- TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
137
- TRADE_CLOSING_DATETIME: 'tradeClosingDateTime'
126
+ TRADE_CREATE_DATETIME: "tradeCreateDateTime",
127
+ TRADE_PAYMENT_DATETIME: "tradePaymentDateTime",
128
+ TRADE_DELIVERY_DATETIME: "tradeDeliveryDateTime",
129
+ TRADE_CLOSING_DATETIME: "tradeClosingDateTime",
130
+ BS_SIGNING_TIME: "bsSigningTime",
131
+ BS_SEND_TIME: "bsSendTime",
132
+ BS_TRADE_PAYMENT_TIME: "bsTradePaymentTime"
138
133
  };
139
134
  });
140
135
  export default BasicDataTime;
@@ -1,3 +1,3 @@
1
- import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception } from './index';
2
- import { PickOption } from './type';
3
- export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AliPay | BuyerNick | BasicCascader | BasicCheckbox | CommonDataTime | CompletedUser | BasicDataTime | ItemEnCode | ItemId | ItemSelect | ErpTradeId | FlowStatusSelect | BasicGrade | Handler | BasicInput | JstItemSelect | JstLogistics | JstSendGood | JstSupply | Logistics | LogisticsInterception | BasicMultSelect | Ordinary | Payment | BasicPicture | PlatForm | BasicRadio | BasicRate | ReceiverAddress | ReceiverMobile | ReceiverName | ERemark | ReturnLogistics | BasicSelect | ShopInput | ShopName | Submitter | SystemOrderNo | TemplateSelect | BasicTextArea | ThirdItemSelect | TradeDateTime | TradeId | WorkOrderId;
1
+ import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, BsSendGood, BsLogistics } from "./index";
2
+ import { PickOption } from "./type";
3
+ export declare const factory: (type: string, options: PickOption) => BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSendGood | BsLogistics | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | PlatForm | ShopInput | Submitter | Handler | CompletedUser;