puzhibing
2023-07-30 03a4584d7d58fc073649a3ef821e1b2ebc0ed6cb
management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent.js
@@ -39,13 +39,7 @@
                }},
        {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
            formatter: function (value, row) {
                if (row.status === 1){
                    return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:red">停用</a>' +'&nbsp;' +
                        '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>'
                }else if (row.status === 2){
                    return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:green">解冻</a>' +'&nbsp;' +
                        '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>'
                }
                return '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>'
            }
        }
    ];
@@ -80,6 +74,54 @@
    this.layerIndex = index;
};
TAgent.openUpdateTAgent = function(){
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '编辑',
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id
        });
        this.layerIndex = index;
    }
}
TAgent.stop = function(){
    if(this.check()){
        var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) {
            Feng.success("修改成功!");
            TAgent.table.refresh();
        }, function (data) {
            Feng.error("修改失败!" + data.responseJSON.message + "!");
        });
        ajax.set("id", TAgent.seItem.id);
        ajax.set("status", 1);
        ajax.start();
    }
}
TAgent.start = function(){
    if(this.check()){
        var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) {
            Feng.success("修改成功!");
            TAgent.table.refresh();
        }, function (data) {
            Feng.error("修改失败!" + data.responseJSON.message + "!");
        });
        ajax.set("id", TAgent.seItem.id);
        ajax.set("status", 2);
        ajax.start();
    }
}
/**
 * 提交启用冻结
 */
@@ -110,22 +152,6 @@
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TAgent.openTAgentDetail = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 打开区域选择页面