@gingkoo/pandora-metabase 0.0.17 → 0.0.19
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 +6 -16
- package/lib/es/index.js.map +1 -1
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-metabase v0.0.
|
|
2
|
+
* @gingkoo/pandora-metabase v0.0.19
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -132,20 +132,13 @@ 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,
|
|
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
|
-
};
|
|
149
142
|
// const [fetchDatasetFn, setFetchDatasetFn] = useState<(id: string) => Promise<any>>(
|
|
150
143
|
// async () => {},
|
|
151
144
|
// ); //fn
|
|
@@ -5353,7 +5346,7 @@ const JoinData = props => {
|
|
|
5353
5346
|
}
|
|
5354
5347
|
} else {
|
|
5355
5348
|
// @ts-ignore
|
|
5356
|
-
data =
|
|
5349
|
+
data = metaList.slice().map(v => {
|
|
5357
5350
|
if (v.type === TypeEnum.data) {
|
|
5358
5351
|
return {
|
|
5359
5352
|
alias: v.table.alias,
|
|
@@ -5737,7 +5730,6 @@ const JoinData = props => {
|
|
|
5737
5730
|
// 子查询弹窗
|
|
5738
5731
|
const showSubQuery = (val = []) => {
|
|
5739
5732
|
const {
|
|
5740
|
-
ref,
|
|
5741
5733
|
subToolbar,
|
|
5742
5734
|
toolbar,
|
|
5743
5735
|
...other
|
|
@@ -6474,7 +6466,6 @@ const GroupBy = props => {
|
|
|
6474
6466
|
isGroup: true,
|
|
6475
6467
|
// @ts-ignore
|
|
6476
6468
|
onGroup: data => {
|
|
6477
|
-
console.log('🚀 ~ handleUpdate ~ data:', data);
|
|
6478
6469
|
// @ts-ignore
|
|
6479
6470
|
newMeta[index].by.splice(i, 1, data);
|
|
6480
6471
|
// @ts-ignore
|
|
@@ -7269,12 +7260,11 @@ const SqlVisionBuilder = /*#__PURE__*/React__default.forwardRef((props, ref) =>
|
|
|
7269
7260
|
store.setProps(props);
|
|
7270
7261
|
}, [props]);
|
|
7271
7262
|
useEffect(() => {
|
|
7272
|
-
store.
|
|
7273
|
-
|
|
7274
|
-
}, [JSON.stringify(value)]);
|
|
7263
|
+
store.setPreData(value);
|
|
7264
|
+
}, [value]);
|
|
7275
7265
|
useEffect(() => {
|
|
7276
7266
|
store.setSourceList(sourceList);
|
|
7277
|
-
}, [
|
|
7267
|
+
}, [sourceList]);
|
|
7278
7268
|
useEffect(() => {
|
|
7279
7269
|
store.setShowFields(showFields);
|
|
7280
7270
|
store.setFieldNameTpl(fieldNameTpl || '${name}');
|