magtool 1.5.37 → 1.5.39
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/dist/composition.js +81 -78
- package/dist/cpt/AiApp.js +117 -0
- package/dist/cpt/AiOrg.js +130 -0
- package/dist/cpt/AsaAdGroup.js +261 -0
- package/dist/cpt/AsaApp.js +126 -0
- package/dist/cpt/AsaCampaign.js +268 -0
- package/dist/cpt/AsaOrg.js +130 -0
- package/dist/cpt/Card.js +92 -0
- package/dist/cpt/Country.js +32 -0
- package/dist/cpt/CountryItem.js +56 -0
- package/dist/cpt/DatePicker.js +246 -0
- package/dist/cpt/EChart.js +271 -0
- package/dist/cpt/Form.js +75 -0
- package/dist/cpt/Header.js +786 -0
- package/dist/cpt/Icon.js +24 -0
- package/dist/cpt/Image.js +58 -0
- package/dist/cpt/Input.js +129 -0
- package/dist/cpt/Main.js +230 -0
- package/dist/cpt/MultipleSelect.js +143 -0
- package/dist/cpt/Nodata.js +39 -0
- package/dist/cpt/Org.js +99 -0
- package/dist/cpt/Page.js +74 -0
- package/dist/cpt/StatusItem.js +68 -0
- package/dist/cpt/StatusSelect.js +79 -0
- package/dist/cpt/Table.js +123 -0
- package/dist/cpt/Textarea.js +132 -0
- package/dist/cpt/Timezone.js +128 -0
- package/dist/cpt/chip.js +639 -0
- package/dist/cpt/component.js +21 -0
- package/dist/css/cpt/Card.css +1 -0
- package/dist/css/cpt/EChart.css +1 -0
- package/dist/css/cpt/Header.css +1 -0
- package/dist/css/cpt/Main.css +1 -0
- package/dist/css/cpt/MultipleSelect.css +1 -0
- package/dist/css/cpt/Nodata.css +1 -0
- package/dist/css/cpt/Page.css +1 -0
- package/dist/css/cpt/Table.css +1 -0
- package/dist/css/cpt/Textarea.css +1 -0
- package/dist/css/cpt/chip.css +1 -0
- package/dist/css/{magtool.css → css/scss.css} +1 -1
- package/dist/index.js +4 -8
- package/dist/util.js +5 -5
- package/dist/vendor.js +38 -31
- package/package.json +1 -1
- package/dist/component.js +0 -4427
package/dist/composition.js
CHANGED
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
const v = (
|
|
2
|
-
const { age:
|
|
1
|
+
const v = (e) => {
|
|
2
|
+
const { age: t } = e || {};
|
|
3
3
|
let n, a;
|
|
4
|
-
if (
|
|
5
|
-
const { minAge: o, maxAge: r } =
|
|
4
|
+
if (t != null && t.included) {
|
|
5
|
+
const { minAge: o, maxAge: r } = t.included[0] || {};
|
|
6
6
|
o ? n = o : n = "all", r ? a = r : a = "all";
|
|
7
7
|
}
|
|
8
8
|
return a === "all" ? n === "all" ? "All" : `${n}~65+` : `${n}~${a}`;
|
|
9
|
-
}, S = (
|
|
9
|
+
}, S = (e, t) => e === "all" ? null : t === 65 ? {
|
|
10
10
|
included: [
|
|
11
11
|
{
|
|
12
|
-
minAge:
|
|
12
|
+
minAge: e
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
} : {
|
|
16
16
|
included: [
|
|
17
17
|
{
|
|
18
|
-
minAge:
|
|
19
|
-
maxAge:
|
|
18
|
+
minAge: e,
|
|
19
|
+
maxAge: t
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
|
-
}, _ = (
|
|
23
|
-
const { gender:
|
|
24
|
-
return
|
|
22
|
+
}, _ = (e) => {
|
|
23
|
+
const { gender: t } = e || {};
|
|
24
|
+
return t != null && t.included ? t.included[0] : null;
|
|
25
25
|
}, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
26
|
__proto__: null,
|
|
27
27
|
useAgeFormat: v,
|
|
28
28
|
useAgeValue: S,
|
|
29
29
|
useGenderFormat: _
|
|
30
|
-
}, Symbol.toStringTag, { value: "Module" })), M = (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
}, Symbol.toStringTag, { value: "Module" })), M = (e) => {
|
|
31
|
+
if (e)
|
|
32
|
+
return new Promise((t, n) => {
|
|
33
|
+
const a = new Image();
|
|
34
|
+
try {
|
|
35
|
+
a.src = window.$getType(e) === "String" ? e : URL.createObjectURL(e), a.onload = () => t(a), a.onerror = () => n(new Error("Could not load image"));
|
|
36
|
+
} catch (o) {
|
|
37
|
+
console.error(`${{ error: o }}. Error Url: ${e}`);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}, O = (e) => new Promise((t, n) => {
|
|
38
41
|
const a = document.createElement("video");
|
|
39
|
-
a.preload = "metadata", window.$getType(
|
|
40
|
-
window.URL.revokeObjectURL(
|
|
42
|
+
a.preload = "metadata", window.$getType(e) === "String" ? a.src = e : a.src = URL.createObjectURL(e), a.onloadedmetadata = () => {
|
|
43
|
+
window.URL.revokeObjectURL(e), t(a);
|
|
41
44
|
};
|
|
42
45
|
}), j = async ({
|
|
43
|
-
type:
|
|
44
|
-
url:
|
|
46
|
+
type: e,
|
|
47
|
+
url: t,
|
|
45
48
|
headers: n,
|
|
46
49
|
data: a,
|
|
47
50
|
name: o,
|
|
@@ -50,15 +53,15 @@ const v = (t) => {
|
|
|
50
53
|
}) => {
|
|
51
54
|
let l = document.createElement("a"), i = null;
|
|
52
55
|
try {
|
|
53
|
-
if (
|
|
56
|
+
if (e === "csv") {
|
|
54
57
|
if (!a)
|
|
55
58
|
throw r(), new Error("data is null");
|
|
56
59
|
const c = new Blob(["\uFEFF" + a], {
|
|
57
60
|
type: "text/csv,charset=UTF-8"
|
|
58
61
|
});
|
|
59
62
|
l.href = URL.createObjectURL(c);
|
|
60
|
-
} else if (
|
|
61
|
-
const c = await fetch(
|
|
63
|
+
} else if (e === "excel") {
|
|
64
|
+
const c = await fetch(t, {
|
|
62
65
|
headers: n
|
|
63
66
|
}).then((g) => g.blob());
|
|
64
67
|
if (!(c != null && c.type.includes("sheet")))
|
|
@@ -74,18 +77,18 @@ const v = (t) => {
|
|
|
74
77
|
download: j,
|
|
75
78
|
loadImage: M,
|
|
76
79
|
loadVideo: O
|
|
77
|
-
}, Symbol.toStringTag, { value: "Module" })), C = ({ table:
|
|
80
|
+
}, Symbol.toStringTag, { value: "Module" })), C = ({ table: e, key: t, form: n, value: a, cb: o = () => {
|
|
78
81
|
} }) => {
|
|
79
|
-
const r =
|
|
80
|
-
r.length > 1 ? (
|
|
81
|
-
}, L = (
|
|
82
|
-
let { sortable:
|
|
82
|
+
const r = e.getSelectionRows();
|
|
83
|
+
r.length > 1 ? (e.clearSelection(), e.toggleRowSelection(r[1], "selected"), n[a] = r[1][t]) : r.length === 1 && (n[a] = r[0][t]), o();
|
|
84
|
+
}, L = (e = {}) => {
|
|
85
|
+
let { sortable: t = !0, empty: n = !1, mmp: a = !1 } = e, o = window.$map.asa.asaMetric.all;
|
|
83
86
|
a && (o = o.concat(window.$map.asa.mmpMetric.all));
|
|
84
87
|
const r = o.map((l, i) => ({
|
|
85
88
|
label: l.label,
|
|
86
89
|
prop: l.value,
|
|
87
90
|
width: l.width,
|
|
88
|
-
sortable:
|
|
91
|
+
sortable: t,
|
|
89
92
|
type: l.type,
|
|
90
93
|
align: l.align,
|
|
91
94
|
visible: l.visible,
|
|
@@ -99,8 +102,8 @@ const v = (t) => {
|
|
|
99
102
|
}), r;
|
|
100
103
|
}, I = () => ({
|
|
101
104
|
label: "-"
|
|
102
|
-
}), R = ({ columns:
|
|
103
|
-
if (!
|
|
105
|
+
}), R = ({ columns: e, data: t, currency: n = "", channel: a = "" }) => {
|
|
106
|
+
if (!t.length || !e.length)
|
|
104
107
|
return [];
|
|
105
108
|
const o = {
|
|
106
109
|
spend: {
|
|
@@ -146,13 +149,13 @@ const v = (t) => {
|
|
|
146
149
|
mmpInstalls: {},
|
|
147
150
|
mmpCPI: {}
|
|
148
151
|
};
|
|
149
|
-
|
|
152
|
+
e.forEach((s, d) => {
|
|
150
153
|
l[s.property] && (l[s.property].i = d);
|
|
151
154
|
const m = o[s.property];
|
|
152
155
|
if (m) {
|
|
153
156
|
m.i = d;
|
|
154
157
|
let f = window.$bn(0);
|
|
155
|
-
|
|
158
|
+
t.forEach((b) => {
|
|
156
159
|
f = f.plus(b[s.property] || 0);
|
|
157
160
|
}), f = f.toNumber(), m.total = f, r.push(f);
|
|
158
161
|
} else
|
|
@@ -174,13 +177,13 @@ const v = (t) => {
|
|
|
174
177
|
r[l.ttr.i] = h;
|
|
175
178
|
const w = o.impressions.total ? window.$fa(o.installs.total * 1e3 / o.impressions.total) : "0.00";
|
|
176
179
|
return r[l.IPM.i] = w, r;
|
|
177
|
-
}, U = (
|
|
178
|
-
const
|
|
179
|
-
return Object.keys(
|
|
180
|
-
const a =
|
|
181
|
-
|
|
182
|
-
}),
|
|
183
|
-
}, F = ({ columns:
|
|
180
|
+
}, U = (e) => {
|
|
181
|
+
const t = window.$map.asa.allMetric.obj;
|
|
182
|
+
return Object.keys(e).forEach((n) => {
|
|
183
|
+
const a = e[n];
|
|
184
|
+
t[n] && (e[`${n}Format`] = window.$fu({ prop: n, value: a, currency: !1, obj: t }));
|
|
185
|
+
}), e;
|
|
186
|
+
}, F = ({ columns: e, data: t }, n) => e.length && t.length ? e.map((o) => {
|
|
184
187
|
let r = n[o.property] === void 0 ? "" : n[o.property];
|
|
185
188
|
if (r !== "")
|
|
186
189
|
try {
|
|
@@ -196,15 +199,15 @@ const v = (t) => {
|
|
|
196
199
|
useRemoteSummary: F,
|
|
197
200
|
useSingleSelect: C,
|
|
198
201
|
useSummary: R
|
|
199
|
-
}, Symbol.toStringTag, { value: "Module" })), x = (
|
|
200
|
-
const n = document.querySelector("html"), { scrollTop: a } = n, o =
|
|
202
|
+
}, Symbol.toStringTag, { value: "Module" })), x = (e, t = 96) => {
|
|
203
|
+
const n = document.querySelector("html"), { scrollTop: a } = n, o = e.getBoundingClientRect();
|
|
201
204
|
n.scrollTo({
|
|
202
|
-
top: a + o.y -
|
|
205
|
+
top: a + o.y - t,
|
|
203
206
|
behavior: "smooth"
|
|
204
207
|
});
|
|
205
|
-
}, T = async ({ app:
|
|
208
|
+
}, T = async ({ app: e, langs: t, langObj: n }) => new Promise((a) => {
|
|
206
209
|
const o = [];
|
|
207
|
-
|
|
210
|
+
t.forEach((i) => {
|
|
208
211
|
i.use && o.push(i);
|
|
209
212
|
}), globalThis.$langs = o;
|
|
210
213
|
let r = {};
|
|
@@ -225,47 +228,47 @@ const v = (t) => {
|
|
|
225
228
|
};
|
|
226
229
|
String.prototype.$l = function() {
|
|
227
230
|
return l(this);
|
|
228
|
-
}, globalThis.$l = l,
|
|
231
|
+
}, globalThis.$l = l, e.config.globalProperties.$l = l, a();
|
|
229
232
|
}), B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
230
233
|
__proto__: null,
|
|
231
234
|
pageScrollTo: x,
|
|
232
235
|
useLang: T
|
|
233
236
|
}, Symbol.toStringTag, { value: "Module" })), u = [];
|
|
234
237
|
let y = 0;
|
|
235
|
-
const $ = function(
|
|
236
|
-
u.forEach((
|
|
237
|
-
if (
|
|
238
|
-
|
|
238
|
+
const $ = function(e) {
|
|
239
|
+
u.forEach((t) => {
|
|
240
|
+
if (t.time === void 0 || t.lastTime === 0 || e - t.lastTime >= t.time) {
|
|
241
|
+
t.cb(e), t.lastTime = e;
|
|
239
242
|
return;
|
|
240
243
|
}
|
|
241
244
|
}), u.length && window.requestAnimationFrame($);
|
|
242
|
-
}, k = function(
|
|
245
|
+
}, k = function(e, t = 1e3) {
|
|
243
246
|
return y++, u.push({
|
|
244
|
-
cb:
|
|
245
|
-
time:
|
|
247
|
+
cb: e,
|
|
248
|
+
time: t,
|
|
246
249
|
lastTime: 0,
|
|
247
250
|
id: y
|
|
248
251
|
}), u.length === 1 && window.requestAnimationFrame($), y;
|
|
249
|
-
}, z = function(
|
|
250
|
-
for (let
|
|
251
|
-
if (u[
|
|
252
|
-
u.splice(
|
|
252
|
+
}, z = function(e) {
|
|
253
|
+
for (let t = 0; t < u.length; t++)
|
|
254
|
+
if (u[t].id === e) {
|
|
255
|
+
u.splice(t, 1);
|
|
253
256
|
break;
|
|
254
257
|
}
|
|
255
258
|
}, q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
256
259
|
__proto__: null,
|
|
257
260
|
clearRaf: z,
|
|
258
261
|
useRaf: k
|
|
259
|
-
}, Symbol.toStringTag, { value: "Module" })), W = async (
|
|
262
|
+
}, Symbol.toStringTag, { value: "Module" })), W = async (e) => {
|
|
260
263
|
if (!document.getElementById("colorfulIcon"))
|
|
261
|
-
return new Promise((
|
|
264
|
+
return new Promise((t) => {
|
|
262
265
|
const n = document.createElement("script");
|
|
263
|
-
n.id = "colorfulIcon", n.type = "text/javascript", n.src =
|
|
266
|
+
n.id = "colorfulIcon", n.type = "text/javascript", n.src = e || globalThis.config.colorfulIcon, document.head.appendChild(n), t();
|
|
264
267
|
});
|
|
265
|
-
}, N = async (
|
|
268
|
+
}, N = async (e = {}) => {
|
|
266
269
|
if (!globalThis.$langs)
|
|
267
|
-
return new Promise(async (
|
|
268
|
-
const { theme: n = "light", currentLang: a, app: o } =
|
|
270
|
+
return new Promise(async (t) => {
|
|
271
|
+
const { theme: n = "light", currentLang: a, app: o } = e, r = document.documentElement, l = a || localStorage.getItem("lang") || globalThis.config.lang || "en_us";
|
|
269
272
|
r.classList.add(l);
|
|
270
273
|
const i = l.split("_");
|
|
271
274
|
r.setAttribute("lang", `${i[0]}-${i[1].toUpperCase()}`);
|
|
@@ -276,19 +279,19 @@ const $ = function(t) {
|
|
|
276
279
|
throw new Error(
|
|
277
280
|
"app is not defined, please check your vue app create from createApp() function"
|
|
278
281
|
);
|
|
279
|
-
|
|
282
|
+
t();
|
|
280
283
|
});
|
|
281
284
|
}, G = () => {
|
|
282
285
|
if (!globalThis.config)
|
|
283
286
|
throw new Error(
|
|
284
287
|
"globalThis.config is not defined, please create globalThis.config frist"
|
|
285
288
|
);
|
|
286
|
-
const { availWidth:
|
|
289
|
+
const { availWidth: e, availHeight: t } = globalThis.screen, { clientHeight: n } = globalThis.document.body, a = globalThis.config.page.paddingLeft || 32, o = globalThis.config.page.paddingRight || 32, r = e - a - o, l = globalThis.config.page.frameHeader || 82, i = globalThis.config.page.frameFooter || 36, c = n - l - i, g = globalThis.config.page.contentPaddingLeft || 16, p = globalThis.config.page.contentPaddingLeft || 16, h = r - g - p, w = globalThis.config.page.tableHeader || 56, s = globalThis.config.page.tableFooter || 56, d = n - l - w - s, m = globalThis.config.page.drawerHeader || 64, f = n - m, b = globalThis.navigator.userAgent.match(
|
|
287
290
|
/(phone|pad|pod|iPhone|iPod|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
288
291
|
) ? "h5" : "pc", P = /iPhone|iPad|iPod/i.test(globalThis.navigator.userAgent);
|
|
289
292
|
return globalThis.config.options = {
|
|
290
|
-
screenWidth:
|
|
291
|
-
screenHeight:
|
|
293
|
+
screenWidth: e,
|
|
294
|
+
screenHeight: t,
|
|
292
295
|
pageWidth: r,
|
|
293
296
|
pageHeight: c,
|
|
294
297
|
contentWidth: h,
|
|
@@ -303,15 +306,15 @@ const $ = function(t) {
|
|
|
303
306
|
initLang: N,
|
|
304
307
|
initOptions: G
|
|
305
308
|
}, Symbol.toStringTag, { value: "Module" })), V = () => {
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
}, J = (
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
|
|
309
|
+
const e = document.querySelectorAll(".echart-tooltip");
|
|
310
|
+
e != null && e.length && e.forEach((t) => t.remove());
|
|
311
|
+
}, J = (e) => {
|
|
312
|
+
if (e) {
|
|
313
|
+
const t = document.querySelector(`#${e}`);
|
|
314
|
+
t && (t.style.display = "none");
|
|
312
315
|
} else {
|
|
313
|
-
const
|
|
314
|
-
|
|
316
|
+
const t = document.querySelectorAll(".echart-tooltip");
|
|
317
|
+
t != null && t.length && t.forEach((n) => n.remove());
|
|
315
318
|
}
|
|
316
319
|
}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
317
320
|
__proto__: null,
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineComponent as D, reactive as I, inject as N, onMounted as L, computed as m, watch as k, resolveComponent as i, createElementBlock as w, openBlock as c, createBlock as b, createCommentVNode as $, createVNode as f, unref as n, mergeProps as j, createSlots as E, withCtx as g, Fragment as M, renderList as F, createElementVNode as _, toDisplayString as y } from "vue";
|
|
2
|
+
const P = { class: "SuperAiApp relative" }, U = { class: "flexMode vc g8" }, q = { class: "txt-nowrap" }, z = { class: "txt-dark5" }, G = D({
|
|
3
|
+
name: "SuperAiApp"
|
|
4
|
+
}), K = /* @__PURE__ */ Object.assign(G, {
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Number,
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
multiple: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
placeholder: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
useDefault: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
emits: [
|
|
24
|
+
"success",
|
|
25
|
+
"update:icon",
|
|
26
|
+
"update:orgs",
|
|
27
|
+
"update:name"
|
|
28
|
+
],
|
|
29
|
+
setup(V, { emit: S }) {
|
|
30
|
+
const s = V, t = I({
|
|
31
|
+
loading: !1,
|
|
32
|
+
single: "",
|
|
33
|
+
multiple: [],
|
|
34
|
+
options: []
|
|
35
|
+
}), d = N("store").ai();
|
|
36
|
+
L(() => {
|
|
37
|
+
x();
|
|
38
|
+
});
|
|
39
|
+
const l = S, x = async () => {
|
|
40
|
+
if (r.value.length) {
|
|
41
|
+
l("success");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
t.loading = !0, await d.getAppOptions(), t.loading = !1, l("success");
|
|
45
|
+
}, p = (e) => {
|
|
46
|
+
l("update:modelValue", e);
|
|
47
|
+
const { data: o } = d.appOptions.filter1((u) => u.id === t.single);
|
|
48
|
+
o && (l("update:name", o.name), l("update:icon", o.icon), l("update:orgs", o.orgs));
|
|
49
|
+
}, r = m(() => d.appOptions), A = m(() => s.placeholder ? window.$l(s.placeholder) : window.$l("App")), h = m(() => r.value.filter1((o) => o.id === t.single).data);
|
|
50
|
+
return k(
|
|
51
|
+
() => s.modelValue,
|
|
52
|
+
(e) => {
|
|
53
|
+
e && e !== t.v && (t.single = e, p(e));
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
immediate: !0
|
|
57
|
+
}
|
|
58
|
+
), k(
|
|
59
|
+
() => r.value,
|
|
60
|
+
(e) => {
|
|
61
|
+
s.useDefault && (e == null ? void 0 : e.length) === 1 && (t.single = e[0].id, p(e[0].id));
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
immediate: !0
|
|
65
|
+
}
|
|
66
|
+
), (e, o) => {
|
|
67
|
+
const u = i("IconLoading"), v = i("Image"), B = i("el-option"), C = i("el-select");
|
|
68
|
+
return c(), w("div", P, [
|
|
69
|
+
n(t).loading ? (c(), b(u, { key: 0 })) : $("", !0),
|
|
70
|
+
f(C, j({
|
|
71
|
+
modelValue: n(t).single,
|
|
72
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => n(t).single = a),
|
|
73
|
+
placeholder: n(A),
|
|
74
|
+
filterable: "",
|
|
75
|
+
clearable: "",
|
|
76
|
+
"default-first-option": "",
|
|
77
|
+
"fit-input-width": ""
|
|
78
|
+
}, e.$attrs, { onChange: p }), E({
|
|
79
|
+
default: g(() => [
|
|
80
|
+
(c(!0), w(M, null, F(n(r), (a, O) => (c(), b(B, {
|
|
81
|
+
key: O,
|
|
82
|
+
label: a.label,
|
|
83
|
+
value: a.id
|
|
84
|
+
}, {
|
|
85
|
+
default: g(() => [
|
|
86
|
+
_("div", U, [
|
|
87
|
+
f(v, {
|
|
88
|
+
src: a.icon,
|
|
89
|
+
class: "noShrink w24 h24 radius radius4 border-dark1"
|
|
90
|
+
}, null, 8, ["src"]),
|
|
91
|
+
_("span", q, y(a.name), 1),
|
|
92
|
+
_("span", z, "(" + y(a.id) + ")", 1)
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
_: 2
|
|
96
|
+
}, 1032, ["label", "value"]))), 128))
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
}, [
|
|
100
|
+
n(h) ? {
|
|
101
|
+
name: "prefix",
|
|
102
|
+
fn: g(() => [
|
|
103
|
+
f(v, {
|
|
104
|
+
src: n(h).icon,
|
|
105
|
+
class: "noShrink w24 h24 radius radius4 border-dark1"
|
|
106
|
+
}, null, 8, ["src"])
|
|
107
|
+
]),
|
|
108
|
+
key: "0"
|
|
109
|
+
} : void 0
|
|
110
|
+
]), 1040, ["modelValue", "placeholder"])
|
|
111
|
+
]);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
K as default
|
|
117
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { defineComponent as D, reactive as G, inject as L, onMounted as O, computed as m, watch as T, resolveComponent as g, createElementBlock as b, openBlock as f, createBlock as h, createCommentVNode as x, createElementVNode as s, unref as i, createVNode as V, withCtx as _, mergeProps as M, Fragment as j, renderList as E, normalizeClass as F, toDisplayString as z } from "vue";
|
|
2
|
+
import { useMap as P } from "asamap";
|
|
3
|
+
const R = { class: "SuperAsaOrg relative" }, U = { class: "inputGroup" }, q = { class: "inputGroupLeft noShrink" }, H = { class: "flexMode vc g4" }, J = { class: "txt-dark5" }, K = D({
|
|
4
|
+
name: "SuperAsaOrg"
|
|
5
|
+
}), Y = /* @__PURE__ */ Object.assign(K, {
|
|
6
|
+
props: {
|
|
7
|
+
app: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
changeImmediately: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: [Number, String],
|
|
17
|
+
default: 0
|
|
18
|
+
},
|
|
19
|
+
readonly: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
unTimezone: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: [
|
|
29
|
+
"update:modelValue",
|
|
30
|
+
"update:name",
|
|
31
|
+
"update:currency",
|
|
32
|
+
"update:readonly",
|
|
33
|
+
"success",
|
|
34
|
+
"error",
|
|
35
|
+
"change"
|
|
36
|
+
],
|
|
37
|
+
setup(C, { emit: k }) {
|
|
38
|
+
const l = C, a = G({
|
|
39
|
+
loading: !1,
|
|
40
|
+
single: "",
|
|
41
|
+
multiple: [],
|
|
42
|
+
options: []
|
|
43
|
+
}), v = L("store").ai();
|
|
44
|
+
O(() => {
|
|
45
|
+
B();
|
|
46
|
+
});
|
|
47
|
+
const t = k, B = async () => {
|
|
48
|
+
u.value.length ? (a.single || y(u.value[0].id), t("success")) : t("error");
|
|
49
|
+
}, y = (e) => {
|
|
50
|
+
var n, r, c, p;
|
|
51
|
+
t("update:modelValue", e), t("update:name", (n = d.value) == null ? void 0 : n.name), t("update:currency", (r = d.value) == null ? void 0 : r.currency), t("update:timezone", (c = d.value) == null ? void 0 : c.timezone), t("update:readonly", (p = d.value) == null ? void 0 : p.readonly), l.changeImmediately && t("change", e), l.unTimezone || N();
|
|
52
|
+
}, N = () => {
|
|
53
|
+
var n;
|
|
54
|
+
let e = d.value;
|
|
55
|
+
v.saveData("accountTimezone", {
|
|
56
|
+
timezoneName: e == null ? void 0 : e.timezone,
|
|
57
|
+
tip: "Account",
|
|
58
|
+
timezone: (n = P("common.timezone").filter1(
|
|
59
|
+
(r) => r.label === (e == null ? void 0 : e.timezone)
|
|
60
|
+
).data) == null ? void 0 : n.value
|
|
61
|
+
});
|
|
62
|
+
}, $ = () => {
|
|
63
|
+
a.single = "", t("update:modelValue", ""), t("update:name", ""), t("update:currency", ""), t("update:timezone", ""), t("update:readonly", !1);
|
|
64
|
+
}, w = m(() => window.$l("Campaign Group")), u = m(() => {
|
|
65
|
+
var e;
|
|
66
|
+
return l.app ? ((e = v.appOptions.filter1((n) => n.id === l.app).data) == null ? void 0 : e.orgs) || [] : [];
|
|
67
|
+
}), d = m(() => u.value.filter1((e) => e.id === a.single).data), I = m(() => !l.app);
|
|
68
|
+
return T(
|
|
69
|
+
() => l.modelValue,
|
|
70
|
+
(e) => {
|
|
71
|
+
e ? e !== a.single && (a.single = e, y(e)) : $();
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
immediate: !0
|
|
75
|
+
}
|
|
76
|
+
), (e, n) => {
|
|
77
|
+
const r = g("IconLoading"), c = g("el-button"), p = g("el-option"), S = g("el-select");
|
|
78
|
+
return f(), b("div", R, [
|
|
79
|
+
i(a).loading ? (f(), h(r, { key: 0 })) : x("", !0),
|
|
80
|
+
s("div", U, [
|
|
81
|
+
s("div", q, [
|
|
82
|
+
V(c, {
|
|
83
|
+
circle: "",
|
|
84
|
+
onClick: n[0] || (n[0] = (o) => e.$copy(i(a).single, "ID"))
|
|
85
|
+
}, {
|
|
86
|
+
icon: _(() => [...n[2] || (n[2] = [
|
|
87
|
+
s("i", { class: "imicon im-copy" }, null, -1)
|
|
88
|
+
])]),
|
|
89
|
+
_: 1
|
|
90
|
+
})
|
|
91
|
+
]),
|
|
92
|
+
V(S, M({
|
|
93
|
+
modelValue: i(a).single,
|
|
94
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => i(a).single = o),
|
|
95
|
+
placeholder: i(w),
|
|
96
|
+
disabled: i(I),
|
|
97
|
+
filterable: ""
|
|
98
|
+
}, e.$attrs, {
|
|
99
|
+
class: "inputGroupRight",
|
|
100
|
+
onChange: y
|
|
101
|
+
}), {
|
|
102
|
+
default: _(() => [
|
|
103
|
+
(f(!0), b(j, null, E(i(u), (o, A) => (f(), h(p, {
|
|
104
|
+
key: A,
|
|
105
|
+
label: `${o.name} (${o.id})`,
|
|
106
|
+
value: o.id,
|
|
107
|
+
disabled: l.readonly && o.readonly
|
|
108
|
+
}, {
|
|
109
|
+
default: _(() => [
|
|
110
|
+
s("div", H, [
|
|
111
|
+
s("i", {
|
|
112
|
+
class: F(["imicon", o.readonly ? "" : "im-writing"])
|
|
113
|
+
}, null, 2),
|
|
114
|
+
s("span", null, z(o.name), 1),
|
|
115
|
+
s("span", J, "(" + z(o.id) + ")", 1)
|
|
116
|
+
])
|
|
117
|
+
]),
|
|
118
|
+
_: 2
|
|
119
|
+
}, 1032, ["label", "value", "disabled"]))), 128))
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 16, ["modelValue", "placeholder", "disabled"])
|
|
123
|
+
])
|
|
124
|
+
]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export {
|
|
129
|
+
Y as default
|
|
130
|
+
};
|