|
|
@@ -126,6 +126,34 @@ export default {
|
|
|
message.error('保存失败');
|
|
|
}
|
|
|
},
|
|
|
+ *remoteQucikAdd(action, { select, call, put }) {
|
|
|
+ try {
|
|
|
+ const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
|
|
|
+ const { title, items } = dashboardDesigner;
|
|
|
+ let body = {
|
|
|
+ bdName: title,
|
|
|
+ bdNote: '',
|
|
|
+ bdConfiguration: JSON.stringify(items),
|
|
|
+ thumbnail: '',
|
|
|
+ createBy: 'zhuth'
|
|
|
+ }
|
|
|
+ console.log('快速新增看板', body);
|
|
|
+ const res = yield call(service.fetch, {
|
|
|
+ url: URLS.DASHBOARD_ADD,
|
|
|
+ body: body
|
|
|
+ });
|
|
|
+ console.log('快速新增看板', body, res);
|
|
|
+ if(!res.err && res.data.code > 0) {
|
|
|
+ yield put({ type: 'fetchList', mandatory: true });
|
|
|
+ yield put({ type: 'main/redirect', path: '/dashboard/' + res.data.data });
|
|
|
+ }else {
|
|
|
+ message.error('保存失败: ' + (res.err || res.data.msg));
|
|
|
+ }
|
|
|
+ }catch(e) {
|
|
|
+ console.log(e);
|
|
|
+ message.error('保存失败');
|
|
|
+ }
|
|
|
+ },
|
|
|
*remoteModify(action, { select, call, put }) {
|
|
|
try {
|
|
|
const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
|