cgformTemplate.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //通用弹出式文件上传
  2. function commonUpload(callback){
  3. $.dialog({
  4. content: "url:systemController.do?commonUpload",
  5. lock : true,
  6. title:"文件上传",
  7. zIndex:2100,
  8. width:700,
  9. height: 200,
  10. parent:windowapi,
  11. cache:false,
  12. ok: function(){
  13. var iframe = this.iframe.contentWindow;
  14. iframe.uploadCallback(callback);
  15. return true;
  16. },
  17. cancelVal: '关闭',
  18. cancel: function(){
  19. }
  20. });
  21. }
  22. function decode(value, id) {//value传入值,id接受值
  23. var last = value.lastIndexOf("/");
  24. var filename = value.substring(last + 1, value.length);
  25. $("#" + id).text(decodeURIComponent(filename));
  26. }
  27. function checkPic(){
  28. if($.trim( $("#templatePic").val()).length<=0){
  29. $.messager.alert('错误', "请上传预览图!");
  30. return false;
  31. }
  32. return true;
  33. }
  34. function checkZip(){
  35. if(hasZipFile<=0){
  36. $.messager.alert('错误', "请上传模板压缩文件!");
  37. return false;
  38. }
  39. return true;
  40. }
  41. //上传图片
  42. function uploadPic(){
  43. $('#templatePic_u').uploadify("upload","*");
  44. }
  45. //风格类型改变后 模板名称默认值要改变
  46. function changeTemplate(selectObj){
  47. var val=selectObj.value;
  48. if(val==1){
  49. $("#templateListName").val("autolist.ftl");
  50. $("#templateAddName").val("jform.ftl");
  51. $("#templateUpdateName").val("jform.ftl");
  52. $("#templateDetailName").val("jform.ftl");
  53. }else{
  54. $("#templateListName").val("autolist.ftl");
  55. $("#templateAddName").val("jformunion.ftl");
  56. $("#templateUpdateName").val("jformunion.ftl");
  57. $("#templateDetailName").val("jformunion.ftl");
  58. }
  59. }