@cloudbase/weda-ui-mp 3.22.0 → 3.22.2
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.
|
@@ -167,16 +167,19 @@ Component({
|
|
|
167
167
|
],
|
|
168
168
|
};
|
|
169
169
|
try {
|
|
170
|
-
if (dataSource?.type === 'database') {
|
|
170
|
+
if (dataSource?.type === 'database' && dataSource?.name) {
|
|
171
171
|
return await callWedaApi({
|
|
172
172
|
action: 'DescribeChartCardData',
|
|
173
173
|
data: params,
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
if (dataSource?.name && dataSource?.methodName) {
|
|
177
|
+
return await callDataSource({
|
|
178
|
+
dataSourceName: dataSource?.name,
|
|
179
|
+
methodName: dataSource?.methodName,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return [];
|
|
180
183
|
} catch {
|
|
181
184
|
return [];
|
|
182
185
|
}
|
|
@@ -159,6 +159,10 @@ Component({
|
|
|
159
159
|
setConfigHandle: function ({ config }) {
|
|
160
160
|
this.setConfig(config);
|
|
161
161
|
},
|
|
162
|
+
uploadHandle: function () {
|
|
163
|
+
upload(this.data.uploadInstance);
|
|
164
|
+
},
|
|
165
|
+
|
|
162
166
|
init: function () {
|
|
163
167
|
const { config } = this.data;
|
|
164
168
|
const uploadInstance = this.initUploadInstance({ action: 'CHOOSE_MEDIA', config });
|
|
@@ -166,9 +170,7 @@ Component({
|
|
|
166
170
|
|
|
167
171
|
this.setReadonlyAttributes &&
|
|
168
172
|
this.setReadonlyAttributes({
|
|
169
|
-
upload: (
|
|
170
|
-
upload(_uploadInstance);
|
|
171
|
-
},
|
|
173
|
+
upload: this.uploadHandle.bind(this),
|
|
172
174
|
delete: this.deleteHandle.bind(this),
|
|
173
175
|
uploadInstance,
|
|
174
176
|
setConfig: this.setConfigHandle.bind(this),
|