• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript store.service.StoreService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@eg/core/store.service.StoreService的典型用法代码示例。如果您正苦于以下问题:TypeScript service.StoreService类的具体用法?TypeScript service.StoreService怎么用?TypeScript service.StoreService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: ngOnInit

    ngOnInit() {
        this.searchContext = this.staffCat.searchContext;

        this.defaultTab =
            this.store.getLocalItem('eg.cat.default_record_tab')
            || 'catalog';

        // Watch for URL record ID changes
        // This includes the initial route.
        // When applying the default configured tab, no navigation occurs
        // to apply the tab name to the URL, it displays as the default.
        // This is done so no intermediate redirect is required, which
        // messes with browser back/forward navigation.
        this.route.paramMap.subscribe((params: ParamMap) => {
            this.recordTab = params.get('tab');
            this.recordId = +params.get('id');
            this.searchContext = this.staffCat.searchContext;

            if (!this.recordTab) {
                this.recordTab = this.defaultTab || 'catalog';
            }

            this.loadRecord();
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:25,代码来源:record.component.ts


示例2: open

    async open(args: NgbModalOptions): Promise<boolean> {
        this.holdIds = [].concat(this.holdIds); // array-ify ints

        this.transferTarget =
            this.store.getLocalItem('eg.circ.hold.title_transfer_target');

        if (!this.transferTarget) {
            this.toast.warning(await this.targetNeeded.current());
            return Promise.reject('Transfer Target Required');
        }

        return super.open(args);
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:13,代码来源:transfer-dialog.component.ts


示例3: reprintLast

    reprintLast() {
        const prev = this.store.getLocalItem('eg.print.last_printed');

        if (prev) {
            const req: PrintRequest = {
                text: prev.content,
                printContext: prev.context || 'default',
                contentType: prev.content_type || 'text/html',
                showDialog: Boolean(prev.show_dialog)
            };

            this.print(req);
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:14,代码来源:print.service.ts


示例4: getRecordIds

    // TODO: Add server-side API for sorting a set of bibs by ID.
    // See EGCatLoader/Container::fetch_mylist
    getRecordIds(): Promise<number[]> {
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);
        this.idList = [];

        if (!cacheKey) { return Promise.resolve(this.idList); }

        return this.anonCache.getItem(cacheKey, BASKET_CACHE_ATTR).then(
            list => {
                if (!list) { return this.idList; }
                this.idList = list.map(id => Number(id));
                return this.idList;
            }
        );
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:16,代码来源:basket.service.ts


示例5: setRecordIds

    setRecordIds(ids: number[]): Promise<number[]> {
        this.idList = ids;

        // If we have no cache key, that's OK, assume this is the first
        // attempt at adding a value and let the server create the cache
        // key for us, then store the value in our cookie.
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);

        return this.anonCache.setItem(cacheKey, BASKET_CACHE_ATTR, this.idList)
        .then(key => {
            this.store.setLoginSessionItem(BASKET_CACHE_KEY_COOKIE, key);
            this.onChange.emit(this.idList);
            return this.idList;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:15,代码来源:basket.service.ts


示例6: dispatchPrint

    dispatchPrint(printReq: PrintRequest) {

        if (!printReq.text) {
            // Sometimes the results come from an externally-parsed HTML
            // template, other times they come from an in-page template.
            printReq.text = this.elm.nativeElement.innerHTML;
        }

        // Retain a copy of each printed document in localStorage
        // so it may be reprinted.
        this.store.setLocalItem('eg.print.last_printed', {
            content: printReq.text,
            context: printReq.printContext,
            content_type: printReq.contentType,
            show_dialog: printReq.showDialog
        });

        if (this.useHatch()) {
            this.printViaHatch(printReq);
        } else {
            // Here the needed HTML is already in the page.
            window.print();
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:24,代码来源:print.component.ts


示例7: useHatch

 useHatch(): boolean {
     return this.store.getLocalItem('eg.hatch.enable.printing')
         && this.hatch.connect();
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:4,代码来源:print.component.ts


示例8:

 .then(key => {
     this.store.setLoginSessionItem(BASKET_CACHE_KEY_COOKIE, key);
     this.onChange.emit(this.idList);
     return this.idList;
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:5,代码来源:basket.service.ts


示例9: setDefaultTab

 setDefaultTab() {
     this.defaultTab = this.recordTab;
     this.store.setLocalItem('eg.cat.default_record_tab', this.recordTab);
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:4,代码来源:record.component.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap