ProjectOverview.js 2.64 KB
let action = null;
layui.config({
    base: "/js/",
    version: 1
}).use(['system'], function () {
    var form = layui.form,
        $ = layui.jquery,
        element = layui.element,
        table = layui.table,
        system = layui.system,
        sysU = new system.u(),
        sendDataWhere = null,
        sendDataDescWhere = null,
        areaName = "configure",
        controllerName = "BaseProject",
        projectId = 0,
        projectKeys = null,
        app = null;

    action = {

    }

    app = {
        data: {
           
        },
        methods: {
            initTable: function (opt) {
                var config = {};
                if (opt != undefined) $.extend(config, opt);
                let options = {
                    elem: "#" + app.data.tableElem,
                    url: `/${areaName}/${controllerName}/Load`,
                    cols: sysU.columnRecord(app.data.tableElem, app.data.cols),
                    toolbar: '#toolbarTable',
                    where: config,
                    //height: "full-56",//如果是主明细页签,列表主体高度要设置,否则分页导航不直观展示
                    doneExtend: function (res, obj) {
                        var pageFlag = "".GetUrlParam("page"),
                            userAccount = "".GetUrlParam("userAccount");
                        //加载用户绑定的客户
                        if (pageFlag == "sysuser") {
                            let ajaxConfig = {
                                data: { userAccount: userAccount },
                                url: `/base/SysUser/GetUserBindClient`,
                                success: function (result) {
                                    if (sysU.successBefore(result)) return false;
                                    var targetArrValue = result.Result.map(function (e) { return e.clientKeys; });
                                    var selectColKey = "".GetUrlParam("selectColKeyCustom");
                                    sysU.SetTableCheck(targetArrValue, res, selectColKey, app.data.tableElem);
                                }
                            };
                            sysU.ajax(ajaxConfig);
                        }
                    }
                }
                app.data.tableIns = sysU.initTable(options);
            },

            getUrlParam: function () {
                projectId = "".GetUrlParam("id");
                projectKeys = "".GetUrlParam("keys");
            },
        },
        registerEvent: function () {

        },
        init: function () {
            debugger
            app.methods.getUrlParam();
        }
    };
    app.init();
});