@gingkoo/pandora-metabase 1.0.0-alpha.11 → 1.0.0-alpha.12

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 v1.0.0-alpha.11
2
+ * @gingkoo/pandora-metabase v1.0.0-alpha.12
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
@@ -1144,7 +1144,7 @@ const useStore = () => {
1144
1144
  };
1145
1145
  // 回显
1146
1146
  // 设置column
1147
- const setQuotes = async _meta => {
1147
+ const setQuotes = _meta => {
1148
1148
  let newMeta = cloneDeep(_meta);
1149
1149
  newMeta.table1 = {
1150
1150
  ...newMeta.table1,
@@ -1171,20 +1171,19 @@ const useStore = () => {
1171
1171
  });
1172
1172
  return newMeta;
1173
1173
  };
1174
- const setPreData = async data => {
1174
+ const setPreData = data => {
1175
1175
  if (data.length) {
1176
1176
  let _metaList = data.map((item, groupIndex) => {
1177
- let newList = item.list?.map(async (v, i) => {
1178
- let newMeta = cloneDeep(item.list);
1179
- let newV = cloneDeep(v);
1177
+ let newList = item.list?.map((v, i) => {
1178
+ let newMeta = item.list;
1180
1179
  // 替换column
1181
- if (newV.type === TypeEnum.joinData) {
1182
- newMeta[i] = await setQuotes(newMeta[i]);
1180
+ if (newMeta[i].type === TypeEnum.joinData) {
1181
+ newMeta[i] = setQuotes(newMeta[i]);
1183
1182
  setMeta(newMeta, groupIndex);
1184
1183
  }
1185
1184
  // 设置右侧column
1186
1185
  if (v.table2?.datasourceId && v.columns.length < 1) {
1187
- await fetchColumns(newMeta[i].table2, newMeta[i].table2.datasourceId, columns => {
1186
+ fetchColumns(newMeta[i].table2, newMeta[i].table2.datasourceId, columns => {
1188
1187
  if (v.isSubquery) {
1189
1188
  let newColumns = [];
1190
1189
  const items = getSubColumns(v.subquery);
@@ -1201,14 +1200,16 @@ const useStore = () => {
1201
1200
  }
1202
1201
  // 设置column
1203
1202
  if (v.table?.datasourceId && v.columns.length < 1) {
1204
- await fetchColumns(newMeta[i].table, newMeta[i].table.datasourceId, columns => {
1203
+ fetchColumns(newMeta[i].table, newMeta[i].table.datasourceId, columns => {
1205
1204
  if (v.isSubquery) {
1206
1205
  let newColumns = [];
1207
1206
  const items = getSubColumns(v.subquery);
1208
1207
  newColumns = items.flatMap(item => item.columns);
1209
1208
  newMeta[i].columns = newColumns;
1209
+ v.columns = newColumns;
1210
1210
  } else {
1211
1211
  newMeta[i].columns = columns;
1212
+ v.columns = columns;
1212
1213
  }
1213
1214
  setMeta(newMeta, groupIndex);
1214
1215
  });