@shjjs/visual-ui 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,25 @@
1
- import { DataSourceUtils as o } from "../../datasource/utils/utils.mjs";
2
- import { EventUtils as l } from "../utils/utils.mjs";
3
- const u = (n, p) => {
4
- const { pageAction: t } = n;
5
- if (!t.target)
1
+ import { DataSourceUtils as l } from "../../datasource/utils/utils.mjs";
2
+ import { EventUtils as p } from "../utils/utils.mjs";
3
+ const S = (g, w) => {
4
+ const { pageAction: e } = g, d = l.getVariableData(), s = l.replaceStringVariables(e.parameter, d), r = s ? p.urlParamToJson(s) : null;
5
+ let a = e.target;
6
+ if (!a && e.pageId && (window.location.href.includes("/sharing") && (window.location.href.includes("/#") ? a = `/#/proto/${e.pageId}/sharing` : a = `/proto/${e.pageId}/sharing`), window.location.href.includes("/release") && (window.location.href.includes("/#") ? a = `/#/release/${e.pageId}` : a = `/release/${e.pageId}`)), !a)
6
7
  return;
7
- const i = o.getVariableData(), a = o.replaceStringVariables(t.parameter, i), r = a ? l.urlParamToJson(a) : null, e = new URL(t.target, window.location.origin);
8
- r && Object.entries(r).forEach(([c, s]) => {
9
- e.searchParams.append(c, s);
10
- }), window.location.href = e.toString();
8
+ const t = new URL(a, window.location.origin);
9
+ if (r) {
10
+ const n = t.toString().indexOf("/#/");
11
+ if (n !== -1) {
12
+ const o = t.toString().substring(0, n), i = t.toString().substring(n), c = new URLSearchParams();
13
+ Object.entries(r).forEach(([f, h]) => {
14
+ c.append(f, h);
15
+ }), window.location.href = `${o}${i}?${c.toString()}`;
16
+ } else
17
+ Object.entries(r).forEach(([o, i]) => {
18
+ t.searchParams.append(o, i);
19
+ }), window.location.href = t.toString();
20
+ } else
21
+ window.location.href = t.toString();
11
22
  };
12
23
  export {
13
- u as executePageAction
24
+ S as executePageAction
14
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../datasource/utils/utils.js"),l=require("../utils/utils.js"),u=(i,g)=>{const{pageAction:e}=i;if(!e.target)return;const n=o.DataSourceUtils.getVariableData(),t=o.DataSourceUtils.replaceStringVariables(e.parameter,n),a=t?l.EventUtils.urlParamToJson(t):null,r=new URL(e.target,window.location.origin);a&&Object.entries(a).forEach(([c,s])=>{r.searchParams.append(c,s)}),window.location.href=r.toString()};exports.executePageAction=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../datasource/utils/utils.js"),f=require("../utils/utils.js"),p=(g,w)=>{const{pageAction:e}=g,d=l.DataSourceUtils.getVariableData(),s=l.DataSourceUtils.replaceStringVariables(e.parameter,d),n=s?f.EventUtils.urlParamToJson(s):null;let t=e.target;if(!t&&e.pageId&&(window.location.href.includes("/sharing")&&(window.location.href.includes("/#")?t=`/#/proto/${e.pageId}/sharing`:t=`/proto/${e.pageId}/sharing`),window.location.href.includes("/release")&&(window.location.href.includes("/#")?t=`/#/release/${e.pageId}`:t=`/release/${e.pageId}`)),!t)return;const a=new URL(t,window.location.origin);if(n){const r=a.toString().indexOf("/#/");if(r!==-1){const i=a.toString().substring(0,r),o=a.toString().substring(r),c=new URLSearchParams;Object.entries(n).forEach(([u,h])=>{c.append(u,h)}),window.location.href=`${i}${o}?${c.toString()}`}else Object.entries(n).forEach(([i,o])=>{a.searchParams.append(i,o)}),window.location.href=a.toString()}else window.location.href=a.toString()};exports.executePageAction=p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shjjs/visual-ui",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "国产自研零代码可视化源码工具",
5
5
  "keywords": [
6
6
  "three",