@jnrs/vue-core 1.2.9 → 1.2.11
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/README.md +20 -43
- package/dist/components/JnDatetime.vue.d.ts +1 -1
- package/dist/components/JnDialog.vue.d.ts +1 -1
- package/dist/components/JnFileUpload.vue.d.ts +297 -324
- package/dist/components/JnImageView.vue.d.ts +2 -2
- package/dist/components/JnImportAndExport.vue.d.ts +387 -0
- package/dist/components/JnPagination.vue.d.ts +3 -3
- package/dist/components/JnPdfView.vue.d.ts +2 -2
- package/dist/components/JnSelectTemplate.vue.d.ts +297 -213
- package/dist/components/JnTable.vue.d.ts +3086 -0
- package/dist/components/index.js +11 -11
- package/dist/composables/index.js +33 -33
- package/dist/index-DRbGqK4D.js +167 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/lib/guards.d.ts +3 -3
- package/dist/piniaStore/base/menu.d.ts +7 -7
- package/dist/piniaStore/base/system.d.ts +15 -15
- package/dist/piniaStore/index.d.ts +0 -1
- package/dist/piniaStore/index.js +3 -4
- package/dist/piniaStore/mock.d.ts +6 -6
- package/dist/types/base.d.ts +5 -5
- package/dist/vueRouter/createVueRouter.d.ts +3 -3
- package/package.json +3 -7
- package/dist/index-Wfhohf_A.js +0 -3386
- package/dist/index-oXJvQR5x.js +0 -201
- package/dist/piniaStore/base/auth.d.ts +0 -135
- package/dist/request/axios.d.ts +0 -8
- package/dist/request/fetch.d.ts +0 -0
- package/dist/request/index.d.ts +0 -1
- package/dist/request/index.js +0 -4
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".jn_globalSetting_header{margin-bottom:0;padding-bottom:20px}.jn_globalSetting_item[data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".jn_globalSetting_header{margin-bottom:0;padding-bottom:20px}.jn_globalSetting_item[data-v-2b8b00a5]{margin-bottom:20px}.jn_imageView[data-v-1e2b2aae]{display:block;width:100%;height:100%}.jn_imageView .jn_imageView_error[data-v-1e2b2aae]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:.8em;line-height:1.1em;text-align:center;filter:opacity(.7)}.jn_image_view_icon[data-v-1e2b2aae]:hover{color:var(--jnrs-color-primary);transform:scale(1.2);transition:all .3s ease}.jn_fileView[data-v-a380f9e9]{display:block;width:100%;height:100%;line-height:1em;cursor:pointer}.jn_fileView:hover .jn_fileView_button[data-v-a380f9e9]{color:var(--jnrs-color-primary)}.jn_fileView .jn_fileView_fileName[data-v-a380f9e9]{font-size:.8em;color:var(--jnrs-font-primary-06);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jn_fileView .jn_fileView_button[data-v-a380f9e9]{height:auto;padding:0;text-decoration:underline;font-size:.9em;transition:all .3s ease}.jn_fileUpload[data-v-7e67b4eb]{position:relative;width:100%;color:var(--jnrs-font-primary-06)}.jn_fileUpload[data-v-7e67b4eb] .el-upload-dragger{padding:30px 0 10px}.jn_fileUpload .jn_uploadTips[data-v-7e67b4eb]{display:block;width:100%;margin-top:5px;line-height:1.2em}.jn_fileUpload .jn_uploadTips span[data-v-7e67b4eb]{display:inline-block;margin-right:10px}.jn_fileUpload .jn_uploadTips b[data-v-7e67b4eb]{color:var(--el-color-danger, #ff3300)}.jn_fileUpload .jn_uploadTips_isDrag[data-v-7e67b4eb]{position:absolute;top:4px;left:0;text-align:center}.jn_fileUpload .jn_fileList[data-v-7e67b4eb]{width:100%}.jn_fileUpload .jn_fileList .jn_fileLis_item[data-v-7e67b4eb]{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:8px;padding:5px 0;border:1px solid var(--jnrs-font-primary-03);background:var(--jnrs-background-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_left[data-v-7e67b4eb]{flex:1;position:relative;display:flex;align-items:center;justify-content:flex-start;padding-right:50px;line-height:1.1em}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_right[data-v-7e67b4eb]{flex-shrink:0;width:60px;display:flex;align-items:center;justify-content:flex-end;padding-right:4px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_index[data-v-7e67b4eb]{flex-shrink:0;width:20px;height:20px;line-height:20px;text-align:center}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_icon[data-v-7e67b4eb]{flex-shrink:0;width:20px;height:20px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_name[data-v-7e67b4eb]{padding:0 4px;word-break:break-all}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_size[data-v-7e67b4eb]{position:absolute;right:0;width:50px;color:#999;white-space:nowrap;text-align:right}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-7e67b4eb]{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0 2px;border-radius:3px;font-size:16px;color:var(--el-color-primary, #5887f7);transition:all .3s ease;cursor:pointer}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-7e67b4eb]:hover{background-color:var(--jnrs-card-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn_danger[data-v-7e67b4eb]{color:var(--el-color-danger, #ff3300)}.jnImportAndExport_button.is-text[data-v-447ad008]{padding:0}.jnImportAndExport_underlineBtn[data-v-447ad008]{display:inline-block;margin-right:36px;color:#3697fc;text-decoration:underline;cursor:pointer}.jnImportAndExport_underlineBtn[data-v-447ad008]:hover{opacity:.8}.jn_table[data-v-1671453b]{width:100%}.jn_table[data-v-1671453b] .jn_table_header{color:var(--jnrs-font-primary)!important;background:var(--jnrs-background-head)!important}.jn_table[data-v-1671453b] .jn_table_header .cell{padding:0 8px;line-height:1.2em}.jn_selectTemplate[data-v-6ec9d84c]{display:flex;align-items:center;font-size:0}.jn_selectTemplate .jn_select[data-v-6ec9d84c]{flex:1;right:-1px;z-index:1}.jn_selectTemplate .jn_select[data-v-6ec9d84c] .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]{border-radius:0 3px 3px 0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]:hover{z-index:1}.t_select_button_only[data-v-6ec9d84c]{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.jn_dialog_header[data-v-6ec9d84c]{display:flex;align-items:center}[data-v-6ec9d84c] .el-input__validateIcon{display:none}[data-v-6ec9d84c] th .el-checkbox--small{display:none!important}[data-v-6ec9d84c] .el-table__row{cursor:pointer}.tableIsSingle[data-v-6ec9d84c] .el-checkbox__inner{border-radius:50%}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
import { defineComponent as H, ref as B, createBlock as U, openBlock as h, unref as i, withCtx as f, createElementVNode as p, createVNode as v, toDisplayString as y, isRef as zt, createElementBlock as E, Fragment as X, renderList as ee, createTextVNode as D, computed as N, normalizeStyle as Ie, createCommentVNode as P, renderSlot as le, withDirectives as ke, normalizeClass as Pe, vShow as Vt, nextTick as te, withModifiers as Be, watch as Ae, onMounted as Ft, mergeProps as Xt } from "vue";
|
|
3
3
|
import { storeToRefs as Ht } from "pinia";
|
|
4
4
|
import { ElDrawer as xt, ElSwitch as Ot, ElRadioGroup as Ee, ElRadio as pe, ElImage as Kt, ElIcon as L, ElButton as V, ElDialog as mt, ElUpload as Mt, vLoading as De, ElMessage as G, ElForm as vt, ElFormItem as Rt, ElMessageBox as Ke, ElLoading as Qe, ElPagination as ht, ElTable as It, ElTableColumn as fe, ElSelect as Gt, ElOption as Nt, ElCheckbox as Jt } from "element-plus";
|
|
5
|
-
import { u as qt,
|
|
5
|
+
import { u as qt, a as Yt, L as Zt, M as Wt, C as $t } from "../index-DRbGqK4D.js";
|
|
6
6
|
import { Back as _t, Right as ea, DArrowRight as ta, ZoomOut as aa, ZoomIn as na, Switch as la, RefreshLeft as ia, Refresh as oa, Download as Fe, Delete as Me, Upload as ra } from "@element-plus/icons-vue";
|
|
7
7
|
import { downloadByUrl as Ct, downloadByBlob as Re, objectToFormData as sa } from "@jnrs/shared";
|
|
8
8
|
import { useI18n as ua } from "vue-i18n";
|
|
@@ -10,7 +10,7 @@ import { i as Ce, b as se, r as K, a as J, f as ca, S as ge, u as Aa, c as da, d
|
|
|
10
10
|
const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_item" }, va = { class: "jn_globalSetting_item" }, ha = { class: "jn_globalSetting_item" }, Ia = /* @__PURE__ */ H({
|
|
11
11
|
__name: "GlobalSetting",
|
|
12
12
|
setup(e, { expose: t }) {
|
|
13
|
-
const {
|
|
13
|
+
const { useMockServe: a } = Ht(qt()), { theme: n, setLocale: s, setMode: l, setPrimaryColor: c } = Yt(), m = B(!1);
|
|
14
14
|
return t({ handleShow: () => {
|
|
15
15
|
m.value = !0;
|
|
16
16
|
} }), (u, d) => (h(), U(i(xt), {
|
|
@@ -100,7 +100,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
|
|
|
100
100
|
for (const [n, s] of t)
|
|
101
101
|
a[n] = s;
|
|
102
102
|
return a;
|
|
103
|
-
}, wr = /* @__PURE__ */ Y(Ia, [["__scopeId", "data-v-
|
|
103
|
+
}, wr = /* @__PURE__ */ Y(Ia, [["__scopeId", "data-v-2b8b00a5"]]), Ca = {
|
|
104
104
|
key: 0,
|
|
105
105
|
class: "jn_imageView_error"
|
|
106
106
|
}, ya = { key: 1 }, ba = /* @__PURE__ */ H({
|
|
@@ -215,7 +215,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
|
|
|
215
215
|
_: 1
|
|
216
216
|
}, 8, ["style", "src", "preview-src-list"]));
|
|
217
217
|
}
|
|
218
|
-
}), Sr = /* @__PURE__ */ Y(ba, [["__scopeId", "data-v-
|
|
218
|
+
}), Sr = /* @__PURE__ */ Y(ba, [["__scopeId", "data-v-1e2b2aae"]]), Ea = ["title", "onClick"], pa = {
|
|
219
219
|
key: 0,
|
|
220
220
|
class: "jn_fileView_fileName"
|
|
221
221
|
}, Qa = /* @__PURE__ */ H({
|
|
@@ -259,7 +259,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
|
|
|
259
259
|
})
|
|
260
260
|
], 8, Ea))), 128));
|
|
261
261
|
}
|
|
262
|
-
}), kr = /* @__PURE__ */ Y(Qa, [["__scopeId", "data-v-
|
|
262
|
+
}), kr = /* @__PURE__ */ Y(Qa, [["__scopeId", "data-v-a380f9e9"]]), ja = /* @__PURE__ */ H({
|
|
263
263
|
__name: "JnDialog",
|
|
264
264
|
props: {
|
|
265
265
|
title: { default: "" },
|
|
@@ -506,7 +506,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
|
|
|
506
506
|
]) : P("", !0)
|
|
507
507
|
]));
|
|
508
508
|
}
|
|
509
|
-
}), dn = /* @__PURE__ */ Y(An, [["__scopeId", "data-v-
|
|
509
|
+
}), dn = /* @__PURE__ */ Y(An, [["__scopeId", "data-v-7e67b4eb"]]), fn = /* @__PURE__ */ H({
|
|
510
510
|
__name: "JnImportAndExport",
|
|
511
511
|
props: {
|
|
512
512
|
importTemplateApi: { type: Function },
|
|
@@ -724,7 +724,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
|
|
|
724
724
|
], 64)) : P("", !0)
|
|
725
725
|
], 64));
|
|
726
726
|
}
|
|
727
|
-
}), Pr = /* @__PURE__ */ Y(fn, [["__scopeId", "data-v-
|
|
727
|
+
}), Pr = /* @__PURE__ */ Y(fn, [["__scopeId", "data-v-447ad008"]]), gn = { style: { opacity: "0.7", "font-size": "0.9em" } }, mn = { key: 1 }, Br = /* @__PURE__ */ H({
|
|
728
728
|
__name: "JnDatetime",
|
|
729
729
|
props: {
|
|
730
730
|
value: { default: "" },
|
|
@@ -1489,7 +1489,7 @@ const sr = /* @__PURE__ */ H({
|
|
|
1489
1489
|
_: 3
|
|
1490
1490
|
}, 8, ["row-key", "data", "height", "showScrollbar-always-on", "onMousedown"]));
|
|
1491
1491
|
}
|
|
1492
|
-
}), Tr = /* @__PURE__ */ Y(sr, [["__scopeId", "data-v-
|
|
1492
|
+
}), Tr = /* @__PURE__ */ Y(sr, [["__scopeId", "data-v-1671453b"]]), ur = { key: 0 }, cr = { style: { float: "left" } }, Ar = {
|
|
1493
1493
|
key: 0,
|
|
1494
1494
|
style: { float: "right", color: "var(--el-text-color-secondary)", "font-size": "0.8em", "padding-left": "2em" }
|
|
1495
1495
|
}, dr = { key: 0 }, fr = { class: "jn_dialog_header" }, gr = { style: { color: "#999", "font-size": "0.8em" } }, mr = {
|
|
@@ -1779,7 +1779,7 @@ const sr = /* @__PURE__ */ H({
|
|
|
1779
1779
|
loading: s.value
|
|
1780
1780
|
}, {
|
|
1781
1781
|
default: f(() => [...b[8] || (b[8] = [
|
|
1782
|
-
D("
|
|
1782
|
+
D("确定", -1)
|
|
1783
1783
|
])]),
|
|
1784
1784
|
_: 1
|
|
1785
1785
|
}, 8, ["loading"])
|
|
@@ -1862,7 +1862,7 @@ const sr = /* @__PURE__ */ H({
|
|
|
1862
1862
|
}, 8, ["modelValue", "width"])
|
|
1863
1863
|
], 64));
|
|
1864
1864
|
}
|
|
1865
|
-
}), Ur = /* @__PURE__ */ Y(hr, [["__scopeId", "data-v-
|
|
1865
|
+
}), Ur = /* @__PURE__ */ Y(hr, [["__scopeId", "data-v-6ec9d84c"]]);
|
|
1866
1866
|
export {
|
|
1867
1867
|
wr as GlobalSetting,
|
|
1868
1868
|
Br as JnDatetime,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { ref as p, onDeactivated as x, onActivated as
|
|
1
|
+
import { c as B, u as F } from "../useMouseSelection-DU3qQWIm.js";
|
|
2
|
+
import { ref as p, onDeactivated as x, onActivated as D, onUnmounted as L } from "vue";
|
|
3
3
|
import { ElMessage as v } from "element-plus";
|
|
4
|
-
import {
|
|
5
|
-
const {
|
|
6
|
-
function
|
|
4
|
+
import { u as _ } from "../index-DRbGqK4D.js";
|
|
5
|
+
const { useMockServe: A } = _();
|
|
6
|
+
function j(O) {
|
|
7
7
|
const {
|
|
8
8
|
url: S,
|
|
9
|
-
token:
|
|
9
|
+
token: b,
|
|
10
10
|
connectionTimeoutDuration: C = 6e4,
|
|
11
|
-
heartbeat:
|
|
12
|
-
heartbeatInterval:
|
|
11
|
+
heartbeat: k = !1,
|
|
12
|
+
heartbeatInterval: y = 3e4,
|
|
13
13
|
heartbeatTimeout: N = 1e4,
|
|
14
14
|
showLog: i = !1,
|
|
15
15
|
showMessage: c = !0,
|
|
16
16
|
onOpen: E,
|
|
17
17
|
onMessage: M,
|
|
18
18
|
onClose: I,
|
|
19
|
-
onError:
|
|
19
|
+
onError: T
|
|
20
20
|
} = O, e = p(null), f = p(!0), s = p(!1), u = p("未连接");
|
|
21
|
-
let h = "", o = "", r = null,
|
|
22
|
-
|
|
21
|
+
let h = "", o = "", r = null, l = null, t = null;
|
|
22
|
+
A && (h = S.startsWith("/mock") ? S : "/mock" + S);
|
|
23
23
|
const g = () => {
|
|
24
|
-
r && clearTimeout(r),
|
|
24
|
+
r && clearTimeout(r), l && clearTimeout(l), r = null, l = null;
|
|
25
25
|
}, W = () => {
|
|
26
26
|
if (!(!e.value || e.value.readyState !== WebSocket.OPEN))
|
|
27
27
|
try {
|
|
28
|
-
e.value.send(JSON.stringify({ type: "ping" })),
|
|
28
|
+
e.value.send(JSON.stringify({ type: "ping" })), l = setTimeout(() => {
|
|
29
29
|
o = "WebSocket 连接不稳定,正在重连...", i && console.warn(o), c && v({
|
|
30
30
|
message: o,
|
|
31
31
|
type: "warning",
|
|
@@ -42,7 +42,7 @@ function z(O) {
|
|
|
42
42
|
}, w = () => {
|
|
43
43
|
if (e.value?.readyState === WebSocket.OPEN) return;
|
|
44
44
|
e.value && e.value.close(), g(), t && clearTimeout(t);
|
|
45
|
-
const n =
|
|
45
|
+
const n = b ? [b] : void 0;
|
|
46
46
|
e.value = new WebSocket(h, n), t = setTimeout(() => {
|
|
47
47
|
e.value && e.value.readyState !== WebSocket.OPEN && (o = "WebSocket 连接超时", f.value = !1, s.value = !1, u.value = "连接超时", i && console.error(o), c && v({
|
|
48
48
|
message: o,
|
|
@@ -50,7 +50,7 @@ function z(O) {
|
|
|
50
50
|
grouping: !0,
|
|
51
51
|
showClose: !0,
|
|
52
52
|
duration: 0
|
|
53
|
-
}), e.value?.close(), e.value = null,
|
|
53
|
+
}), e.value?.close(), e.value = null, T?.(new Event("timeout")));
|
|
54
54
|
}, C), e.value.onopen = () => {
|
|
55
55
|
t && (clearTimeout(t), t = null), f.value = !1, s.value = !0, u.value = "连接成功", o = "WebSocket 连接成功", i && console.log(o), c && v({
|
|
56
56
|
message: o,
|
|
@@ -58,21 +58,21 @@ function z(O) {
|
|
|
58
58
|
grouping: !0,
|
|
59
59
|
showClose: !0,
|
|
60
60
|
duration: 3e3
|
|
61
|
-
}), E?.(),
|
|
62
|
-
}, e.value.onmessage = (
|
|
63
|
-
if (u.value = "数据接收中", typeof
|
|
61
|
+
}), E?.(), k && (g(), r = setInterval(W, y));
|
|
62
|
+
}, e.value.onmessage = (a) => {
|
|
63
|
+
if (u.value = "数据接收中", typeof a.data == "string")
|
|
64
64
|
try {
|
|
65
|
-
if (JSON.parse(
|
|
66
|
-
|
|
65
|
+
if (JSON.parse(a.data).type === "pong") {
|
|
66
|
+
l && (clearTimeout(l), l = null);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
} catch {
|
|
70
70
|
}
|
|
71
71
|
try {
|
|
72
|
-
const m = JSON.parse(
|
|
72
|
+
const m = JSON.parse(a.data);
|
|
73
73
|
M?.(m);
|
|
74
74
|
} catch (m) {
|
|
75
|
-
console.error("WebSocket 消息解析失败:",
|
|
75
|
+
console.error("WebSocket 消息解析失败:", a.data, m);
|
|
76
76
|
}
|
|
77
77
|
}, e.value.onclose = () => {
|
|
78
78
|
f.value = !1, s.value = !1, u.value = "连接已关闭", g(), t && (clearTimeout(t), t = null), o = "WebSocket 连接已关闭", i && console.log(o), c && v({
|
|
@@ -82,14 +82,14 @@ function z(O) {
|
|
|
82
82
|
showClose: !0,
|
|
83
83
|
duration: 3e3
|
|
84
84
|
}), I?.();
|
|
85
|
-
}, e.value.onerror = (
|
|
86
|
-
f.value = !1, s.value = !1, u.value = "连接失败", t && (clearTimeout(t), t = null), o = "WebSocket 连接失败", i && console.error(o,
|
|
85
|
+
}, e.value.onerror = (a) => {
|
|
86
|
+
f.value = !1, s.value = !1, u.value = "连接失败", t && (clearTimeout(t), t = null), o = "WebSocket 连接失败", i && console.error(o, a), c && v({
|
|
87
87
|
message: o,
|
|
88
88
|
type: "error",
|
|
89
89
|
grouping: !0,
|
|
90
90
|
showClose: !0,
|
|
91
91
|
duration: 3e3
|
|
92
|
-
}),
|
|
92
|
+
}), T?.(a);
|
|
93
93
|
};
|
|
94
94
|
}, J = (n) => {
|
|
95
95
|
if (!e.value || e.value.readyState !== WebSocket.OPEN) {
|
|
@@ -102,16 +102,16 @@ function z(O) {
|
|
|
102
102
|
});
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
e.value.send(
|
|
105
|
+
const a = typeof n == "string" ? n : JSON.stringify(n);
|
|
106
|
+
e.value.send(a);
|
|
107
107
|
}, d = () => {
|
|
108
108
|
e.value && (e.value.close(), e.value = null), f.value = !1, s.value = !1, u.value = "手动关闭连接", g(), t && (clearTimeout(t), t = null);
|
|
109
109
|
};
|
|
110
110
|
return w(), x(() => {
|
|
111
|
-
r && (clearInterval(r), r = null),
|
|
112
|
-
}), A(() => {
|
|
113
|
-
s.value && b && (r = setInterval(W, T));
|
|
111
|
+
r && (clearInterval(r), r = null), l && (clearTimeout(l), l = null);
|
|
114
112
|
}), D(() => {
|
|
113
|
+
s.value && k && (r = setInterval(W, y));
|
|
114
|
+
}), L(() => {
|
|
115
115
|
d();
|
|
116
116
|
}), {
|
|
117
117
|
ws: e,
|
|
@@ -123,7 +123,7 @@ function z(O) {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
B as useMouseSelection,
|
|
127
|
+
F as useReactivityTableHeight,
|
|
128
|
+
j as useWebSocket
|
|
129
129
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import "pinia-plugin-persistedstate";
|
|
2
|
+
import { defineStore as m } from "pinia";
|
|
3
|
+
import { ref as u, computed as b, watch as h } from "vue";
|
|
4
|
+
import { Fullscreen as S } from "@jnrs/shared";
|
|
5
|
+
import { usePreferredDark as f } from "@vueuse/core";
|
|
6
|
+
import { a as k } from "./index-GnfhAnhF.js";
|
|
7
|
+
const O = m(
|
|
8
|
+
"@jnrs/vue-core/pinia:mock",
|
|
9
|
+
() => ({ useMockServe: u(!1) }),
|
|
10
|
+
{
|
|
11
|
+
persist: {
|
|
12
|
+
pick: ["useMockServe"]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
), j = [
|
|
16
|
+
{ value: "zhCn", label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.zhCn" },
|
|
17
|
+
{ value: "en", label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.en" }
|
|
18
|
+
], C = [
|
|
19
|
+
{ value: "auto", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.auto" },
|
|
20
|
+
{ value: "light", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.light" },
|
|
21
|
+
{ value: "dark", label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.dark" }
|
|
22
|
+
], M = [
|
|
23
|
+
{ value: "oklch(0.6 0.19 41)", label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jnrs" },
|
|
24
|
+
{
|
|
25
|
+
value: "oklch(0.51 0.21 264)",
|
|
26
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.azure"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "oklch(0.90 0.16 98)",
|
|
30
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.moonYellow"
|
|
31
|
+
},
|
|
32
|
+
{ value: "oklch(0.63 0.25 27)", label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jdRed" },
|
|
33
|
+
{
|
|
34
|
+
value: "oklch(0.65 0.24 33)",
|
|
35
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.taobaoRed"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "oklch(0.61 0.20 261)",
|
|
39
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.dingtalkBlue"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: "oklch(0.70 0.12 152)",
|
|
43
|
+
label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.wechatGreen"
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
function w(e) {
|
|
47
|
+
return e === "zhCn" || e === "en";
|
|
48
|
+
}
|
|
49
|
+
function G(e) {
|
|
50
|
+
return e === "light" || e === "dark" || e === "auto";
|
|
51
|
+
}
|
|
52
|
+
function U(e) {
|
|
53
|
+
return typeof e == "string" && e.trim() !== "";
|
|
54
|
+
}
|
|
55
|
+
const x = m(
|
|
56
|
+
"@jnrs/vue-core/pinia:system",
|
|
57
|
+
() => {
|
|
58
|
+
const e = u(!1), o = () => e.value = !e.value, s = new S(), r = u(!1), p = async () => {
|
|
59
|
+
await s.toggle(), r.value = s.isFullscreen();
|
|
60
|
+
}, t = u({
|
|
61
|
+
locale: j[0].value,
|
|
62
|
+
mode: C[0].value,
|
|
63
|
+
primaryColor: M[0].value
|
|
64
|
+
}), a = b(() => t.value.mode === "auto" ? d.value ? "dark" : "light" : t.value.mode), d = f();
|
|
65
|
+
return h(
|
|
66
|
+
[() => t.value.mode, d, () => t.value.primaryColor],
|
|
67
|
+
([l, y, v]) => {
|
|
68
|
+
const c = document.documentElement;
|
|
69
|
+
c.classList.remove("light", "dark"), l === "auto" ? c.classList.add(y ? "dark" : "light") : c.classList.add(l), v ? c.style.setProperty("--jnrs-color-primary", v) : c.style.removeProperty("--jnrs-color-primary");
|
|
70
|
+
},
|
|
71
|
+
{ immediate: !0 }
|
|
72
|
+
), {
|
|
73
|
+
theme: t,
|
|
74
|
+
computedThemeMode: a,
|
|
75
|
+
menuCollapse: e,
|
|
76
|
+
documentFullscreen: r,
|
|
77
|
+
toggleCollapse: o,
|
|
78
|
+
toggleFullScreen: p,
|
|
79
|
+
setLocale: (l) => {
|
|
80
|
+
w(l) && (t.value.locale = l);
|
|
81
|
+
},
|
|
82
|
+
setMode: (l) => {
|
|
83
|
+
G(l) && (t.value.mode = l);
|
|
84
|
+
},
|
|
85
|
+
setPrimaryColor: (l) => {
|
|
86
|
+
U(l) && (t.value.primaryColor = l);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
persist: {
|
|
92
|
+
pick: ["theme", "menuCollapse"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
), n = [];
|
|
96
|
+
for (let e = 0; e < 256; ++e)
|
|
97
|
+
n.push((e + 256).toString(16).slice(1));
|
|
98
|
+
function L(e, o = 0) {
|
|
99
|
+
return (n[e[o + 0]] + n[e[o + 1]] + n[e[o + 2]] + n[e[o + 3]] + "-" + n[e[o + 4]] + n[e[o + 5]] + "-" + n[e[o + 6]] + n[e[o + 7]] + "-" + n[e[o + 8]] + n[e[o + 9]] + "-" + n[e[o + 10]] + n[e[o + 11]] + n[e[o + 12]] + n[e[o + 13]] + n[e[o + 14]] + n[e[o + 15]]).toLowerCase();
|
|
100
|
+
}
|
|
101
|
+
let i;
|
|
102
|
+
const P = new Uint8Array(16);
|
|
103
|
+
function R() {
|
|
104
|
+
if (!i) {
|
|
105
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
106
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
107
|
+
i = crypto.getRandomValues.bind(crypto);
|
|
108
|
+
}
|
|
109
|
+
return i(P);
|
|
110
|
+
}
|
|
111
|
+
const D = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), g = { randomUUID: D };
|
|
112
|
+
function I(e, o, s) {
|
|
113
|
+
e = e || {};
|
|
114
|
+
const r = e.random ?? e.rng?.() ?? R();
|
|
115
|
+
if (r.length < 16)
|
|
116
|
+
throw new Error("Random bytes length must be >= 16");
|
|
117
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, L(r);
|
|
118
|
+
}
|
|
119
|
+
function _(e, o, s) {
|
|
120
|
+
return g.randomUUID && !e ? g.randomUUID() : I(e);
|
|
121
|
+
}
|
|
122
|
+
const T = m(
|
|
123
|
+
"@jnrs/vue-core/pinia:menu",
|
|
124
|
+
() => {
|
|
125
|
+
const e = u(!1), o = u([]), s = async (t) => {
|
|
126
|
+
if (e.value)
|
|
127
|
+
return o.value;
|
|
128
|
+
r(t), o.value = t, e.value = !0;
|
|
129
|
+
try {
|
|
130
|
+
await k(o.value);
|
|
131
|
+
} catch (a) {
|
|
132
|
+
throw a;
|
|
133
|
+
}
|
|
134
|
+
return o.value;
|
|
135
|
+
}, r = (t) => {
|
|
136
|
+
for (const a of t)
|
|
137
|
+
a.meta.uuid = _(), a.children && r(a.children);
|
|
138
|
+
};
|
|
139
|
+
return { hasFetchedAsyncMenus: e, menus: o, asyncSetMenus: s, clearMenu: () => {
|
|
140
|
+
e.value = !1, o.value = [];
|
|
141
|
+
} };
|
|
142
|
+
}
|
|
143
|
+
// {
|
|
144
|
+
// persist: {
|
|
145
|
+
// pick: ['menus']
|
|
146
|
+
// }
|
|
147
|
+
// }
|
|
148
|
+
);
|
|
149
|
+
console.log(
|
|
150
|
+
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
151
|
+
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
152
|
+
);
|
|
153
|
+
const q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
154
|
+
__proto__: null,
|
|
155
|
+
useMenuStore: T,
|
|
156
|
+
useMockStore: O,
|
|
157
|
+
useSystemStore: x
|
|
158
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
159
|
+
export {
|
|
160
|
+
M as C,
|
|
161
|
+
j as L,
|
|
162
|
+
C as M,
|
|
163
|
+
x as a,
|
|
164
|
+
T as b,
|
|
165
|
+
q as i,
|
|
166
|
+
O as u
|
|
167
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { c as r } from "./index-GnfhAnhF.js";
|
|
2
|
-
import { i } from "./index-
|
|
3
|
-
import { i as t } from "./index-Wfhohf_A.js";
|
|
2
|
+
import { i } from "./index-DRbGqK4D.js";
|
|
4
3
|
console.log(
|
|
5
4
|
"%c✨ 欢迎使用 @jnrs/vue-core",
|
|
6
5
|
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
7
6
|
);
|
|
8
7
|
export {
|
|
9
8
|
i as piniaStore,
|
|
10
|
-
t as request,
|
|
11
9
|
r as vueRouter
|
|
12
10
|
};
|
package/dist/lib/guards.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function isLocale(value: unknown): value is
|
|
3
|
-
export declare function isThemeMode(value: unknown): value is
|
|
1
|
+
import { ILocale, IThemeMode } from '@jnrs/shared';
|
|
2
|
+
export declare function isLocale(value: unknown): value is ILocale;
|
|
3
|
+
export declare function isThemeMode(value: unknown): value is IThemeMode;
|
|
4
4
|
export declare function isValidColor(value: unknown): value is string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMenuItem } from '../../types/base';
|
|
2
2
|
/**
|
|
3
3
|
* useMenuStore 菜单仓库
|
|
4
4
|
* @returns hasFetchedAsyncMenus 菜单是否已获取
|
|
@@ -27,7 +27,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
27
27
|
component?: string | undefined;
|
|
28
28
|
redirect?: string | undefined;
|
|
29
29
|
children?: /*elided*/ any[] | undefined;
|
|
30
|
-
}[],
|
|
30
|
+
}[], IMenuItem[] | {
|
|
31
31
|
meta: {
|
|
32
32
|
[x: string]: unknown;
|
|
33
33
|
[x: number]: unknown;
|
|
@@ -47,7 +47,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
47
47
|
redirect?: string | undefined;
|
|
48
48
|
children?: /*elided*/ any[] | undefined;
|
|
49
49
|
}[]>;
|
|
50
|
-
asyncSetMenus: (res:
|
|
50
|
+
asyncSetMenus: (res: IMenuItem[]) => Promise<{
|
|
51
51
|
meta: {
|
|
52
52
|
[x: string]: unknown;
|
|
53
53
|
[x: number]: unknown;
|
|
@@ -89,7 +89,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
89
89
|
component?: string | undefined;
|
|
90
90
|
redirect?: string | undefined;
|
|
91
91
|
children?: /*elided*/ any[] | undefined;
|
|
92
|
-
}[],
|
|
92
|
+
}[], IMenuItem[] | {
|
|
93
93
|
meta: {
|
|
94
94
|
[x: string]: unknown;
|
|
95
95
|
[x: number]: unknown;
|
|
@@ -109,7 +109,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
109
109
|
redirect?: string | undefined;
|
|
110
110
|
children?: /*elided*/ any[] | undefined;
|
|
111
111
|
}[]>;
|
|
112
|
-
asyncSetMenus: (res:
|
|
112
|
+
asyncSetMenus: (res: IMenuItem[]) => Promise<{
|
|
113
113
|
meta: {
|
|
114
114
|
[x: string]: unknown;
|
|
115
115
|
[x: number]: unknown;
|
|
@@ -151,7 +151,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
151
151
|
component?: string | undefined;
|
|
152
152
|
redirect?: string | undefined;
|
|
153
153
|
children?: /*elided*/ any[] | undefined;
|
|
154
|
-
}[],
|
|
154
|
+
}[], IMenuItem[] | {
|
|
155
155
|
meta: {
|
|
156
156
|
[x: string]: unknown;
|
|
157
157
|
[x: number]: unknown;
|
|
@@ -171,7 +171,7 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
171
171
|
redirect?: string | undefined;
|
|
172
172
|
children?: /*elided*/ any[] | undefined;
|
|
173
173
|
}[]>;
|
|
174
|
-
asyncSetMenus: (res:
|
|
174
|
+
asyncSetMenus: (res: IMenuItem[]) => Promise<{
|
|
175
175
|
meta: {
|
|
176
176
|
[x: string]: unknown;
|
|
177
177
|
[x: number]: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILocale, IThemeMode } from '@jnrs/shared';
|
|
2
2
|
type Theme = {
|
|
3
|
-
locale:
|
|
4
|
-
mode:
|
|
3
|
+
locale: ILocale;
|
|
4
|
+
mode: IThemeMode;
|
|
5
5
|
primaryColor: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
@@ -15,12 +15,12 @@ type Theme = {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-core/pinia:system", Pick<{
|
|
17
17
|
theme: import('vue').Ref<{
|
|
18
|
-
locale:
|
|
19
|
-
mode:
|
|
18
|
+
locale: ILocale;
|
|
19
|
+
mode: IThemeMode;
|
|
20
20
|
primaryColor: string;
|
|
21
21
|
}, Theme | {
|
|
22
|
-
locale:
|
|
23
|
-
mode:
|
|
22
|
+
locale: ILocale;
|
|
23
|
+
mode: IThemeMode;
|
|
24
24
|
primaryColor: string;
|
|
25
25
|
}>;
|
|
26
26
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
@@ -33,12 +33,12 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
33
33
|
setPrimaryColor: (value: unknown) => void;
|
|
34
34
|
}, "theme" | "menuCollapse" | "documentFullscreen">, Pick<{
|
|
35
35
|
theme: import('vue').Ref<{
|
|
36
|
-
locale:
|
|
37
|
-
mode:
|
|
36
|
+
locale: ILocale;
|
|
37
|
+
mode: IThemeMode;
|
|
38
38
|
primaryColor: string;
|
|
39
39
|
}, Theme | {
|
|
40
|
-
locale:
|
|
41
|
-
mode:
|
|
40
|
+
locale: ILocale;
|
|
41
|
+
mode: IThemeMode;
|
|
42
42
|
primaryColor: string;
|
|
43
43
|
}>;
|
|
44
44
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
|
@@ -51,12 +51,12 @@ export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-
|
|
|
51
51
|
setPrimaryColor: (value: unknown) => void;
|
|
52
52
|
}, "computedThemeMode">, Pick<{
|
|
53
53
|
theme: import('vue').Ref<{
|
|
54
|
-
locale:
|
|
55
|
-
mode:
|
|
54
|
+
locale: ILocale;
|
|
55
|
+
mode: IThemeMode;
|
|
56
56
|
primaryColor: string;
|
|
57
57
|
}, Theme | {
|
|
58
|
-
locale:
|
|
59
|
-
mode:
|
|
58
|
+
locale: ILocale;
|
|
59
|
+
mode: IThemeMode;
|
|
60
60
|
primaryColor: string;
|
|
61
61
|
}>;
|
|
62
62
|
computedThemeMode: import('vue').ComputedRef<"light" | "dark">;
|
package/dist/piniaStore/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "pinia-plugin-persistedstate";
|
|
2
|
-
import {
|
|
2
|
+
import { b as r, u as t, a as u } from "../index-DRbGqK4D.js";
|
|
3
3
|
export {
|
|
4
|
-
t as useAuthStore,
|
|
5
4
|
r as useMenuStore,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
t as useMockStore,
|
|
6
|
+
u as useSystemStore
|
|
8
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mock仓库
|
|
3
|
-
* @returns
|
|
3
|
+
* @returns useMockServe 是否使用mock数据
|
|
4
4
|
*/
|
|
5
|
-
export declare const useMockStore: import('pinia').StoreDefinition<"jnrs-
|
|
6
|
-
|
|
7
|
-
}, "
|
|
8
|
-
|
|
5
|
+
export declare const useMockStore: import('pinia').StoreDefinition<"@jnrs/vue-core/pinia:mock", Pick<{
|
|
6
|
+
useMockServe: import('vue').Ref<boolean, boolean>;
|
|
7
|
+
}, "useMockServe">, Pick<{
|
|
8
|
+
useMockServe: import('vue').Ref<boolean, boolean>;
|
|
9
9
|
}, never>, Pick<{
|
|
10
|
-
|
|
10
|
+
useMockServe: import('vue').Ref<boolean, boolean>;
|
|
11
11
|
}, never>>;
|
package/dist/types/base.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { RouteMeta } from 'vue-router';
|
|
|
2
2
|
/**
|
|
3
3
|
* 定义菜单项接口
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface IMenuItem {
|
|
6
6
|
meta: RouteMeta;
|
|
7
7
|
path: string;
|
|
8
8
|
name?: string;
|
|
9
9
|
component?: string;
|
|
10
10
|
redirect?: string;
|
|
11
|
-
children?:
|
|
11
|
+
children?: IMenuItem[];
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Element 尺寸
|
|
@@ -21,7 +21,7 @@ export type ElButtonType = 'default' | 'primary' | 'success' | 'info' | 'warning
|
|
|
21
21
|
/**
|
|
22
22
|
* 文件信息
|
|
23
23
|
*/
|
|
24
|
-
export interface
|
|
24
|
+
export interface IAttachment {
|
|
25
25
|
/**
|
|
26
26
|
* 数据 id
|
|
27
27
|
*/
|
|
@@ -50,7 +50,7 @@ export interface Attachment {
|
|
|
50
50
|
/**
|
|
51
51
|
* 分页
|
|
52
52
|
*/
|
|
53
|
-
export interface
|
|
53
|
+
export interface IPagination {
|
|
54
54
|
/**
|
|
55
55
|
* 当前页码
|
|
56
56
|
*/
|
|
@@ -63,7 +63,7 @@ export interface Pagination {
|
|
|
63
63
|
/**
|
|
64
64
|
* 分页列表数据
|
|
65
65
|
*/
|
|
66
|
-
export interface
|
|
66
|
+
export interface IPageData<T> extends IPagination {
|
|
67
67
|
/**
|
|
68
68
|
* 数据列表
|
|
69
69
|
*/
|