@chewel611/naive-ui-plus 0.0.35 → 0.0.36

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/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { useDialog as Oe, useMessage as ue, NCard as Ee, NDataTable as Me, NSpace as _e, NTooltip as Re, NIcon as N, NDropdown as G, NButton as ve, NAvatar as be, NBreadcrumb as Ie, NBreadcrumbItem as He, NDivider as We, useThemeVars as Ue, NMenu as je, NLayout as Le, NLayoutSider as qe, NFlex as Fe, NLayoutHeader as Ke, NLayoutContent as Ve, NBackTop as Ye, NConfigProvider as Xe, dateZhCN as Je, zhCN as Ze, NDialogProvider as Ge, NNotificationProvider as Qe, NMessageProvider as et, NModal as tt, NText as at, NEmpty as nt, NSpin as ot, NResult as ye } from "naive-ui";
2
- import { defineComponent as W, ref as B, computed as V, unref as a, onMounted as Q, openBlock as g, createBlock as L, withCtx as o, createElementVNode as v, createElementBlock as H, renderSlot as Y, createCommentVNode as A, createVNode as c, toDisplayString as j, h as z, toRaw as Ce, reactive as we, normalizeClass as oe, withDirectives as st, vShow as lt, nextTick as se, inject as Ne, Fragment as Se, renderList as ct, resolveDynamicComponent as he, withModifiers as me, resolveComponent as Be, KeepAlive as rt, useCssVars as it, watch as ze, normalizeStyle as De, provide as ut, mergeProps as dt, createTextVNode as pe, onBeforeMount as ft } from "vue";
2
+ import { defineComponent as W, ref as B, computed as V, unref as a, onMounted as Q, openBlock as g, createBlock as L, withCtx as o, createElementVNode as v, createElementBlock as H, renderSlot as Y, createCommentVNode as A, createVNode as c, toDisplayString as j, h as z, toRaw as Ce, reactive as we, normalizeClass as oe, withDirectives as lt, vShow as st, nextTick as le, inject as Ne, Fragment as Se, renderList as ct, resolveDynamicComponent as he, withModifiers as me, resolveComponent as Be, KeepAlive as rt, useCssVars as it, watch as ze, normalizeStyle as De, provide as ut, mergeProps as dt, createTextVNode as pe, onBeforeMount as ft } from "vue";
3
3
  import { PlusSquareOutlined as gt, DeleteOutlined as Te, ReloadOutlined as Pe, MoreOutlined as pt, EditOutlined as ht, MenuUnfoldOutlined as mt, MenuFoldOutlined as _t, FullscreenOutlined as vt, FullscreenExitOutlined as bt, CloseOutlined as $e, ColumnWidthOutlined as yt, MinusOutlined as wt, LeftOutlined as Pt, RightOutlined as kt, DownOutlined as xt, AlertOutlined as Lt } from "@vicons/antd";
4
4
  import { defineStore as ke } from "pinia";
5
- import { useRouter as le, useRoute as ce } from "vue-router";
5
+ import { useRouter as se, useRoute as ce } from "vue-router";
6
6
  import Ct from "element-resize-detector";
7
7
  import St from "vuedraggable";
8
8
  const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
@@ -362,8 +362,8 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
362
362
  src: a(n).state.logo,
363
363
  class: oe({ "mr-2": !a(n).state.collapsed })
364
364
  }, null, 8, ["src", "class"]),
365
- st(v("h1", { class: "font-bold ease-in-out ml-2 logo-size" }, j(a(n).state.title), 513), [
366
- [lt, !a(n).state.collapsed]
365
+ lt(v("h1", { class: "font-bold ease-in-out ml-2 logo-size" }, j(a(n).state.title), 513), [
366
+ [st, !a(n).state.collapsed]
367
367
  ])
368
368
  ]));
369
369
  }
@@ -427,7 +427,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
427
427
  l && (l.selectLanguageTag.show = !1, l.selectLanguageTag.languages = (await r()).map((b) => b.key).join(","), l.ignore.class.push("ignore-translate-flag"), l.ignore.id.push("ignore-translation"), l.language.setLocal(d()), l.request.api.translate = "api/v1/translation", l.request.api.connectTest = "api/v1/translation/connect-test", l.request.api.init = "api/v1/translation/init", l.request.api.language = "api/v1/translation/language", l.request.setHost(s()), l.request.listener.start(), l.listener.start(), l.whole.enableAll(), l.execute());
428
428
  };
429
429
  return Q(async () => {
430
- await se(), await x(), P.value = await m(), h.value = await r();
430
+ await le(), await x(), P.value = await m(), h.value = await r();
431
431
  }), (l, b) => {
432
432
  const u = N, O = ve;
433
433
  return h.value.length > 0 ? (g(), L(a(G), {
@@ -484,7 +484,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
484
484
  }, Kt = { class: "layout-header-trigger layout-header-trigger-min" }, Vt = { class: "layout-header-trigger layout-header-trigger-min" }, Yt = { class: "avatar" }, Xt = /* @__PURE__ */ W({
485
485
  __name: "PHeader",
486
486
  setup(e) {
487
- const n = ue(), r = Oe(), m = re(), d = le(), s = ce(), P = Ne("reloadPage"), h = (i) => d.push({ name: i }), $ = V(() => x(s.matched)), x = (i) => i.map((_) => {
487
+ const n = ue(), r = Oe(), m = re(), d = se(), s = ce(), P = Ne("reloadPage"), h = (i) => d.push({ name: i }), $ = V(() => x(s.matched)), x = (i) => i.map((_) => {
488
488
  const y = {
489
489
  key: _.name,
490
490
  label: _.meta.title,
@@ -678,7 +678,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
678
678
  v4a1a98ea: r.value,
679
679
  v271d846e: m.value
680
680
  }));
681
- const n = Ue(), r = V(() => n.value.cardColor), m = V(() => n.value.textColor1), d = ue(), s = ce(), P = le(), h = B(null), $ = B(null), x = B(!1), l = re(), b = V(() => l.state.tabs), u = we({
681
+ const n = Ue(), r = V(() => n.value.cardColor), m = V(() => n.value.textColor1), d = ue(), s = ce(), P = se(), h = B(null), $ = B(null), x = B(!1), l = re(), b = V(() => l.state.tabs), u = we({
682
682
  activeKey: s.fullPath,
683
683
  scrollable: !0,
684
684
  dropdownX: 0,
@@ -746,7 +746,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
746
746
  const t = y();
747
747
  M(t), l.initTabs(t);
748
748
  }, T = async (t) => {
749
- if (await se(), !h.value) return;
749
+ if (await le(), !h.value) return;
750
750
  const f = h.value.offsetWidth, p = h.value.scrollWidth;
751
751
  f < p ? (u.scrollable = !0, t && [...h.value.querySelectorAll(".tabs-card-scroll-item") || []].forEach((K) => {
752
752
  K.id === `tag${u.activeKey.split("/").join("/")}` && K.scrollIntoView && K.scrollIntoView();
@@ -761,7 +761,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
761
761
  const { replace: p } = P;
762
762
  toString.call(t), p(t).catch(console.error);
763
763
  }, k = (t, f) => {
764
- t.preventDefault(), x.value = f.path === "/home", u.showDropdown = !1, se().then(() => {
764
+ t.preventDefault(), x.value = f.path === "/home", u.showDropdown = !1, le().then(() => {
765
765
  u.showDropdown = !0, u.dropdownX = t.clientX, u.dropdownY = t.clientY;
766
766
  });
767
767
  }, S = () => {
@@ -945,10 +945,10 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
945
945
  ])
946
946
  ], 4));
947
947
  }
948
- }), oa = /* @__PURE__ */ F(na, [["__scopeId", "data-v-e37d2460"]]), sa = /* @__PURE__ */ W({
948
+ }), oa = /* @__PURE__ */ F(na, [["__scopeId", "data-v-e37d2460"]]), la = /* @__PURE__ */ W({
949
949
  __name: "PMenus",
950
950
  setup(e) {
951
- const n = ce(), r = le(), m = re(), d = B(n.name), s = B(
951
+ const n = ce(), r = se(), m = re(), d = B(n.name), s = B(
952
952
  n.matched && n.matched.length ? n.matched.map((u) => u.name) : []
953
953
  ), P = B([]), h = (u) => {
954
954
  /http(s)?:/.test(u) ? window.open(u) : r.push({ name: u });
@@ -977,7 +977,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
977
977
  });
978
978
  for (const y of u) {
979
979
  if (D || y.meta?.hidden || _.includes(y.path.toLowerCase())) {
980
- O.push(y.name);
980
+ O.push(y.name), l(y.children || [], O, !0);
981
981
  continue;
982
982
  }
983
983
  const M = y.meta?.alwaysShow != !0 && y.children?.filter((ee) => !ee.meta?.hidden)?.length === 1, C = M ? y.children[0] : y, T = {
@@ -1021,12 +1021,12 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
1021
1021
  "onUpdate:expandedKeys": $
1022
1022
  }, null, 8, ["options", "collapsed", "expanded-keys", "value"]));
1023
1023
  }
1024
- }), la = { class: "layout-content-main layout-content-main-fix" }, ca = { class: "main-view main-view-fix" }, ra = /* @__PURE__ */ W({
1024
+ }), sa = { class: "layout-content-main layout-content-main-fix" }, ca = { class: "main-view main-view-fix" }, ra = /* @__PURE__ */ W({
1025
1025
  __name: "PLayout",
1026
1026
  setup(e) {
1027
1027
  const n = re(), r = B(!1);
1028
1028
  return ut("reloadPage", () => {
1029
- r.value = !0, se(() => r.value = !1);
1029
+ r.value = !0, le(() => r.value = !1);
1030
1030
  }), (d, s) => {
1031
1031
  const P = Ye;
1032
1032
  return g(), L(a(Le), {
@@ -1053,7 +1053,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
1053
1053
  c(a(Fe), { vertical: "" }, {
1054
1054
  default: o(() => [
1055
1055
  c(Dt),
1056
- c(sa)
1056
+ c(la)
1057
1057
  ]),
1058
1058
  _: 1
1059
1059
  })
@@ -1070,7 +1070,7 @@ const Tt = { class: "text-lg font-medium" }, $t = { id: "data-content" }, Ot = {
1070
1070
  }),
1071
1071
  c(a(Ve), { class: "layout-content layout-default-background" }, {
1072
1072
  default: o(() => [
1073
- v("div", la, [
1073
+ v("div", sa, [
1074
1074
  c(oa),
1075
1075
  v("div", ca, [
1076
1076
  c(Gt, { loading: r.value }, null, 8, ["loading"])
@@ -1259,7 +1259,7 @@ const fa = /* @__PURE__ */ F(ua, [["render", da]]), ga = U(fa), pa = U(ia), ha =
1259
1259
  }), va = U(_a), ba = U(Ae), ya = W({
1260
1260
  name: "Redirect",
1261
1261
  setup() {
1262
- const e = ce(), n = le();
1262
+ const e = ce(), n = se();
1263
1263
  return ft(() => {
1264
1264
  const { params: r, query: m } = e, { path: d } = r;
1265
1265
  n.replace({
@@ -1277,7 +1277,7 @@ const fa = /* @__PURE__ */ F(ua, [["render", da]]), ga = U(fa), pa = U(ia), ha =
1277
1277
  r.value = !1;
1278
1278
  }
1279
1279
  function P() {
1280
- se(() => {
1280
+ le(() => {
1281
1281
  const h = a(m);
1282
1282
  if (!h) return;
1283
1283
  const $ = h;
@@ -1431,7 +1431,7 @@ const ja = /* @__PURE__ */ F(Ha, [["render", Ua], ["__scopeId", "data-v-3baa9c16
1431
1431
  }), Ya = { class: "view-auth-callback" }, Xa = /* @__PURE__ */ W({
1432
1432
  __name: "POidc",
1433
1433
  setup(e) {
1434
- const n = le(), { callCallback: r, callError: m } = Va();
1434
+ const n = se(), { callCallback: r, callError: m } = Va();
1435
1435
  return Q(async () => {
1436
1436
  try {
1437
1437
  await r(n);
@@ -1 +1 @@
1
- (function(w,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("naive-ui"),require("vue"),require("@vicons/antd"),require("pinia"),require("vue-router"),require("element-resize-detector"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","naive-ui","vue","@vicons/antd","pinia","vue-router","element-resize-detector","vuedraggable"],o):(w=typeof globalThis<"u"?globalThis:w||self,o(w.naiveplus={},w.naiveUi,w.Vue,w.antd,w.pinia,w.vueRouter,w.elementResizeDetectorMaker,w.Draggable))})(this,(function(w,o,e,E,J,R,he,_e){"use strict";const ye={class:"text-lg font-medium"},ke={id:"data-content"},be={key:0,class:"rounded-lg bg-gray-50 flex flex-row gap-2 items-center justify-end p-4 mb-4"},we=e.defineComponent({__name:"PTable",props:{title:{},idField:{default:"id"},columns:{},onLoad:{},onDelete:{},onAdd:{},onEdit:{}},setup(t,{expose:a}){const c=e.ref(null),m=o.useDialog(),d=o.useMessage(),l=e.ref(!1),k=e.ref([]),g=e.ref([]),B=e.ref({page:1,itemCount:0,pageSize:10,pageSizes:[10,20,30,50],showSizePicker:!0,onChange:async y=>{B.value.page=y,await N()},onUpdatePageSize:async y=>{B.value.pageSize=y,await N()}}),C=t,s=y=>{const b=x=>{const S=[];return y&&y.forEach(O=>{O.key!=="edit"&&O.key!=="delete"&&S.push({label:O.name,key:O.key,icon:O.icon&&(()=>e.h(o.NIcon,null,{default:()=>e.h(O.icon)})),props:{onClick:()=>O.action(x)}})}),S};return{title:"操作",key:"actions",width:100,fixed:"right",render:x=>{let S=[];if(C.onEdit&&S.push({label:"编辑",key:"edit",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.EditOutlined)}),props:{onClick:async()=>await C.onEdit(x)}}),C.onDelete&&S.push({label:"删除",key:"delete",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.DeleteOutlined)}),props:{onClick:()=>V(x)}}),S=[...S,...b(x)],!(S.length<=0))return e.h(o.NDropdown,{options:S,placement:"bottom-start"},{default:()=>e.h(o.NButton,{size:"small",type:"primary"},{default:()=>["操作",e.h(o.NIcon,()=>e.h(E.MoreOutlined))]})})}}},h=e.computed(()=>{const y=C.columns.filter(x=>x.key!="action").map(x=>({title:x.title,key:x.key,width:x.width,fixed:x.fixed??!1,render:x.render,ellipsis:x.ellipsis?{tooltip:!0}:!1})),b=C.columns.reduce((x,S)=>S.key==="action"?S:x,void 0)?.action;return b&&b?.length>0||C.onEdit||C.onDelete?[{type:"selection",fixed:"left"},...y,s(b)]:[{type:"selection",fixed:"left"},...y]}),i=async()=>await N(),V=y=>r([y]),T=()=>{const y=u();r(y)},r=y=>{y&&y.length>0&&m.warning({title:"警告",content:"删除数据不可恢复, 确认删除吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(C.onDelete)try{await C.onDelete(y)?(N(),d.success("删除成功")):d.error("删除失败")}catch(b){d.error(b.message)}}})},u=()=>k.value?g.value.filter(b=>k.value.includes(b.id)).map(b=>e.toRaw(b)):[],_=()=>u()[0],$=()=>e.toRaw(g.value),N=async()=>{if(!l.value){l.value=!0;try{if(C.onLoad){var{data:y,total:b}=await C.onLoad(B.value.page,B.value.pageSize);g.value=y,B.value.itemCount=b}}catch(x){d.error(x.message)}finally{l.value=!1}}},P=e.computed(()=>{const y=e.unref(c);if(!y)return;const b=y?.$el,x=b.querySelector(".n-data-table-thead "),{bottomIncludeBody:S}=Z(x),O=48;let I=12,H=25;const A=b.querySelector(".n-data-table__pagination");if(A){const q=A.offsetHeight;I+=q||0}else I+=28;return S-(O+I+H)}),W=y=>!y||!y.getBoundingClientRect?0:y.getBoundingClientRect(),Z=y=>{const b=document.documentElement,x=b.scrollLeft,S=b.scrollTop,O=b.clientLeft,I=b.clientTop,H=window.pageXOffset,A=window.pageYOffset,F=W(y),{left:q,top:G,width:Q,height:n}=F,f=(H||x)-(O||0),p=(A||S)-(I||0),L=q+H,z=G+A,K=L-f,Y=z-p,X=window.document.documentElement.clientWidth,ue=window.document.documentElement.clientHeight;return{left:K,top:Y,right:X-Q-K,bottom:ue-n-Y,rightIncludeBody:X-K,bottomIncludeBody:ue-Y}};return e.onMounted(async()=>await N()),a({getData:$,getSelectedRow:_,getSelectedRows:u,refreshData:N,resetPage:()=>{B.value.page=1}}),(y,b)=>{const x=o.NTooltip,S=o.NSpace,O=o.NDataTable;return e.openBlock(),e.createBlock(e.unref(o.NCard),{bordered:!1},{header:e.withCtx(()=>[e.createVNode(S,{justify:"space-between",align:"center",class:"w-full"},{default:e.withCtx(()=>[e.createElementVNode("span",ye,e.toDisplayString(t.title),1),e.createVNode(S,null,{default:e.withCtx(()=>[C.onAdd?(e.openBlock(),e.createBlock(x,{key:0,trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"mr-1 cursor-pointer hover:text-blue-600",onClick:C.onAdd},{default:e.withCtx(()=>[e.createVNode(e.unref(E.PlusSquareOutlined))]),_:1},8,["onClick"])]),default:e.withCtx(()=>[b[1]||(b[1]=e.createElementVNode("span",null,"新增",-1))]),_:1})):e.createCommentVNode("",!0),C.onDelete?(e.openBlock(),e.createBlock(x,{key:1,trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"mr-1 cursor-pointer hover:text-blue-600",onClick:T},{default:e.withCtx(()=>[e.createVNode(e.unref(E.DeleteOutlined))]),_:1})]),default:e.withCtx(()=>[b[2]||(b[2]=e.createElementVNode("span",null,"删除",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,{trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"cursor-pointer hover:text-blue-600",onClick:i},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ReloadOutlined))]),_:1})]),default:e.withCtx(()=>[b[3]||(b[3]=e.createElementVNode("span",null,"刷新",-1))]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",ke,[y.$slots.toolbar?(e.openBlock(),e.createElementBlock("div",be,[e.renderSlot(y.$slots,"toolbar")])):e.createCommentVNode("",!0),e.createVNode(O,{remote:"",ref_key:"$table",ref:c,"checked-row-keys":k.value,"onUpdate:checkedRowKeys":b[0]||(b[0]=I=>k.value=I),"max-height":P.value,loading:l.value,bordered:!1,"single-line":!1,columns:h.value,data:g.value,pagination:B.value,"row-key":I=>I[t.idField]},null,8,["checked-row-keys","max-height","loading","columns","data","pagination","row-key"])])]),_:3})}}}),D=t=>{const a=t;return a.install=function(c){c.component(a.__name,t)},t},U=D(we),Ce=["Redirect","RedirectSon","login"],j=J.defineStore("p-layout",()=>{const t=e.reactive({collapsed:!1,title:"输入项目名称",logo:"https://picsum.photos/id/1/100/100",avatar:"",uid:"",uname:"",tabs:[],cacheTabs:!1,enableLanguage:!1});return{state:t,initTabs:r=>{r.sort((u,_)=>(_.meta.affix?1:0)-(u.meta.affix?1:0)),t.tabs=r},addTab:r=>Ce.includes(r.name)?!1:(t.tabs?.some(_=>_.fullPath==r.fullPath)||t.tabs?.push(r),!0),closeCurrentTab:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs.splice(u,1)},closeAllTabs:()=>{t.tabs=t.tabs.filter(r=>r?.meta?.affix??!1)},closeOtherTabs:r=>{t.tabs=t.tabs.filter(u=>u.fullPath==r.fullPath||(u?.meta?.affix??!1))},closeLeftTabs:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs=t.tabs.filter((_,$)=>$>=u||(_?.meta?.affix??!1))},closeRightTabs:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs=t.tabs.filter((_,$)=>$<=u||(_?.meta?.affix??!1))},collapse:()=>{t.collapsed=!t.collapsed},setTitle:r=>{t.title=r},setLogo:r=>{t.logo=r},setUser:(r,u)=>{t.uid=r,t.uname=u},setSettingPages:r=>{t.settingPages=r},setLogout:r=>{t.logout=r},enableLanguage:r=>{t.enableLanguage=r}}}),Ne={class:"logo"},xe=e.defineComponent({__name:"PLogo",setup(t){const a=j();return(c,m)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(o.NAvatar),{color:"var(--color-logo)",size:32,src:e.unref(a).state.logo,class:e.normalizeClass({"mr-2":!e.unref(a).state.collapsed})},null,8,["src","class"]),e.withDirectives(e.createElementVNode("h1",{class:"font-bold ease-in-out ml-2 logo-size"},e.toDisplayString(e.unref(a).state.title),513),[[e.vShow,!e.unref(a).state.collapsed]])]))}}),M=(t,a)=>{const c=t.__vccOpts||t;for(const[m,d]of a)c[m]=d;return c},Pe=M(xe,[["__scopeId","data-v-e48aeefa"]]),Be={translationApiUrl:"https://translate.zvo.cn/api",defaultLanguage:"chinese",currentLanguage:"",options:[],initLanguages:async()=>[],selectLanguage:async t=>{}},v=J.defineStore("language",()=>{const t=e.ref(Be),a=async()=>(t.value.options.length===0&&(t.value.options=await t.value.initLanguages()),t.value.options);return{select:async s=>{if(t.value.currentLanguage===s)return;const h=(await a()).find(i=>i.key===s);h&&(t.value.currentLanguage=h.key,t.value.selectLanguage(h))},selectLanguageCallback:async s=>{t.value.selectLanguage=s},initLanguagesCallback:async s=>{t.value.initLanguages=s},getLanguages:a,getCurrentLanguage:async()=>{if(t.value.currentLanguage)return(await a()).find(s=>s.key===t.value.currentLanguage)},setTranslationApiUrl:s=>{t.value.translationApiUrl=s},getTranslationApiUrl:()=>t.value.translationApiUrl,getDefaultLanguage:()=>t.value.defaultLanguage?t.value.defaultLanguage:"chinese_simplified",setDefaultLanguage:s=>{(s==="Chinese"||s==="chinese")&&(s="chinese_simplified"),t.value.defaultLanguage=s}}}),Ve={key:1},ee=e.defineComponent({__name:"PLanguage",setup(t){const{select:a,getLanguages:c,getCurrentLanguage:m,getDefaultLanguage:d,getTranslationApiUrl:l}=v(),k=e.ref(),g=e.ref([]),B=async s=>await a(s),C=async()=>{const s=window.translate;s&&(s.selectLanguageTag.show=!1,s.selectLanguageTag.languages=(await c()).map(h=>h.key).join(","),s.ignore.class.push("ignore-translate-flag"),s.ignore.id.push("ignore-translation"),s.language.setLocal(d()),s.request.api.translate="api/v1/translation",s.request.api.connectTest="api/v1/translation/connect-test",s.request.api.init="api/v1/translation/init",s.request.api.language="api/v1/translation/language",s.request.setHost(l()),s.request.listener.start(),s.listener.start(),s.whole.enableAll(),s.execute())};return e.onMounted(async()=>{await e.nextTick(),await C(),k.value=await m(),g.value=await c()}),(s,h)=>{const i=o.NIcon,V=o.NButton;return g.value.length>0?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,id:"ignore-translation",placement:"bottom-start",trigger:"hover",class:"flex flex-col justify-center h-full ignore",onSelect:B,options:g.value},{default:e.withCtx(()=>[e.createVNode(V,{quaternary:"",type:"info"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("label",Ve,e.toDisplayString(k.value?.label),1)):(e.openBlock(),e.createBlock(i,{key:0,size:"18"},{default:e.withCtx(()=>[...h[0]||(h[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z",fill:"currentColor"}),e.createElementVNode("path",{d:"M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z",fill:"currentColor"})],-1)])]),_:1}))]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)}}}),Se={class:"layout-header"},Le={class:"layout-header-left"},Ee={class:"link-text"},Te={key:1,class:"link-text"},$e={class:"layout-header-right"},Oe={key:0,class:"layout-header-trigger-min"},De={class:"layout-header-trigger layout-header-trigger-min"},Ie={class:"layout-header-trigger layout-header-trigger-min"},Re={class:"avatar"},Me=M(e.defineComponent({__name:"PHeader",setup(t){const a=o.useMessage(),c=o.useDialog(),m=j(),d=R.useRouter(),l=R.useRoute(),k=e.inject("reloadPage"),g=r=>d.push({name:r}),B=e.computed(()=>C(l.matched)),C=r=>r.map(u=>{const _={key:u.name,label:u.meta.title,icon:u.meta.icon,meta:u.meta,disabled:u.path==="/",children:void 0};return u.children&&u.children.length>0&&(_.children=C(u.children)),_}),s=e.ref(!1),h=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),s.value=!1):(document.documentElement.requestFullscreen(),s.value=!0)},i=e.computed(()=>{const r=[];return r.push({label:"退出登录",key:"logout"}),m.state.settingPages&&m.state.settingPages.length>0&&m.state.settingPages.forEach(u=>{r.push({label:u.title,key:u.route})}),r}),V=r=>{r==="logout"?T():d.push({name:r})},T=()=>{c.info({title:"提示",content:"您确定要退出登录吗",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(m.state.logout)try{await m.state.logout(),localStorage.removeItem("TABS-ROUTES"),a.error("退出成功")}catch(r){console.error(r),a.error("退出登录失败")}finally{location.reload()}else a.error("没有配置登出接口, 请配置[usePLayoutStore.logout]方法")},onNegativeClick:()=>{}})};return(r,u)=>{const _=o.NTooltip,$=o.NDivider,N=o.NAvatar;return e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",Le,[e.createElementVNode("div",{class:"ml-1 layout-header-trigger layout-header-trigger-min",onClick:u[0]||(u[0]=(...P)=>e.unref(m).collapse&&e.unref(m).collapse(...P))},[e.unref(m).state.collapsed?(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.MenuUnfoldOutlined))]),_:1})):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:1,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.MenuFoldOutlined))]),_:1}))]),e.createElementVNode("div",{class:"mr-1 layout-header-trigger layout-header-trigger-min",onClick:u[1]||(u[1]=(...P)=>e.unref(k)&&e.unref(k)(...P))},[e.createVNode(e.unref(o.NIcon),{size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ReloadOutlined))]),_:1})]),e.createVNode(e.unref(o.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,P=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P.label},[P.label?(e.openBlock(),e.createBlock(e.unref(o.NBreadcrumbItem),{key:0},{default:e.withCtx(()=>[P.children&&P.children.length?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,options:P.children,onSelect:g},{default:e.withCtx(()=>[e.createElementVNode("span",Ee,[P.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(P.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(P.label),1)])]),_:2},1032,["options"])):(e.openBlock(),e.createElementBlock("span",Te,[P.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(P.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(P.label),1)]))]),_:2},1024)):e.createCommentVNode("",!0)],64))),128))]),_:1})]),e.createElementVNode("div",$e,[e.unref(m).state.enableLanguage?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(ee)])):e.createCommentVNode("",!0),e.createElementVNode("div",De,[e.createVNode(_,{placement:"bottom"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",onClick:e.withModifiers(h,["stop"])},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(e.unref(E.FullscreenExitOutlined),{key:1})):(e.openBlock(),e.createBlock(e.unref(E.FullscreenOutlined),{key:0}))]),_:1})]),default:e.withCtx(()=>[u[2]||(u[2]=e.createElementVNode("span",null,"全屏",-1))]),_:1})]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:V,options:i.value},{default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("span",null,e.toDisplayString(e.unref(m).state.uname),1),e.createVNode($,{vertical:""}),e.createVNode(N,{round:"",src:e.unref(m).state.avatar},null,8,["src"])])]),_:1},8,["options"])])])])}}}),[["__scopeId","data-v-563e4e55"]]),ze={class:"mt-1"},Ae=e.defineComponent({__name:"PContent",props:{loading:{type:Boolean,default:!1}},setup(t){return(a,c)=>{const m=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock("div",ze,[t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0},{default:e.withCtx(({Component:d,route:l})=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d),{key:l.fullPath}))],1024))]),_:1}))])}}}),qe={class:"tabs-view-main"},je=["id","onClick","onContextmenu"],He={class:"tabs-close"},We={class:"tabs-close-btn"},Fe=M(e.defineComponent({__name:"PTabs",setup(t){e.useCssVars(n=>({v4a1a98ea:c.value,v271d846e:m.value}));const a=o.useThemeVars(),c=e.computed(()=>a.value.cardColor),m=e.computed(()=>a.value.textColor1),d=o.useMessage(),l=R.useRoute(),k=R.useRouter(),g=e.ref(null),B=e.ref(null),C=e.ref(!1),s=j(),h=e.computed(()=>s.state.tabs),i=e.reactive({activeKey:l.fullPath,scrollable:!0,dropdownX:0,dropdownY:0,showDropdown:!1,isMultiHeaderFixed:!0,multiTabsSetting:!0}),V=["Login","Redirect","ErrorPage"],T=n=>{const{fullPath:f,hash:p,meta:L,name:z,params:K,path:Y,query:X}=n;return{fullPath:f,hash:p,meta:L,name:z,params:K,path:Y,query:X}},r=e.computed(()=>{const p=s.state.collapsed?"64px":"272px";return{left:p,width:`calc(100% - ${p})`}}),u=e.computed(()=>{const n=h.value.length<=1;return[{label:"刷新当前",key:"1",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.ReloadOutlined)})},{label:"关闭当前",key:"2",disabled:C.value||n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.CloseOutlined)})},{label:"关闭其他",key:"3",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.ColumnWidthOutlined)})},{label:"关闭全部",key:"4",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.MinusOutlined)})}]}),_=()=>{let n=[];const f=T(l);try{if(s.state.cacheTabs){const p=localStorage.getItem("TABS_ROUTES");n=p?JSON.parse(p):[f]}else n=[f]}catch{n=[f]}finally{return n}},$=n=>{const f=k.getRoutes();n.forEach(p=>{const L=f.find(z=>z.path===p.path);L&&(p.meta=L.meta||p.meta,p.name=L.name||p.name)}),s.state.cacheTabs&&localStorage.setItem("TABS_ROUTES",JSON.stringify(n))},N=()=>{const n=_();$(n),s.initTabs(n)},P=async n=>{if(await e.nextTick(),!g.value)return;const f=g.value.offsetWidth,p=g.value.scrollWidth;f<p?(i.scrollable=!0,n&&[...g.value.querySelectorAll(".tabs-card-scroll-item")||[]].forEach(z=>{z.id===`tag${i.activeKey.split("/").join("/")}`&&z.scrollIntoView&&z.scrollIntoView()})):i.scrollable=!1},W=n=>!(n.draggedContext.element.meta.affix||n.relatedContext.element.meta.affix),Z=()=>{let n;n=he(),n.listenTo(B.value,()=>P(!0))},y=n=>{const{fullPath:f}=n;if(f===l.fullPath||(i.activeKey=f,!n))return;const{replace:p}=k;toString.call(n),p(n).catch(console.error)},b=(n,f)=>{n.preventDefault(),C.value=f.path==="/home",i.showDropdown=!1,e.nextTick().then(()=>{i.showDropdown=!0,i.dropdownX=n.clientX,i.dropdownY=n.clientY})},x=()=>{if(l.meta.keepAlive){var n=k.currentRoute.value.matched.find(f=>f.name==l.name);n&&n.components?.default?.name}},S=n=>{if(h.value.length===1)return d.warning("这已经是最后一页,不能再关闭了!");if(x(),s.closeCurrentTab(n),i.activeKey===n.fullPath){const f=h.value[Math.max(0,h.value.length-1)];i.activeKey=f.fullPath,k.push(f)}P()},O=n=>{const{fullPath:f}=n,p=h.value.find(L=>L.fullPath==f);S(p)},I=n=>{s.closeOtherTabs(n),i.activeKey=n.fullPath,k.replace(n.fullPath),P()},H=()=>{s.closeAllTabs(),P()},A=e.inject("reloadPage"),F=n=>{switch(n){case"1":A();break;case"2":S(l);break;case"3":I(l);break;case"4":H();break}P(),i.showDropdown=!1},q=(n,f)=>{const p=g.value.scrollLeft,L=f>0&&p+f>=n||f<0&&p+f<=n?n:p+f;if(g.value&&g.value.scrollTo(L,0),L!==n)return window.requestAnimationFrame(()=>q(n,f))},G=()=>{const n=g.value.offsetWidth,f=g.value.scrollLeft;if(!f)return;const p=f>n?f-n:0;q(p,(p-f)/20)},Q=()=>{const n=g.value.offsetWidth,f=g.value.scrollWidth,p=g.value.scrollLeft;if(f-p<=n)return;const L=f-p>n*2?p+n:f-n;q(L,(L-p)/20)};return window.addEventListener("beforeunload",()=>{localStorage.setItem("TABS_ROUTES",JSON.stringify(h.value))}),window.addEventListener("scroll",n=>{let f=n.target.scrollTop||document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop;i.isMultiHeaderFixed=f>=64},!0),e.watch(()=>l.fullPath,n=>{V.includes(l.name)||(i.activeKey=n,s.addTab(T(l)),P(!0))},{immediate:!0}),N(),e.onMounted(()=>Z()),(n,f)=>(e.openBlock(),e.createElementBlock("div",{class:"box-border tabs-view tabs-view-fix tabs-view-default-background",style:e.normalizeStyle(r.value)},[e.createElementVNode("div",qe,[e.createElementVNode("div",{ref_key:"navWrap",ref:B,class:e.normalizeClass(["tabs-card",{"tabs-card-scrollable":i.scrollable}])},[e.createElementVNode("span",{class:e.normalizeClass(["tabs-card-prev",{"tabs-card-prev-hide":!i.scrollable}]),onClick:G},[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.LeftOutlined))]),_:1})],2),e.createElementVNode("span",{class:e.normalizeClass(["tabs-card-next",{"tabs-card-next-hide":!i.scrollable}]),onClick:Q},[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.RightOutlined))]),_:1})],2),e.createElementVNode("div",{ref_key:"navScroll",ref:g,class:"tabs-card-scroll"},[e.createVNode(e.unref(_e),{list:h.value,animation:"300","item-key":"fullPath",class:"flex",move:W},{item:e.withCtx(({element:p})=>[e.createElementVNode("div",{id:`tag${p.fullPath.split("/").join("/")}`,class:e.normalizeClass(["tabs-card-scroll-item",{"active-item":i.activeKey===p.fullPath}]),onClick:e.withModifiers(L=>y(p),["stop"]),onContextmenu:L=>b(L,p)},[e.createElementVNode("span",null,e.toDisplayString(p.meta.title),1),p.meta.affix?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"14",onClick:e.withModifiers(L=>O(p),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(E.CloseOutlined))]),_:1},8,["onClick"]))],42,je)]),_:1},8,["list"])],512)],2),e.createElementVNode("div",He,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:F,placement:"bottom-end",options:u.value},{default:e.withCtx(()=>[e.createElementVNode("div",We,[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.DownOutlined))]),_:1})])]),_:1},8,["options"])]),e.createVNode(e.unref(o.NDropdown),{show:i.showDropdown,x:i.dropdownX,y:i.dropdownY,onClickoutside:f[0]||(f[0]=p=>i.showDropdown=!1),placement:"bottom-start",onSelect:F,options:u.value},null,8,["show","x","y","options"])])],4))}}),[["__scopeId","data-v-e37d2460"]]),Ke=e.defineComponent({__name:"PMenus",setup(t){const a=R.useRoute(),c=R.useRouter(),m=j(),d=e.ref(a.name),l=e.ref(a.matched&&a.matched.length?a.matched.map(i=>i.name):[]),k=e.ref([]),g=i=>{/http(s)?:/.test(i)?window.open(i):c.push({name:i})},B=i=>{if(!i)return;const V=i.find(T=>l.value.indexOf(T)===-1);l.value=V?[V]:[]},C=()=>{const i=a.matched;l.value=i.map(T=>T.name);const V=a.meta?.activeMenu||"";d.value=V||a.name},s=(i,V=[],T=!1)=>{const r=[],u=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!i||i.length===0)return r;i=i.sort((_,$)=>{let N=($.children?.length?1:0)-(_.children?.length?1:0);return N===0&&(N=(_.meta?.sort??0)-($.meta?.sort??0)),N});for(const _ of i){if(T||_.meta?.hidden||u.includes(_.path.toLowerCase())){V.push(_.name);continue}const $=_.meta?.alwaysShow!=!0&&_.children?.filter(W=>!W.meta?.hidden)?.length===1,N=$?_.children[0]:_,P={key:N.name,label:N.meta?.title,affix:N.meta?.affix,sort:N.meta?.sort,path:N.path,redirect:N.redirect,icon:$?_.meta?.icon:N.meta?.icon,permissions:N.meta?.permissions,meta:N.meta,children:void 0};V.includes(N.name)||(r.push(P),V.push(N.name)),N.children?.length>0&&(P.children=s(N.children,V,T))}return r},h=()=>{const i=c.getRoutes();k.value=s(i)};return e.watch(()=>a.fullPath,()=>{C()}),e.onMounted(()=>{h(),C()}),(i,V)=>(e.openBlock(),e.createBlock(e.unref(o.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:k.value,collapsed:e.unref(m).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":l.value,value:d.value,"onUpdate:value":g,"onUpdate:expandedKeys":B},null,8,["options","collapsed","expanded-keys","value"]))}}),Ye={class:"layout-content-main layout-content-main-fix"},Xe={class:"main-view main-view-fix"},Je=M(e.defineComponent({__name:"PLayout",setup(t){const a=j(),c=e.ref(!1),m=()=>{c.value=!0,e.nextTick(()=>c.value=!1)};return e.provide("reloadPage",m),(d,l)=>{const k=o.NBackTop;return e.openBlock(),e.createBlock(e.unref(o.NLayout),{"has-sider":"",class:"layout",position:"absolute"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NLayoutSider),{class:"layout-sider",inverted:"","show-trigger":"bar",position:"absolute","collapse-mode":"width","trigger-class":"!-right-5","collapsed-trigger-class":"!-right-5",collapsed:e.unref(a).state.collapsed,"native-scrollbar":!1,"collapsed-width":64,onCollapse:e.unref(a).collapse,onExpand:e.unref(a).collapse},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NFlex),{vertical:""},{default:e.withCtx(()=>[e.createVNode(Pe),e.createVNode(Ke)]),_:1})]),_:1},8,["collapsed","onCollapse","onExpand"]),e.createVNode(e.unref(o.NLayout),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NLayoutHeader),{position:"absolute"},{default:e.withCtx(()=>[e.createVNode(Me)]),_:1}),e.createVNode(e.unref(o.NLayoutContent),{class:"layout-content layout-default-background"},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[e.createVNode(Fe),e.createElementVNode("div",Xe,[e.createVNode(Ae,{loading:c.value},null,8,["loading"])])])]),_:1}),e.createVNode(k,{right:20,class:"z-50"})]),_:1})]),_:1})}}}),[["__scopeId","data-v-0bac2e7d"]]),Ze={};function Ge(t,a){const c=e.resolveComponent("router-view");return e.openBlock(),e.createBlock(c)}const te=D(M(Ze,[["render",Ge]])),oe=D(Je),ne=D(e.defineComponent({__name:"PApplication",props:{theme:{},themeOverrides:{default:{common:{primaryColor:"#2d8cf0",primaryColorHover:"#3c9bff",primaryColorPressed:"#3c9bff",primaryColorSuppl:"#2d8cf0"},LoadingBar:{colorLoading:"#2d8cf0"}}}},setup(t){return(a,c)=>{const m=o.NConfigProvider;return e.openBlock(),e.createBlock(m,{locale:e.unref(o.zhCN),theme:t.theme,"theme-overrides":t.themeOverrides,"date-locale":e.unref(o.dateZhCN)},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NDialogProvider),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NNotificationProvider),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NMessageProvider),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3},8,["locale","theme","theme-overrides","date-locale"])}}})),ae=D(e.defineComponent({__name:"PModal",props:{saveBtnText:{default:"保存"},cancelBtnText:{default:"取消"},hideCancelBtn:{type:Boolean,default:!1},hideSaveBtn:{type:Boolean,default:!1},title:{},width:{default:800},height:{default:500},visible:{type:Boolean},loading:{type:Boolean},onSave:{},onClose:{}},emits:["update:visible","update:loading"],setup(t,{expose:a,emit:c}){const m=o.useMessage(),d=t,l=c,k=async()=>{l("update:loading",!0);try{d.onSave&&await d.onSave()&&g()}catch(h){m.error(h.message)}finally{l("update:loading",!1)}},g=()=>{l("update:visible",!1),l("update:loading",!1)},B=async()=>{try{d.onClose?await d.onClose()&&g():g()}catch(h){m.error(h.message),l("update:loading",!1)}};return a({open:()=>{l("update:visible",!0),l("update:loading",!1)},close:()=>{l("update:visible",!1),l("update:loading",!1)}}),(h,i)=>{const V=o.NText,T=o.NButton,r=o.NSpace;return e.openBlock(),e.createBlock(e.unref(o.NModal),e.mergeProps({ref:"$modal",preset:"card"},h.$attrs,{"header-class":"bg-gray-50",show:d.visible,draggable:!0,closable:!1,"close-on-esc":!1,"mask-closable":!1,bordered:!1,style:{width:`${d.width}px`},onClose:g}),{header:e.withCtx(()=>[h.$slots.header?e.renderSlot(h.$slots,"header",{key:0}):d.title?(e.openBlock(),e.createBlock(V,{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})):e.createCommentVNode("",!0)]),"header-extra":e.withCtx(()=>[e.renderSlot(h.$slots,"header-extra")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:"overflow-y-auto overflow-hidden mt-5",style:e.normalizeStyle({maxHeight:`${d.height}px`})},[e.renderSlot(h.$slots,"default")],4)]),footer:e.withCtx(()=>[e.renderSlot(h.$slots,"footer")]),action:e.withCtx(()=>[e.createVNode(r,{justify:"end"},{default:e.withCtx(()=>[d.hideSaveBtn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:0,type:"primary",loading:t.loading,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveBtnText),1)]),_:1},8,["loading"])),e.renderSlot(h.$slots,"action-extra",{loading:t.loading}),d.hideCancelBtn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:1,onClick:B,loading:t.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelBtnText),1)]),_:1},8,["loading"]))]),_:3})]),_:3},16,["show","style"])}}})),le=D(ee),Qe=e.defineComponent({name:"Redirect",setup(){const t=R.useRoute(),a=R.useRouter();return e.onBeforeMount(()=>{const{params:c,query:m}=t,{path:d}=c;a.replace({path:"/"+(Array.isArray(d)?d.join("/"):d),query:m})}),()=>React.createElement(o.NEmpty,null)}}),se=D(Qe),Ue={class:"frame"},ve=["src"],ce=D(M(e.defineComponent({__name:"PIframe",setup(t){const a=R.useRoute(),c=e.ref(!1),m=e.ref(null),d=e.ref("");e.unref(a.meta)?.frameSrc&&(d.value=e.unref(a.meta)?.frameSrc);function l(){c.value=!1}function k(){e.nextTick(()=>{const g=e.unref(m);if(!g)return;const B=g;B.attachEvent?B.attachEvent("onload",()=>{l()}):g.onload=()=>{l()}})}return e.onMounted(()=>{c.value=!0,k()}),(g,B)=>{const C=o.NSpin;return e.openBlock(),e.createBlock(C,{show:c.value},{default:e.withCtx(()=>[e.createElementVNode("div",Ue,[e.createElementVNode("iframe",{src:d.value,class:"frame-iframe",ref_key:"frameRef",ref:m},null,8,ve)])]),_:1},8,["show"])}}}),[["__scopeId","data-v-161a378e"]])),et={class:"border border-gray-100 rounded-lg"},tt={class:"text-xl font-semibold text-gray-800"},ot={class:"text-sm text-gray-500 mt-1"},re=D(e.defineComponent({__name:"PPage",props:{icon:{type:Object,required:!1,default:()=>E.AlertOutlined},title:{type:String,required:!0},subtitle:{type:String,required:!1}},setup(t){const a=t;return(c,m)=>{const d=o.NIcon,l=o.NAvatar,k=o.NSpace,g=o.NCard;return e.openBlock(),e.createElementBlock("div",et,[a.title?(e.openBlock(),e.createBlock(g,{key:0,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.createVNode(k,{align:"center",justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(k,{align:"center",size:16},{default:e.withCtx(()=>[a.icon?(e.openBlock(),e.createBlock(l,{key:0,size:48,class:"bg-linear-to-br from-blue-500 to-indigo-600"},{default:e.withCtx(()=>[e.createVNode(d,{size:24,component:a.icon,color:"#fff"},null,8,["component"])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",tt,e.toDisplayString(a.title),1),e.createElementVNode("div",ot,e.toDisplayString(a.subtitle??a.title+"主页"),1)])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),c.$slots.search?(e.openBlock(),e.createBlock(g,{key:1,class:"mb-4","content-class":"flex flex-row gap-2",bordered:!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search")]),_:3})):e.createCommentVNode("",!0),c.$slots.default?(e.openBlock(),e.createBlock(g,{key:2,"content-class":"flex flex-row gap-2 p-0!",bordered:!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3})):e.createCommentVNode("",!0)])}}})),nt={},at={class:"flex flex-col justify-center page-container"};function lt(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",at,[e.createVNode(c,{status:"500",title:"服务器错误",description:"抱歉,服务器出错了"})])}const st=M(nt,[["render",lt],["__scopeId","data-v-89cb65c7"]]),ct={},rt={class:"flex flex-col justify-center page-container"};function it(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(c,{status:"404",title:"资源不存在",description:"抱歉,你访问的页面不存在"})])}const dt=M(ct,[["render",it],["__scopeId","data-v-99232671"]]),ft={},pt={class:"flex flex-col justify-center page-container"};function mt(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(c,{status:"403",title:"禁止访问",description:"抱歉,你无权访问该页面"})])}const gt=M(ft,[["render",mt],["__scopeId","data-v-3baa9c16"]]),ie=D(st),de=D(dt),fe=D(gt),pe=J.defineStore("app-oidc",()=>{const t=e.reactive({});return{setCallback:l=>t.callback=l,callCallback:async l=>await t.callback?.(l),setError:l=>t.error=l,callError:async(l,k)=>await t.error?.(l,k)}}),ut={class:"view-auth-callback"},me=D(M(e.defineComponent({__name:"POidc",setup(t){const a=R.useRouter(),{callCallback:c,callError:m}=pe();return e.onMounted(async()=>{try{await c(a)}catch(d){await m(a,d)}}),(d,l)=>(e.openBlock(),e.createElementBlock("div",ut,[...l[0]||(l[0]=[e.createElementVNode("div",{class:"view-auth-callback-content"},[e.createElementVNode("div",{class:"view-auth-callback-spinner"},[e.createElementVNode("span",null,"正在处理登录回调...")])],-1)])]))}}),[["__scopeId","data-v-167395ae"]])),ht=Object.freeze(Object.defineProperty({__proto__:null,P403:fe,P404:de,P500:ie,PApplication:ne,PEmptyLayout:te,PIframe:ce,PLanguage:le,PLayout:oe,PModal:ae,POidc:me,PPage:re,PRedirect:se,PTable:U},Symbol.toStringTag,{value:"Module"})),ge=(t,a)=>(Object.values(ht).forEach(c=>{c.install&&t.use(c)}),a?.(),t),_t={install:ge};w.P403=fe,w.P404=de,w.P500=ie,w.PApplication=ne,w.PEmptyLayout=te,w.PIframe=ce,w.PLanguage=le,w.PLayout=oe,w.PModal=ae,w.POidc=me,w.PPage=re,w.PRedirect=se,w.PTable=U,w.default=_t,w.install=ge,w.useLanguageStore=v,w.useLayoutStore=j,w.useOidcStore=pe,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(w,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("naive-ui"),require("vue"),require("@vicons/antd"),require("pinia"),require("vue-router"),require("element-resize-detector"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","naive-ui","vue","@vicons/antd","pinia","vue-router","element-resize-detector","vuedraggable"],o):(w=typeof globalThis<"u"?globalThis:w||self,o(w.naiveplus={},w.naiveUi,w.Vue,w.antd,w.pinia,w.vueRouter,w.elementResizeDetectorMaker,w.Draggable))})(this,(function(w,o,e,E,J,R,he,_e){"use strict";const ye={class:"text-lg font-medium"},ke={id:"data-content"},be={key:0,class:"rounded-lg bg-gray-50 flex flex-row gap-2 items-center justify-end p-4 mb-4"},we=e.defineComponent({__name:"PTable",props:{title:{},idField:{default:"id"},columns:{},onLoad:{},onDelete:{},onAdd:{},onEdit:{}},setup(t,{expose:a}){const c=e.ref(null),m=o.useDialog(),d=o.useMessage(),s=e.ref(!1),k=e.ref([]),g=e.ref([]),B=e.ref({page:1,itemCount:0,pageSize:10,pageSizes:[10,20,30,50],showSizePicker:!0,onChange:async y=>{B.value.page=y,await N()},onUpdatePageSize:async y=>{B.value.pageSize=y,await N()}}),C=t,l=y=>{const b=x=>{const S=[];return y&&y.forEach(O=>{O.key!=="edit"&&O.key!=="delete"&&S.push({label:O.name,key:O.key,icon:O.icon&&(()=>e.h(o.NIcon,null,{default:()=>e.h(O.icon)})),props:{onClick:()=>O.action(x)}})}),S};return{title:"操作",key:"actions",width:100,fixed:"right",render:x=>{let S=[];if(C.onEdit&&S.push({label:"编辑",key:"edit",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.EditOutlined)}),props:{onClick:async()=>await C.onEdit(x)}}),C.onDelete&&S.push({label:"删除",key:"delete",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.DeleteOutlined)}),props:{onClick:()=>V(x)}}),S=[...S,...b(x)],!(S.length<=0))return e.h(o.NDropdown,{options:S,placement:"bottom-start"},{default:()=>e.h(o.NButton,{size:"small",type:"primary"},{default:()=>["操作",e.h(o.NIcon,()=>e.h(E.MoreOutlined))]})})}}},h=e.computed(()=>{const y=C.columns.filter(x=>x.key!="action").map(x=>({title:x.title,key:x.key,width:x.width,fixed:x.fixed??!1,render:x.render,ellipsis:x.ellipsis?{tooltip:!0}:!1})),b=C.columns.reduce((x,S)=>S.key==="action"?S:x,void 0)?.action;return b&&b?.length>0||C.onEdit||C.onDelete?[{type:"selection",fixed:"left"},...y,l(b)]:[{type:"selection",fixed:"left"},...y]}),i=async()=>await N(),V=y=>r([y]),T=()=>{const y=u();r(y)},r=y=>{y&&y.length>0&&m.warning({title:"警告",content:"删除数据不可恢复, 确认删除吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(C.onDelete)try{await C.onDelete(y)?(N(),d.success("删除成功")):d.error("删除失败")}catch(b){d.error(b.message)}}})},u=()=>k.value?g.value.filter(b=>k.value.includes(b.id)).map(b=>e.toRaw(b)):[],_=()=>u()[0],$=()=>e.toRaw(g.value),N=async()=>{if(!s.value){s.value=!0;try{if(C.onLoad){var{data:y,total:b}=await C.onLoad(B.value.page,B.value.pageSize);g.value=y,B.value.itemCount=b}}catch(x){d.error(x.message)}finally{s.value=!1}}},P=e.computed(()=>{const y=e.unref(c);if(!y)return;const b=y?.$el,x=b.querySelector(".n-data-table-thead "),{bottomIncludeBody:S}=Z(x),O=48;let I=12,H=25;const A=b.querySelector(".n-data-table__pagination");if(A){const q=A.offsetHeight;I+=q||0}else I+=28;return S-(O+I+H)}),W=y=>!y||!y.getBoundingClientRect?0:y.getBoundingClientRect(),Z=y=>{const b=document.documentElement,x=b.scrollLeft,S=b.scrollTop,O=b.clientLeft,I=b.clientTop,H=window.pageXOffset,A=window.pageYOffset,F=W(y),{left:q,top:G,width:Q,height:n}=F,f=(H||x)-(O||0),p=(A||S)-(I||0),L=q+H,z=G+A,K=L-f,Y=z-p,X=window.document.documentElement.clientWidth,ue=window.document.documentElement.clientHeight;return{left:K,top:Y,right:X-Q-K,bottom:ue-n-Y,rightIncludeBody:X-K,bottomIncludeBody:ue-Y}};return e.onMounted(async()=>await N()),a({getData:$,getSelectedRow:_,getSelectedRows:u,refreshData:N,resetPage:()=>{B.value.page=1}}),(y,b)=>{const x=o.NTooltip,S=o.NSpace,O=o.NDataTable;return e.openBlock(),e.createBlock(e.unref(o.NCard),{bordered:!1},{header:e.withCtx(()=>[e.createVNode(S,{justify:"space-between",align:"center",class:"w-full"},{default:e.withCtx(()=>[e.createElementVNode("span",ye,e.toDisplayString(t.title),1),e.createVNode(S,null,{default:e.withCtx(()=>[C.onAdd?(e.openBlock(),e.createBlock(x,{key:0,trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"mr-1 cursor-pointer hover:text-blue-600",onClick:C.onAdd},{default:e.withCtx(()=>[e.createVNode(e.unref(E.PlusSquareOutlined))]),_:1},8,["onClick"])]),default:e.withCtx(()=>[b[1]||(b[1]=e.createElementVNode("span",null,"新增",-1))]),_:1})):e.createCommentVNode("",!0),C.onDelete?(e.openBlock(),e.createBlock(x,{key:1,trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"mr-1 cursor-pointer hover:text-blue-600",onClick:T},{default:e.withCtx(()=>[e.createVNode(e.unref(E.DeleteOutlined))]),_:1})]),default:e.withCtx(()=>[b[2]||(b[2]=e.createElementVNode("span",null,"删除",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,{trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"cursor-pointer hover:text-blue-600",onClick:i},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ReloadOutlined))]),_:1})]),default:e.withCtx(()=>[b[3]||(b[3]=e.createElementVNode("span",null,"刷新",-1))]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",ke,[y.$slots.toolbar?(e.openBlock(),e.createElementBlock("div",be,[e.renderSlot(y.$slots,"toolbar")])):e.createCommentVNode("",!0),e.createVNode(O,{remote:"",ref_key:"$table",ref:c,"checked-row-keys":k.value,"onUpdate:checkedRowKeys":b[0]||(b[0]=I=>k.value=I),"max-height":P.value,loading:s.value,bordered:!1,"single-line":!1,columns:h.value,data:g.value,pagination:B.value,"row-key":I=>I[t.idField]},null,8,["checked-row-keys","max-height","loading","columns","data","pagination","row-key"])])]),_:3})}}}),D=t=>{const a=t;return a.install=function(c){c.component(a.__name,t)},t},U=D(we),Ce=["Redirect","RedirectSon","login"],j=J.defineStore("p-layout",()=>{const t=e.reactive({collapsed:!1,title:"输入项目名称",logo:"https://picsum.photos/id/1/100/100",avatar:"",uid:"",uname:"",tabs:[],cacheTabs:!1,enableLanguage:!1});return{state:t,initTabs:r=>{r.sort((u,_)=>(_.meta.affix?1:0)-(u.meta.affix?1:0)),t.tabs=r},addTab:r=>Ce.includes(r.name)?!1:(t.tabs?.some(_=>_.fullPath==r.fullPath)||t.tabs?.push(r),!0),closeCurrentTab:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs.splice(u,1)},closeAllTabs:()=>{t.tabs=t.tabs.filter(r=>r?.meta?.affix??!1)},closeOtherTabs:r=>{t.tabs=t.tabs.filter(u=>u.fullPath==r.fullPath||(u?.meta?.affix??!1))},closeLeftTabs:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs=t.tabs.filter((_,$)=>$>=u||(_?.meta?.affix??!1))},closeRightTabs:r=>{const u=t.tabs.findIndex(_=>_.fullPath==r.fullPath);t.tabs=t.tabs.filter((_,$)=>$<=u||(_?.meta?.affix??!1))},collapse:()=>{t.collapsed=!t.collapsed},setTitle:r=>{t.title=r},setLogo:r=>{t.logo=r},setUser:(r,u)=>{t.uid=r,t.uname=u},setSettingPages:r=>{t.settingPages=r},setLogout:r=>{t.logout=r},enableLanguage:r=>{t.enableLanguage=r}}}),Ne={class:"logo"},xe=e.defineComponent({__name:"PLogo",setup(t){const a=j();return(c,m)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(o.NAvatar),{color:"var(--color-logo)",size:32,src:e.unref(a).state.logo,class:e.normalizeClass({"mr-2":!e.unref(a).state.collapsed})},null,8,["src","class"]),e.withDirectives(e.createElementVNode("h1",{class:"font-bold ease-in-out ml-2 logo-size"},e.toDisplayString(e.unref(a).state.title),513),[[e.vShow,!e.unref(a).state.collapsed]])]))}}),M=(t,a)=>{const c=t.__vccOpts||t;for(const[m,d]of a)c[m]=d;return c},Pe=M(xe,[["__scopeId","data-v-e48aeefa"]]),Be={translationApiUrl:"https://translate.zvo.cn/api",defaultLanguage:"chinese",currentLanguage:"",options:[],initLanguages:async()=>[],selectLanguage:async t=>{}},v=J.defineStore("language",()=>{const t=e.ref(Be),a=async()=>(t.value.options.length===0&&(t.value.options=await t.value.initLanguages()),t.value.options);return{select:async l=>{if(t.value.currentLanguage===l)return;const h=(await a()).find(i=>i.key===l);h&&(t.value.currentLanguage=h.key,t.value.selectLanguage(h))},selectLanguageCallback:async l=>{t.value.selectLanguage=l},initLanguagesCallback:async l=>{t.value.initLanguages=l},getLanguages:a,getCurrentLanguage:async()=>{if(t.value.currentLanguage)return(await a()).find(l=>l.key===t.value.currentLanguage)},setTranslationApiUrl:l=>{t.value.translationApiUrl=l},getTranslationApiUrl:()=>t.value.translationApiUrl,getDefaultLanguage:()=>t.value.defaultLanguage?t.value.defaultLanguage:"chinese_simplified",setDefaultLanguage:l=>{(l==="Chinese"||l==="chinese")&&(l="chinese_simplified"),t.value.defaultLanguage=l}}}),Ve={key:1},ee=e.defineComponent({__name:"PLanguage",setup(t){const{select:a,getLanguages:c,getCurrentLanguage:m,getDefaultLanguage:d,getTranslationApiUrl:s}=v(),k=e.ref(),g=e.ref([]),B=async l=>await a(l),C=async()=>{const l=window.translate;l&&(l.selectLanguageTag.show=!1,l.selectLanguageTag.languages=(await c()).map(h=>h.key).join(","),l.ignore.class.push("ignore-translate-flag"),l.ignore.id.push("ignore-translation"),l.language.setLocal(d()),l.request.api.translate="api/v1/translation",l.request.api.connectTest="api/v1/translation/connect-test",l.request.api.init="api/v1/translation/init",l.request.api.language="api/v1/translation/language",l.request.setHost(s()),l.request.listener.start(),l.listener.start(),l.whole.enableAll(),l.execute())};return e.onMounted(async()=>{await e.nextTick(),await C(),k.value=await m(),g.value=await c()}),(l,h)=>{const i=o.NIcon,V=o.NButton;return g.value.length>0?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,id:"ignore-translation",placement:"bottom-start",trigger:"hover",class:"flex flex-col justify-center h-full ignore",onSelect:B,options:g.value},{default:e.withCtx(()=>[e.createVNode(V,{quaternary:"",type:"info"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("label",Ve,e.toDisplayString(k.value?.label),1)):(e.openBlock(),e.createBlock(i,{key:0,size:"18"},{default:e.withCtx(()=>[...h[0]||(h[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[e.createElementVNode("path",{d:"M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z",fill:"currentColor"}),e.createElementVNode("path",{d:"M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z",fill:"currentColor"})],-1)])]),_:1}))]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)}}}),Se={class:"layout-header"},Le={class:"layout-header-left"},Ee={class:"link-text"},Te={key:1,class:"link-text"},$e={class:"layout-header-right"},Oe={key:0,class:"layout-header-trigger-min"},De={class:"layout-header-trigger layout-header-trigger-min"},Ie={class:"layout-header-trigger layout-header-trigger-min"},Re={class:"avatar"},Me=M(e.defineComponent({__name:"PHeader",setup(t){const a=o.useMessage(),c=o.useDialog(),m=j(),d=R.useRouter(),s=R.useRoute(),k=e.inject("reloadPage"),g=r=>d.push({name:r}),B=e.computed(()=>C(s.matched)),C=r=>r.map(u=>{const _={key:u.name,label:u.meta.title,icon:u.meta.icon,meta:u.meta,disabled:u.path==="/",children:void 0};return u.children&&u.children.length>0&&(_.children=C(u.children)),_}),l=e.ref(!1),h=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),l.value=!1):(document.documentElement.requestFullscreen(),l.value=!0)},i=e.computed(()=>{const r=[];return r.push({label:"退出登录",key:"logout"}),m.state.settingPages&&m.state.settingPages.length>0&&m.state.settingPages.forEach(u=>{r.push({label:u.title,key:u.route})}),r}),V=r=>{r==="logout"?T():d.push({name:r})},T=()=>{c.info({title:"提示",content:"您确定要退出登录吗",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(m.state.logout)try{await m.state.logout(),localStorage.removeItem("TABS-ROUTES"),a.error("退出成功")}catch(r){console.error(r),a.error("退出登录失败")}finally{location.reload()}else a.error("没有配置登出接口, 请配置[usePLayoutStore.logout]方法")},onNegativeClick:()=>{}})};return(r,u)=>{const _=o.NTooltip,$=o.NDivider,N=o.NAvatar;return e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",Le,[e.createElementVNode("div",{class:"ml-1 layout-header-trigger layout-header-trigger-min",onClick:u[0]||(u[0]=(...P)=>e.unref(m).collapse&&e.unref(m).collapse(...P))},[e.unref(m).state.collapsed?(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.MenuUnfoldOutlined))]),_:1})):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:1,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.MenuFoldOutlined))]),_:1}))]),e.createElementVNode("div",{class:"mr-1 layout-header-trigger layout-header-trigger-min",onClick:u[1]||(u[1]=(...P)=>e.unref(k)&&e.unref(k)(...P))},[e.createVNode(e.unref(o.NIcon),{size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ReloadOutlined))]),_:1})]),e.createVNode(e.unref(o.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,P=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P.label},[P.label?(e.openBlock(),e.createBlock(e.unref(o.NBreadcrumbItem),{key:0},{default:e.withCtx(()=>[P.children&&P.children.length?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,options:P.children,onSelect:g},{default:e.withCtx(()=>[e.createElementVNode("span",Ee,[P.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(P.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(P.label),1)])]),_:2},1032,["options"])):(e.openBlock(),e.createElementBlock("span",Te,[P.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(P.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(P.label),1)]))]),_:2},1024)):e.createCommentVNode("",!0)],64))),128))]),_:1})]),e.createElementVNode("div",$e,[e.unref(m).state.enableLanguage?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(ee)])):e.createCommentVNode("",!0),e.createElementVNode("div",De,[e.createVNode(_,{placement:"bottom"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",onClick:e.withModifiers(h,["stop"])},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createBlock(e.unref(E.FullscreenExitOutlined),{key:1})):(e.openBlock(),e.createBlock(e.unref(E.FullscreenOutlined),{key:0}))]),_:1})]),default:e.withCtx(()=>[u[2]||(u[2]=e.createElementVNode("span",null,"全屏",-1))]),_:1})]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:V,options:i.value},{default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("span",null,e.toDisplayString(e.unref(m).state.uname),1),e.createVNode($,{vertical:""}),e.createVNode(N,{round:"",src:e.unref(m).state.avatar},null,8,["src"])])]),_:1},8,["options"])])])])}}}),[["__scopeId","data-v-563e4e55"]]),ze={class:"mt-1"},Ae=e.defineComponent({__name:"PContent",props:{loading:{type:Boolean,default:!1}},setup(t){return(a,c)=>{const m=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock("div",ze,[t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0},{default:e.withCtx(({Component:d,route:s})=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d),{key:s.fullPath}))],1024))]),_:1}))])}}}),qe={class:"tabs-view-main"},je=["id","onClick","onContextmenu"],He={class:"tabs-close"},We={class:"tabs-close-btn"},Fe=M(e.defineComponent({__name:"PTabs",setup(t){e.useCssVars(n=>({v4a1a98ea:c.value,v271d846e:m.value}));const a=o.useThemeVars(),c=e.computed(()=>a.value.cardColor),m=e.computed(()=>a.value.textColor1),d=o.useMessage(),s=R.useRoute(),k=R.useRouter(),g=e.ref(null),B=e.ref(null),C=e.ref(!1),l=j(),h=e.computed(()=>l.state.tabs),i=e.reactive({activeKey:s.fullPath,scrollable:!0,dropdownX:0,dropdownY:0,showDropdown:!1,isMultiHeaderFixed:!0,multiTabsSetting:!0}),V=["Login","Redirect","ErrorPage"],T=n=>{const{fullPath:f,hash:p,meta:L,name:z,params:K,path:Y,query:X}=n;return{fullPath:f,hash:p,meta:L,name:z,params:K,path:Y,query:X}},r=e.computed(()=>{const p=l.state.collapsed?"64px":"272px";return{left:p,width:`calc(100% - ${p})`}}),u=e.computed(()=>{const n=h.value.length<=1;return[{label:"刷新当前",key:"1",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.ReloadOutlined)})},{label:"关闭当前",key:"2",disabled:C.value||n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.CloseOutlined)})},{label:"关闭其他",key:"3",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.ColumnWidthOutlined)})},{label:"关闭全部",key:"4",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(E.MinusOutlined)})}]}),_=()=>{let n=[];const f=T(s);try{if(l.state.cacheTabs){const p=localStorage.getItem("TABS_ROUTES");n=p?JSON.parse(p):[f]}else n=[f]}catch{n=[f]}finally{return n}},$=n=>{const f=k.getRoutes();n.forEach(p=>{const L=f.find(z=>z.path===p.path);L&&(p.meta=L.meta||p.meta,p.name=L.name||p.name)}),l.state.cacheTabs&&localStorage.setItem("TABS_ROUTES",JSON.stringify(n))},N=()=>{const n=_();$(n),l.initTabs(n)},P=async n=>{if(await e.nextTick(),!g.value)return;const f=g.value.offsetWidth,p=g.value.scrollWidth;f<p?(i.scrollable=!0,n&&[...g.value.querySelectorAll(".tabs-card-scroll-item")||[]].forEach(z=>{z.id===`tag${i.activeKey.split("/").join("/")}`&&z.scrollIntoView&&z.scrollIntoView()})):i.scrollable=!1},W=n=>!(n.draggedContext.element.meta.affix||n.relatedContext.element.meta.affix),Z=()=>{let n;n=he(),n.listenTo(B.value,()=>P(!0))},y=n=>{const{fullPath:f}=n;if(f===s.fullPath||(i.activeKey=f,!n))return;const{replace:p}=k;toString.call(n),p(n).catch(console.error)},b=(n,f)=>{n.preventDefault(),C.value=f.path==="/home",i.showDropdown=!1,e.nextTick().then(()=>{i.showDropdown=!0,i.dropdownX=n.clientX,i.dropdownY=n.clientY})},x=()=>{if(s.meta.keepAlive){var n=k.currentRoute.value.matched.find(f=>f.name==s.name);n&&n.components?.default?.name}},S=n=>{if(h.value.length===1)return d.warning("这已经是最后一页,不能再关闭了!");if(x(),l.closeCurrentTab(n),i.activeKey===n.fullPath){const f=h.value[Math.max(0,h.value.length-1)];i.activeKey=f.fullPath,k.push(f)}P()},O=n=>{const{fullPath:f}=n,p=h.value.find(L=>L.fullPath==f);S(p)},I=n=>{l.closeOtherTabs(n),i.activeKey=n.fullPath,k.replace(n.fullPath),P()},H=()=>{l.closeAllTabs(),P()},A=e.inject("reloadPage"),F=n=>{switch(n){case"1":A();break;case"2":S(s);break;case"3":I(s);break;case"4":H();break}P(),i.showDropdown=!1},q=(n,f)=>{const p=g.value.scrollLeft,L=f>0&&p+f>=n||f<0&&p+f<=n?n:p+f;if(g.value&&g.value.scrollTo(L,0),L!==n)return window.requestAnimationFrame(()=>q(n,f))},G=()=>{const n=g.value.offsetWidth,f=g.value.scrollLeft;if(!f)return;const p=f>n?f-n:0;q(p,(p-f)/20)},Q=()=>{const n=g.value.offsetWidth,f=g.value.scrollWidth,p=g.value.scrollLeft;if(f-p<=n)return;const L=f-p>n*2?p+n:f-n;q(L,(L-p)/20)};return window.addEventListener("beforeunload",()=>{localStorage.setItem("TABS_ROUTES",JSON.stringify(h.value))}),window.addEventListener("scroll",n=>{let f=n.target.scrollTop||document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop;i.isMultiHeaderFixed=f>=64},!0),e.watch(()=>s.fullPath,n=>{V.includes(s.name)||(i.activeKey=n,l.addTab(T(s)),P(!0))},{immediate:!0}),N(),e.onMounted(()=>Z()),(n,f)=>(e.openBlock(),e.createElementBlock("div",{class:"box-border tabs-view tabs-view-fix tabs-view-default-background",style:e.normalizeStyle(r.value)},[e.createElementVNode("div",qe,[e.createElementVNode("div",{ref_key:"navWrap",ref:B,class:e.normalizeClass(["tabs-card",{"tabs-card-scrollable":i.scrollable}])},[e.createElementVNode("span",{class:e.normalizeClass(["tabs-card-prev",{"tabs-card-prev-hide":!i.scrollable}]),onClick:G},[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.LeftOutlined))]),_:1})],2),e.createElementVNode("span",{class:e.normalizeClass(["tabs-card-next",{"tabs-card-next-hide":!i.scrollable}]),onClick:Q},[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.RightOutlined))]),_:1})],2),e.createElementVNode("div",{ref_key:"navScroll",ref:g,class:"tabs-card-scroll"},[e.createVNode(e.unref(_e),{list:h.value,animation:"300","item-key":"fullPath",class:"flex",move:W},{item:e.withCtx(({element:p})=>[e.createElementVNode("div",{id:`tag${p.fullPath.split("/").join("/")}`,class:e.normalizeClass(["tabs-card-scroll-item",{"active-item":i.activeKey===p.fullPath}]),onClick:e.withModifiers(L=>y(p),["stop"]),onContextmenu:L=>b(L,p)},[e.createElementVNode("span",null,e.toDisplayString(p.meta.title),1),p.meta.affix?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"14",onClick:e.withModifiers(L=>O(p),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(E.CloseOutlined))]),_:1},8,["onClick"]))],42,je)]),_:1},8,["list"])],512)],2),e.createElementVNode("div",He,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:F,placement:"bottom-end",options:u.value},{default:e.withCtx(()=>[e.createElementVNode("div",We,[e.createVNode(e.unref(o.NIcon),{size:"16",color:"#515a6e"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.DownOutlined))]),_:1})])]),_:1},8,["options"])]),e.createVNode(e.unref(o.NDropdown),{show:i.showDropdown,x:i.dropdownX,y:i.dropdownY,onClickoutside:f[0]||(f[0]=p=>i.showDropdown=!1),placement:"bottom-start",onSelect:F,options:u.value},null,8,["show","x","y","options"])])],4))}}),[["__scopeId","data-v-e37d2460"]]),Ke=e.defineComponent({__name:"PMenus",setup(t){const a=R.useRoute(),c=R.useRouter(),m=j(),d=e.ref(a.name),s=e.ref(a.matched&&a.matched.length?a.matched.map(i=>i.name):[]),k=e.ref([]),g=i=>{/http(s)?:/.test(i)?window.open(i):c.push({name:i})},B=i=>{if(!i)return;const V=i.find(T=>s.value.indexOf(T)===-1);s.value=V?[V]:[]},C=()=>{const i=a.matched;s.value=i.map(T=>T.name);const V=a.meta?.activeMenu||"";d.value=V||a.name},l=(i,V=[],T=!1)=>{const r=[],u=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!i||i.length===0)return r;i=i.sort((_,$)=>{let N=($.children?.length?1:0)-(_.children?.length?1:0);return N===0&&(N=(_.meta?.sort??0)-($.meta?.sort??0)),N});for(const _ of i){if(T||_.meta?.hidden||u.includes(_.path.toLowerCase())){V.push(_.name),l(_.children||[],V,!0);continue}const $=_.meta?.alwaysShow!=!0&&_.children?.filter(W=>!W.meta?.hidden)?.length===1,N=$?_.children[0]:_,P={key:N.name,label:N.meta?.title,affix:N.meta?.affix,sort:N.meta?.sort,path:N.path,redirect:N.redirect,icon:$?_.meta?.icon:N.meta?.icon,permissions:N.meta?.permissions,meta:N.meta,children:void 0};V.includes(N.name)||(r.push(P),V.push(N.name)),N.children?.length>0&&(P.children=l(N.children,V,T))}return r},h=()=>{const i=c.getRoutes();k.value=l(i)};return e.watch(()=>a.fullPath,()=>{C()}),e.onMounted(()=>{h(),C()}),(i,V)=>(e.openBlock(),e.createBlock(e.unref(o.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:k.value,collapsed:e.unref(m).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":s.value,value:d.value,"onUpdate:value":g,"onUpdate:expandedKeys":B},null,8,["options","collapsed","expanded-keys","value"]))}}),Ye={class:"layout-content-main layout-content-main-fix"},Xe={class:"main-view main-view-fix"},Je=M(e.defineComponent({__name:"PLayout",setup(t){const a=j(),c=e.ref(!1),m=()=>{c.value=!0,e.nextTick(()=>c.value=!1)};return e.provide("reloadPage",m),(d,s)=>{const k=o.NBackTop;return e.openBlock(),e.createBlock(e.unref(o.NLayout),{"has-sider":"",class:"layout",position:"absolute"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NLayoutSider),{class:"layout-sider",inverted:"","show-trigger":"bar",position:"absolute","collapse-mode":"width","trigger-class":"!-right-5","collapsed-trigger-class":"!-right-5",collapsed:e.unref(a).state.collapsed,"native-scrollbar":!1,"collapsed-width":64,onCollapse:e.unref(a).collapse,onExpand:e.unref(a).collapse},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NFlex),{vertical:""},{default:e.withCtx(()=>[e.createVNode(Pe),e.createVNode(Ke)]),_:1})]),_:1},8,["collapsed","onCollapse","onExpand"]),e.createVNode(e.unref(o.NLayout),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NLayoutHeader),{position:"absolute"},{default:e.withCtx(()=>[e.createVNode(Me)]),_:1}),e.createVNode(e.unref(o.NLayoutContent),{class:"layout-content layout-default-background"},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[e.createVNode(Fe),e.createElementVNode("div",Xe,[e.createVNode(Ae,{loading:c.value},null,8,["loading"])])])]),_:1}),e.createVNode(k,{right:20,class:"z-50"})]),_:1})]),_:1})}}}),[["__scopeId","data-v-0bac2e7d"]]),Ze={};function Ge(t,a){const c=e.resolveComponent("router-view");return e.openBlock(),e.createBlock(c)}const te=D(M(Ze,[["render",Ge]])),oe=D(Je),ne=D(e.defineComponent({__name:"PApplication",props:{theme:{},themeOverrides:{default:{common:{primaryColor:"#2d8cf0",primaryColorHover:"#3c9bff",primaryColorPressed:"#3c9bff",primaryColorSuppl:"#2d8cf0"},LoadingBar:{colorLoading:"#2d8cf0"}}}},setup(t){return(a,c)=>{const m=o.NConfigProvider;return e.openBlock(),e.createBlock(m,{locale:e.unref(o.zhCN),theme:t.theme,"theme-overrides":t.themeOverrides,"date-locale":e.unref(o.dateZhCN)},{default:e.withCtx(()=>[e.createVNode(e.unref(o.NDialogProvider),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NNotificationProvider),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.NMessageProvider),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3},8,["locale","theme","theme-overrides","date-locale"])}}})),ae=D(e.defineComponent({__name:"PModal",props:{saveBtnText:{default:"保存"},cancelBtnText:{default:"取消"},hideCancelBtn:{type:Boolean,default:!1},hideSaveBtn:{type:Boolean,default:!1},title:{},width:{default:800},height:{default:500},visible:{type:Boolean},loading:{type:Boolean},onSave:{},onClose:{}},emits:["update:visible","update:loading"],setup(t,{expose:a,emit:c}){const m=o.useMessage(),d=t,s=c,k=async()=>{s("update:loading",!0);try{d.onSave&&await d.onSave()&&g()}catch(h){m.error(h.message)}finally{s("update:loading",!1)}},g=()=>{s("update:visible",!1),s("update:loading",!1)},B=async()=>{try{d.onClose?await d.onClose()&&g():g()}catch(h){m.error(h.message),s("update:loading",!1)}};return a({open:()=>{s("update:visible",!0),s("update:loading",!1)},close:()=>{s("update:visible",!1),s("update:loading",!1)}}),(h,i)=>{const V=o.NText,T=o.NButton,r=o.NSpace;return e.openBlock(),e.createBlock(e.unref(o.NModal),e.mergeProps({ref:"$modal",preset:"card"},h.$attrs,{"header-class":"bg-gray-50",show:d.visible,draggable:!0,closable:!1,"close-on-esc":!1,"mask-closable":!1,bordered:!1,style:{width:`${d.width}px`},onClose:g}),{header:e.withCtx(()=>[h.$slots.header?e.renderSlot(h.$slots,"header",{key:0}):d.title?(e.openBlock(),e.createBlock(V,{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})):e.createCommentVNode("",!0)]),"header-extra":e.withCtx(()=>[e.renderSlot(h.$slots,"header-extra")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:"overflow-y-auto overflow-hidden mt-5",style:e.normalizeStyle({maxHeight:`${d.height}px`})},[e.renderSlot(h.$slots,"default")],4)]),footer:e.withCtx(()=>[e.renderSlot(h.$slots,"footer")]),action:e.withCtx(()=>[e.createVNode(r,{justify:"end"},{default:e.withCtx(()=>[d.hideSaveBtn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:0,type:"primary",loading:t.loading,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveBtnText),1)]),_:1},8,["loading"])),e.renderSlot(h.$slots,"action-extra",{loading:t.loading}),d.hideCancelBtn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:1,onClick:B,loading:t.loading},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelBtnText),1)]),_:1},8,["loading"]))]),_:3})]),_:3},16,["show","style"])}}})),le=D(ee),Qe=e.defineComponent({name:"Redirect",setup(){const t=R.useRoute(),a=R.useRouter();return e.onBeforeMount(()=>{const{params:c,query:m}=t,{path:d}=c;a.replace({path:"/"+(Array.isArray(d)?d.join("/"):d),query:m})}),()=>React.createElement(o.NEmpty,null)}}),se=D(Qe),Ue={class:"frame"},ve=["src"],ce=D(M(e.defineComponent({__name:"PIframe",setup(t){const a=R.useRoute(),c=e.ref(!1),m=e.ref(null),d=e.ref("");e.unref(a.meta)?.frameSrc&&(d.value=e.unref(a.meta)?.frameSrc);function s(){c.value=!1}function k(){e.nextTick(()=>{const g=e.unref(m);if(!g)return;const B=g;B.attachEvent?B.attachEvent("onload",()=>{s()}):g.onload=()=>{s()}})}return e.onMounted(()=>{c.value=!0,k()}),(g,B)=>{const C=o.NSpin;return e.openBlock(),e.createBlock(C,{show:c.value},{default:e.withCtx(()=>[e.createElementVNode("div",Ue,[e.createElementVNode("iframe",{src:d.value,class:"frame-iframe",ref_key:"frameRef",ref:m},null,8,ve)])]),_:1},8,["show"])}}}),[["__scopeId","data-v-161a378e"]])),et={class:"border border-gray-100 rounded-lg"},tt={class:"text-xl font-semibold text-gray-800"},ot={class:"text-sm text-gray-500 mt-1"},re=D(e.defineComponent({__name:"PPage",props:{icon:{type:Object,required:!1,default:()=>E.AlertOutlined},title:{type:String,required:!0},subtitle:{type:String,required:!1}},setup(t){const a=t;return(c,m)=>{const d=o.NIcon,s=o.NAvatar,k=o.NSpace,g=o.NCard;return e.openBlock(),e.createElementBlock("div",et,[a.title?(e.openBlock(),e.createBlock(g,{key:0,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.createVNode(k,{align:"center",justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(k,{align:"center",size:16},{default:e.withCtx(()=>[a.icon?(e.openBlock(),e.createBlock(s,{key:0,size:48,class:"bg-linear-to-br from-blue-500 to-indigo-600"},{default:e.withCtx(()=>[e.createVNode(d,{size:24,component:a.icon,color:"#fff"},null,8,["component"])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",tt,e.toDisplayString(a.title),1),e.createElementVNode("div",ot,e.toDisplayString(a.subtitle??a.title+"主页"),1)])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),c.$slots.search?(e.openBlock(),e.createBlock(g,{key:1,class:"mb-4","content-class":"flex flex-row gap-2",bordered:!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"search")]),_:3})):e.createCommentVNode("",!0),c.$slots.default?(e.openBlock(),e.createBlock(g,{key:2,"content-class":"flex flex-row gap-2 p-0!",bordered:!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3})):e.createCommentVNode("",!0)])}}})),nt={},at={class:"flex flex-col justify-center page-container"};function lt(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",at,[e.createVNode(c,{status:"500",title:"服务器错误",description:"抱歉,服务器出错了"})])}const st=M(nt,[["render",lt],["__scopeId","data-v-89cb65c7"]]),ct={},rt={class:"flex flex-col justify-center page-container"};function it(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(c,{status:"404",title:"资源不存在",description:"抱歉,你访问的页面不存在"})])}const dt=M(ct,[["render",it],["__scopeId","data-v-99232671"]]),ft={},pt={class:"flex flex-col justify-center page-container"};function mt(t,a){const c=o.NResult;return e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(c,{status:"403",title:"禁止访问",description:"抱歉,你无权访问该页面"})])}const gt=M(ft,[["render",mt],["__scopeId","data-v-3baa9c16"]]),ie=D(st),de=D(dt),fe=D(gt),pe=J.defineStore("app-oidc",()=>{const t=e.reactive({});return{setCallback:s=>t.callback=s,callCallback:async s=>await t.callback?.(s),setError:s=>t.error=s,callError:async(s,k)=>await t.error?.(s,k)}}),ut={class:"view-auth-callback"},me=D(M(e.defineComponent({__name:"POidc",setup(t){const a=R.useRouter(),{callCallback:c,callError:m}=pe();return e.onMounted(async()=>{try{await c(a)}catch(d){await m(a,d)}}),(d,s)=>(e.openBlock(),e.createElementBlock("div",ut,[...s[0]||(s[0]=[e.createElementVNode("div",{class:"view-auth-callback-content"},[e.createElementVNode("div",{class:"view-auth-callback-spinner"},[e.createElementVNode("span",null,"正在处理登录回调...")])],-1)])]))}}),[["__scopeId","data-v-167395ae"]])),ht=Object.freeze(Object.defineProperty({__proto__:null,P403:fe,P404:de,P500:ie,PApplication:ne,PEmptyLayout:te,PIframe:ce,PLanguage:le,PLayout:oe,PModal:ae,POidc:me,PPage:re,PRedirect:se,PTable:U},Symbol.toStringTag,{value:"Module"})),ge=(t,a)=>(Object.values(ht).forEach(c=>{c.install&&t.use(c)}),a?.(),t),_t={install:ge};w.P403=fe,w.P404=de,w.P500=ie,w.PApplication=ne,w.PEmptyLayout=te,w.PIframe=ce,w.PLanguage=le,w.PLayout=oe,w.PModal=ae,w.POidc=me,w.PPage=re,w.PRedirect=se,w.PTable=U,w.default=_t,w.install=ge,w.useLanguageStore=v,w.useLayoutStore=j,w.useOidcStore=pe,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -1,25 +1,25 @@
1
- import { defineComponent as k, ref as i, watch as y, onMounted as B, openBlock as S, createBlock as C, unref as v } from "vue";
2
- import { NMenu as K } from "naive-ui";
3
- import { useRoute as L, useRouter as O } from "vue-router";
4
- import { useLayoutStore as P } from "../store.js";
1
+ import { defineComponent as k, ref as u, watch as B, onMounted as y, openBlock as S, createBlock as C, unref as v } from "vue";
2
+ import { NMenu as L } from "naive-ui";
3
+ import { useRoute as O, useRouter as P } from "vue-router";
4
+ import { useLayoutStore as U } from "../store.js";
5
5
  const N = /* @__PURE__ */ k({
6
6
  __name: "PMenus",
7
- setup(U) {
8
- const a = L(), u = O(), g = P(), d = i(a.name), l = i(
7
+ setup(b) {
8
+ const a = O(), d = P(), g = U(), m = u(a.name), l = u(
9
9
  a.matched && a.matched.length ? a.matched.map((e) => e.name) : []
10
- ), m = i([]), M = (e) => {
11
- /http(s)?:/.test(e) ? window.open(e) : u.push({ name: e });
10
+ ), p = u([]), M = (e) => {
11
+ /http(s)?:/.test(e) ? window.open(e) : d.push({ name: e });
12
12
  }, _ = (e) => {
13
13
  if (!e) return;
14
14
  const n = e.find((c) => l.value.indexOf(c) === -1);
15
15
  l.value = n ? [n] : [];
16
- }, p = () => {
16
+ }, h = () => {
17
17
  const e = a.matched;
18
18
  l.value = e.map((c) => c.name);
19
19
  const n = a.meta?.activeMenu || "";
20
- d.value = n || a.name;
21
- }, h = (e, n = [], c = !1) => {
22
- const r = [], x = [
20
+ m.value = n || a.name;
21
+ }, r = (e, n = [], c = !1) => {
22
+ const i = [], x = [
23
23
  "/:path(.*)*",
24
24
  "/redirect",
25
25
  "/redirect/:path(.*)",
@@ -27,14 +27,14 @@ const N = /* @__PURE__ */ k({
27
27
  "/oidc-callback"
28
28
  ];
29
29
  if (!e || e.length === 0)
30
- return r;
30
+ return i;
31
31
  e = e.sort((o, s) => {
32
32
  let t = (s.children?.length ? 1 : 0) - (o.children?.length ? 1 : 0);
33
33
  return t === 0 && (t = (o.meta?.sort ?? 0) - (s.meta?.sort ?? 0)), t;
34
34
  });
35
35
  for (const o of e) {
36
36
  if (c || o.meta?.hidden || x.includes(o.path.toLowerCase())) {
37
- n.push(o.name);
37
+ n.push(o.name), r(o.children || [], n, !0);
38
38
  continue;
39
39
  }
40
40
  const s = o.meta?.alwaysShow != !0 && o.children?.filter((R) => !R.meta?.hidden)?.length === 1, t = s ? o.children[0] : o, f = {
@@ -49,31 +49,31 @@ const N = /* @__PURE__ */ k({
49
49
  meta: t.meta,
50
50
  children: void 0
51
51
  };
52
- n.includes(t.name) || (r.push(f), n.push(t.name)), t.children?.length > 0 && (f.children = h(t.children, n, c));
52
+ n.includes(t.name) || (i.push(f), n.push(t.name)), t.children?.length > 0 && (f.children = r(t.children, n, c));
53
53
  }
54
- return r;
54
+ return i;
55
55
  }, w = () => {
56
- const e = u.getRoutes();
57
- m.value = h(e);
56
+ const e = d.getRoutes();
57
+ p.value = r(e);
58
58
  };
59
- return y(
59
+ return B(
60
60
  () => a.fullPath,
61
61
  () => {
62
- p();
62
+ h();
63
63
  }
64
- ), B(() => {
65
- w(), p();
66
- }), (e, n) => (S(), C(v(K), {
64
+ ), y(() => {
65
+ w(), h();
66
+ }), (e, n) => (S(), C(v(L), {
67
67
  class: "h-full",
68
68
  inverted: "",
69
69
  mode: "vertical",
70
- options: m.value,
70
+ options: p.value,
71
71
  collapsed: v(g).state.collapsed,
72
72
  "collapsed-width": 64,
73
73
  "collapsed-icon-size": 20,
74
74
  indent: 24,
75
75
  "expanded-keys": l.value,
76
- value: d.value,
76
+ value: m.value,
77
77
  "onUpdate:value": M,
78
78
  "onUpdate:expandedKeys": _
79
79
  }, null, 8, ["options", "collapsed", "expanded-keys", "value"]));
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),y=require("naive-ui"),v=require("vue-router"),S=require("../store.cjs"),k=a.defineComponent({__name:"PMenus",setup(q){const s=v.useRoute(),i=v.useRouter(),g=S.useLayoutStore(),d=a.ref(s.name),l=a.ref(s.matched&&s.matched.length?s.matched.map(e=>e.name):[]),m=a.ref([]),M=e=>{/http(s)?:/.test(e)?window.open(e):i.push({name:e})},_=e=>{if(!e)return;const n=e.find(c=>l.value.indexOf(c)===-1);l.value=n?[n]:[]},p=()=>{const e=s.matched;l.value=e.map(c=>c.name);const n=s.meta?.activeMenu||"";d.value=n||s.name},h=(e,n=[],c=!1)=>{const u=[],R=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!e||e.length===0)return u;e=e.sort((o,r)=>{let t=(r.children?.length?1:0)-(o.children?.length?1:0);return t===0&&(t=(o.meta?.sort??0)-(r.meta?.sort??0)),t});for(const o of e){if(c||o.meta?.hidden||R.includes(o.path.toLowerCase())){n.push(o.name);continue}const r=o.meta?.alwaysShow!=!0&&o.children?.filter(x=>!x.meta?.hidden)?.length===1,t=r?o.children[0]:o,f={key:t.name,label:t.meta?.title,affix:t.meta?.affix,sort:t.meta?.sort,path:t.path,redirect:t.redirect,icon:r?o.meta?.icon:t.meta?.icon,permissions:t.meta?.permissions,meta:t.meta,children:void 0};n.includes(t.name)||(u.push(f),n.push(t.name)),t.children?.length>0&&(f.children=h(t.children,n,c))}return u},w=()=>{const e=i.getRoutes();m.value=h(e)};return a.watch(()=>s.fullPath,()=>{p()}),a.onMounted(()=>{w(),p()}),(e,n)=>(a.openBlock(),a.createBlock(a.unref(y.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:m.value,collapsed:a.unref(g).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":l.value,value:d.value,"onUpdate:value":M,"onUpdate:expandedKeys":_},null,8,["options","collapsed","expanded-keys","value"]))}});exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),S=require("naive-ui"),v=require("vue-router"),k=require("../store.cjs"),q=a.defineComponent({__name:"PMenus",setup(y){const c=v.useRoute(),d=v.useRouter(),g=k.useLayoutStore(),m=a.ref(c.name),l=a.ref(c.matched&&c.matched.length?c.matched.map(e=>e.name):[]),h=a.ref([]),M=e=>{/http(s)?:/.test(e)?window.open(e):d.push({name:e})},_=e=>{if(!e)return;const n=e.find(s=>l.value.indexOf(s)===-1);l.value=n?[n]:[]},p=()=>{const e=c.matched;l.value=e.map(s=>s.name);const n=c.meta?.activeMenu||"";m.value=n||c.name},u=(e,n=[],s=!1)=>{const i=[],R=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!e||e.length===0)return i;e=e.sort((o,r)=>{let t=(r.children?.length?1:0)-(o.children?.length?1:0);return t===0&&(t=(o.meta?.sort??0)-(r.meta?.sort??0)),t});for(const o of e){if(s||o.meta?.hidden||R.includes(o.path.toLowerCase())){n.push(o.name),u(o.children||[],n,!0);continue}const r=o.meta?.alwaysShow!=!0&&o.children?.filter(x=>!x.meta?.hidden)?.length===1,t=r?o.children[0]:o,f={key:t.name,label:t.meta?.title,affix:t.meta?.affix,sort:t.meta?.sort,path:t.path,redirect:t.redirect,icon:r?o.meta?.icon:t.meta?.icon,permissions:t.meta?.permissions,meta:t.meta,children:void 0};n.includes(t.name)||(i.push(f),n.push(t.name)),t.children?.length>0&&(f.children=u(t.children,n,s))}return i},w=()=>{const e=d.getRoutes();h.value=u(e)};return a.watch(()=>c.fullPath,()=>{p()}),a.onMounted(()=>{w(),p()}),(e,n)=>(a.openBlock(),a.createBlock(a.unref(S.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:h.value,collapsed:a.unref(g).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":l.value,value:m.value,"onUpdate:value":M,"onUpdate:expandedKeys":_},null,8,["options","collapsed","expanded-keys","value"]))}});exports.default=q;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chewel611/naive-ui-plus",
3
3
  "private": false,
4
- "version": "0.0.35",
4
+ "version": "0.0.36",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": false,