carScheduleDetail.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 browseImages(inputId, Img) {// 图片管理器,可多个上传共用
  23. }
  24. function browseFiles(inputId, file) {// 文件管理器,可多个上传共用
  25. }
  26. function decode(value, id) {//value传入值,id接受值
  27. var last = value.lastIndexOf("/");
  28. var filename = value.substring(last + 1, value.length);
  29. $("#" + id).text(decodeURIComponent(filename));
  30. }
  31. function lnglatChange(event){
  32. var lnglat = event.currentTarget.value;
  33. var data = lnglat.split(',');
  34. if(data.length != 2 ){
  35. tip("经纬度填写错误,请重新填写");
  36. event.currentTarget.value = event.currentTarget.validform_lastval;
  37. }else{
  38. var longitude = data[0];
  39. var latitude = data[1];
  40. var lon = /^-?((0|[1-9]\d?|1[1-7]\d)(\.\d{1,7})?|180(\.0{1,7})?)?$/;
  41. var lat = /^-?((0|[1-8]\d|)(\.\d{1,7})?|90(\.0{1,7})?)?$/;
  42. var lonRe = new RegExp(lon);
  43. var latRe = new RegExp(lat);
  44. //alert(lonRe.test(longitude));//返回true OR false
  45. if (!lonRe.test(longitude)) {
  46. tip("经度不符合规范:经度整数部分为0-180,小数部分为0-6位!");
  47. event.currentTarget.value = event.currentTarget.validform_lastval;
  48. }else if (!latRe.test(latitude)) {
  49. tip("纬度不符合规范:纬度整数部分为0-90,小数部分为0-6位!!");
  50. event.currentTarget.value = event.currentTarget.validform_lastval;
  51. }else{
  52. $("#lng").val(longitude);
  53. $("#lat").val(latitude);
  54. }
  55. }
  56. }