@openli1115/lowcode-edit-pro-table 1.0.107 → 1.0.109
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/umi.a9bfd574.js +1 -0
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/dist/BizComps.js +2 -2
- package/dist/BizComps.js.map +1 -1
- package/es/components/ProSearch/index.js +94 -15
- package/lib/components/ProSearch/index.js +105 -26
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
- package/build/docs/umi.907b4318.js +0 -1
|
@@ -12,9 +12,6 @@ import { useState, useEffect } from 'react';
|
|
|
12
12
|
import { SearchOutlined } from '@ant-design/icons';
|
|
13
13
|
import moment from 'moment';
|
|
14
14
|
var OPTION_OPTIONS = [{
|
|
15
|
-
label: '(留空)',
|
|
16
|
-
value: ''
|
|
17
|
-
}, {
|
|
18
15
|
label: '等于',
|
|
19
16
|
value: 'EQ'
|
|
20
17
|
}, {
|
|
@@ -68,12 +65,20 @@ var newCondRow = function newCondRow(sign) {
|
|
|
68
65
|
return {
|
|
69
66
|
id: genId(),
|
|
70
67
|
sign: sign,
|
|
71
|
-
option: '',
|
|
68
|
+
option: 'EQ',
|
|
72
69
|
low: '',
|
|
73
70
|
high: ''
|
|
74
71
|
};
|
|
75
72
|
};
|
|
76
73
|
|
|
74
|
+
/** 根据 low/high 是否都有值,自动推断比较符:都有值 → BT,否则 EQ */
|
|
75
|
+
var autoAdjustOption = function autoAdjustOption(currentOpt, low, high) {
|
|
76
|
+
if (low && high) return 'BT';
|
|
77
|
+
// high 或 low 被清空时,若之前是 BT 则回退到 EQ
|
|
78
|
+
if (currentOpt === 'BT') return 'EQ';
|
|
79
|
+
return currentOpt;
|
|
80
|
+
};
|
|
81
|
+
|
|
77
82
|
// ConditionTable: multi-value rows inside the modal
|
|
78
83
|
var ConditionTable = function ConditionTable(_ref) {
|
|
79
84
|
var sign = _ref.sign,
|
|
@@ -82,7 +87,13 @@ var ConditionTable = function ConditionTable(_ref) {
|
|
|
82
87
|
var update = function update(id, key, val) {
|
|
83
88
|
return onChange(rows.map(function (r) {
|
|
84
89
|
var _extends2;
|
|
85
|
-
|
|
90
|
+
if (r.id !== id) return r;
|
|
91
|
+
var updated = _extends({}, r, (_extends2 = {}, _extends2[key] = val, _extends2));
|
|
92
|
+
// 修改 low/high 时自动调整比较符:都有值 → BT,否则回退 EQ
|
|
93
|
+
if (key === 'low' || key === 'high') {
|
|
94
|
+
updated.option = autoAdjustOption(r.option, updated.low, updated.high);
|
|
95
|
+
}
|
|
96
|
+
return updated;
|
|
86
97
|
}));
|
|
87
98
|
};
|
|
88
99
|
var remove = function remove(id) {
|
|
@@ -231,6 +242,50 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
231
242
|
}, [fields.map(function (f) {
|
|
232
243
|
return f.id;
|
|
233
244
|
}).join(',')]);
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* 实时同步:fieldValues / fields 变化时,将查询条件写入 window.screenStructures 和 window.customTypeMap,
|
|
248
|
+
* 确保任何外部事件(按钮点击、页面加载等)触发 executeLogicEngine 时,generateStructureForm() 能读到最新数据。
|
|
249
|
+
*/
|
|
250
|
+
useEffect(function () {
|
|
251
|
+
var win = window;
|
|
252
|
+
if (!win.screenStructures) win.screenStructures = {};
|
|
253
|
+
if (!win.customTypeMap) win.customTypeMap = {};
|
|
254
|
+
fields.forEach(function (f) {
|
|
255
|
+
var fv = fieldValues[f.id] || {
|
|
256
|
+
low: '',
|
|
257
|
+
high: '',
|
|
258
|
+
conditions: []
|
|
259
|
+
};
|
|
260
|
+
var si = f.screenInner || 'st_' + f.techName;
|
|
261
|
+
var screenRows = [];
|
|
262
|
+
if (fv.conditions.length) {
|
|
263
|
+
fv.conditions.forEach(function (c) {
|
|
264
|
+
if (c.low || c.high) {
|
|
265
|
+
screenRows.push({
|
|
266
|
+
sign: c.sign,
|
|
267
|
+
option: c.option || 'EQ',
|
|
268
|
+
low: c.low || '',
|
|
269
|
+
high: c.high || '',
|
|
270
|
+
selected_flag: null,
|
|
271
|
+
inner_status: null
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
} else if (fv.low || fv.high) {
|
|
276
|
+
screenRows.push({
|
|
277
|
+
sign: 'I',
|
|
278
|
+
option: fv.high ? 'BT' : 'EQ',
|
|
279
|
+
low: fv.low || '',
|
|
280
|
+
high: fv.high || '',
|
|
281
|
+
selected_flag: null,
|
|
282
|
+
inner_status: null
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
win.screenStructures[si] = screenRows;
|
|
286
|
+
win.customTypeMap[si] = '4';
|
|
287
|
+
});
|
|
288
|
+
}, [fieldValues, fields]);
|
|
234
289
|
var updateVal = function updateVal(id, key, val) {
|
|
235
290
|
return setFieldValues(function (prev) {
|
|
236
291
|
var _extends3, _extends4;
|
|
@@ -280,9 +335,9 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
280
335
|
var confirmModal = function confirmModal() {
|
|
281
336
|
if (!activeFieldId) return;
|
|
282
337
|
var conditions = [].concat(includeRows.filter(function (r) {
|
|
283
|
-
return r.low || r.
|
|
338
|
+
return r.low || r.high;
|
|
284
339
|
}), excludeRows.filter(function (r) {
|
|
285
|
-
return r.low || r.
|
|
340
|
+
return r.low || r.high;
|
|
286
341
|
}));
|
|
287
342
|
setFieldValues(function (prev) {
|
|
288
343
|
var _extends7;
|
|
@@ -364,14 +419,14 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
364
419
|
if (modalTab === 'include') {
|
|
365
420
|
setIncludeRows(function (prev) {
|
|
366
421
|
var base = prev.filter(function (r) {
|
|
367
|
-
return r.low || r.high
|
|
422
|
+
return r.low || r.high;
|
|
368
423
|
});
|
|
369
424
|
return base.length ? [].concat(base, newRows) : newRows;
|
|
370
425
|
});
|
|
371
426
|
} else {
|
|
372
427
|
setExcludeRows(function (prev) {
|
|
373
428
|
var base = prev.filter(function (r) {
|
|
374
|
-
return r.low || r.high
|
|
429
|
+
return r.low || r.high;
|
|
375
430
|
});
|
|
376
431
|
return base.length ? [].concat(base, newRows) : newRows;
|
|
377
432
|
});
|
|
@@ -403,7 +458,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
403
458
|
});
|
|
404
459
|
} else if (fv.low || fv.high) {
|
|
405
460
|
var _rows$push2;
|
|
406
|
-
rows.push((_rows$push2 = {}, _rows$push2[si + "-sign"] = 'I', _rows$push2[si + "-option"] = 'EQ', _rows$push2[si + "-low"] = fv.low, _rows$push2[si + "-high"] = fv.high, _rows$push2));
|
|
461
|
+
rows.push((_rows$push2 = {}, _rows$push2[si + "-sign"] = 'I', _rows$push2[si + "-option"] = fv.high ? 'BT' : 'EQ', _rows$push2[si + "-low"] = fv.low, _rows$push2[si + "-high"] = fv.high, _rows$push2));
|
|
407
462
|
}
|
|
408
463
|
if (rows.length) data[si] = rows;
|
|
409
464
|
|
|
@@ -414,7 +469,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
414
469
|
var screenRows = [];
|
|
415
470
|
if (fv.conditions.length) {
|
|
416
471
|
fv.conditions.forEach(function (c) {
|
|
417
|
-
if (c.low || c.high
|
|
472
|
+
if (c.low || c.high) {
|
|
418
473
|
screenRows.push({
|
|
419
474
|
sign: c.sign,
|
|
420
475
|
option: c.option || 'EQ',
|
|
@@ -450,8 +505,24 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
450
505
|
var val = displayCond ? key === 'low' ? displayCond.low : displayCond.high : fv[key];
|
|
451
506
|
var _onChange = function onChange(v) {
|
|
452
507
|
if (displayCond) {
|
|
453
|
-
//
|
|
454
|
-
|
|
508
|
+
// 将修改同步到多值弹窗的第一行对应字段,并自动调整比较符
|
|
509
|
+
var newLow = key === 'low' ? v : displayCond.low;
|
|
510
|
+
var newHigh = key === 'high' ? v : displayCond.high;
|
|
511
|
+
var newOpt = autoAdjustOption(displayCond.option, newLow, newHigh);
|
|
512
|
+
setFieldValues(function (prev) {
|
|
513
|
+
var _extends9;
|
|
514
|
+
var fv = prev[field.id] || {
|
|
515
|
+
low: '',
|
|
516
|
+
high: '',
|
|
517
|
+
conditions: []
|
|
518
|
+
};
|
|
519
|
+
return _extends({}, prev, (_extends9 = {}, _extends9[field.id] = _extends({}, fv, {
|
|
520
|
+
conditions: fv.conditions.map(function (c) {
|
|
521
|
+
var _extends8;
|
|
522
|
+
return c.id === displayCond.id ? _extends({}, c, (_extends8 = {}, _extends8[key] = v, _extends8.option = newOpt, _extends8)) : c;
|
|
523
|
+
})
|
|
524
|
+
}), _extends9));
|
|
525
|
+
});
|
|
455
526
|
} else {
|
|
456
527
|
updateVal(field.id, key, v);
|
|
457
528
|
}
|
|
@@ -549,6 +620,14 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
549
620
|
})
|
|
550
621
|
}, _sym);
|
|
551
622
|
}
|
|
623
|
+
// 无多值条件时:low 和 high 都有值 → 显示绿底"~"(介于)
|
|
624
|
+
if (fv.low && fv.high) {
|
|
625
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
626
|
+
style: _extends({}, badgeStyle, {
|
|
627
|
+
background: '#52c41a'
|
|
628
|
+
})
|
|
629
|
+
}, OPTION_SYMBOL['BT']);
|
|
630
|
+
}
|
|
552
631
|
return null;
|
|
553
632
|
};
|
|
554
633
|
var headerSize = {
|
|
@@ -559,10 +638,10 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
559
638
|
return f.id === activeFieldId;
|
|
560
639
|
});
|
|
561
640
|
var incCount = includeRows.filter(function (r) {
|
|
562
|
-
return r.low || r.
|
|
641
|
+
return r.low || r.high;
|
|
563
642
|
}).length;
|
|
564
643
|
var excCount = excludeRows.filter(function (r) {
|
|
565
|
-
return r.low || r.
|
|
644
|
+
return r.low || r.high;
|
|
566
645
|
}).length;
|
|
567
646
|
return /*#__PURE__*/React.createElement("div", {
|
|
568
647
|
style: {
|
|
@@ -11,16 +11,13 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
12
12
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
13
13
|
var _select = _interopRequireDefault(require("antd/lib/select"));
|
|
14
|
-
var
|
|
14
|
+
var _extends0 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var React = _react;
|
|
17
17
|
var _icons = require("@ant-design/icons");
|
|
18
18
|
var _moment = _interopRequireDefault(require("moment"));
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
20
20
|
var OPTION_OPTIONS = [{
|
|
21
|
-
label: '(留空)',
|
|
22
|
-
value: ''
|
|
23
|
-
}, {
|
|
24
21
|
label: '等于',
|
|
25
22
|
value: 'EQ'
|
|
26
23
|
}, {
|
|
@@ -74,12 +71,20 @@ var newCondRow = function newCondRow(sign) {
|
|
|
74
71
|
return {
|
|
75
72
|
id: genId(),
|
|
76
73
|
sign: sign,
|
|
77
|
-
option: '',
|
|
74
|
+
option: 'EQ',
|
|
78
75
|
low: '',
|
|
79
76
|
high: ''
|
|
80
77
|
};
|
|
81
78
|
};
|
|
82
79
|
|
|
80
|
+
/** 根据 low/high 是否都有值,自动推断比较符:都有值 → BT,否则 EQ */
|
|
81
|
+
var autoAdjustOption = function autoAdjustOption(currentOpt, low, high) {
|
|
82
|
+
if (low && high) return 'BT';
|
|
83
|
+
// high 或 low 被清空时,若之前是 BT 则回退到 EQ
|
|
84
|
+
if (currentOpt === 'BT') return 'EQ';
|
|
85
|
+
return currentOpt;
|
|
86
|
+
};
|
|
87
|
+
|
|
83
88
|
// ConditionTable: multi-value rows inside the modal
|
|
84
89
|
var ConditionTable = function ConditionTable(_ref) {
|
|
85
90
|
var sign = _ref.sign,
|
|
@@ -88,7 +93,13 @@ var ConditionTable = function ConditionTable(_ref) {
|
|
|
88
93
|
var update = function update(id, key, val) {
|
|
89
94
|
return onChange(rows.map(function (r) {
|
|
90
95
|
var _extends2;
|
|
91
|
-
|
|
96
|
+
if (r.id !== id) return r;
|
|
97
|
+
var updated = (0, _extends0["default"])({}, r, (_extends2 = {}, _extends2[key] = val, _extends2));
|
|
98
|
+
// 修改 low/high 时自动调整比较符:都有值 → BT,否则回退 EQ
|
|
99
|
+
if (key === 'low' || key === 'high') {
|
|
100
|
+
updated.option = autoAdjustOption(r.option, updated.low, updated.high);
|
|
101
|
+
}
|
|
102
|
+
return updated;
|
|
92
103
|
}));
|
|
93
104
|
};
|
|
94
105
|
var remove = function remove(id) {
|
|
@@ -237,10 +248,54 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
237
248
|
}, [fields.map(function (f) {
|
|
238
249
|
return f.id;
|
|
239
250
|
}).join(',')]);
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* 实时同步:fieldValues / fields 变化时,将查询条件写入 window.screenStructures 和 window.customTypeMap,
|
|
254
|
+
* 确保任何外部事件(按钮点击、页面加载等)触发 executeLogicEngine 时,generateStructureForm() 能读到最新数据。
|
|
255
|
+
*/
|
|
256
|
+
(0, _react.useEffect)(function () {
|
|
257
|
+
var win = window;
|
|
258
|
+
if (!win.screenStructures) win.screenStructures = {};
|
|
259
|
+
if (!win.customTypeMap) win.customTypeMap = {};
|
|
260
|
+
fields.forEach(function (f) {
|
|
261
|
+
var fv = fieldValues[f.id] || {
|
|
262
|
+
low: '',
|
|
263
|
+
high: '',
|
|
264
|
+
conditions: []
|
|
265
|
+
};
|
|
266
|
+
var si = f.screenInner || 'st_' + f.techName;
|
|
267
|
+
var screenRows = [];
|
|
268
|
+
if (fv.conditions.length) {
|
|
269
|
+
fv.conditions.forEach(function (c) {
|
|
270
|
+
if (c.low || c.high) {
|
|
271
|
+
screenRows.push({
|
|
272
|
+
sign: c.sign,
|
|
273
|
+
option: c.option || 'EQ',
|
|
274
|
+
low: c.low || '',
|
|
275
|
+
high: c.high || '',
|
|
276
|
+
selected_flag: null,
|
|
277
|
+
inner_status: null
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
} else if (fv.low || fv.high) {
|
|
282
|
+
screenRows.push({
|
|
283
|
+
sign: 'I',
|
|
284
|
+
option: fv.high ? 'BT' : 'EQ',
|
|
285
|
+
low: fv.low || '',
|
|
286
|
+
high: fv.high || '',
|
|
287
|
+
selected_flag: null,
|
|
288
|
+
inner_status: null
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
win.screenStructures[si] = screenRows;
|
|
292
|
+
win.customTypeMap[si] = '4';
|
|
293
|
+
});
|
|
294
|
+
}, [fieldValues, fields]);
|
|
240
295
|
var updateVal = function updateVal(id, key, val) {
|
|
241
296
|
return setFieldValues(function (prev) {
|
|
242
297
|
var _extends3, _extends4;
|
|
243
|
-
return (0,
|
|
298
|
+
return (0, _extends0["default"])({}, prev, (_extends4 = {}, _extends4[id] = (0, _extends0["default"])({}, prev[id] || {
|
|
244
299
|
low: '',
|
|
245
300
|
high: '',
|
|
246
301
|
conditions: []
|
|
@@ -257,10 +312,10 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
257
312
|
high: '',
|
|
258
313
|
conditions: []
|
|
259
314
|
};
|
|
260
|
-
return (0,
|
|
315
|
+
return (0, _extends0["default"])({}, prev, (_extends6 = {}, _extends6[fieldId] = (0, _extends0["default"])({}, fv, {
|
|
261
316
|
conditions: fv.conditions.map(function (c) {
|
|
262
317
|
var _extends5;
|
|
263
|
-
return c.id === condId ? (0,
|
|
318
|
+
return c.id === condId ? (0, _extends0["default"])({}, c, (_extends5 = {}, _extends5[key] = val, _extends5)) : c;
|
|
264
319
|
})
|
|
265
320
|
}), _extends6));
|
|
266
321
|
});
|
|
@@ -286,13 +341,13 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
286
341
|
var confirmModal = function confirmModal() {
|
|
287
342
|
if (!activeFieldId) return;
|
|
288
343
|
var conditions = [].concat(includeRows.filter(function (r) {
|
|
289
|
-
return r.low || r.
|
|
344
|
+
return r.low || r.high;
|
|
290
345
|
}), excludeRows.filter(function (r) {
|
|
291
|
-
return r.low || r.
|
|
346
|
+
return r.low || r.high;
|
|
292
347
|
}));
|
|
293
348
|
setFieldValues(function (prev) {
|
|
294
349
|
var _extends7;
|
|
295
|
-
return (0,
|
|
350
|
+
return (0, _extends0["default"])({}, prev, (_extends7 = {}, _extends7[activeFieldId] = (0, _extends0["default"])({}, prev[activeFieldId] || {
|
|
296
351
|
low: '',
|
|
297
352
|
high: ''
|
|
298
353
|
}, {
|
|
@@ -370,14 +425,14 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
370
425
|
if (modalTab === 'include') {
|
|
371
426
|
setIncludeRows(function (prev) {
|
|
372
427
|
var base = prev.filter(function (r) {
|
|
373
|
-
return r.low || r.high
|
|
428
|
+
return r.low || r.high;
|
|
374
429
|
});
|
|
375
430
|
return base.length ? [].concat(base, newRows) : newRows;
|
|
376
431
|
});
|
|
377
432
|
} else {
|
|
378
433
|
setExcludeRows(function (prev) {
|
|
379
434
|
var base = prev.filter(function (r) {
|
|
380
|
-
return r.low || r.high
|
|
435
|
+
return r.low || r.high;
|
|
381
436
|
});
|
|
382
437
|
return base.length ? [].concat(base, newRows) : newRows;
|
|
383
438
|
});
|
|
@@ -409,7 +464,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
409
464
|
});
|
|
410
465
|
} else if (fv.low || fv.high) {
|
|
411
466
|
var _rows$push2;
|
|
412
|
-
rows.push((_rows$push2 = {}, _rows$push2[si + "-sign"] = 'I', _rows$push2[si + "-option"] = 'EQ', _rows$push2[si + "-low"] = fv.low, _rows$push2[si + "-high"] = fv.high, _rows$push2));
|
|
467
|
+
rows.push((_rows$push2 = {}, _rows$push2[si + "-sign"] = 'I', _rows$push2[si + "-option"] = fv.high ? 'BT' : 'EQ', _rows$push2[si + "-low"] = fv.low, _rows$push2[si + "-high"] = fv.high, _rows$push2));
|
|
413
468
|
}
|
|
414
469
|
if (rows.length) data[si] = rows;
|
|
415
470
|
|
|
@@ -420,7 +475,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
420
475
|
var screenRows = [];
|
|
421
476
|
if (fv.conditions.length) {
|
|
422
477
|
fv.conditions.forEach(function (c) {
|
|
423
|
-
if (c.low || c.high
|
|
478
|
+
if (c.low || c.high) {
|
|
424
479
|
screenRows.push({
|
|
425
480
|
sign: c.sign,
|
|
426
481
|
option: c.option || 'EQ',
|
|
@@ -456,22 +511,38 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
456
511
|
var val = displayCond ? key === 'low' ? displayCond.low : displayCond.high : fv[key];
|
|
457
512
|
var _onChange = function onChange(v) {
|
|
458
513
|
if (displayCond) {
|
|
459
|
-
//
|
|
460
|
-
|
|
514
|
+
// 将修改同步到多值弹窗的第一行对应字段,并自动调整比较符
|
|
515
|
+
var newLow = key === 'low' ? v : displayCond.low;
|
|
516
|
+
var newHigh = key === 'high' ? v : displayCond.high;
|
|
517
|
+
var newOpt = autoAdjustOption(displayCond.option, newLow, newHigh);
|
|
518
|
+
setFieldValues(function (prev) {
|
|
519
|
+
var _extends9;
|
|
520
|
+
var fv = prev[field.id] || {
|
|
521
|
+
low: '',
|
|
522
|
+
high: '',
|
|
523
|
+
conditions: []
|
|
524
|
+
};
|
|
525
|
+
return (0, _extends0["default"])({}, prev, (_extends9 = {}, _extends9[field.id] = (0, _extends0["default"])({}, fv, {
|
|
526
|
+
conditions: fv.conditions.map(function (c) {
|
|
527
|
+
var _extends8;
|
|
528
|
+
return c.id === displayCond.id ? (0, _extends0["default"])({}, c, (_extends8 = {}, _extends8[key] = v, _extends8.option = newOpt, _extends8)) : c;
|
|
529
|
+
})
|
|
530
|
+
}), _extends9));
|
|
531
|
+
});
|
|
461
532
|
} else {
|
|
462
533
|
updateVal(field.id, key, v);
|
|
463
534
|
}
|
|
464
535
|
};
|
|
465
536
|
|
|
466
537
|
// 将样式 tab 的所有属性直接应用于输入框
|
|
467
|
-
var inputStyle = style ? (0,
|
|
538
|
+
var inputStyle = style ? (0, _extends0["default"])({}, style) : {};
|
|
468
539
|
|
|
469
540
|
// IS_EMPTY / IS_NOT_EMPTY 时输入框置灰
|
|
470
541
|
var isEmptyOp = displayCond && (displayCond.option === 'IS_EMPTY' || displayCond.option === 'IS_NOT_EMPTY');
|
|
471
542
|
var isDisabled = !!isEmptyOp;
|
|
472
543
|
if (field.fieldType === 'date') {
|
|
473
544
|
return /*#__PURE__*/React.createElement(_datePicker["default"], {
|
|
474
|
-
style: (0,
|
|
545
|
+
style: (0, _extends0["default"])({
|
|
475
546
|
width: '100%'
|
|
476
547
|
}, inputStyle),
|
|
477
548
|
value: val ? (0, _moment["default"])(val) : null,
|
|
@@ -483,7 +554,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
483
554
|
}
|
|
484
555
|
if (field.fieldType === 'time') {
|
|
485
556
|
return /*#__PURE__*/React.createElement(_timePicker["default"], {
|
|
486
|
-
style: (0,
|
|
557
|
+
style: (0, _extends0["default"])({
|
|
487
558
|
width: '100%'
|
|
488
559
|
}, inputStyle),
|
|
489
560
|
value: val ? (0, _moment["default"])(val, 'HH:mm:ss') : null,
|
|
@@ -540,7 +611,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
540
611
|
var sym = OPTION_SYMBOL[opt];
|
|
541
612
|
if (!sym) return null;
|
|
542
613
|
return /*#__PURE__*/React.createElement("span", {
|
|
543
|
-
style: (0,
|
|
614
|
+
style: (0, _extends0["default"])({}, badgeStyle, {
|
|
544
615
|
background: '#52c41a'
|
|
545
616
|
})
|
|
546
617
|
}, sym);
|
|
@@ -550,11 +621,19 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
550
621
|
// 4.5.2:空 / EQ 也要显示红底 "=" ;其它按 OPTION_SYMBOL 显示
|
|
551
622
|
var _sym = _opt && OPTION_SYMBOL[_opt] || '=';
|
|
552
623
|
return /*#__PURE__*/React.createElement("span", {
|
|
553
|
-
style: (0,
|
|
624
|
+
style: (0, _extends0["default"])({}, badgeStyle, {
|
|
554
625
|
background: '#ff4d4f'
|
|
555
626
|
})
|
|
556
627
|
}, _sym);
|
|
557
628
|
}
|
|
629
|
+
// 无多值条件时:low 和 high 都有值 → 显示绿底"~"(介于)
|
|
630
|
+
if (fv.low && fv.high) {
|
|
631
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
632
|
+
style: (0, _extends0["default"])({}, badgeStyle, {
|
|
633
|
+
background: '#52c41a'
|
|
634
|
+
})
|
|
635
|
+
}, OPTION_SYMBOL['BT']);
|
|
636
|
+
}
|
|
558
637
|
return null;
|
|
559
638
|
};
|
|
560
639
|
var headerSize = {
|
|
@@ -565,10 +644,10 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
565
644
|
return f.id === activeFieldId;
|
|
566
645
|
});
|
|
567
646
|
var incCount = includeRows.filter(function (r) {
|
|
568
|
-
return r.low || r.
|
|
647
|
+
return r.low || r.high;
|
|
569
648
|
}).length;
|
|
570
649
|
var excCount = excludeRows.filter(function (r) {
|
|
571
|
-
return r.low || r.
|
|
650
|
+
return r.low || r.high;
|
|
572
651
|
}).length;
|
|
573
652
|
return /*#__PURE__*/React.createElement("div", {
|
|
574
653
|
style: {
|
|
@@ -579,7 +658,7 @@ var ProSearch = function ProSearch(_ref2) {
|
|
|
579
658
|
padding: '0 4px 8px 4px'
|
|
580
659
|
}
|
|
581
660
|
}, showHeader && /*#__PURE__*/React.createElement("div", {
|
|
582
|
-
style: (0,
|
|
661
|
+
style: (0, _extends0["default"])({
|
|
583
662
|
display: 'flex',
|
|
584
663
|
padding: '4px 8px',
|
|
585
664
|
gap: 6,
|
package/lowcode_es/meta.js
CHANGED
|
@@ -102,7 +102,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
102
102
|
packageName = '@openli1115/lowcode-edit-pro-table';
|
|
103
103
|
}
|
|
104
104
|
if (version === void 0) {
|
|
105
|
-
version = '1.0.
|
|
105
|
+
version = '1.0.109';
|
|
106
106
|
}
|
|
107
107
|
if (basicLibraryVersion === void 0) {
|
|
108
108
|
basicLibraryVersion = {
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -107,7 +107,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
107
107
|
packageName = '@openli1115/lowcode-edit-pro-table';
|
|
108
108
|
}
|
|
109
109
|
if (version === void 0) {
|
|
110
|
-
version = '1.0.
|
|
110
|
+
version = '1.0.109';
|
|
111
111
|
}
|
|
112
112
|
if (basicLibraryVersion === void 0) {
|
|
113
113
|
basicLibraryVersion = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openli1115/lowcode-edit-pro-table",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.109",
|
|
4
4
|
"description": "@openli1115/lowcode-edit-pro-table",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
},
|
|
102
102
|
"componentConfig": {
|
|
103
103
|
"isComponentLibrary": true,
|
|
104
|
-
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
104
|
+
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.109/build/lowcode/assets-prod.json"
|
|
105
105
|
},
|
|
106
106
|
"lcMeta": {
|
|
107
107
|
"type": "component"
|
|
108
108
|
},
|
|
109
|
-
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
109
|
+
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.109/build/index.html"
|
|
110
110
|
}
|