提交 81a11211 编写于 作者: tony001's avatar tony001

调整完善实体数据重定向视图逻辑

上级 3eb39141
......@@ -52,7 +52,7 @@
</#if>
<#-- END:导航参数 -->
<#-- BEGIN:准备参数 -->
<#if dataview.isRedirectView()>
<#if dataview.isRedirectView() && dataview.getViewType() != "DEREDIRECTVIEW">
const deResParameters: any[] = [];
const parameters: any[] = [];
<#else>
......@@ -150,7 +150,8 @@
<#-- 应用全局流程工作重定向视图and实体全局流程数据重定向视图end -->
<#else>
<#-- 实体数据重定向视图start -->
// todo 实体数据重定向视图
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
<#-- 实体数据重定向视图end -->
</#if>
<#elseif dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
......
<#assign import_block>
import UIService from '@/uiservice/ui-service';
import qs from 'qs';
import { ViewTool } from '@/utils';
</#assign>
<#assign created_block>
this.viewInit();
......@@ -11,13 +12,12 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${view.name}')}Base
*/
public async viewInit(){
const {srfkey:srfkey,srfappde:srfappde} = this.viewparams;
const uiService:UIService = new UIService();
const targetService:any = await uiService.getService(srfappde.toLowerCase());
targetService.getRDAppView(srfkey,${view.isEnableWorkflow()?c}).then((res:any) =>{
let srfkey:any = this.context.${appde.getCodeName()?lower_case};
this.appUIService.getRDAppView(srfkey,false).then((res:any) =>{
if(res && res.viewname && res.srfappde){
const path:string =<#noparse>`/${res.srfappde}/${srfkey}/${res.viewname}`</#noparse>;
this.$router.push({path:path});
let indexPath:string = ViewTool.getIndexRoutePath(this.$route);
<#noparse>const path:string =`${indexPath}/${res.srfappde}/${srfkey}/${res.viewname}?${qs.stringify(this.viewparams, { delimiter: ';' })}`;</#noparse>
this.$router.replace({path:path});
}else{
console.error("未查找到重定向视图")
}
......
......@@ -14,6 +14,7 @@ Vue.use(Router);
meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
info:'',
viewType: 'REDIRECTVIEW',
<#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}',
......@@ -33,6 +34,7 @@ Vue.use(Router);
meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
info:'',
viewType: 'REDIRECTVIEW',
<#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}',
......@@ -52,6 +54,7 @@ Vue.use(Router);
meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
info:'',
viewType: 'REDIRECTVIEW',
<#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}',
......@@ -64,6 +67,28 @@ Vue.use(Router);
component: () => import('@pages/${srffilepath2(subView.getPSAppModule().getCodeName())}/${srffilepath2(subView.getCodeName())}/${srffilepath2(subView.getCodeName())}.vue'),
},
<#-- 实体全局重定向视图end -->
<#elseif subView.getViewType() == "DEREDIRECTVIEW">
<#-- 实体数据重定向视图start -->
{
path: '<#if !isIncludeIndex>/</#if>${srfpluralize(subView.getPSAppDataEntity().codeName)?lower_case}/:${subView.getPSAppDataEntity().getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?',
meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
info:'',
viewType: 'REDIRECTVIEW',
<#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}',
</#if>
parameters: [
{ pathName: '${view.getCodeName()?lower_case}', parameterName: '${view.getCodeName()?lower_case}' },
{ pathName: '${srfpluralize(subView.getPSAppDataEntity().codeName)?lower_case}', parameterName: '${subView.getPSAppDataEntity().getCodeName()?lower_case}' },
{ pathName: '${subView.getPSDEViewCodeName()?lower_case}', parameterName: '${subView.getPSDEViewCodeName()?lower_case}' },
],
requireAuth: <#if subView.getAccUserMode?? && subView.getAccUserMode()?? && (subView.getAccUserMode() == 1 || subView.getAccUserMode() == 3)>false<#else>true</#if>,
},
component: () => import('@pages/${srffilepath2(subView.getPSAppModule().getCodeName())}/${srffilepath2(subView.getCodeName())}/${srffilepath2(subView.getCodeName())}.vue'),
},
<#-- 实体数据重定向视图end -->
<#else>
<#-- 其他重定向视图start -->
{
......@@ -71,6 +96,7 @@ Vue.use(Router);
meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
info:'',
viewType: 'REDIRECTVIEW',
<#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}',
......
......@@ -246,15 +246,14 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code}
</#if>
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
const multiFormDEField:string|null =<#if de.getFormTypePSDEField()??>"${de.getFormTypePSDEField().getCodeName()?lower_case}"<#else>null</#if>;
if (isEnableMultiForm && multiFormDEField) {
if (multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
return 'MOBEDITVIEW:'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
return 'EDITVIEW:'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册