@zgfe/modules-dm 1.0.57-zhongyuan.38 → 1.0.57-zhongyuan.39
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.
- package/es/modules/clearRule/addRule.js +49 -28
- package/package.json +2 -2
|
@@ -246,11 +246,14 @@ var AddRule = function AddRule(_ref) {
|
|
|
246
246
|
attr: attr === null || attr === void 0 ? void 0 : attr.id
|
|
247
247
|
}
|
|
248
248
|
}).then(function (res) {
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
// if (res?.code == '100000') {
|
|
250
|
+
// // 判断属性是否已经存在
|
|
251
|
+
// const exists = res.data; // 假设后端返回的数据结构中有一个字段表示是否存在
|
|
252
|
+
// !exists && message.error('该属性的规则已存在,请重新选择属性!');
|
|
253
|
+
// return;
|
|
254
|
+
// }
|
|
255
|
+
if ((res === null || res === void 0 ? void 0 : res.code) != '100000') {
|
|
256
|
+
message.error(res.msg);
|
|
254
257
|
return;
|
|
255
258
|
}
|
|
256
259
|
});
|
|
@@ -258,13 +261,6 @@ var AddRule = function AddRule(_ref) {
|
|
|
258
261
|
setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, attr), {}, {
|
|
259
262
|
value: _value
|
|
260
263
|
}));
|
|
261
|
-
// 初始化属性基础类型
|
|
262
|
-
// const newArr = optionsRule.map((o) => {
|
|
263
|
-
// if (o.ruleType == 1) {
|
|
264
|
-
// o.content = attr.type;
|
|
265
|
-
// }
|
|
266
|
-
// });
|
|
267
|
-
// setOptionsRule(newArr);
|
|
268
264
|
setOptions(attr.type != '3' ? [].concat(initOptions, [{
|
|
269
265
|
label: '字典校验',
|
|
270
266
|
value: 6
|
|
@@ -294,8 +290,20 @@ var AddRule = function AddRule(_ref) {
|
|
|
294
290
|
description: currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.ruleDescription,
|
|
295
291
|
status: (currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.status) == 1 ? true : false
|
|
296
292
|
});
|
|
297
|
-
setOptionsRule(currentRuleDetail.verifyDetailVo);
|
|
298
|
-
setOptions(
|
|
293
|
+
// setOptionsRule(currentRuleDetail.verifyDetailVo);
|
|
294
|
+
// setOptions(
|
|
295
|
+
// currentRuleDetail.verifyDetailVo[0] && currentRuleDetail.verifyDetailVo[0].content != '3'
|
|
296
|
+
// ? [...initOptions, { label: '字典校验', value: 6 }]
|
|
297
|
+
// : [...initOptions],
|
|
298
|
+
// );
|
|
299
|
+
var newarr = currentRuleDetail.verifyDetailVo.map(function (r) {
|
|
300
|
+
return _objectSpread(_objectSpread({}, r), {}, {
|
|
301
|
+
uniqueId: generateUniqueId()
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
setOptionsRule(newarr);
|
|
305
|
+
// 回显数据时要加入一个随机id
|
|
306
|
+
setOptions(newarr[0] && newarr[0].content != '3' ? [].concat(initOptions, [{
|
|
299
307
|
label: '字典校验',
|
|
300
308
|
value: 6
|
|
301
309
|
}]) : [].concat(initOptions));
|
|
@@ -496,8 +504,8 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
496
504
|
setDictList((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
497
505
|
return {
|
|
498
506
|
label: item.dictName,
|
|
499
|
-
value: item.id
|
|
500
|
-
id: item.id
|
|
507
|
+
value: String(item.id),
|
|
508
|
+
id: String(item.id)
|
|
501
509
|
};
|
|
502
510
|
}));
|
|
503
511
|
}
|
|
@@ -530,19 +538,32 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
530
538
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
531
539
|
typeValue = _useState28[0],
|
|
532
540
|
setTypeValue = _useState28[1];
|
|
541
|
+
var _useState29 = useState(optionsValue.filter(function (r) {
|
|
542
|
+
return r.uniqueId == id;
|
|
543
|
+
})[0].content),
|
|
544
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
545
|
+
testValue = _useState30[0],
|
|
546
|
+
setTestValue = _useState30[1];
|
|
547
|
+
var _useState31 = useState(optionsValue.filter(function (r) {
|
|
548
|
+
return r.uniqueId == id;
|
|
549
|
+
})[0].content),
|
|
550
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
551
|
+
ziduanValue = _useState32[0],
|
|
552
|
+
setZiduanValue = _useState32[1];
|
|
553
|
+
// 域分类:零售、公司、同业、风险、内部管理、其他
|
|
533
554
|
switch (type) {
|
|
534
555
|
case 1:
|
|
535
556
|
Component = /*#__PURE__*/React.createElement(Select, {
|
|
536
|
-
value:
|
|
557
|
+
value: String(typeValue),
|
|
537
558
|
// disabled={true}
|
|
538
559
|
options: [{
|
|
539
|
-
value: 1,
|
|
560
|
+
value: '1',
|
|
540
561
|
label: '字符串类型'
|
|
541
562
|
}, {
|
|
542
|
-
value: 2,
|
|
563
|
+
value: '2',
|
|
543
564
|
label: '数值类型'
|
|
544
565
|
}, {
|
|
545
|
-
value: 3,
|
|
566
|
+
value: '3',
|
|
546
567
|
label: '日期类型'
|
|
547
568
|
}],
|
|
548
569
|
onChange: function onChange(value) {
|
|
@@ -556,10 +577,9 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
556
577
|
case 2:
|
|
557
578
|
Component = /*#__PURE__*/React.createElement(Input, {
|
|
558
579
|
placeholder: "\u8BF7\u8F93\u5165\u6B63\u5219\u8868\u5355\u5F0F",
|
|
559
|
-
value:
|
|
560
|
-
return r.uniqueId == id;
|
|
561
|
-
})[0].content,
|
|
580
|
+
value: testValue,
|
|
562
581
|
onChange: function onChange(event) {
|
|
582
|
+
setTestValue(event.target.value);
|
|
563
583
|
optionsValue.filter(function (r) {
|
|
564
584
|
return r.uniqueId == id;
|
|
565
585
|
})[0].content = event.target.value;
|
|
@@ -634,14 +654,15 @@ var TypeComponent = function TypeComponent(_ref2) {
|
|
|
634
654
|
});
|
|
635
655
|
break;
|
|
636
656
|
case 6:
|
|
637
|
-
Component = /*#__PURE__*/React.createElement(Select
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
657
|
+
Component = /*#__PURE__*/React.createElement(Select
|
|
658
|
+
// defaultValue={optionsValue.filter((r) => r.uniqueId == id)[0].content}
|
|
659
|
+
, {
|
|
660
|
+
// defaultValue={optionsValue.filter((r) => r.uniqueId == id)[0].content}
|
|
661
|
+
value: ziduanValue,
|
|
642
662
|
placeholder: "\u9009\u62E9\u5B57\u5178\u89C4\u5219",
|
|
643
663
|
options: dictList,
|
|
644
664
|
onChange: function onChange(value) {
|
|
665
|
+
setZiduanValue(value);
|
|
645
666
|
optionsValue.filter(function (r) {
|
|
646
667
|
return r.uniqueId == id;
|
|
647
668
|
})[0].content = value;
|
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.39",
|
|
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": "
|
|
60
|
+
"gitHead": "40d86e8f09a9f47055ddce2c669f04a04ce88f9d",
|
|
61
61
|
"gitHooks": {
|
|
62
62
|
"pre-commit": "lint-staged"
|
|
63
63
|
}
|