excel.ui.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. window.submitForm = function(type)
  2. {
  3. $('#importNoticeModal [name=insert]').val(type == 'insert' ? 1 : 0);
  4. };
  5. window.renderRowData = function($row, index, row)
  6. {
  7. $row.find('[data-name="module"]').find('.picker-box').on('inited', function(e, info)
  8. {
  9. const $modulePicker = info[0];
  10. $modulePicker.render({items: modules[row.branch == undefined || row.branch == '' ? 0 : row.branch]});
  11. $modulePicker.$.setValue(row.module);
  12. });
  13. $row.find('[data-name="story"]').find('.picker-box').on('inited', function(e, info)
  14. {
  15. const $storyPicker = info[0];
  16. $storyPicker.render({items: stories[row.branch == undefined || row.branch == '' ? 0 : row.branch]});
  17. $storyPicker.$.setValue(row.story);
  18. });
  19. }
  20. function changeModule(event)
  21. {
  22. const $target = $(event.target);
  23. const moduleID = $target.val();
  24. const $storyPicker = $target.closest('tr').find('.form-batch-control[data-name="story"] .picker').zui('picker');
  25. const oldStory = $storyPicker.$.value;
  26. $storyPicker.render({items: stories[moduleID]});
  27. $storyPicker.$.setValue(oldStory);
  28. }
  29. function changeBranch(event)
  30. {
  31. const $target = $(event.target);
  32. const branchID = $target.val();
  33. const $modulePicker = $target.closest('tr').find('.form-batch-control[data-name="module"] .picker').zui('picker');
  34. const oldModule = $modulePicker.$.value;
  35. $modulePicker.render({items: modules[branchID]});
  36. $modulePicker.$.setValue(oldModule);
  37. }
  38. window.recomputeTimes = function()
  39. {
  40. if(parseInt($('#maxImport').val())) $('#times').html(Math.ceil(parseInt($allCount) / parseInt($('#maxImport').val())));
  41. };
  42. window.setMaxImport = function()
  43. {
  44. $.cookie.set('maxImport', $('#maxImport').val(), {expires:config.cookieLife, path:config.webRoot});
  45. loadCurrentPage();
  46. };