@zgfe/modules-dm 1.0.57-zhongyuan.39 → 1.0.57-zhongyuan.41
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.
|
@@ -63,6 +63,10 @@ var AddRule = function AddRule(_ref) {
|
|
|
63
63
|
};
|
|
64
64
|
var onFinish = function onFinish(values) {
|
|
65
65
|
console.log('Success:', values, optionsRule);
|
|
66
|
+
if (hasEvent) {
|
|
67
|
+
message.error('该属性的规则已存在,请重新选择属性!');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
if (currentRuleDetail) {
|
|
67
71
|
// currentRuleDetail 有值为修改状态
|
|
68
72
|
request(apis.rule.updateRule, {
|
|
@@ -226,12 +230,17 @@ var AddRule = function AddRule(_ref) {
|
|
|
226
230
|
setEvent(val === null || val === void 0 ? void 0 : val.event);
|
|
227
231
|
};
|
|
228
232
|
// 细分属性初始值
|
|
229
|
-
var _useState13 = useState(
|
|
233
|
+
var _useState13 = useState(false),
|
|
230
234
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
231
|
-
|
|
232
|
-
|
|
235
|
+
hasEvent = _useState14[0],
|
|
236
|
+
setHasEvent = _useState14[1];
|
|
237
|
+
var _useState15 = useState(currentRuleDetail ? JSON.parse(currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.extraMes) : undefined),
|
|
238
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
239
|
+
bizAttributeSelectorValue = _useState16[0],
|
|
240
|
+
setBizAttributeSelectorValue = _useState16[1];
|
|
233
241
|
// 细分属性
|
|
234
242
|
var onChangeAttr = function onChangeAttr(attr) {
|
|
243
|
+
setHasEvent(false);
|
|
235
244
|
if (attr === undefined) {
|
|
236
245
|
// 删除细分属性
|
|
237
246
|
setBizAttributeSelectorValue(undefined);
|
|
@@ -254,6 +263,7 @@ var AddRule = function AddRule(_ref) {
|
|
|
254
263
|
// }
|
|
255
264
|
if ((res === null || res === void 0 ? void 0 : res.code) != '100000') {
|
|
256
265
|
message.error(res.msg);
|
|
266
|
+
setHasEvent(true);
|
|
257
267
|
return;
|
|
258
268
|
}
|
|
259
269
|
});
|
|
@@ -309,6 +319,35 @@ var AddRule = function AddRule(_ref) {
|
|
|
309
319
|
}]) : [].concat(initOptions));
|
|
310
320
|
}
|
|
311
321
|
}, []);
|
|
322
|
+
// 禁用按钮规则
|
|
323
|
+
// { label: '属性类型', value: 1 },
|
|
324
|
+
// { label: '正则匹配', value: 2 },
|
|
325
|
+
// { label: '数值区间', value: 3 },
|
|
326
|
+
// { label: '枚举', value: 4 },
|
|
327
|
+
// { label: '非空', value: 5 },
|
|
328
|
+
// 1字符串类型 2数值类型 3日期类型
|
|
329
|
+
var handleDisabled = function handleDisabled(btnItem) {
|
|
330
|
+
var result = true;
|
|
331
|
+
// 数值类型只有 数值区间规则 / 枚举 / 字典 / 非空 /属性类型
|
|
332
|
+
if ((bizAttributeSelectorValue === null || bizAttributeSelectorValue === void 0 ? void 0 : bizAttributeSelectorValue.type) == 2 && (btnItem.value >= 3 || btnItem.value == 1)) {
|
|
333
|
+
result = false;
|
|
334
|
+
}
|
|
335
|
+
// 日期属性类型 非空/正则/属性类型
|
|
336
|
+
if ((bizAttributeSelectorValue === null || bizAttributeSelectorValue === void 0 ? void 0 : bizAttributeSelectorValue.type) == 3 && (btnItem.value == 2 || btnItem.value == 5 || btnItem.value == 1)) {
|
|
337
|
+
result = false;
|
|
338
|
+
}
|
|
339
|
+
// 字符串类型 正则 /枚举 / 非空/属性类型
|
|
340
|
+
if ((bizAttributeSelectorValue === null || bizAttributeSelectorValue === void 0 ? void 0 : bizAttributeSelectorValue.type) == 1 && (btnItem.value == 2 || btnItem.value == 5 || btnItem.value == 4 || btnItem.value == 1)) {
|
|
341
|
+
result = false;
|
|
342
|
+
}
|
|
343
|
+
// 类型只能添加一个
|
|
344
|
+
if (optionsRule.find(function (o) {
|
|
345
|
+
return o.ruleType == btnItem.value;
|
|
346
|
+
})) {
|
|
347
|
+
result = true;
|
|
348
|
+
}
|
|
349
|
+
return result;
|
|
350
|
+
};
|
|
312
351
|
return /*#__PURE__*/React.createElement("div", {
|
|
313
352
|
className: "addRule"
|
|
314
353
|
}, /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -427,6 +466,7 @@ var AddRule = function AddRule(_ref) {
|
|
|
427
466
|
return /*#__PURE__*/React.createElement(Button, {
|
|
428
467
|
key: index,
|
|
429
468
|
type: "primary",
|
|
469
|
+
disabled: handleDisabled(item),
|
|
430
470
|
onClick: function onClick() {
|
|
431
471
|
return onChangeType(item.value);
|
|
432
472
|
}
|
|
@@ -460,10 +500,10 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
460
500
|
var _useContext2 = useContext(BizGlobalDataContext),
|
|
461
501
|
currentApp = _useContext2.currentApp;
|
|
462
502
|
// 枚举
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
enumValue =
|
|
466
|
-
setEnumValue =
|
|
503
|
+
var _useState17 = useState([]),
|
|
504
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
505
|
+
enumValue = _useState18[0],
|
|
506
|
+
setEnumValue = _useState18[1];
|
|
467
507
|
var handleEnumChange = function handleEnumChange(value) {
|
|
468
508
|
setEnumValue(value);
|
|
469
509
|
optionsValue.filter(function (r) {
|
|
@@ -471,27 +511,27 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
471
511
|
})[0].content = value;
|
|
472
512
|
};
|
|
473
513
|
// 区间
|
|
474
|
-
var _useState17 = useState(1),
|
|
475
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
476
|
-
minNum = _useState18[0],
|
|
477
|
-
setMinNum = _useState18[1];
|
|
478
514
|
var _useState19 = useState(1),
|
|
479
515
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
var _useState21 = useState(
|
|
516
|
+
minNum = _useState20[0],
|
|
517
|
+
setMinNum = _useState20[1];
|
|
518
|
+
var _useState21 = useState(1),
|
|
483
519
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
484
|
-
|
|
485
|
-
|
|
520
|
+
maxNum = _useState22[0],
|
|
521
|
+
setMaxNum = _useState22[1];
|
|
486
522
|
var _useState23 = useState(false),
|
|
487
523
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
var _useState25 = useState([]),
|
|
524
|
+
includedMinState = _useState24[0],
|
|
525
|
+
setIncludedMinState = _useState24[1];
|
|
526
|
+
var _useState25 = useState(false),
|
|
492
527
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
493
|
-
|
|
494
|
-
|
|
528
|
+
includedMaxState = _useState26[0],
|
|
529
|
+
setIncludedMaxState = _useState26[1];
|
|
530
|
+
//字典
|
|
531
|
+
var _useState27 = useState([]),
|
|
532
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
533
|
+
dictList = _useState28[0],
|
|
534
|
+
setDictList = _useState28[1];
|
|
495
535
|
var getDictList = function getDictList() {
|
|
496
536
|
request(apis.dict.dictList, {
|
|
497
537
|
method: 'post',
|
|
@@ -532,30 +572,30 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
532
572
|
getDictList();
|
|
533
573
|
}
|
|
534
574
|
}, []);
|
|
535
|
-
var
|
|
575
|
+
var _useState29 = useState((_optionsValue$find = optionsValue.find(function (o) {
|
|
536
576
|
return o.uniqueId == id;
|
|
537
577
|
})) === null || _optionsValue$find === void 0 ? void 0 : _optionsValue$find.content),
|
|
538
|
-
_useState28 = _slicedToArray(_useState27, 2),
|
|
539
|
-
typeValue = _useState28[0],
|
|
540
|
-
setTypeValue = _useState28[1];
|
|
541
|
-
var _useState29 = useState(optionsValue.filter(function (r) {
|
|
542
|
-
return r.uniqueId == id;
|
|
543
|
-
})[0].content),
|
|
544
578
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
545
|
-
|
|
546
|
-
|
|
579
|
+
typeValue = _useState30[0],
|
|
580
|
+
setTypeValue = _useState30[1];
|
|
547
581
|
var _useState31 = useState(optionsValue.filter(function (r) {
|
|
548
582
|
return r.uniqueId == id;
|
|
549
583
|
})[0].content),
|
|
550
584
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
551
|
-
|
|
552
|
-
|
|
585
|
+
testValue = _useState32[0],
|
|
586
|
+
setTestValue = _useState32[1];
|
|
587
|
+
var _useState33 = useState(optionsValue.filter(function (r) {
|
|
588
|
+
return r.uniqueId == id;
|
|
589
|
+
})[0].content),
|
|
590
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
591
|
+
ziduanValue = _useState34[0],
|
|
592
|
+
setZiduanValue = _useState34[1];
|
|
553
593
|
// 域分类:零售、公司、同业、风险、内部管理、其他
|
|
554
594
|
switch (type) {
|
|
555
595
|
case 1:
|
|
556
596
|
Component = /*#__PURE__*/React.createElement(Select, {
|
|
557
597
|
value: String(typeValue),
|
|
558
|
-
|
|
598
|
+
disabled: true,
|
|
559
599
|
options: [{
|
|
560
600
|
value: '1',
|
|
561
601
|
label: '字符串类型'
|
|
@@ -11,8 +11,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
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
13
|
import { Tooltip, message } from 'antd';
|
|
14
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
15
|
-
import { BizEventSelector, BizAttrConditionGroup, IconFont } from '@zgfe/business-lib';
|
|
14
|
+
import React, { useEffect, useRef, useState, useContext } from 'react';
|
|
15
|
+
import { BizEventSelector, BizAttrConditionGroup, IconFont, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
16
|
import './styles/index.less';
|
|
17
17
|
var classPrefix = 'virtual-event-eventfilter-box';
|
|
18
18
|
var EventFilter = function EventFilter(props) {
|
|
@@ -20,6 +20,8 @@ var EventFilter = function EventFilter(props) {
|
|
|
20
20
|
index = props.index,
|
|
21
21
|
virtualDrawerType = props.virtualDrawerType,
|
|
22
22
|
selectList = props.selectList;
|
|
23
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
24
|
+
envs = _useContext.envs;
|
|
23
25
|
// 筛选条件个数
|
|
24
26
|
var _useState = useState(props.value && props.value.filters && props.value.filters.conditions ? props.value.filters.conditions.length : 0),
|
|
25
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -56,8 +58,8 @@ var EventFilter = function EventFilter(props) {
|
|
|
56
58
|
// 添加筛选
|
|
57
59
|
var onAdd = function onAdd() {
|
|
58
60
|
// 最多可添加5条属性筛选
|
|
59
|
-
if (count >= 5) {
|
|
60
|
-
message.error(
|
|
61
|
+
if (count >= ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 5)) {
|
|
62
|
+
message.error("\u6700\u591A\u53EF\u6DFB\u52A0".concat((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 5, "\u6761\u5C5E\u6027\u7B5B\u9009"));
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
65
|
if (selectList.length <= 0) {
|
|
@@ -122,7 +124,7 @@ var EventFilter = function EventFilter(props) {
|
|
|
122
124
|
placement: "top",
|
|
123
125
|
title: '添加属性筛选'
|
|
124
126
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
125
|
-
className: "".concat(count < 5 && selectList.length > 0 ? '' : 'disable'),
|
|
127
|
+
className: "".concat(count < ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 5) && selectList.length > 0 ? '' : 'disable'),
|
|
126
128
|
type: "shaixuan",
|
|
127
129
|
onClick: function onClick() {
|
|
128
130
|
return onAdd();
|
|
@@ -33,7 +33,8 @@ var DrawerAdd = function DrawerAdd(props) {
|
|
|
33
33
|
name: ''
|
|
34
34
|
};
|
|
35
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
36
|
-
currentApp = _useContext.currentApp
|
|
36
|
+
currentApp = _useContext.currentApp,
|
|
37
|
+
envs = _useContext.envs;
|
|
37
38
|
// 关闭抽屉并重置表单
|
|
38
39
|
useEffect(function () {
|
|
39
40
|
setIsOpen(props.open);
|
|
@@ -304,7 +305,7 @@ var DrawerAdd = function DrawerAdd(props) {
|
|
|
304
305
|
eventIdList: [event.id],
|
|
305
306
|
onChange: onChangeFilters,
|
|
306
307
|
onConditionsCount: setCount
|
|
307
|
-
}), count < 10 ? (/*#__PURE__*/React.createElement(Link, {
|
|
308
|
+
}), count < ((envs === null || envs === void 0 ? void 0 : envs.propertyNum) || 10) ? (/*#__PURE__*/React.createElement(Link, {
|
|
308
309
|
target: "_blank",
|
|
309
310
|
onClick: function onClick() {
|
|
310
311
|
return onAdd();
|
|
@@ -165,7 +165,8 @@ var FormulateRule = function FormulateRule() {
|
|
|
165
165
|
method: 'post',
|
|
166
166
|
data: {
|
|
167
167
|
ruleId: ruleObj.ruleId,
|
|
168
|
-
status: ruleObj.status ? 0 : 1
|
|
168
|
+
status: ruleObj.status ? 0 : 1,
|
|
169
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
169
170
|
}
|
|
170
171
|
}).then(function (res) {
|
|
171
172
|
if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.57-zhongyuan.
|
|
3
|
+
"version": "1.0.57-zhongyuan.41",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/lodash": "^4.14.182",
|
|
47
47
|
"@umijs/fabric": "^2.8.1",
|
|
48
48
|
"@umijs/test": "^3.0.5",
|
|
49
|
-
"@zgfe/business-lib": "1.2.70-hxd.
|
|
49
|
+
"@zgfe/business-lib": "1.2.70-hxd.1",
|
|
50
50
|
"antd": "4.24.10",
|
|
51
51
|
"dumi": "^1.1.0",
|
|
52
52
|
"father-build": "^1.17.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"umi-request": "^1.4.0",
|
|
58
58
|
"yorkie": "^2.0.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "a6a0e1f2cb0745c2000d35f02f15c63557f9a624",
|
|
61
61
|
"gitHooks": {
|
|
62
62
|
"pre-commit": "lint-staged"
|
|
63
63
|
}
|