systemList.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!-- 系统管理 -->
  2. <div id="systemList" class="plg-tab-container">
  3. <div class="view">
  4. <div id="system" class="grid-container-full"></div>
  5. </div>
  6. </div>
  7. <script type="text/javascript">
  8. /**
  9. * guoj
  10. * 2018.11.01
  11. * 系统管理
  12. */
  13. (function () {
  14. var guodids = "";
  15. var system = { "search": "%", "pageNum": 1, "pageSize": 10 };
  16. var opts = {
  17. //terrace显示全部,card分页显示
  18. skin: "card",
  19. //renderer:"grid",
  20. columns: [
  21. { id: "p_id", name: "系统ID", type: 'txt', width: "130", hidden: true },
  22. { id: "p_systemid", name: "系统编号", type: 'ro', width: "100" },
  23. { id: "p_systemname", name: "系统名称", type: 'ro', width: "100" },
  24. { id: "p_modifierid", name: "修饰物", type: 'ro', width: "100" },
  25. { id: "p_modifiername", name: "修饰名", type: 'ro', width: "100" },
  26. { id: "p_platformid", name: "板状", type: 'ro', width: "100" },
  27. { id: "p_enable", name: "是否启用", type: 'ch', width: "100" },
  28. { id: "p_createtime", name: "创建时间", type: 'ro', width: "150" },
  29. { id: "p_lastmodifytime", name: "最后修改时间", type: 'ro', width: "150" },
  30. { id: "p_creatorid", name: "创建人", type: 'ro', width: "100" },
  31. { id: "p_creatorname", name: "创建人名称", type: 'ro', width: "100" },
  32. {
  33. id: "op", name: "操作", type: 'button', align: "left", fixed: 'right', width: "*", render: function (v, record) {
  34. return "删除^system_deleteClick,修改^system_updataClick";
  35. }
  36. }
  37. ],
  38. // multiselect: true,
  39. toolbar: [
  40. { type: "newcolumn", offset: 10 },
  41. { type: "input", name: "search", label: "系统编号/名称:", tooltip: 'll', width: 260 },
  42. { type: "newcolumn", offset: 10 },
  43. { type: "button", name: "querywork", width: 50, value: "查询" }, { type: "newcolumn" },
  44. { type: "button", name: "sys_Reset", width: 50, className: " normal",value: "重置" }, { type: "newcolumn" },
  45. { type: "button", name: "impandexpBtn", width: 80, offsetLeft: 10, className: "plg-toolbar-right normal", value: "<i class='layui-icon layui-icon-file-b'></i>导入/导出" }, { type: "newcolumn" },
  46. { type: "button", name: "addBtn", width: 50, offsetLeft: 10, className: "plg-toolbar-right", value: "<i class='layui-icon layui-icon-add-1'></i>新增" }, { type: "newcolumn" },],
  47. formData: [
  48. { type: "settings", position: "label-left", width: 300, labelWidth: 80 },
  49. { type: "hidden", name: "p_id", label: "id:", tooltip: 'll', width: 100 },
  50. { type: "input", name: "p_systemid", label: "系统编号:", tooltip: 'll', width: 260, editable: false, validate: "NotEmpty", required: true },
  51. { type: "input", name: "p_systemname", label: "系统名称:", tooltip: 'll', width: 260, validate: "NotEmpty", required: true },
  52. { type: "input", name: "p_modifierid", label: "修饰物:", tooltip: 'll', width: 260 },
  53. { type: "input", name: "p_modifiername", label: "修饰名:", tooltip: 'll', width: 260 },
  54. { type: "input", name: "p_platformid", label: "板状:", tooltip: 'll', width: 260 },
  55. { type: "checkbox", name: "p_enable", label: "是否启用:", tooltip: 'll', width: 260 }],
  56. imagePath: "/prologui/assets/PlgGrid",
  57. // /api/service-users/
  58. url: "/api/service-users/sys/getIPlgFxSystemPage/v1.0",//数据接口
  59. type: "POST",//数据提交方式,默认为get
  60. // pagebar: {
  61. // buttons: [
  62. // { text: "<i class='layui-icon layui-icon-delete '></i>删除", className: "layui-btn layui-btn-primary layui-btn-sm", name: "delete" }
  63. // ],
  64. // type: 'simple' //full simple
  65. // },
  66. // contentType: "application/json",
  67. params: system,//查询提交参数,分页参数默认为pageNum,pageSize
  68. page: true, //是否启用分页
  69. totalCount: "totalCount" //总记录数字段,默认totalCount
  70. };
  71. //分页参数 pageSize pageNum
  72. var grid = new PlgGrid(opts);
  73. grid.renderTo("system");
  74. grid.loadData();
  75. //单击事件
  76. grid.on("onRowSelect", function (id, ind) {
  77. guodids = id;
  78. });
  79. //按钮添加方法
  80. grid.attachToolBarEvent("onButtonClick", function (name) {
  81. if (name == "querywork") {
  82. var fdata = grid.getToolBarForm().getFormData();
  83. grid.setParams(fdata);
  84. grid.reload();
  85. }
  86. if (name == "addBtn") {
  87. grid.showDialog(0, '新增', 400, 500, { url: "/api/service-users/sys/insertPlgFxSystem/v1.0", type: 'post', contentType: 'application/json' });
  88. }
  89. if (name == "impandexpBtn") {
  90. utilImportGJ("/download/工作台模板.xlsx", "/api/service-users/container/deleteContainer/v1.0");
  91. }
  92. if (name == "sys_Reset") {
  93. grid.getToolBarForm().clear();
  94. }
  95. });
  96. //双击事件
  97. grid.on("onRowDblClicked", function (id, ids) {
  98. grid.showDialog(1, '编辑', 400, 500, { url: "/api/service-users/sys/updatePlgFxSystem/v1.0", type: 'put', contentType: 'application/json' });
  99. });
  100. //删除
  101. window.system_deleteClick = function (rid, data) {
  102. var data = { "id": rid };
  103. utilDelete("/api/service-users/sys/deletePlgFxSystemById/v1.0", "post", data, function (data) {
  104. layer.msg(data.message);
  105. grid.reload();
  106. });
  107. }
  108. //修改
  109. window.system_updataClick = function (rid, data) {
  110. grid.selectRowById(rid);
  111. grid.showDialog(1, '编辑', 400, 500, { url: "/api/service-users/sys/updatePlgFxSystem/v1.0", type: 'put', contentType: 'application/json' });
  112. }
  113. })()
  114. </script>