@bit-sun/business-component 2.2.0-alpha.22 → 2.2.0-alpha.24
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/index.esm.js +297 -20
- package/dist/index.js +297 -20
- package/package.json +1 -1
- package/src/components/Business/BsLayouts/index.tsx +5 -1
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +4 -0
- package/src/components/Business/JsonQueryTable/index.tsx +248 -33
- package/src/components/Business/moreTreeTable/index.tsx +2 -2
- package/src/components/Functional/AddSelect/index.tsx +16 -2
- package/src/utils/utils.ts +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -9681,7 +9681,7 @@ var formatter = function formatter(data, parentAuthority, parentName) {
|
|
|
9681
9681
|
var memoizeOneFormatter = memoizeOne(formatter, isEqual$1);
|
|
9682
9682
|
var go2BackAndClose = function go2BackAndClose() {
|
|
9683
9683
|
localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
|
|
9684
|
-
history.
|
|
9684
|
+
history.go(-1);
|
|
9685
9685
|
};
|
|
9686
9686
|
/**
|
|
9687
9687
|
* 处理bssulaTable的公共回显样式
|
|
@@ -10218,6 +10218,20 @@ var AddSelect = function AddSelect(props) {
|
|
|
10218
10218
|
return _ref4.apply(this, arguments);
|
|
10219
10219
|
};
|
|
10220
10220
|
}();
|
|
10221
|
+
var setBusinessDefaultValue = function setBusinessDefaultValue(list, record) {
|
|
10222
|
+
var _record$colorValues;
|
|
10223
|
+
var result = list;
|
|
10224
|
+
if (businessType == 'spu' && (record === null || record === void 0 ? void 0 : (_record$colorValues = record.colorValues) === null || _record$colorValues === void 0 ? void 0 : _record$colorValues.length) == 1) {
|
|
10225
|
+
result = list.map(function (i) {
|
|
10226
|
+
if (i.uuid == (record === null || record === void 0 ? void 0 : record.uuid)) {
|
|
10227
|
+
var _record$colorValues$;
|
|
10228
|
+
i.colorName = (_record$colorValues$ = record.colorValues[0]) === null || _record$colorValues$ === void 0 ? void 0 : _record$colorValues$.value;
|
|
10229
|
+
}
|
|
10230
|
+
return i;
|
|
10231
|
+
});
|
|
10232
|
+
}
|
|
10233
|
+
return result;
|
|
10234
|
+
};
|
|
10221
10235
|
useEffect(function () {
|
|
10222
10236
|
setTableColumns(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns);
|
|
10223
10237
|
}, [modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns]);
|
|
@@ -10821,12 +10835,16 @@ var AddSelect = function AddSelect(props) {
|
|
|
10821
10835
|
}
|
|
10822
10836
|
}
|
|
10823
10837
|
if (isAllowRepeatedSelect) {
|
|
10838
|
+
var newUuid = uuid();
|
|
10824
10839
|
var list = popvalue.concat(selectRows).map(function (i) {
|
|
10825
10840
|
return _objectSpread2(_objectSpread2({}, i), {}, {
|
|
10826
|
-
uuid: i.uuid ||
|
|
10841
|
+
uuid: i.uuid || newUuid
|
|
10827
10842
|
});
|
|
10828
10843
|
});
|
|
10829
|
-
|
|
10844
|
+
var recordItem = _objectSpread2(_objectSpread2({}, selectRows[0]), {}, {
|
|
10845
|
+
uuid: newUuid
|
|
10846
|
+
});
|
|
10847
|
+
setPopValue(setBusinessDefaultValue(list, recordItem));
|
|
10830
10848
|
setSelectedRowKeys([]);
|
|
10831
10849
|
} else {
|
|
10832
10850
|
setPopValue(selectRows);
|
|
@@ -21585,7 +21603,11 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
21585
21603
|
// }
|
|
21586
21604
|
// });
|
|
21587
21605
|
(_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
|
|
21588
|
-
localStorage.
|
|
21606
|
+
if (localStorage.getItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK)) {
|
|
21607
|
+
localStorage.removeItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK);
|
|
21608
|
+
} else {
|
|
21609
|
+
localStorage.setItem('isTabChange', true);
|
|
21610
|
+
}
|
|
21589
21611
|
if (appname === itemPath) {
|
|
21590
21612
|
istParent = 1;
|
|
21591
21613
|
if (info.type === 'main') {
|
|
@@ -22566,7 +22588,7 @@ var index$6 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
22566
22588
|
className: 'editTable__block'.concat(" ", 'table_border_style')
|
|
22567
22589
|
}, /*#__PURE__*/React.createElement("tbody", null, config.colLastData.map(function (item, index) {
|
|
22568
22590
|
var fixedTop = item.fixed ? "".concat(index * 40 + config.colHeaderToTop, "px") : 0;
|
|
22569
|
-
return /*#__PURE__*/React.createElement("tr", null, colTableData.
|
|
22591
|
+
return /*#__PURE__*/React.createElement("tr", null, colTableData.map(function (record, index) {
|
|
22570
22592
|
return /*#__PURE__*/React.createElement("td", {
|
|
22571
22593
|
style: {
|
|
22572
22594
|
background: index % 2 === 1 || item.fixed ? '#f7f8fb' : '#fff',
|
|
@@ -22583,7 +22605,7 @@ var index$6 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
22583
22605
|
index: index,
|
|
22584
22606
|
table: tableInsFn
|
|
22585
22607
|
}) : record[item.key || item.dataIndex]);
|
|
22586
|
-
}));
|
|
22608
|
+
}).slice(startIndex, endIndex + 1));
|
|
22587
22609
|
}))), /*#__PURE__*/React.createElement("table", {
|
|
22588
22610
|
style: {
|
|
22589
22611
|
width: '100%',
|
|
@@ -30573,7 +30595,9 @@ var FieldsSettingsTable = (function (props) {
|
|
|
30573
30595
|
_props$codeProps = props.codeProps,
|
|
30574
30596
|
codeProps = _props$codeProps === void 0 ? '' : _props$codeProps,
|
|
30575
30597
|
moduleType = props.moduleType,
|
|
30576
|
-
moduleRelationId = props.moduleRelationId
|
|
30598
|
+
moduleRelationId = props.moduleRelationId,
|
|
30599
|
+
_props$tableFlag = props.tableFlag,
|
|
30600
|
+
tableFlag = _props$tableFlag === void 0 ? false : _props$tableFlag;
|
|
30577
30601
|
var ref = useRef(null);
|
|
30578
30602
|
var _useState = useState({
|
|
30579
30603
|
visible: false,
|
|
@@ -30662,6 +30686,9 @@ var FieldsSettingsTable = (function (props) {
|
|
|
30662
30686
|
render: function render(_ref2) {
|
|
30663
30687
|
var text = _ref2.text,
|
|
30664
30688
|
record = _ref2.record;
|
|
30689
|
+
if (tableFlag) {
|
|
30690
|
+
return /*#__PURE__*/React.createElement("div", null, " \u5217\u8868\uFF1A", "{\"key\": \"extensionFields,".concat(record.code, "\",\"dataIndex\": \"extensionFields,").concat(record.code, "\",\"title\": \"").concat(record.name, "\"},"));
|
|
30691
|
+
}
|
|
30665
30692
|
if (!codeProps.columns) {
|
|
30666
30693
|
return /*#__PURE__*/React.createElement("div", null, "\u8868\u5355\uFF1A", "{\"name\": \"extensionFields,".concat(record.code, "\",\"label\": \"").concat(record.name, "\"},"));
|
|
30667
30694
|
}
|
|
@@ -30802,6 +30829,13 @@ function convertFileds(fields, falltValue, faltFieldRange, containerName) {
|
|
|
30802
30829
|
var _field$container6;
|
|
30803
30830
|
var targetValue = convertFileds(item, falltValue, faltFieldRange, field === null || field === void 0 ? void 0 : (_field$container6 = field.container) === null || _field$container6 === void 0 ? void 0 : _field$container6.name);
|
|
30804
30831
|
if (targetValue) {
|
|
30832
|
+
if (item.dependency) {
|
|
30833
|
+
targetValue.dependency = {
|
|
30834
|
+
visible: _objectSpread2(_objectSpread2({}, item.dependency.visible), {}, {
|
|
30835
|
+
type: new Function('axios', 'ctx', item.dependency.visible.type).bind(null, axios)
|
|
30836
|
+
})
|
|
30837
|
+
};
|
|
30838
|
+
}
|
|
30805
30839
|
filedsValue.push(targetValue);
|
|
30806
30840
|
}
|
|
30807
30841
|
});
|
|
@@ -30810,6 +30844,14 @@ function convertFileds(fields, falltValue, faltFieldRange, containerName) {
|
|
|
30810
30844
|
if (returnField) {
|
|
30811
30845
|
var _returnField$name;
|
|
30812
30846
|
returnField.label = field === null || field === void 0 ? void 0 : field.label;
|
|
30847
|
+
if (field === null || field === void 0 ? void 0 : field.disabled) {
|
|
30848
|
+
// 字段设置只读属性
|
|
30849
|
+
returnField.field.props.disabled = true;
|
|
30850
|
+
}
|
|
30851
|
+
if (field === null || field === void 0 ? void 0 : field.invisible) {
|
|
30852
|
+
// 字段设置不可见属性
|
|
30853
|
+
returnField.initialVisible = false;
|
|
30854
|
+
}
|
|
30813
30855
|
if (Array.isArray(returnField.name) && ((_returnField$name = returnField.name) === null || _returnField$name === void 0 ? void 0 : _returnField$name.includes("extensionFields"))) {
|
|
30814
30856
|
returnField.notShowLabel = true;
|
|
30815
30857
|
}
|
|
@@ -30839,10 +30881,39 @@ function faltCustomerFieldRange(fileds) {
|
|
|
30839
30881
|
});
|
|
30840
30882
|
return columnsValue;
|
|
30841
30883
|
}
|
|
30884
|
+
//form存在新加container属性分组得情况 组合操作
|
|
30885
|
+
function combineContainer(originFields, currentFields) {
|
|
30886
|
+
var newCurrentFields = _toConsumableArray(originFields);
|
|
30887
|
+
currentFields.map(function (item) {
|
|
30888
|
+
if (!originFields.find(function (i) {
|
|
30889
|
+
var _i$container, _i$container$props, _item$container;
|
|
30890
|
+
return (i === null || i === void 0 ? void 0 : (_i$container = i.container) === null || _i$container === void 0 ? void 0 : (_i$container$props = _i$container.props) === null || _i$container$props === void 0 ? void 0 : _i$container$props.name) == (item === null || item === void 0 ? void 0 : (_item$container = item.container) === null || _item$container === void 0 ? void 0 : _item$container.name);
|
|
30891
|
+
})) {
|
|
30892
|
+
var _item$container2, _item$container3;
|
|
30893
|
+
newCurrentFields = [].concat(_toConsumableArray(newCurrentFields), [{
|
|
30894
|
+
container: {
|
|
30895
|
+
type: 'card',
|
|
30896
|
+
props: {
|
|
30897
|
+
title: item === null || item === void 0 ? void 0 : (_item$container2 = item.container) === null || _item$container2 === void 0 ? void 0 : _item$container2.title,
|
|
30898
|
+
level: 1,
|
|
30899
|
+
id: Math.random(),
|
|
30900
|
+
isWhiteCard: true,
|
|
30901
|
+
bordered: false,
|
|
30902
|
+
name: item === null || item === void 0 ? void 0 : (_item$container3 = item.container) === null || _item$container3 === void 0 ? void 0 : _item$container3.name
|
|
30903
|
+
}
|
|
30904
|
+
},
|
|
30905
|
+
fields: (item === null || item === void 0 ? void 0 : item.fields) || []
|
|
30906
|
+
}]);
|
|
30907
|
+
}
|
|
30908
|
+
});
|
|
30909
|
+
return newCurrentFields;
|
|
30910
|
+
}
|
|
30842
30911
|
function hanleCallbackValue(codeProps, value, customerFields) {
|
|
30912
|
+
var cacheColumns = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
30843
30913
|
var faltFieldRange = faltCustomerFieldRange(customerFields);
|
|
30914
|
+
// const falltValue = flatFileds({fields: codeProps.fields})
|
|
30844
30915
|
var falltValue = flatFileds({
|
|
30845
|
-
fields: codeProps.fields
|
|
30916
|
+
fields: combineContainer(codeProps.fields, value === null || value === void 0 ? void 0 : value.fields)
|
|
30846
30917
|
});
|
|
30847
30918
|
var newCodeProps = _objectSpread2({}, codeProps);
|
|
30848
30919
|
newCodeProps.fields = convertFileds({
|
|
@@ -30852,7 +30923,10 @@ function hanleCallbackValue(codeProps, value, customerFields) {
|
|
|
30852
30923
|
var faltColumnsValue = faltColumns(codeProps.columns);
|
|
30853
30924
|
newCodeProps.columns = value.columns.map(function (item) {
|
|
30854
30925
|
if (item.isStaticCode) {
|
|
30855
|
-
|
|
30926
|
+
var cacheFieldProperty = cacheColumns.find(function (k) {
|
|
30927
|
+
return (k.key || k.dataIndex) == (item.key || item.dataIndex);
|
|
30928
|
+
});
|
|
30929
|
+
return _objectSpread2(_objectSpread2({}, faltColumnsValue[item.key]), cacheFieldProperty);
|
|
30856
30930
|
} else {
|
|
30857
30931
|
//自定义字段-列字段
|
|
30858
30932
|
if ((item === null || item === void 0 ? void 0 : item.key) && (item === null || item === void 0 ? void 0 : item.key.includes('extensionFields')) && (item === null || item === void 0 ? void 0 : item.key.includes(','))) {
|
|
@@ -30860,10 +30934,26 @@ function hanleCallbackValue(codeProps, value, customerFields) {
|
|
|
30860
30934
|
render: function render(_ref) {
|
|
30861
30935
|
var record = _ref.record;
|
|
30862
30936
|
try {
|
|
30863
|
-
var
|
|
30864
|
-
|
|
30865
|
-
var
|
|
30866
|
-
|
|
30937
|
+
var _record$extensionFiel = record.extensionFields,
|
|
30938
|
+
extensionFields = _record$extensionFiel === void 0 ? {} : _record$extensionFiel;
|
|
30939
|
+
var fieldName1 = item === null || item === void 0 ? void 0 : item.key.split(',')[1]; //兼容没有fieldName的情况
|
|
30940
|
+
var fieldName2 = "".concat(fieldName1, "Name");
|
|
30941
|
+
if (customerFields.length) {
|
|
30942
|
+
var targetField = customerFields.find(function (k) {
|
|
30943
|
+
return k.name.includes(fieldName1);
|
|
30944
|
+
});
|
|
30945
|
+
if (targetField) {
|
|
30946
|
+
var _targetField$initialS = targetField.initialSource,
|
|
30947
|
+
initialSource = _targetField$initialS === void 0 ? [] : _targetField$initialS;
|
|
30948
|
+
if (initialSource.length) {
|
|
30949
|
+
var _initialSource$find;
|
|
30950
|
+
return ((_initialSource$find = initialSource.find(function (d) {
|
|
30951
|
+
return d.value == extensionFields[fieldName1];
|
|
30952
|
+
})) === null || _initialSource$find === void 0 ? void 0 : _initialSource$find.text) || extensionFields[fieldName1];
|
|
30953
|
+
}
|
|
30954
|
+
}
|
|
30955
|
+
}
|
|
30956
|
+
return extensionFields[fieldName2] || extensionFields[fieldName1] || '';
|
|
30867
30957
|
} catch (e) {
|
|
30868
30958
|
console.log('e', e);
|
|
30869
30959
|
}
|
|
@@ -30896,7 +30986,10 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30896
30986
|
codeProps = props.codeProps,
|
|
30897
30987
|
customerFields = props.customerFields,
|
|
30898
30988
|
initialSetting = props.initialSetting,
|
|
30899
|
-
pageType = props.pageType
|
|
30989
|
+
pageType = props.pageType,
|
|
30990
|
+
_props$detailTablesSe = props.detailTablesSetting,
|
|
30991
|
+
detailTablesSetting = _props$detailTablesSe === void 0 ? [] : _props$detailTablesSe,
|
|
30992
|
+
saveTableCallBack = props.saveTableCallBack;
|
|
30900
30993
|
var codeFilter = {};
|
|
30901
30994
|
if (codeProps.columns) {
|
|
30902
30995
|
// table
|
|
@@ -30920,7 +31013,6 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30920
31013
|
fields: codeProps.fields
|
|
30921
31014
|
}).fields;
|
|
30922
31015
|
}
|
|
30923
|
-
console.log('codeFilter', codeFilter);
|
|
30924
31016
|
var styleRef = useRef(null);
|
|
30925
31017
|
var _useState = useState(false),
|
|
30926
31018
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -30942,6 +31034,18 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30942
31034
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
30943
31035
|
moduleParams = _useState10[0],
|
|
30944
31036
|
setModuleParams = _useState10[1];
|
|
31037
|
+
var _useState11 = useState('main'),
|
|
31038
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
31039
|
+
activeKey = _useState12[0],
|
|
31040
|
+
setActiveKey = _useState12[1]; //默认详情页配置
|
|
31041
|
+
var _useState13 = useState({}),
|
|
31042
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
31043
|
+
tablesConfigParams = _useState14[0],
|
|
31044
|
+
setTablesConfigParams = _useState14[1];
|
|
31045
|
+
var _useState15 = useState([]),
|
|
31046
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
31047
|
+
tableJsonEditorValsArr = _useState16[0],
|
|
31048
|
+
setTableJsonEditorValsArr = _useState16[1];
|
|
30945
31049
|
useEffect(function () {
|
|
30946
31050
|
Promise.all([axios.get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(pageType))]).then(function (_ref2) {
|
|
30947
31051
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
@@ -30965,6 +31069,73 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30965
31069
|
}
|
|
30966
31070
|
});
|
|
30967
31071
|
}, []);
|
|
31072
|
+
useEffect(function () {
|
|
31073
|
+
//明细表的配置数据
|
|
31074
|
+
var axiosArr = detailTablesSetting.map(function (item) {
|
|
31075
|
+
return axios.get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(item.tableCode));
|
|
31076
|
+
});
|
|
31077
|
+
Promise.all(axiosArr).then(function (_ref5) {
|
|
31078
|
+
var _ref6 = _toArray(_ref5),
|
|
31079
|
+
resArr = _ref6.slice(0);
|
|
31080
|
+
var configParams = {};
|
|
31081
|
+
detailTablesSetting.map(function (item, index) {
|
|
31082
|
+
var _resArr$index;
|
|
31083
|
+
var _ref7 = ((_resArr$index = resArr[index]) === null || _resArr$index === void 0 ? void 0 : _resArr$index.data) || {},
|
|
31084
|
+
code = _ref7.code,
|
|
31085
|
+
data = _ref7.data;
|
|
31086
|
+
if (data) {
|
|
31087
|
+
var businessType = data.businessType,
|
|
31088
|
+
fieldGroup = data.code,
|
|
31089
|
+
moduleType = data.moduleType;
|
|
31090
|
+
configParams[item.tableCode] = {
|
|
31091
|
+
businessType: businessType,
|
|
31092
|
+
fieldGroup: fieldGroup,
|
|
31093
|
+
moduleType: moduleType,
|
|
31094
|
+
tableFlag: true
|
|
31095
|
+
};
|
|
31096
|
+
}
|
|
31097
|
+
});
|
|
31098
|
+
setTablesConfigParams(_objectSpread2({}, configParams));
|
|
31099
|
+
});
|
|
31100
|
+
var detailTableCodeFilter = detailTablesSetting.map(function (item) {
|
|
31101
|
+
if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
|
|
31102
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
31103
|
+
columns: item === null || item === void 0 ? void 0 : item.initialSetting
|
|
31104
|
+
});
|
|
31105
|
+
}
|
|
31106
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
31107
|
+
columns: item === null || item === void 0 ? void 0 : item.columns.map(function (childItem) {
|
|
31108
|
+
return {
|
|
31109
|
+
key: childItem.key || childItem.dataIndex,
|
|
31110
|
+
dataIndex: childItem.dataIndex || childItem.key,
|
|
31111
|
+
isStaticCode: true,
|
|
31112
|
+
title: childItem.title
|
|
31113
|
+
};
|
|
31114
|
+
})
|
|
31115
|
+
});
|
|
31116
|
+
});
|
|
31117
|
+
setTableJsonEditorValsArr(_toConsumableArray(detailTableCodeFilter));
|
|
31118
|
+
var lastRes = detailTableCodeFilter.map(function (item) {
|
|
31119
|
+
if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
|
|
31120
|
+
var _codeProps = {
|
|
31121
|
+
fields: [],
|
|
31122
|
+
columns: item === null || item === void 0 ? void 0 : item.columns
|
|
31123
|
+
};
|
|
31124
|
+
var newValue = {
|
|
31125
|
+
fields: [],
|
|
31126
|
+
columns: item.initialSetting
|
|
31127
|
+
};
|
|
31128
|
+
var result = hanleCallbackValue(_codeProps, newValue, item === null || item === void 0 ? void 0 : item.customerFields, item === null || item === void 0 ? void 0 : item.cacheColumns);
|
|
31129
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
31130
|
+
columns: result === null || result === void 0 ? void 0 : result.columns
|
|
31131
|
+
});
|
|
31132
|
+
}
|
|
31133
|
+
return item;
|
|
31134
|
+
});
|
|
31135
|
+
if (lastRes.length) {
|
|
31136
|
+
saveTableCallBack(lastRes, false);
|
|
31137
|
+
}
|
|
31138
|
+
}, [detailTablesSetting.length]);
|
|
30968
31139
|
var onClickRun = function onClickRun(value, isSave) {
|
|
30969
31140
|
setJsonEditorVal(value);
|
|
30970
31141
|
try {
|
|
@@ -30974,6 +31145,40 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30974
31145
|
message.error(e);
|
|
30975
31146
|
}
|
|
30976
31147
|
};
|
|
31148
|
+
//明细表保存
|
|
31149
|
+
var onClickRunDetailTables = function onClickRunDetailTables(value, isSave, tableCode, tableSouce) {
|
|
31150
|
+
var targetCode = tableCode || activeKey;
|
|
31151
|
+
var targetTableSource = tableSouce || tableJsonEditorValsArr;
|
|
31152
|
+
var newArr = targetTableSource.map(function (item) {
|
|
31153
|
+
if (item.tableCode == targetCode) {
|
|
31154
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
31155
|
+
columns: value
|
|
31156
|
+
});
|
|
31157
|
+
}
|
|
31158
|
+
return item;
|
|
31159
|
+
});
|
|
31160
|
+
setTableJsonEditorValsArr(_toConsumableArray(newArr));
|
|
31161
|
+
try {
|
|
31162
|
+
var target = targetTableSource.find(function (item) {
|
|
31163
|
+
return item.tableCode == targetCode;
|
|
31164
|
+
});
|
|
31165
|
+
var _codeProps2 = {
|
|
31166
|
+
fields: [],
|
|
31167
|
+
columns: target === null || target === void 0 ? void 0 : target.columns
|
|
31168
|
+
};
|
|
31169
|
+
var newValue = {
|
|
31170
|
+
fields: [],
|
|
31171
|
+
columns: value
|
|
31172
|
+
};
|
|
31173
|
+
var result = hanleCallbackValue(_codeProps2, newValue, target === null || target === void 0 ? void 0 : target.customerFields, target === null || target === void 0 ? void 0 : target.cacheColumns);
|
|
31174
|
+
saveTableCallBack({
|
|
31175
|
+
columns: result.columns,
|
|
31176
|
+
tableCode: targetCode
|
|
31177
|
+
}, isSave, value);
|
|
31178
|
+
} catch (e) {
|
|
31179
|
+
message.error(e);
|
|
31180
|
+
}
|
|
31181
|
+
};
|
|
30977
31182
|
React.useEffect(function () {
|
|
30978
31183
|
localStorage.setItem('jsonEditorVal', JSON.stringify(jsonEditorVal || {}));
|
|
30979
31184
|
}, [jsonEditorVal]);
|
|
@@ -30990,25 +31195,97 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30990
31195
|
});
|
|
30991
31196
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Drawer, {
|
|
30992
31197
|
visible: visible,
|
|
30993
|
-
width:
|
|
31198
|
+
width: 1400,
|
|
30994
31199
|
onClose: function onClose() {
|
|
30995
31200
|
return setVisible(false);
|
|
30996
31201
|
},
|
|
30997
31202
|
className: 'customFieldsDrawer'
|
|
31203
|
+
}, detailTablesSetting.length == 0 && /*#__PURE__*/React.createElement("div", {
|
|
31204
|
+
style: {
|
|
31205
|
+
display: 'flex'
|
|
31206
|
+
}
|
|
31207
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31208
|
+
style: {
|
|
31209
|
+
flex: 1,
|
|
31210
|
+
width: 500
|
|
31211
|
+
}
|
|
31212
|
+
}, isEmpty(moduleParams) ? /*#__PURE__*/React.createElement("div", {
|
|
31213
|
+
style: {
|
|
31214
|
+
padding: "10px 0",
|
|
31215
|
+
fontSize: "16px",
|
|
31216
|
+
fontWeight: "bolder"
|
|
31217
|
+
}
|
|
31218
|
+
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React.createElement(FieldsSettingsTable, _objectSpread2({}, tableParams))), /*#__PURE__*/React.createElement("div", {
|
|
31219
|
+
style: {
|
|
31220
|
+
flex: 1
|
|
31221
|
+
}
|
|
31222
|
+
}, /*#__PURE__*/React.createElement(Editor, {
|
|
31223
|
+
type: "table",
|
|
31224
|
+
onRun: onClickRun,
|
|
31225
|
+
value: jsonEditorVal,
|
|
31226
|
+
shallowHeight: height
|
|
31227
|
+
}))), detailTablesSetting.length > 0 && /*#__PURE__*/React.createElement(Tabs, {
|
|
31228
|
+
defaultActiveKey: activeKey,
|
|
31229
|
+
onChange: function onChange(v) {
|
|
31230
|
+
return setActiveKey(v);
|
|
31231
|
+
}
|
|
31232
|
+
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
31233
|
+
tab: "\u8BE6\u60C5\u9875\u914D\u7F6E",
|
|
31234
|
+
key: "main"
|
|
30998
31235
|
}, /*#__PURE__*/React.createElement("div", {
|
|
30999
|
-
|
|
31000
|
-
|
|
31236
|
+
style: {
|
|
31237
|
+
display: 'flex'
|
|
31238
|
+
}
|
|
31239
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31240
|
+
style: {
|
|
31241
|
+
flex: 1,
|
|
31242
|
+
width: 500
|
|
31243
|
+
}
|
|
31244
|
+
}, isEmpty(moduleParams) ? /*#__PURE__*/React.createElement("div", {
|
|
31001
31245
|
style: {
|
|
31002
31246
|
padding: "10px 0",
|
|
31003
31247
|
fontSize: "16px",
|
|
31004
31248
|
fontWeight: "bolder"
|
|
31005
31249
|
}
|
|
31006
|
-
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React.createElement(FieldsSettingsTable, _objectSpread2({}, tableParams)), /*#__PURE__*/React.createElement(
|
|
31250
|
+
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React.createElement(FieldsSettingsTable, _objectSpread2({}, tableParams))), /*#__PURE__*/React.createElement("div", {
|
|
31251
|
+
style: {
|
|
31252
|
+
flex: 1
|
|
31253
|
+
}
|
|
31254
|
+
}, /*#__PURE__*/React.createElement(Editor, {
|
|
31007
31255
|
type: "table",
|
|
31008
31256
|
onRun: onClickRun,
|
|
31009
31257
|
value: jsonEditorVal,
|
|
31010
31258
|
shallowHeight: height
|
|
31011
|
-
})),
|
|
31259
|
+
})))), tableJsonEditorValsArr.map(function (k) {
|
|
31260
|
+
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
31261
|
+
tab: k.title,
|
|
31262
|
+
key: k.tableCode
|
|
31263
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31264
|
+
style: {
|
|
31265
|
+
display: 'flex'
|
|
31266
|
+
}
|
|
31267
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31268
|
+
style: {
|
|
31269
|
+
flex: 1,
|
|
31270
|
+
width: 500
|
|
31271
|
+
}
|
|
31272
|
+
}, !tablesConfigParams[k.tableCode] ? /*#__PURE__*/React.createElement("div", {
|
|
31273
|
+
style: {
|
|
31274
|
+
padding: "10px 0",
|
|
31275
|
+
fontSize: "16px",
|
|
31276
|
+
fontWeight: "bolder"
|
|
31277
|
+
}
|
|
31278
|
+
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React.createElement(FieldsSettingsTable, _objectSpread2({}, tablesConfigParams[k.tableCode]))), /*#__PURE__*/React.createElement("div", {
|
|
31279
|
+
style: {
|
|
31280
|
+
flex: 1
|
|
31281
|
+
}
|
|
31282
|
+
}, /*#__PURE__*/React.createElement(Editor, {
|
|
31283
|
+
type: "table",
|
|
31284
|
+
onRun: onClickRunDetailTables,
|
|
31285
|
+
value: k.columns,
|
|
31286
|
+
shallowHeight: height
|
|
31287
|
+
}))));
|
|
31288
|
+
}))), !visible && isAdmin() && /*#__PURE__*/React.createElement(ConfigButton, {
|
|
31012
31289
|
type: 'primary',
|
|
31013
31290
|
onClick: function onClick() {
|
|
31014
31291
|
return setVisible(true);
|