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

TypeScript lang.mixin函数代码示例

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

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



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

示例1: function

    update: function (request, appData) {
        this._assertHasWuid();
        lang.mixin(request, {
            Wuid: this.Wuid
        });
        lang.mixin(request, {
            StateOrig: this.State,
            JobnameOrig: this.Jobname,
            DescriptionOrig: this.Description,
            ProtectedOrig: this.Protected,
            ScopeOrig: this.Scope,
            ClusterOrig: this.Cluster,
            ApplicationValues: appData
        });

        var context = this;
        WsWorkunits.WUUpdate({
            request: request,
            load: function (response) {
                if (lang.exists("Exceptions.Exception", response)) {
                    dojo.publish("hpcc/brToaster", {
                        message: "<h4>" + response.Exceptions.Source + "</h4>" + "<p>" + response.Exceptions.Exception[0].Message + "</p>",
                        type: "error",
                        duration: -1
                    });
                } else {
                    context.updateData(response.WUUpdateResponse.Workunit);
                }
                context.onUpdate();
            }
        });
    },
开发者ID:Michael-Gardner,项目名称:HPCC-Platform,代码行数:32,代码来源:ESPWorkunit.ts


示例2: Grid

export function Grid(pagination?, selection?, overrides?) {
    var baseClass = [];
    var params = {};
    if (pagination) {
        baseClass = [DGrid, Pagination, ColumnResizer, Keyboard, DijitRegistry];
        lang.mixin(params, {
            rowsPerPage: 50,
            pagingLinks: 1,
            pagingTextBox: true,
            firstLastArrows: true,
            pageSizeOptions: [25, 50, 100, 1000]
        });
    } else {
        baseClass = [OnDemandGrid, ColumnResizer, Keyboard, DijitRegistry];
    }
    if (selection) {
        baseClass.push(Selection);
        lang.mixin(params, {
            allowSelectAll: true,
            deselectOnRefresh: false
        });
    }
    baseClass.push(GridHelper);
    return declare(baseClass, lang.mixin(params, overrides));
}
开发者ID:Michael-Gardner,项目名称:HPCC-Platform,代码行数:25,代码来源:ESPUtil.ts


示例3: function

 arrayUtil.forEach(response.BasednsResponse.Basedns.Basedn, function (item, idx) {
     data.push(lang.mixin(item, {
         __hpcc_type: "Permission",
         __hpcc_id: item.basedn,
         DisplayName: item.name,
         children: lang.mixin(CreateResourcesStore(this.groupname, this.username, item.basedn), {
             parent: this,
             parentRow: item
         })
     }));
 }, this);
开发者ID:GordonSmith,项目名称:HPCC-Platform,代码行数:11,代码来源:ws_access.ts


示例4: function

 preProcessRow: function (row) {
     lang.mixin(row, {
         OS: row.Linux === "true" ? 2 : 0
     });
     lang.mixin(row, {
         calculatedID: row.Path + "_" + row.Name,
         displayName: row.Name,
         type: "dropzone",
         fullPath: row.Path + (row.Path && !this.endsWith(row.Path, "/") ? "/" : ""),
         DropZone: row
     });
 },
开发者ID:richardkchapman,项目名称:HPCC-Platform,代码行数:12,代码来源:FileSpray.ts


示例5: _send

    _send(service, action, _params) {
        var params = lang.mixin({
            request: {},
            load: function (response) {
            },
            error: function (error) {
            },
            event: function (evt) {
            }
        }, _params);
        lang.mixin(params.request, {
            rawxml_: true
        });

        var handleAs = params.handleAs ? params.handleAs : "json";
        var postfix = "";
        if (handleAs === "json") {
            postfix = ".json";
        }
        // var method = params.method ? params.method : "get";

        var retVal = null;
        if (this.isCrossSite()) {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), type: "jsonp" });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        } else {
            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service) });
            retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
        }

        return retVal.then(function (response) {
            if (lang.exists("Exceptions.Exception", response)) {
                if (response.Exceptions.Exception.Code === "401") {
                    if (cookie("Status") === "Unlocked") {
                        topic.publish("hpcc/session_management_status", {
                            status: "DoIdle"
                        });
                    }
                    cookie("Status", "Locked");
                    ESPUtil.LocalStorage.removeItem("Status");
                }
            }
            params.load(response);
            return response;
        }).catch(function (error) {
            params.error(error);
            return error;
        });
    }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:49,代码来源:ESPRequest.ts


示例6: function

    preProcessRow: function (item, request, query, options) {
        var context = this;
        var ErrorCount = 0;
        var StatusMessage;
        var MixedNodeStates;
        item[this.idProperty] = item.QuerySetId + ":" + item.Id;
        if (lang.exists("Clusters", item)) {
            arrayUtil.some(item.Clusters.ClusterQueryState, function (cqs, idx) {
                if (lang.exists("Errors", cqs) && cqs.Errors || cqs.State !== "Available") {
                    ErrorCount++;
                    StatusMessage = context.i18n.SuspendedByCluster;
                    return false;
                }
                if (lang.exists("MixedNodeStates", cqs) && cqs.MixedNodeStates === true) {
                    StatusMessage = context.i18n.MixedNodeStates;
                    MixedNodeStates = true;
                }
            });
        }
        if (item.Suspended === true) {
            StatusMessage = this.i18n.SuspendedByUser;
        }

        lang.mixin(item, {
            ErrorCount: ErrorCount,
            Status: StatusMessage,
            MixedNodeStates: MixedNodeStates
        });
    }
开发者ID:richardkchapman,项目名称:HPCC-Platform,代码行数:29,代码来源:ESPQuery.ts


示例7: function

    query: function (query, options) {
        var deferredResults = new Deferred();
        deferredResults.total = new Deferred();

        function nextItem(itemParts) {
            var part = "";
            while (itemParts.length && part.trim() === "") {
                part = itemParts[0]; itemParts.shift();
            }
            return part;
        }

        if (!query.Name) {
            deferredResults.resolve([]);
            deferredResults.total.resolve(0);
        } else {
            TpLogFile({
                request: lang.mixin({}, query, {
                    PageNumber: options.start / options.count
                })
            }).then(lang.hitch(this, function (response) {
                var data = [];
                if (lang.exists("TpLogFileResponse.LogData", response)) {
                    this.lastPage = response.TpLogFileResponse.LogData;
                    this.emit("pageLoaded", this.lastPage);
                    arrayUtil.forEach(response.TpLogFileResponse.LogData.split("\n"), function (item, idx) {
                        if (options.start === 0 || idx > 0) {
                            //  Throw away first line as it will probably only be a partial line  ---
                            var itemParts = item.split(" ");
                            var lineNo, date, time, pid, tid, details;
                            if (itemParts.length) lineNo = nextItem(itemParts);
                            if (itemParts.length) date = nextItem(itemParts);
                            if (itemParts.length) time = nextItem(itemParts);
                            if (itemParts.length) pid = nextItem(itemParts);
                            if (itemParts.length) tid = nextItem(itemParts);
                            if (itemParts.length) details = itemParts.join(" ");
                            data.push({
                                __hpcc_id: response.TpLogFileResponse.PageNumber + "_" + idx,
                                lineNo: lineNo,
                                date: date,
                                time: time,
                                pid: pid,
                                tid: tid,
                                details: details
                            });
                        }
                    }, this);
                }
                this.setData(data);
                if (lang.exists("TpLogFileResponse.TotalPages", response)) {
                    deferredResults.total.resolve(response.TpLogFileResponse.TotalPages * options.count);
                } else {
                    deferredResults.total.resolve(data.length);
                }
                return deferredResults.resolve(this.data);
            }));
        }

        return QueryResults(deferredResults);
    }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:60,代码来源:WsTopology.ts


示例8: function

 setBanner: function (request) {
     lang.mixin(request, {
         FromSubmitBtn: true,
         BannerAction: request.BannerAction ? 1 : 0,
         EnableChatURL: 0
     });
     this.getActivity(request);
 },
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:8,代码来源:ESPActivity.ts


示例9: function

 preProcessRow: function (item, request, query, options) {
     lang.mixin(item, {
         __hpcc_id: createID(item.NodeGroup, item.Name),
         __hpcc_isDir: false,
         __hpcc_displayName: item.Name,
         StateID: 0,
         State: ""
     });
 },
开发者ID:richardkchapman,项目名称:HPCC-Platform,代码行数:9,代码来源:ESPLogicalFile.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript cookie.cookie函数代码示例发布时间:2022-05-25
下一篇:
TypeScript lang.hitch函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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