You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.3 KiB
89 lines
2.3 KiB
import { basicAction } from '@peace/utils'
|
|
import { ApiTable } from '$utils'
|
|
|
|
|
|
export function createFileDir(query) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'CREATE_FILE_DIR',
|
|
url: ApiTable.createFileDir,
|
|
query,
|
|
msg: { error: '创建文件夹失败' },
|
|
// reducer: { name: 'uploadFile' }
|
|
});
|
|
}
|
|
|
|
export function delFileDir(query) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'DEL_FILE_DIR',
|
|
url: ApiTable.delFileDir,
|
|
query,
|
|
msg: { error: '删除文件夹失败' },
|
|
// reducer: { name: 'uploadFile' }
|
|
});
|
|
}
|
|
|
|
export function queryFileDir(query) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'QUERY_FILE_DIR',
|
|
url: ApiTable.queryFileDIr,
|
|
query,
|
|
msg: { error: '查询文件夹失败' },
|
|
reducer: { name: 'fileDirs' }
|
|
});
|
|
}
|
|
|
|
export function updateFileDir(query) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'UPDATE_FILE_DIR',
|
|
url: ApiTable.updateFileDir,
|
|
query,
|
|
msg: { error: '更新文件夹名称失败' },
|
|
// reducer: { name: 'fileDirs' }
|
|
});
|
|
}
|
|
|
|
|
|
// data : {typeId, userId, userName, startDate, endDate, fileSize, fileName, fileUrl, fileExt}
|
|
export function uploadFile(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
dispatch: dispatch,
|
|
actionType: 'UPLOAD_FILE',
|
|
url: ApiTable.uploadFile,
|
|
data,
|
|
msg: { error: '上传文件失败' },
|
|
reducer: { name: 'uploadFile' }
|
|
});
|
|
}
|
|
|
|
export function deleteFile(id) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'DELETE_FILE',
|
|
url: ApiTable.deleteFile,
|
|
msg: { error: '删除文件数据失败' },
|
|
query: { id },
|
|
reducer: { name: 'fileDel' }
|
|
});
|
|
}
|
|
|
|
export function getFileList(query) { // fId, limit, offset, searchTxt
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'GET_FILE_LIST',
|
|
url: ApiTable.getFileList,
|
|
query,
|
|
msg: { error: '获取档案数据失败' },
|
|
reducer: { name: 'fileList' }
|
|
});
|
|
}
|