chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!--有变量名弹出框-->
<div id="wname" style="display:none; ">
    <div class="job_box_div">
        <div class="job_box_inp">
            <form class="layui-form">
                <table cellspacing='1' cellpadding='1' class="admin_examine_table">
                    <tr>
                        <th width="80">类别选择:</th>
                        <td>
                            <div class="layui-input-block">
                                <input name="ctype" lay-filter="ctype" value="1" title="一级分类" checked type="radio">
                                <input name="ctype" lay-filter="ctype" value="2" title="二级分类" type="radio">
                            </div>
                        </td>
                    </tr>
                    <tr class='sclass' style="display:none;">
                        <th>父类:</th>
                        <td>
                            <div class="layui-input-inline">
                                <select name="nid" lay-filter="nid" id="nid_val">
                                    <option value="0">请选择</option>
                                    {yun:}foreach item=v from=$position{/yun}
                                    <option value="{yun:}$v.id{/yun}">{yun:}$v.name{/yun}</option>
                                    {yun:}/foreach{/yun}
                                </select>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="t_fr">类别名称:</th>
                        <td>
                            <textarea id='position' class="add_class_textarea"></textarea>
                        </td>
                    </tr>
 
                    <tr class='variable'>
                        <th class="t_fr">调用变量名:</th>
                        <td>
                            <textarea id='variable' class="add_class_textarea"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <span class="admin_web_tip" style="padding-top: 0;">说明:可以添加多条分类(请按回车Enter键换行,一行一个)</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan='2' align="center"><input class="admin_examine_bth" type="button" value="添加 " onclick="save_class()" /></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
 
<!--有变量名弹出框end-->
<!--弹出框-->
<div id="bname" style="display:none;">
    <div class="job_box_div">
        <div class="job_box_inp">
            <form class="layui-form">
                <table cellspacing='1' cellpadding='1' class="admin_examine_table">
                    <tr>
                        <th width="80">类别选择:</th>
                        <td>
                            <div class="layui-input-block">
                                <input type="radio" name="btype" value="1" title="一级类别">
                                <input type="radio" name="btype" value="2" title="二级类别">
                            </div>
                        </td>
                    </tr>
                    <tr class='sclass_2 sclass_3  sclass' style="display:none;">
                        <th>一级分类:</th>
                        <td>
                            <div class="layui-input-block">
                                <div class="layui-input-inline">
                                    <select name="keyid" lay-filter="" id="keyid_val">
                                        <option value="">请选择</option>
                                        {yun:}foreach from=$position item=v{/yun}
                                        <option value="{yun:}$v.id{/yun}">{yun:}$v.name{/yun}</option>
                                        {yun:}/foreach{/yun}
                                    </select>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="t_fr">类别名称:</th>
                        <td>
                            <textarea id='classname' class="add_class_textarea"></textarea>
                            <span class="admin_web_tip">说明:可以添加多条分类(请按回车键换行,一行一个)</span>
                        </td>
                    </tr>
 
                    <tr>
                        <td colspan='2' align="center" class='ui_content_wrap'>
                            <input class="admin_examine_bth" type="button" value="添加 " onClick="save_bclass()" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<!--弹出框end-->
<script type="text/javascript">
    $(document).ready(function() {
        $(".imghide").hover(function() {
            $(this).find('.class_xg').show();
        }, function() {
            $(this).find('.class_xg').hide();
        });
    })
 
    $(document).ready(function() {
        $('body').click(function(evt) {
            if ($(evt.target).parents("#keyid_name").length == 0 && evt.target.id != "keyid_name") {
                $('#keyid_select').hide();
            }
        });
    })
 
    layui.use(['form'], function() {
        var form = layui.form,
            $ = layui.$;
 
        form.on('radio(ctype)', function(data) {
            if (data.value == 1) {
                $(".variable").show();
                $(".sclass").hide();
            } else if (data.value == 2) {
                $(".variable").hide();
                $(".sclass").show();
            }
        });
 
        $("input[name='btype']").each(function() {
            $(this).next().click(function() {
                var val = $(this).prev().val();
                $(".sclass").hide();
                $(".sclass_" + val).show();
            });
        });
    });
</script>