linzhijie
2021-04-06 8728733ad60e1698bb6cf0fa2e428c28a6bffbe7
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('邮件模板配置')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-email_edit-add">
        <input th:type="hidden" id="id" name="id" th:value="${emailTemplate.id}">
        <!--测试者邀请邮件模板 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">[[#{jsp.exam.test_package.005}]]:</label>
            <div class="col-sm-8">
                <select name="inviteType" id="inviteType" class="form-control noselect2 selectpicker" th:with="type=${@dict.getType('lang_type')}" multiple>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"
                            th:selected="${dict.dictValue} eq 'Chinese' and ${emailTemplate.inviteCnTemplate} != null
                            or ${dict.dictValue} eq 'English' and ${emailTemplate.inviteUsTemplate} != null
                            or ${dict.dictValue} eq 'Thai' and ${emailTemplate.inviteThTemplate} != null ">
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group" id="inviteCnTemplateDiv" th:style="'display:' + @{(*{emailTemplate.inviteCnTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic124}]]:</label>
            <div class="col-sm-8">
                <textarea id="inviteCnTemplate" name="inviteCnTemplate" th:text="${emailTemplate.inviteCnTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="inviteUsTemplateDiv" th:style="'display:' + @{(*{emailTemplate.inviteUsTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic125}]]:</label>
            <div class="col-sm-8">
                <textarea id="inviteUsTemplate" name="inviteUsTemplate" th:text="${emailTemplate.inviteUsTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="inviteThTemplateDiv" th:style="'display:' + @{(*{emailTemplate.inviteThTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic126}]]:</label>
            <div class="col-sm-8">
                <textarea id="inviteThTemplate" name="inviteThTemplate" th:text="${emailTemplate.inviteThTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
 
 
        <!--HR邮件模板 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">[[#{jsp.exam.test_package.hrinvitationEmailContent}]]:</label>
            <div class="col-sm-8">
                <select name="hrType" id="hrType" class="form-control noselect2 selectpicker" th:with="type=${@dict.getType('lang_type')}" multiple>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"
                            th:selected="${dict.dictValue} eq 'Chinese' and ${emailTemplate.hrCnTemplate} != null
                            or ${dict.dictValue} eq 'English' and ${emailTemplate.hrUsTemplate} != null
                            or ${dict.dictValue} eq 'Thai' and ${emailTemplate.hrThTemplate} != null ">
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group" id="hrCnTemplateDiv" th:style="'display:' + @{(*{emailTemplate.hrCnTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic124}]]:</label>
            <div class="col-sm-8">
                <textarea id="hrCnTemplate" name="hrCnTemplate" th:text="${emailTemplate.hrCnTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="hrUsTemplateDiv" th:style="'display:' + @{(*{emailTemplate.hrUsTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic125}]]:</label>
            <div class="col-sm-8">
                <textarea id="hrUsTemplate" name="hrUsTemplate" th:text="${emailTemplate.hrUsTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="hrThTemplateDiv" th:style="'display:' + @{(*{emailTemplate.hrThTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic126}]]:</label>
            <div class="col-sm-8">
                <textarea id="hrThTemplate" name="hrThTemplate" th:text="${emailTemplate.hrThTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
 
        <!-- 测试者接收报告邮件 -->
        <div class="form-group">
            <label class="col-sm-3 control-label">[[#{jsp.exam.test_package.memberEmailContent}]]:</label>
            <div class="col-sm-8">
                <select name="memberType" id="memberType" class="form-control noselect2 selectpicker" th:with="type=${@dict.getType('lang_type')}" multiple>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}"
                            th:selected="${dict.dictValue} eq 'Chinese' and ${emailTemplate.memberCnTemplate} != null
                            or ${dict.dictValue} eq 'English' and ${emailTemplate.memberUsTemplate} != null
                            or ${dict.dictValue} eq 'Thai' and ${emailTemplate.memberThTemplate} != null ">
                </select>
            </div>
        </div>
        <div class="form-group" id="memberCnTemplateDiv" th:style="'display:' + @{(*{emailTemplate.memberCnTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic124}]]:</label>
            <div class="col-sm-8">
                <textarea id="memberCnTemplate" name="memberCnTemplate" th:text="${emailTemplate.memberCnTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="memberUsTemplateDiv" th:style="'display:' + @{(*{emailTemplate.memberUsTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic125}]]:</label>
            <div class="col-sm-8">
                <textarea id="memberUsTemplate" name="memberUsTemplate" th:text="${emailTemplate.memberUsTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
        <div class="form-group" id="memberThTemplateDiv" th:style="'display:' + @{(*{emailTemplate.memberThTemplate} ? 'block' : 'none')} + ''">
            <label class="col-sm-3 control-label">[[#{dict.ic126}]]:</label>
            <div class="col-sm-8">
                <textarea id="memberThTemplate" name="memberThTemplate" th:text="${emailTemplate.memberThTemplate}" class="form-control" rows="10" cols="60"></textarea>
            </div>
        </div>
 
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-select-js" />
<script type="text/javascript">
    var prefix = ctx + "exam/template"
    $("#form-email_edit-add").validate({
        focusCleanup: true
    });
 
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/emailEdit", $('#form-email_edit-add').serialize());
        }
    }
 
    $(function () {
        $.table.testPackDefault();
    });
 
    /**
     * 邀请测试者通知模板
     */
    $("#inviteType").change(function(){
        var opt = $("#inviteType").val();
        //没有选中
        if (opt != null){
            var Chinese = 0;
            var English = 0;
            var Thai = 0;
            //选中后拼接语言赋值模板
            for(var i = 0;i < opt.length;i++){
                if(opt[i] == 'Chinese'){
                    $('#inviteCnTemplateDiv').attr("style","display:block;");
                    Chinese = 1;
                }else if(opt[i] == 'English'){
                    $('#inviteUsTemplateDiv').attr("style","display:block;");
                    English = 1;
                }else if(opt[i] == 'Thai'){
                    $('#inviteThTemplateDiv').attr("style","display:block;");
                    Thai = 1;
                }
            }
            if(Chinese == 0){
                $('#inviteCnTemplateDiv').attr("style","display:none;");
            }
            if(English == 0){
                $('#inviteUsTemplateDiv').attr("style","display:none;");
            }
            if(Thai == 0){
                $('#inviteThTemplateDiv').attr("style","display:none;");
            }
        }else{
            $('#inviteCnTemplateDiv').attr("style","display:none;");
            $('#inviteUsTemplateDiv').attr("style","display:none;");
            $('#inviteThTemplateDiv').attr("style","display:none;");
        }
    });
 
    /**
     * HR通知模板
     */
    $("#hrType").change(function(){
        var opt = $("#hrType").val();
        //没有选中
        if (opt != null){
            var Chinese = 0;
            var English = 0;
            var Thai = 0;
            //选中后拼接语言赋值模板
            for(var i = 0;i < opt.length;i++){
                if(opt[i] == 'Chinese'){
                    $('#hrCnTemplateDiv').attr("style","display:block;");
                    Chinese = 1;
                }else if(opt[i] == 'English'){
                    $('#hrUsTemplateDiv').attr("style","display:block;");
                    English = 1;
                }else if(opt[i] == 'Thai'){
                    $('#hrThTemplateDiv').attr("style","display:block;");
                    Thai = 1;
                }
            }
            if(Chinese == 0){
                $('#hrCnTemplateDiv').attr("style","display:none;");
            }
            if(English == 0){
                $('#hrUsTemplateDiv').attr("style","display:none;");
            }
            if(Thai == 0){
                $('#hrThTemplateDiv').attr("style","display:none;");
            }
        }else{
            $('#hrCnTemplateDiv').attr("style","display:none;");
            $('#hrUsTemplateDiv').attr("style","display:none;");
            $('#hrThTemplateDiv').attr("style","display:none;");
        }
    });
 
    /**
     * 测试者通知模板
     */
    $("#memberType").change(function(){
        var opt = $("#memberType").val();
        //没有选中
        if (opt != null){
            var Chinese = 0;
            var English = 0;
            var Thai = 0;
            //选中后拼接语言赋值模板
            for(var i = 0;i < opt.length;i++){
                if(opt[i] == 'Chinese'){
                    $('#memberCnTemplateDiv').attr("style","display:block;");
                    Chinese = 1;
                }else if(opt[i] == 'English'){
                    $('#memberUsTemplateDiv').attr("style","display:block;");
                    English = 1;
                }else if(opt[i] == 'Thai'){
                    $('#memberThTemplateDiv').attr("style","display:block;");
                    Thai = 1;
                }
            }
            if(Chinese == 0){
                $('#memberCnTemplateDiv').attr("style","display:none;");
            }
            if(English == 0){
                $('#memberUsTemplateDiv').attr("style","display:none;");
            }
            if(Thai == 0){
                $('#memberThTemplateDiv').attr("style","display:none;");
            }
        }else{
            $('#memberCnTemplateDiv').attr("style","display:none;");
            $('#memberUsTemplateDiv').attr("style","display:none;");
            $('#memberThTemplateDiv').attr("style","display:none;");
        }
    });
</script>
</body>
</html>