MsgShowAndOpenAddUrl.cshtml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. @{
  2. ViewBag.Title = "系统提示";
  3. }
  4. @section scripts{
  5. <script type="text/javascript">
  6. function encodeURL(s) {
  7. return s.replace(/&amp;/g, "&");
  8. }
  9. $(function () {
  10. $.messager.alert('系统提示', decodeURI('@ViewBag.msg'), 'info', function () {
  11. var windowID = '@ViewBag.WindowID';
  12. var url = '@ViewBag.url';
  13. var title = '@ViewBag.newtitle';
  14. var height = '@ViewBag.Height';
  15. var width = '@ViewBag.Width';
  16. if (height == null || height == "")
  17. {
  18. height = 530;
  19. }
  20. if (width == null || width == "")
  21. {
  22. width = 860;
  23. }
  24. if (url != '' && (windowID == '' || windowID == 'none')) {
  25. location.href = encodeURL(url);
  26. }
  27. else {
  28. if (windowID == '' || windowID == 'none') {
  29. top.$('#sysWindow').window('close');
  30. } else {
  31. top.$('#' + windowID).window('close');
  32. }
  33. var redirectTo = encodeURL(url);
  34. $.popupTopWindow(title, redirectTo, width, height, null, null);
  35. }
  36. });
  37. $(".panel-tool-close").css("display", "none");
  38. })
  39. </script>
  40. }