    <#if item.getPSViewLogic?? && item.getPSViewLogic()??>
    <#assign viewlogic = item.getPSViewLogic()/>
    /**
     * 打开新建数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof ${srfclassname('${view.name}')}
     */
    public newdata(args: any[], params?: any, $event?: any, xData?: any) {
    <#if viewlogic.isEnableWizardAdd()>
        this.$Notice.warning({ title: '错误', desc: '向导添加未实现' });
    <#elseif viewlogic.isEnableBatchAdd()>
        this.$Notice.warning({ title: '错误', desc: '支持批添加未实现' });
    <#elseif viewlogic.isBatchAddOnly()>
        this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
    <#elseif viewlogic.getNewDataPSAppView()??>
        <#assign dataview = viewlogic.getNewDataPSAppView()/>
        const data: any = {};
        if (args && args.length > 0 && args[0].srfsourcekey) {
            Object.assign(data, { srfsourcekey: args[0].srfsourcekey })
        }
        <#if dataview.getOpenMode() == 'INDEXVIEWTAB' || dataview.getOpenMode() == ''>
        <#--  打开顶级分页视图  -->
        const _this: any = this;
        if (_this.srfparentdata) {
            Object.assign(data, _this.srfparentdata);
        }
        const openIndexViewTab = (viewpath: string, data: any) => {
            // const _params = this.$util.prepareRouteParmas({
            //     route: this.$route,
            //     sourceNode: this.$route.name,
            //     targetNode: viewpath,
            //     data: data,
            // });
            // this.$router.push({ name: viewpath, params: _params });
            this.$router.navigate([viewpath, data], {relativeTo: this.$route.parent.parent});
        }
        openIndexViewTab('${dataview.getPSAppModule().codeName?lower_case}_${dataview.codeName?lower_case}', data);
        <#elseif dataview.getOpenMode() = 'POPUPMODAL'>
        <#--  打开模态  -->
        const _this: any = this;
        if (_this.srfparentdata) {
            Object.assign(data, { srfparentdata: _this.srfparentdata });
        }
        const openPopupModal = (view: any, data: any) => {
            let container: Subject<any> = this.$appmodal.openModal(view, data);
            container.subscribe((result: any) => {
                if (!result || !Object.is(result.ret, 'OK')) {
                    return;
                }
                if (!xData || !(xData.refresh instanceof Function)) {
                    return;
                }
                xData.refresh(result.datas);
            });
        }
        const view: any = {
            viewname: '${srffilepath2(dataview.getCodeName())}', 
            height: ${dataview.getHeight()?c}, 
            width: ${dataview.getWidth()?c},  
            title: '${dataview.title}', 
        };
        openPopupModal(view, data);
        <#elseif dataview.getOpenMode()?index_of('DRAWER') == 0>
        <#--  打开抽屉  -->
        const _this: any = this;
        if (_this.srfparentdata) {
            Object.assign(data, { srfparentdata: _this.srfparentdata });
        }
        const openDrawer = (view: any, data: any) => {
            let container: Subject<any> = this.$appdrawer.openDrawer(view, data);
            container.subscribe((result: any) => {
                if (!result || !Object.is(result.ret, 'OK')) {
                    return;
                }
                if (!xData || !(xData.refresh instanceof Function)) {
                    return;
                }
                xData.refresh(result.datas);
            });
        }
        const view: any = {
            viewname: '${srffilepath2(dataview.getCodeName())}', 
            height: ${dataview.getHeight()?c}, 
            width: ${dataview.getWidth()?c},  
            title: '${dataview.title}', 
            placement: '${dataview.getOpenMode()}',
        };
        openDrawer(view, data);
        <#elseif dataview.getOpenMode() == 'POPOVER'>
        <#--  打开气泡卡片  -->
        const _this: any = this;
        if (_this.srfparentdata) {
            Object.assign(data, { srfparentdata: _this.srfparentdata });
        }
        const openPopOver = (view: any, data: any) => {
            let container: Subject<any> = this.$apppopover.openPop($event, view, data);
            container.subscribe((result: any) => {
                if (!result || !Object.is(result.ret, 'OK')) {
                    return;
                }
                if (!xData || !(xData.refresh instanceof Function)) {
                    return;
                }
                xData.refresh(result.datas);
            });
        }
        const view: any = {
            viewname: '${srffilepath2(dataview.getCodeName())}', 
            height: ${dataview.getHeight()?c}, 
            width: ${dataview.getWidth()?c},  
            title: '${dataview.title}', 
            placement: '${dataview.getOpenMode()}',
        };
        openPopOver(view, data);
        <#else>
        this.$Notice.warning({ title: '错误', desc: '${dataview.title} 不支持该模式打开' });
        </#if>
    <#else>
    this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
    </#if>
    }
    </#if>