@bit-sun/business-component 2.0.39-alpha.12 → 2.0.39-alpha.14

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
@@ -25699,6 +25699,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
25699
25699
  codeProps = props.codeProps,
25700
25700
  customerFields = props.customerFields,
25701
25701
  initialSetting = props.initialSetting;
25702
+ debugger;
25702
25703
  var codeFilter = {};
25703
25704
  if (codeProps.columns) {
25704
25705
  // table
@@ -25721,6 +25722,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
25721
25722
  fields: codeProps.fields
25722
25723
  }).fields;
25723
25724
  }
25725
+ debugger;
25724
25726
  var _useState = useState(false),
25725
25727
  _useState2 = _slicedToArray(_useState, 2),
25726
25728
  visible = _useState2[0],
@@ -25729,7 +25731,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
25729
25731
  _useState4 = _slicedToArray(_useState3, 2),
25730
25732
  code = _useState4[0],
25731
25733
  setCode = _useState4[1];
25732
- var _useState5 = useState(false),
25734
+ var _useState5 = useState(true),
25733
25735
  _useState6 = _slicedToArray(_useState5, 2),
25734
25736
  init = _useState6[0],
25735
25737
  setInit = _useState6[1];
@@ -25742,16 +25744,17 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
25742
25744
  setJsonEditorVal(value);
25743
25745
  try {
25744
25746
  setCode(value);
25745
- callBack(hanleCallbackValue(codeProps, value, customerFields), isSave);
25747
+ callBack(hanleCallbackValue(codeProps, value, customerFields), isSave, value);
25746
25748
  } catch (e) {
25747
25749
  message.error(e);
25748
25750
  }
25749
25751
  };
25750
- // React.useEffect(() => {
25751
- // if (init) {
25752
- // onRun(code);
25753
- // }
25754
- // }, [code]);
25752
+ React.useEffect(function () {
25753
+ if (init) {
25754
+ onClickRun(jsonEditorVal);
25755
+ setInit(false);
25756
+ }
25757
+ }, [jsonEditorVal]);
25755
25758
  var height = (styleRef === null || styleRef === void 0 ? void 0 : (_styleRef$current = styleRef.current) === null || _styleRef$current === void 0 ? void 0 : _styleRef$current.clientHeight) || (styleRef === null || styleRef === void 0 ? void 0 : (_styleRef$current2 = styleRef.current) === null || _styleRef$current2 === void 0 ? void 0 : _styleRef$current2.offsetHeight);
25756
25759
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Drawer, {
25757
25760
  visible: visible,
package/dist/index.js CHANGED
@@ -25717,6 +25717,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
25717
25717
  codeProps = props.codeProps,
25718
25718
  customerFields = props.customerFields,
25719
25719
  initialSetting = props.initialSetting;
25720
+ debugger;
25720
25721
  var codeFilter = {};
25721
25722
  if (codeProps.columns) {
25722
25723
  // table
@@ -25739,6 +25740,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
25739
25740
  fields: codeProps.fields
25740
25741
  }).fields;
25741
25742
  }
25743
+ debugger;
25742
25744
  var _useState = React.useState(false),
25743
25745
  _useState2 = _slicedToArray(_useState, 2),
25744
25746
  visible = _useState2[0],
@@ -25747,7 +25749,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
25747
25749
  _useState4 = _slicedToArray(_useState3, 2),
25748
25750
  code = _useState4[0],
25749
25751
  setCode = _useState4[1];
25750
- var _useState5 = React.useState(false),
25752
+ var _useState5 = React.useState(true),
25751
25753
  _useState6 = _slicedToArray(_useState5, 2),
25752
25754
  init = _useState6[0],
25753
25755
  setInit = _useState6[1];
@@ -25760,16 +25762,17 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
25760
25762
  setJsonEditorVal(value);
25761
25763
  try {
25762
25764
  setCode(value);
25763
- callBack(hanleCallbackValue(codeProps, value, customerFields), isSave);
25765
+ callBack(hanleCallbackValue(codeProps, value, customerFields), isSave, value);
25764
25766
  } catch (e) {
25765
25767
  antd.message.error(e);
25766
25768
  }
25767
25769
  };
25768
- // React.useEffect(() => {
25769
- // if (init) {
25770
- // onRun(code);
25771
- // }
25772
- // }, [code]);
25770
+ React__default['default'].useEffect(function () {
25771
+ if (init) {
25772
+ onClickRun(jsonEditorVal);
25773
+ setInit(false);
25774
+ }
25775
+ }, [jsonEditorVal]);
25773
25776
  var height = (styleRef === null || styleRef === void 0 ? void 0 : (_styleRef$current = styleRef.current) === null || _styleRef$current === void 0 ? void 0 : _styleRef$current.clientHeight) || (styleRef === null || styleRef === void 0 ? void 0 : (_styleRef$current2 = styleRef.current) === null || _styleRef$current2 === void 0 ? void 0 : _styleRef$current2.offsetHeight);
25774
25777
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Drawer, {
25775
25778
  visible: visible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.0.39-alpha.12",
3
+ "version": "2.0.39-alpha.14",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -158,6 +158,8 @@ const JsonQueryTable = React.memo(props => {
158
158
  initialSetting
159
159
  } = props;
160
160
 
161
+ debugger
162
+
161
163
  let codeFilter = {};
162
164
  if (codeProps.columns) { // table
163
165
  codeFilter.columns = codeProps.columns.map(item => ({
@@ -176,9 +178,11 @@ const JsonQueryTable = React.memo(props => {
176
178
  }
177
179
 
178
180
 
181
+ debugger
182
+
179
183
  const [visible, setVisible] = useState(false)
180
184
  const [code, setCode] = useState(codeProps);
181
- const [init, setInit] = useState(false);
185
+ const [init, setInit] = useState(true);
182
186
  const [jsonEditorVal, setJsonEditorVal] = useState(initialSetting || codeFilter);
183
187
  const styleRef = React.useRef(null);
184
188
 
@@ -187,17 +191,18 @@ const JsonQueryTable = React.memo(props => {
187
191
 
188
192
  try {
189
193
  setCode(value);
190
- callBack(hanleCallbackValue(codeProps, value, customerFields), isSave);
194
+ callBack(hanleCallbackValue(codeProps, value, customerFields), isSave, value);
191
195
  } catch (e) {
192
196
  message.error(e);
193
197
  }
194
198
  };
195
199
 
196
- // React.useEffect(() => {
197
- // if (init) {
198
- // onRun(code);
199
- // }
200
- // }, [code]);
200
+ React.useEffect(() => {
201
+ if (init) {
202
+ onClickRun(jsonEditorVal);
203
+ setInit(false)
204
+ }
205
+ }, [jsonEditorVal]);
201
206
 
202
207
  const height =
203
208
  styleRef?.current?.clientHeight || styleRef?.current?.offsetHeight;