You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.1 KiB

2 years ago
  1. 'use strict';
  2. var sProgramId = getProgramId(),
  3. sQueryPrgId = getQueryPrgId(),
  4. fnPageInit = function () {
  5. var oCurData = {
  6. ParentId1: '12345678910',
  7. ParentId2: '12345678911',
  8. ParentId3: '12345678912',
  9. Filelist1: [],
  10. Filelist2: [],
  11. Filelist3: []
  12. },
  13. oValidator = null,
  14. /*
  15. * ToolBar 按鈕事件 function
  16. * @param {Object}inst 按鈕物件對象
  17. * @param {Object} e 事件對象
  18. * @return
  19. * 起始作者John
  20. * 起始日期2016/05/21
  21. * 最新修改人John
  22. * 最新修日期2016/11/03
  23. */
  24. fnButtonHandler = function (inst, e) {
  25. var sId = inst.id;
  26. switch (sId) {
  27. case "Toolbar_Qry":
  28. break;
  29. case "Toolbar_Save":
  30. break;
  31. case "Toolbar_ReAdd":
  32. break;
  33. case "Toolbar_Clear":
  34. clearPageVal();
  35. break;
  36. case "Toolbar_Leave":
  37. pageLeave();
  38. break;
  39. case "Toolbar_Add":
  40. break;
  41. case "Toolbar_Upd":
  42. break;
  43. case "Toolbar_Copy":
  44. break;
  45. case "Toolbar_Del": // ╠message.ConfirmToDelete⇒確定要刪除嗎 ?╣ ╠common.Tips⇒提示╣
  46. layer.confirm(i18next.t("message.ConfirmToDelete"), { icon: 3, title: i18next.t('common.Tips') }, function (index) {
  47. fnDel();
  48. layer.close(index);
  49. });
  50. break;
  51. default:
  52. alert("No handle '" + sId + "'");
  53. break;
  54. }
  55. },
  56. /*
  57. * 初始化 function
  58. * @param
  59. * @return
  60. * 起始作者John
  61. * 起始日期2016/05/21
  62. * 最新修改人John
  63. * 最新修日期2016/11/03
  64. */
  65. init = function () {
  66. var callback1 = function (files) {
  67. var option = {};
  68. option.input = $('#fileInput1');
  69. option.limit = 1;
  70. option.extensions = ['jpg', 'jpeg', 'png', 'bmp', 'gif', 'png'];
  71. option.theme = 'box2';
  72. option.folder = 'Test';
  73. option.type = 'one';
  74. option.parentid = oCurData.ParentId1;
  75. option.files = files;
  76. fnUploadRegister(option);
  77. };
  78. var callback2 = function (files) {
  79. var option = {};
  80. option.input = $('#fileInput2');
  81. option.theme = 'box1';
  82. option.folder = 'Test';
  83. option.parentid = oCurData.ParentId2;
  84. option.files = files;
  85. fnUploadRegister(option);
  86. };
  87. var callback3 = function (files) {
  88. var option = {};
  89. option.input = $('#fileInput3');
  90. option.theme = 'box2';
  91. option.folder = 'Test';
  92. option.type = 'list';
  93. option.parentid = oCurData.ParentId3;
  94. option.files = files;
  95. fnUploadRegister(option);
  96. };
  97. $.whenArray([fnGetUploadFiles(oCurData.ParentId1, callback1),
  98. fnGetUploadFiles(oCurData.ParentId2, callback2),
  99. fnGetUploadFiles(oCurData.ParentId3, callback3)]);
  100. };
  101. init();
  102. };
  103. //require(['base', 'filer', 'util'], fnPageInit);
  104. var jsfnew = bundles.base.concat(bundles.filer, bundles.util);
  105. loadjs(jsfnew, 'jsfnew', { async: false });
  106. loadjs.ready(['jsfnew'], fnPageInit);