|
|
@@ -137,6 +137,8 @@ export default {
|
|
|
creatorName: chart.creatorName,
|
|
|
dataSourceCode: chart.dataSourceCode+'',
|
|
|
dataSourceName: chart.dataSourceName,
|
|
|
+ dataConnectCode: chart.dataConnectCode,
|
|
|
+ dataConnectName: chart.dataConnectName,
|
|
|
viewType: 'chart',
|
|
|
chartType: chart.type,
|
|
|
filters: chart.filters,
|
|
|
@@ -149,32 +151,6 @@ export default {
|
|
|
});
|
|
|
return Object.assign({}, state, {items, chartCodes, dataSources, dirty: true});
|
|
|
},
|
|
|
- addCharts(state, action) {
|
|
|
- let { items, chartCodes, dataSources, defaultLayout } = state;
|
|
|
- const { charts } = action;
|
|
|
-
|
|
|
- items = items.concat(charts.map(c => {
|
|
|
- dataSources.findIndex(d => d.code === c.dataSourceCode+'') === -1 && dataSources.push({
|
|
|
- code: c.dataSourceCode+'',
|
|
|
- name: c.dataSourceName
|
|
|
- });
|
|
|
- chartCodes.push(c.code);
|
|
|
- return {
|
|
|
- code: c.code,
|
|
|
- chartCode: c.code,
|
|
|
- name: c.name,
|
|
|
- creatorCode: c.creatorCode,
|
|
|
- creatorName: c.creatorName,
|
|
|
- viewType: 'chart',
|
|
|
- chartType: c.type,
|
|
|
- dataSourceCode: c.dataSourceCode+'',
|
|
|
- dataSourceName: c.dataSourceName,
|
|
|
- filters: c.filters,
|
|
|
- layout: defaultLayout,
|
|
|
- }
|
|
|
- }));
|
|
|
- return Object.assign({}, state, {items, chartCodes, dataSources, dirty: true});
|
|
|
- },
|
|
|
deleteItem(state, action) {
|
|
|
let { items, chartCodes, dataSources, relationColumns, dirty } = state;
|
|
|
const { item } = action;
|
|
|
@@ -489,6 +465,22 @@ export default {
|
|
|
console.log(e);
|
|
|
message.error('生成缩略图失败: ' + e);
|
|
|
}
|
|
|
+ },
|
|
|
+ *encryptCode(action, { put, call, select }) {
|
|
|
+ const { shareCode } = action;
|
|
|
+ const res = yield call(service.fetch, {
|
|
|
+ url: URLS.DASHBOARD_ENCRYPT_CODE,
|
|
|
+ method: 'GET',
|
|
|
+ body: {
|
|
|
+ code: shareCode
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if(!res.err && res.data.code > 0) {
|
|
|
+ let resData = res.data.data;
|
|
|
+ return resData;
|
|
|
+ }else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
subscriptions: {
|