| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1.0, user-scalable=no"
- />
- <title>变动情况4</title>
- <script src="/js/mp_base/base.js"></script>
- <style>
- #app {
- background: #f5f5f5;
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <!-- 新增对象变动页签容器 by xu 2026-03-06 -->
- <ss-sub-tab
- v-if="tabList.length > 0"
- :tab-list="tabList"
- :base-params="baseParams"
- @tab-change="handleTabChange"
- />
- </div>
- <script>
- window.SS.ready(function () {
- window.SS.dom.initializeFormApp({
- el: "#app",
- data() {
- return {
- pageParams: {},
- loading: false,
- tabList: [],
- baseParams: {},
- };
- },
- mounted() {
- this.pageParams = this.getUrlParams();
- const infoService =
- this.pageParams.service || this.pageParams.ssServ || "";
- const infoDest = this.pageParams.dest || this.pageParams.ssDest || "";
- const infoParam = this.pageParams.param || "";
- // 功能说明:objChg 固定透传 dataType=change,对齐 objChg.ss.jsp 的 pageContext 设置 by xu 2026-03-06
- this.baseParams = {
- ssObjName:
- this.pageParams.ssObjName || this.pageParams.ssobjname || "",
- ssObjId: this.pageParams.ssObjId || this.pageParams.ssobjid || "",
- sqid: this.pageParams.sqid || "",
- shid: this.pageParams.shid || "",
- shyjm: this.pageParams.shyjm || "",
- bdlbm: this.pageParams.bdlbm || "",
- dataType: "change",
- encode_shid: this.pageParams.encode_shid || "",
- jdmc: this.pageParams.jdmc || "",
- ssToken: this.pageParams.ssToken || "",
- service: infoService,
- dest: infoDest,
- param: infoParam,
- ssServ: infoService,
- ssDest: infoDest,
- };
- this.loadTag();
- },
- methods: {
- getUrlParams() {
- const params = {};
- const urlSearchParams = new URLSearchParams(
- window.location.search
- );
- for (const [key, value] of urlSearchParams) {
- try {
- params[key] = decodeURIComponent(value);
- } catch (_) {
- params[key] = String(value);
- }
- }
- return params;
- },
- async loadTag() {
- this.loading = true;
- try {
- const { ssObjName, ssObjId, sqid, shid, service, dest, param } =
- this.baseParams;
- // 功能说明:objChg 页签固定走 chgBaseInfo,child,和 JSP <tab.ss name="chgBaseInfo,child"/> 对齐 by xu 2026-03-06
- const tagQuery = new URLSearchParams({
- ssServ: "tabTag",
- ssDest: "data",
- name: "chgBaseInfo,child",
- ssObjName: ssObjName || "",
- ssObjId: ssObjId || "",
- sqid: sqid || "",
- shid: shid || "",
- service: service || "",
- dest: dest || "",
- param: param || "",
- bdlbm: this.baseParams.bdlbm || "",
- dataType: "change",
- });
- const tagResponse = await request.post(
- `/service?${tagQuery.toString()}`,
- {},
- { loading: false, formData: true }
- );
- if (
- tagResponse &&
- tagResponse.data &&
- Array.isArray(tagResponse.data.tabList)
- ) {
- this.tabList = tagResponse.data.tabList;
- } else {
- console.warn("[mp_objChg] tabTag 未返回 tabList", tagResponse);
- }
- } catch (error) {
- console.error("[mp_objChg] 加载Tab数据失败:", error);
- } finally {
- this.loading = false;
- }
- },
- handleTabChange({ index, tab }) {
- console.log("[mp_objChg] 切换到Tab:", index, tab && (tab.desc || tab.title));
- },
- },
- });
- });
- </script>
- </body>
- </html>
|