VIEW.vue.ftl 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ${srfclassname('${view.name}')}Base from './${srffilepath2(view.name)}-base.vue';

<#if view.getPSControls()??>
<#list view.getPSControls() as ctrl>
<#if ctrl.getControlType?? && ctrl.getControlType() != 'TOOLBAR' && ctrl.getControlType() != 'CONTEXTMENU'>
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
import view_${ctrl.getName()} from '@widgets/${srffilepath2(ctrl.getPSAppDataEntity().getCodeName())}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
<#else>
import view_${ctrl.getName()} from '@widgets/app/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}/${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}.vue';
</#if>
</#if>
</#list>
</#if>
@Component({
    components: {
    <#if view.getPSControls?? && view.getPSControls()??>
    <#list view.getPSControls() as ctrl>
    <#if ctrl.getControlType() != "TOOLBAR">
        view_${ctrl.getName()}, 
    </#if>
    </#list>
    </#if>
    },
    beforeRouteEnter: (to: any, from: any, next: any) => {
        next((vm: any) => {
tony001's avatar
tony001 committed
28
            if(!Object.is(vm.navModel,"route")){
tony001's avatar
tony001 committed
29
                vm.initNavDataWithTab(vm.viewCacheData);
tony001's avatar
tony001 committed
30
            }
31 32 33 34 35 36 37 38
            vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
        });
    },
})
export default class ${srfclassname('${view.name}')} extends ${srfclassname('${view.name}')}Base {

}
</script>