@das-fed/ui 7.1.0-dev.9 → 7.1.1
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/esm-map.json +3 -1
- package/package.json +5 -5
- package/packages/business-components/device-panel/index.d.ts +1 -1
- package/packages/business-components/device-panel/index.js +10424 -10361
- package/packages/business-components/device-panel/index.js.gz +0 -0
- package/packages/business-components/device-panel/src/components/devicePanelModal/index.vue.d.ts +1 -1
- package/packages/business-components/device-panel/src/index.vue.d.ts +1 -1
- package/packages/business-components/device-panel/src/render-panel.d.ts +2 -1
- package/packages/business-components/device-panel/style.css +1 -1
- package/packages/business-components/device-panel/style.css.gz +0 -0
- package/packages/business-components/export-button/index.js +120 -114
- package/packages/business-components/export-button/index.js.gz +0 -0
- package/packages/business-components/index.d.ts +1 -0
- package/packages/business-components/index.js +1 -0
- package/packages/business-components/layout-breadcrumb/index.js +72 -74
- package/packages/business-components/layout-breadcrumb/index.js.gz +0 -0
- package/packages/business-components/process-form/index.js +315 -312
- package/packages/business-components/process-form/index.js.gz +0 -0
- package/packages/business-components/update-confirm-dialog/i18n/index.d.ts +23 -0
- package/packages/business-components/update-confirm-dialog/index.d.ts +61 -0
- package/packages/business-components/update-confirm-dialog/index.js +105 -0
- package/packages/business-components/update-confirm-dialog/index.js.gz +0 -0
- package/packages/business-components/update-confirm-dialog/src/App.vue.d.ts +11 -0
- package/packages/business-components/update-confirm-dialog/src/type.d.ts +4 -0
- package/packages/business-components/video-dialog/index.d.ts +10 -0
- package/packages/business-components/video-dialog/index.js +293 -289
- package/packages/business-components/video-dialog/index.js.gz +0 -0
- package/packages/business-components/video-dialog/src/index.vue.d.ts +2 -0
- package/packages/business-components/video-dialog/src/type.d.ts +4 -0
- package/packages/business-components/video-dialog/style.css +1 -1
- package/packages/business-components/video-dialog/style.css.gz +0 -0
- package/packages/components/collapse-panel/index.js +64 -39
- package/packages/components/collapse-panel/index.js.gz +0 -0
- package/packages/components/collapse-panel/style.css +1 -1
- package/packages/components/collapse-panel/style.css.gz +0 -0
- package/packages/components/dialog/index.d.ts +9 -3
- package/packages/components/dialog/index.js +72 -69
- package/packages/components/dialog/index.js.gz +0 -0
- package/packages/components/dialog/src/Index.vue.d.ts +4 -1
- package/packages/components/dialog/src/type.d.ts +4 -0
- package/packages/components/dialog/style.css +1 -1
- package/packages/components/dialog/style.css.gz +0 -0
- package/packages/components/edit-table/index.js +1 -1
- package/packages/components/edit-table/index.js.gz +0 -0
- package/packages/components/search-form/index.js +503 -498
- package/packages/components/search-form/index.js.gz +0 -0
- package/packages/components/search-form/src/Index.vue.d.ts +2 -0
- package/packages/components/search-form/src/type.d.ts +9 -5
- package/packages/components/search-form/style.css +1 -1
- package/packages/components/search-form/style.css.gz +0 -0
- package/packages/components/tree-select/index.js +43 -42
- package/packages/components/tree-select/index.js.gz +0 -0
- package/packages/components/tree-select/src/App.vue.d.ts +1 -0
|
Binary file
|
|
@@ -1,90 +1,96 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/business-components/export-button/style.css';
|
|
2
|
-
import { withInstall as
|
|
3
|
-
import { ref as p, defineComponent as
|
|
4
|
-
import { t as
|
|
5
|
-
import { DasDialog as
|
|
6
|
-
import { DasProgress as
|
|
7
|
-
import { DasButton as
|
|
8
|
-
import { iotProgress as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { withInstall as J } from "@das-fed/utils/with-install/index";
|
|
3
|
+
import { ref as p, defineComponent as K, computed as Q, watch as I, createElementBlock as W, openBlock as Z, createVNode as D, createCommentVNode as ee, unref as h, withCtx as M, renderSlot as te, createTextVNode as se, toDisplayString as ae, isRef as H } from "vue";
|
|
4
|
+
import { t as v, currentLang as V, i18n as $, setI18nRule as oe } from "@das-fed/web/packages/i18n/index";
|
|
5
|
+
import { DasDialog as re } from "@das-fed/ui/packages/components/dialog/index";
|
|
6
|
+
import { DasProgress as le } from "@das-fed/ui/packages/components/progress/index";
|
|
7
|
+
import { DasButton as ne } from "@das-fed/ui/packages/components/button/index";
|
|
8
|
+
import { iotProgress as ue } from "@das-fed/utils/api-services/modules/iot";
|
|
9
|
+
import { extractFilename as Y } from "@das-fed/utils/common-tools";
|
|
10
|
+
import E from "dayjs";
|
|
11
|
+
import { DasMessage as _ } from "@das-fed/ui/packages/components/message/index";
|
|
12
|
+
import { getConfig as F } from "@das-fed/utils/config";
|
|
13
|
+
let j = (o = 21) => {
|
|
14
|
+
let l = "", e = crypto.getRandomValues(new Uint8Array(o));
|
|
15
|
+
for (; o--; ) {
|
|
16
|
+
let s = e[o] & 63;
|
|
16
17
|
s < 36 ? l += s.toString(36) : s < 62 ? l += (s - 26).toString(36).toUpperCase() : s < 63 ? l += "_" : l += "-";
|
|
17
18
|
}
|
|
18
19
|
return l;
|
|
19
20
|
};
|
|
20
|
-
const
|
|
21
|
-
let l = p(!1), e = p(!1), s = p(""), i = p(0),
|
|
22
|
-
const
|
|
23
|
-
n.value = "",
|
|
24
|
-
},
|
|
25
|
-
|
|
21
|
+
const ie = ue.get("progress"), pe = (o) => {
|
|
22
|
+
let l = p(!1), e = p(!1), s = p(""), i = p(0), r = p("normal"), m = p(!1), c, x = p(""), n = p(""), d = p(""), f = p(""), g = p(!1), w = p(""), C;
|
|
23
|
+
const N = () => {
|
|
24
|
+
n.value = "", d.value = "", f.value = "", g.value = !1, w.value = "";
|
|
25
|
+
}, q = async (t, u = "", y = "") => {
|
|
26
|
+
r.value = "normal", i.value = 0, s.value = y || v("导出进度"), e.value = !0;
|
|
26
27
|
const b = await (t == null ? void 0 : t());
|
|
27
28
|
if (!b.status) {
|
|
28
|
-
e.value = !1,
|
|
29
|
+
e.value = !1, r.value = "error";
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
T(b.taskId, "action", "");
|
|
32
|
-
},
|
|
33
|
-
|
|
33
|
+
}, A = async (t, u = "", y = "") => {
|
|
34
|
+
r.value = "normal", i.value = 0, s.value = v("导出进度"), e.value = !0;
|
|
34
35
|
const b = await (t == null ? void 0 : t());
|
|
35
36
|
if (!b.status) {
|
|
36
|
-
e.value = !1,
|
|
37
|
+
e.value = !1, r.value = "error";
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
}, T = async (t, u,
|
|
41
|
-
m.value = !0,
|
|
40
|
+
E().format("YYYYMMDDHHmmss") + "", T(b.taskId, "export", u || "", y);
|
|
41
|
+
}, T = async (t, u, y, b = "") => {
|
|
42
|
+
m.value = !0, S(t, u, y, b), c = setTimeout(() => {
|
|
42
43
|
}, 50);
|
|
43
|
-
},
|
|
44
|
-
clearTimeout(
|
|
45
|
-
},
|
|
46
|
-
var
|
|
47
|
-
const [
|
|
44
|
+
}, R = () => {
|
|
45
|
+
clearTimeout(c), c = null, e.value = !1;
|
|
46
|
+
}, S = async (t, u = "export", y, b = "") => {
|
|
47
|
+
var B, L;
|
|
48
|
+
const [X, a] = await ie("", {
|
|
48
49
|
url: `progress/${t}`
|
|
49
50
|
}).run();
|
|
50
|
-
if (
|
|
51
|
+
if (X) {
|
|
51
52
|
m.value = !1;
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
i.value =
|
|
55
|
-
const
|
|
55
|
+
i.value = a.percentage;
|
|
56
|
+
const P = u == "export" ? v("导出") : v("导入");
|
|
56
57
|
if (i.value == 100)
|
|
57
|
-
if (x.value =
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
if (x.value = a, m.value = !1, R(), u == "export")
|
|
59
|
+
if (a.status == 1) {
|
|
60
|
+
r.value = "success";
|
|
61
|
+
let k = await Y(`/oss/${a == null ? void 0 : a.filePath}`);
|
|
62
|
+
const z = ((B = k == null ? void 0 : k.split("/")) == null ? void 0 : B.pop()) || "";
|
|
63
|
+
let G = y || z;
|
|
64
|
+
O(`${F().baseURL}/oss${a.filePath}`, G, b), m.value = !1, o("success");
|
|
65
|
+
} else a.status == 2 && (f.value = a.message || `${P}${V.value === "zh-CN" ? v("失败") : " " + v("失败")}`, _.error({
|
|
66
|
+
message: a.message || `${P}${V.value === "zh-CN" ? v("失败") : " " + v("失败")}`,
|
|
60
67
|
grouping: !0,
|
|
61
68
|
repeatNum: 1
|
|
62
69
|
}));
|
|
63
70
|
else if (u == "import") {
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
n.value = `${X}${A}`, c.value = y.sizeText, f.value = g("部分数据校验不通过,请下载附件并修改,重新导入!"), w.value = `${H().baseURL}/oss${r.filePath}`;
|
|
71
|
+
if (a.filePath) {
|
|
72
|
+
r.value = "error", g.value = !0;
|
|
73
|
+
let k = await Y(`/oss/${a == null ? void 0 : a.filePath}`);
|
|
74
|
+
const z = ((L = k == null ? void 0 : k.split("/")) == null ? void 0 : L.pop()) || "";
|
|
75
|
+
n.value = z, d.value = C.sizeText, f.value = v("部分数据校验不通过,请下载附件并修改,重新导入!"), w.value = `${F().baseURL}/oss${a.filePath}`;
|
|
70
76
|
}
|
|
71
|
-
|
|
72
|
-
} else u == "action" && (
|
|
77
|
+
U(a.status, P), a.status == 1 && (l.value = !1), o("success");
|
|
78
|
+
} else u == "action" && (r.value = "success");
|
|
73
79
|
else
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, 50) : (x.value =
|
|
77
|
-
},
|
|
78
|
-
t == 1 ? (
|
|
79
|
-
message:
|
|
80
|
+
c && a.status != 2 ? c = setTimeout(() => {
|
|
81
|
+
S(t, u, y, b);
|
|
82
|
+
}, 50) : (x.value = a, m.value = !1, U(a.status, P), R(), g.value = !0, f.value = (a == null ? void 0 : a.message) || "");
|
|
83
|
+
}, U = (t, u) => {
|
|
84
|
+
t == 1 ? (r.value = "success", _.success({
|
|
85
|
+
message: v("business-components_export-success-tip", u),
|
|
80
86
|
grouping: !0,
|
|
81
87
|
repeatNum: 1
|
|
82
|
-
}), n.value = "",
|
|
83
|
-
message:
|
|
88
|
+
}), n.value = "", d.value = "", f.value = "") : t == 2 ? (r.value = "error", _.error({
|
|
89
|
+
message: v("business-components_export-failure-tip", u),
|
|
84
90
|
grouping: !0,
|
|
85
91
|
repeatNum: 1
|
|
86
|
-
})) : t == 3 && (
|
|
87
|
-
message:
|
|
92
|
+
})) : t == 3 && (r.value = "error", _.error({
|
|
93
|
+
message: v("business-components_export-partially-failure-tip", u),
|
|
88
94
|
grouping: !0,
|
|
89
95
|
repeatNum: 1
|
|
90
96
|
}));
|
|
@@ -94,63 +100,63 @@ const ue = ne.get("progress"), ie = (a) => {
|
|
|
94
100
|
showProgressDialog: e,
|
|
95
101
|
progressTitle: s,
|
|
96
102
|
percent: i,
|
|
97
|
-
progressStatus:
|
|
103
|
+
progressStatus: r,
|
|
98
104
|
progressLoading: m,
|
|
99
105
|
progressResult: x,
|
|
100
106
|
errorFileName: n,
|
|
101
|
-
errorFileSize:
|
|
107
|
+
errorFileSize: d,
|
|
102
108
|
errorMessage: f,
|
|
103
|
-
errorImport:
|
|
109
|
+
errorImport: g,
|
|
104
110
|
errorFilePath: w,
|
|
105
|
-
fileExport:
|
|
106
|
-
fileAction:
|
|
111
|
+
fileExport: A,
|
|
112
|
+
fileAction: q,
|
|
107
113
|
generateUniqueName: (t) => {
|
|
108
114
|
const u = t == null ? void 0 : t.substr(t.indexOf("."));
|
|
109
|
-
return `${t == null ? void 0 : t.replace(/(.*\/)*([^.]+).*/gi, "$2")}${
|
|
115
|
+
return `${t == null ? void 0 : t.replace(/(.*\/)*([^.]+).*/gi, "$2")}${j()}${u}`;
|
|
110
116
|
},
|
|
111
|
-
downloadFile:
|
|
112
|
-
resetStataus:
|
|
117
|
+
downloadFile: O,
|
|
118
|
+
resetStataus: N,
|
|
113
119
|
checkProgress: T
|
|
114
120
|
};
|
|
115
|
-
},
|
|
121
|
+
}, O = (o, l, e = "xlsx") => {
|
|
116
122
|
const s = new XMLHttpRequest();
|
|
117
|
-
s.open("get",
|
|
118
|
-
const
|
|
123
|
+
s.open("get", o), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(i) {
|
|
124
|
+
const r = new Blob([this.response], {
|
|
119
125
|
type: e === "zip" ? "application/zip" : e === "xlsx" ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : "application/pdf"
|
|
120
|
-
}), m = URL.createObjectURL(
|
|
126
|
+
}), m = URL.createObjectURL(r);
|
|
121
127
|
if (window.navigator.msSaveOrOpenBlob)
|
|
122
|
-
navigator.msSaveBlob(
|
|
128
|
+
navigator.msSaveBlob(r, l);
|
|
123
129
|
else {
|
|
124
|
-
const
|
|
125
|
-
|
|
130
|
+
const c = document.createElement("a");
|
|
131
|
+
c.href = m, c.download = l, c.click(), window.URL.revokeObjectURL(m);
|
|
126
132
|
}
|
|
127
133
|
}, s.send();
|
|
128
|
-
},
|
|
129
|
-
const { showProgressDialog: e, progressTitle: s, percent: i, progressStatus:
|
|
134
|
+
}, me = (o, l) => {
|
|
135
|
+
const { showProgressDialog: e, progressTitle: s, percent: i, progressStatus: r, progressLoading: m, fileExport: c } = pe(l), x = p({}), n = p({}), d = (g, w) => {
|
|
130
136
|
x.value = {
|
|
131
|
-
...
|
|
137
|
+
...g
|
|
132
138
|
}, n.value = {
|
|
133
139
|
...w
|
|
134
140
|
};
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
141
|
+
let C = `${E().format("YYYYMMDD")}-${E().format("HHmmss")}.${o.fileType}`;
|
|
142
|
+
V.value === "en" && !/s$/.test(o.exportFileName) && (C = " " + C);
|
|
143
|
+
const N = `${o.exportFileName}${C}`;
|
|
144
|
+
c(f, N, o.fileType);
|
|
139
145
|
}, f = async () => {
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
const [w,
|
|
143
|
-
return w ? { status: !1 } : { status: !0, taskId:
|
|
146
|
+
let g = j();
|
|
147
|
+
o.taskIdPosition === "params" && (x.value.taskId = g), o.taskIdPosition === "body" && (n.value.taskId = g);
|
|
148
|
+
const [w, C] = await o.exportFun(n.value, { params: x.value }).run();
|
|
149
|
+
return w ? { status: !1 } : { status: !0, taskId: g };
|
|
144
150
|
};
|
|
145
151
|
return {
|
|
146
152
|
showProgressDialog: e,
|
|
147
153
|
progressTitle: s,
|
|
148
154
|
percent: i,
|
|
149
|
-
progressStatus:
|
|
155
|
+
progressStatus: r,
|
|
150
156
|
progressLoading: m,
|
|
151
|
-
exportList:
|
|
157
|
+
exportList: d
|
|
152
158
|
};
|
|
153
|
-
},
|
|
159
|
+
}, ce = { class: "das-export-button" }, de = /* @__PURE__ */ K({
|
|
154
160
|
__name: "App",
|
|
155
161
|
props: {
|
|
156
162
|
modelValue: {},
|
|
@@ -165,27 +171,27 @@ const ue = ne.get("progress"), ie = (a) => {
|
|
|
165
171
|
disabled: { type: Boolean, default: !1 }
|
|
166
172
|
},
|
|
167
173
|
emits: ["update:modelValue", "update:bodyParams", "success"],
|
|
168
|
-
setup(
|
|
169
|
-
const e =
|
|
170
|
-
|
|
174
|
+
setup(o, { emit: l }) {
|
|
175
|
+
const e = o, s = l;
|
|
176
|
+
Q(() => e.exportFileName || v("导出表")), I(e.modelValue, (n) => {
|
|
171
177
|
s("update:modelValue", n);
|
|
172
|
-
}),
|
|
178
|
+
}), I(e.bodyParams, (n) => {
|
|
173
179
|
s("update:bodyParams", n);
|
|
174
180
|
});
|
|
175
|
-
const { showProgressDialog: i, percent:
|
|
176
|
-
return (n,
|
|
177
|
-
|
|
181
|
+
const { showProgressDialog: i, percent: r, progressStatus: m, exportList: c } = me(e, s), x = [$("正在导出中...").value, $("导出失败").value, $("导出成功").value];
|
|
182
|
+
return (n, d) => (Z(), W("div", ce, [
|
|
183
|
+
D(h(ne), {
|
|
178
184
|
block: n.block,
|
|
179
185
|
size: "middle",
|
|
180
186
|
disabled: n.disabled,
|
|
181
187
|
"btn-type": e.btnType,
|
|
182
188
|
ghost: n.ghost,
|
|
183
|
-
onClick:
|
|
189
|
+
onClick: d[0] || (d[0] = (f) => h(c)(e.modelValue, e.bodyParams))
|
|
184
190
|
}, {
|
|
185
|
-
default:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
default: M(() => [
|
|
192
|
+
te(n.$slots, "default", {}, () => [
|
|
193
|
+
se(
|
|
194
|
+
ae(h($)("导出").value),
|
|
189
195
|
1
|
|
190
196
|
/* TEXT */
|
|
191
197
|
)
|
|
@@ -194,23 +200,23 @@ const ue = ne.get("progress"), ie = (a) => {
|
|
|
194
200
|
_: 3
|
|
195
201
|
/* FORWARDED */
|
|
196
202
|
}, 8, ["block", "disabled", "btn-type", "ghost"]),
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
ee(" 进度弹窗 "),
|
|
204
|
+
D(h(re), {
|
|
199
205
|
size: "mini",
|
|
200
|
-
title:
|
|
206
|
+
title: h($)("导出进度").value,
|
|
201
207
|
"is-feedback-img": !1,
|
|
202
|
-
modelValue:
|
|
203
|
-
"onUpdate:modelValue":
|
|
208
|
+
modelValue: h(i),
|
|
209
|
+
"onUpdate:modelValue": d[2] || (d[2] = (f) => H(i) ? i.value = f : null),
|
|
204
210
|
"append-to-body": !0,
|
|
205
211
|
type: "feedback"
|
|
206
212
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
|
|
209
|
-
modelValue:
|
|
210
|
-
"onUpdate:modelValue":
|
|
213
|
+
default: M(() => [
|
|
214
|
+
D(h(le), {
|
|
215
|
+
modelValue: h(r),
|
|
216
|
+
"onUpdate:modelValue": d[1] || (d[1] = (f) => H(r) ? r.value = f : null),
|
|
211
217
|
style: { "margin-top": "35px" },
|
|
212
218
|
type: "circle",
|
|
213
|
-
status:
|
|
219
|
+
status: h(m),
|
|
214
220
|
textMap: x
|
|
215
221
|
}, null, 8, ["modelValue", "status"])
|
|
216
222
|
]),
|
|
@@ -219,12 +225,12 @@ const ue = ne.get("progress"), ie = (a) => {
|
|
|
219
225
|
}, 8, ["title", "modelValue"])
|
|
220
226
|
]));
|
|
221
227
|
}
|
|
222
|
-
}),
|
|
223
|
-
const e =
|
|
228
|
+
}), fe = (o, l) => {
|
|
229
|
+
const e = o.__vccOpts || o;
|
|
224
230
|
for (const [s, i] of l)
|
|
225
231
|
e[s] = i;
|
|
226
232
|
return e;
|
|
227
|
-
},
|
|
233
|
+
}, ve = /* @__PURE__ */ fe(de, [["__scopeId", "data-v-49f0bb05"]]), ge = {
|
|
228
234
|
导出表: { "zh-CN": "导出表", en: "Export Table", _appCode: "framework" },
|
|
229
235
|
导出失败: { "zh-CN": "导出失败", en: "Exported Failed", _appCode: "framework" },
|
|
230
236
|
导出成功: { "zh-CN": "导出成功", en: "Exported Successfully", _appCode: "framework" },
|
|
@@ -245,9 +251,9 @@ const ue = ne.get("progress"), ie = (a) => {
|
|
|
245
251
|
_appCode: "framework"
|
|
246
252
|
}
|
|
247
253
|
};
|
|
248
|
-
|
|
249
|
-
const
|
|
254
|
+
oe(ge);
|
|
255
|
+
const ze = J(ve);
|
|
250
256
|
export {
|
|
251
|
-
|
|
252
|
-
|
|
257
|
+
ze as DasExportButton,
|
|
258
|
+
ze as default
|
|
253
259
|
};
|
|
Binary file
|
|
@@ -16,6 +16,7 @@ export * from './process-form';
|
|
|
16
16
|
export * from './process-log';
|
|
17
17
|
export * from './process-search-form';
|
|
18
18
|
export * from './process-table';
|
|
19
|
+
export * from './update-confirm-dialog';
|
|
19
20
|
export * from './upload-file';
|
|
20
21
|
export * from './urgent-panel';
|
|
21
22
|
export * from './user-org-dialog';
|
|
@@ -16,6 +16,7 @@ export * from './process-form'
|
|
|
16
16
|
export * from './process-log'
|
|
17
17
|
export * from './process-search-form'
|
|
18
18
|
export * from './process-table'
|
|
19
|
+
export * from './update-confirm-dialog'
|
|
19
20
|
export * from './upload-file'
|
|
20
21
|
export * from './urgent-panel'
|
|
21
22
|
export * from './user-org-dialog'
|
|
@@ -1,113 +1,111 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/business-components/layout-breadcrumb/style.css';
|
|
2
|
-
import { ref as
|
|
3
|
-
import { withInstall as
|
|
4
|
-
import { DasBreadCrumb as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { flatTree as
|
|
7
|
-
import { getSubApps as
|
|
8
|
-
import { setThemeRule as
|
|
9
|
-
const
|
|
10
|
-
const a =
|
|
11
|
-
const { app:
|
|
12
|
-
if (!
|
|
13
|
-
const
|
|
14
|
-
const t =
|
|
15
|
-
if (
|
|
16
|
-
|
|
2
|
+
import { ref as _, computed as T, watch as I, nextTick as q, defineComponent as N, createElementBlock as R, createCommentVNode as U, unref as g, openBlock as x, createVNode as D } from "vue";
|
|
3
|
+
import { withInstall as O } from "@das-fed/utils/with-install/index";
|
|
4
|
+
import { DasBreadCrumb as P } from "@das-fed/ui/packages/components/breadcrumb/index";
|
|
5
|
+
import { useRouter as J, useRoute as $ } from "vue-router";
|
|
6
|
+
import { flatTree as L } from "@das-fed/utils/common-tools";
|
|
7
|
+
import { getSubApps as S } from "@das-fed/utils/common-info";
|
|
8
|
+
import { setThemeRule as j } from "@das-fed/web/packages/theme/index";
|
|
9
|
+
const E = (s, l) => {
|
|
10
|
+
const a = _([]), b = T(() => [...a.value, ...s.data || []]), p = (e) => new Promise((c) => {
|
|
11
|
+
const { app: r = "", menu: i = "" } = e || {};
|
|
12
|
+
if (!r) return c(!1);
|
|
13
|
+
const u = () => {
|
|
14
|
+
const t = S() ?? {}, o = t.currentSubAppCode, d = t.currentSubApp.currentMenuCode;
|
|
15
|
+
if (JSON.parse(sessionStorage.getItem("breadcrumb") || "{}")[r] && r === o && i === d)
|
|
16
|
+
return c(!0);
|
|
17
|
+
setTimeout(() => u(), 100);
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
}), h = async (e,
|
|
20
|
-
var
|
|
21
|
-
await
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
19
|
+
u();
|
|
20
|
+
}), h = async (e, c) => {
|
|
21
|
+
var d, n;
|
|
22
|
+
await p(c);
|
|
23
|
+
const r = [], i = c.menu || "", u = ((n = (d = S()) == null ? void 0 : d.currentSubApp) == null ? void 0 : n.menus) ?? [];
|
|
24
|
+
if (!u || !u.length) return;
|
|
24
25
|
let t = null;
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const B =
|
|
30
|
-
|
|
26
|
+
const o = L(u);
|
|
27
|
+
if (i ? t = o.find((m) => m.code === i) : t = o.find((m) => m.routeUrl && m.routeUrl === e), t) {
|
|
28
|
+
const m = t.code.split(".");
|
|
29
|
+
if (m.length === 3) {
|
|
30
|
+
const B = m.slice(0, 2).join("."), k = o.find((v) => v.code === B || v.originalCode === B);
|
|
31
|
+
r.push({ name: (k == null ? void 0 : k.name) ?? "", isMenu: !0, disabled: !0 });
|
|
31
32
|
}
|
|
32
33
|
const M = {
|
|
33
34
|
name: (t == null ? void 0 : t.name) ?? "",
|
|
34
35
|
routerPath: (t == null ? void 0 : t.routeUrl) ?? "",
|
|
35
36
|
isMenu: !0
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
+
r.push(M);
|
|
38
39
|
}
|
|
39
|
-
a.value =
|
|
40
|
-
},
|
|
41
|
-
e.disabled ||
|
|
42
|
-
}, C =
|
|
43
|
-
|
|
40
|
+
a.value = r;
|
|
41
|
+
}, y = (e) => {
|
|
42
|
+
e.disabled || l("click-item", e);
|
|
43
|
+
}, C = J(), f = $();
|
|
44
|
+
I(
|
|
44
45
|
() => C.currentRoute.value,
|
|
45
46
|
(e) => {
|
|
46
|
-
const
|
|
47
|
+
const c = (e == null ? void 0 : e.path) ?? "", r = (e == null ? void 0 : e.query) ?? {};
|
|
47
48
|
setTimeout(() => {
|
|
48
|
-
h(
|
|
49
|
+
h(c, r);
|
|
49
50
|
}, 200);
|
|
50
51
|
}
|
|
51
|
-
), h(
|
|
52
|
-
const A =
|
|
53
|
-
return
|
|
52
|
+
), h(f.path, f.query);
|
|
53
|
+
const A = _(!1);
|
|
54
|
+
return I(
|
|
54
55
|
() => s.data,
|
|
55
|
-
() => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
A.value = !!c.find((r) => o === r);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
56
|
+
async () => {
|
|
57
|
+
var t;
|
|
58
|
+
await q(), await p(f.query);
|
|
59
|
+
const e = S(), c = f.query.app || e.currentSubApp.code || "";
|
|
60
|
+
let r = f.query.menu || "";
|
|
61
|
+
if (!r) {
|
|
62
|
+
const o = ((t = e.currentSubApp) == null ? void 0 : t.menus) ?? [], d = L(o).find(
|
|
63
|
+
(n) => `/${(n == null ? void 0 : n.applicationPath) ?? ""}${(n == null ? void 0 : n.routeUrl) ?? ""}`.replace(/\/\//g, "/") === location.pathname
|
|
64
|
+
);
|
|
65
|
+
d && (r = d.code);
|
|
66
|
+
}
|
|
67
|
+
const i = JSON.parse(sessionStorage.getItem("breadcrumb") || "{}")[c], u = [];
|
|
68
|
+
for (let o in i) i[o] && u.push(o);
|
|
69
|
+
A.value = !!u.find((o) => r === o);
|
|
72
70
|
},
|
|
73
71
|
{ deep: !0, immediate: !0 }
|
|
74
72
|
), {
|
|
75
73
|
isShow: A,
|
|
76
|
-
breadcrumbList:
|
|
77
|
-
clickItem:
|
|
74
|
+
breadcrumbList: b,
|
|
75
|
+
clickItem: y
|
|
78
76
|
};
|
|
79
|
-
},
|
|
77
|
+
}, w = {
|
|
80
78
|
key: 0,
|
|
81
79
|
class: "layout-breadcrumb"
|
|
82
|
-
},
|
|
80
|
+
}, z = {
|
|
83
81
|
name: "LayoutBreadCrumb"
|
|
84
|
-
},
|
|
85
|
-
...
|
|
82
|
+
}, F = /* @__PURE__ */ N({
|
|
83
|
+
...z,
|
|
86
84
|
props: {
|
|
87
85
|
data: { default: () => [] }
|
|
88
86
|
},
|
|
89
87
|
emits: ["click-item"],
|
|
90
|
-
setup(s, { emit:
|
|
91
|
-
const a = s,
|
|
92
|
-
return (C,
|
|
93
|
-
D(
|
|
94
|
-
data:
|
|
95
|
-
onClickItem: y
|
|
88
|
+
setup(s, { emit: l }) {
|
|
89
|
+
const a = s, b = l, { isShow: p, breadcrumbList: h, clickItem: y } = E(a, b);
|
|
90
|
+
return (C, f) => g(p) && C.data && C.data.length ? (x(), R("div", w, [
|
|
91
|
+
D(g(P), {
|
|
92
|
+
data: g(h),
|
|
93
|
+
onClickItem: g(y)
|
|
96
94
|
}, null, 8, ["data", "onClickItem"])
|
|
97
95
|
])) : U("v-if", !0);
|
|
98
96
|
}
|
|
99
|
-
}),
|
|
97
|
+
}), G = (s, l) => {
|
|
100
98
|
const a = s.__vccOpts || s;
|
|
101
|
-
for (const [
|
|
102
|
-
a[
|
|
99
|
+
for (const [b, p] of l)
|
|
100
|
+
a[b] = p;
|
|
103
101
|
return a;
|
|
104
|
-
},
|
|
102
|
+
}, H = /* @__PURE__ */ G(F, [["__scopeId", "data-v-878cd70a"]]), K = {
|
|
105
103
|
"--das-layout-micro-container-bg-color": "#e2e7ef",
|
|
106
104
|
"--das-layout-breadcrumb-bg-color": "#ffffff"
|
|
107
105
|
};
|
|
108
|
-
|
|
109
|
-
const te =
|
|
106
|
+
j(K);
|
|
107
|
+
const te = O(H), re = () => _(null);
|
|
110
108
|
export {
|
|
111
109
|
te as DasLayoutBreadcrumb,
|
|
112
|
-
|
|
110
|
+
re as DasLayoutBreadcrumbRef
|
|
113
111
|
};
|
|
Binary file
|