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

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

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