VIEW-BASE.vue.ftl 1.6 KB
Newer Older
1 2 3 4 5 6 7
<#assign self_content>

    /**
     * iframe路径
     *
     * @memberof @memberof ${srfclassname('${view.name}')}Base
     */
8
    public iframeUrl:string ="";
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

    /**
     * 获取iframe路径
     *
     * @public
     * @memberof ${srfclassname('${view.name}')}Base
     */
    public getIframeUrl(){
        <#if view.getPSAppDataEntity()??>
        <#assign curAppEntity = view.getPSAppDataEntity() />
        </#if>
        this.$http.post(`/${srfpluralize(curAppEntity.codeName)?lower_case}/<#noparse>${</#noparse>this.context['${curAppEntity.getCodeName()?lower_case}']<#noparse>}</#noparse>/wfstart`,{}).then((response:any) =>{
            if (response && response.status === 200) {
                const data = response.data;
                //?srfwfproxydataid=<#noparse>${</#noparse>this.context.${curAppEntity.getCodeName()?lower_case}<#noparse>}</#noparse>;srfwfproxymoduleid=${curAppEntity.getCodeName()}
                this.iframeUrl = `<#noparse>${data.url}</#noparse>`;   
            }
        }).catch((response:any) =>{
            if (response && response.status === 401) {
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }
        })
    }
</#assign>
<#assign self_viewparam>
        this.getIframeUrl();
</#assign>
<#assign created_block>
        window.addEventListener('message',(e:any) =>{
            this.$emit('close',e.data);
        },false);
</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>