stree_list.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. $(function () {
  2. });
  3. /*
  4. 参数解释:
  5. title 标题
  6. url 请求的url
  7. id 需要操作的数据id
  8. w 弹出层宽度(缺省调默认值)
  9. h 弹出层高度(缺省调默认值)
  10. */
  11. /*管理员-增加*/
  12. function slides_add(title, url, w, h) {
  13. layer_show(title, pagePath + url, w, h);
  14. }
  15. /*管理员-编辑*/
  16. function slides_edit(title, url, w, h) {
  17. layer_show(title, pagePath + url, w, h);
  18. }
  19. /*管理员-详情*/
  20. function slides_info(title, url, w, h) {
  21. layer_show(title, pagePath + url, w, h);
  22. }
  23. /*管理员-批量删除*/
  24. function slides_del(a) {
  25. var id = $(a).parents('tr').children('td').eq(0).children('input').attr('id')
  26. layer.confirm('确认要删除吗?', function (index) {
  27. $.ajax({
  28. url: pagePath + "/super/stree/delete",
  29. type: "put",
  30. data: {'ids': id},
  31. dataType: "json",
  32. success: function (result) {
  33. if (result.success) {
  34. smileMessage(result.message)
  35. setTime();
  36. } else {
  37. errorMessage(result.message);
  38. }
  39. },
  40. error: function () {
  41. errorMessage('系统错误!');
  42. }
  43. });
  44. });
  45. }
  46. /*管理员-删除*/
  47. function slides_delete(obj, url) {
  48. layer.confirm('确认要删除吗?', function (index) {
  49. //此处请求后台程序,下方是成功后的前台处理……
  50. $.ajax({
  51. type: "DELETE",
  52. dataType: "json",
  53. url: pagePath + url,
  54. data: {
  55. "timestamp": new Date().getTime()
  56. },
  57. success: function (result) {
  58. if (result.success) {
  59. smileMessage(result.message)
  60. setTime();
  61. } else {
  62. errorMessage(result.message);
  63. }
  64. },
  65. error: function () {
  66. errorMessage('系统错误!');
  67. }
  68. });
  69. });
  70. }
  71. /**
  72. * 禁用|启用
  73. * @param ids
  74. */
  75. function slides_status(urls, isLock, obj) {
  76. var msg = "确认要启用吗";
  77. if (!isLock) {
  78. msg = "确认要禁用吗?";
  79. }
  80. layer.confirm(msg, function (index) {
  81. //此处请求后台程序,下方是成功后的前台处理……
  82. $.ajax({
  83. type: "Post",
  84. dataType: "json",
  85. url: pagePath + urls,
  86. data: {
  87. "isLock": isLock
  88. },
  89. success: function (result) {
  90. if (result.success) {
  91. smileMessage(result.message);
  92. setTime();
  93. } else {
  94. errorMessage(result.message);
  95. }
  96. },
  97. error: function () {
  98. errorMessage('系统错误!');
  99. }
  100. });
  101. });
  102. }