LOGIC.tsx.ftl 855 字节
Newer Older
yanshaowei's avatar
yanshaowei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    /**
     * ${item.getCaption()}
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof ${srfclassname('${view.name}')}
     */
    public ${item.getFullCodeName()}(args: any[], params?: any, $event?: any, xData?: any) {
        // 界面行为容器对象 _this
        const _this: any = this;
        if (xData && xData.save instanceof Function) {
            const _data = { srfparentdata: _this.srfparentdata };
            xData.save(_data).then((response: any) => {
                if (!response || response.status !== 200) {
                    return;
                }
                _this.$emit('viewdataschange', [{ ...response.data }]);
            });
        } else if (_this.save && _this.save instanceof Function) {
            _this.save();
        }
    }