@zgfe/modules-dm 1.0.57-zhongyuan.54 → 1.0.57-zhongyuan.56

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.
@@ -24,6 +24,7 @@ import { generateUniqueId } from '../../utils/index';
24
24
  import apis from '../../constants/api';
25
25
  var TextArea = Input.TextArea;
26
26
  var AddRule = function AddRule(_ref) {
27
+ var _currentRuleDetail$ve;
27
28
  var addruleShow = _ref.addruleShow,
28
29
  onSetclose = _ref.onSetclose,
29
30
  currentRuleDetail = _ref.currentRuleDetail,
@@ -72,7 +73,7 @@ var AddRule = function AddRule(_ref) {
72
73
  message.error('请添加规则');
73
74
  return;
74
75
  }
75
- if (hasEvent) {
76
+ if (!hasEvent) {
76
77
  message.error('该属性的规则已存在,请重新选择属性!');
77
78
  return;
78
79
  }
@@ -264,15 +265,9 @@ var AddRule = function AddRule(_ref) {
264
265
  attr: attr === null || attr === void 0 ? void 0 : attr.id
265
266
  }
266
267
  }).then(function (res) {
267
- // if (res?.code == '100000') {
268
- // // 判断属性是否已经存在
269
- // const exists = res.data; // 假设后端返回的数据结构中有一个字段表示是否存在
270
- // !exists && message.error('该属性的规则已存在,请重新选择属性!');
271
- // return;
272
- // }
268
+ setHasEvent((res === null || res === void 0 ? void 0 : res.code) == '100000' ? true : false);
273
269
  if ((res === null || res === void 0 ? void 0 : res.code) != '100000') {
274
270
  message.error(res.msg);
275
- setHasEvent(true);
276
271
  return;
277
272
  }
278
273
  });
@@ -318,12 +313,6 @@ var AddRule = function AddRule(_ref) {
318
313
  description: currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.ruleDescription,
319
314
  status: (currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.status) == 1 ? true : false
320
315
  });
321
- // setOptionsRule(currentRuleDetail.verifyDetailVo);
322
- // setOptions(
323
- // currentRuleDetail.verifyDetailVo[0] && currentRuleDetail.verifyDetailVo[0].content != '3'
324
- // ? [...initOptions, { label: '字典校验', value: 6 }]
325
- // : [...initOptions],
326
- // );
327
316
  var newarr = currentRuleDetail.verifyDetailVo.map(function (r) {
328
317
  return _objectSpread(_objectSpread({}, r), {}, {
329
318
  uniqueId: generateUniqueId()
@@ -442,9 +431,9 @@ var AddRule = function AddRule(_ref) {
442
431
  value: 'eventProp'
443
432
  }, "\u4E8B\u4EF6\u5C5E\u6027\u6821\u9A8C")), /*#__PURE__*/React.createElement("br", null), ruleRowView && (/*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
444
433
  type: "link"
445
- }, "\u4E8B\u4EF6\u5C5E\u6027\uFF1A\u4E8B\u4EF6\u5C5E\u6027\u6821\u9A8C"), /*#__PURE__*/React.createElement(Button, {
434
+ }, "\u4E8B\u4EF6\u540D\u79F0\uFF1A", currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : (_currentRuleDetail$ve = currentRuleDetail.verifyObject) === null || _currentRuleDetail$ve === void 0 ? void 0 : _currentRuleDetail$ve.split('|||')[0]), /*#__PURE__*/React.createElement(Button, {
446
435
  type: "link"
447
- }, "\u7EC6\u5206\u5C5E\u6027\uFF1A\u89D2\u8272\u5C5E\u6027\u6821\u9A8C"))), !ruleRowView && (/*#__PURE__*/React.createElement("div", {
436
+ }, "\u5C5E\u6027\u540D\u79F0\uFF1A", (bizAttributeSelectorValue === null || bizAttributeSelectorValue === void 0 ? void 0 : bizAttributeSelectorValue.label) || (bizAttributeSelectorValue === null || bizAttributeSelectorValue === void 0 ? void 0 : bizAttributeSelectorValue.name)))), !ruleRowView && (/*#__PURE__*/React.createElement("div", {
448
437
  className: "selectVent"
449
438
  }, selectType == 'eventProp' && (/*#__PURE__*/React.createElement(BizEventSelector, {
450
439
  showAllEvent: true,
@@ -69,9 +69,10 @@ var ClearRule = function ClearRule() {
69
69
  }, {
70
70
  title: '操作',
71
71
  key: 'action',
72
+ width: 240,
72
73
  render: function render(_, record) {
73
74
  return /*#__PURE__*/React.createElement(Space, {
74
- size: "middle"
75
+ size: 4
75
76
  }, authority[170928557414] && (/*#__PURE__*/React.createElement(Switch, {
76
77
  checked: record.status == 0 ? false : true,
77
78
  onChange: function onChange(e) {
@@ -154,30 +155,7 @@ var ClearRule = function ClearRule() {
154
155
  };
155
156
  var handleViewRule = function handleViewRule(ruleRow) {
156
157
  setRuleRowEdit(ruleRow);
157
- request(apis.rule.checkRule, {
158
- method: 'post',
159
- data: {
160
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
161
- ruleId: ruleRow.ruleId
162
- }
163
- }).then(function (res) {
164
- if (!res) return;
165
- if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
166
- // 1: 已清洗并且有正在执行的列表 2: 元事件已被删除的提示 3:校验通过
167
- if (res.data.update == '2') {
168
- UseModal({
169
- onOk: function onOk() {
170
- return getDetail(ruleRow.ruleId);
171
- },
172
- okText: '确定',
173
- title: '校验对象已被删除',
174
- content: "\u6821\u9A8C\u5BF9\u8C61\u5DF2\u88AB\u5220\u9664\uFF0C\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4F7F\u7528\uFF0C\u8BF7\u8FDB\u884C\u4FEE\u6539"
175
- });
176
- }
177
- }
178
- }).finally(function () {
179
- getDetail(ruleRow.ruleId);
180
- });
158
+ getDetail(ruleRow.ruleId);
181
159
  };
182
160
  var getDetail = function getDetail(ruleId) {
183
161
  setEditStatus(true);
@@ -332,7 +310,9 @@ var ClearRule = function ClearRule() {
332
310
  var _useState31 = useState({
333
311
  current: 1,
334
312
  pageSize: 10,
335
- total: 0
313
+ total: 0,
314
+ showQuickJumper: true,
315
+ showSizeChanger: true
336
316
  }),
337
317
  _useState32 = _slicedToArray(_useState31, 2),
338
318
  tableParams = _useState32[0],
@@ -1171,9 +1171,9 @@ var TablePlus = function TablePlus(props) {
1171
1171
  props.Refresh();
1172
1172
  return;
1173
1173
  }
1174
- notification.error({
1175
- message: res === null || res === void 0 ? void 0 : res.msg
1176
- });
1174
+ // notification.error({
1175
+ // message: res?.msg,
1176
+ // });
1177
1177
  });
1178
1178
  };
1179
1179
  var _useState57 = useState(''),
@@ -172,11 +172,11 @@ var AddFormulate = function AddFormulate(_ref) {
172
172
  //类型转换
173
173
  if (detailRow.ruleType == 3) {
174
174
  var _shuzhiArr$find;
175
- if (!detailRow.sourceValue || !detailRow.targetValue) {
176
- return str;
177
- }
175
+ // if (!detailRow.sourceValue || !detailRow.targetValue) {
176
+ // return str;
177
+ // }
178
178
  str = (_shuzhiArr$find = shuzhiArr.find(function (o) {
179
- return o.value == (tag == 1 ? detailRow.sourceValue : detailRow.targetValue);
179
+ return o.value == (tag == 1 ? detailRow === null || detailRow === void 0 ? void 0 : detailRow.sourceValue : detailRow === null || detailRow === void 0 ? void 0 : detailRow.targetValue);
180
180
  })) === null || _shuzhiArr$find === void 0 ? void 0 : _shuzhiArr$find.label;
181
181
  }
182
182
  return str;
@@ -198,15 +198,17 @@ var AddFormulate = function AddFormulate(_ref) {
198
198
  // 回显
199
199
  if (detailData) {
200
200
  var _detailData$rinseObje2, _detailData$rinseShif;
201
+ var currentTargetObj = res.data.data.find(function (o) {
202
+ var _detailData$rinseObje;
203
+ return (detailData === null || detailData === void 0 ? void 0 : (_detailData$rinseObje = detailData.rinseObjects) === null || _detailData$rinseObje === void 0 ? void 0 : _detailData$rinseObje[0]) == o.ruleId;
204
+ });
201
205
  ruleForm.setFieldsValue({
202
206
  name: detailData.ruleName,
203
207
  description: detailData === null || detailData === void 0 ? void 0 : detailData.ruleDescription,
204
- target: res.data.data.find(function (o) {
205
- var _detailData$rinseObje;
206
- return (detailData === null || detailData === void 0 ? void 0 : (_detailData$rinseObje = detailData.rinseObjects) === null || _detailData$rinseObje === void 0 ? void 0 : _detailData$rinseObje[0]) == o.ruleId;
207
- }) ? detailData === null || detailData === void 0 ? void 0 : (_detailData$rinseObje2 = detailData.rinseObjects) === null || _detailData$rinseObje2 === void 0 ? void 0 : _detailData$rinseObje2[0] : undefined,
208
+ target: currentTargetObj ? detailData === null || detailData === void 0 ? void 0 : (_detailData$rinseObje2 = detailData.rinseObjects) === null || _detailData$rinseObje2 === void 0 ? void 0 : _detailData$rinseObje2[0] : undefined,
208
209
  ruleArr: detailData === null || detailData === void 0 ? void 0 : detailData.rinseShiftRuleDetails
209
210
  });
211
+ currentTargetObj && setCurrentBizAttributeSelectorValue(JSON.parse(currentTargetObj === null || currentTargetObj === void 0 ? void 0 : currentTargetObj.extraMes));
210
212
  var arr = detailData === null || detailData === void 0 ? void 0 : (_detailData$rinseShif = detailData.rinseShiftRuleDetails) === null || _detailData$rinseShif === void 0 ? void 0 : _detailData$rinseShif.map(function (o) {
211
213
  var _shuzhiArr$find2, _shuzhiArr$find3;
212
214
  return {
@@ -501,6 +501,11 @@ var AddRule = function AddRule(_ref) {
501
501
  // });
502
502
  // setShuzhiArr1(arr);
503
503
  // }, [shuzhisourceValueId]);
504
+ useEffect(function () {
505
+ shuzhiForm.setFieldsValue({
506
+ sourceValueId: currentBizAttributeSelectorValue === null || currentBizAttributeSelectorValue === void 0 ? void 0 : currentBizAttributeSelectorValue.type
507
+ });
508
+ }, []);
504
509
  var component = null;
505
510
  switch (currentType) {
506
511
  case 1:
@@ -610,7 +615,7 @@ var AddRule = function AddRule(_ref) {
610
615
  span: 19
611
616
  },
612
617
  initialValues: {
613
- sourceValueId: undefined,
618
+ sourceValueId: currentBizAttributeSelectorValue === null || currentBizAttributeSelectorValue === void 0 ? void 0 : currentBizAttributeSelectorValue.type,
614
619
  targetValueId: undefined
615
620
  },
616
621
  onFinish: onShuzhiFinish
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
- import { Table, Input, Button, Space, Switch, Modal, message, Typography, Tooltip, DatePicker, Spin } from 'antd';
13
+ import { Table, Input, Button, Space, Switch, Modal, message, Typography, Tooltip, DatePicker } from 'antd';
14
14
  import { SearchOutlined, DiffOutlined, PlusOutlined, DownloadOutlined, LoadingOutlined } from '@ant-design/icons';
15
15
  import React, { useContext, useEffect, useState } from 'react';
16
16
  import { BizGlobalDataContext } from '@zgfe/business-lib';
@@ -72,7 +72,7 @@ var FormulateRule = function FormulateRule() {
72
72
  width: 240,
73
73
  render: function render(_, record) {
74
74
  return /*#__PURE__*/React.createElement(Space, {
75
- size: "middle"
75
+ size: 4
76
76
  }, authority[170928557425] && (/*#__PURE__*/React.createElement(Switch, {
77
77
  checked: record.status == 0 ? false : true,
78
78
  onChange: function onChange() {
@@ -219,28 +219,7 @@ var FormulateRule = function FormulateRule() {
219
219
  };
220
220
  var handleView = function handleView(ruleId) {
221
221
  setRuleRowEdit(ruleId);
222
- request(apis.clearRule.checkRule, {
223
- method: 'post',
224
- data: {
225
- ruleId: ruleId
226
- }
227
- }).then(function (res) {
228
- if (!res) return;
229
- if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
230
- if (res.data == 1) {
231
- UseModal({
232
- onOk: function onOk() {
233
- getDetail(ruleId);
234
- },
235
- okText: '去修改',
236
- title: '校验对象已被删除',
237
- content: "\u6821\u9A8C\u5BF9\u8C61\u5DF2\u88AB\u5220\u9664\uFF0C\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4F7F\u7528\uFF0C\u8BF7\u8FDB\u884C\u4FEE\u6539"
238
- });
239
- }
240
- }
241
- }).finally(function () {
242
- getDetail(ruleId);
243
- });
222
+ getDetail(ruleId);
244
223
  };
245
224
  var handleDetale = function handleDetale(ruleId) {
246
225
  setRuleRowEdit(undefined);
@@ -292,7 +271,9 @@ var FormulateRule = function FormulateRule() {
292
271
  var _useState7 = useState({
293
272
  current: 1,
294
273
  pageSize: 10,
295
- total: 0
274
+ total: 0,
275
+ showQuickJumper: true,
276
+ showSizeChanger: true
296
277
  }),
297
278
  _useState8 = _slicedToArray(_useState7, 2),
298
279
  tableParams = _useState8[0],
@@ -438,13 +419,7 @@ var FormulateRule = function FormulateRule() {
438
419
  onChange: searchChange,
439
420
  onBlur: handleSearch,
440
421
  value: ruleSearchName
441
- }), /*#__PURE__*/React.createElement(Space, null, authority[170928557424] && (/*#__PURE__*/React.createElement(Spin, {
442
- indicator: antIcon,
443
- spinning: statusLoading
444
- }, /*#__PURE__*/React.createElement(Switch, {
445
- checked: allOpenRule,
446
- onChange: handleAllOpenStatus
447
- }))), authority[170928557426] && showProdDownload && (/*#__PURE__*/React.createElement(Button, {
422
+ }), /*#__PURE__*/React.createElement(Space, null, authority[170928557426] && showProdDownload && (/*#__PURE__*/React.createElement(Button, {
448
423
  icon: /*#__PURE__*/React.createElement(DiffOutlined, {
449
424
  onPointerEnterCapture: undefined,
450
425
  onPointerLeaveCapture: undefined
@@ -458,7 +433,7 @@ var FormulateRule = function FormulateRule() {
458
433
  onPointerLeaveCapture: undefined
459
434
  }),
460
435
  type: "primary",
461
- // disabled={!authority[170928557421]}
436
+ disabled: !authority[170928557421],
462
437
  onClick: function onClick() {
463
438
  setOpenAddDraw(true);
464
439
  setDetailData(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.57-zhongyuan.54",
3
+ "version": "1.0.57-zhongyuan.56",
4
4
  "license": "ISC",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "umi-request": "^1.4.0",
58
58
  "yorkie": "^2.0.0"
59
59
  },
60
- "gitHead": "9ead8ae23d0760c49387a7f3074d22ca05cfa51b",
60
+ "gitHead": "9a8408cc7ebc8420d74a165d996b819c99bac0b8",
61
61
  "gitHooks": {
62
62
  "pre-commit": "lint-staged"
63
63
  }