mp_chgchk.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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>审核</title>
  10. <script src="/js/mp_base/base.js"></script>
  11. <style>
  12. [v-cloak] {
  13. display: none !important;
  14. }
  15. #app {
  16. background: #f5f5f5;
  17. height: 100vh;
  18. display: flex;
  19. flex-direction: column;
  20. overflow: hidden;
  21. box-sizing: border-box;
  22. }
  23. .content-wrap {
  24. flex: 1;
  25. display: flex;
  26. flex-direction: column;
  27. gap: 8px;
  28. padding: 8px;
  29. box-sizing: border-box;
  30. overflow: hidden;
  31. }
  32. .frame-card {
  33. background: #fff;
  34. border-radius: 8px;
  35. overflow: hidden;
  36. box-sizing: border-box;
  37. }
  38. .info-frame-wrap {
  39. flex: 0 0 176px;
  40. }
  41. .chg-frame-wrap,
  42. .sh-frame-wrap {
  43. flex: 1;
  44. min-height: 0;
  45. }
  46. .info-iframe,
  47. .chg-iframe,
  48. .sh-iframe {
  49. width: 100%;
  50. height: 100%;
  51. border: none;
  52. display: block;
  53. background: #fff;
  54. }
  55. .status-wrap {
  56. flex: 1;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. padding: 16px;
  61. box-sizing: border-box;
  62. }
  63. .status-card {
  64. width: 100%;
  65. max-width: 520px;
  66. background: #fff;
  67. border-radius: 8px;
  68. padding: 16px;
  69. box-sizing: border-box;
  70. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  71. }
  72. .status-title {
  73. font-size: 15px;
  74. font-weight: 600;
  75. color: #2d3748;
  76. }
  77. .status-text {
  78. margin-top: 8px;
  79. line-height: 1.6;
  80. color: #4a5568;
  81. font-size: 13px;
  82. word-break: break-all;
  83. }
  84. .status-retry {
  85. margin-top: 12px;
  86. height: 34px;
  87. padding: 0 14px;
  88. border: none;
  89. border-radius: 4px;
  90. background: #4a5568;
  91. color: #fff;
  92. font-size: 13px;
  93. }
  94. .url-log-fab {
  95. position: fixed;
  96. right: 12px;
  97. bottom: 72px;
  98. z-index: 1200;
  99. border: none;
  100. border-radius: 16px;
  101. background: rgba(36, 40, 53, 0.88);
  102. color: #fff;
  103. font-size: 12px;
  104. line-height: 1;
  105. padding: 8px 10px;
  106. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  107. }
  108. .url-log-panel {
  109. position: fixed;
  110. left: 12px;
  111. right: 12px;
  112. bottom: 116px;
  113. z-index: 1200;
  114. background: rgba(36, 40, 53, 0.96);
  115. color: #fff;
  116. border-radius: 8px;
  117. padding: 10px;
  118. max-height: 42vh;
  119. overflow: auto;
  120. box-sizing: border-box;
  121. }
  122. .url-log-panel__head {
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. margin-bottom: 8px;
  127. font-size: 12px;
  128. }
  129. .url-log-panel__close {
  130. border: none;
  131. background: transparent;
  132. color: #fff;
  133. font-size: 14px;
  134. line-height: 1;
  135. }
  136. .url-log-panel__body {
  137. margin: 0;
  138. white-space: pre-wrap;
  139. word-break: break-all;
  140. font-size: 12px;
  141. line-height: 1.5;
  142. }
  143. </style>
  144. </head>
  145. <body>
  146. <div id="app" v-cloak>
  147. <div class="content-wrap" v-if="initStatus === 'ready'">
  148. <div class="frame-card info-frame-wrap">
  149. <iframe
  150. ref="infoIframe"
  151. class="info-iframe"
  152. :src="topIframeSrc || 'about:blank'"
  153. frameborder="0"
  154. ></iframe>
  155. </div>
  156. <div class="frame-card chg-frame-wrap">
  157. <iframe
  158. ref="chgIframe"
  159. class="chg-iframe"
  160. :src="chgIframeSrc || 'about:blank'"
  161. frameborder="0"
  162. ></iframe>
  163. </div>
  164. <div class="frame-card sh-frame-wrap">
  165. <iframe
  166. ref="shIframe"
  167. class="sh-iframe"
  168. :src="shIframeSrc || 'about:blank'"
  169. frameborder="0"
  170. ></iframe>
  171. </div>
  172. </div>
  173. <div class="status-wrap" v-else>
  174. <div class="status-card">
  175. <div class="status-title">{{ initStatusTitle }}</div>
  176. <div class="status-text">{{ initStatusMessage }}</div>
  177. <div class="status-text" v-if="missingParams.length > 0">
  178. 缺少参数:{{ missingParams.join('、') }}
  179. </div>
  180. <button class="status-retry" type="button" @click="callApi">
  181. 重新加载
  182. </button>
  183. </div>
  184. </div>
  185. <ss-bottom
  186. :buttons="bottomButtons"
  187. :show-shyj="true"
  188. @button-click="handleBottomAction"
  189. :disabled="submitting"
  190. v-if="initStatus === 'ready' && bottomButtons.length > 0"
  191. ></ss-bottom>
  192. <button class="url-log-fab" type="button" @click="showCurrentUrls">
  193. URL
  194. </button>
  195. <div class="url-log-panel" v-if="urlLogVisible">
  196. <div class="url-log-panel__head">
  197. <span>当前 URL</span>
  198. <button
  199. class="url-log-panel__close"
  200. type="button"
  201. @click="urlLogVisible = false"
  202. >
  203. ×
  204. </button>
  205. </div>
  206. <pre class="url-log-panel__body">{{ urlLogText }}</pre>
  207. </div>
  208. </div>
  209. <script>
  210. window.SS.ready(function () {
  211. window.SS.dom.initializeFormApp({
  212. el: "#app",
  213. data() {
  214. return {
  215. pageParams: {},
  216. loading: false,
  217. submitting: false,
  218. jdmc: "",
  219. sqid: "",
  220. shid: "",
  221. shyjm: "",
  222. bdlbm: "",
  223. dataType: "bdplay",
  224. encode_shid: "",
  225. ssObjName: "",
  226. ssObjId: "",
  227. initStatus: "loading",
  228. initStatusTitle: "页面初始化中",
  229. initStatusMessage: "正在加载审核数据,请稍候...",
  230. missingParams: [],
  231. infoData: null,
  232. actionAgreeData: null,
  233. actionRejectData: null,
  234. bottomButtons: [],
  235. topIframeSrc: "",
  236. chgIframeSrc: "",
  237. shIframeSrc: "",
  238. urlLogVisible: false,
  239. urlLogText: "",
  240. };
  241. },
  242. mounted() {
  243. this.pageParams = this.getUrlParams();
  244. this.callApi();
  245. },
  246. methods: {
  247. // 新增变动审核页初始化状态控制 by xu 2026-03-06
  248. setInitStatus(status, title, message) {
  249. this.initStatus = status;
  250. this.initStatusTitle = title || "";
  251. this.initStatusMessage = message || "";
  252. },
  253. normalizeError(error) {
  254. return {
  255. message: (error && error.message) || String(error),
  256. };
  257. },
  258. getUrlParams() {
  259. const params = {};
  260. const aliasMap = {
  261. ssobjname: "ssObjName",
  262. ssobjid: "ssObjId",
  263. sqid: "sqid",
  264. shid: "shid",
  265. shyjm: "shyjm",
  266. bdlbm: "bdlbm",
  267. datatype: "dataType",
  268. encode_shid: "encode_shid",
  269. jdmc: "jdmc",
  270. };
  271. const urlSearchParams = new URLSearchParams(
  272. window.location.search
  273. );
  274. for (const [rawKey, rawValue] of urlSearchParams) {
  275. const decodedValue = this.safeDecode(rawValue);
  276. params[rawKey] = decodedValue;
  277. const normalizedKey = aliasMap[String(rawKey).toLowerCase()];
  278. if (normalizedKey) {
  279. params[normalizedKey] = decodedValue;
  280. }
  281. }
  282. return params;
  283. },
  284. safeDecode(text) {
  285. if (text === undefined || text === null || text === "") return "";
  286. try {
  287. return decodeURIComponent(String(text));
  288. } catch (_) {
  289. return String(text);
  290. }
  291. },
  292. pickFirstValue(sources, keys) {
  293. const srcArr = Array.isArray(sources) ? sources : [];
  294. const keyArr = Array.isArray(keys) ? keys : [];
  295. for (let i = 0; i < srcArr.length; i += 1) {
  296. const src = srcArr[i];
  297. if (!src || typeof src !== "object") continue;
  298. for (let j = 0; j < keyArr.length; j += 1) {
  299. const key = keyArr[j];
  300. const value = src[key];
  301. if (value !== undefined && value !== null && value !== "") {
  302. return value;
  303. }
  304. }
  305. }
  306. return "";
  307. },
  308. extractTokenData(apiResponse) {
  309. const wantedKeys = [
  310. "sqid",
  311. "shid",
  312. "ssObjName",
  313. "ssObjId",
  314. "jdmc",
  315. "bdlbm",
  316. "dataType",
  317. "encode_shid",
  318. ];
  319. const candidates = [
  320. apiResponse && apiResponse.data && apiResponse.data.ssData,
  321. apiResponse && apiResponse.ssData,
  322. apiResponse && apiResponse.data,
  323. apiResponse,
  324. ];
  325. let best = {};
  326. let bestScore = -1;
  327. candidates.forEach((item) => {
  328. if (!item || typeof item !== "object") return;
  329. let score = 0;
  330. wantedKeys.forEach((key) => {
  331. if (
  332. item[key] !== undefined &&
  333. item[key] !== null &&
  334. item[key] !== ""
  335. ) {
  336. score += 1;
  337. }
  338. });
  339. if (score > bestScore) {
  340. best = item;
  341. bestScore = score;
  342. }
  343. });
  344. return best;
  345. },
  346. resolveBusinessContext(apiResponse) {
  347. const tokenData = this.extractTokenData(apiResponse);
  348. const sources = [tokenData, this.pageParams];
  349. return {
  350. sqid: String(this.pickFirstValue(sources, ["sqid"]) || ""),
  351. shid: String(this.pickFirstValue(sources, ["shid"]) || ""),
  352. shyjm: String(this.pickFirstValue(sources, ["shyjm"]) || ""),
  353. ssObjName: String(
  354. this.pickFirstValue(sources, ["ssObjName", "ssobjname"]) ||
  355. ""
  356. ),
  357. ssObjId: String(
  358. this.pickFirstValue(sources, ["ssObjId", "ssobjid"]) || ""
  359. ),
  360. bdlbm: String(this.pickFirstValue(sources, ["bdlbm"]) || ""),
  361. dataType:
  362. String(
  363. this.pickFirstValue(sources, ["dataType", "datatype"]) ||
  364. this.dataType ||
  365. "bdplay"
  366. ) || "bdplay",
  367. encode_shid: String(
  368. this.pickFirstValue(sources, ["encode_shid"]) || ""
  369. ),
  370. jdmc: this.safeDecode(
  371. this.pickFirstValue(sources, ["jdmc"]) || ""
  372. ),
  373. };
  374. },
  375. parseInfoParm(rawParm) {
  376. if (!rawParm) return {};
  377. if (typeof rawParm === "object") return rawParm;
  378. const text = String(rawParm).trim();
  379. if (!text) return {};
  380. try {
  381. return JSON.parse(text);
  382. } catch (_) {}
  383. try {
  384. const normalized = text
  385. .replace(/([{,]\s*)([A-Za-z0-9_]+)\s*:/g, '$1"$2":')
  386. .replace(/'/g, '"');
  387. return JSON.parse(normalized);
  388. } catch (_) {
  389. return {};
  390. }
  391. },
  392. resolveInfoDestPath(destName) {
  393. const raw = String(destName || "").trim();
  394. if (!raw) return "";
  395. if (/^https?:\/\//i.test(raw)) return raw;
  396. if (raw.startsWith("/")) return raw;
  397. if (raw.endsWith(".html")) return `/page/${raw}`;
  398. if (raw.startsWith("mp_")) return `/page/${raw}.html`;
  399. return `/page/mp_${raw}.html`;
  400. },
  401. buildIframeSrc(path, queryObj) {
  402. const search = new URLSearchParams();
  403. Object.keys(queryObj || {}).forEach((key) => {
  404. const value = queryObj[key];
  405. if (value === undefined || value === null) return;
  406. search.set(key, String(value));
  407. });
  408. return `${path}?${search.toString()}`;
  409. },
  410. buildInfoIframeSrc(infoData, fallbackQuery) {
  411. const conf =
  412. infoData && typeof infoData === "object" ? infoData : {};
  413. const serviceName = conf.service || conf.servName || "";
  414. const destName = conf.dest || "";
  415. const parmObj = this.parseInfoParm(conf.parm);
  416. const mergedQuery = {
  417. ...(fallbackQuery || {}),
  418. ...(parmObj || {}),
  419. };
  420. if (!serviceName || !destName) {
  421. return this.buildIframeSrc("/page/mp_objInfo.html", mergedQuery);
  422. }
  423. const pagePath = this.resolveInfoDestPath(destName);
  424. if (!pagePath) {
  425. return this.buildIframeSrc("/page/mp_objInfo.html", mergedQuery);
  426. }
  427. const paramText =
  428. typeof conf.parm === "string"
  429. ? conf.parm
  430. : JSON.stringify(parmObj || {});
  431. const iframeQuery = {
  432. ...mergedQuery,
  433. ssServ: serviceName,
  434. ssDest: destName,
  435. service: serviceName,
  436. dest: destName,
  437. param: paramText,
  438. };
  439. return this.buildIframeSrc(pagePath, iframeQuery);
  440. },
  441. buildCommonQuery() {
  442. return {
  443. sqid: this.sqid,
  444. shid: this.shid,
  445. shyjm: this.shyjm,
  446. bdlbm: this.bdlbm,
  447. dataType: this.dataType,
  448. encode_shid: this.encode_shid,
  449. ssObjName: this.ssObjName,
  450. ssObjId: this.ssObjId,
  451. jdmc: this.jdmc,
  452. };
  453. },
  454. normalizeActionConfig(config) {
  455. if (!config || typeof config !== "object") return null;
  456. const normalized = { ...config };
  457. if (!normalized.service && normalized.servName) {
  458. normalized.service = normalized.servName;
  459. }
  460. return normalized;
  461. },
  462. async fetchActionConfigs() {
  463. // 按 bdlbm 拉取变动审核同意退回动作配置 by xu 2026-03-06
  464. const query = `ssObjName=${encodeURIComponent(
  465. this.ssObjName
  466. )}&ssObjId=${encodeURIComponent(
  467. this.ssObjId
  468. )}&sqid=${encodeURIComponent(
  469. this.sqid
  470. )}&shid=${encodeURIComponent(
  471. this.shid
  472. )}&bdlbm=${encodeURIComponent(
  473. this.bdlbm
  474. )}&dataType=${encodeURIComponent(
  475. this.dataType
  476. )}&encode_shid=${encodeURIComponent(this.encode_shid)}`;
  477. let agreeTag = "";
  478. let rejectTag = "";
  479. if (String(this.bdlbm) === "55") {
  480. agreeTag = "agrRes";
  481. rejectTag = "rejRes";
  482. } else if (String(this.bdlbm) === "51") {
  483. agreeTag = "agrSus";
  484. rejectTag = "rejSus";
  485. } else if (!["1", "51", "55"].includes(String(this.bdlbm))) {
  486. agreeTag = "agrChg";
  487. rejectTag = "rejChg";
  488. }
  489. this.actionAgreeData = null;
  490. this.actionRejectData = null;
  491. const buttons = [];
  492. if (rejectTag) {
  493. const rejectRes = await request.post(
  494. `/service?ssServ=dataTag&ssDest=data&name=${rejectTag}&${query}`,
  495. {},
  496. { loading: false, formData: true }
  497. );
  498. this.actionRejectData = this.normalizeActionConfig(
  499. rejectRes && rejectRes.data ? rejectRes.data[rejectTag] : null
  500. );
  501. if (
  502. this.actionRejectData &&
  503. this.actionRejectData.service &&
  504. this.actionRejectData.dest
  505. ) {
  506. buttons.push({ text: "退回", action: "reject" });
  507. }
  508. }
  509. if (agreeTag) {
  510. const agreeRes = await request.post(
  511. `/service?ssServ=dataTag&ssDest=data&name=${agreeTag}&${query}`,
  512. {},
  513. { loading: false, formData: true }
  514. );
  515. this.actionAgreeData = this.normalizeActionConfig(
  516. agreeRes && agreeRes.data ? agreeRes.data[agreeTag] : null
  517. );
  518. if (
  519. this.actionAgreeData &&
  520. this.actionAgreeData.service &&
  521. this.actionAgreeData.dest
  522. ) {
  523. buttons.push({ text: "同意", action: "agree" });
  524. }
  525. }
  526. this.bottomButtons = buttons;
  527. },
  528. async callApi() {
  529. this.loading = true;
  530. this.infoData = null;
  531. this.actionAgreeData = null;
  532. this.actionRejectData = null;
  533. this.bottomButtons = [];
  534. this.topIframeSrc = "";
  535. this.chgIframeSrc = "";
  536. this.shIframeSrc = "";
  537. this.missingParams = [];
  538. this.setInitStatus(
  539. "loading",
  540. "页面初始化中",
  541. "正在加载审核数据,请稍候..."
  542. );
  543. let apiResponse = null;
  544. try {
  545. if (this.pageParams.ssToken) {
  546. apiResponse = await request.post(
  547. `/service?ssToken=${this.pageParams.ssToken}`,
  548. {},
  549. { loading: false }
  550. );
  551. }
  552. const context = this.resolveBusinessContext(apiResponse);
  553. this.sqid = context.sqid;
  554. this.shid = context.shid;
  555. this.shyjm = context.shyjm;
  556. this.ssObjName = context.ssObjName;
  557. this.ssObjId = context.ssObjId;
  558. this.bdlbm = context.bdlbm;
  559. this.dataType = context.dataType;
  560. this.encode_shid = context.encode_shid;
  561. this.jdmc = context.jdmc || "";
  562. const requiredKeys = ["sqid", "shid", "ssObjId"];
  563. this.missingParams = requiredKeys.filter((key) => !this[key]);
  564. const query = this.buildCommonQuery();
  565. const infoRes = await request.post(
  566. `/service?ssServ=dataTag&ssDest=data&name=info&ssObjName=${encodeURIComponent(
  567. this.ssObjName
  568. )}&ssObjId=${encodeURIComponent(
  569. this.ssObjId
  570. )}&sqid=${encodeURIComponent(
  571. this.sqid
  572. )}&shid=${encodeURIComponent(this.shid)}`,
  573. {},
  574. { loading: false, formData: true }
  575. );
  576. this.infoData = infoRes && infoRes.data ? infoRes.data.info : null;
  577. this.topIframeSrc = this.buildInfoIframeSrc(this.infoData, query);
  578. // 新增变动情况子页承接 by xu 2026-03-06
  579. this.chgIframeSrc = this.buildIframeSrc(
  580. // 功能说明:变动页签入口改为精确命中 mp_chgChkTab.html,对齐 chgChkTab.ss.jsp by xu 2026-03-08
  581. "/page/mp_chgChkTab.html",
  582. {
  583. ...query,
  584. service: "selChgInfo",
  585. dest: "chgList",
  586. ssServ: "selChgInfo",
  587. ssDest: "chgList",
  588. param: JSON.stringify({ sqid: this.sqid }),
  589. }
  590. );
  591. this.shIframeSrc = this.buildIframeSrc(
  592. "/page/mp_shList.html",
  593. query
  594. );
  595. await this.fetchActionConfigs();
  596. this.setInitStatus("ready", "页面已就绪", "审核数据加载完成");
  597. } catch (error) {
  598. const normalized = this.normalizeError(error);
  599. this.setInitStatus(
  600. "error",
  601. "页面初始化失败",
  602. normalized.message || "页面初始化失败,请稍后重试"
  603. );
  604. console.error("[mp_chgchk] 初始化失败", error);
  605. if (typeof showToastEffect === "function") {
  606. showToastEffect("页面初始化失败,请稍后重试", 2200, "error");
  607. }
  608. } finally {
  609. this.loading = false;
  610. }
  611. },
  612. buildSubmitPayload(actionPayload) {
  613. const submitPayload = {};
  614. if (this.shid) submitPayload.shid = this.shid;
  615. if (this.sqid) submitPayload.sqid = this.sqid;
  616. if (this.ssObjName) submitPayload.ssObjName = this.ssObjName;
  617. if (this.ssObjId) submitPayload.ssObjId = this.ssObjId;
  618. const payloadObj =
  619. actionPayload && typeof actionPayload === "object"
  620. ? actionPayload
  621. : {};
  622. const reviewValue = this.pickFirstValue(
  623. [payloadObj],
  624. [
  625. "shsm",
  626. "shyjValue",
  627. "shyj",
  628. "spyj",
  629. "opinion",
  630. "comment",
  631. "remark",
  632. "reason",
  633. "yj",
  634. ]
  635. );
  636. if (
  637. reviewValue !== undefined &&
  638. reviewValue !== null &&
  639. reviewValue !== ""
  640. ) {
  641. submitPayload.shsm = String(reviewValue);
  642. }
  643. return submitPayload;
  644. },
  645. goBackWithRefresh() {
  646. if (
  647. window.NavigationManager &&
  648. typeof window.NavigationManager.goBack === "function"
  649. ) {
  650. window.NavigationManager.goBack({ refreshParent: true });
  651. return;
  652. }
  653. window.history.back();
  654. },
  655. async submitByConfig(conf, actionPayload) {
  656. const serviceName = conf && (conf.service || conf.servName);
  657. const destName = conf && conf.dest;
  658. if (!conf || !serviceName || !destName) {
  659. if (typeof showToastEffect === "function") {
  660. showToastEffect("缺少提交配置", 2200, "error");
  661. }
  662. return;
  663. }
  664. if (this.submitting) return;
  665. try {
  666. this.submitting = true;
  667. await request.post(
  668. `/service?ssServ=${encodeURIComponent(
  669. serviceName
  670. )}&ssDest=${encodeURIComponent(destName)}`,
  671. this.buildSubmitPayload(actionPayload),
  672. {
  673. loading: true,
  674. formData: true,
  675. }
  676. );
  677. if (typeof showToastEffect === "function") {
  678. showToastEffect("提交成功", 1200, "success");
  679. }
  680. setTimeout(() => {
  681. this.goBackWithRefresh();
  682. }, 300);
  683. } catch (error) {
  684. console.error("[mp_chgchk] 提交失败", error);
  685. if (typeof showToastEffect === "function") {
  686. showToastEffect("提交失败,请稍后重试", 2200, "error");
  687. }
  688. } finally {
  689. this.submitting = false;
  690. }
  691. },
  692. handleBottomAction(payload) {
  693. if (!payload || !payload.action) return;
  694. if (payload.action === "agree") {
  695. this.submitByConfig(this.actionAgreeData, payload);
  696. return;
  697. }
  698. if (payload.action === "reject") {
  699. this.submitByConfig(this.actionRejectData, payload);
  700. }
  701. },
  702. showCurrentUrls() {
  703. const lines = [
  704. `page: ${window.location.href}`,
  705. `info: ${
  706. (this.$refs.infoIframe && this.$refs.infoIframe.src) ||
  707. this.topIframeSrc ||
  708. "(empty)"
  709. }`,
  710. `chg: ${
  711. (this.$refs.chgIframe && this.$refs.chgIframe.src) ||
  712. this.chgIframeSrc ||
  713. "(empty)"
  714. }`,
  715. `sh: ${
  716. (this.$refs.shIframe && this.$refs.shIframe.src) ||
  717. this.shIframeSrc ||
  718. "(empty)"
  719. }`,
  720. ];
  721. this.urlLogText = lines.join("\n");
  722. this.urlLogVisible = true;
  723. },
  724. },
  725. });
  726. });
  727. </script>
  728. </body>
  729. </html>