@zgfe/business-lib 1.1.34-alpha.7 → 1.1.34-alpha.8

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.
@@ -71,7 +71,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
71
71
  title: cdpTip
72
72
  }, /*#__PURE__*/React.createElement(IconFont, {
73
73
  type: "tishiicon"
74
- })) : null)) : null, (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
74
+ })) : null)) : null, !currentUser || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
75
75
  className: "condition-type",
76
76
  key: "business",
77
77
  onClick: function onClick() {
@@ -79,7 +79,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
79
79
  }
80
80
  }, /*#__PURE__*/React.createElement(Space, {
81
81
  key: "business"
82
- }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))) : null, (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
82
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))) : null, !currentUser || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
83
83
  className: "condition-type",
84
84
  key: "order",
85
85
  onClick: function onClick() {
@@ -54,6 +54,9 @@ var Text = function Text(props) {
54
54
  if (String(data.eventId) === '-13') {
55
55
  return renderOrder(data);
56
56
  }
57
+ if (String(data.eventId) === '-14') {
58
+ return renderBusiness(data);
59
+ }
57
60
  if (data.eventId) {
58
61
  return renderEvent(data);
59
62
  }
@@ -137,7 +140,27 @@ var Text = function Text(props) {
137
140
  backgroundColor: '#fffeeb',
138
141
  padding: '6px 7px'
139
142
  }
140
- }, "\u8BA2\u5355\u6570\u636E ", period, timeDimensions, "\u8BA2\u5355\u5C5E\u6027 ", property, frequencyValues);
143
+ }, "\u8BA2\u5355\u6570\u636E ", period, timeDimensions, property, frequencyValues);
144
+ }
145
+ function renderBusiness(condition) {
146
+ var periodLabel = {};
147
+ if (condition.runPeriod.operator === 'join_time') {
148
+ periodLabel.before = '在新增后';
149
+ periodLabel.after = '天内';
150
+ }
151
+ if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
152
+ periodLabel.before = '在';
153
+ }
154
+ var period = renderPeriod(periodLabel, condition.runPeriod, true);
155
+ var frequencyValues = renderFrequencyValues(condition.runTimes.values, condition.runTimes.operator, '次数');
156
+ var timeDimensions = renderTimeDimensions(condition.timeDimensions);
157
+ var property = renderProperty(condition.attrs, '业务属性');
158
+ return /*#__PURE__*/React.createElement("span", {
159
+ style: {
160
+ backgroundColor: '#fffeeb',
161
+ padding: '6px 7px'
162
+ }
163
+ }, condition.typeName, period, timeDimensions, property, frequencyValues);
141
164
  }
142
165
  function renderProperty(attrs, label) {
143
166
  var attrsDom = [];
@@ -167,7 +190,7 @@ var Text = function Text(props) {
167
190
  var operator = operateList.filter(function (v) {
168
191
  return v.value === item.computeType;
169
192
  });
170
- var frequencyValues = renderFrequencyValues(item.params, item.operator, item.attrType === 'cont-date' ? '天数' : '');
193
+ var frequencyValues = renderFrequencyValues(item.params, item.operator, item.attrType === 'cont-date' && item.operator !== 'absolute' ? '天数' : item.operator === 'absolute' ? '日期' : '');
171
194
  if (label) {
172
195
  var _orderType$, _attrType$, _operator$;
173
196
  var dom = /*#__PURE__*/React.createElement("span", {
@@ -177,7 +200,7 @@ var Text = function Text(props) {
177
200
  }
178
201
  });
179
202
  if (!attrsDom.length) return null;
180
- return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), attrsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
203
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), label, ":", attrsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
181
204
  }
182
205
  function renderAttrs(event, attrs) {
183
206
  var attrsDom = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.34-alpha.7",
3
+ "version": "1.1.34-alpha.8",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",