提交 24ef466c 编写于 作者: ibizdev's avatar ibizdev

tony001 发布系统代码 [后台服务,演示应用]

上级 e95c0858
......@@ -419,6 +419,8 @@ mock.onGet(new RegExp(/^\/ibizbooks\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
......
......@@ -17,8 +17,8 @@
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
finishAction='Update'
initAction='Get'
finishAction='Finish'
initAction='Init'
name="wizardpanel"
ref='wizardpanel'
@finish="wizardpanel_finish($event)"
......
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import { Verify } from '@/utils/verify/verify';
/**
* 完成图书流程
*
* @export
* @class FinishLogicBase
*/
export default class FinishLogicBase {
/**
* 名称
*
* @memberof FinishLogicBase
*/
private name:string ="finish";
/**
* 唯一标识
*
* @memberof FinishLogicBase
*/
private id:string = "2AF2CCC0-86F0-4F45-9FE1-D7055BED0654";
/**
* 默认参数名称
*
* @memberof FinishLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof FinishLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of FinishLogicBase.
*
* @param {*} [opts={}]
* @memberof FinishLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof FinishLogicBase
*/
public initParams(opts:any){
this.paramsMap.set('Default',opts);
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 完成图书状态
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
let actionParam:any = this.paramsMap.get('Default');
const targetService:IBIZBOOKService = new IBIZBOOKService();
if (targetService['Save'] && targetService['Save'] instanceof Function) {
result = await targetService['Save'](actionParam.context,actionParam.data, false);
}
if(result && result.status == 200){
Object.assign(actionParam.data,result.data);
return this.paramsMap.get(this.defaultParamName).data;
}
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute0Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import FinishLogicBase from './finish-logic-base';
/**
* 完成图书流程
*
* @export
* @class FinishLogic
*/
export default class FinishLogic extends FinishLogicBase{
/**
* Creates an instance of FinishLogic
*
* @param {*} [opts={}]
* @memberof FinishLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import FinishLogic from '@/service/ibizbook/finish-logic';
import InitDataLogic from '@/service/ibizbook/init-data-logic';
......@@ -209,4 +210,36 @@ export default class IBIZBOOKServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/ibizbooks/searchdefault`,tempData,isloading);
}
/**
* Finish接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Finish(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let appLogic:FinishLogic = new FinishLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await appLogic.onExecute(context,data,isloading?true:false);
let res:any ={status:200,data:data};
return res;
}
/**
* Init接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof IBIZBOOKServiceBase
*/
public async Init(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let appLogic:InitDataLogic = new InitDataLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await appLogic.onExecute(context,data,isloading?true:false);
let res:any ={status:200,data:data};
return res;
}
}
\ No newline at end of file
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import { Verify } from '@/utils/verify/verify';
......@@ -58,6 +59,15 @@ export default class InitDataLogicBase {
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
......@@ -69,6 +79,26 @@ export default class InitDataLogicBase {
}
/**
* 获取图书数据
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
let actionParam:any = this.paramsMap.get('Default');
const targetService:IBIZBOOKService = new IBIZBOOKService();
if (targetService['Get'] && targetService['Get'] instanceof Function) {
result = await targetService['Get'](actionParam.context,actionParam.data, false);
}
if(result && result.status == 200){
Object.assign(actionParam.data,result.data);
return this.paramsMap.get(this.defaultParamName).data;
}
}
/**
* 开始
*
......@@ -76,7 +106,9 @@ export default class InitDataLogicBase {
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
return this.paramsMap.get(this.defaultParamName).data;
if(this.compute0Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
......
......@@ -21,7 +21,7 @@
"delogicname":"图书",
"sysmoudle":{"id":"SAMPLE","name":"示例"},
"dedataset":[{"id":"Default" , "name":"数据集"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"UpdatePress" , "name":"更新出版社" , "type":"USERCUSTOM" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Finish" , "name":"完成借书流程" , "type":"DELOGIC" },{"id":"Init" , "name":"初始化" , "type":"DELOGIC" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"UpdatePress" , "name":"更新出版社" , "type":"USERCUSTOM" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册