xyvcard-mice 0.0.38 → 0.0.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.
@@ -0,0 +1,64 @@
1
+ import { defineComponent as T, ref as x, resolveComponent as m, openBlock as d, createElementBlock as p, createElementVNode as a, Fragment as S, renderList as k, unref as h, toDisplayString as C, createVNode as f, withCtx as w } from "vue";
2
+ import { useUserStore as _, request as A, fileApi as y } from "jmash-core";
3
+ import { useRoute as U, useRouter as q } from "vue-router";
4
+ import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
+ class I {
6
+ // 查询列表信息
7
+ findMyList(c) {
8
+ const i = _().user.tenant;
9
+ return A({
10
+ url: "/v1/storage/storage_organ/my_list/" + i,
11
+ method: "get",
12
+ params: { serviceType: c },
13
+ // 关键:自定义参数序列化,强制在 serviceType[] 前加 &
14
+ paramsSerializer: (l) => l.serviceType.map((o) => `&serviceType[]=${o}`).join("")
15
+ });
16
+ }
17
+ }
18
+ const L = new I(), O = { class: "organ-container" }, R = { class: "organ-content" }, M = ["onClick"], N = ["src"], P = { style: { "margin-right": "auto" } }, b = /* @__PURE__ */ T({
19
+ __name: "index",
20
+ setup(v) {
21
+ const c = U(), i = q(), l = _(), g = x([]);
22
+ L.findMyList(["mice"]).then((e) => {
23
+ console.log(e), e.data.results.length === 1 && o(e.data.results[0]), g.value = e.data.results;
24
+ });
25
+ const o = (e) => {
26
+ l.loginOrgan(e.organTenant).then(() => {
27
+ _().user.tenant = e.organTenant, console.log(e.organTenant, "=> organTenant"), sessionStorage.setItem("myShop", e.organTenant);
28
+ const n = c.query, u = n.redirect ?? "/", r = Object.keys(n).reduce(
29
+ (t, s) => (s !== "redirect" && (t[s] = n[s]), t),
30
+ {}
31
+ );
32
+ r.tenant = e.organTenant, i.push({ path: u, query: r });
33
+ });
34
+ };
35
+ return (e, n) => {
36
+ const u = m("ArrowRightBold"), r = m("el-icon");
37
+ return d(), p("div", O, [
38
+ n[0] || (n[0] = a("h1", null, "请选择一个组织进入", -1)),
39
+ a("div", R, [
40
+ (d(!0), p(S, null, k(g.value, (t) => (d(), p("div", {
41
+ class: "organ-content_item",
42
+ key: t.organId,
43
+ onClick: (s) => o(t)
44
+ }, [
45
+ a("img", {
46
+ src: t.logoUrl ? h(y).imageUrl(t.logoUrl, 60, 60) : h(y).imageUrl("/wxapp/images/user/avatar.png", 60, 60),
47
+ alt: "logo"
48
+ }, null, 8, N),
49
+ a("div", P, C(t.organName), 1),
50
+ f(r, null, {
51
+ default: w(() => [
52
+ f(u)
53
+ ]),
54
+ _: 1
55
+ })
56
+ ], 8, M))), 128))
57
+ ])
58
+ ]);
59
+ };
60
+ }
61
+ }), z = /* @__PURE__ */ B(b, [["__scopeId", "data-v-f62bc452"]]);
62
+ export {
63
+ z as default
64
+ };