|
@@ -182,8 +182,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -182,8 +182,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
182
|
|
182
|
|
183
|
//新增
|
183
|
//新增
|
184
|
$("#resManageAdd").unbind("click").on("click", function () {
|
184
|
$("#resManageAdd").unbind("click").on("click", function () {
|
185
|
- if ($.inArray('back:resource:save', checkList) == -1) {
|
|
|
186
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
185
|
+ if (!common.hasPermission('back:resource:save')){
|
187
|
return;
|
186
|
return;
|
188
|
}
|
187
|
}
|
189
|
var data = curTreeNode.data;
|
188
|
var data = curTreeNode.data;
|
|
@@ -215,8 +214,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -215,8 +214,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
215
|
|
214
|
|
216
|
//拷贝
|
215
|
//拷贝
|
217
|
$("#resManageCopy").unbind().on("click", function () {
|
216
|
$("#resManageCopy").unbind().on("click", function () {
|
218
|
- if ($.inArray('back:resource:query', checkList) == -1) {
|
|
|
219
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
217
|
+ if (!common.hasPermission('back:resource:query')){
|
220
|
return;
|
218
|
return;
|
221
|
}
|
219
|
}
|
222
|
var data = table.checkStatus('resManageTable').data;
|
220
|
var data = table.checkStatus('resManageTable').data;
|
|
@@ -230,8 +228,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -230,8 +228,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
230
|
|
228
|
|
231
|
//分配任务
|
229
|
//分配任务
|
232
|
$("#res_task_assignment").unbind("click").on("click", function () {
|
230
|
$("#res_task_assignment").unbind("click").on("click", function () {
|
233
|
- if ($.inArray('back:resource:task', checkList) == -1) {
|
|
|
234
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
231
|
+ if (!common.hasPermission('back:resource:task')){
|
235
|
return;
|
232
|
return;
|
236
|
}
|
233
|
}
|
237
|
var treeData = {id: '', children: []};
|
234
|
var treeData = {id: '', children: []};
|
|
@@ -277,8 +274,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -277,8 +274,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
277
|
|
274
|
|
278
|
// 模板下载
|
275
|
// 模板下载
|
279
|
$('#resManageDownloadTemp').unbind().on('click', function () {
|
276
|
$('#resManageDownloadTemp').unbind().on('click', function () {
|
280
|
- if ($.inArray('back:resource:export', checkList) == -1) {
|
|
|
281
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
277
|
+ if (!common.hasPermission('back:resource:export')){
|
282
|
return;
|
278
|
return;
|
283
|
}
|
279
|
}
|
284
|
var data = curTreeNode.data;
|
280
|
var data = curTreeNode.data;
|
|
@@ -357,16 +353,14 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -357,16 +353,14 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
357
|
});
|
353
|
});
|
358
|
//点击上传按钮事件
|
354
|
//点击上传按钮事件
|
359
|
$("#resManageImport").on("click", function () {
|
355
|
$("#resManageImport").on("click", function () {
|
360
|
- if ($.inArray('back:resource:lead', checkList) == -1) {
|
|
|
361
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
356
|
+ if (!common.hasPermission('back:resource:lead')){
|
362
|
return;
|
357
|
return;
|
363
|
}
|
358
|
}
|
364
|
$('#btn-resManageImport').click();
|
359
|
$('#btn-resManageImport').click();
|
365
|
});
|
360
|
});
|
366
|
// 点击导出资源
|
361
|
// 点击导出资源
|
367
|
$('#resManageExportExcel').unbind('click').on('click', function () {
|
362
|
$('#resManageExportExcel').unbind('click').on('click', function () {
|
368
|
- if ($.inArray('back:resource:export', checkList) == -1) {
|
|
|
369
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
363
|
+ if (!common.hasPermission('back:resource:export')){
|
370
|
return;
|
364
|
return;
|
371
|
}
|
365
|
}
|
372
|
var data = curTreeNode.data;
|
366
|
var data = curTreeNode.data;
|
|
@@ -435,8 +429,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -435,8 +429,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
435
|
});
|
429
|
});
|
436
|
|
430
|
|
437
|
$("#resManageColl").unbind().on("click", function () {
|
431
|
$("#resManageColl").unbind().on("click", function () {
|
438
|
- if ($.inArray('back:resource:relcolltemp', checkList) == -1) {
|
|
|
439
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
432
|
+ if (!common.hasPermission('back:resource:relcolltemp')){
|
440
|
return;
|
433
|
return;
|
441
|
}
|
434
|
}
|
442
|
var data = table.checkStatus('resManageTable').data;
|
435
|
var data = table.checkStatus('resManageTable').data;
|
|
@@ -468,8 +461,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -468,8 +461,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
468
|
return false;
|
461
|
return false;
|
469
|
}
|
462
|
}
|
470
|
var loding = layer.load(2);
|
463
|
var loding = layer.load(2);
|
471
|
- $.ajax({
|
|
|
472
|
- url: common.domainName + '/api-web/manage/restemp/resourceTaskTemplate?resIds=' + resIds.toString() + '&taskId=' + taskId + '&checkTempId=' + checkTempId + '&access_token=' + accessToken,
|
464
|
+ admin.req({
|
|
|
465
|
+ type: "get",
|
|
|
466
|
+ url: common.domainName + '/api-web/manage/restemp/resourceTaskTemplate?resIds=' + resIds.toString() + '&taskId=' + taskId + '&checkTempId=' + checkTempId ,
|
473
|
success: function (res) {
|
467
|
success: function (res) {
|
474
|
layer.close(loding);
|
468
|
layer.close(loding);
|
475
|
layer.msg('配置成功', {
|
469
|
layer.msg('配置成功', {
|
|
@@ -481,11 +475,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -481,11 +475,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
481
|
reloadTable();
|
475
|
reloadTable();
|
482
|
});
|
476
|
});
|
483
|
},
|
477
|
},
|
484
|
- error: function () {
|
478
|
+ error: function (err) {
|
485
|
layer.close(loding)
|
479
|
layer.close(loding)
|
486
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
480
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
487
|
}
|
481
|
}
|
488
|
- })
|
482
|
+ });
|
|
|
483
|
+ // $.ajax({
|
|
|
484
|
+ // url: common.domainName + '/api-web/manage/restemp/resourceTaskTemplate?resIds=' + resIds.toString() + '&taskId=' + taskId + '&checkTempId=' + checkTempId + '&access_token=' + accessToken,
|
|
|
485
|
+ // success: function (res) {
|
|
|
486
|
+ // layer.close(loding);
|
|
|
487
|
+ // layer.msg('配置成功', {
|
|
|
488
|
+ // offset: '15px'
|
|
|
489
|
+ // , icon: 1
|
|
|
490
|
+ // , time: 1500
|
|
|
491
|
+ // }, function () {
|
|
|
492
|
+ // layer.closeAll();
|
|
|
493
|
+ // reloadTable();
|
|
|
494
|
+ // });
|
|
|
495
|
+ // },
|
|
|
496
|
+ // error: function () {
|
|
|
497
|
+ // layer.close(loding)
|
|
|
498
|
+ // layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
|
|
499
|
+ // }
|
|
|
500
|
+ // })
|
489
|
})
|
501
|
})
|
490
|
}
|
502
|
}
|
491
|
})
|
503
|
})
|
|
@@ -537,8 +549,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -537,8 +549,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
537
|
resize: false,
|
549
|
resize: false,
|
538
|
area: ['50%', '40%'],
|
550
|
area: ['50%', '40%'],
|
539
|
success: function (indexm, layero) {
|
551
|
success: function (indexm, layero) {
|
540
|
- $.ajax({
|
|
|
541
|
- url: common.domainName + '/api-web/manage/task/page?page=-1&limit=-1&access_token=' + accessToken,
|
552
|
+ admin.req({
|
|
|
553
|
+ url: common.domainName + '/api-web/manage/task/page?page=-1&limit=-1' ,
|
542
|
success: function (res) {
|
554
|
success: function (res) {
|
543
|
$.each(res.data, function (i, e) {
|
555
|
$.each(res.data, function (i, e) {
|
544
|
var option = '<option value="' + e.taskId + '">' + e.taskName + '</option>'
|
556
|
var option = '<option value="' + e.taskId + '">' + e.taskName + '</option>'
|
|
@@ -560,8 +572,35 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -560,8 +572,35 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
560
|
})
|
572
|
})
|
561
|
}
|
573
|
}
|
562
|
})
|
574
|
})
|
|
|
575
|
+ },
|
|
|
576
|
+ error: function (err) {
|
563
|
}
|
577
|
}
|
564
|
- })
|
578
|
+ });
|
|
|
579
|
+ // $.ajax({
|
|
|
580
|
+ // url: common.domainName + '/api-web/manage/task/page?page=-1&limit=-1&access_token=' + accessToken,
|
|
|
581
|
+ // success: function (res) {
|
|
|
582
|
+ // $.each(res.data, function (i, e) {
|
|
|
583
|
+ // var option = '<option value="' + e.taskId + '">' + e.taskName + '</option>'
|
|
|
584
|
+ // $("#resChooseTaskSelect").append(option);
|
|
|
585
|
+ // })
|
|
|
586
|
+ // $("#resChooseTaskSelect").on("change", function () {
|
|
|
587
|
+ // var $that = $(this);
|
|
|
588
|
+ // $("#resChooseTaskTempSelect").empty();
|
|
|
589
|
+ // $("#resChooseTaskTempSelect").append('<option value="">请选择</option>')
|
|
|
590
|
+ // if ($that.val()) {
|
|
|
591
|
+ // $.ajax({
|
|
|
592
|
+ // url: common.domainName + '/api-web/manage/restemp/findByTaskId?taskId=' + $that.val() + '&access_token=' + accessToken,
|
|
|
593
|
+ // success: function (tempRes) {
|
|
|
594
|
+ // $.each(tempRes.data, function (k, j) {
|
|
|
595
|
+ // var option = '<option value="' + j.checkTempId + '">' + j.taskId + '</option>'
|
|
|
596
|
+ // $("#resChooseTaskTempSelect").append(option);
|
|
|
597
|
+ // })
|
|
|
598
|
+ // }
|
|
|
599
|
+ // })
|
|
|
600
|
+ // }
|
|
|
601
|
+ // })
|
|
|
602
|
+ // }
|
|
|
603
|
+ // })
|
565
|
},
|
604
|
},
|
566
|
yes: function (index, layero) {
|
605
|
yes: function (index, layero) {
|
567
|
if (callback && callback()) {
|
606
|
if (callback && callback()) {
|
|
@@ -574,8 +613,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -574,8 +613,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
574
|
|
613
|
|
575
|
//告警模板
|
614
|
//告警模板
|
576
|
$("#resManageAlarmTemp").unbind("click").on("click", function () {
|
615
|
$("#resManageAlarmTemp").unbind("click").on("click", function () {
|
577
|
- if ($.inArray('back:resource:relalarmtemp', checkList) == -1) {
|
|
|
578
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
616
|
+ if (!common.hasPermission('back:resource:relalarmtemp')){
|
579
|
return;
|
617
|
return;
|
580
|
}
|
618
|
}
|
581
|
var data = table.checkStatus('resManageTable').data;
|
619
|
var data = table.checkStatus('resManageTable').data;
|
|
@@ -593,8 +631,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -593,8 +631,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
593
|
return false;
|
631
|
return false;
|
594
|
}
|
632
|
}
|
595
|
var loding = layer.load(2);
|
633
|
var loding = layer.load(2);
|
596
|
- $.ajax({
|
|
|
597
|
- url: common.domainName + '/api-web/manage/resource/alarmTemplate?resIds=' + resIds.toString() + '&alarmTempId=' + alarmtemplateData[0].alarmTempId + '&access_token=' + accessToken,
|
634
|
+ admin.req({
|
|
|
635
|
+ url: common.domainName + '/api-web/manage/resource/alarmTemplate?resIds=' + resIds.toString() + '&alarmTempId=' + alarmtemplateData[0].alarmTempId ,
|
598
|
success: function (res) {
|
636
|
success: function (res) {
|
599
|
layer.close(loding);
|
637
|
layer.close(loding);
|
600
|
layer.msg('配置成功', {
|
638
|
layer.msg('配置成功', {
|
|
@@ -606,11 +644,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -606,11 +644,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
606
|
reloadTable();
|
644
|
reloadTable();
|
607
|
});
|
645
|
});
|
608
|
},
|
646
|
},
|
609
|
- error: function () {
|
647
|
+ error: function (err) {
|
610
|
layer.close(loding)
|
648
|
layer.close(loding)
|
611
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
649
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
612
|
}
|
650
|
}
|
613
|
- })
|
651
|
+ });
|
|
|
652
|
+ // $.ajax({
|
|
|
653
|
+ // url: common.domainName + '/api-web/manage/resource/alarmTemplate?resIds=' + resIds.toString() + '&alarmTempId=' + alarmtemplateData[0].alarmTempId + '&access_token=' + accessToken,
|
|
|
654
|
+ // success: function (res) {
|
|
|
655
|
+ // layer.close(loding);
|
|
|
656
|
+ // layer.msg('配置成功', {
|
|
|
657
|
+ // offset: '15px'
|
|
|
658
|
+ // , icon: 1
|
|
|
659
|
+ // , time: 1500
|
|
|
660
|
+ // }, function () {
|
|
|
661
|
+ // layer.closeAll();
|
|
|
662
|
+ // reloadTable();
|
|
|
663
|
+ // });
|
|
|
664
|
+ // },
|
|
|
665
|
+ // error: function () {
|
|
|
666
|
+ // layer.close(loding)
|
|
|
667
|
+ // layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
|
|
668
|
+ // }
|
|
|
669
|
+ // })
|
614
|
}, resIds);
|
670
|
}, resIds);
|
615
|
}
|
671
|
}
|
616
|
})
|
672
|
})
|
|
@@ -645,8 +701,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -645,8 +701,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
645
|
|
701
|
|
646
|
//资源管理告警订阅
|
702
|
//资源管理告警订阅
|
647
|
$("#resManageSub").unbind("click").on("click", function () {
|
703
|
$("#resManageSub").unbind("click").on("click", function () {
|
648
|
- if ($.inArray('back:resource:setResSubsrib', checkList) == -1) {
|
|
|
649
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
704
|
+ if (!common.hasPermission('back:resource:setResSubsrib')){
|
650
|
return;
|
705
|
return;
|
651
|
}
|
706
|
}
|
652
|
var data = table.checkStatus('resManageTable').data;
|
707
|
var data = table.checkStatus('resManageTable').data;
|
|
@@ -664,8 +719,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -664,8 +719,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
664
|
return false;
|
719
|
return false;
|
665
|
}
|
720
|
}
|
666
|
var loding = layer.load(2);
|
721
|
var loding = layer.load(2);
|
667
|
- $.ajax({
|
|
|
668
|
- url: common.domainName + '/api-web/manage/resource/resourceSub?resIds=' + resIds.toString() + '&subId=' + subData[0].subId + '&access_token=' + accessToken,
|
722
|
+ admin.req({
|
|
|
723
|
+ url: common.domainName + '/api-web/manage/resource/resourceSub?resIds=' + resIds.toString() + '&subId=' + subData[0].subId ,
|
669
|
success: function (res) {
|
724
|
success: function (res) {
|
670
|
layer.close(loding);
|
725
|
layer.close(loding);
|
671
|
layer.msg('配置成功', {
|
726
|
layer.msg('配置成功', {
|
|
@@ -677,11 +732,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -677,11 +732,29 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
677
|
reloadTable();
|
732
|
reloadTable();
|
678
|
});
|
733
|
});
|
679
|
},
|
734
|
},
|
680
|
- error: function () {
|
735
|
+ error: function (err) {
|
681
|
layer.close(loding)
|
736
|
layer.close(loding)
|
682
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
737
|
layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
683
|
}
|
738
|
}
|
684
|
- })
|
739
|
+ });
|
|
|
740
|
+ // $.ajax({
|
|
|
741
|
+ // url: common.domainName + '/api-web/manage/resource/resourceSub?resIds=' + resIds.toString() + '&subId=' + subData[0].subId + '&access_token=' + accessToken,
|
|
|
742
|
+ // success: function (res) {
|
|
|
743
|
+ // layer.close(loding);
|
|
|
744
|
+ // layer.msg('配置成功', {
|
|
|
745
|
+ // offset: '15px'
|
|
|
746
|
+ // , icon: 1
|
|
|
747
|
+ // , time: 1500
|
|
|
748
|
+ // }, function () {
|
|
|
749
|
+ // layer.closeAll();
|
|
|
750
|
+ // reloadTable();
|
|
|
751
|
+ // });
|
|
|
752
|
+ // },
|
|
|
753
|
+ // error: function () {
|
|
|
754
|
+ // layer.close(loding)
|
|
|
755
|
+ // layer.msg("配置失败!服务异常", {offset: '15px', icon: 7, time: 2000});
|
|
|
756
|
+ // }
|
|
|
757
|
+ // })
|
685
|
}, resIds)
|
758
|
}, resIds)
|
686
|
form.render();
|
759
|
form.render();
|
687
|
}
|
760
|
}
|
|
@@ -732,8 +805,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -732,8 +805,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
732
|
|
805
|
|
733
|
//资源授权
|
806
|
//资源授权
|
734
|
$('#res-user-grant-btn').unbind("click").on('click', function () {
|
807
|
$('#res-user-grant-btn').unbind("click").on('click', function () {
|
735
|
- if ($.inArray('back:resource:impower', checkList) == -1) {
|
|
|
736
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
808
|
+ if (!common.hasPermission('back:resource:impower')){
|
737
|
return;
|
809
|
return;
|
738
|
}
|
810
|
}
|
739
|
resManageAuthorization()
|
811
|
resManageAuthorization()
|
|
@@ -931,8 +1003,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -931,8 +1003,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
931
|
|
1003
|
|
932
|
//点击协议名称 进行编辑
|
1004
|
//点击协议名称 进行编辑
|
933
|
$('[resmanage-data-edit]').unbind("click").on('click', function () {
|
1005
|
$('[resmanage-data-edit]').unbind("click").on('click', function () {
|
934
|
- if ($.inArray('back:resource:update', checkList) == -1) {
|
|
|
935
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
1006
|
+ if (!common.hasPermission('back:resource:update')){
|
936
|
return;
|
1007
|
return;
|
937
|
}
|
1008
|
}
|
938
|
openEditHtml($(this).attr("resmanage-data-edit"), $(this).data("restype"), false);
|
1009
|
openEditHtml($(this).attr("resmanage-data-edit"), $(this).data("restype"), false);
|
|
@@ -958,12 +1029,12 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -958,12 +1029,12 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
958
|
resId: $that.attr("resmanage-data-stopcoll"),
|
1029
|
resId: $that.attr("resmanage-data-stopcoll"),
|
959
|
state: $that.data("param")
|
1030
|
state: $that.data("param")
|
960
|
}
|
1031
|
}
|
961
|
- $.ajax({
|
|
|
962
|
- url: common.domainName + '/api-web/manage/resource/stopOrStartColl?access_token=' + accessToken
|
|
|
963
|
- , data: JSON.stringify(opj)
|
1032
|
+ admin.req({
|
|
|
1033
|
+ url: common.domainName + '/api-web/manage/resource/stopOrStartColl'
|
|
|
1034
|
+ ,data: JSON.stringify(opj)
|
964
|
, type: 'post'
|
1035
|
, type: 'post'
|
965
|
- , contentType: "application/json; charset=utf-8"
|
|
|
966
|
- , success: function (res) {
|
1036
|
+ , contentType: "application/json; charset=utf-8",
|
|
|
1037
|
+ success: function (res) {
|
967
|
if (res.success) {
|
1038
|
if (res.success) {
|
968
|
layer.close(loding);
|
1039
|
layer.close(loding);
|
969
|
layer.msg('操作成功', {
|
1040
|
layer.msg('操作成功', {
|
|
@@ -982,7 +1053,32 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -982,7 +1053,32 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
982
|
layer.closeAll();
|
1053
|
layer.closeAll();
|
983
|
console.error(res);
|
1054
|
console.error(res);
|
984
|
}
|
1055
|
}
|
985
|
- })
|
1056
|
+ });
|
|
|
1057
|
+ // $.ajax({
|
|
|
1058
|
+ // url: common.domainName + '/api-web/manage/resource/stopOrStartColl?access_token=' + accessToken
|
|
|
1059
|
+ // , data: JSON.stringify(opj)
|
|
|
1060
|
+ // , type: 'post'
|
|
|
1061
|
+ // , contentType: "application/json; charset=utf-8"
|
|
|
1062
|
+ // , success: function (res) {
|
|
|
1063
|
+ // if (res.success) {
|
|
|
1064
|
+ // layer.close(loding);
|
|
|
1065
|
+ // layer.msg('操作成功', {
|
|
|
1066
|
+ // offset: '15px'
|
|
|
1067
|
+ // , icon: 1
|
|
|
1068
|
+ // , time: 1500
|
|
|
1069
|
+ // }, function () {
|
|
|
1070
|
+ // layer.closeAll();
|
|
|
1071
|
+ // reloadTable();
|
|
|
1072
|
+ // });
|
|
|
1073
|
+ // } else {
|
|
|
1074
|
+ // layer.msg('操作异常:' + res.msg, {icon: 7, time: 3000});
|
|
|
1075
|
+ // }
|
|
|
1076
|
+ // },
|
|
|
1077
|
+ // error: function (res) {
|
|
|
1078
|
+ // layer.closeAll();
|
|
|
1079
|
+ // console.error(res);
|
|
|
1080
|
+ // }
|
|
|
1081
|
+ // })
|
986
|
});
|
1082
|
});
|
987
|
});
|
1083
|
});
|
988
|
// 加入/移出收藏夹
|
1084
|
// 加入/移出收藏夹
|
|
@@ -1427,10 +1523,11 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1427,10 +1523,11 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1427
|
subIds: formdata.subIds
|
1523
|
subIds: formdata.subIds
|
1428
|
}
|
1524
|
}
|
1429
|
var loding = layer.load(2);
|
1525
|
var loding = layer.load(2);
|
1430
|
- $.ajax({
|
|
|
1431
|
- url: common.domainName + '/api-web/manage/resource/saveResAlarmAndTaskInfo?access_token=' + accessToken,
|
1526
|
+ admin.req({
|
|
|
1527
|
+ //修改扩展字段T3/IOp值
|
|
|
1528
|
+ url: common.domainName + '/api-web/manage/resource/saveResAlarmAndTaskInfo',
|
1432
|
data: param,
|
1529
|
data: param,
|
1433
|
- success: function (res) {
|
1530
|
+ success: function (response) {
|
1434
|
layer.msg('配置成功', {offset: '15px', icon: 1, time: 2000}, function () {
|
1531
|
layer.msg('配置成功', {offset: '15px', icon: 1, time: 2000}, function () {
|
1435
|
layer.closeAll();
|
1532
|
layer.closeAll();
|
1436
|
reloadTable();
|
1533
|
reloadTable();
|
|
@@ -1440,10 +1537,27 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1440,10 +1537,27 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1440
|
});
|
1537
|
});
|
1441
|
|
1538
|
|
1442
|
},
|
1539
|
},
|
1443
|
- error: function (res) {
|
1540
|
+ error: function (err) {
|
1444
|
layer.close(loding);
|
1541
|
layer.close(loding);
|
1445
|
}
|
1542
|
}
|
1446
|
- })
|
1543
|
+ });
|
|
|
1544
|
+ // $.ajax({
|
|
|
1545
|
+ // url: common.domainName + '/api-web/manage/resource/saveResAlarmAndTaskInfo?access_token=' + accessToken,
|
|
|
1546
|
+ // data: param,
|
|
|
1547
|
+ // success: function (res) {
|
|
|
1548
|
+ // layer.msg('配置成功', {offset: '15px', icon: 1, time: 2000}, function () {
|
|
|
1549
|
+ // layer.closeAll();
|
|
|
1550
|
+ // reloadTable();
|
|
|
1551
|
+ // if (next == '1') {
|
|
|
1552
|
+ // openResourceRelationConfigHtml(bean.resId, bean.resType)
|
|
|
1553
|
+ // }
|
|
|
1554
|
+ // });
|
|
|
1555
|
+ //
|
|
|
1556
|
+ // },
|
|
|
1557
|
+ // error: function (res) {
|
|
|
1558
|
+ // layer.close(loding);
|
|
|
1559
|
+ // }
|
|
|
1560
|
+ // })
|
1447
|
})
|
1561
|
})
|
1448
|
|
1562
|
|
1449
|
},
|
1563
|
},
|
|
@@ -1472,8 +1586,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1472,8 +1586,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1472
|
|
1586
|
|
1473
|
//资源关系配置
|
1587
|
//资源关系配置
|
1474
|
$('#res_relation_config').unbind().on('click', function (obj) {
|
1588
|
$('#res_relation_config').unbind().on('click', function (obj) {
|
1475
|
- if ($.inArray('back:resource:relation', checkList) == -1) {
|
|
|
1476
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
1589
|
+ if (!common.hasPermission('back:resource:relation')){
|
1477
|
return;
|
1590
|
return;
|
1478
|
}
|
1591
|
}
|
1479
|
var data = table.checkStatus('resManageTable').data;
|
1592
|
var data = table.checkStatus('resManageTable').data;
|
|
@@ -1521,7 +1634,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1521,7 +1634,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1521
|
layer.msg("请先选择关系类型!", {offset: '15px', icon: 7, time: 2000});
|
1634
|
layer.msg("请先选择关系类型!", {offset: '15px', icon: 7, time: 2000});
|
1522
|
return false;
|
1635
|
return false;
|
1523
|
}
|
1636
|
}
|
1524
|
- $.ajax({
|
1637
|
+ admin.req({
|
|
|
1638
|
+ //修改扩展字段T3/IOp值
|
1525
|
url: common.domainName + '/api-web/manage/resource/findResRelationByResId',
|
1639
|
url: common.domainName + '/api-web/manage/resource/findResRelationByResId',
|
1526
|
async: false,
|
1640
|
async: false,
|
1527
|
data: {
|
1641
|
data: {
|
|
@@ -1535,8 +1649,26 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1535,8 +1649,26 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1535
|
resIds = res.data.map(item => {
|
1649
|
resIds = res.data.map(item => {
|
1536
|
return item.targetId;
|
1650
|
return item.targetId;
|
1537
|
})
|
1651
|
})
|
|
|
1652
|
+ },
|
|
|
1653
|
+ error: function (err) {
|
1538
|
}
|
1654
|
}
|
1539
|
- })
|
1655
|
+ });
|
|
|
1656
|
+ // $.ajax({
|
|
|
1657
|
+ // url: common.domainName + '/api-web/manage/resource/findResRelationByResId',
|
|
|
1658
|
+ // async: false,
|
|
|
1659
|
+ // data: {
|
|
|
1660
|
+ // access_token: accessToken,
|
|
|
1661
|
+ // resId: resId,
|
|
|
1662
|
+ // reType: reType,
|
|
|
1663
|
+ // page: 1,
|
|
|
1664
|
+ // limit: -1
|
|
|
1665
|
+ // },
|
|
|
1666
|
+ // success: function (res) {
|
|
|
1667
|
+ // resIds = res.data.map(item => {
|
|
|
1668
|
+ // return item.targetId;
|
|
|
1669
|
+ // })
|
|
|
1670
|
+ // }
|
|
|
1671
|
+ // })
|
1540
|
common.openWin("template/res/reslist", "选择资源", {oldData: resIds}, ["选择"], function () {
|
1672
|
common.openWin("template/res/reslist", "选择资源", {oldData: resIds}, ["选择"], function () {
|
1541
|
var reslist = layui.reslist({});
|
1673
|
var reslist = layui.reslist({});
|
1542
|
var data = reslist.getData();
|
1674
|
var data = reslist.getData();
|
|
@@ -1559,8 +1691,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1559,8 +1691,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1559
|
reType: reType,
|
1691
|
reType: reType,
|
1560
|
arr: arr
|
1692
|
arr: arr
|
1561
|
}
|
1693
|
}
|
1562
|
- $.ajax({
|
|
|
1563
|
- url: common.domainName + '/api-web/manage/resource/saveResRelation?access_token=' + accessToken,
|
1694
|
+ admin.req({
|
|
|
1695
|
+ //修改扩展字段T3/IOp值
|
|
|
1696
|
+ url: common.domainName + '/api-web/manage/resource/saveResRelation',
|
1564
|
type: 'post',
|
1697
|
type: 'post',
|
1565
|
contentType: "application/json; charset=utf-8",
|
1698
|
contentType: "application/json; charset=utf-8",
|
1566
|
data: JSON.stringify(param),
|
1699
|
data: JSON.stringify(param),
|
|
@@ -1570,10 +1703,25 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1570,10 +1703,25 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1570
|
relationTableRender(resId);
|
1703
|
relationTableRender(resId);
|
1571
|
});
|
1704
|
});
|
1572
|
},
|
1705
|
},
|
1573
|
- error: function (res) {
|
1706
|
+ error: function (err) {
|
1574
|
layer.close(loding);
|
1707
|
layer.close(loding);
|
1575
|
}
|
1708
|
}
|
1576
|
- })
|
1709
|
+ });
|
|
|
1710
|
+ // $.ajax({
|
|
|
1711
|
+ // url: common.domainName + '/api-web/manage/resource/saveResRelation?access_token=' + accessToken,
|
|
|
1712
|
+ // type: 'post',
|
|
|
1713
|
+ // contentType: "application/json; charset=utf-8",
|
|
|
1714
|
+ // data: JSON.stringify(param),
|
|
|
1715
|
+ // success: function (res) {
|
|
|
1716
|
+ // layer.msg('保存成功!', {icon: 1, time: 1500}, function () {
|
|
|
1717
|
+ // layer.close(loding);
|
|
|
1718
|
+ // relationTableRender(resId);
|
|
|
1719
|
+ // });
|
|
|
1720
|
+ // },
|
|
|
1721
|
+ // error: function (res) {
|
|
|
1722
|
+ // layer.close(loding);
|
|
|
1723
|
+ // }
|
|
|
1724
|
+ // })
|
1577
|
return true;
|
1725
|
return true;
|
1578
|
})
|
1726
|
})
|
1579
|
})
|
1727
|
})
|
|
@@ -1809,8 +1957,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1809,8 +1957,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1809
|
}
|
1957
|
}
|
1810
|
|
1958
|
|
1811
|
function deleteByIds(ids) {
|
1959
|
function deleteByIds(ids) {
|
1812
|
- if ($.inArray('back:resource:delete', checkList) == -1) {
|
|
|
1813
|
- layer.msg('暂无权限!', {icon: 7, time: 3000});
|
1960
|
+ if (!common.hasPermission('back:resource:delete')){
|
1814
|
return;
|
1961
|
return;
|
1815
|
}
|
1962
|
}
|
1816
|
//确认提示框
|
1963
|
//确认提示框
|
|
@@ -1928,8 +2075,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1928,8 +2075,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1928
|
extend: extend
|
2075
|
extend: extend
|
1929
|
}
|
2076
|
}
|
1930
|
var loding = layer.load(2)
|
2077
|
var loding = layer.load(2)
|
1931
|
- $.ajax({
|
|
|
1932
|
- url: common.domainName + '/api-web/manage/resource/save?access_token=' + accessToken,
|
2078
|
+ admin.req({
|
|
|
2079
|
+ //修改扩展字段T3/IOp值
|
|
|
2080
|
+ url: common.domainName + '/api-web/manage/resource/save',
|
1933
|
type: 'post',
|
2081
|
type: 'post',
|
1934
|
data: JSON.stringify(param),
|
2082
|
data: JSON.stringify(param),
|
1935
|
contentType: "application/json;charset=utf-8",
|
2083
|
contentType: "application/json;charset=utf-8",
|
|
@@ -1944,10 +2092,30 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -1944,10 +2092,30 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
1944
|
}
|
2092
|
}
|
1945
|
});
|
2093
|
});
|
1946
|
},
|
2094
|
},
|
1947
|
- error: function (res) {
|
2095
|
+ error: function (err) {
|
1948
|
layer.close(loding)
|
2096
|
layer.close(loding)
|
1949
|
}
|
2097
|
}
|
1950
|
- })
|
2098
|
+ });
|
|
|
2099
|
+ // $.ajax({
|
|
|
2100
|
+ // url: common.domainName + '/api-web/manage/resource/save?access_token=' + accessToken,
|
|
|
2101
|
+ // type: 'post',
|
|
|
2102
|
+ // data: JSON.stringify(param),
|
|
|
2103
|
+ // contentType: "application/json;charset=utf-8",
|
|
|
2104
|
+ // success: function (res) {
|
|
|
2105
|
+ // layer.close(loding)
|
|
|
2106
|
+ // layer.msg('保存成功!', {icon: 1, time: 1500}, function () {
|
|
|
2107
|
+ // layer.closeAll();
|
|
|
2108
|
+ // reloadTable();
|
|
|
2109
|
+ // if (next == '1') {
|
|
|
2110
|
+ // //openCollTaskAndAlarm(res.object)
|
|
|
2111
|
+ // openResourceRelationConfigHtml(res.object.resId, res.object.resType)
|
|
|
2112
|
+ // }
|
|
|
2113
|
+ // });
|
|
|
2114
|
+ // },
|
|
|
2115
|
+ // error: function (res) {
|
|
|
2116
|
+ // layer.close(loding)
|
|
|
2117
|
+ // }
|
|
|
2118
|
+ // })
|
1951
|
}
|
2119
|
}
|
1952
|
|
2120
|
|
1953
|
//资源协议验证
|
2121
|
//资源协议验证
|
|
@@ -2084,9 +2252,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -2084,9 +2252,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
2084
|
userIds = userId.toString()
|
2252
|
userIds = userId.toString()
|
2085
|
var loading = layer.load(2);
|
2253
|
var loading = layer.load(2);
|
2086
|
var param = {userIds: userIds, resIds: resIds}
|
2254
|
var param = {userIds: userIds, resIds: resIds}
|
2087
|
- $.ajax({
|
|
|
2088
|
- type: "post",
|
|
|
2089
|
- url: domainName + "/api-web/manage/resource/grant?access_token=" + accessToken,
|
2255
|
+ admin.req({
|
|
|
2256
|
+ //修改扩展字段T3/IOp值
|
|
|
2257
|
+ url: domainName + "/api-web/manage/resource/grant",
|
2090
|
contentType: 'application/json;charset=UTF-8',
|
2258
|
contentType: 'application/json;charset=UTF-8',
|
2091
|
data: JSON.stringify(param),
|
2259
|
data: JSON.stringify(param),
|
2092
|
async: true,
|
2260
|
async: true,
|
|
@@ -2101,11 +2269,33 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -2101,11 +2269,33 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
2101
|
reloadTable()
|
2269
|
reloadTable()
|
2102
|
});
|
2270
|
});
|
2103
|
},
|
2271
|
},
|
2104
|
- error: function () {
|
2272
|
+ error: function (err) {
|
2105
|
layer.close(loading)
|
2273
|
layer.close(loading)
|
2106
|
layer.msg("授权失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
2274
|
layer.msg("授权失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
2107
|
}
|
2275
|
}
|
2108
|
- })
|
2276
|
+ });
|
|
|
2277
|
+ // $.ajax({
|
|
|
2278
|
+ // type: "post",
|
|
|
2279
|
+ // url: domainName + "/api-web/manage/resource/grant?access_token=" + accessToken,
|
|
|
2280
|
+ // contentType: 'application/json;charset=UTF-8',
|
|
|
2281
|
+ // data: JSON.stringify(param),
|
|
|
2282
|
+ // async: true,
|
|
|
2283
|
+ // success: function (res) {
|
|
|
2284
|
+ // layer.close(loading);
|
|
|
2285
|
+ // layer.msg('授权成功', {
|
|
|
2286
|
+ // offset: '15px'
|
|
|
2287
|
+ // , icon: 1
|
|
|
2288
|
+ // , time: 1500
|
|
|
2289
|
+ // }, function () {
|
|
|
2290
|
+ // layer.closeAll();
|
|
|
2291
|
+ // reloadTable()
|
|
|
2292
|
+ // });
|
|
|
2293
|
+ // },
|
|
|
2294
|
+ // error: function () {
|
|
|
2295
|
+ // layer.close(loading)
|
|
|
2296
|
+ // layer.msg("授权失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
|
|
2297
|
+ // }
|
|
|
2298
|
+ // })
|
2109
|
}
|
2299
|
}
|
2110
|
})
|
2300
|
})
|
2111
|
})
|
2301
|
})
|
|
@@ -2134,9 +2324,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -2134,9 +2324,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
2134
|
})
|
2324
|
})
|
2135
|
var loading = layer.load(2);
|
2325
|
var loading = layer.load(2);
|
2136
|
var param = {resType: resType, checkTempId: checkTempId.toString(), resId: resIds};
|
2326
|
var param = {resType: resType, checkTempId: checkTempId.toString(), resId: resIds};
|
2137
|
- $.ajax({
|
2327
|
+ admin.req({
|
2138
|
type: "get",
|
2328
|
type: "get",
|
2139
|
- url: domainName + "/api-web/manage/restemp/saveResTaskAndTemp?access_token=" + accessToken,
|
2329
|
+ url: domainName + "/api-web/manage/restemp/saveResTaskAndTemp" ,
|
2140
|
data: param,
|
2330
|
data: param,
|
2141
|
async: true,
|
2331
|
async: true,
|
2142
|
success: function (res) {
|
2332
|
success: function (res) {
|
|
@@ -2154,11 +2344,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
|
@@ -2154,11 +2344,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', |
2154
|
reloadTable()
|
2344
|
reloadTable()
|
2155
|
});
|
2345
|
});
|
2156
|
},
|
2346
|
},
|
2157
|
- error: function () {
|
2347
|
+ error: function (err) {
|
2158
|
layer.close(loading)
|
2348
|
layer.close(loading)
|
2159
|
layer.msg("保存失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
2349
|
layer.msg("保存失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
2160
|
}
|
2350
|
}
|
2161
|
- })
|
2351
|
+ });
|
|
|
2352
|
+ // $.ajax({
|
|
|
2353
|
+ // type: "get",
|
|
|
2354
|
+ // url: domainName + "/api-web/manage/restemp/saveResTaskAndTemp?access_token=" + accessToken,
|
|
|
2355
|
+ // data: param,
|
|
|
2356
|
+ // async: true,
|
|
|
2357
|
+ // success: function (res) {
|
|
|
2358
|
+ // layer.close(loading);
|
|
|
2359
|
+ // var icon = 1;
|
|
|
2360
|
+ // if ((res.success && res.data.length != 0) || !res.success) {
|
|
|
2361
|
+ // icon = 7;
|
|
|
2362
|
+ // }
|
|
|
2363
|
+ // layer.msg(res.msg, {
|
|
|
2364
|
+ // offset: '15px'
|
|
|
2365
|
+ // , icon: icon
|
|
|
2366
|
+ // , time: 1500
|
|
|
2367
|
+ // }, function () {
|
|
|
2368
|
+ // layer.closeAll();
|
|
|
2369
|
+ // reloadTable()
|
|
|
2370
|
+ // });
|
|
|
2371
|
+ // },
|
|
|
2372
|
+ // error: function () {
|
|
|
2373
|
+ // layer.close(loading)
|
|
|
2374
|
+ // layer.msg("保存失败,请联系管理员!", {offset: '15px', icon: 7, time: 2000});
|
|
|
2375
|
+ // }
|
|
|
2376
|
+ // })
|
2162
|
}
|
2377
|
}
|
2163
|
})
|
2378
|
})
|
2164
|
})
|
2379
|
})
|