UserList.cshtml 3.64 KB
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
    ViewData["title"] = "用户表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section header{

}

<div id="listForm" class="layui-tab-item layui-show">
    <table id="mainList" lay-filter="mainList"></table>
</div>


@section   Scripts{

    <script>
        let action = null,
            app=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(),
                sendData = null,
                areaName = "base",
                controllerName = "SysUser";

            action = {
              
                //所有动作成功之后
                actionSuccess: (falg) => {
                    u.refreshTable(app, u, null, falg);
                 }
            }

            app = {
                data: {
                    cols: [[
                        { field: "id", width: 80, hide: true, title: "Id" },
                        { field: "account", width: 150, title: "账号" },

                        { field: "name", width: 150, title: "用户名" },
                        { field: "phoneNumber", width: 150, title: "phoneNumber" },
                        { field: "facePicture", width: 150, title: "脸部图片" },
                        { field: "idcard", width: 150, title: "工卡" },
                        { field: "faceID", width: 150, hide: true, title: "脸部id" },

                        { field: "createTime", width: 150, title: "创建时间" },
                        { field: "createBy", width: 150, title: "创建用户" },
                        { field: "updateTime", width: 150, title: "更新时间" },
                        { field: "updateBy", width: 150, title: "更新用户" },
                        { field: "otherCode", width: 150, title: "外部编码" },
                        { field: "plmeid", width: 150, title: "plmeid" },
                        { field: "remarks", width: 150, title: "remarks" },
                    ]],
                    tableIns: null,
                    tableElem: "mainList",
                    //下拉框配置
                    selectOption: {
                       
                        //返回的数据 用于后续操作
                        selectData: {

                        }
                    }
                },
                methods: {
                    initTable: function () {
                        var teamCode = "".GetUrlParam("teamCode");
                        let options = {
                            elem: "#" + app.data.tableElem,
                            url: `/${areaName}/${controllerName}/LoadUserListByTeamCode`,
                            cols: sysU.columnRecord(app.data.tableElem, app.data.cols),
                            where: { teamCode: teamCode },
                        }
                        app.data.tableIns = sysU.initTable(options);
                    },

                    initSelectTable: function () {

                    },

                    initFrom() {
                        sysU.initSelect(app.data.selectOption);
                    }
                },
                registerEvent: function () {

                },
                init: function () {
                    app.methods.initTable();
                    app.methods.initFrom();
                    app.registerEvent();
                }
            };
            app.init();
        });
    </script>
}