@zgfe/modules-dm 1.0.57-zhongyuan.42 → 1.0.57-zhongyuan.45

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.
@@ -6,5 +6,6 @@ declare const AddRule: React.FC<{
6
6
  onSetclose: Function;
7
7
  currentRuleDetail: RuleDetailType | undefined | null;
8
8
  getList: Function;
9
+ ruleRowEdit?: number;
9
10
  }>;
10
11
  export default AddRule;
@@ -27,7 +27,8 @@ var AddRule = function AddRule(_ref) {
27
27
  var addruleShow = _ref.addruleShow,
28
28
  onSetclose = _ref.onSetclose,
29
29
  currentRuleDetail = _ref.currentRuleDetail,
30
- getList = _ref.getList;
30
+ getList = _ref.getList,
31
+ ruleRowEdit = _ref.ruleRowEdit;
31
32
  var _useContext = useContext(BizGlobalDataContext),
32
33
  currentApp = _useContext.currentApp;
33
34
  // 规则启用
@@ -63,6 +64,10 @@ var AddRule = function AddRule(_ref) {
63
64
  };
64
65
  var onFinish = function onFinish(values) {
65
66
  console.log('Success:', values, optionsRule);
67
+ if (event.id == -100 || !bizAttributeSelectorValue) {
68
+ message.error('请选择事件或者属性!');
69
+ return;
70
+ }
66
71
  if (hasEvent) {
67
72
  message.error('该属性的规则已存在,请重新选择属性!');
68
73
  return;
@@ -271,6 +276,15 @@ var AddRule = function AddRule(_ref) {
271
276
  setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, attr), {}, {
272
277
  value: _value
273
278
  }));
279
+ var arr = optionsRule.map(function (o) {
280
+ if (o.ruleType == 1) {
281
+ return _objectSpread(_objectSpread({}, o), {}, {
282
+ content: attr.type
283
+ });
284
+ }
285
+ return o;
286
+ });
287
+ setOptionsRule(arr);
274
288
  setOptions(attr.type != '3' ? [].concat(initOptions, [{
275
289
  label: '字典校验',
276
290
  value: 6
@@ -346,6 +360,17 @@ var AddRule = function AddRule(_ref) {
346
360
  })) {
347
361
  result = true;
348
362
  }
363
+ // 类型只能添加一个
364
+ if (optionsRule.find(function (o) {
365
+ return o.ruleType != 2;
366
+ }) && btnItem.value == 2) {
367
+ result = true;
368
+ }
369
+ if (optionsRule.find(function (o) {
370
+ return o.ruleType == 2;
371
+ }) && optionsRule.length >= 1) {
372
+ result = true;
373
+ }
349
374
  return result;
350
375
  };
351
376
  return /*#__PURE__*/React.createElement("div", {
@@ -366,12 +391,13 @@ var AddRule = function AddRule(_ref) {
366
391
  width: "700px",
367
392
  footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
368
393
  onClick: onClose
369
- }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
394
+ }, "\u53D6\u6D88"), (ruleRowEdit == undefined || ruleRowEdit === 0) && (/*#__PURE__*/React.createElement(Button, {
370
395
  type: "primary",
371
396
  onClick: handleSave
372
- }, "\u786E\u5B9A")))
397
+ }, "\u786E\u5B9A"))))
373
398
  }, /*#__PURE__*/React.createElement(Form, {
374
399
  form: ruleForm,
400
+ disabled: ruleRowEdit === 1,
375
401
  labelCol: {
376
402
  span: 4
377
403
  },
@@ -490,7 +516,7 @@ function parseRange(str) {
490
516
  };
491
517
  }
492
518
  var TypeComponent = function TypeComponent(_ref2) {
493
- var _optionsValue$find;
519
+ var _optionsValue$find, _optionsValue$find3;
494
520
  var type = _ref2.type,
495
521
  optionsValue = _ref2.optionsValue,
496
522
  editStatus = _ref2.editStatus,
@@ -578,6 +604,14 @@ var TypeComponent = function TypeComponent(_ref2) {
578
604
  _useState30 = _slicedToArray(_useState29, 2),
579
605
  typeValue = _useState30[0],
580
606
  setTypeValue = _useState30[1];
607
+ useEffect(function () {
608
+ var _optionsValue$find2;
609
+ setTypeValue((_optionsValue$find2 = optionsValue.find(function (o) {
610
+ return o.uniqueId == id;
611
+ })) === null || _optionsValue$find2 === void 0 ? void 0 : _optionsValue$find2.content);
612
+ }, [(_optionsValue$find3 = optionsValue.find(function (o) {
613
+ return o.uniqueId == id;
614
+ })) === null || _optionsValue$find3 === void 0 ? void 0 : _optionsValue$find3.content]);
581
615
  var _useState31 = useState(optionsValue.filter(function (r) {
582
616
  return r.uniqueId == id;
583
617
  })[0].content),
@@ -1,257 +1,265 @@
1
- .clearRule {
2
- height: 100%;
3
- padding: 24px;
4
- background: #fff;
5
- border-radius: 8px;
6
- }
7
- .clearRule-searchTop {
8
- display: grid;
9
- grid-template-columns: 320px 1fr;
10
- align-items: center;
11
- justify-items: self-end;
12
- margin-bottom: 20px;
13
- }
14
- .clearRule-modal .ant-modal-body {
15
- height: 350px;
16
- }
17
- .clearRule-modal .ant-picker-dropdown {
18
- top: 133px !important;
19
- left: 13px !important;
20
- }
21
- .clearRule-content {
22
- display: flex;
23
- align-items: center;
24
- justify-content: space-between;
25
- }
26
- .clearRule-importModal-tip {
27
- margin: 0px 0px 10px;
28
- padding: 5px 0px 5px 15px;
29
- background-color: #e7f3fe;
30
- border: 1px solid #b8e4ff;
31
- border-radius: 4px;
32
- }
33
- .clearRule-importModal-tip .icon {
34
- margin: 0px 10px;
35
- color: #165dff;
36
- }
37
- .clearRule-importModal-list {
38
- height: 160px;
39
- padding: 10px;
40
- overflow-y: scroll;
41
- border: 1px solid #e5e5e5;
42
- border-radius: 4px;
43
- }
44
- .clearRule-openRuleModal-list {
45
- height: 160px;
46
- padding: 10px;
47
- overflow-y: scroll;
48
- border: 1px solid #e5e5e5;
49
- border-radius: 4px;
50
- }
51
- .clearRule-openRuleModal-closeTip {
52
- margin: 10px 0px;
53
- color: red;
54
- }
55
- .openRuleModal-icon {
56
- margin: 0px 10px 0px 0px;
57
- color: #faad14;
58
- }
59
- .addRuleForm .selectVent {
60
- display: grid;
61
- grid-gap: 20px;
62
- grid-template-columns: 1fr 1fr;
63
- align-items: center;
64
- width: 100%;
65
- margin: 20px 0px;
66
- }
67
- .addRuleForm .ant-checkbox-wrapper {
68
- position: relative;
69
- margin-right: 8px;
70
- margin-bottom: 8px;
71
- padding: 4px 15px;
72
- color: #333;
73
- vertical-align: middle;
74
- background-color: #efefef;
75
- border: 1px solid #e5e5e5;
76
- border-radius: 4px;
77
- cursor: pointer;
78
- transition: all 0.2s ease;
79
- }
80
- .addRuleForm .ant-checkbox-wrapper::after {
81
- position: absolute;
82
- bottom: -1px;
83
- left: 6px;
84
- z-index: 10;
85
- width: 17px;
86
- font-size: 23px;
87
- content: '+';
88
- }
89
- .addRuleForm .ant-checkbox-wrapper-checked {
90
- position: relative;
91
- color: #165dff;
92
- background-color: transparent;
93
- border: 1px solid #165dff;
94
- }
95
- .addRuleForm .ant-checkbox-wrapper-checked::after {
96
- position: absolute;
97
- bottom: -1px;
98
- left: 6px;
99
- z-index: 10;
100
- width: 17px;
101
- font-size: 23px;
102
- content: '+';
103
- }
104
- .addRuleForm .ant-checkbox-wrapper::after {
105
- display: inline;
106
- }
107
- .addRuleForm .ant-checkbox,
108
- .addRuleForm .ant-checkbox-inner {
109
- display: none;
110
- }
111
- .addRuleForm .drawerCloseIcon {
112
- float: right;
113
- cursor: pointer;
114
- }
115
- .addRuleForm .ant-drawer-close {
116
- display: none;
117
- }
118
- .addRuleForm .ant-drawer-footer {
119
- display: flex;
120
- justify-content: end;
121
- }
122
- .addRuleForm .attrValue {
123
- position: relative;
124
- padding-left: 30px;
125
- }
126
- .addRuleForm .attrValue-list {
127
- display: grid;
128
- grid-gap: 20px;
129
- grid-template-columns: 120px 1fr 50px;
130
- align-items: center;
131
- justify-content: space-between;
132
- margin: 20px 0px;
133
- }
134
- .addRuleForm .attrValue-styleLine {
135
- position: absolute;
136
- top: 50%;
137
- left: -1px;
138
- z-index: 10;
139
- width: 20px;
140
- color: white;
141
- text-align: center;
142
- background: #165dff;
143
- border-radius: 4px 4px 0px 0px;
144
- transform: translate(0, -50%);
145
- }
146
- .addRuleForm .attrValue::after {
147
- position: absolute;
148
- top: 0;
149
- left: 8px;
150
- z-index: 1;
151
- width: 1px;
152
- height: 100%;
153
- background: #e8efff;
154
- content: '';
155
- }
156
- .addRuleForm .attrValue .attrValue-list-right {
157
- display: grid;
158
- grid-gap: 20px;
159
- grid-template-columns: 3px 80px 10px 80px 3px;
160
- align-items: center;
161
- justify-content: start;
162
- }
163
- .columnsActionClass {
164
- cursor: pointer;
165
- }
166
- .formulateDetail-title {
167
- display: flex;
168
- align-items: center;
169
- justify-content: space-between;
170
- }
171
- .addRule-formulate-tip {
172
- margin: 10px 0px 0px;
173
- color: red;
174
- }
175
- .formulateDetailClass {
176
- margin: 10px 0px 0px;
177
- border: 1px solid #ecedf0;
178
- border-radius: 5px;
179
- }
180
- .formulateDetailClass-time {
181
- color: #5f6085;
182
- }
183
- .formulateDetailClass-title {
184
- display: grid;
185
- grid-gap: 16px;
186
- grid-template-columns: 200px 1fr;
187
- align-items: center;
188
- justify-content: space-between;
189
- background-color: #f2f3f4;
190
- border-bottom: 1px solid #ecedf0;
191
- }
192
- .formulateDetailClass-title-left {
193
- padding: 10px 0px 10px 10px;
194
- border-right: 1px solid #ecedf0;
195
- }
196
- .formulateDetailClass-title-right {
197
- display: flex;
198
- align-items: center;
199
- justify-content: space-between;
200
- padding: 10px 10px 10px 10px;
201
- }
202
- .formulateDetailClass-content {
203
- display: grid;
204
- grid-gap: 16px;
205
- grid-template-columns: 200px 1fr;
206
- align-items: flex-start;
207
- justify-content: space-between;
208
- height: 300px;
209
- }
210
- .formulateDetailClass-content-left {
211
- height: 100%;
212
- overflow: auto;
213
- border-right: 1px solid #ecedf0;
214
- }
215
- .formulateDetailClass-content-left-tip {
216
- margin: 0px 5px 0px 0px;
217
- color: red;
218
- }
219
- .formulateDetailClass-content-left-item {
220
- padding: 10px;
221
- cursor: pointer;
222
- }
223
- .formulateDetailClass-content-left-itemContent {
224
- margin: 0px 0px 0px 5px;
225
- padding: 5px;
226
- border: 1px solid #5f6085;
227
- border-radius: 4px;
228
- }
229
- .formulateDetailClass-content-left .active {
230
- position: relative;
231
- background-color: #e8efff;
232
- }
233
- .formulateDetailClass-content-left .active::after {
234
- position: absolute;
235
- top: 0;
236
- left: 0;
237
- width: 2px;
238
- height: 100%;
239
- background-color: #6b8ffd;
240
- content: '';
241
- }
242
- .formulateDetailClass-content-left .activeTime {
243
- color: #2467fc;
244
- }
245
- .formulateDetailClass-content-left .activeTime .formulateDetailClass-content-left-tip {
246
- color: #2467fc;
247
- }
248
- .formulateDetailClass-content-right {
249
- display: flex;
250
- align-items: center;
251
- justify-content: space-between;
252
- margin: 15px;
253
- line-height: 2;
254
- }
255
- .addRule-errorTip {
256
- color: red;
257
- }
1
+ .clearRule {
2
+ height: 100%;
3
+ padding: 24px;
4
+ background: #fff;
5
+ border-radius: 8px;
6
+ }
7
+ .clearRule-searchTop {
8
+ display: grid;
9
+ grid-template-columns: 320px 1fr;
10
+ align-items: center;
11
+ justify-items: self-end;
12
+ margin-bottom: 20px;
13
+ }
14
+ .clearRule-modal .ant-modal-body {
15
+ height: 350px;
16
+ }
17
+ .clearRule-modal .ant-picker-dropdown {
18
+ top: 133px !important;
19
+ left: 13px !important;
20
+ }
21
+ .clearRule-content {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ }
26
+ .clearRule-importModal-tip {
27
+ margin: 0px 0px 10px;
28
+ padding: 5px 0px 5px 15px;
29
+ background-color: #e7f3fe;
30
+ border: 1px solid #b8e4ff;
31
+ border-radius: 4px;
32
+ }
33
+ .clearRule-importModal-tip .icon {
34
+ margin: 0px 10px;
35
+ color: #165dff;
36
+ }
37
+ .clearRule-importModal-list {
38
+ height: 160px;
39
+ padding: 10px;
40
+ overflow-y: scroll;
41
+ border: 1px solid #e5e5e5;
42
+ border-radius: 4px;
43
+ }
44
+ .clearRule-openRuleModal-list {
45
+ height: 160px;
46
+ padding: 10px;
47
+ overflow-y: scroll;
48
+ border: 1px solid #e5e5e5;
49
+ border-radius: 4px;
50
+ }
51
+ .clearRule-openRuleModal-closeTip {
52
+ margin: 10px 0px;
53
+ color: red;
54
+ }
55
+ .openRuleModal-icon {
56
+ margin: 0px 10px 0px 0px;
57
+ color: #faad14;
58
+ }
59
+ .addRuleForm .sourceValueErrortext {
60
+ color: red;
61
+ margin: 6px 0px 0px;
62
+ font-size: 12px;
63
+ position: absolute;
64
+ bottom: 0;
65
+ left: 16px;
66
+ }
67
+ .addRuleForm .selectVent {
68
+ display: grid;
69
+ grid-gap: 20px;
70
+ grid-template-columns: 1fr 1fr;
71
+ align-items: center;
72
+ width: 100%;
73
+ margin: 20px 0px;
74
+ }
75
+ .addRuleForm .ant-checkbox-wrapper {
76
+ position: relative;
77
+ margin-right: 8px;
78
+ margin-bottom: 8px;
79
+ padding: 4px 15px;
80
+ color: #333;
81
+ vertical-align: middle;
82
+ background-color: #efefef;
83
+ border: 1px solid #e5e5e5;
84
+ border-radius: 4px;
85
+ cursor: pointer;
86
+ transition: all 0.2s ease;
87
+ }
88
+ .addRuleForm .ant-checkbox-wrapper::after {
89
+ position: absolute;
90
+ bottom: -1px;
91
+ left: 6px;
92
+ z-index: 10;
93
+ width: 17px;
94
+ font-size: 23px;
95
+ content: '+';
96
+ }
97
+ .addRuleForm .ant-checkbox-wrapper-checked {
98
+ position: relative;
99
+ color: #165dff;
100
+ background-color: transparent;
101
+ border: 1px solid #165dff;
102
+ }
103
+ .addRuleForm .ant-checkbox-wrapper-checked::after {
104
+ position: absolute;
105
+ bottom: -1px;
106
+ left: 6px;
107
+ z-index: 10;
108
+ width: 17px;
109
+ font-size: 23px;
110
+ content: '+';
111
+ }
112
+ .addRuleForm .ant-checkbox-wrapper::after {
113
+ display: inline;
114
+ }
115
+ .addRuleForm .ant-checkbox,
116
+ .addRuleForm .ant-checkbox-inner {
117
+ display: none;
118
+ }
119
+ .addRuleForm .drawerCloseIcon {
120
+ float: right;
121
+ cursor: pointer;
122
+ }
123
+ .addRuleForm .ant-drawer-close {
124
+ display: none;
125
+ }
126
+ .addRuleForm .ant-drawer-footer {
127
+ display: flex;
128
+ justify-content: end;
129
+ }
130
+ .addRuleForm .attrValue {
131
+ position: relative;
132
+ padding-left: 30px;
133
+ }
134
+ .addRuleForm .attrValue-list {
135
+ display: grid;
136
+ grid-gap: 20px;
137
+ grid-template-columns: 120px 1fr 50px;
138
+ align-items: center;
139
+ justify-content: space-between;
140
+ margin: 20px 0px;
141
+ }
142
+ .addRuleForm .attrValue-styleLine {
143
+ position: absolute;
144
+ top: 50%;
145
+ left: -1px;
146
+ z-index: 10;
147
+ width: 20px;
148
+ color: white;
149
+ text-align: center;
150
+ background: #165dff;
151
+ border-radius: 4px 4px 0px 0px;
152
+ transform: translate(0, -50%);
153
+ }
154
+ .addRuleForm .attrValue::after {
155
+ position: absolute;
156
+ top: 0;
157
+ left: 8px;
158
+ z-index: 1;
159
+ width: 1px;
160
+ height: 100%;
161
+ background: #e8efff;
162
+ content: '';
163
+ }
164
+ .addRuleForm .attrValue .attrValue-list-right {
165
+ display: grid;
166
+ grid-gap: 20px;
167
+ grid-template-columns: 3px 80px 10px 80px 3px;
168
+ align-items: center;
169
+ justify-content: start;
170
+ }
171
+ .columnsActionClass {
172
+ cursor: pointer;
173
+ }
174
+ .formulateDetail-title {
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: space-between;
178
+ }
179
+ .addRule-formulate-tip {
180
+ margin: 10px 0px 0px;
181
+ color: red;
182
+ }
183
+ .formulateDetailClass {
184
+ margin: 10px 0px 0px;
185
+ border: 1px solid #ecedf0;
186
+ border-radius: 5px;
187
+ }
188
+ .formulateDetailClass-time {
189
+ color: #5f6085;
190
+ }
191
+ .formulateDetailClass-title {
192
+ display: grid;
193
+ grid-gap: 16px;
194
+ grid-template-columns: 200px 1fr;
195
+ align-items: center;
196
+ justify-content: space-between;
197
+ background-color: #f2f3f4;
198
+ border-bottom: 1px solid #ecedf0;
199
+ }
200
+ .formulateDetailClass-title-left {
201
+ padding: 10px 0px 10px 10px;
202
+ border-right: 1px solid #ecedf0;
203
+ }
204
+ .formulateDetailClass-title-right {
205
+ display: flex;
206
+ align-items: center;
207
+ justify-content: space-between;
208
+ padding: 10px 10px 10px 10px;
209
+ }
210
+ .formulateDetailClass-content {
211
+ display: grid;
212
+ grid-gap: 16px;
213
+ grid-template-columns: 200px 1fr;
214
+ align-items: flex-start;
215
+ justify-content: space-between;
216
+ height: 300px;
217
+ }
218
+ .formulateDetailClass-content-left {
219
+ height: 100%;
220
+ overflow: auto;
221
+ border-right: 1px solid #ecedf0;
222
+ }
223
+ .formulateDetailClass-content-left-tip {
224
+ margin: 0px 5px 0px 0px;
225
+ color: red;
226
+ }
227
+ .formulateDetailClass-content-left-item {
228
+ padding: 10px;
229
+ cursor: pointer;
230
+ }
231
+ .formulateDetailClass-content-left-itemContent {
232
+ margin: 0px 0px 0px 5px;
233
+ padding: 5px;
234
+ border: 1px solid #5f6085;
235
+ border-radius: 4px;
236
+ }
237
+ .formulateDetailClass-content-left .active {
238
+ position: relative;
239
+ background-color: #e8efff;
240
+ }
241
+ .formulateDetailClass-content-left .active::after {
242
+ position: absolute;
243
+ top: 0;
244
+ left: 0;
245
+ width: 2px;
246
+ height: 100%;
247
+ background-color: #6b8ffd;
248
+ content: '';
249
+ }
250
+ .formulateDetailClass-content-left .activeTime {
251
+ color: #2467fc;
252
+ }
253
+ .formulateDetailClass-content-left .activeTime .formulateDetailClass-content-left-tip {
254
+ color: #2467fc;
255
+ }
256
+ .formulateDetailClass-content-right {
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: space-between;
260
+ margin: 15px;
261
+ line-height: 2;
262
+ }
263
+ .addRule-errorTip {
264
+ color: red;
265
+ }