0e57c67a65765ce5df03044f146f9c34a6d7db0e.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. function initComplete(){
  2. /**
  3. * 工具条
  4. */
  5. var roleCons = roleButtonArr();
  6. var toolBarOpt1 = {
  7. items:[
  8. {text: '新增', click: "addUnit", iconClass: 'add1_tem',id:"10000"},
  9. {text: '删除', click: "deleteUnit", iconClass: 'delete_tem',id:"10002"},
  10. {text: '修改', click: "updateUnit", iconClass: 'update_tem',id:"10001"},
  11. {text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"}
  12. ],
  13. roleCons:roleCons
  14. };
  15. /**
  16. * 树形列
  17. */
  18. var grid_option1 = {
  19. columns: [
  20. { display: '源站名称', name: 'NAME_219', align: 'center', width: "30%",isPrimaryKey:true,
  21. render : function(rowdata, value) {
  22. return '<a href="javascript:void(0)" '
  23. + 'onclick=jumpPage("'
  24. + rowdata.FD_OBJECTID219
  25. +'")>'+ rowdata.NAME_219 +'</a>';
  26. }
  27. },
  28. { display: '源站URL', name: 'SOURCE_URL_219', align: 'center', width: "70%"}
  29. ],
  30. rownumbers : true,
  31. checkbox : true,
  32. pageSize : 10,
  33. percentWidthMode : true
  34. };
  35. var options1={
  36. url :'/nwyj/ws/crud/CRUDService/queryQui',
  37. params:loadParams,
  38. height: '100%',
  39. width:"100%",
  40. gridOptions:grid_option1,
  41. singleRecodeOptions:{a:"aa"},
  42. paperOpration:{showInput:"true"},
  43. toolBarOptions:toolBarOpt1
  44. };
  45. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  46. }
  47. //点击查看
  48. function jumpPage(id){
  49. window.location.href="configuration-update.jsp?"+id;
  50. }
  51. //新增
  52. function addUnit(){
  53. window.location.href="configuration-update.jsp";
  54. }
  55. //修改
  56. function updateUnit(){
  57. var rows = g.getSelectedRows();
  58. if(rows.length==0){
  59. top.Dialog.alert("请选择一条记录");
  60. return;
  61. }
  62. if(rows.length>1){
  63. top.Dialog.alert("只能选择一条记录");
  64. return;
  65. }
  66. var fd_id = rows[0].FD_OBJECTID219;
  67. window.location.href="configuration-update.jsp?"+fd_id;
  68. }
  69. //删除
  70. function deleteUnit(){
  71. var rows = g.getSelectedRows();
  72. var rowsLength = rows.length;
  73. if (rowsLength == 0) {
  74. top.Dialog.alert("请选中要删除的记录!");
  75. return;
  76. }
  77. var ids = "";
  78. for ( var i = 0; i < rowsLength; i++) {
  79. ids += rows[i].FD_OBJECTID219 + ",";
  80. }
  81. top.Dialog.confirm("确定要删除吗?|删除", function() {
  82. // 删除记录
  83. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  84. "objectIDs" : ids,
  85. classid : 219
  86. }, function(result) {
  87. if (result.Msg.sucsess == true) {
  88. $.messager.alert("删除成功",null,null,null,1);
  89. // 刷新表格数据
  90. g.rend();
  91. } else {
  92. top.Dialog.alert("删除失败!");
  93. }
  94. }, "json");
  95. });
  96. }
  97. //详情
  98. function onView(){
  99. var rows = g.getSelectedRows();
  100. if(rows.length==0){
  101. top.Dialog.alert("请选择一条记录");
  102. return;
  103. }
  104. if(rows.length>1){
  105. top.Dialog.alert("只能选择一条记录");
  106. return;
  107. }
  108. var fd_id = rows[0].FD_OBJECTID219;
  109. window.location.href="configuration-update.jsp?"+fd_id;
  110. }