提交 698b155f 编写于 作者: JunZai's avatar JunZai

update

上级 3886535d
<#assign import_block>
import UtilService from '@/utilservice/util-service';
</#assign>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude>
/**
* 工具服务对象
*
* @protected
* @type {UtilService}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
protected utilService: UtilService = new UtilService();
/**
* 加载数据模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public loadModel(serviceName: string, context: any, viewparams: any) {
return new Promise((resolve: any, reject: any) => {
this.utilService.getService(serviceName).then((service: any) => {
service.loadModelData(JSON.stringify(context), viewparams).then((response: any) => {
resolve(response);
}).catch((response: any) => {
reject(response);
});
}).catch((response: any) => {
reject(response);
});
});
}
/**
* 保存模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public saveModel(serviceName: string, context: any, viewparams: any) {
return new Promise((resolve: any, reject: any) => {
this.utilService.getService(serviceName).then((service: any) => {
service.saveModelData(JSON.stringify(context), '', viewparams).then((response: any) => {
resolve(response);
}).catch((response: any) => {
reject(response);
});
}).catch((response: any) => {
reject(response);
});
});
}
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册