@shjjs/visual-ui 3.0.17 → 3.0.19
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.
- package/es/commons/plugins/datasource/utils/storageData.mjs +14 -6
- package/es/commons/plugins/datasource/utils/utils.mjs +160 -135
- package/es/commons/plugins/event/actions/updateVariableAction.mjs +32 -30
- package/es/components/Commons/components/CustomComponentRender/index.vue.mjs +2 -2
- package/es/components/Commons/components/CustomComponentRender/index.vue2.mjs +74 -66
- package/es/components/Scene/components/UeForWebUI/index.vue.mjs +2 -2
- package/es/components/Scene/components/UeForWebUI/index.vue2.mjs +7 -8
- package/es/components/Scene/components/UeForXiWebView/index.vue.mjs +2 -2
- package/es/components/Scene/components/UeForXiWebView/index.vue2.mjs +7 -8
- package/es/components/Text/components/List/index.vue.mjs +47 -47
- package/es/components/Text/components/TableScroll/index.vue.mjs +2 -2
- package/es/components/Text/components/TableScroll/index.vue2.mjs +2 -1
- package/es/components/Text/components/TextDynamic/index.vue.mjs +4 -4
- package/es/packages/commons/plugins/datasource/utils/utils.d.ts +51 -43
- package/es/packages/commons/plugins/event/entity/event.d.ts +1 -0
- package/es/packages/components/Commons/components/CustomComponentRender/index.vue.d.ts +73 -70
- package/es/widgets.css +1 -1
- package/package.json +1 -1
- package/umd/index.js +1043 -1036
- package/umd/widgets.css +1 -1
- package/es/components/Scene/components/UeForWebUI/WebUI.mjs +0 -4
- package/es/components/Scene/components/UeForXiWebView/XiWebView.mjs +0 -4
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const s = (e, t) => {
|
|
2
|
+
try {
|
|
3
|
+
if (!e || !e.setField || e.setType === 0)
|
|
4
|
+
return;
|
|
5
|
+
e.setType === 1 && localStorage.setItem("Local_" + e.setField, JSON.stringify(t)), e.setType === 2 && sessionStorage.setItem(
|
|
6
|
+
"Session_" + e.setField,
|
|
7
|
+
JSON.stringify(t)
|
|
8
|
+
);
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
s as storageData
|
|
14
|
+
};
|
|
@@ -1,135 +1,160 @@
|
|
|
1
|
-
import { cloneDeep as u } from "lodash";
|
|
2
|
-
import { SHJDatasourceV2 as c } from "../index.mjs";
|
|
3
|
-
import { storageData as d } from "./storageData.mjs";
|
|
4
|
-
import "../../event/actions/fullScreenAction.mjs";
|
|
5
|
-
import { EventUtils as
|
|
6
|
-
class o {
|
|
7
|
-
static executeAllVariable(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}), o.setVariables(
|
|
11
|
-
c.parse({
|
|
12
|
-
sources: [
|
|
13
|
-
noUseMapping: !0,
|
|
14
|
-
callback: (t) => {
|
|
15
|
-
o.setVariableById(
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
static replaceObjectVariables(
|
|
21
|
-
const
|
|
22
|
-
return JSON.parse(
|
|
23
|
-
}
|
|
24
|
-
static replaceStringVariables(
|
|
25
|
-
return
|
|
26
|
-
const { varName:
|
|
27
|
-
if (!
|
|
28
|
-
return "Error";
|
|
29
|
-
let
|
|
30
|
-
try {
|
|
31
|
-
for (const l of
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
} catch {
|
|
39
|
-
return "Error";
|
|
40
|
-
}
|
|
41
|
-
return typeof
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
static getObjectVariableNames(
|
|
45
|
-
return this.getStringVariableNames(JSON.stringify(
|
|
46
|
-
}
|
|
47
|
-
static getStringVariableNames(
|
|
48
|
-
const
|
|
49
|
-
for (const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return Array.from(
|
|
54
|
-
}
|
|
55
|
-
static parseVariablePath(
|
|
56
|
-
const t =
|
|
57
|
-
return { varName:
|
|
58
|
-
}
|
|
59
|
-
static getEnvironments() {
|
|
60
|
-
return window._apiEnvironment;
|
|
61
|
-
}
|
|
62
|
-
static setEnvironments(
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
envName:
|
|
66
|
-
envBaseUrl:
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
static getVariables() {
|
|
70
|
-
return window._variables || [];
|
|
71
|
-
}
|
|
72
|
-
static setVariables(
|
|
73
|
-
window._variables = u(
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
static setVariableById(
|
|
78
|
-
const r = this.getVariableById(
|
|
79
|
-
if (r) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
import { cloneDeep as u, isObject as b } from "lodash";
|
|
2
|
+
import { SHJDatasourceV2 as c } from "../index.mjs";
|
|
3
|
+
import { storageData as d } from "./storageData.mjs";
|
|
4
|
+
import "../../event/actions/fullScreenAction.mjs";
|
|
5
|
+
import { EventUtils as f } from "../../event/utils/utils.mjs";
|
|
6
|
+
class o {
|
|
7
|
+
static executeAllVariable(e) {
|
|
8
|
+
e.forEach((a) => {
|
|
9
|
+
a.sources.isVariable = !0;
|
|
10
|
+
}), o.setVariables(e), e.forEach((a) => {
|
|
11
|
+
c.parse({
|
|
12
|
+
sources: [a.sources],
|
|
13
|
+
noUseMapping: !0,
|
|
14
|
+
callback: (t) => {
|
|
15
|
+
o.setVariableById(a, t, !1);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
static replaceObjectVariables(e) {
|
|
21
|
+
const a = this.replaceStringVariables(JSON.stringify(e));
|
|
22
|
+
return JSON.parse(a);
|
|
23
|
+
}
|
|
24
|
+
static replaceStringVariables(e) {
|
|
25
|
+
return e.replace(/\$g\{([^}]+)\}/g, (a, t) => {
|
|
26
|
+
const { varName: i, propPath: r } = this.parseVariablePath(t), s = this.getVariables().find((l) => l.name === i);
|
|
27
|
+
if (!s)
|
|
28
|
+
return "Error";
|
|
29
|
+
let n = s._value;
|
|
30
|
+
try {
|
|
31
|
+
for (const l of r) {
|
|
32
|
+
if (n == null) {
|
|
33
|
+
n = void 0;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
n = n[l];
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
return "Error";
|
|
40
|
+
}
|
|
41
|
+
return typeof n == "object" ? JSON.stringify(n) : n === void 0 ? "Error" : String(n);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
static getObjectVariableNames(e) {
|
|
45
|
+
return this.getStringVariableNames(JSON.stringify(e));
|
|
46
|
+
}
|
|
47
|
+
static getStringVariableNames(e) {
|
|
48
|
+
const a = /* @__PURE__ */ new Set(), t = /\$g\{([^}]+)\}/g;
|
|
49
|
+
for (const i of e.matchAll(t)) {
|
|
50
|
+
const r = i[1], { varName: s } = this.parseVariablePath(r);
|
|
51
|
+
s && a.add(s);
|
|
52
|
+
}
|
|
53
|
+
return Array.from(a);
|
|
54
|
+
}
|
|
55
|
+
static parseVariablePath(e) {
|
|
56
|
+
const t = e.replace(/\[/g, ".").replace(/\]/g, "").split("."), i = t[0], r = t.slice(1);
|
|
57
|
+
return { varName: i, propPath: r };
|
|
58
|
+
}
|
|
59
|
+
static getEnvironments() {
|
|
60
|
+
return window._apiEnvironment;
|
|
61
|
+
}
|
|
62
|
+
static setEnvironments(e) {
|
|
63
|
+
const a = e.find((t) => t.selected);
|
|
64
|
+
a && (window._apiEnvironment = {
|
|
65
|
+
envName: a.envName,
|
|
66
|
+
envBaseUrl: a.envBaseUrl
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
static getVariables() {
|
|
70
|
+
return window._variables || [];
|
|
71
|
+
}
|
|
72
|
+
static setVariables(e) {
|
|
73
|
+
window._variables = u(e), window._variables.forEach((a) => {
|
|
74
|
+
a._callbacks ??= /* @__PURE__ */ new Map();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
static setVariableById(e, a, t = !0, i) {
|
|
78
|
+
const r = this.getVariableById(e.id);
|
|
79
|
+
if (r) {
|
|
80
|
+
if (i) {
|
|
81
|
+
const s = this.setObjectJsonByPath(
|
|
82
|
+
i,
|
|
83
|
+
r._value,
|
|
84
|
+
a
|
|
85
|
+
);
|
|
86
|
+
s && (r._value = s);
|
|
87
|
+
} else
|
|
88
|
+
r._value = a;
|
|
89
|
+
d(e.sources.source.storage, a), r._callbacks ??= /* @__PURE__ */ new Map(), r._callbacks.forEach((s) => s(e._value)), t && f.updateWidgetVariableData(r);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static getVariableById(e) {
|
|
93
|
+
return window._variables.find((a) => a.id === e);
|
|
94
|
+
}
|
|
95
|
+
static getVariableByName(e) {
|
|
96
|
+
return window._variables.find((a) => a.name === e);
|
|
97
|
+
}
|
|
98
|
+
static getVariableValueById(e) {
|
|
99
|
+
const a = window._variables.find((t) => t.id === e);
|
|
100
|
+
return a ? a._value : null;
|
|
101
|
+
}
|
|
102
|
+
static addVariable = (e) => {
|
|
103
|
+
c.parse({
|
|
104
|
+
sources: [e.sources],
|
|
105
|
+
noUseMapping: !0,
|
|
106
|
+
callback: (a) => {
|
|
107
|
+
this.getVariables().push(e), this.setVariableById(e, a, !1);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
static updateVariable = (e) => {
|
|
112
|
+
c.parse({
|
|
113
|
+
sources: [e.sources],
|
|
114
|
+
noUseMapping: !0,
|
|
115
|
+
callback: (a) => {
|
|
116
|
+
this.setVariableById(e, a, !0);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
static deleteVariableById = (e) => {
|
|
121
|
+
const a = window._variables.findIndex((t) => t.id === e);
|
|
122
|
+
a > -1 && window._variables.splice(a, 1);
|
|
123
|
+
};
|
|
124
|
+
static noneData(e) {
|
|
125
|
+
return {
|
|
126
|
+
id: e,
|
|
127
|
+
finalKeyData: { id: e, data: null },
|
|
128
|
+
finalUserData: { id: e, data: null },
|
|
129
|
+
filteredData: null,
|
|
130
|
+
rawData: null,
|
|
131
|
+
noMappingData: null
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 动态给对象指定路径设置值(含路径有效性检测,全程使用new Function)
|
|
136
|
+
* @param {string} path - 支持点分隔(data3.t1)和数组下标(data3.t2[1])
|
|
137
|
+
* @param {object} obj - 目标对象
|
|
138
|
+
* @param {any} value - 待设置值
|
|
139
|
+
* @throws {Error} 路径无效(节点不存在)时抛出错误
|
|
140
|
+
*/
|
|
141
|
+
static setObjectJsonByPath(e, a, t) {
|
|
142
|
+
if (!b(a))
|
|
143
|
+
return;
|
|
144
|
+
a = u(a);
|
|
145
|
+
const i = new Function("obj", `return obj${e}`);
|
|
146
|
+
try {
|
|
147
|
+
if (i(a) === void 0)
|
|
148
|
+
return;
|
|
149
|
+
} catch {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
return new Function("obj", "value", `obj${e} = value; return obj`)(
|
|
153
|
+
a,
|
|
154
|
+
t
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
o as DataSourceUtils
|
|
160
|
+
};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { SHJDatasourceV2 as
|
|
2
|
-
import { DataSourceUtils as s } from "../../datasource/utils/utils.mjs";
|
|
3
|
-
const f = (e,
|
|
4
|
-
const r = s.getVariableByName(e.name);
|
|
5
|
-
if (r) {
|
|
6
|
-
if (e.refreshLinkComponents ??= !0, e.dataType === "params") {
|
|
7
|
-
s.setVariableById(
|
|
8
|
-
r,
|
|
9
|
-
|
|
10
|
-
e.refreshLinkComponents
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { SHJDatasourceV2 as n } from "../../datasource/index.mjs";
|
|
2
|
+
import { DataSourceUtils as s } from "../../datasource/utils/utils.mjs";
|
|
3
|
+
const f = (e, t) => {
|
|
4
|
+
const r = s.getVariableByName(e.name);
|
|
5
|
+
if (r) {
|
|
6
|
+
if (e.refreshLinkComponents ??= !0, e.dataType === "params") {
|
|
7
|
+
s.setVariableById(
|
|
8
|
+
r,
|
|
9
|
+
t,
|
|
10
|
+
e.refreshLinkComponents,
|
|
11
|
+
e.setObjectKeyPath
|
|
12
|
+
);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
n.parse({
|
|
16
|
+
sources: [e.useDataSource],
|
|
17
|
+
noUseMapping: !0,
|
|
18
|
+
isInterval: !1,
|
|
19
|
+
callback: (o) => {
|
|
20
|
+
s.setVariableById(
|
|
21
|
+
r,
|
|
22
|
+
o,
|
|
23
|
+
e.refreshLinkComponents,
|
|
24
|
+
e.setObjectKeyPath
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
f as executeUpdateVariableAction
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f1d151c0"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useVueImportMap as
|
|
1
|
+
import { defineComponent as v, onMounted as H, computed as u, ref as l, shallowRef as y, createElementBlock as E, openBlock as d, createElementVNode as x, createBlock as V, createCommentVNode as C, unref as O } from "vue";
|
|
2
|
+
import { useVueImportMap as b, Sandbox as j, useStore as D } from "@shjjs/repl";
|
|
3
3
|
import { useWatch as N } from "./hooks/useWatch.mjs";
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
@@ -158,100 +158,97 @@ import "../../../Scene/components/Earth/index.mjs";
|
|
|
158
158
|
import "../../../Deleted/components/StaticSwitch/index.mjs";
|
|
159
159
|
import "../../../Deleted/components/RowScroll/index.mjs";
|
|
160
160
|
import "../../../Deleted/components/Wavesurfer/index.mjs";
|
|
161
|
-
import { SHJDatasourceV2 as
|
|
162
|
-
import { SHJParseEvent as
|
|
161
|
+
import { SHJDatasourceV2 as R } from "../../../../commons/plugins/datasource/index.mjs";
|
|
162
|
+
import { SHJParseEvent as P } from "../../../../commons/plugins/event/index.mjs";
|
|
163
163
|
import "lodash";
|
|
164
|
-
import { upgradeCustomComponentRender as
|
|
165
|
-
import
|
|
166
|
-
import
|
|
167
|
-
import
|
|
168
|
-
import
|
|
169
|
-
const
|
|
170
|
-
...
|
|
164
|
+
import { upgradeCustomComponentRender as M } from "./version.mjs";
|
|
165
|
+
import f from "./libs/runtime-dom.esm-browser.mjs";
|
|
166
|
+
import k from "./libs/server-renderer.esm-browser.mjs";
|
|
167
|
+
import B from "axios";
|
|
168
|
+
import L from "hls.js";
|
|
169
|
+
const W = { class: "custom-component-render" }, A = v({ name: "ShjCustomComponentRender" }), Gt = /* @__PURE__ */ v({
|
|
170
|
+
...A,
|
|
171
171
|
props: {
|
|
172
172
|
option: {},
|
|
173
173
|
sources: {},
|
|
174
174
|
useEvents: {}
|
|
175
175
|
},
|
|
176
|
-
setup(i, { expose:
|
|
177
|
-
window.Axios =
|
|
178
|
-
window.SHJDatasourceV2 =
|
|
176
|
+
setup(i, { expose: w }) {
|
|
177
|
+
window.Axios = B, window.Hls = L, H(() => {
|
|
178
|
+
window.SHJDatasourceV2 = R, window.SHJParseEvent = P;
|
|
179
179
|
});
|
|
180
|
-
const
|
|
181
|
-
productionMode:
|
|
182
|
-
vueVersion:
|
|
180
|
+
const p = u(() => M(i.option)), {
|
|
181
|
+
productionMode: m,
|
|
182
|
+
vueVersion: S,
|
|
183
183
|
importMap: h
|
|
184
|
-
} =
|
|
185
|
-
runtimeDev:
|
|
186
|
-
runtimeProd:
|
|
187
|
-
serverRenderer:
|
|
188
|
-
}),
|
|
184
|
+
} = b({
|
|
185
|
+
runtimeDev: f,
|
|
186
|
+
runtimeProd: f,
|
|
187
|
+
serverRenderer: k
|
|
188
|
+
}), g = u(() => ({
|
|
189
189
|
script: {
|
|
190
|
-
inlineTemplate:
|
|
191
|
-
isProd:
|
|
190
|
+
inlineTemplate: m.value,
|
|
191
|
+
isProd: m.value,
|
|
192
192
|
propsDestructure: !0
|
|
193
193
|
},
|
|
194
194
|
style: {
|
|
195
|
-
isProd:
|
|
195
|
+
isProd: m.value
|
|
196
196
|
},
|
|
197
197
|
template: {
|
|
198
|
-
isProd:
|
|
198
|
+
isProd: m.value
|
|
199
199
|
}
|
|
200
|
-
})),
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
})), e = l(!0), o = y(null), c = l("");
|
|
201
|
+
(() => {
|
|
202
|
+
const r = p.value.hash;
|
|
203
|
+
if (!(c.value === r && o.value)) {
|
|
204
|
+
c.value = r, e.value = !0;
|
|
204
205
|
try {
|
|
205
206
|
const t = D(
|
|
206
|
-
{ builtinImportMap: h, vueVersion:
|
|
207
|
-
|
|
207
|
+
{ builtinImportMap: h, vueVersion: S, sfcOptions: g },
|
|
208
|
+
r
|
|
208
209
|
);
|
|
209
210
|
t.files["src/source.json"] && (t.files["src/source.json"].code = JSON.stringify(i.sources, null, 2)), t.files["src/option.json"] && (t.files["src/option.json"].code = JSON.stringify(
|
|
210
|
-
|
|
211
|
+
p.value.option,
|
|
211
212
|
null,
|
|
212
213
|
2
|
|
213
|
-
)), o.value = t,
|
|
214
|
+
)), o.value = t, e.value = !1;
|
|
214
215
|
} catch {
|
|
215
|
-
|
|
216
|
+
e.value = !1;
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const m = () => {
|
|
227
|
-
o.value && (r.value = !0, o.value.files["src/source.json"] && (o.value.files["src/source.json"].code = JSON.stringify(
|
|
219
|
+
})();
|
|
220
|
+
const n = () => {
|
|
221
|
+
if (!o.value || !a.value)
|
|
222
|
+
return;
|
|
223
|
+
const r = a.value.querySelector("iframe").contentWindow;
|
|
224
|
+
r && r.postMessage(JSON.stringify(i.sources), "*");
|
|
225
|
+
}, s = () => {
|
|
226
|
+
o.value && (e.value = !0, o.value.files["src/source.json"] && (o.value.files["src/source.json"].code = JSON.stringify(
|
|
228
227
|
i.sources,
|
|
229
228
|
null,
|
|
230
229
|
2
|
|
231
|
-
)),
|
|
232
|
-
|
|
233
|
-
}, 10));
|
|
234
|
-
}, n = () => {
|
|
235
|
-
o.value && (r.value = !0, o.value.files["src/option.json"] && (o.value.files["src/option.json"].code = JSON.stringify(
|
|
236
|
-
e.value.option,
|
|
230
|
+
)), o.value.files["src/option.json"] && (o.value.files["src/option.json"].code = JSON.stringify(
|
|
231
|
+
p.value.option,
|
|
237
232
|
null,
|
|
238
233
|
2
|
|
239
234
|
)), setTimeout(() => {
|
|
240
|
-
|
|
235
|
+
e.value = !1;
|
|
241
236
|
}, 10));
|
|
242
237
|
};
|
|
243
|
-
N({ option:
|
|
238
|
+
N({ option: p, sources: i.sources }, n, s), w({
|
|
244
239
|
refresh: () => {
|
|
245
|
-
|
|
240
|
+
s(), n();
|
|
246
241
|
},
|
|
247
242
|
refreshView: () => {
|
|
248
|
-
|
|
243
|
+
s(), n();
|
|
249
244
|
},
|
|
250
245
|
refreshData: () => {
|
|
251
|
-
|
|
246
|
+
n();
|
|
252
247
|
}
|
|
253
248
|
});
|
|
254
|
-
const
|
|
249
|
+
const J = u(() => ({
|
|
250
|
+
showRuntimeError: !1,
|
|
251
|
+
showRuntimeWarning: !1,
|
|
255
252
|
customCode: {
|
|
256
253
|
useCode: `
|
|
257
254
|
/** 导入山河鉴必须的变量 **/
|
|
@@ -260,6 +257,13 @@ const A = { class: "custom-component-render" }, I = { class: "preview-content" }
|
|
|
260
257
|
window.Hls = window.parent.Hls;
|
|
261
258
|
window.SHJDatasourceV2 = window.parent.SHJDatasourceV2;
|
|
262
259
|
window.SHJParseEvent = window.parent.SHJParseEvent;
|
|
260
|
+
window.SHJDataEventListener = function (sources) {
|
|
261
|
+
console.log("数据源发生改变", sources)
|
|
262
|
+
}
|
|
263
|
+
/** 监听父页面发送的消息 */
|
|
264
|
+
window.addEventListener('message', function (e) {
|
|
265
|
+
SHJDataEventListener(JSON.parse(e.data))
|
|
266
|
+
});
|
|
263
267
|
`
|
|
264
268
|
},
|
|
265
269
|
headHTML: `
|
|
@@ -279,19 +283,23 @@ const A = { class: "custom-component-render" }, I = { class: "preview-content" }
|
|
|
279
283
|
}
|
|
280
284
|
</style>
|
|
281
285
|
`
|
|
282
|
-
}));
|
|
283
|
-
return (
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
})), a = l();
|
|
287
|
+
return (r, t) => (d(), E("div", W, [
|
|
288
|
+
x("div", {
|
|
289
|
+
ref_key: "sandboxRef",
|
|
290
|
+
ref: a,
|
|
291
|
+
class: "preview-content"
|
|
292
|
+
}, [
|
|
293
|
+
!e.value && o.value ? (d(), V(O(j), {
|
|
286
294
|
key: 0,
|
|
287
295
|
store: o.value,
|
|
288
|
-
"clear-console": !
|
|
289
|
-
"preview-options":
|
|
290
|
-
}, null, 8, ["store", "preview-options"])) :
|
|
291
|
-
])
|
|
296
|
+
"clear-console": !0,
|
|
297
|
+
"preview-options": J.value
|
|
298
|
+
}, null, 8, ["store", "preview-options"])) : C("", !0)
|
|
299
|
+
], 512)
|
|
292
300
|
]));
|
|
293
301
|
}
|
|
294
302
|
});
|
|
295
303
|
export {
|
|
296
|
-
|
|
304
|
+
Gt as default
|
|
297
305
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f08c485a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, computed as a, onMounted as d, onBeforeUnmount as
|
|
1
|
+
import { defineComponent as s, computed as a, onMounted as d, onBeforeUnmount as l, createElementBlock as v, openBlock as f } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import "../../../Interaction/components/Tabs/index.mjs";
|
|
@@ -162,9 +162,8 @@ import "../../../../commons/plugins/datasource/utils/request.mjs";
|
|
|
162
162
|
import "mqtt";
|
|
163
163
|
import "nanoid";
|
|
164
164
|
import { upgradeUeForWebUI as g } from "./version.mjs";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
...U,
|
|
165
|
+
const h = { class: "shj-ue-for-WebUI" }, E = s({ name: "ShjUeForWebUI" }), wr = /* @__PURE__ */ s({
|
|
166
|
+
...E,
|
|
168
167
|
props: {
|
|
169
168
|
option: {},
|
|
170
169
|
sources: {},
|
|
@@ -190,14 +189,14 @@ const E = { class: "shj-ue-for-WebUI" }, U = s({ name: "ShjUeForWebUI" }), Ir =
|
|
|
190
189
|
};
|
|
191
190
|
let o = null;
|
|
192
191
|
return d(() => {
|
|
193
|
-
o = document.createElement("script"), o.src =
|
|
192
|
+
o = document.createElement("script"), o.src = `/libs/WebUI.js?t=${Date.now()}`, o.type = "text/javascript", o.onload = () => {
|
|
194
193
|
u();
|
|
195
194
|
}, document.body.appendChild(o);
|
|
196
|
-
}),
|
|
195
|
+
}), l(() => {
|
|
197
196
|
delete window.ue;
|
|
198
|
-
}), (r, i) => (
|
|
197
|
+
}), (r, i) => (f(), v("div", h));
|
|
199
198
|
}
|
|
200
199
|
});
|
|
201
200
|
export {
|
|
202
|
-
|
|
201
|
+
wr as default
|
|
203
202
|
};
|