自动化立体仓库 - WMS系统
#
LSH
2023-02-11 d35dd49decd2207b80b8c9410427d4ff25d3e3d0
src/main/webapp/static/js/role/role.js
@@ -3,14 +3,14 @@
var powerTreeData;
$(function (){
    $.ajax({
        url: "/power/list/auth",
        url: baseUrl+"/power/list/auth",
        headers: {'token': localStorage.getItem('token')},
        method: 'GET',
        success: function (res) {
            if (res.code === 200){
                powerTreeData = res.data;
            } else if (res.code === 403){
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            } else {
                layer.msg(res.msg)
            }
@@ -29,9 +29,10 @@
    tableIns = table.render({
        elem: '#role',
        headers: {token: localStorage.getItem('token')},
        url: '/role/list/auth',
        url: baseUrl+'/role/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
@@ -39,7 +40,7 @@
            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'code', align: 'center',title: '编码'}
            ,{field: 'name', align: 'center',title: '名称'}
            ,{field: 'leader$', align: 'center',title: '上级',event: 'leader', style: 'text-decoration: underline;cursor:pointer'}
            ,{field: 'leader$', align: 'center',title: '上级'}
            // ,{field: 'level$', align: 'center',title: '角色等级'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
@@ -61,7 +62,7 @@
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
@@ -83,7 +84,7 @@
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
@@ -128,7 +129,7 @@
                } else {
                    layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){
                        $.ajax({
                            url: "/role/delete/auth",
                            url: baseUrl+"/role/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {ids: ids},
                            method: 'POST',
@@ -138,7 +139,7 @@
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = "/";
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -148,7 +149,7 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', function(){
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
@@ -166,7 +167,7 @@
                        'fields': fields
                    };
                    $.ajax({
                        url: "/role/export/auth",
                        url: baseUrl+"/role/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
@@ -177,7 +178,7 @@
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = "/";
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
@@ -241,7 +242,7 @@
                       content: '../role/role_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: "/role/"+ param +"/auth",
                               url: baseUrl+"/role/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
@@ -292,7 +293,7 @@
        };
        $.ajax({
            url: "/role/edit/auth",
            url: baseUrl+"/role/edit/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
@@ -304,7 +305,7 @@
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
@@ -348,7 +349,7 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {