cy
2022-06-28 2ba5c891b24d4d0cd6ce7ef833592e4f576ee5e8
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
<!doctype html>
<html>
<head>
[#include "/business/wechat/include/title.html" /]
[#include "/business/wechat/include/wheader.html" /]
</head>
 
<body>
<header class="kltit"><div class="present"><a href="javascript:saveLinkKnow();">确定</a></div><a href="javascript:history.go(-1);" ><span></span></a>添加关联知识</header>
<div class="search-bg">
    <div class="search-box">
        <input type="text" placeholder="请输入知识标题" id="title" >
        <a href="javascript:query();"><span></span></a>
    </div>    
</div>
 
<div id="main"></div>
</body>
<script type="text/javascript">
function query() {
    var title = $.util.encode($.trim($("#title").val()));
    var param = {"title":title,"knowIds":"${knowIds}"};
    $.post("${base}/ewyw/ewKnowledge/ewLinkKnowData.html",param,function(data,textStatus) {
            $("#main").html(data);
    });
}
 
 
$(function() {
    query();
})
 
function saveLinkKnow(){
    var checkedBox = $(".item-foucs");
    if(checkedBox.length==0) {
        popupTips("请选择关联知识");
        return;
    }
    
    var knowsArray = new Array();
    checkedBox.each(function() {
        knowsArray.push($(this).find(".know").val());
    });
    var knows = knowsArray.join(",");
    $.post("${base}/ewyw/ewKnowledge/saveLinkKnow.html",{"knows":knows,"beforeKnows":"${knowIds}"},function(data,textStatus) {
        if(data=="1") {
            popupTips("关联成功");
            if('${type}' == 1){
                window.location.href = "${base}/ewyw/ewKnowledge/ewAddKnowledge.html";
            }else if('${type}' == 2){
                window.location.href = "${base}/ewyw/ewKnowledge/ewEditKnowledge.html?id=${id}&type=${type}";
            }else{
                window.location.href = "${base}/ewyw/ewKnowledge/ewEditShKnowledge.html?id=${id}&type=${type}";
            }
        } else {
            popupTips("关联失败");
        }
    })
}
 
</script>
</html>