@gingkoo/pandora-metabase 1.0.29 → 1.0.30
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.
|
@@ -46,6 +46,7 @@ var IconMap = {
|
|
|
46
46
|
};
|
|
47
47
|
var OPEN_GROUP = false; // mr.chen 说不弄这块 弄个开关防止后面要用
|
|
48
48
|
var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
49
|
+
var _value$, _value$2;
|
|
49
50
|
var _ref$data = _ref.data,
|
|
50
51
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
51
52
|
_value = _ref.value,
|
|
@@ -67,7 +68,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
67
68
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
68
69
|
value = _useState2[0],
|
|
69
70
|
setValue = _useState2[1]; // 当前选择的字段
|
|
70
|
-
var _useState3 = (0, _react.useState)(''),
|
|
71
|
+
var _useState3 = (0, _react.useState)((_value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableId) === _helper.SummarizeAlias ? '' : _value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableUuid),
|
|
71
72
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
72
73
|
curTable = _useState4[0],
|
|
73
74
|
setCurTable = _useState4[1]; // 当前选择的表
|
|
@@ -83,21 +84,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
83
84
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
84
85
|
tableList = _useState6[0],
|
|
85
86
|
setTableList = _useState6[1];
|
|
86
|
-
(0, _react.useEffect)(function () {
|
|
87
|
-
var _value$, _value$2;
|
|
88
|
-
var tableUuid = _value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableUuid;
|
|
89
|
-
if ((_value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableId) === _helper.SummarizeAlias) {
|
|
90
|
-
tableUuid = '';
|
|
91
|
-
} else {
|
|
92
|
-
var isHas = data.filter(function (v) {
|
|
93
|
-
return v.tableUuid === tableUuid;
|
|
94
|
-
});
|
|
95
|
-
if (isHas.length < 1) {
|
|
96
|
-
tableUuid = data[0].tableUuid;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
setCurTable(tableUuid);
|
|
100
|
-
}, [data, _value]);
|
|
101
87
|
(0, _react.useEffect)(function () {
|
|
102
88
|
// setCurColumn(_value);
|
|
103
89
|
setValue(_value);
|
|
@@ -108,8 +94,15 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
108
94
|
}).length) > 0;
|
|
109
95
|
};
|
|
110
96
|
(0, _react.useEffect)(function () {
|
|
97
|
+
var tableUuid = curTable;
|
|
98
|
+
var isHas = data.filter(function (v) {
|
|
99
|
+
return v.tableUuid === tableUuid;
|
|
100
|
+
});
|
|
101
|
+
if (isHas.length < 1 && tableUuid !== _helper.SummarizeAlias) {
|
|
102
|
+
tableUuid = data[0].tableUuid;
|
|
103
|
+
}
|
|
111
104
|
setTableList(data.map(function (v, i) {
|
|
112
|
-
var open = !i && !
|
|
105
|
+
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid; // TODO.这里只判断表名相等 没有用了 因为表上面加了一层数据源 先这样吧
|
|
113
106
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, v), {}, {
|
|
114
107
|
open: open,
|
|
115
108
|
searchText: '',
|
|
@@ -40,6 +40,7 @@ var IconMap = {
|
|
|
40
40
|
};
|
|
41
41
|
var OPEN_GROUP = false; // mr.chen 说不弄这块 弄个开关防止后面要用
|
|
42
42
|
var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
43
|
+
var _value$, _value$2;
|
|
43
44
|
var _ref$data = _ref.data,
|
|
44
45
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
45
46
|
_value = _ref.value,
|
|
@@ -61,7 +62,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
61
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
63
|
value = _useState2[0],
|
|
63
64
|
setValue = _useState2[1]; // 当前选择的字段
|
|
64
|
-
var _useState3 = useState(''),
|
|
65
|
+
var _useState3 = useState((_value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableId) === SummarizeAlias ? '' : _value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableUuid),
|
|
65
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
67
|
curTable = _useState4[0],
|
|
67
68
|
setCurTable = _useState4[1]; // 当前选择的表
|
|
@@ -77,21 +78,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
77
78
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
78
79
|
tableList = _useState6[0],
|
|
79
80
|
setTableList = _useState6[1];
|
|
80
|
-
useEffect(function () {
|
|
81
|
-
var _value$, _value$2;
|
|
82
|
-
var tableUuid = _value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableUuid;
|
|
83
|
-
if ((_value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableId) === SummarizeAlias) {
|
|
84
|
-
tableUuid = '';
|
|
85
|
-
} else {
|
|
86
|
-
var isHas = data.filter(function (v) {
|
|
87
|
-
return v.tableUuid === tableUuid;
|
|
88
|
-
});
|
|
89
|
-
if (isHas.length < 1) {
|
|
90
|
-
tableUuid = data[0].tableUuid;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
setCurTable(tableUuid);
|
|
94
|
-
}, [data, _value]);
|
|
95
81
|
useEffect(function () {
|
|
96
82
|
// setCurColumn(_value);
|
|
97
83
|
setValue(_value);
|
|
@@ -102,8 +88,15 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
102
88
|
}).length) > 0;
|
|
103
89
|
};
|
|
104
90
|
useEffect(function () {
|
|
91
|
+
var tableUuid = curTable;
|
|
92
|
+
var isHas = data.filter(function (v) {
|
|
93
|
+
return v.tableUuid === tableUuid;
|
|
94
|
+
});
|
|
95
|
+
if (isHas.length < 1 && tableUuid !== SummarizeAlias) {
|
|
96
|
+
tableUuid = data[0].tableUuid;
|
|
97
|
+
}
|
|
105
98
|
setTableList(data.map(function (v, i) {
|
|
106
|
-
var open = !i && !
|
|
99
|
+
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid; // TODO.这里只判断表名相等 没有用了 因为表上面加了一层数据源 先这样吧
|
|
107
100
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
108
101
|
open: open,
|
|
109
102
|
searchText: '',
|