wzp
2021-09-16 f73f7f06ed1cbdca4a1d7c127ca89829b6f2433c
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<%@ Page Language="C#" masterpagefile="~/Main.master"  AutoEventWireup="true" CodeFile="GwStrategyUpdate.aspx.cs" Inherits="_GwStrategyUpdate" %>
 
 
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <form name="Form_ID" method="post" action="GwStrategyUpdate.aspx" id="Form_ID" enctype="multipart/form-data">
    <%if (Action == "edit")
      {%>
    <input type="hidden" name="action" value="editDeal" id="action" />
    <%}
      else
      { %>
    <input type="hidden" name="action" value="addDeal" id="action" />
    <%} %>
    <div class="editCanvas">
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th colspan="4">
                        <%if (Action == "edit")
                          { %>修改<%}
                          else
                          { %>添加<%} %>
                        拦截策略
                    </th>
                </tr>
            </thead>
            <%if (Action == "edit")
              { %>
            <tr>
                <th>
                    策略名称:
                    <input type="hidden" name="StrategyId" id="StrategyId" maxlength="50" value="<%= GwStrategy.StrategyId%>" />
                </th>
                <td>
                    <input type="text" name="StrategyName" id="StrategyName" style="width: 400px" maxlength="100"
                        value="<%= GwStrategy.StrategyName %>" />
                    <span class="highlight">*</span>
                </td>
            </tr>
            <%}
              else
              {%>
            <tr>
                <th>
                    策略名称:
                </th>
                <td colspan="3">
                    <input type="text" name="StrategyName" id="StrategyName" style="width: 400px" maxlength="100"
                        value="<%= GwStrategy.StrategyName %>" />
                    <span class="highlight">*</span>
                </td>
            </tr>
            <%} %>
            <tr>
                <th style="word-wrap: break-word; word-break: break-all">
                    关键词列表
                    <br />
                    每行一个关键字
                </th>
                <td colspan="3">
                    <textarea style="width: 99%; height: 80%;" cols="100" rows="20" name="WordList" id="WordList"><%= GwStrategy.WordList %></textarea><span
                        class="highlight">*</span>
                </td>
            </tr>
            <tr>
                <th>
                    关键词测试
                </th>
                <td colspan="3">
                    <div id="result-box">
                    </div>
                    <div id="match-box">
                        <input value="" name="SrcContent" type="text" id="SrcContent" maxlength="200" style="width: 600px;" />
                        <a href="javascript:;" id="MatchButton" style="background-color: #009900; color: #FFFFFF;
                            text-align: center; width: 60px; padding: 5px; display: inline-block; border: 1px solid #666;">
                            测试</a>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                </th>
                <td colspan="3">
                    <input class="btn btn-primary" value="保  存" type="submit" />
                    <input class="btn btn-primary" value="返  回" onclick="history.back();" type="button" />
                </td>
            </tr>
        </table>
    </div>
    </form>
    <script>
        $(function () {
            $("textarea").numberedtextarea();
 
            $("#MatchButton").on("click", function () {
                var wordList = $("#WordList").val();
                var srcContent = $("#SrcContent").val();
 
                $.ajax({
                    url: "gwstrategy.ashx",
                    method: "POST",
                    data: { wordList: wordList, srcContent: srcContent },
                    success: function (result) {
                        if (result.OK) {
                            $("#result-box").text(result.Message);
                        }
                    },
                    error: function (result) {
                        alert(result);
                    }
                });
            });
        });
        
    </script>
</asp:Content>