UploadDialog.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. function HtmlUploadDialog(conf) {
  2. if(!conf) conf={};
  3. var max = conf.max||0,
  4. type = conf.type||"",
  5. size = conf.size||0;
  6. var url=__ctx + "/platform/system/file/UploadDialog.ht?max="+max+"&type="+type+"&size="+size;
  7. var dialog = null;
  8. var def = {
  9. passConf : {dialog:dialog},
  10. title : " 附件上传",
  11. width : 800,
  12. height : 500,
  13. modal : true,
  14. resizable : true,
  15. buttons:[{
  16. text:'确定',
  17. onclick:function(item, dialog){
  18. dialog.jiframe[0].contentWindow.getData()
  19. if(!scope){
  20. $.ligerDialog.error("获取已上传文件信息时出错");
  21. return;
  22. }
  23. if(scope.uploader.getNotUploadedItems().length>0){
  24. $.ligerDialog.alertExt("提示信息","有文件尚未上传,请上传该文件或删除该文件.");
  25. return;
  26. }
  27. if(scope.uploader.queue.length==0){
  28. $.ligerDialog.alertExt("提示信息","至少需要上传一个文件.");
  29. return;
  30. }
  31. if(conf.callback){
  32. var ary = [];
  33. angular.forEach(scope.uploader.queue,function(item){
  34. ary.push(item.json);
  35. });
  36. conf.callback(ary);
  37. dialog.dialog("close");
  38. }else{
  39. dialog.dialog("close");
  40. }
  41. }
  42. },{
  43. text:'取消',
  44. onclick: function (item,dialog) { dialog.close(); }
  45. }]
  46. };
  47. dialog = $.topCall.dialog({
  48. src:url,
  49. base:def
  50. });
  51. }