@kmkf-fe-packages/services-components 0.7.14-alpha.0 → 0.7.14-alpha.11

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.
@@ -18,6 +18,8 @@ var OperationLog = function OperationLog(_ref) {
18
18
  componentDtoList = _ref.componentDtoList;
19
19
  if (!content) return null;
20
20
  try {
21
+ //todo过滤一些固定字段 展示不确定
22
+ var filterList = ["COMPLETED_DATETIME", "COMPLETED_USER_INPUT"];
21
23
  if (/^TRANSFER/.test(operation)) {
22
24
  if (/^\[.*?\]-->>\[.*?\]$/.test(content)) {
23
25
  var _content$split = content.split("-->>"),
@@ -71,7 +73,7 @@ var OperationLog = function OperationLog(_ref) {
71
73
  }, {});
72
74
  var currentNeedContentId = Object.keys(currentContent);
73
75
  var newTemplateColumns = componentDtoList === null || componentDtoList === void 0 ? void 0 : componentDtoList.filter(function (item) {
74
- return currentNeedContentId.findIndex(function (id) {
76
+ return !filterList.includes(item.workOrderComponentType) && currentNeedContentId.findIndex(function (id) {
75
77
  return id === null || id === void 0 ? void 0 : id.startsWith(item === null || item === void 0 ? void 0 : item.uniqueKey);
76
78
  }) > -1;
77
79
  });
@@ -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
  /**
4
4
  * 针对完成时间、创建时间、修改时间定义了3中类型
5
5
  */
@@ -14,8 +14,8 @@ declare class CommonDataTime implements ComponentInterface {
14
14
  formField: string;
15
15
  canSort: boolean;
16
16
  children: ComponentInterface[];
17
- dataType: ComponentInterface['dataType'];
18
- format: ComponentInterface['format'];
17
+ dataType: ComponentInterface["dataType"];
18
+ format: ComponentInterface["format"];
19
19
  constructor(options: PickOption);
20
20
  getValue: (value: string) => string;
21
21
  renderClient: (record: any) => React.JSX.Element | null;
@@ -5,10 +5,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
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
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import React from 'react';
9
- import moment from 'moment';
8
+ import React from "react";
9
+ import moment from "moment";
10
10
  import ItemView from "../../commonComponents/ItemView";
11
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
11
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
12
12
  import { SYMBOL } from "../../constant";
13
13
 
14
14
  /**
@@ -30,18 +30,18 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
30
30
  _defineProperty(this, "dataType", void 0);
31
31
  _defineProperty(this, "format", void 0);
32
32
  _defineProperty(this, "getValue", function (value) {
33
- return moment(value).format('YYYY-MM-DD HH:mm:ss');
33
+ return moment(value).format("YYYY-MM-DD HH:mm:ss");
34
34
  });
35
35
  _defineProperty(this, "renderClient", function (record) {
36
36
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
37
37
  id: _this.id,
38
38
  label: _this.name,
39
- value: _this.getValue(record === null || record === void 0 ? void 0 : record[_this.id]) || ''
39
+ value: _this.getValue(record === null || record === void 0 ? void 0 : record[_this.id]) || ""
40
40
  }) : null;
41
41
  });
42
42
  _defineProperty(this, "renderPc", function (value, record) {
43
43
  var _record;
44
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
44
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : "--";
45
45
  // if (record?.[`${this.id}`] === undefined) {
46
46
  // return <span>--</span>;
47
47
  // }
@@ -60,9 +60,9 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
60
60
  });
61
61
  _defineProperty(this, "renderExport", function (value, record) {
62
62
  if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) === undefined) {
63
- return '--';
63
+ return "--";
64
64
  }
65
- return moment(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]).format('YYYY-MM-DD HH:mm:ss');
65
+ return moment(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]).format("YYYY-MM-DD HH:mm:ss");
66
66
  });
67
67
  _defineProperty(this, "editRender", function () {
68
68
  return null;
@@ -75,17 +75,17 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
75
75
  // 过滤组件id
76
76
  name: item.name,
77
77
  // 过滤组件名称
78
- filterComponentType: 'Date',
78
+ filterComponentType: "Date",
79
79
  filterFn: function filterFn(value) {
80
80
  return function (i) {
81
- var recordDateTime = _filterFn.filterTableListItemColumnValue(i, item.id, '');
81
+ var recordDateTime = _filterFn.filterTableListItemColumnValue(i, item.id, "");
82
82
  return _filterFn.filterDateFn(value, recordDateTime);
83
83
  };
84
84
  },
85
85
  formatFilterValue: function formatFilterValue(val) {
86
86
  if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
87
87
  return val === null || val === void 0 ? void 0 : val.map(function (v) {
88
- return moment(v).startOf('second').valueOf();
88
+ return moment(v).startOf("second").valueOf();
89
89
  });
90
90
  }
91
91
  }
@@ -101,7 +101,7 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
101
101
  this.isCombinationComponent = false;
102
102
  this.canSort = true;
103
103
  this.children = [];
104
- this.dataType = 'string';
105
- this.format = 'dateTime';
104
+ this.dataType = "string";
105
+ this.format = "dateTime";
106
106
  });
107
107
  export default CommonDataTime;
@@ -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)]);
@@ -7,5 +7,5 @@ declare type GetFormItemProps = {
7
7
  component: JSX.Element | null;
8
8
  hidden?: boolean;
9
9
  };
10
- declare const GetFormItem: ({ rules, required, title, component, name, hidden }: GetFormItemProps) => React.JSX.Element;
10
+ declare const GetFormItem: ({ rules, required, title, component, name, hidden }: GetFormItemProps) => React.JSX.Element | null;
11
11
  export default GetFormItem;
@@ -15,6 +15,8 @@ var GetFormItem = function GetFormItem(_ref) {
15
15
  message: "\u8BF7\u8F93\u5165".concat(title)
16
16
  });
17
17
  }
18
+ // 当隐藏时, 不在拥有该组件
19
+ if (hidden) return null;
18
20
  return /*#__PURE__*/React.createElement("div", {
19
21
  className: "form-item--wrap",
20
22
  style: {
@@ -24,8 +26,8 @@ var GetFormItem = function GetFormItem(_ref) {
24
26
  name: name,
25
27
  label: title,
26
28
  rules: newRules,
27
- className: "form-item-label--index",
28
- hidden: hidden
29
+ className: "form-item-label--index"
30
+ // hidden={hidden}
29
31
  }, component));
30
32
  };
31
33
  export default GetFormItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.7.14-alpha.0",
3
+ "version": "0.7.14-alpha.11",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.7.14-alpha.0",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.7.14-alpha.0"
29
+ "@kmkf-fe-packages/basic-components": "^0.7.14-alpha.9",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.14-alpha.9"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@ant-design/icons": "^4.7.0",
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "678546f4f78df3f93ba9fb2d57382c81e37ea8db"
43
+ "gitHead": "0e8cc54f498c0f594fa2a578706d0ecc74f87e66"
44
44
  }