105 lines
2.0 KiB
JavaScript
105 lines
2.0 KiB
JavaScript
import {
|
|
api,
|
|
downloadFile,
|
|
createApiUrl
|
|
} from '~/utils/axios';
|
|
|
|
|
|
/**
|
|
* 下载代码块模板
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function downloadTemplate(data) {
|
|
downloadFile(createApiUrl('CodeModule.CodeModule/downloadTemplate'), data);
|
|
}
|
|
|
|
/**
|
|
* 导入代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export const importExcel = createApiUrl('CodeModule.CodeModule/importExcel');
|
|
|
|
/**
|
|
* 导出代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function exportExcel(data) {
|
|
downloadFile(createApiUrl('CodeModule.CodeModule/exportExcel'), data);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 获取字典值
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function getDictionary(data) {
|
|
return api.post('Dictionary.Dictionary/getDictionary', data, {});
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取代码块列表
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function getCodeModuleList(data) {
|
|
return api.post('CodeModule.CodeModule/getCodeModuleList', data);
|
|
}
|
|
|
|
/**
|
|
* 删除代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function deleteCodeModule(data) {
|
|
return api.post('CodeModule.CodeModule/deleteCodeModule', data, {
|
|
isTransformResponse: true,
|
|
isShowSuccessMessage: true,
|
|
errorMessageText: '删除失败'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 添加代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function addCodeModule(data) {
|
|
return api.post('CodeModule.CodeModule/addCodeModule', data, {
|
|
isTransformResponse: true,
|
|
isShowSuccessMessage: true,
|
|
errorMessageText: '添加失败'
|
|
});
|
|
}
|
|
/**
|
|
* 编辑代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function editCodeModule(data) {
|
|
return api.post('CodeModule.CodeModule/editCodeModule', data, {
|
|
isTransformResponse: true,
|
|
isShowSuccessMessage: true,
|
|
errorMessageText: '编辑失败'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 审核代码块
|
|
* @param {Object} data
|
|
* @return {Promise} api
|
|
*/
|
|
export function audit(data) {
|
|
return api.post('CodeModule.CodeModule/auditCodeModule', data, {
|
|
errorMessageText: '审核失败'
|
|
});
|
|
} |