@bit-sun/business-component 4.2.0-alpha.6.2 → 4.2.0-alpha.6.3
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/dist/components/Business/SystemLog/index.d.ts +78 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +279 -51
- package/dist/index.js +280 -50
- package/dist/utils/utils.d.ts +41 -0
- package/package.json +1 -1
- package/src/components/Business/SystemLog/index.md +37 -0
- package/src/components/Business/SystemLog/index.tsx +87 -0
- package/src/components/Functional/AddSelect/index.tsx +92 -0
- package/src/index.ts +2 -0
- package/src/utils/utils.ts +41 -1
package/dist/index.js
CHANGED
|
@@ -1477,6 +1477,45 @@ var handleConvertResponse = function handleConvertResponse(items, total) {
|
|
|
1477
1477
|
var noEmptyArray = function noEmptyArray(targetObj) {
|
|
1478
1478
|
return Array.isArray(targetObj) && targetObj.length !== 0;
|
|
1479
1479
|
};
|
|
1480
|
+
var formContainerAndItemLayout = function formContainerAndItemLayout(type, title, name) {
|
|
1481
|
+
return type === 'form' ? {
|
|
1482
|
+
container: {
|
|
1483
|
+
type: 'card',
|
|
1484
|
+
props: {
|
|
1485
|
+
title: title,
|
|
1486
|
+
id: Math.random(),
|
|
1487
|
+
level: 1,
|
|
1488
|
+
name: name
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
itemLayout: {
|
|
1492
|
+
span: 8,
|
|
1493
|
+
labelCol: {
|
|
1494
|
+
span: 8
|
|
1495
|
+
},
|
|
1496
|
+
wrapperCol: {
|
|
1497
|
+
span: 18
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
} : {
|
|
1501
|
+
container: {
|
|
1502
|
+
type: 'card',
|
|
1503
|
+
props: {
|
|
1504
|
+
title: title,
|
|
1505
|
+
id: Math.random(),
|
|
1506
|
+
level: 1,
|
|
1507
|
+
bordered: null,
|
|
1508
|
+
isWhiteCard: true,
|
|
1509
|
+
name: name
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
itemLayout: {
|
|
1513
|
+
wrapperCol: {
|
|
1514
|
+
span: 0
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
};
|
|
1480
1519
|
|
|
1481
1520
|
// 判断某个按钮/菜单 是否有权限,返回布尔值
|
|
1482
1521
|
var authFunc = function authFunc(code) {
|
|
@@ -7836,6 +7875,116 @@ var AddSelect = function AddSelect(props) {
|
|
|
7836
7875
|
acc[key] = typeof value === 'function' ? value === null || value === void 0 ? void 0 : value(record) : value;
|
|
7837
7876
|
return acc;
|
|
7838
7877
|
}, {});
|
|
7878
|
+
// 可输入非数字字符
|
|
7879
|
+
if (item.canInputString) {
|
|
7880
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
7881
|
+
min: 0,
|
|
7882
|
+
precision: 0,
|
|
7883
|
+
controls: false
|
|
7884
|
+
}, inputProps), {}, {
|
|
7885
|
+
value: text || '',
|
|
7886
|
+
keyboard: false,
|
|
7887
|
+
onPressEnter: function onPressEnter(e) {
|
|
7888
|
+
e.target.blur();
|
|
7889
|
+
},
|
|
7890
|
+
onBlur: function () {
|
|
7891
|
+
var _onBlur = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
7892
|
+
var value;
|
|
7893
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
7894
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
7895
|
+
case 0:
|
|
7896
|
+
value = e.target.value;
|
|
7897
|
+
record[item.dataIndex] = value;
|
|
7898
|
+
editRecord(record);
|
|
7899
|
+
case 3:
|
|
7900
|
+
case "end":
|
|
7901
|
+
return _context2.stop();
|
|
7902
|
+
}
|
|
7903
|
+
}, _callee2);
|
|
7904
|
+
}));
|
|
7905
|
+
function onBlur(_x7) {
|
|
7906
|
+
return _onBlur.apply(this, arguments);
|
|
7907
|
+
}
|
|
7908
|
+
return onBlur;
|
|
7909
|
+
}(),
|
|
7910
|
+
onKeyDown: function onKeyDown(e) {
|
|
7911
|
+
if (e.keyCode === 13 && e.ctrlKey) {
|
|
7912
|
+
var _document$getElementB;
|
|
7913
|
+
handleOk(true);
|
|
7914
|
+
(_document$getElementB = document.getElementById("first-query")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
|
|
7915
|
+
}
|
|
7916
|
+
if (e.keyCode === 8 && e.ctrlKey) {
|
|
7917
|
+
var _e$nativeEvent$path$;
|
|
7918
|
+
antd.message.success('删除当前行');
|
|
7919
|
+
e.stopPropagation();
|
|
7920
|
+
e.preventDefault();
|
|
7921
|
+
var dom = (_e$nativeEvent$path$ = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$ === void 0 ? void 0 : _e$nativeEvent$path$.getElementsByTagName('input')[currentIndex];
|
|
7922
|
+
if (dom) {
|
|
7923
|
+
dom.select();
|
|
7924
|
+
dom.focus();
|
|
7925
|
+
dom.scrollIntoView(false);
|
|
7926
|
+
}
|
|
7927
|
+
dom = null;
|
|
7928
|
+
deleteRecord(record);
|
|
7929
|
+
}
|
|
7930
|
+
if (e.keyCode === 37 && e.shiftKey) {
|
|
7931
|
+
var _e$nativeEvent$path$2;
|
|
7932
|
+
// 左滑动
|
|
7933
|
+
e.stopPropagation();
|
|
7934
|
+
e.preventDefault();
|
|
7935
|
+
var _dom = (_e$nativeEvent$path$2 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$2 === void 0 ? void 0 : _e$nativeEvent$path$2.getElementsByTagName('input')[currentIndex - 1];
|
|
7936
|
+
if (_dom) {
|
|
7937
|
+
_dom.select();
|
|
7938
|
+
_dom.focus();
|
|
7939
|
+
_dom.scrollIntoView(false);
|
|
7940
|
+
}
|
|
7941
|
+
_dom = null;
|
|
7942
|
+
}
|
|
7943
|
+
if (e.keyCode === 39 && e.shiftKey) {
|
|
7944
|
+
var _e$nativeEvent$path$3;
|
|
7945
|
+
// 右滑
|
|
7946
|
+
e.stopPropagation();
|
|
7947
|
+
e.preventDefault();
|
|
7948
|
+
var _dom2 = (_e$nativeEvent$path$3 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$3 === void 0 ? void 0 : _e$nativeEvent$path$3.getElementsByTagName('input')[currentIndex + 1];
|
|
7949
|
+
if (_dom2) {
|
|
7950
|
+
_dom2.select();
|
|
7951
|
+
_dom2.focus();
|
|
7952
|
+
_dom2.scrollIntoView(false);
|
|
7953
|
+
}
|
|
7954
|
+
_dom2 = null;
|
|
7955
|
+
}
|
|
7956
|
+
if (e.keyCode === 40) {
|
|
7957
|
+
var _e$nativeEvent$path$4;
|
|
7958
|
+
e.stopPropagation();
|
|
7959
|
+
e.preventDefault();
|
|
7960
|
+
var _dom3 = (_e$nativeEvent$path$4 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$4 === void 0 ? void 0 : _e$nativeEvent$path$4.getElementsByTagName('input')[currentIndex];
|
|
7961
|
+
if (_dom3) {
|
|
7962
|
+
_dom3.select();
|
|
7963
|
+
_dom3.focus();
|
|
7964
|
+
_dom3.scrollIntoView(false);
|
|
7965
|
+
}
|
|
7966
|
+
_dom3 = null;
|
|
7967
|
+
} else if (e.keyCode === 38) {
|
|
7968
|
+
var _e$nativeEvent$path$5;
|
|
7969
|
+
e.stopPropagation();
|
|
7970
|
+
e.preventDefault();
|
|
7971
|
+
var dom1 = (_e$nativeEvent$path$5 = e.nativeEvent.path[5].children[index]) === null || _e$nativeEvent$path$5 === void 0 ? void 0 : _e$nativeEvent$path$5.getElementsByTagName('input')[currentIndex];
|
|
7972
|
+
if (dom1) {
|
|
7973
|
+
// dom1.value=""
|
|
7974
|
+
// dom1.setSelectionRange(100, 0);
|
|
7975
|
+
dom1.select();
|
|
7976
|
+
dom1.focus();
|
|
7977
|
+
dom1.scrollIntoViewIfNeeded(false);
|
|
7978
|
+
// dom1.value=record['count']
|
|
7979
|
+
}
|
|
7980
|
+
dom1 = null;
|
|
7981
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
7982
|
+
e.stopPropagation();
|
|
7983
|
+
e.preventDefault();
|
|
7984
|
+
}
|
|
7985
|
+
}
|
|
7986
|
+
}));
|
|
7987
|
+
}
|
|
7839
7988
|
return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2(_objectSpread2(_objectSpread2({}, inputProps), {}, {
|
|
7840
7989
|
value: text || '',
|
|
7841
7990
|
min: 0,
|
|
@@ -7853,16 +8002,16 @@ var AddSelect = function AddSelect(props) {
|
|
|
7853
8002
|
// }}
|
|
7854
8003
|
onKeyDown: function onKeyDown(e) {
|
|
7855
8004
|
if (e.keyCode === 13 && e.ctrlKey) {
|
|
7856
|
-
var _document$
|
|
8005
|
+
var _document$getElementB2;
|
|
7857
8006
|
handleOk(true);
|
|
7858
|
-
(_document$
|
|
8007
|
+
(_document$getElementB2 = document.getElementById("first-query")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
|
|
7859
8008
|
}
|
|
7860
8009
|
if (e.keyCode === 8 && e.ctrlKey) {
|
|
7861
|
-
var _e$nativeEvent$path
|
|
8010
|
+
var _e$nativeEvent$path$6;
|
|
7862
8011
|
antd.message.success('删除当前行');
|
|
7863
8012
|
e.stopPropagation();
|
|
7864
8013
|
e.preventDefault();
|
|
7865
|
-
var dom = (_e$nativeEvent$path$ = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$ === void 0 ? void 0 : _e$nativeEvent$path
|
|
8014
|
+
var dom = (_e$nativeEvent$path$6 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$6 === void 0 ? void 0 : _e$nativeEvent$path$6.getElementsByTagName('input')[currentIndex];
|
|
7866
8015
|
if (dom) {
|
|
7867
8016
|
dom.select();
|
|
7868
8017
|
dom.focus();
|
|
@@ -7872,47 +8021,47 @@ var AddSelect = function AddSelect(props) {
|
|
|
7872
8021
|
deleteRecord(record);
|
|
7873
8022
|
}
|
|
7874
8023
|
if (e.keyCode === 37 && e.shiftKey) {
|
|
7875
|
-
var _e$nativeEvent$path$
|
|
8024
|
+
var _e$nativeEvent$path$7;
|
|
7876
8025
|
// 左滑动
|
|
7877
8026
|
e.stopPropagation();
|
|
7878
8027
|
e.preventDefault();
|
|
7879
|
-
var
|
|
7880
|
-
if (
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
8028
|
+
var _dom4 = (_e$nativeEvent$path$7 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$7 === void 0 ? void 0 : _e$nativeEvent$path$7.getElementsByTagName('input')[currentIndex - 1];
|
|
8029
|
+
if (_dom4) {
|
|
8030
|
+
_dom4.select();
|
|
8031
|
+
_dom4.focus();
|
|
8032
|
+
_dom4.scrollIntoView(false);
|
|
7884
8033
|
}
|
|
7885
|
-
|
|
8034
|
+
_dom4 = null;
|
|
7886
8035
|
}
|
|
7887
8036
|
if (e.keyCode === 39 && e.shiftKey) {
|
|
7888
|
-
var _e$nativeEvent$path$
|
|
8037
|
+
var _e$nativeEvent$path$8;
|
|
7889
8038
|
// 右滑
|
|
7890
8039
|
e.stopPropagation();
|
|
7891
8040
|
e.preventDefault();
|
|
7892
|
-
var
|
|
7893
|
-
if (
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
8041
|
+
var _dom5 = (_e$nativeEvent$path$8 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$8 === void 0 ? void 0 : _e$nativeEvent$path$8.getElementsByTagName('input')[currentIndex + 1];
|
|
8042
|
+
if (_dom5) {
|
|
8043
|
+
_dom5.select();
|
|
8044
|
+
_dom5.focus();
|
|
8045
|
+
_dom5.scrollIntoView(false);
|
|
7897
8046
|
}
|
|
7898
|
-
|
|
8047
|
+
_dom5 = null;
|
|
7899
8048
|
}
|
|
7900
8049
|
if (e.keyCode === 40) {
|
|
7901
|
-
var _e$nativeEvent$path$
|
|
8050
|
+
var _e$nativeEvent$path$9;
|
|
7902
8051
|
e.stopPropagation();
|
|
7903
8052
|
e.preventDefault();
|
|
7904
|
-
var
|
|
7905
|
-
if (
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
8053
|
+
var _dom6 = (_e$nativeEvent$path$9 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$9 === void 0 ? void 0 : _e$nativeEvent$path$9.getElementsByTagName('input')[currentIndex];
|
|
8054
|
+
if (_dom6) {
|
|
8055
|
+
_dom6.select();
|
|
8056
|
+
_dom6.focus();
|
|
8057
|
+
_dom6.scrollIntoView(false);
|
|
7909
8058
|
}
|
|
7910
|
-
|
|
8059
|
+
_dom6 = null;
|
|
7911
8060
|
} else if (e.keyCode === 38) {
|
|
7912
|
-
var _e$nativeEvent$path$
|
|
8061
|
+
var _e$nativeEvent$path$10;
|
|
7913
8062
|
e.stopPropagation();
|
|
7914
8063
|
e.preventDefault();
|
|
7915
|
-
var dom1 = (_e$nativeEvent$path$
|
|
8064
|
+
var dom1 = (_e$nativeEvent$path$10 = e.nativeEvent.path[5].children[index]) === null || _e$nativeEvent$path$10 === void 0 ? void 0 : _e$nativeEvent$path$10.getElementsByTagName('input')[currentIndex];
|
|
7916
8065
|
if (dom1) {
|
|
7917
8066
|
// dom1.value=""
|
|
7918
8067
|
// dom1.setSelectionRange(100, 0);
|
|
@@ -7946,19 +8095,19 @@ var AddSelect = function AddSelect(props) {
|
|
|
7946
8095
|
return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, item.selectProps), {}, {
|
|
7947
8096
|
value: text || null,
|
|
7948
8097
|
onChange: function () {
|
|
7949
|
-
var _onChange = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8098
|
+
var _onChange = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
|
|
7950
8099
|
var dataSourceSelectItem, _item$selectChangeCal, changeValue, isCheckPass, isConformToTheRules;
|
|
7951
|
-
return _regeneratorRuntime().wrap(function
|
|
7952
|
-
while (1) switch (
|
|
8100
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8101
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
7953
8102
|
case 0:
|
|
7954
8103
|
dataSourceSelectItem = (dataSourceList === null || dataSourceList === void 0 ? void 0 : dataSourceList.find(function (d) {
|
|
7955
8104
|
return d[selectKey] == value;
|
|
7956
8105
|
})) || {};
|
|
7957
8106
|
if (!(item === null || item === void 0 ? void 0 : item.selectChangeCallback)) {
|
|
7958
|
-
|
|
8107
|
+
_context3.next = 6;
|
|
7959
8108
|
break;
|
|
7960
8109
|
}
|
|
7961
|
-
|
|
8110
|
+
_context3.next = 4;
|
|
7962
8111
|
return item === null || item === void 0 ? void 0 : (_item$selectChangeCal = item.selectChangeCallback) === null || _item$selectChangeCal === void 0 ? void 0 : _item$selectChangeCal.call(item, popvalue, setPopValue, {
|
|
7963
8112
|
record: record,
|
|
7964
8113
|
index: index,
|
|
@@ -7969,7 +8118,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
7969
8118
|
editRecord: editRecord
|
|
7970
8119
|
});
|
|
7971
8120
|
case 4:
|
|
7972
|
-
|
|
8121
|
+
_context3.next = 25;
|
|
7973
8122
|
break;
|
|
7974
8123
|
case 6:
|
|
7975
8124
|
// 更新当前行数据函数
|
|
@@ -7984,12 +8133,12 @@ var AddSelect = function AddSelect(props) {
|
|
|
7984
8133
|
}
|
|
7985
8134
|
}; // 处理校验,默认不校验
|
|
7986
8135
|
isCheckPass = true;
|
|
7987
|
-
|
|
8136
|
+
_context3.prev = 8;
|
|
7988
8137
|
if (!(item === null || item === void 0 ? void 0 : item.selectCheckCallback)) {
|
|
7989
|
-
|
|
8138
|
+
_context3.next = 15;
|
|
7990
8139
|
break;
|
|
7991
8140
|
}
|
|
7992
|
-
|
|
8141
|
+
_context3.next = 12;
|
|
7993
8142
|
return item === null || item === void 0 ? void 0 : item.selectCheckCallback(popvalue, {
|
|
7994
8143
|
record: record,
|
|
7995
8144
|
index: index,
|
|
@@ -7999,21 +8148,21 @@ var AddSelect = function AddSelect(props) {
|
|
|
7999
8148
|
dataSourceSelectItem: dataSourceSelectItem
|
|
8000
8149
|
});
|
|
8001
8150
|
case 12:
|
|
8002
|
-
isCheckPass =
|
|
8003
|
-
|
|
8151
|
+
isCheckPass = _context3.sent;
|
|
8152
|
+
_context3.next = 19;
|
|
8004
8153
|
break;
|
|
8005
8154
|
case 15:
|
|
8006
|
-
|
|
8155
|
+
_context3.next = 17;
|
|
8007
8156
|
return checkSelectChange(businessType, popvalue, mappingValueField, record, item, value);
|
|
8008
8157
|
case 17:
|
|
8009
|
-
isConformToTheRules =
|
|
8158
|
+
isConformToTheRules = _context3.sent;
|
|
8010
8159
|
isCheckPass = !isConformToTheRules;
|
|
8011
8160
|
case 19:
|
|
8012
|
-
|
|
8161
|
+
_context3.next = 23;
|
|
8013
8162
|
break;
|
|
8014
8163
|
case 21:
|
|
8015
|
-
|
|
8016
|
-
|
|
8164
|
+
_context3.prev = 21;
|
|
8165
|
+
_context3.t0 = _context3["catch"](8);
|
|
8017
8166
|
case 23:
|
|
8018
8167
|
if (isCheckPass) {
|
|
8019
8168
|
changeValue(value, dataSourceSelectItem);
|
|
@@ -8024,11 +8173,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
8024
8173
|
editRecord(record);
|
|
8025
8174
|
case 25:
|
|
8026
8175
|
case "end":
|
|
8027
|
-
return
|
|
8176
|
+
return _context3.stop();
|
|
8028
8177
|
}
|
|
8029
|
-
},
|
|
8178
|
+
}, _callee3, null, [[8, 21]]);
|
|
8030
8179
|
}));
|
|
8031
|
-
function onChange(
|
|
8180
|
+
function onChange(_x8) {
|
|
8032
8181
|
return _onChange.apply(this, arguments);
|
|
8033
8182
|
}
|
|
8034
8183
|
return onChange;
|
|
@@ -8288,8 +8437,8 @@ var AddSelect = function AddSelect(props) {
|
|
|
8288
8437
|
}
|
|
8289
8438
|
}
|
|
8290
8439
|
setTimeout(function () {
|
|
8291
|
-
var _document$
|
|
8292
|
-
(_document$
|
|
8440
|
+
var _document$getElementB3;
|
|
8441
|
+
(_document$getElementB3 = document.getElementById("first-query")) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.focus();
|
|
8293
8442
|
}, 50);
|
|
8294
8443
|
};
|
|
8295
8444
|
// 将格式化完的数据回显到 表格中
|
|
@@ -8319,7 +8468,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
8319
8468
|
handleLoading(isContinue, true);
|
|
8320
8469
|
onSaveCallback(popvalue).then(function (res) {
|
|
8321
8470
|
{
|
|
8322
|
-
var _Object$keys2, _document$
|
|
8471
|
+
var _Object$keys2, _document$getElementB4;
|
|
8323
8472
|
// 成功信息可以在调用处处理 即resolve({messageSuccessBackInfo: { needThrowSuccess: false } })、resolve({messageSuccessBackInfo: { needThrowSuccess: true, successMessage: '已保存' } })
|
|
8324
8473
|
var initSuccessMessage = '保存成功';
|
|
8325
8474
|
var rmsbi = (res === null || res === void 0 ? void 0 : res.messageSuccessBackInfo) || {};
|
|
@@ -8329,7 +8478,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
8329
8478
|
antd.message.success(initSuccessMessage);
|
|
8330
8479
|
}
|
|
8331
8480
|
deleteSelectRows();
|
|
8332
|
-
(_document$
|
|
8481
|
+
(_document$getElementB4 = document.getElementById('first-query')) === null || _document$getElementB4 === void 0 ? void 0 : _document$getElementB4.focus();
|
|
8333
8482
|
!isContinue && handleCancel();
|
|
8334
8483
|
}
|
|
8335
8484
|
handleLoading(isContinue, false);
|
|
@@ -40303,6 +40452,85 @@ var ParagraphCopier = function ParagraphCopier(props) {
|
|
|
40303
40452
|
}, children));
|
|
40304
40453
|
};
|
|
40305
40454
|
|
|
40455
|
+
//操作日志
|
|
40456
|
+
var SystemLog = function SystemLog(_ref) {
|
|
40457
|
+
var modeType = _ref.modeType,
|
|
40458
|
+
code = _ref.code,
|
|
40459
|
+
containerName = _ref.containerName,
|
|
40460
|
+
_ref$renderLogRef = _ref.renderLogRef,
|
|
40461
|
+
renderLogRef = _ref$renderLogRef === void 0 ? {} : _ref$renderLogRef,
|
|
40462
|
+
_ref$extraParams = _ref.extraParams,
|
|
40463
|
+
extraParams = _ref$extraParams === void 0 ? {} : _ref$extraParams;
|
|
40464
|
+
return _objectSpread2(_objectSpread2({}, formContainerAndItemLayout('table', '操作日志', containerName)), {}, {
|
|
40465
|
+
initialVisible: modeType != 'create',
|
|
40466
|
+
fields: [{
|
|
40467
|
+
name: 'table',
|
|
40468
|
+
label: false,
|
|
40469
|
+
itemLayout: {
|
|
40470
|
+
span: 24,
|
|
40471
|
+
labelCol: {
|
|
40472
|
+
span: 0
|
|
40473
|
+
},
|
|
40474
|
+
wrapperCol: {
|
|
40475
|
+
span: 24
|
|
40476
|
+
}
|
|
40477
|
+
},
|
|
40478
|
+
field: function field(ctx) {
|
|
40479
|
+
return code && /*#__PURE__*/React__default['default'].createElement(bssula.Table, {
|
|
40480
|
+
remoteDataSource: {
|
|
40481
|
+
url: "/oms-ops/logInfo?qp-businessCode-eq=".concat(code),
|
|
40482
|
+
convertParams: function convertParams(_ref2) {
|
|
40483
|
+
var params = _ref2.params;
|
|
40484
|
+
return _objectSpread2({
|
|
40485
|
+
pageSize: params.pageSize,
|
|
40486
|
+
currentPage: params.current
|
|
40487
|
+
}, extraParams);
|
|
40488
|
+
},
|
|
40489
|
+
converter: function converter(_ref3) {
|
|
40490
|
+
var data = _ref3.data;
|
|
40491
|
+
return _objectSpread2({}, handleConvertResponse(data.list, data.total || data.totalCount));
|
|
40492
|
+
}
|
|
40493
|
+
},
|
|
40494
|
+
columns: [{
|
|
40495
|
+
title: '操作人',
|
|
40496
|
+
dataIndex: 'handlerName'
|
|
40497
|
+
}, {
|
|
40498
|
+
title: '操作名称',
|
|
40499
|
+
dataIndex: 'handlerType'
|
|
40500
|
+
}, {
|
|
40501
|
+
title: '操作时间',
|
|
40502
|
+
dataIndex: 'handlerTime',
|
|
40503
|
+
render: function render(_ref4) {
|
|
40504
|
+
var text = _ref4.text;
|
|
40505
|
+
return handleCommonTimeRender$1(text);
|
|
40506
|
+
}
|
|
40507
|
+
}, {
|
|
40508
|
+
title: '操作内容',
|
|
40509
|
+
dataIndex: 'logcontent'
|
|
40510
|
+
}],
|
|
40511
|
+
style: {
|
|
40512
|
+
width: '100%',
|
|
40513
|
+
marginTop: '-16px',
|
|
40514
|
+
padding: '0px'
|
|
40515
|
+
},
|
|
40516
|
+
rowKey: "id",
|
|
40517
|
+
scroll: {
|
|
40518
|
+
x: 'max-content'
|
|
40519
|
+
},
|
|
40520
|
+
pagination: {
|
|
40521
|
+
showTotal: function showTotal(total) {
|
|
40522
|
+
return "\u5171 ".concat(total, " \u6761");
|
|
40523
|
+
},
|
|
40524
|
+
showQuickJumper: true,
|
|
40525
|
+
hideOnSinglePage: true
|
|
40526
|
+
},
|
|
40527
|
+
ref: renderLogRef
|
|
40528
|
+
});
|
|
40529
|
+
}
|
|
40530
|
+
}]
|
|
40531
|
+
});
|
|
40532
|
+
};
|
|
40533
|
+
|
|
40306
40534
|
exports.AddSelect = AddSelect;
|
|
40307
40535
|
exports.AddSkcSelect = AddSkcSelect;
|
|
40308
40536
|
exports.AddSkuSelect = AddSkuSelect;
|
|
@@ -40341,6 +40569,7 @@ exports.SearchSelect = SearchSelect;
|
|
|
40341
40569
|
exports.Section = Section;
|
|
40342
40570
|
exports.StateFlow = index$2;
|
|
40343
40571
|
exports.SulaColumnSettingTable = ColumnSettingSulaTable;
|
|
40572
|
+
exports.SystemLog = SystemLog;
|
|
40344
40573
|
exports.TableColumnSetting = TableColumnSetting;
|
|
40345
40574
|
exports.TreeSearchSelect = TreeSearchSelect;
|
|
40346
40575
|
exports.authFunc = authFunc;
|
|
@@ -40350,6 +40579,7 @@ exports.coverToParallel = _coverToParallel;
|
|
|
40350
40579
|
exports.createUniqID = createUniqID;
|
|
40351
40580
|
exports.downloadExcel = downloadExcel;
|
|
40352
40581
|
exports.ergodicMenuRoutes = ergodicMenuRoutes;
|
|
40582
|
+
exports.formContainerAndItemLayout = formContainerAndItemLayout;
|
|
40353
40583
|
exports.formatter = _formatter;
|
|
40354
40584
|
exports.getAccountID = getAccountID;
|
|
40355
40585
|
exports.getAccountId = getAccountId;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -31,3 +31,44 @@ export declare const randomString: (len?: any) => string;
|
|
|
31
31
|
export declare const createUniqID: (length: any) => string;
|
|
32
32
|
export declare const handleConvertResponse: (items: any, total: number) => object;
|
|
33
33
|
export declare const noEmptyArray: (targetObj: any) => boolean;
|
|
34
|
+
export declare const formContainerAndItemLayout: (type: string, title: any, name: string) => {
|
|
35
|
+
container: {
|
|
36
|
+
type: string;
|
|
37
|
+
props: {
|
|
38
|
+
title: any;
|
|
39
|
+
id: number;
|
|
40
|
+
level: number;
|
|
41
|
+
name: string;
|
|
42
|
+
bordered?: undefined;
|
|
43
|
+
isWhiteCard?: undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
itemLayout: {
|
|
47
|
+
span: number;
|
|
48
|
+
labelCol: {
|
|
49
|
+
span: number;
|
|
50
|
+
};
|
|
51
|
+
wrapperCol: {
|
|
52
|
+
span: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
container: {
|
|
57
|
+
type: string;
|
|
58
|
+
props: {
|
|
59
|
+
title: any;
|
|
60
|
+
id: number;
|
|
61
|
+
level: number;
|
|
62
|
+
bordered: null;
|
|
63
|
+
isWhiteCard: boolean;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
itemLayout: {
|
|
68
|
+
wrapperCol: {
|
|
69
|
+
span: number;
|
|
70
|
+
};
|
|
71
|
+
span?: undefined;
|
|
72
|
+
labelCol?: undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 业务组件
|
|
7
|
+
order: 1
|
|
8
|
+
title: 日志组件
|
|
9
|
+
order: 1
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SystemLog
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 日志业务组件
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
|
+
import { SystemLog } from '../../../index.ts';
|
|
20
|
+
|
|
21
|
+
export default () => {
|
|
22
|
+
const [modeType, setModeType] = useState('view');
|
|
23
|
+
const renderLogRef = useRef<any>();
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
fields: [
|
|
27
|
+
SystemLog({
|
|
28
|
+
modeType,
|
|
29
|
+
code: '123',
|
|
30
|
+
containerName: 'Test_Log_Info',
|
|
31
|
+
renderLogRef,
|
|
32
|
+
extraParams: {},
|
|
33
|
+
})
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { handleCommonTimeRender } from '@/utils/TableUtils';
|
|
2
|
+
import { formContainerAndItemLayout, handleConvertResponse } from '@/utils/utils';
|
|
3
|
+
import { Table as BsTable } from 'bssula';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
//操作日志
|
|
7
|
+
const SystemLog = ({
|
|
8
|
+
modeType,
|
|
9
|
+
code,
|
|
10
|
+
containerName,
|
|
11
|
+
renderLogRef = {},
|
|
12
|
+
extraParams = {},
|
|
13
|
+
}: {
|
|
14
|
+
modeType: string,
|
|
15
|
+
code: any
|
|
16
|
+
containerName: string,
|
|
17
|
+
renderLogRef: object,
|
|
18
|
+
extraParams?: object,
|
|
19
|
+
}) => {
|
|
20
|
+
return {
|
|
21
|
+
...formContainerAndItemLayout('table', '操作日志', containerName),
|
|
22
|
+
initialVisible: modeType != 'create',
|
|
23
|
+
fields: [
|
|
24
|
+
{
|
|
25
|
+
name: 'table',
|
|
26
|
+
label: false,
|
|
27
|
+
itemLayout: {
|
|
28
|
+
span: 24,
|
|
29
|
+
labelCol: {
|
|
30
|
+
span: 0,
|
|
31
|
+
},
|
|
32
|
+
wrapperCol: {
|
|
33
|
+
span: 24,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
field: (ctx: any) => {
|
|
37
|
+
return code && <BsTable
|
|
38
|
+
remoteDataSource={{
|
|
39
|
+
url: `/oms-ops/logInfo?qp-businessCode-eq=${code}`,
|
|
40
|
+
convertParams: ({ params }: any) => {
|
|
41
|
+
return {
|
|
42
|
+
pageSize: params.pageSize,
|
|
43
|
+
currentPage: params.current,
|
|
44
|
+
...extraParams,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
converter: ({ data }: any) => {
|
|
48
|
+
return {
|
|
49
|
+
...handleConvertResponse(data.list, data.total || data.totalCount),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
columns={[
|
|
54
|
+
{
|
|
55
|
+
title: '操作人',
|
|
56
|
+
dataIndex: 'handlerName',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: '操作名称',
|
|
60
|
+
dataIndex: 'handlerType',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: '操作时间',
|
|
64
|
+
dataIndex: 'handlerTime',
|
|
65
|
+
render: ({ text }: { text: any }) => handleCommonTimeRender(text)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: '操作内容',
|
|
69
|
+
dataIndex: 'logcontent',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
style={{ width: '100%', marginTop: '-16px', padding: '0px' }}
|
|
73
|
+
rowKey="id"
|
|
74
|
+
scroll={{ x: 'max-content' }}
|
|
75
|
+
pagination={{
|
|
76
|
+
showTotal: (total: any) => `共 ${total} 条`,
|
|
77
|
+
showQuickJumper: true,
|
|
78
|
+
hideOnSinglePage: true,
|
|
79
|
+
}}
|
|
80
|
+
ref={renderLogRef}
|
|
81
|
+
/>
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export default SystemLog
|