@bit-sun/business-component 2.2.0-alpha.13 → 2.2.0-alpha.15

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 CHANGED
@@ -30590,6 +30590,14 @@ function convertFileds(fields, falltValue, faltFieldRange, containerName) {
30590
30590
  if (returnField) {
30591
30591
  var _returnField$name;
30592
30592
  returnField.label = field === null || field === void 0 ? void 0 : field.label;
30593
+ if (field === null || field === void 0 ? void 0 : field.disabled) {
30594
+ // 字段设置只读属性
30595
+ returnField.field.props.disabled = true;
30596
+ }
30597
+ if (field === null || field === void 0 ? void 0 : field.invisible) {
30598
+ // 字段设置不可见属性
30599
+ returnField.initialVisible = false;
30600
+ }
30593
30601
  if (Array.isArray(returnField.name) && ((_returnField$name = returnField.name) === null || _returnField$name === void 0 ? void 0 : _returnField$name.includes("extensionFields"))) {
30594
30602
  returnField.notShowLabel = true;
30595
30603
  }
@@ -30833,11 +30841,26 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
30833
30841
  });
30834
30842
  });
30835
30843
  setTableJsonEditorValsArr(_toConsumableArray(detailTableCodeFilter));
30836
- detailTableCodeFilter.map(function (item) {
30844
+ var lastRes = detailTableCodeFilter.map(function (item) {
30837
30845
  if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
30838
- onClickRunDetailTables(item.initialSetting, false, item.tableCode, detailTableCodeFilter);
30846
+ var _codeProps = {
30847
+ fields: [],
30848
+ columns: item === null || item === void 0 ? void 0 : item.columns
30849
+ };
30850
+ var newValue = {
30851
+ fields: [],
30852
+ columns: item.initialSetting
30853
+ };
30854
+ var result = hanleCallbackValue(_codeProps, newValue, item === null || item === void 0 ? void 0 : item.customerFields);
30855
+ return _objectSpread2(_objectSpread2({}, item), {}, {
30856
+ columns: result === null || result === void 0 ? void 0 : result.columns
30857
+ });
30839
30858
  }
30859
+ return item;
30840
30860
  });
30861
+ if (lastRes.length) {
30862
+ saveTableCallBack(lastRes, false);
30863
+ }
30841
30864
  }, [detailTablesSetting.length]);
30842
30865
  var onClickRun = function onClickRun(value, isSave) {
30843
30866
  setJsonEditorVal(value);
@@ -30865,7 +30888,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
30865
30888
  var target = targetTableSource.find(function (item) {
30866
30889
  return item.tableCode == targetCode;
30867
30890
  });
30868
- var _codeProps = {
30891
+ var _codeProps2 = {
30869
30892
  fields: [],
30870
30893
  columns: target === null || target === void 0 ? void 0 : target.columns
30871
30894
  };
@@ -30873,7 +30896,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
30873
30896
  fields: [],
30874
30897
  columns: value
30875
30898
  };
30876
- var result = hanleCallbackValue(_codeProps, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
30899
+ var result = hanleCallbackValue(_codeProps2, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
30877
30900
  saveTableCallBack({
30878
30901
  columns: result.columns,
30879
30902
  tableCode: targetCode
package/dist/index.js CHANGED
@@ -30608,6 +30608,14 @@ function convertFileds(fields, falltValue, faltFieldRange, containerName) {
30608
30608
  if (returnField) {
30609
30609
  var _returnField$name;
30610
30610
  returnField.label = field === null || field === void 0 ? void 0 : field.label;
30611
+ if (field === null || field === void 0 ? void 0 : field.disabled) {
30612
+ // 字段设置只读属性
30613
+ returnField.field.props.disabled = true;
30614
+ }
30615
+ if (field === null || field === void 0 ? void 0 : field.invisible) {
30616
+ // 字段设置不可见属性
30617
+ returnField.initialVisible = false;
30618
+ }
30611
30619
  if (Array.isArray(returnField.name) && ((_returnField$name = returnField.name) === null || _returnField$name === void 0 ? void 0 : _returnField$name.includes("extensionFields"))) {
30612
30620
  returnField.notShowLabel = true;
30613
30621
  }
@@ -30851,11 +30859,26 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
30851
30859
  });
30852
30860
  });
30853
30861
  setTableJsonEditorValsArr(_toConsumableArray(detailTableCodeFilter));
30854
- detailTableCodeFilter.map(function (item) {
30862
+ var lastRes = detailTableCodeFilter.map(function (item) {
30855
30863
  if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
30856
- onClickRunDetailTables(item.initialSetting, false, item.tableCode, detailTableCodeFilter);
30864
+ var _codeProps = {
30865
+ fields: [],
30866
+ columns: item === null || item === void 0 ? void 0 : item.columns
30867
+ };
30868
+ var newValue = {
30869
+ fields: [],
30870
+ columns: item.initialSetting
30871
+ };
30872
+ var result = hanleCallbackValue(_codeProps, newValue, item === null || item === void 0 ? void 0 : item.customerFields);
30873
+ return _objectSpread2(_objectSpread2({}, item), {}, {
30874
+ columns: result === null || result === void 0 ? void 0 : result.columns
30875
+ });
30857
30876
  }
30877
+ return item;
30858
30878
  });
30879
+ if (lastRes.length) {
30880
+ saveTableCallBack(lastRes, false);
30881
+ }
30859
30882
  }, [detailTablesSetting.length]);
30860
30883
  var onClickRun = function onClickRun(value, isSave) {
30861
30884
  setJsonEditorVal(value);
@@ -30883,7 +30906,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
30883
30906
  var target = targetTableSource.find(function (item) {
30884
30907
  return item.tableCode == targetCode;
30885
30908
  });
30886
- var _codeProps = {
30909
+ var _codeProps2 = {
30887
30910
  fields: [],
30888
30911
  columns: target === null || target === void 0 ? void 0 : target.columns
30889
30912
  };
@@ -30891,7 +30914,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
30891
30914
  fields: [],
30892
30915
  columns: value
30893
30916
  };
30894
- var result = hanleCallbackValue(_codeProps, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
30917
+ var result = hanleCallbackValue(_codeProps2, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
30895
30918
  saveTableCallBack({
30896
30919
  columns: result.columns,
30897
30920
  tableCode: targetCode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.2.0-alpha.13",
3
+ "version": "2.2.0-alpha.15",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -82,7 +82,14 @@ function convertFileds (fields, falltValue, faltFieldRange, containerName) {
82
82
  } else {
83
83
  const returnField = field.isStaticCode ? falltValue[containerName ? (containerName + field.name) : field.name] : faltFieldRange[field.name];
84
84
  if (returnField) {
85
- returnField.label = field?.label;
85
+ returnField.label = field?.label;
86
+ if(field?.disabled){ // 字段设置只读属性
87
+ returnField.field.props.disabled = true;
88
+ }
89
+ if(field?.invisible){ // 字段设置不可见属性
90
+ returnField.initialVisible = false;
91
+ }
92
+
86
93
  if(Array.isArray(returnField.name)&&returnField.name?.includes("extensionFields")){
87
94
  returnField.notShowLabel = true;
88
95
  }
@@ -327,11 +334,27 @@ const JsonQueryTable = React.memo(props => {
327
334
  }
328
335
  });
329
336
  setTableJsonEditorValsArr([...detailTableCodeFilter]);
330
- detailTableCodeFilter.map(item => {
337
+ const lastRes = detailTableCodeFilter.map(item => {
331
338
  if(item?.initialSetting && item?.initialSetting.length){
332
- onClickRunDetailTables(item.initialSetting, false, item.tableCode, detailTableCodeFilter);
339
+ const codeProps = {
340
+ fields: [],
341
+ columns: item?.columns,
342
+ };
343
+ const newValue = {
344
+ fields: [],
345
+ columns: item.initialSetting
346
+ };
347
+ const result = hanleCallbackValue(codeProps, newValue, item?.customerFields);
348
+ return {
349
+ ...item,
350
+ columns: result?.columns
351
+ }
333
352
  }
334
- })
353
+ return item;
354
+ });
355
+ if(lastRes.length){
356
+ saveTableCallBack(lastRes, false);
357
+ }
335
358
  },[detailTablesSetting.length]);
336
359
 
337
360
  const onClickRun = (value, isSave) => {