无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 * 跨城站点管理管理初始化
 */
var TSiteLock = {
    layerIndex: -1,
    validateFields: {
    }
};
 
/**
 * 关闭此对话框
 */
TSiteLock.close = function() {
    parent.layer.close(window.parent.TSite.layerIndex);
}
/**
 * 添加
 */
TSiteLock.add = function(id) {
    console.log("看看id");
    console.log(id)
    var startTime = $("#start-time").val().replace("T"," ");
    var endTime =   $("#end-time").val().replace("T"," ");
    data1 = {
        siteId:id,
        startTime:startTime,
        endTime:endTime
    };
    $.ajax({
        url: Feng.ctxPath + "/tSite/addSiteLock",
        type: "POST",
        contentType: "application/json", // 设置请求头的 Content-Type
        data: JSON.stringify(data1), // 将数据转换为 JSON 字符串
        success: function(response) {
            console.log("看看后端返回的id");
            console.log(response.data);
            var str = '<tr class="timeClass">' +
                '<td><span>' + startTime +'</span></td>' +
                '<td><span>' + endTime + '</span></td>' +
                '<td><button '+'id = '+response.data+' + onclick="TSiteLock.delete(this)">删除</button></td></tr>';
            $("#coun").append(str);
            Feng.success("锁定成功!");
        },
        error: function(xhr, status, error) {
            Feng.error("您的网络异常!");
        }
    });
}
/**
 * 删除
 */
TSiteLock.delete = function(e) {
    $(e).parent().parent().remove();
    $.ajax({
        url: Feng.ctxPath + "/tSite/deleteSiteLock/"+e.id,
        type: "POST",
        contentType: "application/json", // 设置请求头的 Content-Type
        success: function(response) {
            Feng.success("删除成功!");
            TSite.search();
        },
        error: function(xhr, status, error) {
            var errorMessage = xhr.responseText ? xhr.responseText : "删除失败!";
            Feng.error("您的网络异常!");
        }
    });
}
 
 
function UploadFileFn(){
    $('#upFile').click();
}
 
 
$(function () {
 
 
 
});