@gingkoo/pandora-metabase 0.0.16 → 0.0.17

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/lib/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-metabase v0.0.16
2
+ * @gingkoo/pandora-metabase v0.0.17
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
@@ -132,13 +132,20 @@ const useStore = () => {
132
132
  const [sourceList, setSourceList] = useState([]); //数据源列表
133
133
  const [_cacheSource2TableMap, set_cacheSource2TableMap] = useState({}); //数据源id 对应数据集列表
134
134
  const [_cacheColumnsMap, set_cacheColumnsMap] = useState({}); //数据源id 对应数据集列表
135
- const [metaList, setMeta] = useState(defaultMetaList); //数据源id 对应数据集列表
135
+ const [metaList, _setMeta] = useState(defaultMetaList); //数据源id 对应数据集列表
136
136
  const [popupData, setPopup] = useState({
137
137
  visible: false,
138
138
  node: null,
139
139
  content: null
140
140
  }); //弹窗
141
141
  const [popupClosable, setClosable] = useState(defaultMetaList); //是否可关闭 如果弹框里面再弹框 则不可关闭
142
+ const setMeta = list => {
143
+ if (list.length) {
144
+ _setMeta(list);
145
+ } else {
146
+ _setMeta(defaultMetaList);
147
+ }
148
+ };
142
149
  // const [fetchDatasetFn, setFetchDatasetFn] = useState<(id: string) => Promise<any>>(
143
150
  // async () => {},
144
151
  // ); //fn
@@ -5757,7 +5764,8 @@ const JoinData = props => {
5757
5764
  newMeta[index].subquery = newList;
5758
5765
  newMeta[index].table2 = {
5759
5766
  ...newList[0].table,
5760
- column: ''
5767
+ column: '',
5768
+ column_id: ''
5761
5769
  };
5762
5770
  const items = _getColumns(newList);
5763
5771
  const newColumns = items.flatMap(item => item.columns);
@@ -7261,7 +7269,8 @@ const SqlVisionBuilder = /*#__PURE__*/React__default.forwardRef((props, ref) =>
7261
7269
  store.setProps(props);
7262
7270
  }, [props]);
7263
7271
  useEffect(() => {
7264
- store.setPreData(value);
7272
+ store.setMeta(value);
7273
+ // store.setPreData(value);
7265
7274
  }, [JSON.stringify(value)]);
7266
7275
  useEffect(() => {
7267
7276
  store.setSourceList(sourceList);