Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-21 11:29:20 +08:00

Deploying to gh-pages from @ 3810f269bf503c08c836bc5c772943d23d57853a 🚀

This commit is contained in:
pany-ang 2023-12-02 06:42:40 +00:00
parent d9cf092dc9
commit abf28c07eb
74 changed files with 88 additions and 83 deletions

View File

@ -6,16 +6,15 @@
<link rel="icon" href="/v3-admin-vite/favicon.ico" />
<link rel="stylesheet" href="/v3-admin-vite/app-loading.css" />
<title>V3 Admin Vite</title>
<script type="module" crossorigin src="/v3-admin-vite/static/index-0b14b080.js"></script>
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/vue-fe0cb6ad.js">
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/element-15f07d95.js">
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/vxe-002bef21.js">
<link rel="stylesheet" href="/v3-admin-vite/static/index-fa5f9e9b.css">
<script type="module" crossorigin src="/v3-admin-vite/static/index-TYq13IvJ.js"></script>
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/vue-0R2mOSep.js">
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/element-bPbAKOxQ.js">
<link rel="modulepreload" crossorigin href="/v3-admin-vite/static/vxe-yFah2GU7.js">
<link rel="stylesheet" crossorigin href="/v3-admin-vite/static/index-kM44U5B2.css">
</head>
<body>
<div id="app">
<div id="app-loading"></div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

1
static/403-vC2eND23.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
static/404-foLNvZ6M.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{_}from"./index-0b14b080.js";import{ah as e,l as n,m as c,p as d,I as l,V as t,P as o,T as p}from"./vue-fe0cb6ad.js";const u={},i={class:"error-page"},f={class:"error-page-svg"};function m(r,v){const a=e("el-button"),s=e("router-link");return n(),c("div",i,[d("div",f,[l(r.$slots,"default",{},void 0,!0)]),t(s,{to:"/"},{default:o(()=>[t(a,{type:"primary"},{default:o(()=>[p("回到首页")]),_:1})]),_:1})])}const h=_(u,[["render",m],["__scopeId","data-v-2fba9562"]]);export{h as E};

View File

@ -0,0 +1 @@
import{_ as n}from"./index-TYq13IvJ.js";import{ag as e,m as c,p as _,q as d,H as l,T as t,O as o,S as p}from"./vue-0R2mOSep.js";const i={},u={class:"error-page"},f={class:"error-page-svg"};function m(r,g){const a=e("el-button"),s=e("router-link");return c(),_("div",u,[d("div",f,[l(r.$slots,"default",{},void 0,!0)]),t(s,{to:"/"},{default:o(()=>[t(a,{type:"primary"},{default:o(()=>[p("回到首页")]),_:1})]),_:1})])}const k=n(i,[["render",m],["__scopeId","data-v-2fba9562"]]);export{k as E};

View File

@ -0,0 +1 @@
import{d as u,_ as m}from"./index-TYq13IvJ.js";import{l as h,r as S,b as f,ag as c,m as v,p as w,q as t,R as g,u as b,T as s,O as I,aH as R,aI as V}from"./vue-0R2mOSep.js";const x=e=>(R("data-v-54e6a169"),e=e(),V(),e),B={class:"switch-roles"},C=x(()=>t("span",null,"切换权限:",-1)),k=h({__name:"SwitchRoles",emits:["change"],setup(e,{emit:i}){const d=i,o=u(),a=S(o.roles[0]);return f(a,async l=>{await o.changeRoles(l),d("change")}),(l,n)=>{const r=c("el-radio-button"),p=c("el-radio-group");return v(),w("div",null,[t("div",null,"你的权限:"+g(b(o).roles),1),t("div",B,[C,s(p,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=_=>a.value=_)},{default:I(()=>[s(r,{label:"editor"}),s(r,{label:"admin"})]),_:1},8,["modelValue"])])])}}}),U=m(k,[["__scopeId","data-v-54e6a169"]]);export{U as S};

View File

@ -1 +0,0 @@
import{d as u,_ as m}from"./index-0b14b080.js";import{H as h,r as v,b as S,ah as _,l as w,m as f,p as a,U as g,u as V,V as t,P as b,aI as x,aJ as I}from"./vue-fe0cb6ad.js";const R=e=>(x("data-v-54e6a169"),e=e(),I(),e),y={class:"switch-roles"},B=R(()=>a("span",null,"切换权限:",-1)),C=h({__name:"SwitchRoles",emits:["change"],setup(e,{emit:r}){const i=r,o=u(),s=v(o.roles[0]);return S(s,async l=>{await o.changeRoles(l),i("change")}),(l,n)=>{const c=_("el-radio-button"),d=_("el-radio-group");return w(),f("div",null,[a("div",null,"你的权限:"+g(V(o).roles),1),a("div",y,[B,t(d,{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=p=>s.value=p)},{default:b(()=>[t(c,{label:"editor"}),t(c,{label:"admin"})]),_:1},8,["modelValue"])])])}}});const N=m(C,[["__scopeId","data-v-54e6a169"]]);export{N as S};

View File

@ -0,0 +1 @@
import{i as g,_ as y}from"./index-TYq13IvJ.js";import{S as b}from"./SwitchRoles-MB3dJxZ3.js";import{l as P,r as C,ag as m,aq as x,m as a,p as _,T as s,q as p,V as u,M as o,O as t,S as e,u as f,Q as v}from"./vue-0R2mOSep.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const k=r=>{if(Array.isArray(r)&&r.length>0){const{roles:n}=g();return n.some(l=>r.includes(l))}else return console.error("need roles! Like checkPermission(['admin','editor'])"),!1},V={class:"app-container"},w={class:"margin-top-15"},z=P({__name:"directive",setup(r){const n=C(1),l=()=>{n.value++};return(B,N)=>{const i=m("el-tag"),c=m("el-tab-pane"),h=m("el-tabs"),d=x("permission");return a(),_("div",V,[s(b,{onChange:l}),(a(),_("div",{key:n.value,class:"margin-top-30"},[p("div",null,[u((a(),o(i,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['admin']" 所以只有 admin 可以看见这句话 `)]),_:1})),[[d,["admin"]]])]),p("div",null,[u((a(),o(i,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['editor']" 所以只有 editor 可以看见这句话 `)]),_:1})),[[d,["editor"]]])]),p("div",w,[u((a(),o(i,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['admin', 'editor']" 所以 admin 和 editor 都可以看见这句话 `)]),_:1})),[[d,["admin","editor"]]])])])),(a(),_("div",{key:`checkPermission${n.value}`,class:"margin-top-30"},[s(i,{type:"warning",size:"large"},{default:t(()=>[e(" 例如 Element Plus 的 el-tab-pane 或 el-table-column 以及其它动态渲染 Dom 的场景不适合使用 v-permission这种情况下你可以通过 v-if 和 checkPermission 来实现: ")]),_:1}),s(h,{type:"border-card",class:"margin-top-15"},{default:t(()=>[f(k)(["admin"])?(a(),o(c,{key:0,label:"admin"},{default:t(()=>[e(" 这里采用了 "),s(i,null,{default:t(()=>[e(`v-if="checkPermission(['admin'])"`)]),_:1}),e(" 所以只有 admin 可以看见这句话 ")]),_:1})):v("",!0),f(k)(["editor"])?(a(),o(c,{key:1,label:"editor"},{default:t(()=>[e(" 这里采用了 "),s(i,null,{default:t(()=>[e(`v-if="checkPermission(['editor'])"`)]),_:1}),e(" 所以只有 editor 可以看见这句话 ")]),_:1})):v("",!0),f(k)(["admin","editor"])?(a(),o(c,{key:2,label:"admin 和 editor"},{default:t(()=>[e(" 这里采用了 "),s(i,null,{default:t(()=>[e(`v-if="checkPermission(['admin', 'editor'])"`)]),_:1}),e(" 所以 admin 和 editor 都可以看见这句话 ")]),_:1})):v("",!0)]),_:1})]))])}}}),T=y(z,[["__scopeId","data-v-6d704b73"]]);export{T as default};

View File

@ -1 +0,0 @@
import{i as g,_ as y}from"./index-0b14b080.js";import{S as b}from"./SwitchRoles-c483193f.js";import{H as P,r as x,ah as m,ar as C,l as i,m as _,V as s,p,Q as u,O as o,P as t,T as e,u as f,S as v}from"./vue-fe0cb6ad.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const h=r=>{if(Array.isArray(r)&&r.length>0){const{roles:n}=g();return n.some(c=>r.includes(c))}else return console.error("need roles! Like checkPermission(['admin','editor'])"),!1},V={class:"app-container"},w={class:"margin-top-15"},z=P({__name:"directive",setup(r){const n=x(1),c=()=>{n.value++};return(B,N)=>{const a=m("el-tag"),l=m("el-tab-pane"),k=m("el-tabs"),d=C("permission");return i(),_("div",V,[s(b,{onChange:c}),(i(),_("div",{key:n.value,class:"margin-top-30"},[p("div",null,[u((i(),o(a,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['admin']" 所以只有 admin 可以看见这句话 `)]),_:1})),[[d,["admin"]]])]),p("div",null,[u((i(),o(a,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['editor']" 所以只有 editor 可以看见这句话 `)]),_:1})),[[d,["editor"]]])]),p("div",w,[u((i(),o(a,{type:"success",size:"large",effect:"plain"},{default:t(()=>[e(` 这里采用了 v-permission="['admin', 'editor']" 所以 admin 和 editor 都可以看见这句话 `)]),_:1})),[[d,["admin","editor"]]])])])),(i(),_("div",{key:`checkPermission${n.value}`,class:"margin-top-30"},[s(a,{type:"warning",size:"large"},{default:t(()=>[e(" 例如 Element Plus 的 el-tab-pane 或 el-table-column 以及其它动态渲染 Dom 的场景不适合使用 v-permission这种情况下你可以通过 v-if 和 checkPermission 来实现: ")]),_:1}),s(k,{type:"border-card",class:"margin-top-15"},{default:t(()=>[f(h)(["admin"])?(i(),o(l,{key:0,label:"admin"},{default:t(()=>[e(" 这里采用了 "),s(a,null,{default:t(()=>[e(`v-if="checkPermission(['admin'])"`)]),_:1}),e(" 所以只有 admin 可以看见这句话 ")]),_:1})):v("",!0),f(h)(["editor"])?(i(),o(l,{key:1,label:"editor"},{default:t(()=>[e(" 这里采用了 "),s(a,null,{default:t(()=>[e(`v-if="checkPermission(['editor'])"`)]),_:1}),e(" 所以只有 editor 可以看见这句话 ")]),_:1})):v("",!0),f(h)(["admin","editor"])?(i(),o(l,{key:2,label:"admin 和 editor"},{default:t(()=>[e(" 这里采用了 "),s(a,null,{default:t(()=>[e(`v-if="checkPermission(['admin', 'editor'])"`)]),_:1}),e(" 所以 admin 和 editor 都可以看见这句话 ")]),_:1})):v("",!0)]),_:1})]))])}}});const T=y(z,[["__scopeId","data-v-6d704b73"]]);export{T as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{H as t,aE as r,aF as a,l as o,m as s}from"./vue-fe0cb6ad.js";const _=t({__name:"index",setup(n){const e=r();return a().replace({path:"/"+e.params.path,query:e.query}),(c,p)=>(o(),s("div"))}});export{_ as default};

1
static/index-0H-HRat5.js Normal file
View File

@ -0,0 +1 @@
import{l as r,r as p,ag as t,m as c,p as m,T as o,O as u}from"./vue-0R2mOSep.js";const _={class:"app-container"},x=r({name:"Menu1-2-2",__name:"index",setup(d){const e=p("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return c(),m("div",_,[o(l,{header:"四级路由缓存 - menu1-2-2"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{H as r,r as c,ah as t,l as m,m as p,V as o,P as u}from"./vue-fe0cb6ad.js";const _={class:"app-container"},x=r({name:"Menu1-2-1",__name:"index",setup(d){const e=c("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return m(),p("div",_,[o(l,{header:"四级路由缓存 - menu1-2-1"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{_}from"./index-0b14b080.js";import{ah as e,l as s,m as i,p as l,T as o,V as t,P as n}from"./vue-fe0cb6ad.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const p={},d={class:"app-container"};function m(u,f){const c=e("el-link"),a=e("router-view"),r=e("el-card");return s(),i("div",d,[l("h4",null,[o(" 三级及其以上路由缓存功能默认关闭,需要请前往此配置文件中打开: "),t(c,{type:"primary",href:"https://github.com/un-pany/v3-admin-vite/blob/main/src/config/route.ts",target:"_blank"},{default:n(()=>[o(" src/config/route.ts ")]),_:1})]),t(r,{header:"二级路由 - menu1"},{default:n(()=>[t(a)]),_:1})])}const g=_(p,[["render",m],["__scopeId","data-v-6b5ec9cb"]]);export{g as default};

View File

@ -1 +0,0 @@
import{_ as c,d as a}from"./index-0b14b080.js";import{ah as s,l as n,m as _,V as r,H as i,O as d,R as p,u as m}from"./vue-fe0cb6ad.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const l={},u={class:"app-container center"};function f(t,o){const e=s("el-empty");return n(),_("div",u,[r(e,{description:"Admin 权限可见"})])}const v=c(l,[["render",f],["__scopeId","data-v-540a7bcc"]]);const y={},x={class:"app-container center"};function h(t,o){const e=s("el-empty");return n(),_("div",x,[r(e,{description:"Editor 权限可见"})])}const b=c(y,[["render",h],["__scopeId","data-v-e677b768"]]),S=i({__name:"index",setup(t){const e=a().roles.includes("admin");return(A,E)=>(n(),d(p(m(e)?v:b)))}});export{S as default};

1
static/index-B3Yq1krQ.js Normal file
View File

@ -0,0 +1 @@
import{_ as c,d as a}from"./index-TYq13IvJ.js";import{ag as s,m as n,p as r,T as _,l as i,M as p,P as d,u as m}from"./vue-0R2mOSep.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const l={},u={class:"app-container center"};function f(t,o){const e=s("el-empty");return n(),r("div",u,[_(e,{description:"Admin 权限可见"})])}const v=c(l,[["render",f],["__scopeId","data-v-540a7bcc"]]),x={},h={class:"app-container center"};function y(t,o){const e=s("el-empty");return n(),r("div",h,[_(e,{description:"Editor 权限可见"})])}const $=c(x,[["render",y],["__scopeId","data-v-e677b768"]]),b=i({__name:"index",setup(t){const e=a().roles.includes("admin");return(k,A)=>(n(),p(d(m(e)?v:$)))}});export{b as default};

1
static/index-BQyBmfFt.js Normal file
View File

@ -0,0 +1 @@
import{l as r,r as p,ag as t,m as c,p as m,T as o,O as u}from"./vue-0R2mOSep.js";const _={class:"app-container"},x=r({name:"Menu2",__name:"index",setup(d){const e=p("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return c(),m("div",_,[o(l,{header:"二级路由缓存 - menu2"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

1
static/index-DxfKhqoi.js Normal file

File diff suppressed because one or more lines are too long

1
static/index-Otf0zx2T.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{h as e}from"./index-0b14b080.js";function r(t){return e({url:"table",method:"post",data:t})}function u(t){return e({url:`table/${t}`,method:"delete"})}function l(t){return e({url:"table",method:"put",data:t})}function n(t){return e({url:"table",method:"get",params:t})}export{r as c,u as d,n as g,l as u};
import{h as e}from"./index-TYq13IvJ.js";function r(t){return e({url:"table",method:"post",data:t})}function u(t){return e({url:`table/${t}`,method:"delete"})}function l(t){return e({url:"table",method:"put",data:t})}function n(t){return e({url:"table",method:"get",params:t})}export{r as c,u as d,n as g,l as u};

1
static/index-R2vbr-WF.js Normal file
View File

@ -0,0 +1 @@
import{l as r,r as p,ag as t,m as c,p as m,T as o,O as u}from"./vue-0R2mOSep.js";const _={class:"app-container"},x=r({name:"Menu1-3",__name:"index",setup(d){const e=p("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return c(),m("div",_,[o(l,{header:"三级路由缓存 - menu1-3"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

1
static/index-TWLNbEXU.js Normal file
View File

@ -0,0 +1 @@
import{l as k,aE as C,r as f,Z as S,ag as s,m as z,p as I,T as e,q as c,O as t,u as i,a2 as U,S as q,a8 as F,aH as M,aI as R}from"./vue-0R2mOSep.js";import{e as B,d as E,_ as K}from"./index-TYq13IvJ.js";import{v as N,w as H,x as L,y as T,z as Z}from"./element-bPbAKOxQ.js";import{_ as A}from"./index.vue_vue_type_script_setup_true_lang-OYG1HTHX.js";import"./vxe-yFah2GU7.js";const D="/v3-admin-vite/static/logo-text-2-lXsH_ESZ.png",O=d=>(M("data-v-79326910"),d=d(),R(),d),X={class:"login-container"},$={class:"login-card"},j=O(()=>c("div",{class:"title"},[c("img",{src:D})],-1)),G={class:"content"},J=k({__name:"index",setup(d){const h=C(),g=f(null),u=f(!1),p=f(""),o=S({username:"admin",password:"12345678",code:""}),w={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:8,max:16,message:"长度在 8 到 16 个字符",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}]},x=()=>{var r;(r=g.value)==null||r.validate((a,l)=>{a?(u.value=!0,E().login(o).then(()=>{h.push({path:"/"})}).catch(()=>{m(),o.password=""}).finally(()=>{u.value=!1})):console.error("表单校验不通过",l)})},m=()=>{o.code="",p.value="",B().then(r=>{p.value=r.data})};return m(),(r,a)=>{const l=s("el-input"),_=s("el-form-item"),v=s("el-icon"),y=s("el-image"),V=s("el-button"),b=s("el-form");return z(),I("div",X,[e(A,{class:"theme-switch"}),c("div",$,[j,c("div",G,[e(b,{ref_key:"loginFormRef",ref:g,model:o,rules:w,onKeyup:F(x,["enter"])},{default:t(()=>[e(_,{prop:"username"},{default:t(()=>[e(l,{modelValue:o.username,"onUpdate:modelValue":a[0]||(a[0]=n=>o.username=n),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":i(N),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),e(_,{prop:"password"},{default:t(()=>[e(l,{modelValue:o.password,"onUpdate:modelValue":a[1]||(a[1]=n=>o.password=n),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":i(H),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])]),_:1}),e(_,{prop:"code"},{default:t(()=>[e(l,{modelValue:o.code,"onUpdate:modelValue":a[2]||(a[2]=n=>o.code=n),modelModifiers:{trim:!0},placeholder:"验证码",type:"text",tabindex:"3","prefix-icon":i(L),maxlength:"7",size:"large"},{append:t(()=>[e(y,{src:p.value,onClick:m,draggable:"false"},{placeholder:t(()=>[e(v,null,{default:t(()=>[e(i(T))]),_:1})]),error:t(()=>[e(v,null,{default:t(()=>[e(i(Z))]),_:1})]),_:1},8,["src"])]),_:1},8,["modelValue","prefix-icon"])]),_:1}),e(V,{loading:u.value,type:"primary",size:"large",onClick:U(x,["prevent"])},{default:t(()=>[q("登 录")]),_:1},8,["loading","onClick"])]),_:1},8,["model","onKeyup"])])])])}}}),oe=K(J,[["__scopeId","data-v-79326910"]]);export{oe as default};

11
static/index-TYq13IvJ.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{H as k,aF as C,r as f,_ as z,ah as s,l as F,m as I,V as e,p as c,P as t,u as i,a3 as U,T as M,a9 as R,aI as S,aJ as q}from"./vue-fe0cb6ad.js";import{e as B,d as K,_ as N}from"./index-0b14b080.js";import{v as L,w as T,x as A,y as D,z as E}from"./element-15f07d95.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-7eca3c65.js";import"./vxe-002bef21.js";const J="/v3-admin-vite/static/logo-text-2-eef467fb.png",P=d=>(S("data-v-79326910"),d=d(),q(),d),$={class:"login-container"},j={class:"login-card"},G=P(()=>c("div",{class:"title"},[c("img",{src:J})],-1)),O={class:"content"},Q=k({__name:"index",setup(d){const h=C(),g=f(null),u=f(!1),p=f(""),o=z({username:"admin",password:"12345678",code:""}),w={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:8,max:16,message:"长度在 8 到 16 个字符",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}]},x=()=>{var l;(l=g.value)==null||l.validate((a,r)=>{a?(u.value=!0,K().login(o).then(()=>{h.push({path:"/"})}).catch(()=>{m(),o.password=""}).finally(()=>{u.value=!1})):console.error("表单校验不通过",r)})},m=()=>{o.code="",p.value="",B().then(l=>{p.value=l.data})};return m(),(l,a)=>{const r=s("el-input"),_=s("el-form-item"),v=s("el-icon"),y=s("el-image"),V=s("el-button"),b=s("el-form");return F(),I("div",$,[e(H,{class:"theme-switch"}),c("div",j,[G,c("div",O,[e(b,{ref_key:"loginFormRef",ref:g,model:o,rules:w,onKeyup:R(x,["enter"])},{default:t(()=>[e(_,{prop:"username"},{default:t(()=>[e(r,{modelValue:o.username,"onUpdate:modelValue":a[0]||(a[0]=n=>o.username=n),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":i(L),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),e(_,{prop:"password"},{default:t(()=>[e(r,{modelValue:o.password,"onUpdate:modelValue":a[1]||(a[1]=n=>o.password=n),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":i(T),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])]),_:1}),e(_,{prop:"code"},{default:t(()=>[e(r,{modelValue:o.code,"onUpdate:modelValue":a[2]||(a[2]=n=>o.code=n),modelModifiers:{trim:!0},placeholder:"验证码",type:"text",tabindex:"3","prefix-icon":i(A),maxlength:"7",size:"large"},{append:t(()=>[e(y,{src:p.value,onClick:m,draggable:"false"},{placeholder:t(()=>[e(v,null,{default:t(()=>[e(i(D))]),_:1})]),error:t(()=>[e(v,null,{default:t(()=>[e(i(E))]),_:1})]),_:1},8,["src"])]),_:1},8,["modelValue","prefix-icon"])]),_:1}),e(V,{loading:u.value,type:"primary",size:"large",onClick:U(x,["prevent"])},{default:t(()=>[M("登 录")]),_:1},8,["loading","onClick"])]),_:1},8,["model","onKeyup"])])])])}}});const oe=N(Q,[["__scopeId","data-v-79326910"]]);export{oe as default};

View File

@ -1 +0,0 @@
import{H as r,r as c,ah as t,l as m,m as p,V as o,P as u}from"./vue-fe0cb6ad.js";const _={class:"app-container"},x=r({name:"Menu1-3",__name:"index",setup(d){const e=c("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return m(),p("div",_,[o(l,{header:"三级路由缓存 - menu1-3"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

File diff suppressed because one or more lines are too long

1
static/index-aqntK00M.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{H as r,r as c,ah as t,l as m,m as p,V as o,P as u}from"./vue-fe0cb6ad.js";const _={class:"app-container"},x=r({name:"Menu1-1",__name:"index",setup(d){const e=c("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return m(),p("div",_,[o(l,{header:"三级路由缓存 - menu1-1"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

View File

@ -1 +0,0 @@
import{H as r,r as c,ah as t,l as m,m as p,V as o,P as u}from"./vue-fe0cb6ad.js";const _={class:"app-container"},x=r({name:"Menu2",__name:"index",setup(d){const e=c("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return m(),p("div",_,[o(l,{header:"二级路由缓存 - menu2"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

View File

@ -1 +0,0 @@
import{_ as n}from"./index-0b14b080.js";import{ah as e,l as c,m as a,V as o,P as s}from"./vue-fe0cb6ad.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const _={},i={class:"app-container"};function m(p,d){const t=e("router-view"),r=e("el-card");return c(),a("div",i,[o(r,{header:"三级路由 - menu1-2"},{default:s(()=>[o(t)]),_:1})])}const x=n(_,[["render",m]]);export{x as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{H as r,r as c,ah as t,l as m,m as p,V as o,P as u}from"./vue-fe0cb6ad.js";const _={class:"app-container"},x=r({name:"Menu1-2-2",__name:"index",setup(d){const e=c("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return m(),p("div",_,[o(l,{header:"四级路由缓存 - menu1-2-2"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
static/index-lr33QjX9.js Normal file
View File

@ -0,0 +1 @@
import{_ as n}from"./index-TYq13IvJ.js";import{ag as e,m as c,p as a,T as o,O as s}from"./vue-0R2mOSep.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const _={},i={class:"app-container"};function m(p,d){const t=e("router-view"),r=e("el-card");return c(),a("div",i,[o(r,{header:"三级路由 - menu1-2"},{default:s(()=>[o(t)]),_:1})])}const h=n(_,[["render",m]]);export{h as default};

1
static/index-rW8316Hd.js Normal file
View File

@ -0,0 +1 @@
import{_ as s}from"./index-TYq13IvJ.js";import{ag as e,m as _,p as i,q as p,S as o,T as t,O as n}from"./vue-0R2mOSep.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const l={},m={class:"app-container"};function d(u,f){const r=e("el-link"),a=e("router-view"),c=e("el-card");return _(),i("div",m,[p("h4",null,[o(" 三级及其以上路由缓存功能默认关闭,需要请前往此配置文件中打开: "),t(r,{type:"primary",href:"https://github.com/un-pany/v3-admin-vite/blob/main/src/config/route.ts",target:"_blank"},{default:n(()=>[o(" src/config/route.ts ")]),_:1})]),t(c,{header:"二级路由 - menu1"},{default:n(()=>[t(a)]),_:1})])}const g=s(l,[["render",d],["__scopeId","data-v-6b5ec9cb"]]);export{g as default};

View File

@ -1 +1 @@
import{_ as e}from"./index-0b14b080.js";import{l as o,m as n,p as t}from"./vue-fe0cb6ad.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const a={},i={"h-full":"","uno-padding-20":""},s=t("div",{"h-full":"","text-center":"",flex:"","select-none":"","all:transition-400":""},[t("div",{ma:""},[t("div",{"text-5xl":"",fw100:"","animate-bounce-alt":"","animate-count-infinite":"","animate-1s":""},"UnoCSS"),t("div",{op30:"","dark:op60":"","text-lg":"",fw300:"",m1:""},"该页面是一个 UnoCSS 的使用案例,其他页面依旧采用 Scss"),t("div",{m2:"",flex:"","justify-center":"","text-lg":"",op30:"","dark:op60":"",hover:"op80","dark:hover":"op80"},[t("a",{href:"https://antfu.me/posts/reimagine-atomic-css-zh",target:"_blank"},"推荐阅读:重新构想原子化 CSS")])])],-1),r=[s];function c(d,l){return o(),n("div",i,r)}const h=e(a,[["render",c]]);export{h as default};
import{_ as e}from"./index-TYq13IvJ.js";import{m as o,p as n,q as t}from"./vue-0R2mOSep.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const a={},i={"h-full":"","uno-padding-20":""},s=t("div",{"h-full":"","text-center":"",flex:"","select-none":"","all:transition-400":""},[t("div",{ma:""},[t("div",{"text-5xl":"",fw100:"","animate-bounce-alt":"","animate-count-infinite":"","animate-1s":""},"UnoCSS"),t("div",{op30:"","dark:op60":"","text-lg":"",fw300:"",m1:""},"该页面是一个 UnoCSS 的使用案例,其他页面依旧采用 Scss"),t("div",{m2:"",flex:"","justify-center":"","text-lg":"",op30:"","dark:op60":"",hover:"op80","dark:hover":"op80"},[t("a",{href:"https://antfu.me/posts/reimagine-atomic-css-zh",target:"_blank"},"推荐阅读:重新构想原子化 CSS")])])],-1),r=[s];function c(d,l){return o(),n("div",i,r)}const h=e(a,[["render",c]]);export{h as default};

1
static/index-rof0ZnY3.js Normal file
View File

@ -0,0 +1 @@
import{l as r,r as p,ag as t,m as c,p as m,T as o,O as u}from"./vue-0R2mOSep.js";const _={class:"app-container"},x=r({name:"Menu1-1",__name:"index",setup(d){const e=p("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return c(),m("div",_,[o(l,{header:"三级路由缓存 - menu1-1"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

1
static/index-zroOQI36.js Normal file
View File

@ -0,0 +1 @@
import{l as t,aD as r,aE as a,m as o,p as s}from"./vue-0R2mOSep.js";const _=t({__name:"index",setup(n){const e=r();return a().replace({path:"/"+e.params.path,query:e.query}),(p,c)=>(o(),s("div"))}});export{_ as default};

1
static/index-zvKywTu-.js Normal file
View File

@ -0,0 +1 @@
import{l as r,r as p,ag as t,m as c,p as m,T as o,O as u}from"./vue-0R2mOSep.js";const _={class:"app-container"},x=r({name:"Menu1-2-1",__name:"index",setup(d){const e=p("");return(i,n)=>{const a=t("el-input"),l=t("el-card");return c(),m("div",_,[o(l,{header:"四级路由缓存 - menu1-2-1"},{default:u(()=>[o(a,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=s=>e.value=s)},null,8,["modelValue"])]),_:1})])}}});export{x as default};

View File

@ -1 +0,0 @@
import{f as k}from"./index-0b14b080.js";import{A as g}from"./element-15f07d95.js";import{H as h,ah as o,l,O as m,P as e,V as n,m as C,a8 as x,u as t,F as B,p as s,U as b}from"./vue-fe0cb6ad.js";const L=h({__name:"index",setup(v){const{themeList:c,activeThemeName:d,setTheme:r}=k();return(N,T)=>{const _=o("el-icon"),p=o("el-tooltip"),i=o("el-dropdown-item"),u=o("el-dropdown-menu"),f=o("el-dropdown");return l(),m(f,{trigger:"click",onCommand:t(r)},{dropdown:e(()=>[n(u,null,{default:e(()=>[(l(!0),C(B,null,x(t(c),(a,w)=>(l(),m(i,{key:w,disabled:t(d)===a.name,command:a.name},{default:e(()=>[s("span",null,b(a.title),1)]),_:2},1032,["disabled","command"]))),128))]),_:1})]),default:e(()=>[s("div",null,[n(p,{effect:"dark",content:"主题模式",placement:"bottom"},{default:e(()=>[n(_,{size:20},{default:e(()=>[n(t(g))]),_:1})]),_:1})])]),_:1},8,["onCommand"])}}});export{L as _};

View File

@ -0,0 +1 @@
import{f as k}from"./index-TYq13IvJ.js";import{A as g}from"./element-bPbAKOxQ.js";import{l as C,ag as o,m as l,M as m,O as e,T as n,p as h,a7 as x,u as t,F as B,q as s,R as T}from"./vue-0R2mOSep.js";const V=C({__name:"index",setup(b){const{themeList:c,activeThemeName:d,setTheme:r}=k();return(v,N)=>{const _=o("el-icon"),p=o("el-tooltip"),i=o("el-dropdown-item"),u=o("el-dropdown-menu"),f=o("el-dropdown");return l(),m(f,{trigger:"click",onCommand:t(r)},{dropdown:e(()=>[n(u,null,{default:e(()=>[(l(!0),h(B,null,x(t(c),(a,w)=>(l(),m(i,{key:w,disabled:t(d)===a.name,command:a.name},{default:e(()=>[s("span",null,T(a.title),1)]),_:2},1032,["disabled","command"]))),128))]),_:1})]),default:e(()=>[s("div",null,[n(p,{effect:"dark",content:"主题模式",placement:"bottom"},{default:e(()=>[n(_,{size:20},{default:e(()=>[n(t(g))]),_:1})]),_:1})])]),_:1},8,["onCommand"])}}});export{V as _};

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

View File

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

View File

@ -1 +0,0 @@
import{H as s,aF as n,ah as _,l as p,m as r,V as e,P as c,T as i}from"./vue-fe0cb6ad.js";import{S as l}from"./SwitchRoles-c483193f.js";import{_ as m}from"./index-0b14b080.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const d={class:"app-container"},u=s({__name:"page",setup(f){const t=n(),a=()=>{t.push({path:"/403"})};return(g,h)=>{const o=_("el-tag");return p(),r("div",d,[e(l,{onChange:a}),e(o,{type:"warning",size:"large"},{default:c(()=>[i("当前页面只有 admin 权限可见,切换权限后将不能进入该页面")]),_:1})])}}});const R=m(u,[["__scopeId","data-v-7986af66"]]);export{R as default};

1
static/page-GM7_t8Ab.js Normal file
View File

@ -0,0 +1 @@
import{l as s,aE as n,ag as r,m as p,p as c,T as e,O as _,S as m}from"./vue-0R2mOSep.js";import{S as i}from"./SwitchRoles-MB3dJxZ3.js";import{_ as l}from"./index-TYq13IvJ.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const d={class:"app-container"},f=s({__name:"page",setup(g){const t=n(),a=()=>{t.push({path:"/403"})};return(h,u)=>{const o=r("el-tag");return p(),c("div",d,[e(i,{onChange:a}),e(o,{type:"warning",size:"large"},{default:_(()=>[m("当前页面只有 admin 权限可见,切换权限后将不能进入该页面")]),_:1})])}}}),S=l(f,[["__scopeId","data-v-7986af66"]]);export{S as default};

View File

@ -1 +1 @@
import{r as c,d as S,H as V,ah as r,l as i,m as _,V as m,P as b,F as E,a8 as k,u as a,B as f,p as d,O as B,L as C}from"./vue-fe0cb6ad.js";function P(s){const{api:l}=s,t=c(!1),e=c([]),p=c(""),o=()=>{t.value=!0,e.value=[],l().then(u=>{e.value=u.data}).finally(()=>{t.value=!1})};return S(()=>{o()}),{loading:t,options:e,value:p}}const w={code:0,data:[{label:"苹果",value:1},{label:"香蕉",value:2},{label:"橘子",value:3,disabled:!0}],message:"获取 Select 数据成功"};function x(){return new Promise((s,l)=>{setTimeout(()=>{Math.random()<.8?s(w):l(new Error("接口发生错误"))},2e3)})}const A={class:"app-container"},D=d("h4",null,"该示例是演示:通过 hook 自动调用 api 后拿到 Select 组件需要的数据并传递给 Select 组件",-1),F=d("h5",null,"Select 示例",-1),L=d("h5",null,"Select V2 示例(如果数据量过多,可以选择该组件)",-1),T=V({__name:"use-fetch-select",setup(s){const{loading:l,options:t,value:e}=P({api:x});return(p,o)=>{const u=r("el-option"),v=r("el-select"),h=r("el-select-v2");return i(),_("div",A,[D,F,m(v,{loading:a(l),modelValue:a(e),"onUpdate:modelValue":o[0]||(o[0]=n=>f(e)?e.value=n:null),filterable:""},{default:b(()=>[(i(!0),_(E,null,k(a(t),(n,g)=>(i(),B(u,C(n,{key:g,placeholder:"请选择"}),null,16))),128))]),_:1},8,["loading","modelValue"]),L,m(h,{loading:a(l),modelValue:a(e),"onUpdate:modelValue":o[1]||(o[1]=n=>f(e)?e.value=n:null),options:a(t),filterable:"",placeholder:"请选择"},null,8,["loading","modelValue","options"])])}}});export{T as default};
import{r as c,d as S,l as V,ag as r,m as i,p as _,T as m,O as b,F as E,a7 as k,u as a,B as f,q as d,K as B,M as C}from"./vue-0R2mOSep.js";function T(s){const{api:l}=s,t=c(!1),e=c([]),p=c(""),o=()=>{t.value=!0,e.value=[],l().then(u=>{e.value=u.data}).finally(()=>{t.value=!1})};return S(()=>{o()}),{loading:t,options:e,value:p}}const w={code:0,data:[{label:"苹果",value:1},{label:"香蕉",value:2},{label:"橘子",value:3,disabled:!0}],message:"获取 Select 数据成功"};function x(){return new Promise((s,l)=>{setTimeout(()=>{Math.random()<.8?s(w):l(new Error("接口发生错误"))},2e3)})}const A={class:"app-container"},D=d("h4",null,"该示例是演示:通过 hook 自动调用 api 后拿到 Select 组件需要的数据并传递给 Select 组件",-1),F=d("h5",null,"Select 示例",-1),M=d("h5",null,"Select V2 示例(如果数据量过多,可以选择该组件)",-1),P=V({__name:"use-fetch-select",setup(s){const{loading:l,options:t,value:e}=T({api:x});return(p,o)=>{const u=r("el-option"),v=r("el-select"),h=r("el-select-v2");return i(),_("div",A,[D,F,m(v,{loading:a(l),modelValue:a(e),"onUpdate:modelValue":o[0]||(o[0]=n=>f(e)?e.value=n:null),filterable:""},{default:b(()=>[(i(!0),_(E,null,k(a(t),(n,g)=>(i(),C(u,B(n,{key:g,placeholder:"请选择"}),null,16))),128))]),_:1},8,["loading","modelValue"]),M,m(h,{loading:a(l),modelValue:a(e),"onUpdate:modelValue":o[1]||(o[1]=n=>f(e)?e.value=n:null),options:a(t),filterable:"",placeholder:"请选择"},null,8,["loading","modelValue","options"])])}}});export{P as default};

View File

@ -1,10 +0,0 @@
import{I as d,b as n}from"./element-15f07d95.js";import{H as p,ah as _,l as m,m as g,V as c,P as i,T as l,p as f}from"./vue-fe0cb6ad.js";const h={lock:!0,text:"加载中..."},u=(s,e={})=>{let t;return async(...a)=>{try{return t=d.service({...h,...e}),await s(...a)}finally{t==null||t.close()}}},y={code:0,data:{list:[]},message:"获取成功"};function k(s){return new Promise(e=>{setTimeout(()=>{e({...y,data:{list:s}})},1e3)})}function w(){return new Promise((s,e)=>{setTimeout(()=>{e(new Error("发生错误"))},1e3)})}const C={class:"app-container"},E=f("h4",null,"该示例是演示:通过将要执行的函数传递给 hook让 hook 自动开启全屏 loading函数执行结束后自动关闭 loading",-1),x=`
<path class="path" d="
M 30 15
L 28 17
M 25.61 25.61
A 15 15, 0, 0, 1, 15 30
A 15 15, 0, 1, 1, 27.99 7.5
L 15 15
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
`,b=p({__name:"use-fullscreen-loading",setup(s){const e={text:"即将发生错误...",background:"#F56C6C20",svg:x,svgViewBox:"-10, -10, 50, 50"},t=async()=>{const o=await u(k)([2,3,3]);n.success(`${o.message}传参为 ${o.data.list.toString()}`)},a=async()=>{try{await u(w,e)()}catch(o){n.error(o.message)}};return(o,S)=>{const r=_("el-button");return m(),g("div",C,[E,c(r,{type:"primary",onClick:t},{default:i(()=>[l("查询成功")]),_:1}),c(r,{type:"danger",onClick:a},{default:i(()=>[l("查询失败")]),_:1})])}}});export{b as default};

View File

@ -0,0 +1,10 @@
import{I as d,b as n}from"./element-bPbAKOxQ.js";import{l as p,ag as _,m,p as g,T as c,O as i,S as l,q as f}from"./vue-0R2mOSep.js";const y={lock:!0,text:"加载中..."},u=(s,e={})=>{let t;return async(...a)=>{try{return t=d.service({...y,...e}),await s(...a)}finally{t==null||t.close()}}},h={code:0,data:{list:[]},message:"获取成功"};function k(s){return new Promise(e=>{setTimeout(()=>{e({...h,data:{list:s}})},1e3)})}function w(){return new Promise((s,e)=>{setTimeout(()=>{e(new Error("发生错误"))},1e3)})}const C={class:"app-container"},E=f("h4",null,"该示例是演示:通过将要执行的函数传递给 hook让 hook 自动开启全屏 loading函数执行结束后自动关闭 loading",-1),S=`
<path class="path" d="
M 30 15
L 28 17
M 25.61 25.61
A 15 15, 0, 0, 1, 15 30
A 15 15, 0, 1, 1, 27.99 7.5
L 15 15
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
`,b=p({__name:"use-fullscreen-loading",setup(s){const e={text:"即将发生错误...",background:"#F56C6C20",svg:S,svgViewBox:"-10, -10, 50, 50"},t=async()=>{const o=await u(k)([2,3,3]);n.success(`${o.message}传参为 ${o.data.list.toString()}`)},a=async()=>{try{await u(w,e)()}catch(o){n.error(o.message)}};return(o,x)=>{const r=_("el-button");return m(),g("div",C,[E,c(r,{type:"primary",onClick:t},{default:i(()=>[l("查询成功")]),_:1}),c(r,{type:"danger",onClick:a},{default:i(()=>[l("查询失败")]),_:1})])}}});export{b as default};

View File

@ -1 +0,0 @@
import{u}from"./useWatermark-a10740b1.js";import{H as v,r as y,ah as f,l as C,m as b,p as m,V as t,P as a,u as r,T as l,aI as W,aJ as g}from"./vue-fe0cb6ad.js";import{_ as x}from"./index-0b14b080.js";import"./element-15f07d95.js";import"./vxe-002bef21.js";const w=n=>(W("data-v-dbeea05d"),n=n(),g(),n),I={class:"app-container"},$=w(()=>m("h4",null," 该示例是演示:通过调用 hook开启或关闭水印 支持局部、全局、自定义样式(颜色、透明度、字体大小、字体、倾斜角度等),并自带防御(防删、防隐藏)和自适应功能 ",-1)),V=v({__name:"use-watermark",setup(n){const p=y(null),{setWatermark:c,clearWatermark:i}=u(p),{setWatermark:d,clearWatermark:k}=u();return(B,e)=>{const o=f("el-button"),_=f("el-button-group");return C(),b("div",I,[$,m("div",{ref_key:"localRef",ref:p,class:"local"},null,512),t(_,null,{default:a(()=>[t(o,{type:"primary",onClick:e[0]||(e[0]=s=>r(c)("局部水印",{color:"#409eff"}))},{default:a(()=>[l("创建局部水印")]),_:1}),t(o,{type:"warning",onClick:e[1]||(e[1]=s=>r(c)("没有防御功能的局部水印",{color:"#e6a23c",defense:!1}))},{default:a(()=>[l(" 关闭防御功能 ")]),_:1}),t(o,{type:"danger",onClick:r(i)},{default:a(()=>[l("清除局部水印")]),_:1},8,["onClick"])]),_:1}),t(_,null,{default:a(()=>[t(o,{type:"primary",onClick:e[2]||(e[2]=s=>r(d)("全局水印",{color:"#409eff"}))},{default:a(()=>[l("创建全局水印")]),_:1}),t(o,{type:"warning",onClick:e[3]||(e[3]=s=>r(d)("没有防御功能的全局水印",{color:"#e6a23c",defense:!1}))},{default:a(()=>[l(" 关闭防御功能 ")]),_:1}),t(o,{type:"danger",onClick:r(k)},{default:a(()=>[l("清除全局水印")]),_:1},8,["onClick"])]),_:1})])}}});const h=x(V,[["__scopeId","data-v-dbeea05d"]]);export{h as default};

View File

@ -0,0 +1 @@
import{u as f}from"./useWatermark-dvtb0VZP.js";import{l as C,r as v,ag as m,m as y,p as b,q as i,T as t,O as a,u as r,S as l,aH as W,aI as g}from"./vue-0R2mOSep.js";import{_ as w}from"./index-TYq13IvJ.js";import"./element-bPbAKOxQ.js";import"./vxe-yFah2GU7.js";const x=n=>(W("data-v-dbeea05d"),n=n(),g(),n),I={class:"app-container"},$=x(()=>i("h4",null," 该示例是演示:通过调用 hook开启或关闭水印 支持局部、全局、自定义样式(颜色、透明度、字体大小、字体、倾斜角度等),并自带防御(防删、防隐藏)和自适应功能 ",-1)),S=C({__name:"use-watermark",setup(n){const p=v(null),{setWatermark:c,clearWatermark:_}=f(p),{setWatermark:d,clearWatermark:k}=f();return(B,e)=>{const o=m("el-button"),u=m("el-button-group");return y(),b("div",I,[$,i("div",{ref_key:"localRef",ref:p,class:"local"},null,512),t(u,null,{default:a(()=>[t(o,{type:"primary",onClick:e[0]||(e[0]=s=>r(c)("局部水印",{color:"#409eff"}))},{default:a(()=>[l("创建局部水印")]),_:1}),t(o,{type:"warning",onClick:e[1]||(e[1]=s=>r(c)("没有防御功能的局部水印",{color:"#e6a23c",defense:!1}))},{default:a(()=>[l(" 关闭防御功能 ")]),_:1}),t(o,{type:"danger",onClick:r(_)},{default:a(()=>[l("清除局部水印")]),_:1},8,["onClick"])]),_:1}),t(u,null,{default:a(()=>[t(o,{type:"primary",onClick:e[2]||(e[2]=s=>r(d)("全局水印",{color:"#409eff"}))},{default:a(()=>[l("创建全局水印")]),_:1}),t(o,{type:"warning",onClick:e[3]||(e[3]=s=>r(d)("没有防御功能的全局水印",{color:"#e6a23c",defense:!1}))},{default:a(()=>[l(" 关闭防御功能 ")]),_:1}),t(o,{type:"danger",onClick:r(k)},{default:a(()=>[l("清除全局水印")]),_:1},8,["onClick"])]),_:1})])}}}),q=w(S,[["__scopeId","data-v-dbeea05d"]]);export{q as default};

View File

@ -1 +1 @@
import{n as u}from"./element-15f07d95.js";import{r as x,z as C}from"./vue-fe0cb6ad.js";const L={defense:!0,color:"#c0c4cc",opacity:.5,size:16,family:"serif",angle:-20,width:300,height:200},E=x(document.body);function $(n=E){let v,d,t=null;const r={watermarkElMutationObserver:void 0,parentElMutationObserver:void 0,parentElResizeObserver:void 0},O=(e,a={})=>{if(!n.value){console.warn("请在 DOM 挂载完成后再调用 setWatermark 方法设置水印");return}v=e,d={...L,...a},t?b():f(),m(n.value)},f=()=>{const e=n.value.tagName.toLowerCase()===E.value.tagName.toLowerCase(),a=e?"fixed":"absolute",i=e?"":"relative";t=document.createElement("div"),t.style.pointerEvents="none",t.style.top="0",t.style.left="0",t.style.position=a,t.style.zIndex="99999";const{clientWidth:s,clientHeight:l}=n.value;b({width:s,height:l}),n.value.style.position=i,n.value.appendChild(t)},b=(e={})=>{t&&(v&&(t.style.background=`url(${y()}) left top repeat`),e.width&&(t.style.width=`${e.width}px`),e.height&&(t.style.height=`${e.height}px`))},y=()=>{const{color:e,opacity:a,size:i,family:s,angle:l,width:z,height:w}=d,c=document.createElement("canvas");c.width=z,c.height=w;const o=c.getContext("2d");return o&&(o.fillStyle=e,o.globalAlpha=a,o.font=`${i}px ${s}`,o.rotate(Math.PI/180*l),o.fillText(v,0,w/2)),c.toDataURL()},h=()=>{if(!(!n.value||!t)){p();try{n.value.removeChild(t)}catch{console.warn("水印元素已不存在,请重新创建")}finally{t=null}}},g=u(()=>{h(),f(),m(n.value)},100),m=e=>{d.defense?!r.watermarkElMutationObserver&&!r.parentElMutationObserver&&k(e):p("mutation"),r.parentElResizeObserver||M(e)},p=(e="all")=>{var a,i,s;(e==="mutation"||e==="all")&&((a=r.watermarkElMutationObserver)==null||a.disconnect(),r.watermarkElMutationObserver=void 0,(i=r.parentElMutationObserver)==null||i.disconnect(),r.parentElMutationObserver=void 0),(e==="resize"||e==="all")&&((s=r.parentElResizeObserver)==null||s.disconnect(),r.parentElResizeObserver=void 0)},k=e=>{const a=u(i=>{i.forEach(u(s=>{switch(s.type){case"attributes":s.target===t&&g();break;case"childList":s.removedNodes.forEach(l=>{l===t&&e.appendChild(t)});break}},100))},100);r.watermarkElMutationObserver=new MutationObserver(a),r.parentElMutationObserver=new MutationObserver(a),r.watermarkElMutationObserver.observe(t,{attributes:!0,childList:!1,subtree:!1}),r.parentElMutationObserver.observe(e,{attributes:!1,childList:!0,subtree:!1})},M=e=>{const a=u(()=>{const{clientWidth:i,clientHeight:s}=e;b({width:i,height:s})},500);r.parentElResizeObserver=new ResizeObserver(a),r.parentElResizeObserver.observe(e)};return C(()=>{h()}),{setWatermark:O,clearWatermark:h}}export{$ as u};
import{n as u}from"./element-bPbAKOxQ.js";import{r as x,z as C}from"./vue-0R2mOSep.js";const L={defense:!0,color:"#c0c4cc",opacity:.5,size:16,family:"serif",angle:-20,width:300,height:200},E=x(document.body);function $(n=E){let v,d,t=null;const r={watermarkElMutationObserver:void 0,parentElMutationObserver:void 0,parentElResizeObserver:void 0},O=(e,a={})=>{if(!n.value){console.warn("请在 DOM 挂载完成后再调用 setWatermark 方法设置水印");return}v=e,d={...L,...a},t?b():f(),m(n.value)},f=()=>{const e=n.value.tagName.toLowerCase()===E.value.tagName.toLowerCase(),a=e?"fixed":"absolute",i=e?"":"relative";t=document.createElement("div"),t.style.pointerEvents="none",t.style.top="0",t.style.left="0",t.style.position=a,t.style.zIndex="99999";const{clientWidth:s,clientHeight:l}=n.value;b({width:s,height:l}),n.value.style.position=i,n.value.appendChild(t)},b=(e={})=>{t&&(v&&(t.style.background=`url(${y()}) left top repeat`),e.width&&(t.style.width=`${e.width}px`),e.height&&(t.style.height=`${e.height}px`))},y=()=>{const{color:e,opacity:a,size:i,family:s,angle:l,width:z,height:w}=d,c=document.createElement("canvas");c.width=z,c.height=w;const o=c.getContext("2d");return o&&(o.fillStyle=e,o.globalAlpha=a,o.font=`${i}px ${s}`,o.rotate(Math.PI/180*l),o.fillText(v,0,w/2)),c.toDataURL()},h=()=>{if(!(!n.value||!t)){p();try{n.value.removeChild(t)}catch{console.warn("水印元素已不存在,请重新创建")}finally{t=null}}},g=u(()=>{h(),f(),m(n.value)},100),m=e=>{d.defense?!r.watermarkElMutationObserver&&!r.parentElMutationObserver&&k(e):p("mutation"),r.parentElResizeObserver||M(e)},p=(e="all")=>{var a,i,s;(e==="mutation"||e==="all")&&((a=r.watermarkElMutationObserver)==null||a.disconnect(),r.watermarkElMutationObserver=void 0,(i=r.parentElMutationObserver)==null||i.disconnect(),r.parentElMutationObserver=void 0),(e==="resize"||e==="all")&&((s=r.parentElResizeObserver)==null||s.disconnect(),r.parentElResizeObserver=void 0)},k=e=>{const a=u(i=>{i.forEach(u(s=>{switch(s.type){case"attributes":s.target===t&&g();break;case"childList":s.removedNodes.forEach(l=>{l===t&&e.appendChild(t)});break}},100))},100);r.watermarkElMutationObserver=new MutationObserver(a),r.parentElMutationObserver=new MutationObserver(a),r.watermarkElMutationObserver.observe(t,{attributes:!0,childList:!1,subtree:!1}),r.parentElMutationObserver.observe(e,{attributes:!1,childList:!0,subtree:!1})},M=e=>{const a=u(()=>{const{clientWidth:i,clientHeight:s}=e;b({width:i,height:s})},500);r.parentElResizeObserver=new ResizeObserver(a),r.parentElResizeObserver.observe(e)};return C(()=>{h()}),{setWatermark:O,clearWatermark:h}}export{$ as u};

1
static/vue-0R2mOSep.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
static/vxe-yFah2GU7.js Normal file

File diff suppressed because one or more lines are too long