mp_objChg.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="width=device-width, initial-scale=1.0, user-scalable=no"
  8. />
  9. <title>变动情况4</title>
  10. <script src="/js/mp_base/base.js"></script>
  11. <style>
  12. #app {
  13. background: #f5f5f5;
  14. min-height: 100vh;
  15. display: flex;
  16. flex-direction: column;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <div id="app" v-cloak>
  22. <!-- 新增对象变动页签容器 by xu 2026-03-06 -->
  23. <ss-sub-tab
  24. v-if="tabList.length > 0"
  25. :tab-list="tabList"
  26. :base-params="baseParams"
  27. @tab-change="handleTabChange"
  28. />
  29. </div>
  30. <script>
  31. window.SS.ready(function () {
  32. window.SS.dom.initializeFormApp({
  33. el: "#app",
  34. data() {
  35. return {
  36. pageParams: {},
  37. loading: false,
  38. tabList: [],
  39. baseParams: {},
  40. };
  41. },
  42. mounted() {
  43. this.pageParams = this.getUrlParams();
  44. const infoService =
  45. this.pageParams.service || this.pageParams.ssServ || "";
  46. const infoDest = this.pageParams.dest || this.pageParams.ssDest || "";
  47. const infoParam = this.pageParams.param || "";
  48. // 功能说明:objChg 固定透传 dataType=change,对齐 objChg.ss.jsp 的 pageContext 设置 by xu 2026-03-06
  49. this.baseParams = {
  50. ssObjName:
  51. this.pageParams.ssObjName || this.pageParams.ssobjname || "",
  52. ssObjId: this.pageParams.ssObjId || this.pageParams.ssobjid || "",
  53. sqid: this.pageParams.sqid || "",
  54. shid: this.pageParams.shid || "",
  55. shyjm: this.pageParams.shyjm || "",
  56. bdlbm: this.pageParams.bdlbm || "",
  57. dataType: "change",
  58. encode_shid: this.pageParams.encode_shid || "",
  59. jdmc: this.pageParams.jdmc || "",
  60. ssToken: this.pageParams.ssToken || "",
  61. service: infoService,
  62. dest: infoDest,
  63. param: infoParam,
  64. ssServ: infoService,
  65. ssDest: infoDest,
  66. };
  67. this.loadTag();
  68. },
  69. methods: {
  70. getUrlParams() {
  71. const params = {};
  72. const urlSearchParams = new URLSearchParams(
  73. window.location.search
  74. );
  75. for (const [key, value] of urlSearchParams) {
  76. try {
  77. params[key] = decodeURIComponent(value);
  78. } catch (_) {
  79. params[key] = String(value);
  80. }
  81. }
  82. return params;
  83. },
  84. async loadTag() {
  85. this.loading = true;
  86. try {
  87. const { ssObjName, ssObjId, sqid, shid, service, dest, param } =
  88. this.baseParams;
  89. // 功能说明:objChg 页签固定走 chgBaseInfo,child,和 JSP <tab.ss name="chgBaseInfo,child"/> 对齐 by xu 2026-03-06
  90. const tagQuery = new URLSearchParams({
  91. ssServ: "tabTag",
  92. ssDest: "data",
  93. name: "chgBaseInfo,child",
  94. ssObjName: ssObjName || "",
  95. ssObjId: ssObjId || "",
  96. sqid: sqid || "",
  97. shid: shid || "",
  98. service: service || "",
  99. dest: dest || "",
  100. param: param || "",
  101. bdlbm: this.baseParams.bdlbm || "",
  102. dataType: "change",
  103. });
  104. const tagResponse = await request.post(
  105. `/service?${tagQuery.toString()}`,
  106. {},
  107. { loading: false, formData: true }
  108. );
  109. if (
  110. tagResponse &&
  111. tagResponse.data &&
  112. Array.isArray(tagResponse.data.tabList)
  113. ) {
  114. this.tabList = tagResponse.data.tabList;
  115. } else {
  116. console.warn("[mp_objChg] tabTag 未返回 tabList", tagResponse);
  117. }
  118. } catch (error) {
  119. console.error("[mp_objChg] 加载Tab数据失败:", error);
  120. } finally {
  121. this.loading = false;
  122. }
  123. },
  124. handleTabChange({ index, tab }) {
  125. console.log("[mp_objChg] 切换到Tab:", index, tab && (tab.desc || tab.title));
  126. },
  127. },
  128. });
  129. });
  130. </script>
  131. </body>
  132. </html>