LOGIC.vue.ftl 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
    /**
     * ${item.getCaption()}
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof ${srfclassname('${view.name}')}Base
     */
12
    public ${item.getFullCodeName()}(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
13 14 15 16
        const _this: any = this;
        if (!xData || !(xData.wfstart instanceof Function)) {
            return;
        }
17 18
        <#if view.getPSWorkflow()??>
        <#assign curWorkflow = view.getPSWorkflow() />
19 20
        <#-- 通过是否使用代理模式来区分流程启动的模式 -->
        <#if curWorkflow.isUseWFProxyApp()>
21
        xData.wfstart(args).then((response: any) => {
22 23 24 25
        <#else>
        let localdata:any = {processDefinitionKey:null};
        xData.wfstart(args,localdata).then((response: any) => {
        </#if>
26 27
        <#else>
        xData.wfstart(args).then((response: any) => {
28
        </#if>
29 30 31 32 33 34 35 36 37 38
            if (!response || response.status !== 200) {
                return;
            }
            const { data: _data } = response;
            if(window.parent){
                window.parent.postMessage({ ..._data },'*');
            }
            if (_this.viewdata) {
                _this.$emit('viewdataschange', [{ ..._data }]);
                _this.$emit('close');
39 40
            }else if (this.$tabPageExp) {
                this.$tabPageExp.onClose(this.$route.fullPath);
41 42 43
            }
        });
    }