当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript service.IdlService.create方法代码示例

本文整理汇总了TypeScript中@eg/core/idl.service.IdlService.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.IdlService.create方法的具体用法?TypeScript service.IdlService.create怎么用?TypeScript service.IdlService.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@eg/core/idl.service.IdlService的用法示例。


在下文中一共展示了service.IdlService.create方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype(this.bucketType);

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                // make it find-able to the queue-add method which
                // requires the bucket name.
                bucket.id(bktId);
                this.buckets.push(bucket);
                this.addToBucket(bktId);
            }
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:26,代码来源:record-bucket-dialog.component.ts

示例2:

        this.createNew = () => {

            const part = this.idl.create('bmp');
            part.record(this.recId);
            this.editDialog.record = part;

            this.editDialog.mode = 'create';
            this.editDialog.open().then(
                ok => this.partsGrid.reload(),
                err => {}
            );
        };
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:12,代码来源:parts.component.ts

示例3: fetchHold

    fetchHold() {
        this.hold = null;

        if (this.holdIds.length === 0) {
            return;

        } else if (this.isBatch()) {
            // Use a dummy hold to store form values.
            this.hold = this.idl.create('ahr');

        } else {
            // Form values are stored in the one hold we're editing.
            this.pcrud.retrieve('ahr', this.holdIds[0])
            .subscribe(hold => this.hold = hold);
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:16,代码来源:manage.component.ts

示例4: addToBucket

 // Add the record to the selected existing bucket
 addToBucket(id: number) {
     const item = this.idl.create('cbrebi');
     item.bucket(id);
     item.target_biblio_record_entry(this.recId);
     this.net.request(
         'open-ils.actor',
         'open-ils.actor.container.item.create',
         this.auth.token(), 'biblio', item
     ).subscribe(resp => {
         const evt = this.evt.parse(resp);
         if (evt) {
             this.toast.danger(evt.toString());
         } else {
             this.close();
         }
     });
 }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:18,代码来源:record-bucket-dialog.component.ts

示例5: addRootNode

    // When creating a new tree, add a stub boolean node
    // as the root so the tree has something to render.
    addRootNode() {

        const point = this.idl.create('vmsp');
        point.id(this.newId--);
        point.isnew(true);
        point.match_set(this.matchSet_.id());
        point.children([]);
        point.bool_op('AND');

        const node: TreeNode = new TreeNode({
            id: point.id(),
            callerData: {point: point}
        });

        this.tree = new Tree(node);
        this.setNodeLabel(node, point);
    }
开发者ID:evergreen-library-system,项目名称:Evergreen,代码行数:19,代码来源:match-set-expression.component.ts

示例6: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype('staff_client');

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                this.addToBucket(bktId);
            }
        });
    }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:22,代码来源:record-bucket-dialog.component.ts

示例7: addChildNode

    addChildNode() {
        this.changesMade = true;

        const pnode = this.tree.selectedNode();
        const point = this.idl.create('vmsp');
        point.id(this.newId--);
        point.isnew(true);
        point.parent(pnode.id);
        point.match_set(this.matchSet_.id());
        point.children([]);

        const ptype = this.newPoint.values.pointType;

        if (ptype === 'bool') {
            point.bool_op(this.newPoint.values.boolOp);

        } else {

            if (ptype === 'attr') {
                point.svf(this.newPoint.values.recordAttr);

            } else if (ptype === 'marc') {
                point.tag(this.newPoint.values.marcTag);
                point.subfield(this.newPoint.values.marcSf);
            } else if (ptype === 'heading') {
                point.heading(true);
            }

            point.negate(this.newPoint.values.negate);
            point.quality(this.newPoint.values.matchScore);
        }

        const node: TreeNode = new TreeNode({
            id: point.id(),
            callerData: {point: point}
        });

        // Match points are added to the DB only when the tree is saved.
        this.setNodeLabel(node, point).then(() => pnode.children.push(node));
    }
开发者ID:evergreen-library-system,项目名称:Evergreen,代码行数:40,代码来源:match-set-expression.component.ts

示例8: translate

    translate() {
        if (!this.translatedValue) { return; }

        let entry;

        if (this.existingTranslation) {
            entry = this.existingTranslation;
            entry.string(this.translatedValue);

            this.pcrud.update(entry).toPromise().then(
                ok => {
                    if (!this.nextString) {
                        this.close('Translation updated');
                    }
                },
                err => console.error(err)
            );

            return;
        }

        entry = this.idl.create('i18n');
        entry.fq_field(this.fqField());
        entry.identity_value(this.identValue());
        entry.translation(this.selectedLocale);
        entry.string(this.translatedValue);

        this.pcrud.create(entry).toPromise().then(
            ok => {
                if (!this.nextString) {
                    this.close('Translation created');
                }
            },
            err => console.error('Translation creation failed')
        );
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:36,代码来源:translate.component.ts

示例9: addQuality

    addQuality() {
        const quality = this.idl.create('vmsq');
        const values = this.newPoint.values;

        quality.match_set(this.matchSet_.id());
        quality.quality(values.matchScore);
        quality.value(values.value);

        if (values.recordAttr) {
            quality.svf(values.recordAttr);
        } else {
            quality.tag(values.marcTag);
            quality.subfield(values.marcSf);
        }

        this.pcrud.create(quality).subscribe(
            ok  => console.debug('created ', ok),
            err => console.error(err),
            ()  => {
                this.newPointType = null;
                this.grid.reload();
            }
        );
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:24,代码来源:match-set-quality.component.ts

示例10:

 this.recIds.forEach(recId => {
     const item = this.idl.create('cbrebi');
     item.bucket(bucketId);
     item.target_biblio_record_entry(recId);
     items.push(item);
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:6,代码来源:record-bucket-dialog.component.ts


注:本文中的@eg/core/idl.service.IdlService.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。