uepay-mesh 3.0.11 → 3.0.12

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.
@@ -30,8 +30,8 @@ const {
30
30
  } = _antd.DatePicker;
31
31
 
32
32
  function subtractNatural(subNum) {
33
- const begin = (0, _moment.default)().hour(0).minute(0).second(0),
34
- end = begin.clone().subtract(subNum, 'days').hour(23).minute(59).second(59);
33
+ const end = (0, _moment.default)().hour(23).minute(59).second(59),
34
+ begin = end.clone().subtract(subNum, 'days').hour(0).minute(0).second(0);
35
35
  return {
36
36
  begin,
37
37
  end
@@ -114,7 +114,7 @@ class TimestampDatePickerSearch extends _react.default.Component {
114
114
  p: moment && (0, _timestampDatePicker.moment2Date)(stringTime, showTime, moment) || undefined,
115
115
  s: undefined
116
116
  };
117
- onChange && onChange(date, column);
117
+ onChange && onChange(date, column, _serverEnums.RelationType.BETWEEN.value);
118
118
  });
119
119
 
120
120
  _defineProperty(this, "handleCondChange", value => {
@@ -134,7 +134,7 @@ class TimestampDatePickerSearch extends _react.default.Component {
134
134
  const _search = {},
135
135
  _cond = {};
136
136
 
137
- if (column.component && column.component.config && column.component.config.timePickerDefaultRange) {
137
+ if (column.component && column.component.config && column.component.config.timePickerDefaultRange && Range.none.value !== column.component.config.timePickerDefaultRange) {
138
138
  const {
139
139
  showTime,
140
140
  stringTime
@@ -199,6 +199,7 @@ class TimestampDatePickerSearch extends _react.default.Component {
199
199
  onChange: this.handleChange
200
200
  }), /*#__PURE__*/_react.default.createElement(_condSelect.default, {
201
201
  condOptions: TimestampDatePickerSearch.DefaultCondTypes,
202
+ defaultCondValue: _serverEnums.RelationType.BETWEEN.value,
202
203
  condValue: condValue,
203
204
  onChange: this.handleCondChange
204
205
  }), /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
@@ -22,6 +22,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
22
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  /**
25
+ * @param props.condOptions {Array} 可选操作列表
26
+ * @param props.defaultCondValue {String} 默认条件关联选项
25
27
  * @param props.column {String} 字段信息
26
28
  * @param props.condValue {String} 搜索框的值
27
29
  * @param props.children {React} 包装搜索元素
@@ -51,7 +53,7 @@ function SearchContain(props) {
51
53
  }
52
54
 
53
55
  function handleValueChange(val) {
54
- onChange(val, column);
56
+ onChange(val, column, defaultCondValue);
55
57
  }
56
58
 
57
59
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -56,9 +56,10 @@ class ReduxSearch {
56
56
  this.scribe();
57
57
  }
58
58
 
59
- setValue(label, value) {
59
+ setValue(label, value, defaultCond) {
60
60
  this.search = _objectSpread({}, this.search);
61
61
  this.search[label] = value;
62
+ !this.condition[label] && defaultCond && (this.condition[label] = defaultCond);
62
63
  this.scribe();
63
64
  }
64
65
 
@@ -121,8 +121,8 @@ class ReduxSearchItemWrapper extends _react.default.Component {
121
121
  }
122
122
  });
123
123
 
124
- _defineProperty(this, "handleSearchChange", (value, label) => {
125
- this.props.reduxSearch.setValue(label, value);
124
+ _defineProperty(this, "handleSearchChange", (value, label, defaultCond) => {
125
+ this.props.reduxSearch.setValue(label, value, defaultCond);
126
126
  });
127
127
 
128
128
  _defineProperty(this, "handleConditionChange", (value, label) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uepay-mesh",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "数据中心数据集设计工具前端",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "node-sass": "^4.13.0",
45
45
  "react": "^16.12.0",
46
46
  "react-dom": "^16.12.0",
47
- "uepay-mesh": "^3.0.10",
47
+ "uepay-mesh": "^3.0.12",
48
48
  "uepay-ops2": "^3.0.2"
49
49
  }
50
50
  }