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

zhouweidong 发布系统代码 [ibz-wf,统一工作流]

上级 c21fe4dd
......@@ -13,7 +13,7 @@
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction=""
updateAction="Jump"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
......
......@@ -38,6 +38,179 @@ export default class WFProcessInstanceServiceBase extends EntityService {
// 实体接口
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/checkkey`,data,isloading);
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/wfprocessinstances`,data,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessinstances/${context.wfprocessinstance}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/wfprocessinstances/getdraft`,isloading);
res.data.wfprocessinstance = data.wfprocessinstance;
return res;
}
/**
* Jump接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Jump(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/jump`,data,isloading);
return res;
}
/**
* JumpBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async JumpBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfprocessinstances/jumpbatch`,tempData,isloading);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfprocessinstances/${context.wfprocessinstance}`,isloading);
return res;
}
/**
* Restart接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Restart(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/restart`,data,isloading);
return res;
}
/**
* RestartBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async RestartBatch(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfprocessinstances/restartbatch`,tempData,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfprocessinstances/${context.wfprocessinstance}/save`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfprocessinstances/${context.wfprocessinstance}`,data,isloading);
return res;
}
/**
* FetchActiveProcessInstance接口方法
*
......@@ -48,6 +221,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase
*/
public async FetchActiveProcessInstance(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/wfprocessinstances/fetchactiveprocessinstance`,tempData,isloading);
return res;
}
/**
......@@ -74,6 +250,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = Http.getInstance().get(`/wfprocessinstances/fetchdefault`,tempData,isloading);
return res;
}
/**
......
......@@ -233,7 +233,26 @@ export default class WFProcessInstanceUIServiceBase extends UIService {
delete context.srfsessionid;
}
const backend = () => {
actionContext.$Notice.error({ title: '错误', desc: '模型异常,应用实体方法不存在' });
const curService:WFProcessInstanceService = new WFProcessInstanceService();
curService.Restart(context,data, true).then((response: any) => {
if (!response || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: response.message });
return;
}
actionContext.$Notice.success({ title: '成功', desc: '操作成功' });
const _this: any = actionContext;
return response;
}).catch((response: any) => {
if (response && response.status && response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
actionContext.$Notice.error({ title: (actionContext.$t('app.commonWords.wrong') as string), desc: (actionContext.$t('app.commonWords.sysException') as string) });
return;
}
return response;
});
};
backend();
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册