import { IHttpResponse, IParam } from '@/core/interface'; import { ControlVOBase } from '../control-vo'; import FormService from './form-service'; /** * 搜索表单部件服务 * * @class SearchFormService */ class SearchFormService extends FormService { /** * 加载草稿 * * @param {string} action * @param {IParam} [context={}] * @param {IParam} [data={}] * @return {*} {Promise} * @memberof SearchFormService */ async loadDraft( action: string, context: IParam = {}, data: IParam = {} ): Promise { let result: Promise | null = null; const { data: Data, context: Context } = this.handleRequestData( context, data ); try { await this.initEntityService(); result = this.appEntityService[action ? action : 'GetDraft']( Context, Data ); if (result) { const response = await result; this.handleResponse(response); } } catch (error) {} return result; } } export default SearchFormService;