channelplanFile.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * channelplan管理初始化
  3. */
  4. var ChannelplanFile = {
  5. id: "ChannelplanFileTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChannelplanFile.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '', field: 'id', visible: true, align: 'center', valign: 'middle'},
  17. {title: '海峡申报计划ID', field: 'cpId', visible: true, align: 'center', valign: 'middle'},
  18. {title: '成员ID', field: 'memberTypeId', visible: true, align: 'center', valign: 'middle'},
  19. {title: '附件类别ID', field: 'typeId', visible: true, align: 'center', valign: 'middle'},
  20. {title: '附件原名', field: 'oldName', visible: true, align: 'center', valign: 'middle'},
  21. {title: '附件新名', field: 'url', visible: true, align: 'center', valign: 'middle'},
  22. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'},
  23. {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
  24. {title: '创建用户', field: 'createUser', visible: true, align: 'center', valign: 'middle'},
  25. {title: '更新时间', field: 'updateTime', visible: true, align: 'center', valign: 'middle'},
  26. {title: '更新用户', field: 'updateUser', visible: true, align: 'center', valign: 'middle'}
  27. ];
  28. };
  29. /**
  30. * 检查是否选中
  31. */
  32. ChannelplanFile.check = function () {
  33. var selected = $('#' + this.id).bootstrapTable('getSelections');
  34. if(selected.length == 0){
  35. Feng.info("请先选中表格中的某一记录!");
  36. return false;
  37. }else{
  38. ChannelplanFile.seItem = selected[0];
  39. return true;
  40. }
  41. };
  42. /**
  43. * 点击添加channelplan
  44. */
  45. ChannelplanFile.openAddChannelplanFile = function () {
  46. var index = layer.open({
  47. type: 2,
  48. title: '添加channelplan',
  49. area: ['800px', '420px'], //宽高
  50. fix: false, //不固定
  51. maxmin: true,
  52. content: Feng.ctxPath + '/channelplanFile/channelplanFile_add'
  53. });
  54. this.layerIndex = index;
  55. };
  56. /**
  57. * 打开查看channelplan详情
  58. */
  59. ChannelplanFile.openChannelplanFileDetail = function () {
  60. if (this.check()) {
  61. var index = layer.open({
  62. type: 2,
  63. title: 'channelplan详情',
  64. area: ['800px', '420px'], //宽高
  65. fix: false, //不固定
  66. maxmin: true,
  67. content: Feng.ctxPath + '/channelplanFile/channelplanFile_update/' + ChannelplanFile.seItem.id
  68. });
  69. this.layerIndex = index;
  70. }
  71. };
  72. /**
  73. * 删除channelplan
  74. */
  75. ChannelplanFile.delete = function () {
  76. if (this.check()) {
  77. var ajax = new $ax(Feng.ctxPath + "/channelplanFile/delete", function (data) {
  78. Feng.success("删除成功!");
  79. ChannelplanFile.table.refresh();
  80. }, function (data) {
  81. Feng.error("删除失败!" + data.responseJSON.message + "!");
  82. });
  83. ajax.set("channelplanFileId",this.seItem.id);
  84. ajax.start();
  85. }
  86. };
  87. /**
  88. * 查询channelplan列表
  89. */
  90. ChannelplanFile.search = function () {
  91. var queryData = {};
  92. queryData['condition'] = $("#condition").val();
  93. ChannelplanFile.table.refresh({query: queryData});
  94. };
  95. $(function () {
  96. var defaultColunms = ChannelplanFile.initColumn();
  97. var table = new BSTable(ChannelplanFile.id, "/channelplanFile/list", defaultColunms);
  98. table.setPaginationType("client");
  99. ChannelplanFile.table = table.init();
  100. });