src/ZKEACMS.WebHost/wwwroot/js/list-editor.js

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*! http://www.zkea.net/
 * Copyright (c) ZKEASOFT. All rights reserved.
 * http://www.zkea.net/licenses */

$(function () {
    $("input,select,textarea", ".input-group-collection .Template").each(function () {
        if (!$(this).prop("disabled")) {
            $(this).prop("disabled", true);
            $(this).attr("editable", true);
        }
    });

    $(document).on("click", ".input-group-collection .add", function () {
        var index = $(this).siblings(".items").children(".item").size();
        var tpl = $(this).siblings(".Template");
        var template = $(tpl.html());
        var namePrefix = tpl.children().data("name");
        var deep = 0;
        namePrefix.replace(/\[(\d+)\]/g, function (a) {
            deep++;
            return a;
        });
        $("input,select,textarea", template).attr("data-val", true).each(function () {
            if ($(this).attr("editable")) {
                $(this).prop("disabled", false);
                $(this).removeAttr("editable");
            }
            var name = $(this).attr("name");
            if (name) {
                var cuDeep = 0;
                $(this).attr("name", name.replace(/\[(\d+)\]/g, function (a) {
                    cuDeep++;
                    var idx = cuDeep == deep ? "[" + index + "]" : a;
                    return idx;
                }));
            }
            var id = $(this).attr("id");
            if (id) {
                var cuDeep = 0;
                $(this).attr("id", id.replace(/\_(\d+)\_/g, function (a) {
                    cuDeep++;
                    var idx = cuDeep == deep ? "_" + index + "_" : a;
                    return idx;
                }));
            }

            if ($(this).hasClass("Date") && !$(this).prop("readonly") && !$(this).prop("disabled") && $.fn.datetimepicker) {
                $(this).datetimepicker({ locale: "zh-CN", format: $(this).attr("JsDateFormat") });
            }
        });

        $("label", template).each(function () {
            var id = $(this).attr("for");
            if (id) {
                var cuDeep = 0;
                $(this).attr("for", id.replace(/\_(\d+)\_/g, function (a) {
                    cuDeep++;
                    var idx = cuDeep == deep ? "_" + index + "_" : a;
                    return idx;
                }));
后面还有 97 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。