提交 322dc9bb 编写于 作者: Mosher's avatar Mosher

update:更新流程

上级 09188357
...@@ -134,6 +134,22 @@ ${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code} ...@@ -134,6 +134,22 @@ ${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
prop: 'srffrontuf', prop: 'srffrontuf',
dataType: 'TEXT', dataType: 'TEXT',
}, },
// 预置工作流数据字段
{
name: 'srfprocessdefinitionkey',
prop: 'srfprocessdefinitionkey',
dataType: 'TEXT'
},
{
name: 'srftaskdefinitionkey',
prop: 'srftaskdefinitionkey',
dataType: 'TEXT'
},
{
name: 'srftaskid',
prop: 'srftaskid',
dataType: 'TEXT'
}
] ]
} }
} }
......
...@@ -10,10 +10,18 @@ ...@@ -10,10 +10,18 @@
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this; const that: any = this;
if (!xData || !(xData.wfstart instanceof Function)) { if (!xData || !(xData.wfstart instanceof Function)) {
return; return;
} }
let validateStatus: boolean = true;
if (xData.formValidateStatus && xData.formValidateStatus instanceof Function) {
validateStatus = xData.formValidateStatus();
}
if (!validateStatus) {
return;
}
const startWorkFlow: Function = (param: any, localdata: any) => {
<#if view.getPSWorkflow()??> <#if view.getPSWorkflow()??>
<#assign curWorkflow = view.getPSWorkflow() /> <#assign curWorkflow = view.getPSWorkflow() />
<#-- 通过是否使用代理模式来区分流程启动的模式 --> <#-- 通过是否使用代理模式来区分流程启动的模式 -->
...@@ -30,14 +38,94 @@ ...@@ -30,14 +38,94 @@
return; return;
} }
const { data: _data } = response; const { data: _data } = response;
if(window.parent){ that.closeView(_data);
window.parent.postMessage({ ..._data },'*'); });
}
const openStartView: Function = async (item: any, localdata: any) => {
if (item['wfversion']) {
<#noparse>const targetView: any = that.viewRefData ? that.viewRefData[`WFSTART@${item['wfversion']}`] : null;</#noparse>
if (targetView) {
const tempContext = Util.deepCopy(that.context);
<#noparse>const tempViewParams = { actionView: `WFSTART@${item['wfversion']}`, actionForm: item['process-form'] };</#noparse>
const container: Subject<any> = that.$appmodal.openModal(targetView, tempContext, tempViewParams);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
} }
if (_this.viewdata) { const tempSubmitData: any = Util.deepCopy(args[0]);
_this.$emit('viewdataschange', [{ ..._data }]); if (result.datas && result.datas[0]) {
_this.$emit('close'); const resultData: any = result.datas[0];
}else if (this.$tabPageExp) { if (Object.keys(resultData).length > 0) {
this.$tabPageExp.onClose(this.$route.fullPath); let tempData: any = {};
Object.keys(resultData).forEach((key: any) => {
if (resultData[key] || (resultData[key] === 0) || (resultData[key] === false)) {
tempData[key] = resultData[key];
} }
}); })
Object.assign(tempSubmitData, tempData);
}
}
startWorkFlow([tempSubmitData], localdata);
})
} else {
startWorkFlow(args, localdata);
}
} else {
startWorkFlow(args, localdata);
}
}
let localData: any;
const localContext = Util.deepCopy(that.context);
const requestResult: Promise<any> = that.appEntityService.getStandWorkflow(localContext);
requestResult.then((response: any) => {
const { data: targetData, status } = response;
if (status !== 200 || targetData.length === 0) {
return;
}
if (targetData && targetData.length > 1) {
const h = that.$createElement;
targetData.forEach((element: any) => {
Object.assign(element, { value: element.definitionkey, label: element.definitionname });
})
that.$msgbox({
title: '请选择流程版本',
message: h('i-select', {
key: Util.createUUID(),
props: {
value: localData,
placeholder: "请选择流程版本...",
transfer: true,
transferClassName: "start-workflow-select-wraper"
},
on: {
'on-change': ($event: any) => {
localData = { processDefinitionKey: $event };
}
}
}, targetData.map((item: any) => {
return h('i-option', {
key: item.value,
props: {
value: item.value,
label: item.label
}
})
})),
showCancelButton: true,
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then((action: string) => {
if (Object.is(action, 'confirm') && localData && Object.keys(localData).length > 0) {
let targetItem: any = targetData.find((item: any) => {
return item.definitionkey === localData.processDefinitionKey;
})
openStartView(targetItem, localData);
}
})
} else {
localData = { processDefinitionKey: targetData[0]['definitionkey'] }
targetData[0]['process-view'] = "WFSTART@1";
openStartView(targetData[0], localData);
}
})
} }
\ No newline at end of file
...@@ -164,6 +164,18 @@ ...@@ -164,6 +164,18 @@
<#elseif dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''> <#elseif dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
<#-- 打开顶级分页视图 --> <#-- 打开顶级分页视图 -->
const _this: any = this; const _this: any = this;
if (fullargs && fullargs.length > 0) {
const _args = fullargs[0];
if (_args['srfprocessdefinitionkey'] && _args['srftaskdefinitionkey']) {
Object.assign(data, {
processDefinitionKey: _args['srfprocessdefinitionkey'],
taskDefinitionKey: _args['srftaskdefinitionkey']
});
if (_args['srftaskid']) {
Object.assign(data, { 'srftaskid': _args['srftaskid'] });
}
}
}
if(fullargs && fullargs.copymode){ if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true}); Object.assign(data,{copymode:true});
} }
......
...@@ -105,8 +105,9 @@ ...@@ -105,8 +105,9 @@
public dynamic_toolbar_click(linkItem:any, $event:any){ public dynamic_toolbar_click(linkItem:any, $event:any){
let datas: any[] = []; let datas: any[] = [];
let xData: any = this.$refs.form; let xData: any = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) { if (Object.keys(this.viewparams).length > 0) {
datas = [...xData.getDatas()]; Object.assign(datas, { 'processDefinitionKey': this.viewparams.processDefinitionKey });
Object.assign(datas, { 'taskDefinitionKey': this.viewparams.taskDefinitionKey });
} }
const submit:Function = (submitData:any,linkItem:any) =>{ const submit:Function = (submitData:any,linkItem:any) =>{
xData.wfsubmit(submitData,linkItem).then((response: any) => { xData.wfsubmit(submitData,linkItem).then((response: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册