VIEW-BASE.vue.ftl 2.4 KB
Newer Older
1 2 3
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
4
// 基于 @VIEW/实体编辑视图/VIEW-BASE.vue.ftl 生成
5 6 7 8
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>

9 10
<#assign self_content>
<#if view.getPSAppViewRefs?? && view.getPSAppViewRefs()??>
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

    /**
     * meditview9状态下发变量
     *
     * @memberof ${srfclassname('${view.name}')}Base
     */
    @Prop() public panelState?: Subject<ViewState>;

    /**
     * meditview9状态事件
     *
     * @public
     * @type {(Subscription | undefined)}
     * @memberof ${srfclassname('${view.name}')}Base
     */
    public panelStateEvent: Subscription | undefined;

28 29 30 31 32 33 34 35 36
    /**
     * 视图引用数据
     * 
     * @memberof ${srfclassname('${view.codeName}')}Base
     */
    public viewRefData:any = {
    <#list view.getPSAppViewRefs() as viewRef>
    <#if viewRef.getName?? && viewRef.getName()?? && viewRef.getRefPSAppView?? && viewRef.getRefPSAppView()??>
    <#assign refAppView = viewRef.getRefPSAppView() />
tony001's avatar
tony001 committed
37
        "${viewRef.getName()}":{viewname:"${srffilepath2(refAppView.getCodeName())}",title:"<#if refAppView.getPSAppDataEntity()??>entities.${refAppView.getPSAppDataEntity().getCodeName()?lower_case}.views.${refAppView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${refAppView.getCodeName()?lower_case}.caption</#if>", width: <#if refAppView.getWidth?? && refAppView.getWidth() gt 0>${refAppView.getWidth()?c}<#else>800</#if>, height: <#if refAppView.getHeight?? && refAppView.getHeight() gt 0>${refAppView.getHeight()?c}<#else>500</#if>}<#if viewRef_has_next>,</#if>
38 39 40 41 42
    </#if>
    </#list>
    };
</#if>
</#assign>
43

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<#assign created_block>
if (this.panelState) {
    this.panelStateEvent = this.panelState.subscribe((res:any) => {
        if (Object.is(res.tag, 'meditviewpanel')) {
            if (Object.is(res.action, 'save')) {
                this.viewState.next({ tag:'form', action: 'save', data: res.data });
            }
            if (Object.is(res.action, 'remove')) {
                this.viewState.next({ tag:'form', action: 'remove', data: res.data });
            }
        }
    });
}
</#assign>
<#assign before_destroy_block>
    if (_this.panelStateEvent) {
        _this.panelStateEvent.unsubscribe();
    }
</#assign>
63 64 65 66 67 68 69 70 71 72 73 74
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>


<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>

<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
</#ibizinclude>