Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz4jVue
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
iBiz4jVue
提交
59cc4ca6
提交
59cc4ca6
编写于
8月 24, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增实体工作流动态导航表格视图批量提交流程数据
上级
23f86f4d
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
155 行增加
和
1 行删除
+155
-1
CONTROL-BASE.vue.ftl
@CONTROL/表格/CONTROL-BASE.vue.ftl
+38
-0
SERVICE.ts.ftl
@CONTROL/表格/SERVICE.ts.ftl
+102
-0
VIEW-BASE.vue.ftl
@VIEW/实体工作流动态导航表格视图/VIEW-BASE.vue.ftl
+15
-1
未找到文件。
@CONTROL/表格/CONTROL-BASE.vue.ftl
浏览文件 @
59cc4ca6
...
@@ -2034,6 +2034,44 @@ import { FormItemModel } from '@/model/form-detail';
...
@@ -2034,6 +2034,44 @@ import { FormItemModel } from '@/model/form-detail';
return falg;
return falg;
}
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async submitbatch(data: any,localdata:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const arg: any = data;
const result: Promise<any> = this.service.submitbatch(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg,localdata,this.showBusyIndicator);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.submiterror') as string) + ', ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.submitsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
reject(response);
});
})
}
<#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
</#ibizinclude>
...
...
@CONTROL/表格/SERVICE.ts.ftl
浏览文件 @
59cc4ca6
...
@@ -18,6 +18,14 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
...
@@ -18,6 +18,14 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude>
</#ibizinclude>
/**
* 备份原生数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public copynativeData:any;
<#list ctrl.getPSDEGridEditItems() as deItem>
<#list ctrl.getPSDEGridEditItems() as deItem>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()??>
<#if deItem.getPSEditor()?? && deItem.getPSEditor().getPSAppDataEntity?? && deItem.getPSEditor().getPSAppDataEntity()??>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
<#assign _appde = deItem.getPSEditor().getPSAppDataEntity()/>
...
@@ -242,6 +250,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
...
@@ -242,6 +250,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
result =_appEntityService.FetchDefault(Context,Data, isloading);
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
}
result.then((response) => {
result.then((response) => {
this.copynativeData = Util.deepCopy(response.data);
this.handleResponse(action, response);
this.handleResponse(action, response);
resolve(response);
resolve(response);
}).catch(response => {
}).catch(response => {
...
@@ -419,6 +428,98 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
...
@@ -419,6 +428,98 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
return {context:tempContext,data:requestData};
return {context:tempContext,data:requestData};
}
}
/**
* 处理工作流数据
*
* @param data 传入数据
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public handleWFData(data:any, isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
dataItems.forEach((item:any) =>{
if(item && item.prop){
if(item.dataType){
if(!Object.is(item.dataType,'QUERYPARAM')){
requestData[item.prop] = data[item.name];
}
}else{
requestData[item.prop] = data[item.name];
}
}
});
if(isMerge && (data.viewparams && Object.keys(data.viewparams).length > 0)){
Object.assign(requestData,data.viewparams);
}
// 删除前端srffrontuf标识
if(requestData.hasOwnProperty('srffrontuf')){
delete requestData.srffrontuf;
}
//补充工作流所需主键
requestData.srfkey = data.${appde.getCodeName()?lower_case};
//补充全量数据
requestData = this.fillNativeData(requestData);
return requestData;
}
/**
* 补充全量数据
*
* @param {*} [data]
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public fillNativeData(data:any){
if(this.copynativeData && this.copynativeData.length >0){
let targetData:any = this.copynativeData.find((item:any) =>{
return item.${appde.getKeyPSAppDEField().getCodeName()?lower_case} === data.srfkey;
})
data = Object.assign(targetData,data);
return data;
}
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
@Errorlog
public submitbatch(action: string,context: any = {}, data: any,localdata:any,isloading?: boolean): Promise<any> {
let tempData:any = [];
if(data && data.length > 0){
data.forEach((item:any) => {
let data:any = this.handleWFData(item,true);
tempData.push(data);
});
}
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,tempData, localdata,isloading);
} else {
result = this.appEntityService.wfSubmitBatch(context,tempData,localdata,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
<#ibizinclude>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
</#ibizinclude>
\ No newline at end of file
@VIEW/实体工作流动态导航表格视图/VIEW-BASE.vue.ftl
浏览文件 @
59cc4ca6
...
@@ -130,7 +130,21 @@
...
@@ -130,7 +130,21 @@
* @memberof ${srfclassname('${view.codeName}')}Base
* @memberof ${srfclassname('${view.codeName}')}Base
*/
*/
public dynamic_toolbar_click(linkItem:any, $event:any){
public dynamic_toolbar_click(linkItem:any, $event:any){
let datas: any[] = [];
let xData: any = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
xData.submitbatch(datas,linkItem).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
this.engine.load();
if (this.viewdata) {
this.$emit('viewdataschange', [{ ..._data }]);
}
});
}
}
/**
/**
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录