@wetspace/pro-components
Version:
::: tip 基本介绍
2 lines (1 loc) • 13.3 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../delete-button/index.js");const x=require("../../count-down-button/index.js");require("../../ellipsis/index.js");const d=require("../../form-fileds/index.js"),p=require("../../pro-form/index.js");require("../../pro-table/index.js");require("../../pro-descriptions/index.js");require("../../pro-list/index.js");require("../../layout/index.js");require("../index.js");require("../../guide/index.js");require("../../notice-menu/index.js");require("../../state/index.js");const o=require("element-plus"),E=require("../types.js"),k=require("../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.4.2_/node_modules/@vueuse/core/index.js"),y={class:"title"},B=e.defineComponent({name:"WetLogin",__name:"index",props:E.wetLoginProps,emits:["login","forget","getCode","otherLogin"],setup(w,{emit:g}){const C=e.useSlots(),i=e.shallowRef(!1),c=g,n=o.useNamespace("login-page"),r=w,s=k.useLocalStorage(r.storeName,{}),a=e.shallowRef(),f=e.shallowRef(),V=async()=>{var t;const l=await((t=a.value)==null?void 0:t.submit());i.value?s.value={...l,isRemember:!0}:s.value={},c("login",l)},v=async()=>{var t;const l=await((t=f.value)==null?void 0:t.submit());c("login",l)},u=l=>{c("otherLogin",l)},N=e.computed(()=>!(!C.footer&&(!r.otherActions||r.otherActions.length===0))),m=e.computed(()=>({isString:typeof r.logo=="string",render:r.logo}));return e.onMounted(()=>{var l;(l=s.value)!=null&&l.isRemember&&(i.value=!0,a.value&&a.value.setValue(s.value))}),(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(n).b(),e.unref(n).is("page",r.isPage)]),style:e.normalizeStyle(`--wet-login-bg-image:url(${r.backgroundImage})`)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).e("login-form"),e.unref(n).is("page",r.isPage)])},[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).m("form-logo")])},[m.value.isString?(e.openBlock(),e.createBlock(e.unref(o.ElImage),{key:0,style:{width:"44px",height:"44px"},src:m.value.render},null,8,["src"])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.value.render),{key:1})),e.createElementVNode("span",y,e.toDisplayString(r.title),1)],2),r.subTitle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(n).m("form-subtitle")])},e.toDisplayString(r.subTitle),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(e.unref(o.ElTabs),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElTabPane),{label:"账号密码登录"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.WetProForm),{ref_key:"formins1",ref:a,"label-width":"70",size:"large"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.WetFormText),{prop:"username",label:"用户名",required:""}),e.createVNode(e.unref(d.WetFormText),{prop:"password",label:"密码",required:"","form-input-props":{showPassword:!0}}),e.createVNode(e.unref(o.ElCol),{span:24},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElRow),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElCheckbox),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=h=>i.value=h)},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode(" 记住密码 ")])),_:1},8,["modelValue"]),e.createVNode(e.unref(o.ElButton),{link:"",type:"primary"},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode(" 忘记密码 ")])),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(o.ElCol),{style:{"margin-top":"10px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElButton),{style:{width:"100%"},type:"primary",onClick:V},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode(" 登录 ")])),_:1})]),_:1})]),_:1},512)]),_:1}),r.havePhone?(e.openBlock(),e.createBlock(e.unref(o.ElTabPane),{key:0,label:"手机号登录"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.WetProForm),{ref_key:"formins2",ref:f,"label-width":"70",size:"large"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.WetFormText),{prop:"phonenum",label:"手机号",required:""}),e.createVNode(e.unref(o.ElCol),null,{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElRow),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.WetFormText),{span:16,label:"验证码",required:"",prop:"code"}),e.createVNode(e.unref(o.ElCol),{span:1}),e.createVNode(e.unref(o.ElCol),{span:7},{default:e.withCtx(()=>[e.createVNode(e.unref(x.CountDownButton),{style:{width:"100%"}})]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(o.ElCol),{style:{"margin-top":"10px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElButton),{style:{width:"100%"},type:"primary",onClick:v},{default:e.withCtx(()=>t[8]||(t[8]=[e.createTextVNode(" 登录 ")])),_:1})]),_:1})]),_:1},512)]),_:1})):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).m("form-footer")])},[N.value?e.renderSlot(l.$slots,"footer",{key:0},()=>[t[13]||(t[13]=e.createElementVNode("span",null,"其他登录方式",-1)),e.createVNode(e.unref(o.ElSpace),null,{default:e.withCtx(()=>[r.otherActions.includes("wx")?(e.openBlock(),e.createBlock(e.unref(o.ElIcon),{key:0,class:"item",size:28,onClick:t[1]||(t[1]=()=>u("wx"))},{default:e.withCtx(()=>t[9]||(t[9]=[e.createElementVNode("svg",{t:"1720419509451",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4292",width:"200",height:"200"},[e.createElementVNode("path",{d:"M337.387283 341.82659c-17.757225 0-35.514451 11.83815-35.514451 29.595375s17.757225 29.595376 35.514451 29.595376 29.595376-11.83815 29.595376-29.595376c0-18.49711-11.83815-29.595376-29.595376-29.595375zM577.849711 513.479769c-11.83815 0-22.936416 12.578035-22.936416 23.6763 0 12.578035 11.83815 23.676301 22.936416 23.676301 17.757225 0 29.595376-11.83815 29.595376-23.676301s-11.83815-23.676301-29.595376-23.6763zM501.641618 401.017341c17.757225 0 29.595376-12.578035 29.595376-29.595376 0-17.757225-11.83815-29.595376-29.595376-29.595375s-35.514451 11.83815-35.51445 29.595375 17.757225 29.595376 35.51445 29.595376zM706.589595 513.479769c-11.83815 0-22.936416 12.578035-22.936416 23.6763 0 12.578035 11.83815 23.676301 22.936416 23.676301 17.757225 0 29.595376-11.83815 29.595376-23.676301s-11.83815-23.676301-29.595376-23.6763z",fill:"#28C445","p-id":"4293"}),e.createElementVNode("path",{d:"M510.520231 2.959538C228.624277 2.959538 0 231.583815 0 513.479769s228.624277 510.520231 510.520231 510.520231 510.520231-228.624277 510.520231-510.520231-228.624277-510.520231-510.520231-510.520231zM413.595376 644.439306c-29.595376 0-53.271676-5.919075-81.387284-12.578034l-81.387283 41.433526 22.936416-71.768786c-58.450867-41.433526-93.965318-95.445087-93.965317-159.815029 0-113.202312 105.803468-201.988439 233.803468-201.98844 114.682081 0 216.046243 71.028902 236.023121 166.473989-7.398844-0.739884-14.797688-1.479769-22.196532-1.479769-110.982659 1.479769-198.289017 85.086705-198.289017 188.67052 0 17.017341 2.959538 33.294798 7.398844 49.572255-7.398844 0.739884-15.537572 1.479769-22.936416 1.479768z m346.265896 82.867052l17.757225 59.190752-63.630058-35.514451c-22.936416 5.919075-46.612717 11.83815-70.289017 11.83815-111.722543 0-199.768786-76.947977-199.768786-172.393063-0.739884-94.705202 87.306358-171.653179 198.289017-171.65318 105.803468 0 199.028902 77.687861 199.028902 172.393064 0 53.271676-34.774566 100.624277-81.387283 136.138728z",fill:"#28C445","p-id":"4294"})],-1)])),_:1})):e.createCommentVNode("",!0),r.otherActions.includes("qq")?(e.openBlock(),e.createBlock(e.unref(o.ElIcon),{key:1,size:28,class:"item",onClick:t[2]||(t[2]=()=>u("qq"))},{default:e.withCtx(()=>t[10]||(t[10]=[e.createElementVNode("svg",{t:"1720419642025",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7195",width:"200",height:"200"},[e.createElementVNode("path",{d:"M512 0C229.224296 0 0 229.224296 0 512s229.224296 512 512 512 512-229.224296 512-512S794.775704 0 512 0zM801.261037 668.86163c-21.731556 18.640593-49.948444-61.345185-54.006519-49.038222-9.879704 29.923556-14.506667 49.929481-43.633778 82.507852-1.554963 1.744593 33.659259 14.468741 43.633778 41.642667 9.557333 26.017185 28.141037 67.26163-93.487407 80.213333-71.35763 7.585185-122.936889-38.020741-128.075852-37.584593-9.53837 0.83437-5.290667 0-15.530667 0-8.38163 0-8.931556 0.606815-16.820148 0-2.161778-0.170667-25.884444 37.584593-131.963259 37.584593-82.223407 0-103.518815-51.749926-86.983111-80.213333 16.535704-28.463407 44.126815-36.750222 40.239407-41.263407-19.152593-22.186667-32.350815-45.909333-40.239407-67.356444-1.953185-5.347556-3.584-10.543407-4.873481-15.530667-2.996148-11.45363-25.884444 67.204741-50.460444 49.038222-24.576-18.166519-22.376296-64.417185-6.46637-108.676741 16.042667-44.619852 56.471704-87.589926 56.926815-97.071407 1.611852-35.290074-3.489185-41.14963 0-50.422519 7.755852-20.764444 17.199407-12.8 17.199407-23.570963 0-135.736889 100.864-245.76 225.28-245.76s225.28 110.042074 225.28 245.76c0 5.195852 13.520593 0 19.986963 23.570963 1.327407 4.873481 2.23763 23.665778 0.663704 50.422519-0.739556 12.856889 34.266074 28.501333 52.375704 97.071407C828.434963 628.754963 810.30637 661.105778 801.261037 668.86163z",fill:"#68A5E1","p-id":"7196"})],-1)])),_:1})):e.createCommentVNode("",!0),r.otherActions.includes("alipay")?(e.openBlock(),e.createBlock(e.unref(o.ElIcon),{key:2,class:"item",size:28,onClick:t[3]||(t[3]=()=>u("alipay"))},{default:e.withCtx(()=>t[11]||(t[11]=[e.createElementVNode("svg",{t:"1720419573530",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5272",width:"200",height:"200"},[e.createElementVNode("path",{d:"M230.771014 576.556522c-12.614493 9.646377-25.228986 23.744928-28.93913 42.295652-5.194203 24.486957-0.742029 55.652174 22.26087 80.13913 28.93913 28.93913 72.718841 37.101449 92.011594 38.585508 51.2 3.710145 106.110145-22.26087 147.663768-50.457971 16.324638-11.130435 43.77971-34.133333 70.492754-69.750725-59.362319-30.423188-133.565217-64.556522-212.22029-61.588406-41.553623 1.484058-70.492754 9.646377-91.269566 20.776812zM983.188406 712.347826c25.971014-61.588406 40.811594-129.113043 40.811594-200.347826 0-281.971014-230.028986-512-512-512S0 230.028986 0 512s230.028986 512 512 512c170.666667 0 321.298551-83.849275 414.794203-212.22029C838.492754 768.742029 693.797101 696.023188 604.011594 652.985507c-42.295652 48.973913-105.368116 97.205797-176.602898 117.982609-44.521739 13.356522-85.333333 18.550725-126.886957 9.646377-42.295652-8.904348-72.718841-28.197101-90.527536-47.489855-8.904348-10.388406-19.292754-22.26087-27.455073-37.843479 0.742029 0.742029 0.742029 2.226087 0.742029 2.968116 0 0-4.452174-7.42029-7.420289-19.292753-1.484058-5.936232-2.968116-11.872464-3.710145-17.808696-0.742029-4.452174-0.742029-8.904348 0-12.614493-0.742029-7.42029 0-15.582609 1.484058-23.744927 4.452174-20.776812 12.614493-43.77971 35.617391-65.298551 48.973913-48.231884 115.014493-50.457971 149.147826-50.457971 50.457971 0.742029 138.017391 22.26087 212.22029 48.973913 20.776812-43.77971 34.133333-89.785507 42.295652-121.692754H304.973913v-33.391304h158.052174v-66.782609H272.324638v-34.133333h190.701449v-66.782609c0-8.904348 2.226087-16.324638 16.324638-16.324637h74.944927v83.107246h207.026087v33.391304H554.295652v66.782609H719.768116S702.701449 494.933333 651.501449 586.202899c115.014493 40.811594 277.518841 104.626087 331.686957 126.144927z m0 0",fill:"#06B4FD","p-id":"5273"})],-1)])),_:1})):e.createCommentVNode("",!0),r.otherActions.includes("dy")?(e.openBlock(),e.createBlock(e.unref(o.ElIcon),{key:3,class:"item",size:28,onClick:t[4]||(t[4]=()=>u("dy"))},{default:e.withCtx(()=>t[12]||(t[12]=[e.createElementVNode("svg",{t:"1720419719555",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8217",width:"200",height:"200"},[e.createElementVNode("path",{d:"M512.32 0.32C229.76 0.32 0.832 229.44 0.832 512.128 0.832 794.88 229.76 1024 512.32 1024c282.432 0 511.424-229.12 511.424-511.872 0-282.688-228.928-511.808-511.424-511.808z m241.6 462.528a225.408 225.408 0 0 1-131.2-41.408c0 59.008 0 117.888 0.512 176.896 0 7.872 0.384 15.744-0.256 23.552a190.272 190.272 0 0 1-74.88 137.344c-26.24 19.2-57.856 30.016-90.56 30.848a198.912 198.912 0 0 1-48.96-3.968 171.264 171.264 0 0 1-64.64-28.608 175.808 175.808 0 0 1-73.92-148.48 176.256 176.256 0 0 1 83.648-144.576 173.888 173.888 0 0 1 115.584-24.32c0.064 7.488-0.192 14.976 0.128 22.4 0.576 9.344 0.064 18.688 0.256 28.032v47.68a67.328 67.328 0 0 0-37.632-1.152c-14.72 3.456-28.864 9.728-40.512 19.52-7.04 5.888-12.992 13.312-17.216 21.568a82.112 82.112 0 0 0-8.192 45.76c1.792 15.232 8.128 29.568 18.24 41.216 6.784 8.064 15.232 14.464 24.064 19.84 24.32 13.76 56 12.288 79.488-2.752 22.72-14.08 37.44-40.128 37.504-66.944V373.12c0.384-46.272 0.064-92.544 0.256-138.752h95.488c-0.256 8.128 0.768 16.256 2.112 24.256h0.512c2.56 13.44 7.552 26.304 13.696 38.528 9.728 18.816 24 35.648 42.24 46.72 1.088 0.704 1.92 1.728 2.816 2.624 13.376 8.32 28.16 14.592 43.52 17.92 9.024 1.984 18.304 2.688 27.52 2.944 0 7.04 0 14.08 0.128 21.12 0.384 24.768 0.128 49.536 0.256 74.368z",fill:"#000000","p-id":"8218"})],-1)])),_:1})):e.createCommentVNode("",!0)]),_:1})]):e.createCommentVNode("",!0)],2)],2)],6))}});exports.default=B;