@zgfe/modules-dm 1.0.57-zhongyuan.37 → 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.
@@ -89,6 +89,7 @@ declare let apis: {
89
89
  downloadTemple: string;
90
90
  allOpenStatus: string;
91
91
  checkStatus: string;
92
+ checkExists: string;
92
93
  };
93
94
  clearRule: {
94
95
  getList: string;
@@ -152,7 +152,8 @@ var apis = {
152
152
  exportFile: '/zg/web/v2/verify/report/export',
153
153
  downloadTemple: '/zg/web/v2/verify/downloadMould',
154
154
  allOpenStatus: '/zg/web/v2/verify/statusMain',
155
- checkStatus: '/zg/web/v2/verify/statusBefore'
155
+ checkStatus: '/zg/web/v2/verify/statusBefore',
156
+ checkExists: '/zg/web/v2/verify/checkExists'
156
157
  },
157
158
  clearRule: {
158
159
  getList: '/zg/web/v2/rinseShiftRule/queryRinseShiftRuleList',
@@ -237,17 +237,30 @@ var AddRule = function AddRule(_ref) {
237
237
  setBizAttributeSelectorValue(undefined);
238
238
  setOptions([].concat(initOptions));
239
239
  } else {
240
+ // 先查询是否有属性规则一开启的
241
+ request(apis.rule.checkExists, {
242
+ method: 'post',
243
+ data: {
244
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
245
+ event: event.id,
246
+ attr: attr === null || attr === void 0 ? void 0 : attr.id
247
+ }
248
+ }).then(function (res) {
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);
257
+ return;
258
+ }
259
+ });
240
260
  var _value = attr.propCategory === 'eventProp' ? attr.id : attr.name;
241
261
  setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, attr), {}, {
242
262
  value: _value
243
263
  }));
244
- // 初始化属性基础类型
245
- // const newArr = optionsRule.map((o) => {
246
- // if (o.ruleType == 1) {
247
- // o.content = attr.type;
248
- // }
249
- // });
250
- // setOptionsRule(newArr);
251
264
  setOptions(attr.type != '3' ? [].concat(initOptions, [{
252
265
  label: '字典校验',
253
266
  value: 6
@@ -277,8 +290,20 @@ var AddRule = function AddRule(_ref) {
277
290
  description: currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.ruleDescription,
278
291
  status: (currentRuleDetail === null || currentRuleDetail === void 0 ? void 0 : currentRuleDetail.status) == 1 ? true : false
279
292
  });
280
- setOptionsRule(currentRuleDetail.verifyDetailVo);
281
- setOptions(currentRuleDetail.verifyDetailVo[0] && currentRuleDetail.verifyDetailVo[0].content != '3' ? [].concat(initOptions, [{
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, [{
282
307
  label: '字典校验',
283
308
  value: 6
284
309
  }]) : [].concat(initOptions));
@@ -479,8 +504,8 @@ var TypeComponent = function TypeComponent(_ref2) {
479
504
  setDictList((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
480
505
  return {
481
506
  label: item.dictName,
482
- value: item.id + '',
483
- id: item.id
507
+ value: String(item.id),
508
+ id: String(item.id)
484
509
  };
485
510
  }));
486
511
  }
@@ -513,19 +538,32 @@ var TypeComponent = function TypeComponent(_ref2) {
513
538
  _useState28 = _slicedToArray(_useState27, 2),
514
539
  typeValue = _useState28[0],
515
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
+ // 域分类:零售、公司、同业、风险、内部管理、其他
516
554
  switch (type) {
517
555
  case 1:
518
556
  Component = /*#__PURE__*/React.createElement(Select, {
519
- value: Number(typeValue),
557
+ value: String(typeValue),
520
558
  // disabled={true}
521
559
  options: [{
522
- value: 1,
560
+ value: '1',
523
561
  label: '字符串类型'
524
562
  }, {
525
- value: 2,
563
+ value: '2',
526
564
  label: '数值类型'
527
565
  }, {
528
- value: 3,
566
+ value: '3',
529
567
  label: '日期类型'
530
568
  }],
531
569
  onChange: function onChange(value) {
@@ -539,10 +577,9 @@ var TypeComponent = function TypeComponent(_ref2) {
539
577
  case 2:
540
578
  Component = /*#__PURE__*/React.createElement(Input, {
541
579
  placeholder: "\u8BF7\u8F93\u5165\u6B63\u5219\u8868\u5355\u5F0F",
542
- value: optionsValue.filter(function (r) {
543
- return r.uniqueId == id;
544
- })[0].content,
580
+ value: testValue,
545
581
  onChange: function onChange(event) {
582
+ setTestValue(event.target.value);
546
583
  optionsValue.filter(function (r) {
547
584
  return r.uniqueId == id;
548
585
  })[0].content = event.target.value;
@@ -617,14 +654,15 @@ var TypeComponent = function TypeComponent(_ref2) {
617
654
  });
618
655
  break;
619
656
  case 6:
620
- Component = /*#__PURE__*/React.createElement(Select, {
621
- defaultValue: Number(optionsValue.filter(function (r) {
622
- return r.uniqueId == id;
623
- })[0].content),
624
- // value={optionsValue.filter((r) => r.ruleType == type)[0].content}
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,
625
662
  placeholder: "\u9009\u62E9\u5B57\u5178\u89C4\u5219",
626
663
  options: dictList,
627
664
  onChange: function onChange(value) {
665
+ setZiduanValue(value);
628
666
  optionsValue.filter(function (r) {
629
667
  return r.uniqueId == id;
630
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.37",
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": "425c100daccfefb97c11efdcaa5761678936b7ad",
60
+ "gitHead": "40d86e8f09a9f47055ddce2c669f04a04ce88f9d",
61
61
  "gitHooks": {
62
62
  "pre-commit": "lint-staged"
63
63
  }