main.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $(function() {
  2. //树形结构
  3. function treeOpenOrClose() {
  4. $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
  5. $('.tree li.parent_li > span').on('click', function(e) {
  6. var children = $(this).parent('li.parent_li').find(' > ul > li');
  7. if (children.is(":visible")) {
  8. children.hide('fast');
  9. $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
  10. } else {
  11. children.show('fast');
  12. $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
  13. }
  14. e.stopPropagation();
  15. });
  16. }
  17. treeOpenOrClose();
  18. // 单选框选项卡
  19. $(document).on('click', '.pure-table tbody tr', function() {
  20. $(this).addClass("selected").siblings().removeClass("selected");
  21. $(this).find(".status").addClass('checked').parent().siblings().find(".status").removeClass('checked');
  22. })
  23. //列表删除功能
  24. // $(".delete").click(function () {/** 批量删除*/
  25. // // alert(1)
  26. // $(".pure-table tbody tr.selected").each(function () {// 遍历选中的checkbox
  27. // var n = $(this).index(); // 获取checkbox所在行的顺序
  28. // delRow(n);
  29. // //alert(n)
  30. // });
  31. // //getListDataAjax(getSearchParamObj());
  32. // });
  33. // function delRow(n) {
  34. // $(".pure-table tbody").find("tr:eq(" + n + ")").remove(); //移除选中的行
  35. // }
  36. //新增模态框
  37. // $('.xcConfirm').hide()
  38. // $('.add').click(function () {
  39. // $('.xcConfirm').show()
  40. // })
  41. // $('.clsBtn,.cancel').click(function () {
  42. // //alert(1)
  43. // $('.xcConfirm').hide()
  44. // })
  45. // $('.handle').click(function () {
  46. // $('.xcConfirm.xcConfirm-handle').show()
  47. // })
  48. })