|
@@ -244,10 +244,10 @@
|
244
|
244
|
defaultToolbar: ['filter', 'exports', 'print'],
|
245
|
245
|
cols: [
|
246
|
246
|
[
|
247
|
|
- {type: "checkbox", fixed: 'left'},
|
248
|
|
- {type: 'numbers', fixed: 'left'},
|
|
247
|
+ {type: "radio", fixed: 'left',title:'😊'},
|
|
248
|
+ {type: 'numbers', fixed: 'left',title: '序号'},
|
249
|
249
|
{field: 'account', width: '8%', title: '账号', sort: true},
|
250
|
|
- {field: 'name', width: '8%', title: '姓名', sort: true},
|
|
250
|
+ {field: 'name', width: '8%', title: '用户名', sort: true},
|
251
|
251
|
{field: 'sex', width: '5%', title: '性别', templet: '#sexTpl', align: 'center'},
|
252
|
252
|
// {
|
253
|
253
|
// field: 'avatar', title: '头像', width: '6%', templet: function (d) {
|
|
@@ -305,7 +305,8 @@
|
305
|
305
|
"account": '',
|
306
|
306
|
"name": '',
|
307
|
307
|
'deptName': '',
|
308
|
|
- 'status': ''
|
|
308
|
+ 'status': '',
|
|
309
|
+ 'userPostName':''
|
309
|
310
|
});
|
310
|
311
|
// 执行搜索重载
|
311
|
312
|
currTable.reload({
|
|
@@ -406,38 +407,51 @@
|
406
|
407
|
});
|
407
|
408
|
}
|
408
|
409
|
} else if (obj.event === 'delete') { // 监听删除操作
|
409
|
|
- var checkStatus = table.checkStatus('currentTableId')
|
410
|
|
- , data = checkStatus.data;
|
411
|
|
- if (data == null || data.length === 0) {
|
|
410
|
+ var checkStatus = table.checkStatus('currentTableId')
|
|
411
|
+ , data = checkStatus.data;
|
|
412
|
+ if (data == null || data.length === 0) {
|
412
|
413
|
Message.warning("请选择要删除的用户!", 1000);
|
413
|
414
|
return;
|
414
|
415
|
}
|
415
|
|
-
|
416
|
416
|
var userIds = [];
|
417
|
417
|
for (var i = 0, len = data.length; i < len; i++) {
|
418
|
418
|
userIds.push(data[i].userId);
|
419
|
419
|
}
|
420
|
|
- layer.confirm('确定批量删除用户吗?', function (index) {
|
421
|
|
- layer.close(index);
|
|
420
|
+ layer.confirm('确定要删除当前账号吗?', {
|
|
421
|
+ title: '注意!',
|
|
422
|
+ btn: ['确定', '取消']
|
|
423
|
+ }, function () {
|
|
424
|
+ // 用户点击确定按钮后的回调函数
|
|
425
|
+ console.log('执行退出账号操作');
|
422
|
426
|
AjaxUtil.post({
|
423
|
427
|
url: AjaxUtil.ctx + "userinfo/batchDelete",
|
424
|
428
|
contentType: "application/json",
|
425
|
429
|
data: JSON.stringify(userIds),
|
426
|
430
|
success: function (res) {
|
427
|
|
- if (res.code === 0) {
|
428
|
|
- Message.success(1500, res.message, function () {
|
|
431
|
+ if (res.code == 0) {
|
|
432
|
+ layer.msg(res.message,{icon:1},function () {
|
429
|
433
|
// 重载表格
|
430
|
434
|
currTable.reload();
|
431
|
435
|
});
|
432
|
|
- } else {
|
433
|
|
- Message.error(res.message, 1000);
|
|
436
|
+ } else if (res.code == -1){
|
|
437
|
+ layer.msg(res.message, {icon:2});
|
|
438
|
+ return;
|
434
|
439
|
}
|
435
|
440
|
},
|
436
|
441
|
error: function (error) {
|
437
|
442
|
}
|
438
|
443
|
});
|
|
444
|
+ // 这里添加真实的退出账号逻辑,例如发送AJAX请求到服务器
|
|
445
|
+ }, function () {
|
|
446
|
+ // 用户点击取消按钮后的回调函数
|
|
447
|
+ console.log('已取消删除账号');
|
439
|
448
|
});
|
440
|
449
|
|
|
450
|
+ /* layer.confirm('确定删除用户吗?', function (index) {
|
|
451
|
+ layer.close(index);
|
|
452
|
+
|
|
453
|
+ });*/
|
|
454
|
+
|
441
|
455
|
// layer.alert(JSON.stringify(data));
|
442
|
456
|
} else if (obj.event === 'downloadPdf') {
|
443
|
457
|
console.log("点击下载pdf");
|