@chewel611/naive-ui-plus 0.0.30 → 0.0.32
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 +539 -531
- package/dist/index.umd.cjs +1 -1
- package/es/modal/PModal.d.ts +3 -0
- package/es/modal/PModal.vue.js +47 -42
- package/es/modal/index.d.ts +9 -0
- package/es/modal/typing.d.ts +3 -0
- package/es/page/PPage.vue.js +20 -20
- package/es/table/PTable.vue.js +111 -108
- package/es/table/typing.d.ts +2 -2
- package/lib/modal/PModal.d.ts +3 -0
- package/lib/modal/PModal.vue.cjs +1 -1
- package/lib/modal/index.d.ts +9 -0
- package/lib/modal/typing.d.ts +3 -0
- package/lib/page/PPage.vue.cjs +1 -1
- package/lib/table/PTable.vue.cjs +1 -1
- package/lib/table/typing.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -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"},be={id:"data-content"},ke={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 r=e.ref(null),g=o.useDialog(),p=o.useMessage(),s=e.ref(!1),b=e.ref([]),u=e.ref([]),P=e.ref({page:1,itemCount:0,pageSize:10,pageSizes:[10,20,30,50],showSizePicker:!0,onChange:async y=>{P.value.page=y,await B()},onUpdatePageSize:async y=>{P.value.pageSize=y,await B()}}),C=t,l=y=>{const k=N=>{const S=[];return y&&y.forEach(D=>{D.key!=="edit"&&D.key!=="delete"&&S.push({label:D.name,key:D.key,props:{onClick:()=>D.action(N)}})}),S};return{title:"操作",key:"actions",width:100,fixed:"right",render:N=>{let S=[];if(C.onEdit&&S.push({label:"编辑",key:"edit",props:{onClick:async()=>await C.onEdit(N)}}),C.onDelete&&S.push({label:"删除",key:"delete",props:{onClick:()=>V(N)}}),S=[...S,...k(N)],!(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))]})})}}},_=e.computed(()=>{const y=C.columns.filter(N=>N.key!="action").map(N=>({title:N.title,key:N.key,width:N.width,fixed:N.fixed??!1,render:N.render,ellipsis:N.ellipsis?{tooltip:!0}:!1})),k=C.columns.reduce((N,S)=>S.key==="action"?S:N,void 0)?.action;return k&&k?.length>0||C.onEdit||C.onDelete?[{type:"selection",fixed:"left"},...y,l(k)]:[{type:"selection",fixed:"left"},...y]}),c=async()=>await B(),V=y=>i([y]),T=()=>{const y=h();i(y)},i=y=>{y&&y.length>0&&g.warning({title:"警告",content:"删除数据不可恢复, 确认删除吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(C.onDelete)try{await C.onDelete(y)?(B(),p.success("删除成功")):p.error("删除失败")}catch(k){p.error(k.message)}}})},h=()=>b.value?u.value.filter(k=>b.value.includes(k.id)).map(k=>e.toRaw(k)):[],m=()=>h()[0],$=()=>e.toRaw(u.value),B=async()=>{if(!s.value){s.value=!0;try{if(C.onLoad){var{data:y,total:k}=await C.onLoad(P.value.page,P.value.pageSize);u.value=y,P.value.itemCount=k}}catch(N){p.error(N.message)}finally{s.value=!1}}},x=e.computed(()=>{const y=e.unref(r);if(!y)return;const k=y?.$el,N=k.querySelector(".n-data-table-thead "),{bottomIncludeBody:S}=Z(N),D=48;let I=12,H=24;const A=k.querySelector(".n-data-table__pagination");if(A){const q=A.offsetHeight;I+=q||0}else I+=28;return S-(D+I+H)}),W=y=>!y||!y.getBoundingClientRect?0:y.getBoundingClientRect(),Z=y=>{const k=document.documentElement,N=k.scrollLeft,S=k.scrollTop,D=k.clientLeft,I=k.clientTop,H=window.pageXOffset,A=window.pageYOffset,F=W(y),{left:q,top:G,width:Q,height:n}=F,d=(H||N)-(D||0),f=(A||S)-(I||0),L=q+H,z=G+A,K=L-d,Y=z-f,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 B()),a({getData:$,getSelectedRow:m,getSelectedRows:h,refreshData:B,resetPage:()=>{P.value.page=1}}),(y,k)=>{const N=o.NTooltip,S=o.NSpace,D=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(N,{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(()=>[k[1]||(k[1]=e.createElementVNode("span",null,"新增",-1))]),_:1})):e.createCommentVNode("",!0),C.onDelete?(e.openBlock(),e.createBlock(N,{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(()=>[k[2]||(k[2]=e.createElementVNode("span",null,"删除",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(N,{trigger:"hover"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",class:"cursor-pointer hover:text-blue-600",onClick:c},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ReloadOutlined))]),_:1})]),default:e.withCtx(()=>[k[3]||(k[3]=e.createElementVNode("span",null,"刷新",-1))]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",be,[y.$slots.toolbar?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(y.$slots,"toolbar")])):e.createCommentVNode("",!0),e.createVNode(D,{remote:"",ref_key:"$table",ref:r,"checked-row-keys":b.value,"onUpdate:checkedRowKeys":k[0]||(k[0]=I=>b.value=I),"max-height":x.value,loading:s.value,bordered:!1,"single-line":!1,columns:_.value,data:u.value,pagination:P.value,"row-key":I=>I[t.idField]},null,8,["checked-row-keys","max-height","loading","columns","data","pagination","row-key"])])]),_:3})}}}),O=t=>{const a=t;return a.install=function(r){r.component(a.__name,t)},t},U=O(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:i=>{i.sort((h,m)=>(m.meta.affix?1:0)-(h.meta.affix?1:0)),t.tabs=i},addTab:i=>Ce.includes(i.name)?!1:(t.tabs?.some(m=>m.fullPath==i.fullPath)||t.tabs?.push(i),!0),closeCurrentTab:i=>{const h=t.tabs.findIndex(m=>m.fullPath==i.fullPath);t.tabs.splice(h,1)},closeAllTabs:()=>{t.tabs=t.tabs.filter(i=>i?.meta?.affix??!1)},closeOtherTabs:i=>{t.tabs=t.tabs.filter(h=>h.fullPath==i.fullPath||(h?.meta?.affix??!1))},closeLeftTabs:i=>{const h=t.tabs.findIndex(m=>m.fullPath==i.fullPath);t.tabs=t.tabs.filter((m,$)=>$>=h||(m?.meta?.affix??!1))},closeRightTabs:i=>{const h=t.tabs.findIndex(m=>m.fullPath==i.fullPath);t.tabs=t.tabs.filter((m,$)=>$<=h||(m?.meta?.affix??!1))},collapse:()=>{t.collapsed=!t.collapsed},setTitle:i=>{t.title=i},setLogo:i=>{t.logo=i},setUser:(i,h)=>{t.uid=i,t.uname=h},setSettingPages:i=>{t.settingPages=i},setLogout:i=>{t.logout=i},enableLanguage:i=>{t.enableLanguage=i}}}),Ne={class:"logo"},xe=e.defineComponent({__name:"PLogo",setup(t){const a=j();return(r,g)=>(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 r=t.__vccOpts||t;for(const[g,p]of a)r[g]=p;return r},Pe=M(xe,[["__scopeId","data-v-e48aeefa"]]),Ve={translationApiUrl:"https://translate.zvo.cn/api",defaultLanguage:"chinese",currentLanguage:"",options:[],initLanguages:async()=>[],selectLanguage:async t=>{}},v=J.defineStore("language",()=>{const t=e.ref(Ve),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 _=(await a()).find(c=>c.key===l);_&&(t.value.currentLanguage=_.key,t.value.selectLanguage(_))},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}}}),Be={key:1},ee=e.defineComponent({__name:"PLanguage",setup(t){const{select:a,getLanguages:r,getCurrentLanguage:g,getDefaultLanguage:p,getTranslationApiUrl:s}=v(),b=e.ref(),u=e.ref([]),P=async l=>await a(l),C=async()=>{const l=window.translate;l&&(l.selectLanguageTag.show=!1,l.selectLanguageTag.languages=(await r()).map(_=>_.key).join(","),l.ignore.class.push("ignore-translate-flag"),l.ignore.id.push("ignore-translation"),l.language.setLocal(p()),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(),b.value=await g(),u.value=await r()}),(l,_)=>{const c=o.NIcon,V=o.NButton;return u.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:P,options:u.value},{default:e.withCtx(()=>[e.createVNode(V,{quaternary:"",type:"info"},{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createElementBlock("label",Be,e.toDisplayString(b.value?.label),1)):(e.openBlock(),e.createBlock(c,{key:0,size:"18"},{default:e.withCtx(()=>[..._[0]||(_[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(),r=o.useDialog(),g=j(),p=R.useRouter(),s=R.useRoute(),b=e.inject("reloadPage"),u=i=>p.push({name:i}),P=e.computed(()=>C(s.matched)),C=i=>i.map(h=>{const m={key:h.name,label:h.meta.title,icon:h.meta.icon,meta:h.meta,disabled:h.path==="/",children:void 0};return h.children&&h.children.length>0&&(m.children=C(h.children)),m}),l=e.ref(!1),_=()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),l.value=!1):(document.documentElement.requestFullscreen(),l.value=!0)},c=e.computed(()=>{const i=[];return i.push({label:"退出登录",key:"logout"}),g.state.settingPages&&g.state.settingPages.length>0&&g.state.settingPages.forEach(h=>{i.push({label:h.title,key:h.route})}),i}),V=i=>{i==="logout"?T():p.push({name:i})},T=()=>{r.info({title:"提示",content:"您确定要退出登录吗",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(g.state.logout)try{await g.state.logout(),localStorage.removeItem("TABS-ROUTES"),a.error("退出成功")}catch(i){console.error(i),a.error("退出登录失败")}finally{location.reload()}else a.error("没有配置登出接口, 请配置[usePLayoutStore.logout]方法")},onNegativeClick:()=>{}})};return(i,h)=>{const m=o.NTooltip,$=o.NDivider,B=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:h[0]||(h[0]=(...x)=>e.unref(g).collapse&&e.unref(g).collapse(...x))},[e.unref(g).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:h[1]||(h[1]=(...x)=>e.unref(b)&&e.unref(b)(...x))},[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(P.value,x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x.label},[x.label?(e.openBlock(),e.createBlock(e.unref(o.NBreadcrumbItem),{key:0},{default:e.withCtx(()=>[x.children&&x.children.length?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,options:x.children,onSelect:u},{default:e.withCtx(()=>[e.createElementVNode("span",Ee,[x.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(x.label),1)])]),_:2},1032,["options"])):(e.openBlock(),e.createElementBlock("span",Te,[x.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(x.label),1)]))]),_:2},1024)):e.createCommentVNode("",!0)],64))),128))]),_:1})]),e.createElementVNode("div",$e,[e.unref(g).state.enableLanguage?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(ee)])):e.createCommentVNode("",!0),e.createElementVNode("div",De,[e.createVNode(m,{placement:"bottom"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",onClick:e.withModifiers(_,["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(()=>[h[2]||(h[2]=e.createElementVNode("span",null,"全屏",-1))]),_:1})]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:V,options:c.value},{default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("span",null,e.toDisplayString(e.unref(g).state.uname),1),e.createVNode($,{vertical:""}),e.createVNode(B,{round:"",src:e.unref(g).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,r)=>{const g=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock("div",ze,[t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g,{key:0},{default:e.withCtx(({Component:p,route:s})=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p),{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=>({v141ddb06:r.value,cf709148:g.value}));const a=o.useThemeVars(),r=e.computed(()=>a.value.cardColor),g=e.computed(()=>a.value.textColor1),p=o.useMessage(),s=R.useRoute(),b=R.useRouter(),u=e.ref(null),P=e.ref(null),C=e.ref(!1),l=j(),_=e.computed(()=>l.state.tabs),c=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:d,hash:f,meta:L,name:z,params:K,path:Y,query:X}=n;return{fullPath:d,hash:f,meta:L,name:z,params:K,path:Y,query:X}},i=e.computed(()=>{const f=l.state.collapsed?"64px":"272px";return{left:f,width:`calc(100% - ${f})`}}),h=e.computed(()=>{const n=_.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)})}]}),m=()=>{let n=[];const d=T(s);try{if(l.state.cacheTabs){const f=localStorage.getItem("TABS_ROUTES");n=f?JSON.parse(f):[d]}}catch{n=[d]}finally{return n}},$=n=>{const d=b.getRoutes();n.forEach(f=>{const L=d.find(z=>z.path===f.path);L&&(f.meta=L.meta||f.meta,f.name=L.name||f.name)}),l.state.cacheTabs&&localStorage.setItem("TABS_ROUTES",JSON.stringify(n))},B=()=>{const n=m();$(n),l.initTabs(n)},x=async n=>{if(await e.nextTick(),!u.value)return;const d=u.value.offsetWidth,f=u.value.scrollWidth;d<f?(c.scrollable=!0,n&&[...u.value.querySelectorAll(".tabs-card-scroll-item")||[]].forEach(z=>{z.id===`tag${c.activeKey.split("/").join("/")}`&&z.scrollIntoView&&z.scrollIntoView()})):c.scrollable=!1},W=n=>!(n.draggedContext.element.meta.affix||n.relatedContext.element.meta.affix),Z=()=>{let n;n=he(),n.listenTo(P.value,()=>x(!0))},y=n=>{const{fullPath:d}=n;if(d===s.fullPath||(c.activeKey=d,!n))return;const{replace:f}=b;toString.call(n),f(n).catch(console.error)},k=(n,d)=>{n.preventDefault(),C.value=d.path==="/home",c.showDropdown=!1,e.nextTick().then(()=>{c.showDropdown=!0,c.dropdownX=n.clientX,c.dropdownY=n.clientY})},N=()=>{if(s.meta.keepAlive){var n=b.currentRoute.value.matched.find(d=>d.name==s.name);n&&n.components?.default?.name}},S=n=>{if(_.value.length===1)return p.warning("这已经是最后一页,不能再关闭了!");if(N(),l.closeCurrentTab(n),c.activeKey===n.fullPath){const d=_.value[Math.max(0,_.value.length-1)];c.activeKey=d.fullPath,b.push(d)}x()},D=n=>{const{fullPath:d}=n,f=_.value.find(L=>L.fullPath==d);S(f)},I=n=>{l.closeOtherTabs(n),c.activeKey=n.fullPath,b.replace(n.fullPath),x()},H=()=>{l.closeAllTabs(),x()},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}x(),c.showDropdown=!1},q=(n,d)=>{const f=u.value.scrollLeft,L=d>0&&f+d>=n||d<0&&f+d<=n?n:f+d;if(u.value&&u.value.scrollTo(L,0),L!==n)return window.requestAnimationFrame(()=>q(n,d))},G=()=>{const n=u.value.offsetWidth,d=u.value.scrollLeft;if(!d)return;const f=d>n?d-n:0;q(f,(f-d)/20)},Q=()=>{const n=u.value.offsetWidth,d=u.value.scrollWidth,f=u.value.scrollLeft;if(d-f<=n)return;const L=d-f>n*2?f+n:d-n;q(L,(L-f)/20)};return window.addEventListener("beforeunload",()=>{localStorage.setItem("TABS_ROUTES",JSON.stringify(_.value))}),window.addEventListener("scroll",n=>{let d=n.target.scrollTop||document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop;c.isMultiHeaderFixed=d>=64},!0),e.watch(()=>s.fullPath,n=>{V.includes(s.name)||(c.activeKey=n,l.addTab(T(s)),x(!0))},{immediate:!0}),B(),e.onMounted(()=>Z()),(n,d)=>(e.openBlock(),e.createElementBlock("div",{class:"box-border tabs-view tabs-view-fix tabs-view-default-background",style:e.normalizeStyle(i.value)},[e.createElementVNode("div",qe,[e.createElementVNode("div",{ref_key:"navWrap",ref:P,class:e.normalizeClass(["tabs-card",{"tabs-card-scrollable":c.scrollable}])},[e.createElementVNode("span",{class:e.normalizeClass(["tabs-card-prev",{"tabs-card-prev-hide":!c.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":!c.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:u,class:"tabs-card-scroll"},[e.createVNode(e.unref(_e),{list:_.value,animation:"300","item-key":"fullPath",class:"flex",move:W},{item:e.withCtx(({element:f})=>[e.createElementVNode("div",{id:`tag${f.fullPath.split("/").join("/")}`,class:e.normalizeClass(["tabs-card-scroll-item",{"active-item":c.activeKey===f.fullPath}]),onClick:e.withModifiers(L=>y(f),["stop"]),onContextmenu:L=>k(L,f)},[e.createElementVNode("span",null,e.toDisplayString(f.meta.title),1),f.meta.affix?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"14",onClick:e.withModifiers(L=>D(f),["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:h.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:c.showDropdown,x:c.dropdownX,y:c.dropdownY,onClickoutside:d[0]||(d[0]=f=>c.showDropdown=!1),placement:"bottom-start",onSelect:F,options:h.value},null,8,["show","x","y","options"])])],4))}}),[["__scopeId","data-v-48b3be2d"]]),Ke=e.defineComponent({__name:"PMenus",setup(t){const a=R.useRoute(),r=R.useRouter(),g=j(),p=e.ref(a.name),s=e.ref(a.matched&&a.matched.length?a.matched.map(c=>c.name):[]),b=e.ref([]),u=c=>{/http(s)?:/.test(c)?window.open(c):r.push({name:c})},P=c=>{if(!c)return;const V=c.find(T=>s.value.indexOf(T)===-1);s.value=V?[V]:[]},C=()=>{const c=a.matched;s.value=c.map(T=>T.name);const V=a.meta?.activeMenu||"";p.value=V||a.name},l=(c,V=[],T=!1)=>{const i=[],h=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!c||c.length===0)return i;c=c.sort((m,$)=>{let B=($.children?.length?1:0)-(m.children?.length?1:0);return B===0&&(B=(m.meta?.sort??0)-($.meta?.sort??0)),B});for(const m of c){if(T||(m.meta?.hidden||!1)==!0||h.includes(m.path)){V.push(m.name),m.children&&m.children.length>0&&l(m.children,V,!0);continue}const $=m.meta?.alwaysShow!=!0&&m?.children?.filter(W=>!W?.meta?.hidden)?.length===1,B=$?m.children[0]:m,x={key:B.name,label:B.meta?.title,affix:B.meta?.affix,sort:B.meta?.sort,path:B.path,redirect:B.redirect,icon:$?m.meta?.icon:B.meta?.icon,permissions:B.meta?.permissions,meta:B.meta,children:void 0};if(!V.includes(m.name)){if(i.push(x),V.push(m.name),$){l(m.children,V,T);continue}m.children&&m.children.length>0&&(x.children=l(m.children,V,T))}}return i},_=()=>{const c=r.getRoutes();b.value=l(c)};return e.watch(()=>a.fullPath,()=>{C()}),e.onMounted(()=>{_(),C()}),(c,V)=>(e.openBlock(),e.createBlock(e.unref(o.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:b.value,collapsed:e.unref(g).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":s.value,value:p.value,"onUpdate:value":u,"onUpdate:expandedKeys":P},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(),r=e.ref(!1),g=()=>{r.value=!0,e.nextTick(()=>r.value=!1)};return e.provide("reloadPage",g),(p,s)=>{const b=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:r.value},null,8,["loading"])])])]),_:1}),e.createVNode(b,{right:20,class:"z-50"})]),_:1})]),_:1})}}}),[["__scopeId","data-v-0bac2e7d"]]),Ze={};function Ge(t,a){const r=e.resolveComponent("router-view");return e.openBlock(),e.createBlock(r)}const te=O(M(Ze,[["render",Ge]])),oe=O(Je),ne=O(e.defineComponent({__name:"PApplication",props:{theme:{},themeOverrides:{default:{common:{primaryColor:"#2d8cf0",primaryColorHover:"#3c9bff",primaryColorPressed:"#3c9bff",primaryColorSuppl:"#2d8cf0"},LoadingBar:{colorLoading:"#2d8cf0"}}}},setup(t){return(a,r)=>{const g=o.NConfigProvider;return e.openBlock(),e.createBlock(g,{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=O(e.defineComponent({__name:"PModal",props:{saveBtnText:{default:"保存"},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:r}){const g=o.useMessage(),p=t,s=r,b=async()=>{s("update:loading",!0);try{p.onSave&&await p.onSave()&&u()}catch(_){g.error(_.message)}finally{s("update:loading",!1)}},u=()=>{s("update:visible",!1),s("update:loading",!1)},P=async()=>{try{p.onClose?await p.onClose()&&u():u()}catch(_){g.error(_.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)}}),(_,c)=>{const V=o.NText,T=o.NButton,i=o.NSpace;return e.openBlock(),e.createBlock(e.unref(o.NModal),e.mergeProps({ref:"$modal",preset:"card"},_.$attrs,{"header-class":"bg-gray-50",show:p.visible,draggable:!0,closable:!1,"close-on-esc":!1,"mask-closable":!1,bordered:!1,style:{width:`${p.width}px`},onClose:u}),{header:e.withCtx(()=>[_.$slots.header?e.renderSlot(_.$slots,"header",{key:0}):p.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(_.$slots,"header-extra")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:"overflow-y-auto overflow-hidden mt-5",style:e.normalizeStyle({maxHeight:`${p.height}px`})},[e.renderSlot(_.$slots,"default")],4)]),footer:e.withCtx(()=>[e.renderSlot(_.$slots,"footer")]),action:e.withCtx(()=>[e.createVNode(i,{justify:"end"},{default:e.withCtx(()=>[e.createVNode(T,{type:"primary",loading:t.loading,onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveBtnText),1)]),_:1},8,["loading"]),e.renderSlot(_.$slots,"action-extra",{loading:t.loading}),e.createVNode(T,{onClick:P,loading:t.loading},{default:e.withCtx(()=>[...c[0]||(c[0]=[e.createTextVNode("取消",-1)])]),_:1},8,["loading"])]),_:3})]),_:3},16,["show","style"])}}})),le=O(ee),Qe=e.defineComponent({name:"Redirect",setup(){const t=R.useRoute(),a=R.useRouter();return e.onBeforeMount(()=>{const{params:r,query:g}=t,{path:p}=r;a.replace({path:"/"+(Array.isArray(p)?p.join("/"):p),query:g})}),()=>React.createElement(o.NEmpty,null)}}),se=O(Qe),Ue={class:"frame"},ve=["src"],ce=O(M(e.defineComponent({__name:"PIframe",setup(t){const a=R.useRoute(),r=e.ref(!1),g=e.ref(null),p=e.ref("");e.unref(a.meta)?.frameSrc&&(p.value=e.unref(a.meta)?.frameSrc);function s(){r.value=!1}function b(){e.nextTick(()=>{const u=e.unref(g);if(!u)return;const P=u;P.attachEvent?P.attachEvent("onload",()=>{s()}):u.onload=()=>{s()}})}return e.onMounted(()=>{r.value=!0,b()}),(u,P)=>{const C=o.NSpin;return e.openBlock(),e.createBlock(C,{show:r.value},{default:e.withCtx(()=>[e.createElementVNode("div",Ue,[e.createElementVNode("iframe",{src:p.value,class:"frame-iframe",ref_key:"frameRef",ref:g},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=O(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(r,g)=>{const p=o.NIcon,s=o.NAvatar,b=o.NSpace,u=o.NCard;return e.openBlock(),e.createElementBlock("div",et,[a.title?(e.openBlock(),e.createBlock(u,{key:0,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.createVNode(b,{align:"center",justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(b,{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(p,{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),r.$slots.search?(e.openBlock(),e.createBlock(u,{key:1,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"search")]),_:3})):e.createCommentVNode("",!0),r.$slots.default?(e.openBlock(),e.createBlock(u,{key:2,bordered:!1,"content-class":"!py-0"},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3})):e.createCommentVNode("",!0)])}}})),nt={},at={class:"flex flex-col justify-center page-container"};function lt(t,a){const r=o.NResult;return e.openBlock(),e.createElementBlock("div",at,[e.createVNode(r,{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 r=o.NResult;return e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(r,{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 r=o.NResult;return e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(r,{status:"403",title:"禁止访问",description:"抱歉,你无权访问该页面"})])}const gt=M(ft,[["render",mt],["__scopeId","data-v-3baa9c16"]]),ie=O(st),de=O(dt),fe=O(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,b)=>await t.error?.(s,b)}}),ut={class:"view-auth-callback"},me=O(M(e.defineComponent({__name:"POidc",setup(t){const a=R.useRouter(),{callCallback:r,callError:g}=pe();return e.onMounted(async()=>{try{await r(a)}catch(p){await g(a,p)}}),(p,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(r=>{r.install&&t.use(r)}),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,L,J,R,he,_e){"use strict";const ye={class:"text-lg font-medium"},be={id:"data-content"},ke={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),g=o.useDialog(),d=o.useMessage(),s=e.ref(!1),b=e.ref([]),u=e.ref([]),P=e.ref({page:1,itemCount:0,pageSize:10,pageSizes:[10,20,30,50],showSizePicker:!0,onChange:async y=>{P.value.page=y,await V()},onUpdatePageSize:async y=>{P.value.pageSize=y,await V()}}),C=t,l=y=>{const k=N=>{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(N)}})}),S};return{title:"操作",key:"actions",width:100,fixed:"right",render:N=>{let S=[];if(C.onEdit&&S.push({label:"编辑",key:"edit",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.EditOutlined)}),props:{onClick:async()=>await C.onEdit(N)}}),C.onDelete&&S.push({label:"删除",key:"delete",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.DeleteOutlined)}),props:{onClick:()=>B(N)}}),S=[...S,...k(N)],!(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(L.MoreOutlined))]})})}}},_=e.computed(()=>{const y=C.columns.filter(N=>N.key!="action").map(N=>({title:N.title,key:N.key,width:N.width,fixed:N.fixed??!1,render:N.render,ellipsis:N.ellipsis?{tooltip:!0}:!1})),k=C.columns.reduce((N,S)=>S.key==="action"?S:N,void 0)?.action;return k&&k?.length>0||C.onEdit||C.onDelete?[{type:"selection",fixed:"left"},...y,l(k)]:[{type:"selection",fixed:"left"},...y]}),i=async()=>await V(),B=y=>r([y]),T=()=>{const y=h();r(y)},r=y=>{y&&y.length>0&&g.warning({title:"警告",content:"删除数据不可恢复, 确认删除吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(C.onDelete)try{await C.onDelete(y)?(V(),d.success("删除成功")):d.error("删除失败")}catch(k){d.error(k.message)}}})},h=()=>b.value?u.value.filter(k=>b.value.includes(k.id)).map(k=>e.toRaw(k)):[],m=()=>h()[0],$=()=>e.toRaw(u.value),V=async()=>{if(!s.value){s.value=!0;try{if(C.onLoad){var{data:y,total:k}=await C.onLoad(P.value.page,P.value.pageSize);u.value=y,P.value.itemCount=k}}catch(N){d.error(N.message)}finally{s.value=!1}}},x=e.computed(()=>{const y=e.unref(c);if(!y)return;const k=y?.$el,N=k.querySelector(".n-data-table-thead "),{bottomIncludeBody:S}=Z(N),O=48;let I=12,H=24;const A=k.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 k=document.documentElement,N=k.scrollLeft,S=k.scrollTop,O=k.clientLeft,I=k.clientTop,H=window.pageXOffset,A=window.pageYOffset,F=W(y),{left:q,top:G,width:Q,height:n}=F,f=(H||N)-(O||0),p=(A||S)-(I||0),E=q+H,z=G+A,K=E-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 V()),a({getData:$,getSelectedRow:m,getSelectedRows:h,refreshData:V,resetPage:()=>{P.value.page=1}}),(y,k)=>{const N=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(N,{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(L.PlusSquareOutlined))]),_:1},8,["onClick"])]),default:e.withCtx(()=>[k[1]||(k[1]=e.createElementVNode("span",null,"新增",-1))]),_:1})):e.createCommentVNode("",!0),C.onDelete?(e.openBlock(),e.createBlock(N,{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(L.DeleteOutlined))]),_:1})]),default:e.withCtx(()=>[k[2]||(k[2]=e.createElementVNode("span",null,"删除",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(N,{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(L.ReloadOutlined))]),_:1})]),default:e.withCtx(()=>[k[3]||(k[3]=e.createElementVNode("span",null,"刷新",-1))]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",be,[y.$slots.toolbar?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(y.$slots,"toolbar")])):e.createCommentVNode("",!0),e.createVNode(O,{remote:"",ref_key:"$table",ref:c,"checked-row-keys":b.value,"onUpdate:checkedRowKeys":k[0]||(k[0]=I=>b.value=I),"max-height":x.value,loading:s.value,bordered:!1,"single-line":!1,columns:_.value,data:u.value,pagination:P.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((h,m)=>(m.meta.affix?1:0)-(h.meta.affix?1:0)),t.tabs=r},addTab:r=>Ce.includes(r.name)?!1:(t.tabs?.some(m=>m.fullPath==r.fullPath)||t.tabs?.push(r),!0),closeCurrentTab:r=>{const h=t.tabs.findIndex(m=>m.fullPath==r.fullPath);t.tabs.splice(h,1)},closeAllTabs:()=>{t.tabs=t.tabs.filter(r=>r?.meta?.affix??!1)},closeOtherTabs:r=>{t.tabs=t.tabs.filter(h=>h.fullPath==r.fullPath||(h?.meta?.affix??!1))},closeLeftTabs:r=>{const h=t.tabs.findIndex(m=>m.fullPath==r.fullPath);t.tabs=t.tabs.filter((m,$)=>$>=h||(m?.meta?.affix??!1))},closeRightTabs:r=>{const h=t.tabs.findIndex(m=>m.fullPath==r.fullPath);t.tabs=t.tabs.filter((m,$)=>$<=h||(m?.meta?.affix??!1))},collapse:()=>{t.collapsed=!t.collapsed},setTitle:r=>{t.title=r},setLogo:r=>{t.logo=r},setUser:(r,h)=>{t.uid=r,t.uname=h},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,g)=>(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[g,d]of a)c[g]=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 _=(await a()).find(i=>i.key===l);_&&(t.value.currentLanguage=_.key,t.value.selectLanguage(_))},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:g,getDefaultLanguage:d,getTranslationApiUrl:s}=v(),b=e.ref(),u=e.ref([]),P=async l=>await a(l),C=async()=>{const l=window.translate;l&&(l.selectLanguageTag.show=!1,l.selectLanguageTag.languages=(await c()).map(_=>_.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(),b.value=await g(),u.value=await c()}),(l,_)=>{const i=o.NIcon,B=o.NButton;return u.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:P,options:u.value},{default:e.withCtx(()=>[e.createVNode(B,{quaternary:"",type:"info"},{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createElementBlock("label",Ve,e.toDisplayString(b.value?.label),1)):(e.openBlock(),e.createBlock(i,{key:0,size:"18"},{default:e.withCtx(()=>[..._[0]||(_[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"},Ee={class:"layout-header-left"},Le={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(),g=j(),d=R.useRouter(),s=R.useRoute(),b=e.inject("reloadPage"),u=r=>d.push({name:r}),P=e.computed(()=>C(s.matched)),C=r=>r.map(h=>{const m={key:h.name,label:h.meta.title,icon:h.meta.icon,meta:h.meta,disabled:h.path==="/",children:void 0};return h.children&&h.children.length>0&&(m.children=C(h.children)),m}),l=e.ref(!1),_=()=>{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"}),g.state.settingPages&&g.state.settingPages.length>0&&g.state.settingPages.forEach(h=>{r.push({label:h.title,key:h.route})}),r}),B=r=>{r==="logout"?T():d.push({name:r})},T=()=>{c.info({title:"提示",content:"您确定要退出登录吗",positiveText:"确定",negativeText:"取消",onPositiveClick:async()=>{if(g.state.logout)try{await g.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,h)=>{const m=o.NTooltip,$=o.NDivider,V=o.NAvatar;return e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",Ee,[e.createElementVNode("div",{class:"ml-1 layout-header-trigger layout-header-trigger-min",onClick:h[0]||(h[0]=(...x)=>e.unref(g).collapse&&e.unref(g).collapse(...x))},[e.unref(g).state.collapsed?(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:0,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.MenuUnfoldOutlined))]),_:1})):(e.openBlock(),e.createBlock(e.unref(o.NIcon),{key:1,size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.MenuFoldOutlined))]),_:1}))]),e.createElementVNode("div",{class:"mr-1 layout-header-trigger layout-header-trigger-min",onClick:h[1]||(h[1]=(...x)=>e.unref(b)&&e.unref(b)(...x))},[e.createVNode(e.unref(o.NIcon),{size:"18"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.ReloadOutlined))]),_:1})]),e.createVNode(e.unref(o.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x.label},[x.label?(e.openBlock(),e.createBlock(e.unref(o.NBreadcrumbItem),{key:0},{default:e.withCtx(()=>[x.children&&x.children.length?(e.openBlock(),e.createBlock(e.unref(o.NDropdown),{key:0,options:x.children,onSelect:u},{default:e.withCtx(()=>[e.createElementVNode("span",Le,[x.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(x.label),1)])]),_:2},1032,["options"])):(e.openBlock(),e.createElementBlock("span",Te,[x.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.icon),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(x.label),1)]))]),_:2},1024)):e.createCommentVNode("",!0)],64))),128))]),_:1})]),e.createElementVNode("div",$e,[e.unref(g).state.enableLanguage?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(ee)])):e.createCommentVNode("",!0),e.createElementVNode("div",De,[e.createVNode(m,{placement:"bottom"},{trigger:e.withCtx(()=>[e.createVNode(e.unref(o.NIcon),{size:"18",onClick:e.withModifiers(_,["stop"])},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createBlock(e.unref(L.FullscreenExitOutlined),{key:1})):(e.openBlock(),e.createBlock(e.unref(L.FullscreenOutlined),{key:0}))]),_:1})]),default:e.withCtx(()=>[h[2]||(h[2]=e.createElementVNode("span",null,"全屏",-1))]),_:1})]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(o.NDropdown),{trigger:"hover",onSelect:B,options:i.value},{default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("span",null,e.toDisplayString(e.unref(g).state.uname),1),e.createVNode($,{vertical:""}),e.createVNode(V,{round:"",src:e.unref(g).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 g=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock("div",ze,[t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g,{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=>({v141ddb06:c.value,cf709148:g.value}));const a=o.useThemeVars(),c=e.computed(()=>a.value.cardColor),g=e.computed(()=>a.value.textColor1),d=o.useMessage(),s=R.useRoute(),b=R.useRouter(),u=e.ref(null),P=e.ref(null),C=e.ref(!1),l=j(),_=e.computed(()=>l.state.tabs),i=e.reactive({activeKey:s.fullPath,scrollable:!0,dropdownX:0,dropdownY:0,showDropdown:!1,isMultiHeaderFixed:!0,multiTabsSetting:!0}),B=["Login","Redirect","ErrorPage"],T=n=>{const{fullPath:f,hash:p,meta:E,name:z,params:K,path:Y,query:X}=n;return{fullPath:f,hash:p,meta:E,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})`}}),h=e.computed(()=>{const n=_.value.length<=1;return[{label:"刷新当前",key:"1",icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.ReloadOutlined)})},{label:"关闭当前",key:"2",disabled:C.value||n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.CloseOutlined)})},{label:"关闭其他",key:"3",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.ColumnWidthOutlined)})},{label:"关闭全部",key:"4",disabled:n,icon:()=>e.h(o.NIcon,null,{default:()=>e.h(L.MinusOutlined)})}]}),m=()=>{let n=[];const f=T(s);try{if(l.state.cacheTabs){const p=localStorage.getItem("TABS_ROUTES");n=p?JSON.parse(p):[f]}}catch{n=[f]}finally{return n}},$=n=>{const f=b.getRoutes();n.forEach(p=>{const E=f.find(z=>z.path===p.path);E&&(p.meta=E.meta||p.meta,p.name=E.name||p.name)}),l.state.cacheTabs&&localStorage.setItem("TABS_ROUTES",JSON.stringify(n))},V=()=>{const n=m();$(n),l.initTabs(n)},x=async n=>{if(await e.nextTick(),!u.value)return;const f=u.value.offsetWidth,p=u.value.scrollWidth;f<p?(i.scrollable=!0,n&&[...u.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(P.value,()=>x(!0))},y=n=>{const{fullPath:f}=n;if(f===s.fullPath||(i.activeKey=f,!n))return;const{replace:p}=b;toString.call(n),p(n).catch(console.error)},k=(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})},N=()=>{if(s.meta.keepAlive){var n=b.currentRoute.value.matched.find(f=>f.name==s.name);n&&n.components?.default?.name}},S=n=>{if(_.value.length===1)return d.warning("这已经是最后一页,不能再关闭了!");if(N(),l.closeCurrentTab(n),i.activeKey===n.fullPath){const f=_.value[Math.max(0,_.value.length-1)];i.activeKey=f.fullPath,b.push(f)}x()},O=n=>{const{fullPath:f}=n,p=_.value.find(E=>E.fullPath==f);S(p)},I=n=>{l.closeOtherTabs(n),i.activeKey=n.fullPath,b.replace(n.fullPath),x()},H=()=>{l.closeAllTabs(),x()},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}x(),i.showDropdown=!1},q=(n,f)=>{const p=u.value.scrollLeft,E=f>0&&p+f>=n||f<0&&p+f<=n?n:p+f;if(u.value&&u.value.scrollTo(E,0),E!==n)return window.requestAnimationFrame(()=>q(n,f))},G=()=>{const n=u.value.offsetWidth,f=u.value.scrollLeft;if(!f)return;const p=f>n?f-n:0;q(p,(p-f)/20)},Q=()=>{const n=u.value.offsetWidth,f=u.value.scrollWidth,p=u.value.scrollLeft;if(f-p<=n)return;const E=f-p>n*2?p+n:f-n;q(E,(E-p)/20)};return window.addEventListener("beforeunload",()=>{localStorage.setItem("TABS_ROUTES",JSON.stringify(_.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=>{B.includes(s.name)||(i.activeKey=n,l.addTab(T(s)),x(!0))},{immediate:!0}),V(),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:P,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(L.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(L.RightOutlined))]),_:1})],2),e.createElementVNode("div",{ref_key:"navScroll",ref:u,class:"tabs-card-scroll"},[e.createVNode(e.unref(_e),{list:_.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(E=>y(p),["stop"]),onContextmenu:E=>k(E,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(E=>O(p),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(L.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:h.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(L.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:h.value},null,8,["show","x","y","options"])])],4))}}),[["__scopeId","data-v-48b3be2d"]]),Ke=e.defineComponent({__name:"PMenus",setup(t){const a=R.useRoute(),c=R.useRouter(),g=j(),d=e.ref(a.name),s=e.ref(a.matched&&a.matched.length?a.matched.map(i=>i.name):[]),b=e.ref([]),u=i=>{/http(s)?:/.test(i)?window.open(i):c.push({name:i})},P=i=>{if(!i)return;const B=i.find(T=>s.value.indexOf(T)===-1);s.value=B?[B]:[]},C=()=>{const i=a.matched;s.value=i.map(T=>T.name);const B=a.meta?.activeMenu||"";d.value=B||a.name},l=(i,B=[],T=!1)=>{const r=[],h=["/:path(.*)*","/redirect","/redirect/:path(.*)","/login","/oidc-callback"];if(!i||i.length===0)return r;i=i.sort((m,$)=>{let V=($.children?.length?1:0)-(m.children?.length?1:0);return V===0&&(V=(m.meta?.sort??0)-($.meta?.sort??0)),V});for(const m of i){if(T||(m.meta?.hidden||!1)==!0||h.includes(m.path)){B.push(m.name),m.children&&m.children.length>0&&l(m.children,B,!0);continue}const $=m.meta?.alwaysShow!=!0&&m?.children?.filter(W=>!W?.meta?.hidden)?.length===1,V=$?m.children[0]:m,x={key:V.name,label:V.meta?.title,affix:V.meta?.affix,sort:V.meta?.sort,path:V.path,redirect:V.redirect,icon:$?m.meta?.icon:V.meta?.icon,permissions:V.meta?.permissions,meta:V.meta,children:void 0};if(!B.includes(m.name)){if(r.push(x),B.push(m.name),$){l(m.children,B,T);continue}m.children&&m.children.length>0&&(x.children=l(m.children,B,T))}}return r},_=()=>{const i=c.getRoutes();b.value=l(i)};return e.watch(()=>a.fullPath,()=>{C()}),e.onMounted(()=>{_(),C()}),(i,B)=>(e.openBlock(),e.createBlock(e.unref(o.NMenu),{class:"h-full",inverted:"",mode:"vertical",options:b.value,collapsed:e.unref(g).state.collapsed,"collapsed-width":64,"collapsed-icon-size":20,indent:24,"expanded-keys":s.value,value:d.value,"onUpdate:value":u,"onUpdate:expandedKeys":P},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),g=()=>{c.value=!0,e.nextTick(()=>c.value=!1)};return e.provide("reloadPage",g),(d,s)=>{const b=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(b,{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 g=o.NConfigProvider;return e.openBlock(),e.createBlock(g,{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 g=o.useMessage(),d=t,s=c,b=async()=>{s("update:loading",!0);try{d.onSave&&await d.onSave()&&u()}catch(_){g.error(_.message)}finally{s("update:loading",!1)}},u=()=>{s("update:visible",!1),s("update:loading",!1)},P=async()=>{try{d.onClose?await d.onClose()&&u():u()}catch(_){g.error(_.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)}}),(_,i)=>{const B=o.NText,T=o.NButton,r=o.NSpace;return e.openBlock(),e.createBlock(e.unref(o.NModal),e.mergeProps({ref:"$modal",preset:"card"},_.$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:u}),{header:e.withCtx(()=>[_.$slots.header?e.renderSlot(_.$slots,"header",{key:0}):d.title?(e.openBlock(),e.createBlock(B,{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})):e.createCommentVNode("",!0)]),"header-extra":e.withCtx(()=>[e.renderSlot(_.$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(_.$slots,"default")],4)]),footer:e.withCtx(()=>[e.renderSlot(_.$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:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.saveBtnText),1)]),_:1},8,["loading"])),e.renderSlot(_.$slots,"action-extra",{loading:t.loading}),d.hideCancelBtn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:1,onClick:P,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:g}=t,{path:d}=c;a.replace({path:"/"+(Array.isArray(d)?d.join("/"):d),query:g})}),()=>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),g=e.ref(null),d=e.ref("");e.unref(a.meta)?.frameSrc&&(d.value=e.unref(a.meta)?.frameSrc);function s(){c.value=!1}function b(){e.nextTick(()=>{const u=e.unref(g);if(!u)return;const P=u;P.attachEvent?P.attachEvent("onload",()=>{s()}):u.onload=()=>{s()}})}return e.onMounted(()=>{c.value=!0,b()}),(u,P)=>{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:g},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:()=>L.AlertOutlined},title:{type:String,required:!0},subtitle:{type:String,required:!1}},setup(t){const a=t;return(c,g)=>{const d=o.NIcon,s=o.NAvatar,b=o.NSpace,u=o.NCard;return e.openBlock(),e.createElementBlock("div",et,[a.title?(e.openBlock(),e.createBlock(u,{key:0,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.createVNode(b,{align:"center",justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(b,{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(u,{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(u,{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,b)=>await t.error?.(s,b)}}),ut={class:"view-auth-callback"},me=D(M(e.defineComponent({__name:"POidc",setup(t){const a=R.useRouter(),{callCallback:c,callError:g}=pe();return e.onMounted(async()=>{try{await c(a)}catch(d){await g(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"}})}));
|
package/es/modal/PModal.d.ts
CHANGED
|
@@ -2114,6 +2114,9 @@ declare const __VLS_component: import('vue').DefineComponent<ModalProps, {
|
|
|
2114
2114
|
width: number;
|
|
2115
2115
|
height: number;
|
|
2116
2116
|
saveBtnText: string;
|
|
2117
|
+
cancelBtnText: string;
|
|
2118
|
+
hideCancelBtn: boolean;
|
|
2119
|
+
hideSaveBtn: boolean;
|
|
2117
2120
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
2118
2121
|
$modal: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
2119
2122
|
draggable: import('vue').PropType<boolean | import('naive-ui/es/modal/src/interface').ModalDraggableOptions>;
|
package/es/modal/PModal.vue.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { useMessage as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const H = /* @__PURE__ */
|
|
1
|
+
import { useMessage as C, NModal as b, NSpace as $, NButton as w, NText as x } from "naive-ui";
|
|
2
|
+
import { defineComponent as S, openBlock as d, createBlock as i, unref as k, mergeProps as N, withCtx as o, createVNode as T, createTextVNode as r, toDisplayString as c, createCommentVNode as f, renderSlot as s, createElementVNode as V, normalizeStyle as M } from "vue";
|
|
3
|
+
const H = /* @__PURE__ */ S({
|
|
4
4
|
__name: "PModal",
|
|
5
5
|
props: {
|
|
6
6
|
saveBtnText: { default: "保存" },
|
|
7
|
+
cancelBtnText: { default: "取消" },
|
|
8
|
+
hideCancelBtn: { type: Boolean, default: !1 },
|
|
9
|
+
hideSaveBtn: { type: Boolean, default: !1 },
|
|
7
10
|
title: {},
|
|
8
11
|
width: { default: 800 },
|
|
9
12
|
height: { default: 500 },
|
|
@@ -13,93 +16,95 @@ const H = /* @__PURE__ */ k({
|
|
|
13
16
|
onClose: {}
|
|
14
17
|
},
|
|
15
18
|
emits: ["update:visible", "update:loading"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
+
setup(l, { expose: p, emit: m }) {
|
|
20
|
+
const u = C(), t = l, a = m, h = async () => {
|
|
21
|
+
a("update:loading", !0);
|
|
19
22
|
try {
|
|
20
|
-
|
|
23
|
+
t.onSave && await t.onSave() && n();
|
|
21
24
|
} catch (e) {
|
|
22
|
-
|
|
25
|
+
u.error(e.message);
|
|
23
26
|
} finally {
|
|
24
|
-
|
|
27
|
+
a("update:loading", !1);
|
|
25
28
|
}
|
|
26
29
|
}, n = () => {
|
|
27
|
-
|
|
28
|
-
},
|
|
30
|
+
a("update:visible", !1), a("update:loading", !1);
|
|
31
|
+
}, y = async () => {
|
|
29
32
|
try {
|
|
30
|
-
|
|
33
|
+
t.onClose ? await t.onClose() && n() : n();
|
|
31
34
|
} catch (e) {
|
|
32
|
-
|
|
35
|
+
u.error(e.message), a("update:loading", !1);
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
|
-
return
|
|
38
|
+
return p({
|
|
36
39
|
open: () => {
|
|
37
|
-
|
|
40
|
+
a("update:visible", !0), a("update:loading", !1);
|
|
38
41
|
},
|
|
39
42
|
close: () => {
|
|
40
|
-
|
|
43
|
+
a("update:visible", !1), a("update:loading", !1);
|
|
41
44
|
}
|
|
42
|
-
}), (e,
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
+
}), (e, z) => {
|
|
46
|
+
const v = x, g = w, B = $;
|
|
47
|
+
return d(), i(k(b), N({
|
|
45
48
|
ref: "$modal",
|
|
46
49
|
preset: "card"
|
|
47
50
|
}, e.$attrs, {
|
|
48
51
|
"header-class": "bg-gray-50",
|
|
49
|
-
show:
|
|
52
|
+
show: t.visible,
|
|
50
53
|
draggable: !0,
|
|
51
54
|
closable: !1,
|
|
52
55
|
"close-on-esc": !1,
|
|
53
56
|
"mask-closable": !1,
|
|
54
57
|
bordered: !1,
|
|
55
|
-
style: { width: `${
|
|
58
|
+
style: { width: `${t.width}px` },
|
|
56
59
|
onClose: n
|
|
57
60
|
}), {
|
|
58
61
|
header: o(() => [
|
|
59
|
-
e.$slots.header ?
|
|
62
|
+
e.$slots.header ? s(e.$slots, "header", { key: 0 }) : t.title ? (d(), i(v, { key: 1 }, {
|
|
60
63
|
default: o(() => [
|
|
61
|
-
|
|
64
|
+
r(c(l.title), 1)
|
|
62
65
|
]),
|
|
63
66
|
_: 1
|
|
64
|
-
})) :
|
|
67
|
+
})) : f("", !0)
|
|
65
68
|
]),
|
|
66
69
|
"header-extra": o(() => [
|
|
67
|
-
|
|
70
|
+
s(e.$slots, "header-extra")
|
|
68
71
|
]),
|
|
69
72
|
default: o(() => [
|
|
70
73
|
V("div", {
|
|
71
74
|
class: "overflow-y-auto overflow-hidden mt-5",
|
|
72
|
-
style: M({ maxHeight: `${
|
|
75
|
+
style: M({ maxHeight: `${t.height}px` })
|
|
73
76
|
}, [
|
|
74
|
-
|
|
77
|
+
s(e.$slots, "default")
|
|
75
78
|
], 4)
|
|
76
79
|
]),
|
|
77
80
|
footer: o(() => [
|
|
78
|
-
|
|
81
|
+
s(e.$slots, "footer")
|
|
79
82
|
]),
|
|
80
83
|
action: o(() => [
|
|
81
|
-
|
|
84
|
+
T(B, { justify: "end" }, {
|
|
82
85
|
default: o(() => [
|
|
83
|
-
d(
|
|
86
|
+
t.hideSaveBtn ? f("", !0) : (d(), i(g, {
|
|
87
|
+
key: 0,
|
|
84
88
|
type: "primary",
|
|
85
|
-
loading:
|
|
86
|
-
onClick:
|
|
89
|
+
loading: l.loading,
|
|
90
|
+
onClick: h
|
|
87
91
|
}, {
|
|
88
92
|
default: o(() => [
|
|
89
|
-
|
|
93
|
+
r(c(l.saveBtnText), 1)
|
|
90
94
|
]),
|
|
91
95
|
_: 1
|
|
92
|
-
}, 8, ["loading"]),
|
|
93
|
-
|
|
94
|
-
d(
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
}, 8, ["loading"])),
|
|
97
|
+
s(e.$slots, "action-extra", { loading: l.loading }),
|
|
98
|
+
t.hideCancelBtn ? f("", !0) : (d(), i(g, {
|
|
99
|
+
key: 1,
|
|
100
|
+
onClick: y,
|
|
101
|
+
loading: l.loading
|
|
97
102
|
}, {
|
|
98
|
-
default: o(() => [
|
|
99
|
-
|
|
100
|
-
])
|
|
103
|
+
default: o(() => [
|
|
104
|
+
r(c(l.cancelBtnText), 1)
|
|
105
|
+
]),
|
|
101
106
|
_: 1
|
|
102
|
-
}, 8, ["loading"])
|
|
107
|
+
}, 8, ["loading"]))
|
|
103
108
|
]),
|
|
104
109
|
_: 3
|
|
105
110
|
})
|
package/es/modal/index.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export declare const PModalPlugin: {
|
|
|
13
13
|
width: number;
|
|
14
14
|
height: number;
|
|
15
15
|
saveBtnText: string;
|
|
16
|
+
cancelBtnText: string;
|
|
17
|
+
hideCancelBtn: boolean;
|
|
18
|
+
hideSaveBtn: boolean;
|
|
16
19
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
17
20
|
$modal: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
18
21
|
draggable: import('vue').PropType<boolean | import('naive-ui/es/modal/src/interface').ModalDraggableOptions>;
|
|
@@ -2117,6 +2120,9 @@ export declare const PModalPlugin: {
|
|
|
2117
2120
|
width: number;
|
|
2118
2121
|
height: number;
|
|
2119
2122
|
saveBtnText: string;
|
|
2123
|
+
cancelBtnText: string;
|
|
2124
|
+
hideCancelBtn: boolean;
|
|
2125
|
+
hideSaveBtn: boolean;
|
|
2120
2126
|
}>;
|
|
2121
2127
|
__isFragment?: never;
|
|
2122
2128
|
__isTeleport?: never;
|
|
@@ -2134,6 +2140,9 @@ export declare const PModalPlugin: {
|
|
|
2134
2140
|
width: number;
|
|
2135
2141
|
height: number;
|
|
2136
2142
|
saveBtnText: string;
|
|
2143
|
+
cancelBtnText: string;
|
|
2144
|
+
hideCancelBtn: boolean;
|
|
2145
|
+
hideSaveBtn: boolean;
|
|
2137
2146
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
2138
2147
|
$slots: {
|
|
2139
2148
|
header?(_: {}): any;
|
package/es/modal/typing.d.ts
CHANGED
package/es/page/PPage.vue.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { NCard as m, NSpace as b, NAvatar as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { AlertOutlined as
|
|
4
|
-
const
|
|
1
|
+
import { NCard as m, NSpace as b, NAvatar as g, NIcon as y } from "naive-ui";
|
|
2
|
+
import { defineComponent as x, openBlock as o, createElementBlock as h, createBlock as r, withCtx as t, createVNode as a, createCommentVNode as s, createElementVNode as c, toDisplayString as d, renderSlot as f } from "vue";
|
|
3
|
+
import { AlertOutlined as k } from "@vicons/antd";
|
|
4
|
+
const N = { class: "border border-gray-100 rounded-lg" }, v = { class: "text-xl font-semibold text-gray-800" }, S = { class: "text-sm text-gray-500 mt-1" }, z = /* @__PURE__ */ x({
|
|
5
5
|
__name: "PPage",
|
|
6
6
|
props: {
|
|
7
|
-
icon: { type: Object, required: !1, default: () =>
|
|
7
|
+
icon: { type: Object, required: !1, default: () => k },
|
|
8
8
|
title: { type: String, required: !0 },
|
|
9
9
|
subtitle: { type: String, required: !1 }
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const e =
|
|
13
|
-
return (n,
|
|
14
|
-
const
|
|
15
|
-
return o(),
|
|
11
|
+
setup(u) {
|
|
12
|
+
const e = u;
|
|
13
|
+
return (n, w) => {
|
|
14
|
+
const p = y, _ = g, i = b, l = m;
|
|
15
|
+
return o(), h("div", N, [
|
|
16
16
|
e.title ? (o(), r(l, {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "mb-4",
|
|
@@ -36,7 +36,7 @@ const v = { class: "border border-gray-100 rounded-lg" }, S = { class: "text-xl
|
|
|
36
36
|
class: "bg-linear-to-br from-blue-500 to-indigo-600"
|
|
37
37
|
}, {
|
|
38
38
|
default: t(() => [
|
|
39
|
-
a(
|
|
39
|
+
a(p, {
|
|
40
40
|
size: 24,
|
|
41
41
|
component: e.icon,
|
|
42
42
|
color: "#fff"
|
|
@@ -45,8 +45,8 @@ const v = { class: "border border-gray-100 rounded-lg" }, S = { class: "text-xl
|
|
|
45
45
|
_: 1
|
|
46
46
|
})) : s("", !0),
|
|
47
47
|
c("div", null, [
|
|
48
|
-
c("div",
|
|
49
|
-
c("div",
|
|
48
|
+
c("div", v, d(e.title), 1),
|
|
49
|
+
c("div", S, d(e.subtitle ?? e.title + "主页"), 1)
|
|
50
50
|
])
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
@@ -60,21 +60,21 @@ const v = { class: "border border-gray-100 rounded-lg" }, S = { class: "text-xl
|
|
|
60
60
|
n.$slots.search ? (o(), r(l, {
|
|
61
61
|
key: 1,
|
|
62
62
|
class: "mb-4",
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
"content-class": "flex flex-row gap-2",
|
|
64
|
+
bordered: !1
|
|
65
65
|
}, {
|
|
66
66
|
default: t(() => [
|
|
67
|
-
|
|
67
|
+
f(n.$slots, "search")
|
|
68
68
|
]),
|
|
69
69
|
_: 3
|
|
70
70
|
})) : s("", !0),
|
|
71
71
|
n.$slots.default ? (o(), r(l, {
|
|
72
72
|
key: 2,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
"content-class": "flex flex-row gap-2 p-0!",
|
|
74
|
+
bordered: !1
|
|
75
75
|
}, {
|
|
76
76
|
default: t(() => [
|
|
77
|
-
|
|
77
|
+
f(n.$slots, "default")
|
|
78
78
|
]),
|
|
79
79
|
_: 3
|
|
80
80
|
})) : s("", !0)
|
|
@@ -83,5 +83,5 @@ const v = { class: "border border-gray-100 rounded-lg" }, S = { class: "text-xl
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
export {
|
|
86
|
-
|
|
86
|
+
z as default
|
|
87
87
|
};
|