Browse Source

(*)采集任务action提交

master
peng.peng 2 years ago
parent
commit
9d749ee09e
  1. 6
      web/client/src/sections/metadataAcquisition/actions/dataSource.js
  2. 5
      web/client/src/sections/metadataAcquisition/actions/index.js
  3. 56
      web/client/src/sections/metadataAcquisition/actions/task.js
  4. 6
      web/client/src/utils/webapi.js

6
web/client/src/sections/metadataAcquisition/actions/dataSource.js

@ -23,7 +23,7 @@ export function getDataSources(query) {
query: query || {},
actionType: 'GET_ACQ_DATASOURCES',
url: `${ApiTable.getDataSources}`,
msg: { error: '获取适配器列表失败' },
msg: { error: '获取数据源列表失败' },
reducer: { name: 'datasources' }
});
}
@ -35,7 +35,7 @@ export function deleteDataSource(id) {
actionType: 'DELETE_ACQ_DATASOURCE',
url: ApiTable.modifyDataSource.replace('{id}', id),
msg: {
option: '模型删除',
option: '数据源删除',
},
});
}
@ -48,7 +48,7 @@ export function modifyDataSource(id, params, msg) {
actionType: 'MODIFY_ACQ_DATASOURCE',
url: ApiTable.modifyDataSource.replace('{id}', id),
msg: {
option: msg || '模型编辑',
option: msg || '数据源编辑',
},
});
}

5
web/client/src/sections/metadataAcquisition/actions/index.js

@ -3,9 +3,10 @@
import * as example from './example'
import * as adapter from './adapter'
import * as dataSource from './dataSource'
import * as task from './task';
export default {
...example,
...adapter,
...dataSource
...dataSource,
...task
}

56
web/client/src/sections/metadataAcquisition/actions/task.js

@ -0,0 +1,56 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function addTask(params, msg) {
return (dispatch) => basicAction({
type: 'post',
data: params,
dispatch,
actionType: 'ADD_DATSOURCE',
url: ApiTable.addTask,
msg: {
option: msg || '新增采集任务',
},
});
}
export function getTasks(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query || {},
actionType: 'GET_ACQ_TASKS',
url: `${ApiTable.getTasks}`,
msg: { error: '获取采集任务列表失败' },
reducer: { name: 'tasks' }
});
}
export function deleteTask(id) {
return (dispatch) => basicAction({
type: 'del',
dispatch,
actionType: 'DELETE_ACQ_TASK',
url: ApiTable.modifyTask.replace('{id}', id),
msg: {
option: '采集任务删除',
},
});
}
export function modifyTask(id, params, msg) {
return (dispatch) => basicAction({
type: 'put',
data: params,
dispatch,
actionType: 'MODIFY_ACQ_TASK',
url: ApiTable.modifyTask.replace('{id}', id),
msg: {
option: msg || '采集任务编辑',
},
});
}

6
web/client/src/utils/webapi.js

@ -31,9 +31,9 @@ export const ApiTable = {
modifyDataSource: 'acq/dataSource/{id}',
//元数据采集-采集任务管理
addDataSource: 'meta/acq/task',
getDataSources: 'meta/acq/tasks',
modifyDataSource: 'acq/task/{id}',
addTask: 'meta/acq/task',
getTasks: 'meta/acq/tasks',
modifyTask: 'acq/task/{id}',
};

Loading…
Cancel
Save