RouteUtil.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Uuid } from 'pc-component-v3';
  2. import Common from './Common.js';
  3. export default {
  4. getRouteUrl: function(menu) {
  5. var nodeType = menu.menuNodeType;
  6. if (nodeType == undefined || nodeType == 'NONE' || nodeType == 'Branch') {
  7. return '#';
  8. } else if (nodeType == 'Report' || nodeType == 'Process') {
  9. return '/desktop/process-report/' + menu.processReportNo;
  10. } else if (nodeType == 'WorkFlow') {
  11. return '#';
  12. } else if (nodeType == 'Window') {
  13. return (
  14. '/desktop/window/' + menu.curdWindowNo + '?uuid=' + Uuid.createUUID()
  15. );
  16. } else if (nodeType == 'Info') {
  17. return '/desktop/info/' + menu.infoWindowNo;
  18. } else if (nodeType == 'Customer') {
  19. if (menu.routeUrl != undefined) {
  20. if (menu.routeUrl[0] == '/') {
  21. return menu.routeUrl;
  22. } else {
  23. return '/desktop/' + menu.routeUrl;
  24. }
  25. }
  26. return '#';
  27. } else if (nodeType == 'HTML') {
  28. var htmlFileName = menu.htmlFileName;
  29. if (htmlFileName.indexOf('{URL}') >= 0) {
  30. htmlFileName = htmlFileName.replace(
  31. '{URL}',
  32. Common.getHostPageBaseURL(),
  33. );
  34. }
  35. return htmlFileName;
  36. }
  37. },
  38. };