zhanmingkan
2022-05-17 ad3562d25c2bcb4044ba631bd91d20703ab3bfe7
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
//获取全部
function getTagAll(){
    $.ajax({
        type : "post",
        url : "../../easyAPI/tag/getTag.action",
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            showTags(data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("获取标签信息失败!");
        }
    });
}
//根据id删除
function deleteTagById(tagId){
    $.ajax({
        type : "post",
        url : "../../easyAPI/tag/delete.action",
        data : "tagId="+tagId,
        success : function(data) {
            if (data == 1) {
                clearTags();
                getTagAll();
            }else{
                console.log("删除标签失败!");
            };
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("删除标签失败!");
        }
    });
}
//插入标签
function insertTag(obj){
    var args = JSON.stringify(obj);
    $.ajax({
        type : "post",
        url : "../../easyAPI/tag/insert.action",
        data : args,
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            if(data == 1){
                getTagAll();
            }else{
                console.log("保存失败!");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("ajax请求失败!");
        }
    });
}