Browse Source

Merge branch 'Next'

XMTT 7 years ago
parent
commit
1284e76a95

+ 116 - 0
css/model/sys/professornew.css

@ -31,3 +31,119 @@
31 31
    height: 250px;
32 32
    padding: 0 20px 10px;
33 33
}
34
35
.sys_professornew_details{
36
    width: 800px;
37
    height: 600px;
38
    padding: 0 20px 10px;
39
}
40
41
.sys_professornew_details .requiredSpan, .sys_professornew_honor .requiredSpan,
42
.sys_professornew_project .requiredSpan, .sys_professornew_job .requiredSpan,
43
.sys_professornew_edu .requiredSpan{
44
    color: #ff0000;
45
    position:relative;
46
    top:6px;
47
    left: -4px;
48
49
}
50
51
.sys_professornew_details .citybox .frmtype {
52
    border: 1px solid #B5B5B5;
53
}
54
55
.sys_professornew_details .citybox span {
56
    position: relative;
57
    width: 96%;
58
    display: inline-block;
59
    padding: 0 0 0 6px;
60
    cursor: pointer;
61
    margin: 0;
62
    background: #fff;
63
}
64
65
.sys_professornew_details .citybox span .mr_show.mr_select {
66
    color: #333;
67
}
68
69
.sys_professornew_details .citybox span .mr_show{
70
    font-style: normal;
71
    color: #AAAAAA;
72
    width: 100%;
73
    display: inline-block;
74
    height: 32px;
75
    line-height: 32px;
76
    position: relative;
77
}
78
79
.sys_professornew_details .citybox span .mr_show .mr_select {
80
    color: #333;
81
}
82
83
.sys_professornew_details .citybox span .mr_sj {
84
    position: absolute;
85
    right: 10px;
86
    top: 15px;
87
    display: inline-block;
88
    height: 0;
89
    width: 0;
90
    border: 6px solid #fff;
91
    border-color: #28b8fa transparent transparent;
92
}
93
94
.sys_professornew_details .citybox span ul {
95
    width: 98%;
96
    border-radius: 0 0 5px 5px;
97
    position: absolute;
98
    border: 1px solid #E8E8E8;
99
    background: #fff;
100
    left: -1px;
101
    top: 38px;
102
    margin-bottom: 10px;
103
    display: none;
104
    z-index: 10;
105
    max-height: 280px;
106
    overflow: auto;
107
}
108
109
.sys_professornew_details .citybox span ul li{
110
    width: 100%;
111
    float: left;
112
    overflow: hidden;
113
    border-top: 1px solid #E8E8E8;
114
}
115
116
.sys_professornew_details .citybox span ul li:first-child {
117
    border-top: 0;
118
}
119
120
.sys_professornew_details .citybox span ul li a {
121
    display: block;
122
    height: 30px;
123
    line-height: 30px;
124
    padding: 0 8px;
125
    color: #494949;
126
}
127
128
.sys_professornew_details .orgSize.dyn-mselect .icon-drop {
129
    display: none !important;
130
}
131
132
.sys_professornew_details .orgSize.dyn-mselect .dd-drop {
133
    display: none !important;
134
}
135
136
.sys_professornew_details .orgSize.dyn-mselect .placeholder {
137
    display: none !important;
138
}
139
140
.sys_professornew_project ,.sys_professornew_honor,.sys_professornew_job,.sys_professornew_edu{
141
    width: 600px;
142
    padding: 0 20px 10px;
143
}
144
.sys_professornew_project ,.sys_professornew_honor{
145
    height: 350px;
146
}
147
.sys_professornew_job,.sys_professornew_edu{
148
    height: 470px;
149
}

+ 264 - 0
html/model/sys/professornew/details.html

@ -0,0 +1,264 @@
1
<div class="sys_professornew_details centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">专家姓名</div>
8
            <div class="col-4">
9
                <div class="form-item text required readOnly" placeholder="姓名最长为10个字" name="name"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption">职称</div>
15
            <div class="col-4">
16
                <div class="form-item text" placeholder="职称不得超过20个字" name="title"></div>
17
            </div>
18
            <div class="col-2 item-caption">职位</div>
19
            <div class="col-4">
20
                <div class="form-item text" placeholder="职位不得超过20个字" name="office"></div>
21
            </div>
22
        </div>
23
        <div class="row">
24
            <div class="col-2 item-caption">所在机构</div>
25
            <div class="col-4">
26
                <div class="form-item text" placeholder="所在机构不得超过50个字" name="orgName"></div>
27
            </div>
28
            <div class="col-2 item-caption">所属部门</div>
29
            <div class="col-4">
30
                <div class="form-item text" placeholder="所在部门不得超过20个字" name="department"></div>
31
            </div>
32
        </div>
33
        <div class="row me">
34
            <div class="col-2 item-caption">联系电话</div>
35
            <div class="col-4">
36
                <div class="form-item text" placeholder="联系电话不得超过50个字" name="phone"></div>
37
            </div>
38
            <div class="col-2 item-caption">联系邮箱</div>
39
            <div class="col-4">
40
                <div class="form-item text" defVal="" name="email"></div>
41
            </div>
42
        </div>
43
        <div class="row me">
44
            <div class="col-2 item-caption">注册电话</div>
45
            <div class="col-4">
46
                <div class="form-item text readOnly" placeholder="联系电话不得超过50个字" name="loginPhone"></div>
47
            </div>
48
            <div class="col-2 item-caption">注册邮箱</div>
49
            <div class="col-4">
50
                <div class="form-item text readOnly" defVal="" name="loginEmail"></div>
51
            </div>
52
        </div>
53
        <div class="row">
54
            <div class="col-2 item-caption cityText">所在城市</div>
55
            <div class="col-8 city">
56
                <form action="" name="form1">
57
                    <div class=" col-6 citybox">
58
														<span class="frmtype frmtypeW" id="Province">
59
				                                        	<em class="mr_sj"></em>
60
				                                            <i class="mr_show" id="oprovince">请选择省份</i>
61
				                                            <ul>
62
				                                                <li><a href="javascript:void(0)"
63
                                                                       alt="请选择省份">请选择省份</a></li>
64
				                                            </ul>
65
				                                            <input type="hidden" name="cho_Province"
66
                                                                   value="请选择省份">
67
				                                        </span>
68
                    </div>
69
                    <div class="col-6 citybox">
70
														<span class="frmtype frmtypeW" id="City">
71
				                                       		<em class="mr_sj"></em>
72
				                                            <i class="mr_show" id="ocity"></i>
73
				                                            <ul>
74
				                                                <li><a href="javascript:void(0)"
75
                                                                       alt="请选择城市">请选择城市</a></li>
76
				                                            </ul>
77
				                                            <input type="hidden" name="cho_City" value="请选择城市 ">
78
				                                        </span>
79
                    </div>
80
                </form>
81
            </div>
82
        </div>
83
        <div class="row">
84
            <div class="col-2 item-caption">个人简介</div>
85
            <div class="col-6">
86
                <div class="form-item textarea" placeholder="个人简介不得超过500个字" name="descp"></div>
87
            </div>
88
        </div>
89
        <div class="row">
90
            <div class="col-2 item-caption">学术领域</div>
91
            <div class="col-4">
92
                <div class="form-item text" placeholder="添加内容不能超过15个字" name="newSubject"></div>
93
            </div>
94
            <div class="col-2">
95
                <div class="btn pull-right opt-subject">
96
                    <i class="icon-check"></i> 添加
97
                </div>
98
            </div>
99
        </div>
100
        <div class="row">
101
            <div class="col-2"></div>
102
            <div class="col-6">
103
                <div class="form-item dyn-mselect orgSize" name="subjectList"></div>
104
            </div>
105
        </div>
106
        <div class="row">
107
            <div class="col-2 item-caption">研究方向</div>
108
            <div class="col-4">
109
                <div class="form-item text" placeholder="添加内容不能超过20个字" name="newResearchArea"></div>
110
            </div>
111
            <div class="col-2">
112
                <div class="btn pull-right opt-ra">
113
                    <i class="icon-check"></i> 添加
114
                </div>
115
            </div>
116
        </div>
117
        <div class="row">
118
            <div class="col-2"></div>
119
            <div class="col-6">
120
                <div class="form-item dyn-mselect orgSize" name="researchAreaList"></div>
121
            </div>
122
        </div>
123
        <div class="row">
124
            <div class="col-2 item-caption">行业领域</div>
125
            <div class="col-4">
126
                <div class="form-item text" placeholder="添加内容不能超过15个字" name="newIndustry"></div>
127
            </div>
128
            <div class="col-2">
129
                <div class="btn pull-right opt-industry">
130
                    <i class="icon-check"></i> 添加
131
                </div>
132
            </div>
133
        </div>
134
        <div class="row">
135
            <div class="col-2"></div>
136
            <div class="col-6">
137
                <div class="form-item dyn-mselect orgSize" name="industryList"></div>
138
            </div>
139
        </div>
140
    </div>
141
    <div class="container">
142
        <table class="table table-bordered">
143
            <thead>
144
            <tr>
145
                <th>项目经历</th>
146
                <th class="col-3">
147
                    <div class="btn pull-right opt-project-new">
148
                        <i class="icon-check"></i> 添加
149
                    </div>
150
                </th>
151
            </tr>
152
            </thead>
153
            <tbody class="dt-project">
154
            <tr ch-dir="list">
155
                <td >{{name}}&nbsp;&nbsp;{{startMonth}}-{{stopMonth}}<br>{{descp}}</td>
156
                <td class="table-opt edit" pid="{{id}}">
157
                    <div class="btn opt-project-edit">
158
                        <i class="icon-edit"></i>
159
                        编辑
160
                    </div>
161
                    <div class="btn pull-right opt-project-del">
162
                        <i class="icon-edit"></i>
163
                        删除
164
                    </div>
165
                </td>
166
            </tr>
167
        </table>
168
    </div>
169
    <div class="container">
170
        <table class="table table-bordered">
171
            <thead>
172
            <tr>
173
                <th>荣誉奖项</th>
174
                <th class="col-3">
175
                    <div class="btn pull-right opt-honor-new">
176
                        <i class="icon-check"></i> 添加
177
                    </div>
178
                </th>
179
            </tr>
180
            </thead>
181
            <tbody class="dt-honor">
182
            <tr ch-dir="list">
183
                <td>{{name}}&nbsp;&nbsp;{{year}}<br>{{descp}}</td>
184
                <td class="table-opt edit" hid="{{id}}">
185
                    <div class="btn opt-honor-edit">
186
                        <i class="icon-edit"></i>
187
                        编辑
188
                    </div>
189
                    <div class="btn pull-right opt-honor-del">
190
                        <i class="icon-edit"></i>
191
                        删除
192
                    </div>
193
                </td>
194
            </tr>
195
            </tbody>
196
        </table>
197
    </div>
198
    <div class="container">
199
        <table class="table table-bordered">
200
            <thead>
201
            <tr>
202
                <th>工作经历</th>
203
                <th class="col-3">
204
                    <div class="btn pull-right opt-job-new">
205
                        <i class="icon-check"></i> 添加
206
                    </div>
207
                </th>
208
            </tr>
209
            </thead>
210
            <tbody class="dt-job">
211
            <tr ch-dir="list">
212
                <td>{{company}}-{{title}}-{{department}}&nbsp;&nbsp;{{startMonth}}-{{stopMonth}}</td>
213
                <td class="table-opt edit" jid="{{id}}">
214
                    <div class="btn opt-job-edit">
215
                        <i class="icon-edit"></i>
216
                        编辑
217
                    </div>
218
                    <div class="btn pull-right opt-job-del">
219
                        <i class="icon-edit"></i>
220
                        删除
221
                    </div>
222
                </td>
223
            </tr>
224
            </tbody>
225
        </table>
226
    </div>
227
    <div class="container">
228
        <table class="table table-bordered">
229
            <thead>
230
            <tr>
231
                <th>教育背景</th>
232
                <th class="col-3">
233
                    <div class="btn pull-right opt-edu-new">
234
                        <i class="icon-check"></i> 添加
235
                    </div>
236
                </th>
237
            </tr>
238
            </thead>
239
            <tbody class="dt-edu">
240
            <tr ch-dir="list">
241
                <td>{{school}}-{{college}}-{{major}}-{{degree}}&nbsp;&nbsp;{{year}}<br>{{descp}}</td>
242
                <td class="table-opt edit" eid="{{id}}">
243
                    <div class="btn opt-edu-edit">
244
                        <i class="icon-edit"></i>
245
                        编辑
246
                    </div>
247
                    <div class="btn pull-right opt-edu-del">
248
                        <i class="icon-edit"></i>
249
                        删除
250
                    </div>
251
                </td>
252
            </tr>
253
            </tbody>
254
        </table>
255
    </div>
256
    <div class="row">
257
        <div class="col-10"></div>
258
        <div class="col-4 pull-right">
259
            <div class="btn pull-right opt-save">
260
                <i class="icon-check"></i> 保存
261
            </div>
262
        </div>
263
    </div>
264
</div>

+ 49 - 0
html/model/sys/professornew/edu.html

@ -0,0 +1,49 @@
1
<div class="sys_professornew_edu centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">学校名称</div>
8
            <div class="col-6">
9
                <div class="form-item text trim" placeholder="学校名称不得超过50个字" name="school"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption">院系名称</div>
15
            <div class="col-6">
16
                <div class="form-item text trim" placeholder="院系名称不得超过20个字" name="college"></div>
17
            </div>
18
        </div>
19
        <div class="row">
20
            <div class="col-2 item-caption">专业名称</div>
21
            <div class="col-6">
22
                <div class="form-item text trim" placeholder="专业名称不得超过20个字" name="major"></div>
23
            </div>
24
        </div>
25
        <div class="row">
26
            <div class="col-2 item-caption">学位</div>
27
            <div class="col-6">
28
                <div class="form-item select" dictCode="user_degree" defVal="" name="degree"></div>
29
            </div>
30
        </div>
31
        <div class="row">
32
            <div class="col-2 item-caption ">毕业时间</div>
33
            <div class="col-4">
34
                <div class="form-item select tree" dictCode="edu_year" name="year"></div>
35
            </div>
36
        </div>
37
        <div class="row">
38
            <div class="col-10"></div>
39
            <div class="col-2">
40
                <div class="btn pull-right opt-save">
41
                    <i class="icon-check"></i> 保存
42
                </div>
43
44
            </div>
45
46
        </div>
47
    </div>
48
49
</div>

+ 37 - 0
html/model/sys/professornew/honor.html

@ -0,0 +1,37 @@
1
<div class="sys_professornew_honor centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">奖项名称</div>
8
            <div class="col-6">
9
                <div class="form-item text trim" placeholder="奖项名称不得超过50个字" name="name"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption ">获奖时间</div>
15
            <div class="col-4">
16
                <div class="form-item select" dictCode="honor_year" name="year"></div>
17
            </div>
18
        </div>
19
        <div class="row">
20
            <div class="col-2 item-caption">备注</div>
21
            <div class="col-6">
22
                <div class="form-item textarea" placeholder="项目描述不得超过200个字" name="descp"></div>
23
            </div>
24
        </div>
25
        <div class="row">
26
            <div class="col-10"></div>
27
            <div class="col-2">
28
                <div class="btn pull-right opt-save">
29
                    <i class="icon-check"></i> 保存
30
                </div>
31
32
            </div>
33
34
        </div>
35
    </div>
36
37
</div>

+ 22 - 11
html/model/sys/professornew/index.html

@ -4,11 +4,23 @@
4 4
    </div>
5 5
    <div class="container dt-form">
6 6
        <div class="row">
7
            <div class="col-2 item-caption">用户名</div>
8
            <div class="col-3">
9
                <div class="form-item text trim" defVal="" name="name"></div>
7
            <div class="col-1"></div>
8
            <div class="col-1 item-caption ">用户名</div>
9
            <div class="col-2">
10
                <div class="form-item text" name="name"></div>
11
            </div>
12
            <div class="col-1 item-caption">激活状态</div>
13
            <div class="col-2">
14
                <div class="form-item select" dictCode="active_status" name="activeStatus"></div>
10 15
            </div>
11
            <div class="col-1 item-caption ">创建日期</div>
16
            <div class="col-1 item-caption">邀请状态</div>
17
            <div class="col-2">
18
                <div class="form-item select" dictCode="bool" name="sendMailStatus"></div>
19
            </div>
20
        </div>
21
        <div class="row">
22
            <div class="col-1"></div>
23
            <div class="col-1 item-caption ">发布时间</div>
12 24
            <div class="col-2">
13 25
                <div class="form-item date" defVal="" name="bt"></div>
14 26
            </div>
@ -16,7 +28,6 @@
16 28
            <div class="col-2">
17 29
                <div class="form-item date" defVal="" name="et"></div>
18 30
            </div>
19
            <div class="col-1"></div>
20 31
        </div>
21 32
        <div class="row">
22 33
            <div class="col-9">
@ -39,9 +50,9 @@
39 50
            <div class="btn opt-edit">
40 51
                修改账户信息
41 52
            </div>
42
            <!--<div class="btn opt-details">-->
43
                <!--编辑用户资料-->
44
            <!--</div>-->
53
            <div class="btn opt-details">
54
                编辑用户资料
55
            </div>
45 56
            <div class="btn opt-view">
46 57
                查看用户信息
47 58
            </div>
@ -86,15 +97,15 @@
86 97
                <td class="hand-dict" dict="solveStatus" code="{{authStatus}}"></td>
87 98
                <td class="hand-dict" dict="solveStatus" code="{{authStatusExpert}}"></td>
88 99
                <td>{{sortFirst}}</td>
89
                <td>{{activeStatus}}</td>
100
                <td class="hand-dict" dict="active_status" code="{{activeStatus}}"></td>
90 101
                <td>{{pageViews}}</td>
91 102
                <td class="hand-fans" id="{{id}}"></td>
92
                <td>{{sendMailStatus}}</td>
103
                <td>{{sendMailStatus-bool}}</td>
93 104
            </tr>
94 105
            </tbody>
95 106
            <tbody ch-dir="array.empty">
96 107
            <tr>
97
                <td class="empty-desc" colspan="11">表格暂无数据</td>
108
                <td class="empty-desc" colspan="16">表格暂无数据</td>
98 109
            </tr>
99 110
            </tbody>
100 111
        </table>

+ 48 - 0
html/model/sys/professornew/job.html

@ -0,0 +1,48 @@
1
<div class="sys_professornew_job centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">机构名称</div>
8
            <div class="col-6">
9
                <div class="form-item text trim" placeholder="机构名称不得超过50个字" name="company"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption">所在部门</div>
15
            <div class="col-6">
16
                <div class="form-item text trim" placeholder="部门名称不得超过50个字" name="department"></div>
17
            </div>
18
        </div>
19
        <div class="row">
20
            <div class="col-2 item-caption">职位</div>
21
            <div class="col-6">
22
                <div class="form-item text trim" placeholder="职位不得超过50个字" name="title"></div>
23
            </div>
24
            <span class="requiredSpan">*</span>
25
        </div>
26
        <div class="row">
27
            <div class="col-2 item-caption ">任职时间</div>
28
            <div class="col-4">
29
                <div class="form-item select tree" dictCode="date_start" name="startMonth"></div>
30
            </div>
31
            <div class="col-1 item-caption center">至</div>
32
            <div class="col-4">
33
                <div class="form-item select tree" dictCode="date_start" name="stopMonth"></div>
34
            </div>
35
        </div>
36
        <div class="row">
37
            <div class="col-10"></div>
38
            <div class="col-2">
39
                <div class="btn pull-right opt-save">
40
                    <i class="icon-check"></i> 保存
41
                </div>
42
43
            </div>
44
45
        </div>
46
    </div>
47
48
</div>

+ 39 - 0
html/model/sys/professornew/project.html

@ -0,0 +1,39 @@
1
<div class="sys_professornew_project centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2 item-caption">项目名称</div>
8
            <div class="col-6">
9
                <div class="form-item text trim" placeholder="项目名称不得超过50个字" name="name"></div>
10
            </div>
11
            <span class="requiredSpan">*</span>
12
        </div>
13
        <div class="row">
14
            <div class="col-2 item-caption ">项目时间</div>
15
            <div class="col-4">
16
                <div class="form-item select tree" dictCode="date_start" name="startMonth"></div>
17
            </div>
18
            <div class="col-1 item-caption center">至</div>
19
            <div class="col-4">
20
                <div class="form-item select tree" dictCode="date_start" name="stopMonth"></div>
21
            </div>
22
        </div>
23
        <div class="row">
24
            <div class="col-2 item-caption">备注</div>
25
            <div class="col-6">
26
                <div class="form-item textarea" placeholder="项目描述不得超过200个字" name="descp"></div>
27
            </div>
28
        </div>
29
        <div class="row">
30
            <div class="col-10"></div>
31
            <div class="col-2">
32
                <div class="btn pull-right opt-save">
33
                    <i class="icon-check"></i> 保存
34
                </div>
35
            </div>
36
        </div>
37
    </div>
38
39
</div>

+ 1 - 1
html/model/sys/userInfo/edu.html

@ -38,7 +38,7 @@
38 38
            <div class="col-10"></div>
39 39
            <div class="col-2">
40 40
                <div class="btn pull-right opt-save">
41
                    <i class="icon-check"></i> SAVE
41
                    <i class="icon-check"></i> 保存
42 42
                </div>
43 43
44 44
            </div>

+ 1 - 1
html/model/sys/userInfo/honor.html

@ -26,7 +26,7 @@
26 26
            <div class="col-10"></div>
27 27
            <div class="col-2">
28 28
                <div class="btn pull-right opt-save">
29
                    <i class="icon-check"></i> SAVE
29
                    <i class="icon-check"></i> 保存
30 30
                </div>
31 31
32 32
            </div>

+ 1 - 1
html/model/sys/userInfo/job.html

@ -37,7 +37,7 @@
37 37
            <div class="col-10"></div>
38 38
            <div class="col-2">
39 39
                <div class="btn pull-right opt-save">
40
                    <i class="icon-check"></i> SAVE
40
                    <i class="icon-check"></i> 保存
41 41
                </div>
42 42
43 43
            </div>

+ 1 - 1
html/model/sys/userInfo/project.html

@ -30,7 +30,7 @@
30 30
            <div class="col-10"></div>
31 31
            <div class="col-2">
32 32
                <div class="btn pull-right opt-save">
33
                    <i class="icon-check"></i> SAVE
33
                    <i class="icon-check"></i> 保存
34 34
                </div>
35 35
            </div>
36 36
        </div>

+ 547 - 0
js/model/sys/professornew/details.js

@ -0,0 +1,547 @@
1
/**
2
 * Created by TT on 2017/7/7.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form", "code"], function (spa, util, fb, code) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_details");
10
                var ca = {ready: true, items: []};
11
                var dp = code.parseCode(root.find(".dt-project"));
12
                var dh = code.parseCode(root.find(".dt-honor"));
13
                var dj = code.parseCode(root.find(".dt-job"));
14
                var de = code.parseCode(root.find(".dt-edu"));
15
                var form = fb.build(root.find(".newForm"), {
16
                    industryList: ca,
17
                    subjectList: ca,
18
                    researchAreaList: ca
19
                });
20
                var oValue;
21
                var oJudge;
22
                var trim = function (str) { //删除左右两端的空格			  
23
                    return str.replace(/(^\s*)|(\s*$)/g, "");
24
                };
25
                var saveBtn = root.find(".opt-save"),
26
                    save = function () {
27
                        var researchAreas = [];
28
                        var researchList = form.val().researchAreaList || [];
29
                        for (var i = 0; i < researchList.length; ++i) {
30
                            var item = {caption: researchList[i], professorId: data.data.id};
31
                            researchAreas.push(item);
32
                        }
33
                        form.val({researchAreas: researchAreas});
34
                        if(form.val().industryList) {
35
                            form.val({
36
                                industry: oString(form.val().industryList)
37
                            });
38
                        }else {
39
                            form.val({industry: null});
40
                        }
41
                        if(form.val().subjectList) {
42
                            form.val({
43
                                subject: oString(form.val().subjectList)
44
                            });
45
                        }else {
46
                            form.val({subject: null});
47
                        }
48
                        form.val({
49
                            subjectList: "", industryList: "", researchAreaList: ""
50
                        });
51
                        if (form.val().title) {
52
                            var title = trim(form.val().title);
53
                            if (title.length > 20) {
54
                                util.alert("职称不得超过20个字");
55
                                return;
56
                            }
57
                        }
58
                        if (form.val().office) {
59
                            var office = trim(form.val().office);
60
                            if (office.length > 20) {
61
                                util.alert("职位不得超过20个字");
62
                                return;
63
                            }
64
                        }
65
                        if (form.val().orgName) {
66
                            var orgName = trim(form.val().orgName);
67
                            if (orgName.length > 50) {
68
                                util.alert("所在机构不得超过50个字");
69
                                return;
70
                            }
71
                        }
72
                        if (form.val().department) {
73
                            var department = trim(form.val().department);
74
                            if (department.length > 20) {
75
                                util.alert("所在部门不得超过20个字");
76
                                return;
77
                            }
78
                        }
79
                        if (form.val().descp) {
80
                            var descp = trim(form.val().descp);
81
                            if (descp.length > 500) {
82
                                util.alert("个人简介不得超过500个字");
83
                            }
84
                        }
85
                        if (form.val().phone) {
86
                            var phone = trim(form.val().phone);
87
                            if (trim(phone)) {
88
                                if (phone.length > 50) {
89
                                    util.alert('提示', '联系电话不得超过50个字');
90
                                    return;
91
                                }
92
                            }
93
                        }
94
                        if (form.val().email) {
95
                            var email = trim(form.val().email);
96
                            var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
97
                            if (!gunf.test(email)) {
98
                                util.alert("联系邮箱格式有误,请检查后重新填写");
99
                                return;
100
                            }
101
                        }
102
                        if (form.val().name) {
103
                            var name = trim(form.val().name);
104
                            if (name.length > 10) {
105
                                util.alert("姓名最长为10个字");
106
                                return;
107
                            }
108
                        }
109
                        if (form.val().name == null) {
110
                            util.alert("请输入专家姓名");
111
                        } else if (form.val().loginPhone || form.val().loginEmail) {
112
                            form.doPut("../ajax/sys/professor", function () {
113
                                spa.closeModal();
114
                                if (data.hand) {
115
                                    data.hand();
116
                                }
117
                            }, {"50000":"只能修改未激活用户信息"});
118
                        } else {
119
                            util.alert("手机或邮箱至少输入一项");
120
                        }
121
                    };
122
                var part = function (one, list) {
123
                    oValue = one;
124
                    oJudge = list || [];
125
                    var repeat,
126
                        b;
127
                    if (!oValue) {
128
                        util.alert('提示', '请先填写内容');
129
                        return;
130
                    }
131
                    if (oValue.length > 15) {
132
                        util.alert('提示', '添加内容不能超过15个字');
133
                        return;
134
                    } else {
135
                        var oValueList = oValue.split(","),
136
                            length = oValueList.length;
137
                        for (var j = 0; j < length; j++) {
138
                            for (var n = j + 1; n < oValueList.length + 1;) {
139
                                if (oValueList[j] == oValueList[n]) {
140
                                    oValueList.remove(n);
141
                                    repeat = false;
142
                                } else {
143
                                    n++;
144
                                }
145
                            }
146
                        }
147
                        for (var j = 0; j < oValueList.length;) {
148
                            for (var i = 0; i < oJudge.length; i++) {
149
                                if (oValueList[j] == oJudge[i]) {
150
                                    oValueList.remove(j);
151
                                    repeat = false;
152
                                    b = true;
153
                                }
154
                            }
155
                            if (b) {
156
                                b = false
157
                            } else j++;
158
                        }
159
                        if (repeat == false) {
160
                            util.alert('提示', '添加内容不能重复');
161
                        }
162
                        for (var m = 0; m < oValueList.length; m++) {
163
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
164
                            oJudge.push(oValueList[m]);
165
                        }
166
                    }
167
                };
168
169
                var part2 = function (one, list) {
170
                    oValue = one;
171
                    oJudge = list || [];
172
                    var repeat,
173
                        b;
174
                    if (!oValue) {
175
                        util.alert('提示', '请先填写内容');
176
                        return;
177
                    }
178
                    if (oValue.length > 20) {
179
                        util.alert('提示', '添加内容不能超过20个字');
180
                        return;
181
                    } else {
182
                        var oValueList = oValue.split(","),
183
                            length = oValueList.length;
184
                        for (var j = 0; j < length; j++) {
185
                            for (var n = j + 1; n < oValueList.length + 1;) {
186
                                if (oValueList[j] == oValueList[n]) {
187
                                    oValueList.remove(n);
188
                                    repeat = false;
189
                                } else {
190
                                    n++;
191
                                }
192
                            }
193
                        }
194
                        for (var j = 0; j < oValueList.length;) {
195
                            for (var i = 0; i < oJudge.length; i++) {
196
                                if (oValueList[j] == oJudge[i]) {
197
                                    oValueList.remove(j);
198
                                    repeat = false;
199
                                    b = true;
200
                                }
201
                            }
202
                            if (b) {
203
                                b = false
204
                            } else j++;
205
                        }
206
                        if (repeat == false) {
207
                            util.alert('提示', '添加内容不能重复');
208
                        }
209
                        for (var m = 0; m < oValueList.length; m++) {
210
                            ca.items.push({code: oValueList[m], caption: oValueList[m]});
211
212
                            oJudge.push(oValueList[m]);
213
                        }
214
                    }
215
                };
216
217
                var split = function (data) {
218
                    var index = data.split(",");
219
                    var arr = [];
220
                    for (var m = 0; m < index.length; m++) {
221
                        ca.items.push({code: index[m], caption: index[m]});
222
                        arr.push(index[m]);
223
                    }
224
                    return arr;
225
                };
226
227
                var split2 = function (data) {
228
                    var arr = [];
229
                    for (var m = 0; m < data.length; m++) {
230
                        ca.items.push({code: data[m].caption, caption: data[m].caption});
231
                        arr.push(data[m].caption);
232
                    }
233
                    return arr;
234
                };
235
236
                if (data.data.industry) {
237
                    form.val({industryList: split(data.data.industry)});
238
                }
239
                if (data.data.subject) {
240
                    form.val({subjectList: split(data.data.subject)});
241
                }
242
                if (data.data.researchAreas) {
243
                    form.val({researchAreaList: split2(data.data.researchAreas)});
244
                }
245
246
247
                Array.prototype.remove = function (obj) {
248
                    for (var i = 0; i < this.length; i++) {
249
                        var temp = this[i];
250
                        if (!isNaN(obj)) {
251
                            temp = i;
252
                        }
253
                        if (temp == obj) {
254
                            for (var j = i; j < this.length; j++) {
255
                                this[j] = this[j + 1];
256
                            }
257
                            this.length = this.length - 1;
258
                        }
259
                    }
260
                };
261
                function oString(data) {
262
                    var arry = new Array();
263
                    if (data) {
264
                        for (var i = 0; i < data.length; i++) {
265
                            arry.push(data[i]);
266
                        }
267
                    }
268
                    return arry.join(",");
269
                }
270
271
                root.find(".opt-industry").on("click", function () {
272
                    part(form.val().newIndustry, form.val().industryList);
273
                    form.val({newIndustry: "", industryList: oJudge});
274
                });
275
                root.find(".opt-subject").on("click", function () {
276
                    part(form.val().newSubject, form.val().subjectList);
277
                    form.val({newSubject: "", subjectList: oJudge});
278
                });
279
                root.find(".opt-ra").on("click", function () {
280
                    part2(form.val().newResearchArea, form.val().researchAreaList);
281
                    form.val({newResearchArea: "", researchAreaList: oJudge});
282
                });
283
                root.find(".modal-ctrl .icon-times").on("click", function () {
284
                    spa.closeModal();
285
                });
286
287
                root.find(".opt-project-new").on("click", function () {
288
                    spa.showModal("sys_professornew_project_new", {
289
                        data: data.data.id, hand: function () {
290
                            loadPorject();
291
                        }
292
                    });
293
                });
294
                root.on("click", ".opt-project-edit", function () {
295
                    var pid = $(this).parent().attr("pid");
296
                    util.get("../ajax/project/" + pid, null, function (project) {
297
                        if (project) {
298
                            spa.showModal("sys_professornew_project_edit", {
299
                                data: project, hand: function () {
300
                                    loadPorject();
301
                                }
302
                            });
303
                        } else {
304
                            util.alert("该项目经历不存在");
305
                        }
306
                    });
307
                });
308
                root.on("click", ".opt-project-del", function () {
309
                    var pid = $(this).parent().attr("pid");
310
                    util.get("../ajax/project/" + pid, null, function (project) {
311
                        if (project) {
312
                            util.boxMsg({
313
                                title: "确认删除",
314
                                content: "确认删除该项目经历?删除后无法恢复。",
315
                                btns: [{
316
                                    caption: "删除",
317
                                    hand: function () {
318
                                        util.del("../ajax/project/" + pid, function () {
319
                                            loadPorject();
320
                                        }, {});
321
                                    }
322
                                },
323
                                    {caption: "取消"}
324
                                ]
325
                            });
326
                        } else {
327
                            util.alert("该项目经历不存在");
328
                        }
329
                    });
330
                });
331
                root.find(".opt-honor-new").on("click", function () {
332
                    spa.showModal("sys_professornew_honor_new", {
333
                        data: data.data.id, hand: function () {
334
                            loadHonor();
335
                        }
336
                    });
337
                });
338
                root.on("click", ".opt-honor-edit", function () {
339
                    var hid = $(this).parent().attr("hid");
340
                    util.get("../ajax/honor/" + hid, null, function (honor) {
341
                        if (honor) {
342
                            spa.showModal("sys_professornew_honor_edit", {
343
                                data: honor, hand: function () {
344
                                    loadHonor();
345
                                }
346
                            });
347
                        } else {
348
                            util.alert("该荣誉奖项不存在");
349
                        }
350
                    });
351
                });
352
                root.on("click", ".opt-honor-del", function () {
353
                    var hid = $(this).parent().attr("hid");
354
                    util.get("../ajax/honor/" + hid, null, function (honor) {
355
                        if (honor) {
356
                            util.boxMsg({
357
                                title: "确认删除",
358
                                content: "确认删除该荣誉奖项?删除后无法恢复。",
359
                                btns: [{
360
                                    caption: "删除",
361
                                    hand: function () {
362
                                        util.del("../ajax/honor/" + hid, function () {
363
                                            loadHonor();
364
                                        }, {});
365
                                    }
366
                                },
367
                                    {caption: "取消"}
368
                                ]
369
                            });
370
                        } else {
371
                            util.alert("该荣誉奖项不存在");
372
                        }
373
                    });
374
                });
375
                root.find(".opt-job-new").on("click", function () {
376
                    spa.showModal("sys_professornew_job_new", {
377
                        data: data.data.id, hand: function () {
378
                            loadJob();
379
                        }
380
                    });
381
                });
382
                root.on("click", ".opt-job-edit", function () {
383
                    var jid = $(this).parent().attr("jid");
384
                    util.get("../ajax/job/" + jid, null, function (job) {
385
                        if (job) {
386
                            spa.showModal("sys_professornew_job_edit", {
387
                                data: job, hand: function () {
388
                                    loadJob();
389
                                }
390
                            });
391
                        } else {
392
                            util.alert("该工作经历不存在");
393
                        }
394
                    });
395
                });
396
                root.on("click", ".opt-job-del", function () {
397
                    var jid = $(this).parent().attr("jid");
398
                    util.get("../ajax/job/" + jid, null, function (job) {
399
                        if (job) {
400
                            util.boxMsg({
401
                                title: "确认删除",
402
                                content: "确认删除该工作经历?删除后无法恢复。",
403
                                btns: [{
404
                                    caption: "删除",
405
                                    hand: function () {
406
                                        util.del("../ajax/job/" + jid, function () {
407
                                            loadJob();
408
                                        }, {});
409
                                    }
410
                                },
411
                                    {caption: "取消"}
412
                                ]
413
                            });
414
                        } else {
415
                            util.alert("该工作经历不存在");
416
                        }
417
                    });
418
                });
419
                root.find(".opt-edu-new").on("click", function () {
420
                    spa.showModal("sys_professornew_edu_new", {
421
                        data: data.data.id, hand: function () {
422
                            loadEdu();
423
                        }
424
                    });
425
                });
426
                root.on("click", ".opt-edu-edit", function () {
427
                    var eid = $(this).parent().attr("eid");
428
                    util.get("../ajax/edu/" + eid, null, function (edu) {
429
                        if (edu) {
430
                            spa.showModal("sys_professornew_edu_edit", {
431
                                data: edu, hand: function () {
432
                                    loadEdu();
433
                                }
434
                            });
435
                        } else {
436
                            util.alert("该教育经历不存在");
437
                        }
438
                    });
439
                });
440
                root.on("click", ".opt-edu-del", function () {
441
                    var eid = $(this).parent().attr("eid");
442
                    util.get("../ajax/edu/" + eid, null, function (edu) {
443
                        if (edu) {
444
                            util.boxMsg({
445
                                title: "确认删除",
446
                                content: "确认删除该教育经历?删除后无法恢复。",
447
                                btns: [{
448
                                    caption: "删除",
449
                                    hand: function () {
450
                                        util.del("../ajax/edu/" + eid, function () {
451
                                            loadEdu();
452
                                        }, {});
453
                                    }
454
                                },
455
                                    {caption: "取消"}
456
                                ]
457
                            });
458
                        } else {
459
                            util.alert("该教育经历不存在");
460
                        }
461
                    });
462
                });
463
                $.fn.citySelect();
464
                $(document).on("click", "#City li a", function () {
465
                    var aVal = $(this).text();
466
                    $(this).parent().parent().parent().find('.mr_show').text(aVal);
467
                    $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
468
                    if ($("#ocity").text() == "请选择城市") {
469
                        $("#ocity").removeClass("mr_select");
470
                    } else {
471
                        $("#ocity").addClass("mr_select");
472
                    }
473
                    if ($("#oprovince").text() != "请选择省份") {
474
                        form.val({province: $("#oprovince").text()});
475
                    }
476
                    if ($("#ocity").text() != "请选择城市") {
477
                        form.val({address: $("#ocity").text()});
478
                    }
479
480
                });
481
482
                if (data.data.province) {
483
                    $("#oprovince").text(data.data.province);
484
                }
485
                if (data.data.address) {
486
                    $("#ocity").text(data.data.address);
487
                }
488
                saveBtn.on("click", function () {
489
                    save();
490
                });
491
492
                // data.data.projects = data.data.projects || [];
493
                // for (var i = 0; i < data.data.projects.length; ++i) {
494
                //     data.data.projects[i].no = i;
495
                // }
496
                // dp.val(data.data.projects);
497
                //
498
                // data.data.honors = data.data.honors || [];
499
                // for (var i = 0; i < data.data.honors.length; ++i) {
500
                //     data.data.honors[i].no = i;
501
                // }
502
                // dh.val(data.data.honors);
503
                //
504
                // data.data.jobs = data.data.jobs || [];
505
                // for (var i = 0; i < data.data.jobs.length; ++i) {
506
                //     data.data.jobs[i].no = i;
507
                // }
508
                // dj.val(data.data.jobs);
509
                //
510
                // data.data.edus = data.data.edus || [];
511
                // for (var i = 0; i < data.data.edus.length; ++i) {
512
                //     data.data.edus[i].no = i;
513
                // }
514
                // de.val(data.data.edus);
515
516
                /*
517
                 加载项目经历、荣誉奖项、工作经历、教育背景
518
                 */
519
                var loadPorject = function () {
520
                    util.get("../ajax/project/professor", {professorId: data.data.id}, function (projects) {
521
                        dp.val(projects);
522
                    });
523
                };
524
                var loadHonor = function () {
525
                    util.get("../ajax/honor/professor", {professorId: data.data.id}, function (honors) {
526
                        dh.val(honors);
527
                    });
528
                };
529
                var loadJob = function () {
530
                    util.get("../ajax/job/professor", {professorId: data.data.id}, function (jobs) {
531
                        dj.val(jobs);
532
                    });
533
                };
534
                var loadEdu = function () {
535
                    util.get("../ajax/edu/professor", {professorId: data.data.id}, function (edus) {
536
                        de.val(edus);
537
                    });
538
                };
539
                form.val(data.data);
540
                loadPorject();
541
                loadHonor();
542
                loadJob();
543
                loadEdu();
544
            }
545
        }
546
    });
547
});

+ 62 - 0
js/model/sys/professornew/eduEdit.js

@ -0,0 +1,62 @@
1
/**
2
 * Created by TT on 2017/8/14.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_edu");
10
                var form = fb.build(root.find(".newForm"));
11
                var saveBtn = root.find(".opt-save"),
12
                    save = function () {
13
                        if (form.val().school) {
14
                            var school = trim(form.val().school);
15
                            if (school.length > 50) {
16
                                util.alert("学校名称不得超过50个字");
17
                                return;
18
                            }
19
                        } else {
20
                            util.alert("请填写学校名称");
21
                            return;
22
                        }
23
                        if (form.val().college) {
24
                            var college = trim(form.val().college);
25
                            if (college.length > 20) {
26
                                util.alert("院系名称不得超过20个字");
27
                                return;
28
                            }
29
                        }
30
                        if (form.val().major) {
31
                            var major = trim(form.val().major);
32
                            if (major.length > 20) {
33
                                util.alert("专业名称不得超过20个字");
34
                                return;
35
                            }
36
                        }
37
                        form.doPut("../ajax/edu",function () {
38
                            spa.closeModal();
39
                            if (data.hand){
40
                                data.hand();
41
                            }
42
                        },function (data) {
43
                            util.alert(data.msg);
44
                        })
45
                    };
46
                root.find(".modal-ctrl .icon-times").on("click", function () {
47
                    spa.closeModal();
48
                });
49
                saveBtn.on("click", save);
50
                form.val(data.data);
51
                if (data.data.year) {
52
                    if (trim(data.data.year) == "至今") {
53
                        form.val({year: "至今"});
54
                    }
55
                }
56
                function trim(str) { //删除左右两端的空格			  
57
                    return str.replace(/(^\s*)|(\s*$)/g, "");
58
                }
59
            }
60
        }
61
    });
62
});

+ 58 - 0
js/model/sys/professornew/eduNew.js

@ -0,0 +1,58 @@
1
/**
2
 * Created by TT on 2017/7/11.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_edu");
10
                var form = fb.build(root.find(".newForm"));
11
                var saveBtn = root.find(".opt-save"),
12
                    save = function () {
13
                        if (form.val().school) {
14
                            var school = trim(form.val().school);
15
                            if (school.length > 50) {
16
                                util.alert("学校名称不得超过50个字");
17
                                return;
18
                            }
19
                        } else {
20
                            util.alert("请填写学校名称");
21
                            return;
22
                        }
23
                        if (form.val().college) {
24
                            var college = trim(form.val().college);
25
                            if (college.length > 20) {
26
                                util.alert("院系名称不得超过20个字");
27
                                return;
28
                            }
29
                        }
30
                        if (form.val().major) {
31
                            var major = trim(form.val().major);
32
                            if (major.length > 20) {
33
                                util.alert("专业名称不得超过20个字");
34
                                return;
35
                            }
36
                        }
37
                        if (form.val().year) {
38
                            form.val({year: form.val().year.substring(0, 4)});
39
                        }
40
                        form.val({professorId: data.data});
41
                        form.doPost("../ajax/edu", function () {
42
                            spa.closeModal();
43
                            if (data.hand) {
44
                                data.hand();
45
                            }
46
                        });
47
                    };
48
                root.find(".modal-ctrl .icon-times").on("click", function () {
49
                    spa.closeModal();
50
                });
51
                saveBtn.on("click", save);
52
                function trim(str) { //删除左右两端的空格			  
53
                    return str.replace(/(^\s*)|(\s*$)/g, "");
54
                }
55
            }
56
        }
57
    });
58
});

+ 53 - 0
js/model/sys/professornew/honorEdit.js

@ -0,0 +1,53 @@
1
/**
2
 * Created by TT on 2017/8/14.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_honor");
10
                var form = fb.build(root.find(".newForm"));
11
                var saveBtn = root.find(".opt-save"),
12
                    save = function () {
13
                        if (form.val().name) {
14
                            var name = trim(form.val().name);
15
                            if (name.length > 50) {
16
                                util.alert("奖项名称不得超过50个字");
17
                                return;
18
                            }
19
                        } else {
20
                            util.alert("请填写奖项名称");
21
                            return;
22
                        }
23
                        if (form.val().descp) {
24
                            var descp = trim(form.val().descp);
25
                            if (descp.length > 200) {
26
                                util.alert("项目描述不得超过200个字");
27
                                return;
28
                            }
29
                        }
30
                        if (form.val().year) {
31
                            form.val().year = form.val().year.substring(0, 4);
32
                        }
33
                        form.doPut("../ajax/honor", function () {
34
                            spa.closeModal();
35
                            if (data.hand) {
36
                                data.hand();
37
                            }
38
                        },function (data) {
39
                            util.alert(data.msg);
40
                        });
41
                    };
42
                root.find(".modal-ctrl .icon-times").on("click", function () {
43
                    spa.closeModal();
44
                });
45
                saveBtn.on("click", save);
46
                form.val(data.data);
47
                function trim(str) { //删除左右两端的空格			  
48
                    return str.replace(/(^\s*)|(\s*$)/g, "");
49
                }
50
            }
51
        }
52
    });
53
});

+ 48 - 0
js/model/sys/professornew/honorNew.js

@ -0,0 +1,48 @@
1
/**
2
 * Created by TT on 2017/8/15.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_honor");
10
                var form = fb.build(root.find(".newForm"));
11
                var saveBtn = root.find(".opt-save"),
12
                    save = function () {
13
                        if (form.val().name) {
14
                            var name = trim(form.val().name);
15
                            if (name.length > 50) {
16
                                util.alert("奖项名称不得超过50个字");
17
                                return;
18
                            }
19
                        } else {
20
                            util.alert("请填写奖项名称");
21
                            return;
22
                        }
23
                        if (form.val().descp) {
24
                            var descp = trim(form.val().descp);
25
                            if (descp.length > 200) {
26
                                util.alert("项目描述不得超过200个字");
27
                                return;
28
                            }
29
                        }
30
                        form.val({professorId: data.data});
31
                        form.doPost("../ajax/honor", function () {
32
                            spa.closeModal();
33
                            if (data.hand) {
34
                                data.hand();
35
                            }
36
                        })
37
                    };
38
                root.find(".modal-ctrl .icon-times").on("click", function () {
39
                    spa.closeModal();
40
                });
41
                saveBtn.on("click", save);
42
                function trim(str) { //删除左右两端的空格			  
43
                    return str.replace(/(^\s*)|(\s*$)/g, "");
44
                }
45
            }
46
        }
47
    });
48
});

+ 43 - 35
js/model/sys/professornew/index.js

@ -15,14 +15,18 @@ spa_define(function () {
15 15
                    }
16 16
                    return "";
17 17
                });
18
                pdg.code.shell("bool", function (env) {
19
                    var v = env.cd[this.k];
20
                    return v === 1 ? "是" : (v === 0 ? "否" : "");
21
                });
18 22
                pdg.code.listen($.dict.doTransfer);
19
                pdg.code.listen(function(){
20
                    root.find(".hand-fans").each(function() {
23
                pdg.code.listen(function () {
24
                    root.find(".hand-fans").each(function () {
21 25
                        var $e = $(this);
22 26
                        var collectionid = $e.attr("id");
23
                        util.get("/ajax/content/countProfessor",{id:collectionid,type:1},function(data){
27
                        util.get("/ajax/content/countProfessor", {id: collectionid, type: 1}, function (data) {
24 28
                            $e.text(data);
25
                        },{});
29
                        }, {});
26 30
                        $e.removeClass("hand-fans");
27 31
                    });
28 32
                });
@ -56,11 +60,39 @@ spa_define(function () {
56 60
                        } else {
57 61
                            util.get("../ajax/sys/professor/luserId/" + $org.attr("professorId"), null, function (data) {
58 62
                                if (data) {
59
                                        spa.showModal("sys_professornew_edit", {
60
                                            data: data,name:$org.attr("na"), hand: function () {
61
                                                pdg.load()
63
                                    spa.showModal("sys_professornew_edit", {
64
                                        data: data, name: $org.attr("na"), hand: function () {
65
                                            pdg.reload()
66
                                        }
67
                                    })
68
                                } else {
69
                                    util.alert("用户不存在了", function () {
70
                                        pdg.load();
71
                                    });
72
                                }
73
                            }, {});
74
                        }
75
                    } else {
76
                        util.alert("请选择一个用户");
77
                    }
78
                });
79
                root.find(".opt-details").on("click", function () {
80
                    var $professor = root.find("td.opt-check>i.checked");
81
                    if ($professor.length) {
82
                        if ($professor.length > 1) {
83
                            util.alert("只能选择一个用户");
84
                        } else {
85
                            util.get("../ajax/sys/professor/detail/" + $professor.attr("professorId"), null, function (data) {
86
                                if (data) {
87
                                    if (data.activeStatus != "1") {
88
                                        spa.showModal("sys_professornew_details", {
89
                                            data: data, hand: function () {
90
                                                pdg.reload()
62 91
                                            }
63 92
                                        })
93
                                    }else {
94
                                        util.alert("只能修改未激活的用户");
95
                                    }
64 96
                                } else {
65 97
                                    util.alert("用户不存在了", function () {
66 98
                                        pdg.load();
@ -72,30 +104,6 @@ spa_define(function () {
72 104
                        util.alert("请选择一个用户");
73 105
                    }
74 106
                });
75
                // root.find(".opt-details").on("click", function () {
76
                //     var $org = root.find("td.opt-check>i.checked");
77
                //     if ($org.length) {
78
                //         if ($org.length > 1) {
79
                //             util.alert("只能选择一个用户");
80
                //         } else {
81
                //             util.get("../ajax/sys/org/id/" + $org.attr("orgId"), null, function (data) {
82
                //                 if (data) {
83
                //                     spa.showModal("sys_org_details", {
84
                //                         data: data, hand: function () {
85
                //                             pdg.load()
86
                //                         }
87
                //                     })
88
                //                 } else {
89
                //                     util.alert("用户不存在了", function () {
90
                //                         pdg.load();
91
                //                     });
92
                //                 }
93
                //             }, {});
94
                //         }
95
                //     } else {
96
                //         util.alert("请选择一个用户");
97
                //     }
98
                // });
99 107
                root.find(".opt-data").on("click", function () {
100 108
                    var $professor = root.find("td.opt-check>i.checked");
101 109
                    if ($professor.length) {
@ -121,12 +129,12 @@ spa_define(function () {
121 129
                    }
122 130
                });
123 131
                root.find(".opt-view").on("click", function () {
124
                    var $org = root.find("td.opt-check>i.checked");
125
                    if ($org.length) {
126
                        if ($org.length > 1) {
132
                    var $professor = root.find("td.opt-check>i.checked");
133
                    if ($professor.length) {
134
                        if ($professor.length > 1) {
127 135
                            util.alert("只能选择一个用户");
128 136
                        } else {
129
                            window.open('http://www.ekexiu.com/userInforShow.html?professorId=' + $org.attr("professorid"));
137
                            window.open('http://www.ekexiu.com/userInforShow.html?professorId=' + $professor.attr("professorid"));
130 138
                        }
131 139
                    } else {
132 140
                        util.alert("请选择一个用户");

+ 76 - 0
js/model/sys/professornew/jobEdit.js

@ -0,0 +1,76 @@
1
/**
2
 * Created by TT on 2017/8/14.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_job");
10
                var form = fb.build(root.find(".newForm"));
11
                var date = new Date(),
12
                    month = date.getMonth() + 1,
13
                    myDate = "" + date.getFullYear() + (month > 9 ? month : ("0" + month));
14
                var saveBtn = root.find(".opt-save"),
15
                    save = function () {
16
                        if (form.val().company) {
17
                            var company = trim(form.val().company);
18
                            if (company.length > 50) {
19
                                util.alert("机构名称不得超过50个字");
20
                                return;
21
                            }
22
                        } else {
23
                            util.alert("请填写机构名称");
24
                            return;
25
                        }
26
                        if (form.val().title) {
27
                            var title = trim(form.val().title);
28
                            if (title.length > 50) {
29
                                util.alert("职位不得超过50个字");
30
                                return;
31
                            }
32
                        } else {
33
                            util.alert("请填写职位");
34
                            return;
35
                        }
36
                        if (form.val().department) {
37
                            var department = trim(form.val().department);
38
                            if (department.length > 50) {
39
                                util.alert("部门名称不得超过50个字");
40
                                return;
41
                            }
42
                        }
43
                        if (!form.val().startMonth && form.val().stopMonth) {
44
                            util.alert("没有选择开始时间");
45
                            return;
46
                        }
47
                        if (form.val().startMonth && form.val().stopMonth) {
48
                            form.val().startMonth = form.val().startMonth.substring(0, 6);
49
                            form.val().stopMonth = form.val().stopMonth.substring(0, 6);
50
                        }
51
                        form.doPut("../ajax/job",function () {
52
                            spa.closeModal();
53
                            if (data.hand){
54
                                data.hand();
55
                            }
56
                        },function (data) {
57
                            util.alert(data.msg);
58
                        })
59
                    };
60
                root.find(".modal-ctrl .icon-times").on("click", function () {
61
                    spa.closeModal();
62
                });
63
                saveBtn.on("click", save);
64
                form.val(data.data);
65
                if (data.data.stopMonth) {
66
                    if (trim(data.data.stopMonth) == "至今") {
67
                        form.val({stopMonth: ""});
68
                    }
69
                }
70
                function trim(str) {
71
                    return str.replace(/(^\s*)|(\s*$)/g, "");
72
                }
73
            }
74
        }
75
    });
76
});

+ 65 - 0
js/model/sys/professornew/jobNew.js

@ -0,0 +1,65 @@
1
/**
2
 * Created by TT on 2017/7/11.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_job");
10
                var form = fb.build(root.find(".newForm"));
11
                var date = new Date(),
12
                    month = date.getMonth() + 1,
13
                    myDate = "" + date.getFullYear() + (month > 9 ? month : ("0" + month));
14
                var saveBtn = root.find(".opt-save"),
15
                    save = function () {
16
                        if (form.val().company) {
17
                            var company = trim(form.val().company);
18
                            if (company.length > 50) {
19
                                util.alert("机构名称不得超过50个字");
20
                                return;
21
                            }
22
                        } else {
23
                            util.alert("请填写机构名称");
24
                            return;
25
                        }
26
                        if (form.val().title) {
27
                            var title = trim(form.val().title);
28
                            if (title.length > 50) {
29
                                util.alert("职位不得超过50个字");
30
                                return;
31
                            }
32
                        } else {
33
                            util.alert("请填写职位");
34
                            return;
35
                        }
36
                        if (form.val().department) {
37
                            var department = trim(form.val().department);
38
                            if (department.length > 50) {
39
                                util.alert("部门名称不得超过50个字");
40
                                return;
41
                            }
42
                        }
43
                        if (!form.val().startMonth && form.val().stopMonth) {
44
                            util.alert("没有选择开始时间");
45
                            return;
46
                        }
47
                        form.val({professorId:data.data})
48
                        form.doPost("../ajax/job",function () {
49
                            spa.closeModal();
50
                            if (data.hand){
51
                                data.hand();
52
                            }
53
                        })
54
                    };
55
                root.find(".modal-ctrl .icon-times").on("click", function () {
56
                    spa.closeModal();
57
                });
58
                saveBtn.on("click", save);
59
                function trim(str) { //删除左右两端的空格			  
60
                    return str.replace(/(^\s*)|(\s*$)/g, "");
61
                }
62
            }
63
        }
64
    });
65
});

+ 66 - 0
js/model/sys/professornew/projectEdit.js

@ -0,0 +1,66 @@
1
/**
2
 * Created by TT on 2017/8/14.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_project");
10
                var form = fb.build(root.find(".newForm"));
11
                var date = new Date(),
12
                    month = date.getMonth() + 1,
13
                    myDate = "" + date.getFullYear() + (month > 9 ? month : ("0" + month));
14
                var saveBtn = root.find(".opt-save"),
15
                    save = function () {
16
                        if (form.val().name) {
17
                            var name = trim(form.val().name);
18
                            if (name.length > 50) {
19
                                util.alert("项目名称不得超过50个字");
20
                                return;
21
                            }
22
                        } else {
23
                            util.alert("请填写项目名称");
24
                            return;
25
                        }
26
                        if (form.val().descp) {
27
                            var descp = trim(form.val().descp);
28
                            if (descp.length > 200) {
29
                                util.alert("项目描述不得超过200个字");
30
                                return;
31
                            }
32
                        }
33
                        if (!form.val().startMonth && form.val().stopMonth) {
34
                            util.alert("没有选择开始时间");
35
                            return;
36
                        }
37
                        if (form.val().startMonth && form.val().stopMonth) {
38
                            form.val().startMonth = form.val().startMonth.substring(0, 6);
39
                            form.val().stopMonth = form.val().stopMonth.substring(0, 6);
40
                        }
41
                        form.doPut("../ajax/project",function () {
42
                            spa.closeModal();
43
                            if (data.hand){
44
                                data.hand();
45
                            }
46
                        },function (data) {
47
                            util.alert(data.msg);
48
                        })
49
                    };
50
                root.find(".modal-ctrl .icon-times").on("click", function () {
51
                    spa.closeModal();
52
                });
53
                saveBtn.on("click", save);
54
                form.val(data.data);
55
                if (data.data.stopMonth) {
56
                    if (trim(data.data.stopMonth) == "至今") {
57
                        form.val({stopMonth: ""});
58
                    }
59
                }
60
                function trim(str) { //删除左右两端的空格			  
61
                    return str.replace(/(^\s*)|(\s*$)/g, "");
62
                }
63
            }
64
        }
65
    });
66
});

+ 58 - 0
js/model/sys/professornew/projectNew.js

@ -0,0 +1,58 @@
1
/**
2
 * Created by TT on 2017/8/15.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_professornew_project");
10
                var form = fb.build(root.find(".newForm"));
11
                var date = new Date(),
12
                    month = date.getMonth() + 1,
13
                    myDate = "" + date.getFullYear() + (month > 9 ? month : ("0" + month));
14
                var saveBtn = root.find(".opt-save"),
15
                    save = function () {
16
                        if (form.val().name) {
17
                            var name = trim(form.val().name);
18
                            if (name.length > 50) {
19
                                util.alert("项目名称不得超过50个字");
20
                                return;
21
                            }
22
                        } else {
23
                            util.alert("请填写项目名称");
24
                            return;
25
                        }
26
                        if (form.val().descp) {
27
                            var descp = trim(form.val().descp);
28
                            if (descp.length > 200) {
29
                                util.alert("项目描述不得超过200个字");
30
                                return;
31
                            }
32
                        }
33
                        if (!form.val().startMonth && form.val().stopMonth) {
34
                            util.alert("没有选择开始时间");
35
                            return;
36
                        }
37
                        if(form.val().stopMonth == "至今"){
38
                            form.val().stopMonth = "";
39
                        }
40
                        form.val({professorId:data.data})
41
                        form.doPost("../ajax/project",function () {
42
                            spa.closeModal();
43
                            if (data.hand){
44
                                data.hand();
45
                            }
46
                        })
47
                    };
48
                root.find(".modal-ctrl .icon-times").on("click", function () {
49
                    spa.closeModal();
50
                });
51
                saveBtn.on("click", save);
52
                function trim(str) { //删除左右两端的空格			  
53
                    return str.replace(/(^\s*)|(\s*$)/g, "");
54
                }
55
            }
56
        }
57
    });
58
});

+ 5 - 0
js/static.js

@ -187,6 +187,11 @@
187 187
            code:"5",caption:"论文",enabled:true
188 188
        }]);
189 189
190
        dict.set("active_status", [{
191
            code: "0", caption: "未激活", enabled: true
192
        }, {
193
            code: "1", caption: "已激活", enabled: true
194
        }]);
190 195
    });
191 196
192 197
})();