/** * @description 预编译SQL脚本 返回JSON数据:{status:'总体执行状态', errorStack:'错误异常', tasks:[{ status:'单条SQL执行状态', physicalSql:'物理SQL', error:{ startRow:'错误开始行' startCol:'错误开始列' message:'错误信息' } }] } */ import { getUrl } from 'src/utils/getUrl'; import Request from 'src/utils/requests'; import * as defs from '../../baseClass'; export class Params { /** 项目ID */ projectId: number; /** 选中代码的起始行号 */ selRowStart?: string; /** 选中代码的起始列号 */ selColStart?: string; } export const init = new defs.PreCompileBO(); export async function request(params = {}, bodyParams = {}) { return Request({ url: '/api/editor/precompile', params: bodyParams, method: 'post', }); } export function createFetchAction(types, stateKey) { return (params = {}, bodyParams, meta?: any) => { return { types, meta, stateKey, method: 'POST', url: getUrl('/api/editor/precompile', params, 'POST'), params: bodyParams, init, }; }; }