LOGIC.vue.ftl 1.4 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 17 18 19 20
        if (args.length === 0) {
            return;
        }
        const _this: any = this;
        if (_this.newdata && _this.newdata instanceof Function) {
            const data: any = {};
            if (args.length > 0) {
                Object.assign(data, { srfsourcekey: args[0].srfkey })
tony001's avatar
tony001 committed
21
                actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
22
            }
23
            _this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
24 25
        } else if (xData && xData.copy instanceof Function) {
            if (args.length > 0) {
tony001's avatar
tony001 committed
26
                actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
27
            }
tony001's avatar
tony001 committed
28
            xData.copy(args[0].srfkey);
29 30 31 32
        } else {
            _this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
        }
    }