ss-component-new 1.1.661 → 1.1.662

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),T=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F=require("vue-router"),G=require("./login-9FT8kgSz.cjs"),u=require("./menu-ScIJ5kqr.cjs"),W=require("./crypto-CRbcEKIz.cjs"),x=require("./index-BE8DQhoN.cjs"),H={},z={class:"left-wrap"},$={class:"left-bg"};function ee(v,E){return e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",$,[e.renderSlot(v.$slots,"img",{},void 0,!0)])])}const te=T._export_sfc(H,[["render",ee],["__scopeId","data-v-9b7ee6c9"]]),ae={class:"right-wrap"},oe={class:"right-title"},ne={class:"right-content"},se={class:"tab-content"},re={class:"tab-tips"},ce=e.defineComponent({__name:"index",props:{tabList:{type:Array,default:[]},loading:{type:Boolean,default:!1}},emits:["clickLogin","handleTabClick"],setup(v,{emit:E}){const y=e.ref("account"),c=E,i=()=>{c("clickLogin",y.value)},A=()=>{c("handleTabClick",y.value)};return(p,f)=>{const g=e.resolveComponent("el-button"),h=e.resolveComponent("el-tab-pane"),C=e.resolveComponent("el-tabs");return e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",oe,[e.renderSlot(p.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",ne,[e.createVNode(C,{modelValue:y.value,"onUpdate:modelValue":f[0]||(f[0]=w=>y.value=w),class:"right-tabs",onTabClick:A},{default:e.withCtx(()=>[e.createVNode(h,{name:"account"},{label:e.withCtx(()=>[e.renderSlot(p.$slots,"tabLabel2",{},void 0,!0)]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.renderSlot(p.$slots,"tabContent2",{},void 0,!0)]),e.createElementVNode("div",{class:"tab-button special",onClick:i},[e.createVNode(g,{loading:v.loading},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"tabButton2",{},void 0,!0)]),_:3},8,["loading"])]),e.createElementVNode("div",re,[e.renderSlot(p.$slots,"tabTips2",{},void 0,!0)])]),_:3})]),_:3},8,["modelValue"])])])}}}),le=T._export_sfc(ce,[["__scopeId","data-v-3ebcb6e2"]]),ie={class:"account-wrap"},de=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""},isClickLogin:{type:Boolean,default:!1}},emits:["handleLoginFormChange"],setup(v,{emit:E}){const y=v,c=e.reactive({account:"",password:""}),i=e.reactive({account:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),A=e.ref(null),p=E;return e.watch(()=>y.isClickLogin,f=>{var g;f&&((g=A.value)==null||g.validate(h=>{p("handleLoginFormChange",h,h?c:null)}))},{immediate:!0}),e.watch(()=>y.activeTabName,f=>{var g;f&&((g=A.value)==null||g.resetFields())}),(f,g)=>{const h=e.resolveComponent("svg-icon"),C=e.resolveComponent("el-input"),w=e.resolveComponent("el-form-item"),k=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(k,{model:c,rules:i,ref_key:"formRef",ref:A},{default:e.withCtx(()=>[e.createVNode(w,{label:"",prop:"account"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:c.account,"onUpdate:modelValue":g[0]||(g[0]=S=>c.account=S),placeholder:"请输入账号",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(h,{name:"account",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(w,{label:"",prop:"password"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:c.password,"onUpdate:modelValue":g[1]||(g[1]=S=>c.password=S),type:"password",placeholder:"请输入密码","show-password":"",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(h,{name:"password",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])}}}),ue=T._export_sfc(de,[["__scopeId","data-v-b023e8c1"]]),pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAd9JREFUWEftl71OAkEQx/97QC8XEj+iiTGexo/OnvgE0ChPIIXHQwgP4amxsYZGnkCtpbAxxiyJFEqCJie1yK7ZixhUuNtZYkLUa2/+M7+ZnbnbYTB87P3bIpi1BWCt34UEzpkUF35huWjimpmIlCbp8TMGbA7RX/uus27i2xjI9rgMC+i7jpFvI5EC+XEg2+NlSKTBMKmTuS5QlB2ApgRqz66TVXGDCmmIPhh7RxGl0bXrT15pWNLjVQZkdBuwF0i3qaPAv8StMNvjDwBmdIGQwJyfd+51xn7i4GbekvE7bd8SLQUUOi3fnElR0v3GvEPvaQOpHiIDKe9SlIQlTtq7K41BwexjPosXsQNmkWCCpjYCoqRMtP0HiirY76uQBWQRS1xalhCvnW4aQDmqCmHvR6rQsB/oKIMyClDOd53KoGxTHs8IoGpSKWOgeCI29ZhfaA0EOmpMi26n+beBAIzXkanjGLemDlpkrMbepGmjNMZTFuXY9D0dSF09wE7bhaWrsKD2IV+FgNrNtilwVKCK7zo5SgDqJY0EFJPMeSos1ilAKa++ISBruhoSUNi3Z1hA2+PqyLR/uPRLvm6qJnbqkk9dg0ziEDQV8qJIcE42DRbFnkp3lSZHiRZ8WqXfAFwe+He0YFLSAAAAAElFTkSuQmCC",fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAx1JREFUWEfFV01oE1EQnnmpYJRGL/6gYsGLVCoUzMGLNrO1B4sYKooXQT0JWtSK4KEHEVERPCjUHgqCQlFED4raUmP3bS0UhRQKnrTorQdFBBOkBZP97AuJbNo0+2KF7GlJ3sz3zcw3M2+Z6vxwnfHJmkAqlVrT0NCwB8BepdQuAOuJaEMxgK/M/M33/UlmfpvL5cY7Ojp+2gQXSiCdTq/IZrNniOg0gM1WTplniKi/sbHxbjwe/13NpioBrXUcwB0iarUBrnBmipnPiUh6KfslCXiet9/3/af/CFxmppQ6nEgkhiv5qkhAa90N4Ob/AC/5YOZLItK30OciAlrrAwAe24Iz8yul1A0imgPQ5ft+75LpZj4qIi+D/5cRMILLZDJejTXvcRxnwDgdGxtrzufzS9abiKZisVgiKMwyAlrr8wCu2UZvzjHzgIj0mHet9fH59uyvqnrmXhG5/bc0pZehoaFYNBpN27ZaoLY/mPk1EeUAmDnRFEJgZnZ2Nt7Z2ZkpBFA6rLXeB+B5LdEXM/ARwPZa7Jg5KSJvygi4rnuFiC7aOlJKPSCiR4lEYrw4L0aIaKWl/S3HcS6XEfA8b9T3/d2WDoxORhzHmQxk0JSv2cZeKfVunnj7whJ8ALDNwkFBpMy8Q0SOBQhMA9hkYW9sv4jIzoUEvgFYbeHAEOgFcKK9vf1JUf0tAN5b2BaOMPMvETHLrEyEtgQKTmKx2NpSP7uue4GIri6XgG0JTARDInIkkP5hs6ZrILC4BLWIkJlPicigAZyYmIjOzc19twU35yqKsJY2zGazG5PJZNY4c103SUQPayFARIvb0HYQMfOoiBwMpL8PwEkiMkPMkAl9Kg4i21HMzGdF5F4JxfO8TwA+Axg33RGGzsyVR3GxnUKXETM3iUih5lrrFiK6T0TdRPQCwCoLApWXkTG0WceRSKS1ra1tugSUSqWa5397RkRbwsBD13ExqqoXEqXUYD6fvx6JRLYCOEREXQDWWYCb9q1+IQkIq35XsoC46ncpDWSiftfyEom6fpgEhVW3TzMbdS/nTOi34XKc29j+AXyzojCfNKqJAAAAAElFTkSuQmCC",ge={class:"card-wrap"},ye={class:"card-icon card"},me={class:"card-input"},Ae={class:"card-icon info"},he=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""}},emits:["handleCardInput"],setup(v,{emit:E}){const y=v,c=e.ref(""),i=E,A=p=>{i("handleCardInput",p)};return e.watch(()=>y.activeTabName,p=>{p&&(c.value="")}),(p,f)=>{const g=e.resolveComponent("el-image"),h=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",ye,[e.createVNode(g,{src:e.unref(pe),fit:"contain"},null,8,["src"])]),e.createElementVNode("div",me,[e.createVNode(h,{modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=C=>c.value=C),onChange:A,clearable:""},null,8,["modelValue"])]),e.createElementVNode("div",Ae,[e.createVNode(g,{src:e.unref(fe),fit:"contain"},null,8,["src"])])])}}}),be=T._export_sfc(he,[["__scopeId","data-v-23f91251"]]),ve=u.useMenuState(u.pinia),R=G.useLoginState(u.pinia),J=e.ref(!1),X=e.ref(!1),_e=async()=>{const v=u.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),E=u.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});return await Promise.all([v,E]).then(y=>{var A,p,f,g,h,C,w,k,S,K,M,B,U,L;const c=y==null?void 0:y[0],i=y==null?void 0:y[1];if(c.data.code===200){const D=(w=(C=(h=(g=(f=(p=(A=c==null?void 0:c.data)==null?void 0:A.result)==null?void 0:p[0])==null?void 0:f.value)==null?void 0:g.pageData)==null?void 0:h.compData)==null?void 0:C[0])==null?void 0:w.contents;ve.setRawMenus(D??[]),J.value=((k=c==null?void 0:c.data)==null?void 0:k.result)&&((K=(S=c==null?void 0:c.data)==null?void 0:S.result)==null?void 0:K.length)>0}else u.ElMessage.error("获取模型菜单响应失败");i.data.code===200?i.data.result&&((M=i.data.result)==null?void 0:M.length)>0&&(R.setStructureData(i.data.result),R.setIsStructureExist(!0),X.value=((B=i==null?void 0:i.data)==null?void 0:B.result)&&((L=(U=i==null?void 0:i.data)==null?void 0:U.result)==null?void 0:L.length)>0):u.ElMessage.error("获取模型结构响应失败")}),{menuExist:J.value,structureExist:X.value}};function Ce(){const v={account:"superadmin",password:"1c8e7623312244c1feb677732278fb8b2af6af1a5335fdaebbdb2720137b372b7871292d11165b83b2967b9c39fa37027d63d37a2f36d764257b566dcfa99f334faa8995301601aec549adf39aef8d89c8788da03a9164937a5f73af20a15ea60d47c7cf01cf",tenantId:-1,code:"",codeId:0};return u.service({url:"/api/sysAuth/login",method:"post",data:v})}const we={class:"login-wrap"},Ee={class:"login-body"},Ne={class:"login-body-item left"},Se={class:"login-body-item right"},ke=e.defineComponent({__name:"index",emits:["change"],setup(v,{emit:E}){const y=F.useRouter(),c=G.useLoginState(u.pinia),i=e.ref({sysCTitle:"",sysETitle:"",loginTitle:"账户密码登录",tabs:[{name:"刷卡登录",btnLabel:"请刷卡登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"},{name:"用户名登录",btnLabel:"登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"}]}),A=e.ref(""),p=e.ref(!1),f=e.ref(!1),g=()=>{p.value=!0},h=a=>{p.value=!1,q(a)},C=(a,o)=>{p.value=!1,a&&q(o)},w=a=>x.getFirstArrayProperty(a),k=a=>{let o;const n=x.convertArrayToTree(a),s=x.addPathToTree(n),m=x.getLeafNodesRecursive(s),b=x.groupByField(m,"parentPath");return o=x.handleRowAuthorityRender(b),o},S=(a,o)=>{var s,m,b;const n=(o==null?void 0:o.userRoles)??(o==null?void 0:o.角色名称);try{if(o.layer&&((s=o==null?void 0:o.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN")return"superAdmin";if(Array.isArray(n)){if((n==null?void 0:n.length)===1){const r=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===(n==null?void 0:n[0])||t.角色名称===(n==null?void 0:n[0])),_=w(r),l=k(r==null?void 0:r[_]);return r&&l&&Array.isArray(l)?r?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}if((n==null?void 0:n.length)>1){let r=a==null?void 0:a.filter(t=>n==null?void 0:n.includes(t.roleName||(t==null?void 0:t.角色名称)));const _=w(r==null?void 0:r[0]),l=(b=(m=r==null?void 0:r.map(t=>Array.isArray(t==null?void 0:t[_])?t==null?void 0:t[_]:[]))==null?void 0:m.flat())==null?void 0:b.flatMap(t=>t.checkedButtons);return(l==null?void 0:l.length)===0?u.ElMessage.error("该用户没有权限,请联系管理员"):new Set(l)}}if(typeof n=="string"){const r=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===n||(t==null?void 0:t.角色名称)===n),_=w(r),l=k(r==null?void 0:r[_]);return r&&l&&Array.isArray(l)?r?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}}catch(r){throw new Error(r)}},K=async a=>{var o,n;try{let s=[];const m=await u.getInsofDataApi({key:{systemKey:a==null?void 0:a.systemKey,pageKey:"系统管理/角色管理",type:"data"}});if(m.data.code===200){const b=(n=(o=m.data)==null?void 0:o.result)==null?void 0:n.map(r=>r.value.tableData);s=S(b,a)}if(s)return Array.isArray(s)?Array.from(s):s;throw u.ElMessage.error("获取用户权限失败,请联系管理员"),new Error("获取用户权限失败,请联系管理员")}catch(s){throw u.ElMessage.error("获取用户权限失败,请联系管理员"),new Error(s)}},M=async a=>{var o,n,s,m,b,r,_;try{let l=[],t,I;const P=await u.getInsofDataApi({key:{pageKey:"系统管理/用户管理",type:"data"}}),O=await u.getInsofDataApi({keyLikes:{layer:"superAdmin"}});if(P.data.code===200&&O.data.code===200){const Y=(n=(o=O.data)==null?void 0:o.result)==null?void 0:n.map(d=>{var N,V;return{...d.value.tableData,layer:(N=d.key)==null?void 0:N.layer,systemKey:(V=d==null?void 0:d.key)==null?void 0:V.systemKey,id:d.id}}),j=(m=(s=P.data)==null?void 0:s.result)==null?void 0:m.map(d=>{var N,V;return{...d.value.tableData,layer:(N=d.key)==null?void 0:N.layer,systemKey:(V=d==null?void 0:d.key)==null?void 0:V.systemKey,id:d.id}}),Q=[...Y,...j];if(t=Q==null?void 0:Q.find(d=>(d==null?void 0:d.account)===(a==null?void 0:a.account)||(d==null?void 0:d.账号)===(a==null?void 0:a.account)),t){if(((b=t.layer)==null?void 0:b.toUpperCase())!=="SUPERADMIN"&&(!(t!=null&&t.状态)||(t==null?void 0:t.状态)==="禁用"||(t==null?void 0:t.status)==="禁用")){u.ElMessage.error("该用户已被禁用,请联系管理员"),f.value=!1;return}l=await K(t);const{privateKey:d}=await c.getModelSecretAsync(t);let N;if(t.password?N=((r=t.layer)==null?void 0:r.toUpperCase())==="SUPERADMIN"?t.password:W.decryptData(t.password,d):N=((_=t.layer)==null?void 0:_.toUpperCase())==="SUPERADMIN"?t.password:x.resetPassword,(a==null?void 0:a.password)===N)I=t;else throw I=null,u.ElMessage.error("输入的密码错误,请重新输入"),f.value=!1,new Error("输入的密码错误,请重新输入")}}return I&&l?{matchedUser:I,userAuthority:l}:void 0}catch(l){throw new Error(l)}},B=async a=>{var n,s,m;const o=await M(a);if(o!=null&&o.matchedUser){c.setLoginUserInfo(o.matchedUser),sessionStorage.setItem("authority",JSON.stringify(o.userAuthority));const b=((s=(n=o.matchedUser)==null?void 0:n.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN";return sessionStorage.setItem("isSuperAdmin",JSON.stringify(b)),sessionStorage.setItem("systemKey",(m=o.matchedUser)==null?void 0:m.systemKey),await U(o.matchedUser),!0}else throw f.value=!1,u.ElMessage.error("该用户不存在,请重新输入"),new Error("该用户不存在,请重新输入")},U=async a=>{var n,s,m,b,r,_,l,t,I;const o=await u.getInsofDataApi({key:{layer:"superAdmin",systemKey:a==null?void 0:a.systemKey}});if(o.data.code===200&&(n=o.data)!=null&&n.result&&Array.isArray((s=o.data)==null?void 0:s.result)&&((b=(m=o.data)==null?void 0:m.result)==null?void 0:b.length)>0){const P=(I=(t=(l=(_=(r=o.data)==null?void 0:r.result)==null?void 0:_[0])==null?void 0:l.value)==null?void 0:t.tableData)==null?void 0:I.account;c.setSuperAdminInfo({account:P})}},L=async()=>{var a,o,n;try{const s=await Ce();return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("loginToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){u.ElMessage.error(s)}},D=async()=>{var a,o,n;try{const s=await u.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("magicToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){u.ElMessage.error(s)}},q=a=>{f.value=!0;let o=[B(a),L(),D()];Promise.all(o).then(n=>{(n==null?void 0:n.every(m=>m))&&(_e(),y.push("/"),c.setLogRecordAsync({type:"登录",data:{account:a==null?void 0:a.account}},"/login","login"))})},Z=a=>{A.value=a,p.value=!1,f.value=!1};return(a,o)=>(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",Ee,[e.createElementVNode("div",Ne,[e.createVNode(te,{class:"login-left-bg"},{img:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("div",{class:"title"},[e.createElementVNode("div",null,"INSOFWORKS"),e.createElementVNode("div",null,"工业软件集成开发平台")],-1),e.createElementVNode("div",{class:"divide-line"},null,-1)])),_:1})]),e.createElementVNode("div",Se,[e.createVNode(le,{loading:f.value,onClickLogin:g,onHandleTabClick:Z},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.loginTitle),1)]),tabLabel1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[0].name),1)]),tabContent1:e.withCtx(()=>[e.createVNode(be,{activeTabName:A.value,onHandleCardInput:h},null,8,["activeTabName"])]),tabButton1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[0].btnLabel),1)]),tabLabel2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[1].name),1)]),tabContent2:e.withCtx(()=>[e.createVNode(ue,{activeTabName:A.value,isClickLogin:p.value,onHandleLoginFormChange:C},null,8,["activeTabName","isClickLogin"])]),tabButton2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[1].btnLabel),1)]),_:1},8,["loading"])])])]))}}),Ie=T._export_sfc(ke,[["__scopeId","data-v-67c34ff9"]]);exports.default=Ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),T=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F=require("vue-router"),G=require("./login-9FT8kgSz.cjs"),u=require("./menu-ScIJ5kqr.cjs"),W=require("./crypto-CRbcEKIz.cjs"),x=require("./index-BE8DQhoN.cjs"),H={},z={class:"left-wrap"},$={class:"left-bg"};function ee(v,E){return e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",$,[e.renderSlot(v.$slots,"img",{},void 0,!0)])])}const te=T._export_sfc(H,[["render",ee],["__scopeId","data-v-9b7ee6c9"]]),ae={class:"right-wrap"},oe={class:"right-title"},ne={class:"right-content"},se={class:"tab-content"},re={class:"tab-tips"},ce=e.defineComponent({__name:"index",props:{tabList:{type:Array,default:[]},loading:{type:Boolean,default:!1}},emits:["clickLogin","handleTabClick"],setup(v,{emit:E}){const y=e.ref("account"),c=E,i=()=>{c("clickLogin",y.value)},A=()=>{c("handleTabClick",y.value)};return(p,f)=>{const g=e.resolveComponent("el-button"),h=e.resolveComponent("el-tab-pane"),C=e.resolveComponent("el-tabs");return e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",oe,[e.renderSlot(p.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",ne,[e.createVNode(C,{modelValue:y.value,"onUpdate:modelValue":f[0]||(f[0]=w=>y.value=w),class:"right-tabs",onTabClick:A},{default:e.withCtx(()=>[e.createVNode(h,{name:"account"},{label:e.withCtx(()=>[e.renderSlot(p.$slots,"tabLabel2",{},void 0,!0)]),default:e.withCtx(()=>[e.createElementVNode("div",se,[e.renderSlot(p.$slots,"tabContent2",{},void 0,!0)]),e.createElementVNode("div",{class:"tab-button special",onClick:i},[e.createVNode(g,{loading:v.loading},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"tabButton2",{},void 0,!0)]),_:3},8,["loading"])]),e.createElementVNode("div",re,[e.renderSlot(p.$slots,"tabTips2",{},void 0,!0)])]),_:3})]),_:3},8,["modelValue"])])])}}}),le=T._export_sfc(ce,[["__scopeId","data-v-3ebcb6e2"]]),ie={class:"account-wrap"},de=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""},isClickLogin:{type:Boolean,default:!1}},emits:["handleLoginFormChange"],setup(v,{emit:E}){const y=v,c=e.reactive({account:"",password:""}),i=e.reactive({account:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),A=e.ref(null),p=E;return e.watch(()=>y.isClickLogin,f=>{var g;f&&((g=A.value)==null||g.validate(h=>{p("handleLoginFormChange",h,h?c:null)}))},{immediate:!0}),e.watch(()=>y.activeTabName,f=>{var g;f&&((g=A.value)==null||g.resetFields())}),(f,g)=>{const h=e.resolveComponent("svg-icon"),C=e.resolveComponent("el-input"),w=e.resolveComponent("el-form-item"),k=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(k,{model:c,rules:i,ref_key:"formRef",ref:A},{default:e.withCtx(()=>[e.createVNode(w,{label:"",prop:"account"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:c.account,"onUpdate:modelValue":g[0]||(g[0]=S=>c.account=S),placeholder:"请输入账号",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(h,{name:"account",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(w,{label:"",prop:"password"},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:c.password,"onUpdate:modelValue":g[1]||(g[1]=S=>c.password=S),type:"password",placeholder:"请输入密码","show-password":"",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(h,{name:"password",style:{width:"15px",height:"15px"}})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])}}}),ue=T._export_sfc(de,[["__scopeId","data-v-b023e8c1"]]),pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAd9JREFUWEftl71OAkEQx/97QC8XEj+iiTGexo/OnvgE0ChPIIXHQwgP4amxsYZGnkCtpbAxxiyJFEqCJie1yK7ZixhUuNtZYkLUa2/+M7+ZnbnbYTB87P3bIpi1BWCt34UEzpkUF35huWjimpmIlCbp8TMGbA7RX/uus27i2xjI9rgMC+i7jpFvI5EC+XEg2+NlSKTBMKmTuS5QlB2ApgRqz66TVXGDCmmIPhh7RxGl0bXrT15pWNLjVQZkdBuwF0i3qaPAv8StMNvjDwBmdIGQwJyfd+51xn7i4GbekvE7bd8SLQUUOi3fnElR0v3GvEPvaQOpHiIDKe9SlIQlTtq7K41BwexjPosXsQNmkWCCpjYCoqRMtP0HiirY76uQBWQRS1xalhCvnW4aQDmqCmHvR6rQsB/oKIMyClDOd53KoGxTHs8IoGpSKWOgeCI29ZhfaA0EOmpMi26n+beBAIzXkanjGLemDlpkrMbepGmjNMZTFuXY9D0dSF09wE7bhaWrsKD2IV+FgNrNtilwVKCK7zo5SgDqJY0EFJPMeSos1ilAKa++ISBruhoSUNi3Z1hA2+PqyLR/uPRLvm6qJnbqkk9dg0ziEDQV8qJIcE42DRbFnkp3lSZHiRZ8WqXfAFwe+He0YFLSAAAAAElFTkSuQmCC",fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAx1JREFUWEfFV01oE1EQnnmpYJRGL/6gYsGLVCoUzMGLNrO1B4sYKooXQT0JWtSK4KEHEVERPCjUHgqCQlFED4raUmP3bS0UhRQKnrTorQdFBBOkBZP97AuJbNo0+2KF7GlJ3sz3zcw3M2+Z6vxwnfHJmkAqlVrT0NCwB8BepdQuAOuJaEMxgK/M/M33/UlmfpvL5cY7Ojp+2gQXSiCdTq/IZrNniOg0gM1WTplniKi/sbHxbjwe/13NpioBrXUcwB0iarUBrnBmipnPiUh6KfslCXiet9/3/af/CFxmppQ6nEgkhiv5qkhAa90N4Ob/AC/5YOZLItK30OciAlrrAwAe24Iz8yul1A0imgPQ5ft+75LpZj4qIi+D/5cRMILLZDJejTXvcRxnwDgdGxtrzufzS9abiKZisVgiKMwyAlrr8wCu2UZvzjHzgIj0mHet9fH59uyvqnrmXhG5/bc0pZehoaFYNBpN27ZaoLY/mPk1EeUAmDnRFEJgZnZ2Nt7Z2ZkpBFA6rLXeB+B5LdEXM/ARwPZa7Jg5KSJvygi4rnuFiC7aOlJKPSCiR4lEYrw4L0aIaKWl/S3HcS6XEfA8b9T3/d2WDoxORhzHmQxk0JSv2cZeKfVunnj7whJ8ALDNwkFBpMy8Q0SOBQhMA9hkYW9sv4jIzoUEvgFYbeHAEOgFcKK9vf1JUf0tAN5b2BaOMPMvETHLrEyEtgQKTmKx2NpSP7uue4GIri6XgG0JTARDInIkkP5hs6ZrILC4BLWIkJlPicigAZyYmIjOzc19twU35yqKsJY2zGazG5PJZNY4c103SUQPayFARIvb0HYQMfOoiBwMpL8PwEkiMkPMkAl9Kg4i21HMzGdF5F4JxfO8TwA+Axg33RGGzsyVR3GxnUKXETM3iUih5lrrFiK6T0TdRPQCwCoLApWXkTG0WceRSKS1ra1tugSUSqWa5397RkRbwsBD13ExqqoXEqXUYD6fvx6JRLYCOEREXQDWWYCb9q1+IQkIq35XsoC46ncpDWSiftfyEom6fpgEhVW3TzMbdS/nTOi34XKc29j+AXyzojCfNKqJAAAAAElFTkSuQmCC",ge={class:"card-wrap"},ye={class:"card-icon card"},me={class:"card-input"},Ae={class:"card-icon info"},he=e.defineComponent({__name:"index",props:{activeTabName:{type:String,default:""}},emits:["handleCardInput"],setup(v,{emit:E}){const y=v,c=e.ref(""),i=E,A=p=>{i("handleCardInput",p)};return e.watch(()=>y.activeTabName,p=>{p&&(c.value="")}),(p,f)=>{const g=e.resolveComponent("el-image"),h=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",ye,[e.createVNode(g,{src:e.unref(pe),fit:"contain"},null,8,["src"])]),e.createElementVNode("div",me,[e.createVNode(h,{modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=C=>c.value=C),onChange:A,clearable:""},null,8,["modelValue"])]),e.createElementVNode("div",Ae,[e.createVNode(g,{src:e.unref(fe),fit:"contain"},null,8,["src"])])])}}}),be=T._export_sfc(he,[["__scopeId","data-v-23f91251"]]),ve=u.useMenuState(u.pinia),R=G.useLoginState(u.pinia),J=e.ref(!1),X=e.ref(!1),_e=async()=>{const v=u.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),E=u.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});return await Promise.all([v,E]).then(y=>{var A,p,f,g,h,C,w,k,S,K,M,B,U,L;const c=y==null?void 0:y[0],i=y==null?void 0:y[1];if(c.data.code===200){const D=(w=(C=(h=(g=(f=(p=(A=c==null?void 0:c.data)==null?void 0:A.result)==null?void 0:p[0])==null?void 0:f.value)==null?void 0:g.pageData)==null?void 0:h.compData)==null?void 0:C[0])==null?void 0:w.contents;ve.setRawMenus(D??[]),J.value=((k=c==null?void 0:c.data)==null?void 0:k.result)&&((K=(S=c==null?void 0:c.data)==null?void 0:S.result)==null?void 0:K.length)>0}else u.ElMessage.error("获取模型菜单响应失败");i.data.code===200?i.data.result&&((M=i.data.result)==null?void 0:M.length)>0&&(R.setStructureData(i.data.result),R.setIsStructureExist(!0),X.value=((B=i==null?void 0:i.data)==null?void 0:B.result)&&((L=(U=i==null?void 0:i.data)==null?void 0:U.result)==null?void 0:L.length)>0):u.ElMessage.error("获取模型结构响应失败")}),{menuExist:J.value,structureExist:X.value}};function Ce(){const v={account:"superadmin",password:"1c8e7623312244c1feb677732278fb8b2af6af1a5335fdaebbdb2720137b372b7871292d11165b83b2967b9c39fa37027d63d37a2f36d764257b566dcfa99f334faa8995301601aec549adf39aef8d89c8788da03a9164937a5f73af20a15ea60d47c7cf01cf",tenantId:-1,code:"",codeId:0};return u.service({url:"/api/sysAuth/login",method:"post",data:v})}const we={class:"login-wrap"},Ee={class:"login-body"},Ne={class:"login-body-item left"},Se={class:"login-body-item right"},ke=e.defineComponent({__name:"index",emits:["change"],setup(v,{emit:E}){const y=F.useRouter(),c=G.useLoginState(u.pinia),i=e.ref({sysCTitle:"",sysETitle:"",loginTitle:"账户密码登录",tabs:[{name:"刷卡登录",btnLabel:"请刷卡登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"},{name:"用户名登录",btnLabel:"登录",tips:"温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"}]}),A=e.ref(""),p=e.ref(!1),f=e.ref(!1),g=()=>{p.value=!0},h=a=>{p.value=!1,q(a)},C=(a,o)=>{p.value=!1,a&&q(o)},w=a=>x.getFirstArrayProperty(a),k=a=>{let o;const n=x.convertArrayToTree(a),s=x.addPathToTree(n),m=x.getLeafNodesRecursive(s),b=x.groupByField(m,"parentPath");return o=x.handleRowAuthorityRender(b),o},S=(a,o)=>{var s,m,b;const n=(o==null?void 0:o.userRoles)??(o==null?void 0:o.角色名称);try{if(o.layer&&((s=o==null?void 0:o.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN")return"superAdmin";if(Array.isArray(n)){if((n==null?void 0:n.length)===1){const r=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===(n==null?void 0:n[0])||t.角色名称===(n==null?void 0:n[0])),_=w(r),l=k(r==null?void 0:r[_]);return r&&l&&Array.isArray(l)?r?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}if((n==null?void 0:n.length)>1){let r=a==null?void 0:a.filter(t=>n==null?void 0:n.includes(t.roleName||(t==null?void 0:t.角色名称)));const _=w(r==null?void 0:r[0]),l=(b=(m=r==null?void 0:r.map(t=>Array.isArray(t==null?void 0:t[_])?t==null?void 0:t[_]:[]))==null?void 0:m.flat())==null?void 0:b.flatMap(t=>t.checkedButtons);return(l==null?void 0:l.length)===0?u.ElMessage.error("该用户没有权限,请联系管理员"):new Set(l)}}if(typeof n=="string"){const r=a==null?void 0:a.find(t=>(t==null?void 0:t.roleName)===n||(t==null?void 0:t.角色名称)===n),_=w(r),l=k(r==null?void 0:r[_]);return r&&l&&Array.isArray(l)?r?l==null?void 0:l.flatMap(t=>t.checkedButtons):[]:[]}}catch(r){throw new Error(r)}},K=async a=>{var o,n;try{let s=[];const m=await u.getInsofDataApi({key:{systemKey:a==null?void 0:a.systemKey,pageKey:"系统管理/角色管理",type:"data"}});if(m.data.code===200){const b=(n=(o=m.data)==null?void 0:o.result)==null?void 0:n.map(r=>r.value.tableData);s=S(b,a)}if(s)return Array.isArray(s)?Array.from(s):s;throw u.ElMessage.error("获取用户权限失败,请联系管理员"),new Error("获取用户权限失败,请联系管理员")}catch(s){throw u.ElMessage.error("获取用户权限失败,请联系管理员"),new Error(s)}},M=async a=>{var o,n,s,m,b,r,_;try{let l=[],t,I;const P=await u.getInsofDataApi({key:{pageKey:"系统管理/用户管理",type:"data"}}),O=await u.getInsofDataApi({keyLikes:{layer:"superAdmin"}});if(P.data.code===200&&O.data.code===200){const Y=(n=(o=O.data)==null?void 0:o.result)==null?void 0:n.map(d=>{var N,V;return{...d.value.tableData,layer:(N=d.key)==null?void 0:N.layer,systemKey:(V=d==null?void 0:d.key)==null?void 0:V.systemKey,id:d.id}}),j=(m=(s=P.data)==null?void 0:s.result)==null?void 0:m.map(d=>{var N,V;return{...d.value.tableData,layer:(N=d.key)==null?void 0:N.layer,systemKey:(V=d==null?void 0:d.key)==null?void 0:V.systemKey,id:d.id}}),Q=[...Y,...j];if(t=Q==null?void 0:Q.find(d=>(d==null?void 0:d.account)===(a==null?void 0:a.account)||(d==null?void 0:d.账号)===(a==null?void 0:a.account)),t){if(((b=t.layer)==null?void 0:b.toUpperCase())!=="SUPERADMIN"&&(!(t!=null&&t.状态)||(t==null?void 0:t.状态)==="禁用"||(t==null?void 0:t.status)==="禁用")){u.ElMessage.error("该用户已被禁用,请联系管理员"),f.value=!1;return}l=await K(t);const{privateKey:d}=await c.getModelSecretAsync(t);let N;if(t.password?N=((r=t.layer)==null?void 0:r.toUpperCase())==="SUPERADMIN"?t.password:W.decryptData(t.password,d):N=((_=t.layer)==null?void 0:_.toUpperCase())==="SUPERADMIN"?t.password:x.resetPassword,(a==null?void 0:a.password)===N)I=t;else throw I=null,u.ElMessage.error("输入的密码错误,请重新输入"),f.value=!1,new Error("输入的密码错误,请重新输入")}}return I&&l?{matchedUser:I,userAuthority:l}:void 0}catch(l){throw new Error(l)}},B=async a=>{var n,s,m;const o=await M(a);if(o!=null&&o.matchedUser){c.setLoginUserInfo(o.matchedUser),sessionStorage.setItem("authority",JSON.stringify(o.userAuthority));const b=((s=(n=o.matchedUser)==null?void 0:n.layer)==null?void 0:s.toUpperCase())==="SUPERADMIN";return sessionStorage.setItem("isSuperAdmin",JSON.stringify(b)),sessionStorage.setItem("systemKey",(m=o.matchedUser)==null?void 0:m.systemKey),await U(o.matchedUser),!0}else throw f.value=!1,u.ElMessage.error("该用户不存在,请重新输入"),new Error("该用户不存在,请重新输入")},U=async a=>{var n,s,m,b,r,_,l,t,I;const o=await u.getInsofDataApi({key:{layer:"superAdmin",systemKey:a==null?void 0:a.systemKey}});if(o.data.code===200&&(n=o.data)!=null&&n.result&&Array.isArray((s=o.data)==null?void 0:s.result)&&((b=(m=o.data)==null?void 0:m.result)==null?void 0:b.length)>0){const P=(I=(t=(l=(_=(r=o.data)==null?void 0:r.result)==null?void 0:_[0])==null?void 0:l.value)==null?void 0:t.tableData)==null?void 0:I.account;c.setSuperAdminInfo({account:P})}},L=async()=>{var a,o,n;try{const s=await Ce();return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("loginToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){u.ElMessage.error(s)}},D=async()=>{var a,o,n;try{const s=await u.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});return((a=s==null?void 0:s.data)==null?void 0:a.code)===200?(sessionStorage.setItem("magicToken",(n=(o=s.data)==null?void 0:o.result)==null?void 0:n.accessToken),!0):!1}catch(s){u.ElMessage.error(s)}},q=a=>{f.value=!0;let o=[B(a),L(),D()];Promise.all(o).then(n=>{(n==null?void 0:n.every(m=>m))&&(_e(),y.push("/"),c.setLogRecordAsync({type:"登录",data:{account:a==null?void 0:a.account}},"/login","login"))})},Z=a=>{A.value=a,p.value=!1,f.value=!1};return(a,o)=>(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",Ee,[e.createElementVNode("div",Ne,[e.createVNode(te,{class:"login-left-bg"},{img:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("div",{class:"title"},[e.createElementVNode("div",null,"INSOFWORKS"),e.createElementVNode("div",null,"工业软件集成开发平台")],-1),e.createElementVNode("div",{class:"divide-line"},null,-1)])),_:1})]),e.createElementVNode("div",Se,[e.createVNode(le,{loading:f.value,onClickLogin:g,onHandleTabClick:Z},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.loginTitle),1)]),tabLabel1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[0].name),1)]),tabContent1:e.withCtx(()=>[e.createVNode(be,{activeTabName:A.value,onHandleCardInput:h},null,8,["activeTabName"])]),tabButton1:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[0].btnLabel),1)]),tabLabel2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[1].name),1)]),tabContent2:e.withCtx(()=>[e.createVNode(ue,{activeTabName:A.value,isClickLogin:p.value,onHandleLoginFormChange:C},null,8,["activeTabName","isClickLogin"])]),tabButton2:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.tabs[1].btnLabel),1)]),_:1},8,["loading"])])])]))}}),Ie=T._export_sfc(ke,[["__scopeId","data-v-c8fd23a9"]]);exports.default=Ie;
@@ -500,7 +500,7 @@ const Yt = { class: "login-wrap" }, Ft = { class: "login-body" }, Wt = { class:
500
500
  ])
501
501
  ]));
502
502
  }
503
- }), oe = /* @__PURE__ */ R(zt, [["__scopeId", "data-v-67c34ff9"]]);
503
+ }), oe = /* @__PURE__ */ R(zt, [["__scopeId", "data-v-c8fd23a9"]]);
504
504
  export {
505
505
  oe as default
506
506
  };