ss-component-new 1.1.647 → 1.1.649
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/{array-NXwPkThl.js → array-CmuXVJcq.js} +1 -1
- package/dist/{array-Dbtz7Lsx.cjs → array-aPSjboDC.cjs} +1 -1
- package/dist/icons/svg/account.svg +1 -0
- package/dist/icons/svg/password.svg +1 -0
- package/dist/{index-BHB6W84v.js → index-0HD35fP-.js} +1 -1
- package/dist/index-1vppGfrB.cjs +1 -0
- package/dist/{index-CMLAuXhA.cjs → index-BCtH2YUo.cjs} +1 -1
- package/dist/{index-ZCzNjeSn.cjs → index-BEAaSlwn.cjs} +1 -1
- package/dist/{index-cECmgKhq.cjs → index-BMPwcf8P.cjs} +1 -1
- package/dist/{index-CSP32Cpe.js → index-BMiIYkQX.js} +17 -17
- package/dist/{index-D8yxAzMr.cjs → index-BRgti4Vk.cjs} +1 -1
- package/dist/{index-DFeluCs6.js → index-BZcD1S7f.js} +5 -5
- package/dist/{index-CyTvXRd_.js → index-BbXTjZC6.js} +14 -14
- package/dist/{index-D__jheUt.js → index-Bc4QRK5_.js} +1453 -1432
- package/dist/{index-DB0h-mJg.js → index-BdwwvqBV.js} +5 -5
- package/dist/{index-DUfwkFTo.js → index-Bg8pXrX1.js} +1 -1
- package/dist/{index-fxYQxMly.cjs → index-Bkc_eA-6.cjs} +1 -1
- package/dist/{index-C4h0etKA.cjs → index-Bmvc2b5a.cjs} +1 -1
- package/dist/{index-DfOFUswy.cjs → index-C-zHD2dx.cjs} +24 -24
- package/dist/{index-DuLknvYQ.js → index-C0Skr8vW.js} +3 -3
- package/dist/{index-B5jfLywn.cjs → index-C0XUPmmN.cjs} +1 -1
- package/dist/{index-BJO5oW-6.js → index-C9HkqXuv.js} +1 -1
- package/dist/index-CK0nMCCq.js +4758 -0
- package/dist/{index-Dg5bZiqz.cjs → index-CPrLaNjA.cjs} +1 -1
- package/dist/{index-C-r2A3LQ.js → index-CUfvgW-P.js} +1 -1
- package/dist/{index-DtOjrRlk.js → index-CaRvdQDj.js} +188 -178
- package/dist/{index-DXpOifO9.cjs → index-CaccSGDq.cjs} +1 -1
- package/dist/{index-_BlT7Ow2.cjs → index-Cax9Gcc2.cjs} +1 -1
- package/dist/{index-BSjgPb_u.js → index-CfqT1FB6.js} +4 -4
- package/dist/{index-BiKU5NYv.js → index-Chz_f8HF.js} +4 -4
- package/dist/{index-CjB80Fuo.cjs → index-CoLPeWbP.cjs} +1 -1
- package/dist/{index-Bsqef1GK.cjs → index-D33XDWeA.cjs} +1 -1
- package/dist/index-DAaL5Eoq.cjs +1 -0
- package/dist/{index-CnDYddiq.js → index-DL6591by.js} +1 -1
- package/dist/{index-C5HGe8wB.cjs → index-DOMlBYd3.cjs} +1 -1
- package/dist/{index-DsvjWAeE.cjs → index-DOaMKKyw.cjs} +1 -1
- package/dist/{index-e6ImJxWd.cjs → index-DY6p_kYl.cjs} +1 -1
- package/dist/{index-BHPcjVK9.js → index-D_JcQBhQ.js} +3 -3
- package/dist/{index-DO2ACn4u.js → index-Da0aT75u.js} +3526 -3536
- package/dist/{index-XGGpr3tc.cjs → index-DavPYW6C.cjs} +1 -1
- package/dist/index-DfeSp3Xs.cjs +1 -0
- package/dist/{index-BNPpYTxK.js → index-DkCoZbhh.js} +3 -3
- package/dist/{index-BKOLVNLy.js → index-DlZ39exG.js} +3 -3
- package/dist/{index-CRxQmdqr.cjs → index-DlwxyuGS.cjs} +1 -1
- package/dist/{index-DwmNg-Kj.js → index-Dq69JbNT.js} +26 -26
- package/dist/{index-DoNIQvZN.js → index-DwTtqshG.js} +3 -3
- package/dist/{index-CxSyxnig.cjs → index-GcPeN2Pl.cjs} +1 -1
- package/dist/{index-6bxYAAdE.js → index-SaOuyaJw.js} +6 -6
- package/dist/{index-B1hxh2di.cjs → index-Tq1Lujhv.cjs} +1 -1
- package/dist/{index-4G6sudZa.js → index-h6ZpTS4x.js} +8 -8
- package/dist/{index-D9RJOgdq.cjs → index-p3IpHK5z.cjs} +12 -12
- package/dist/{index-CfoCO3b_.js → index-s1Ss2z_W.js} +315 -308
- package/dist/{index.vue_vue_type_script_setup_true_lang-B9A4aq25.cjs → index.vue_vue_type_script_setup_true_lang-CZgjidw2.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-BAZB0lsu.js → index.vue_vue_type_script_setup_true_lang-DZDm1D_1.js} +21 -21
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CkjKzR_j.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CktgCT12.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-SvIkwdoj.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DVsoGKzS.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Sxrl7ymP.cjs → index.vue_vue_type_style_index_0_scoped_264dc673_lang-BIfh1cHt.cjs} +11 -11
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-DCtL59xZ.js → index.vue_vue_type_style_index_0_scoped_264dc673_lang-BSZ5EEcY.js} +5316 -5268
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-ZVFoMnuN.cjs → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DVUyWmPJ.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-nEOADWRQ.js → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DWtnMEYF.js} +15 -15
- package/dist/{login-BiEodQd9.js → login-CbKgBqdm.js} +8 -8
- package/dist/{login-zGHoUey-.cjs → login-ZGc0USt4.cjs} +1 -1
- package/dist/{main-C3eHN5Lg.cjs → main-AuBsvtRo.cjs} +1 -1
- package/dist/{main-Dup_MZ-f.js → main-FPsSpm49.js} +5 -5
- package/dist/{menu-Cl42pSjw.js → menu-BzQW-fEY.js} +683 -681
- package/dist/{menu-nedhfMQM.cjs → menu-CyErnOWr.cjs} +10 -10
- package/dist/{modelComp-VVOVTdqN.cjs → modelComp-4_7EVAJl.cjs} +1 -1
- package/dist/{modelComp-DWx0hNJL.js → modelComp-U2iMeIQU.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +9 -9
- package/dist/{threeModel-BSrAOw0V.js → threeModel-Cu6GSNTS.js} +2 -2
- package/dist/{threeModel-D_GxJqyT.cjs → threeModel-zBuUEfA7.cjs} +1 -1
- package/package.json +1 -1
- package/public/icons/svg/account.svg +1 -0
- package/public/icons/svg/password.svg +1 -0
- package/dist/index-BOuwY_BP.js +0 -4734
- package/dist/index-CUAI6KvP.cjs +0 -1
- package/dist/index-Dk3SU9zD.cjs +0 -1
- package/dist/index-uDDcvihH.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("vue"),l=require("./menu-nedhfMQM.cjs"),X=require("./login-zGHoUey-.cjs"),ve=require("./modelComp-VVOVTdqN.cjs"),C=require("./crypto-CRbcEKIz.cjs"),de=require("./index-ZCzNjeSn.cjs"),F=l.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Ae=l.useMenuState(l.pinia),{activeMenuPath:d}=l.storeToRefs(Ae),Y=X.useLoginState(l.pinia),{structureData:be}=l.storeToRefs(Y),ke=F(l.pinia),{routerPageStructures:Se}=l.storeToRefs(ke),Z=ve.useModelComp(l.pinia),Be=u.ref([{label:"角色名称",value:"",name:"roleName"}]),Te=u.ref([{label:"查询"},{label:"重置"}]),J=u.reactive({isFilter:!1,filterForm:{}}),Ce=u.ref(!1),De=e=>{J.isFilter=!0,J.filterForm=e},m=u.ref([]),ee=u.ref([]),te=u.ref(""),Pe=u.computed(()=>{var r,s,t,n,a;const e=(r=Se.value)==null?void 0:r.find(o=>{var c;return((c=o==null?void 0:o.comp)==null?void 0:c.toUpperCase())==="TABLE"});if(e){te.value=e.name,ee.value=(n=(t=(s=e==null?void 0:e.compData)==null?void 0:s.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:t.contents)==null?void 0:n.filter(c=>(c==null?void 0:c.label)!=="操作");const o=(a=e==null?void 0:e.compData)==null?void 0:a.map(c=>{if((c==null?void 0:c.key)==="rowButton"){let h=[];return P.value?h=[...c==null?void 0:c.contents,{label:"授权"}]:h=c==null?void 0:c.contents,{...c,contents:h}}return c});return ne(o),o}return[]}),Ke=e=>{U(e.singleContent,e.buttonName,E.value)},b=u.ref({}),x=u.ref(),D=async(e,r,s)=>{var t,n;try{const a=await e(r);return((t=a==null?void 0:a.data)==null?void 0:t.code)===200?(s!=="查询"&&await Y.setLogRecordAsync({type:s,data:r},d.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){l.ElMessage.error(a)}},we=(e,r)=>{const s=new Map(r.map(n=>[n.path,n.checkedButtons]));function t(n){var o,c;const a=(o=n==null?void 0:n.path)!=null&&o.startsWith("/")?(c=n==null?void 0:n.path)==null?void 0:c.substring(1):n==null?void 0:n.path;s.has(a)&&(n.checkedButtons=s.get(a)),n.children&&n.children.length>0&&n.children.forEach(t)}e.forEach(t)},se=e=>e==null?void 0:e.map(r=>{var t;const s={...r,checkedButtons:[]};return s.children&&((t=s.children)==null?void 0:t.length)>0&&(s.children=se(s.children)),s}),O=e=>{for(const r in e)if(Array.isArray(e[r]))return r;return""},re=e=>{const r=[];let s=0;for(;s<e.length;)if(typeof e[s]=="string"){const t={title:e[s]};s+1<e.length&&Array.isArray(e[s+1])?(t.children=re(e[s+1]),s+=2):s+=1,r.push(t)}return r},j=e=>{const r=[];let s=0;for(;s<(e==null?void 0:e.length);){const t={title:e==null?void 0:e[s]};s+1<(e==null?void 0:e.length)&&Array.isArray(e==null?void 0:e[s+1])?(t.children=re(e==null?void 0:e[s+1]),s+=2):s+=1,r.push(t)}return r},M=(e,r="",s=new Map)=>e==null?void 0:e.map(t=>{const n=r?`${r}/${t.title}`:t.title;if(s.has(n))return s.get(n);const a={...t,path:n};return t.children&&t.children.length>0&&(a.children=M(t.children,n,s)),s.set(n,a),a}),W=(e,r)=>e.reduce((s,t)=>{const n=t[r];return s[n]||(s[n]=[]),s[n].push(t),s},{}),L=e=>{const r=[];function s(t,n){!t.children||t.children.length===0?r.push({...t,parentPath:n||""}):t.children.forEach(a=>s(a,t.path||n))}return e.forEach(t=>s(t,"")),r},q=e=>Object.entries(e).map(([s,t])=>({path:s,checkedButtons:t==null?void 0:t.map(n=>n==null?void 0:n.path)})),Ie=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,Re=e=>{const r={},s=Array.isArray(e)?e==null?void 0:e.filter(t=>{var n;return!(Ie(t)&&((n=Object.keys(t))!=null&&n.includes("id")))}):null;return s&&(s==null||s.forEach((t,n)=>{if(n<=0)return;const a=`a${n}`;r[a]=t})),r},k=u.ref(""),ne=e=>{var n;const r=e==null?void 0:e.find(a=>(a==null?void 0:a.key)==="tableContents");if(!r)return"";const s=(n=r==null?void 0:r.contents)==null?void 0:n[0],t=Re(s);k.value=O(t)},$e=e=>{if(!Array.isArray(e))return!1;for(let r of e){if(typeof r!="object"||r===null||typeof r.path!="string"||!Array.isArray(r.checkedButtons))return!1;for(let s of r.checkedButtons)if(typeof s!="string")return!1}return!0},Me=e=>{const r=[];for(const s in e)e[s].forEach(n=>{var h,i;const a=(h=n.path)!=null&&h.startsWith("/")?(i=n.path)==null?void 0:i.substring(1):n.path,o=a==null?void 0:a.split("/");let c=r;o.forEach(y=>{let p=c.find(v=>v.title===y);p||(p={title:y,path:n.path,children:[]},c.push(p)),c=p.children})});return r},Ee=e=>{const r={};return e.forEach(s=>{const{path:t,checkedButtons:n}=s,a=t,o=n.map(c=>({title:c.split("/").pop()||"",path:c,parentPath:a}));r[a]=o}),r},ae=e=>{let r=[];for(const s of e){let t=[s.title];if(s.children&&Array.isArray(s.children)){let n=ae(s.children);n.length>0&&t.push(n)}r.push(t)}return r},Ne=e=>{const r=[];for(const s of e){if(!Array.isArray(s)||s.length!==2)continue;const[t,n]=s,a=ce(n),o=r.indexOf(t);o===-1?r.push(t,a):r[o+1]=oe(r[o+1],a)}return r},ce=e=>{const r=[];for(const s of e)if(Array.isArray(s)){if(s.length===1&&typeof s[0]=="string")r.push(s[0]);else if(s.length===2&&typeof s[0]=="string"){const[t,n]=s;r.push(t,ce(n))}}return r},oe=(e,r)=>{const s=[...e];let t=0;for(;t<r.length;){const n=r[t];if(typeof n=="string"){const a=s.indexOf(n);a===-1?s.push(n,r[t+1]):s[a+1]=oe(s[a+1],r[t+1]),t+=2}else s.push(n),t+=1}return s},Fe=async(e,r)=>{var s,t;if(b.value=l.cloneDeep(r),Z.setRefreshCurStructure(!1),(s=S.value)==null||s.splice(0),e==="授权"){if(!k.value){l.ElMessage.error("请正确定义角色权限");return}const n=$e(b.value[k.value]);let a;if(n)a=b.value[k.value];else{const c=j(b.value[k.value]),h=M(c),i=L(h),y=W(i,"parentPath");a=q(y)}if(!a||!Array.isArray(a)){l.ElMessage.error("权限数据处理出错了,请联系管理员");return}A.title=`【${r.a0}】授权`,A.show=!0,await u.nextTick();const o=a==null?void 0:a.map(c=>c==null?void 0:c.path);(t=x.value)==null||t.setCheckedKeys(o),we(K.value,a)}},xe=()=>{A.show=!1},I=u.ref(),Oe=async e=>{const r=await D(l.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),s=r==null?void 0:r.map(t=>{var n;return{id:t.id,tableData:(n=t==null?void 0:t.value)==null?void 0:n.tableData}});return s==null?void 0:s.map(t=>{var n;if(Array.isArray(t==null?void 0:t.tableData)){let a={id:t.id};return(n=t==null?void 0:t.tableData)==null||n.forEach((o,c)=>{a[`a${c}`]=o}),a}else return{...t.tableData,id:t.id}})},_=(e,r)=>{let s={};return r==null||r.forEach((t,n)=>{t.label&&e&&(s[t.label]=(e==null?void 0:e[`a${n}`])??null)}),s},U=(e,r,s)=>{var a,o,c,h;const t=l.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=_(t,ee.value);r==="新增"?D(l.createInsofDataApi,{key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(a=d.value)!=null&&a.startsWith("/")?(o=d.value)==null?void 0:o.substring(1):d.value,tableId:s},value:{tableData:n}},r).then(i=>{I.value={...e,newId:i}}):r==="编辑"?D(l.updateInsofDataApi,{id:e.id,key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=d.value)!=null&&c.startsWith("/")?(h=d.value)==null?void 0:h.substring(1):d.value,tableId:s},value:{tableData:n}},r).then(i=>{A.show=!1}):r==="删除"&&D(l.deleteInsofDataApi,{id:e.id},r).then(i=>{r&&i&&l.ElMessage.success(r+"成功")}),Z.setRefreshCurStructure(!0)},le=e=>{let r=[];return e==null||e.forEach(s=>{var t;if(s.checkedButtons&&((t=s.checkedButtons)==null?void 0:t.length)>0){const n={path:s.path,checkedButtons:s.checkedButtons};r=r.concat(n)}s.children&&(r=r.concat(le(s.children)))}),r},je=()=>{const e=le(K.value),r=Ee(e),s=Me(r),t=ae(s),n=Ne(t);I.value={...b.value,[k.value]:n},u.nextTick(()=>{U(I.value,"编辑",E.value)})},A=u.reactive({show:!1,title:"角色授权",width:"35%",draggable:!0}),We=({isPenultimate:e},r)=>{var s,t;return console.log("isPenultimate",e,r),((t=(s=r==null?void 0:r.data)==null?void 0:s.renderButtons)==null?void 0:t.length)>0?"is-penultimate":""},E=u.ref(0),ue=async e=>{var t,n,a,o,c;let r;const s=await l.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:e!=null&&e.startsWith("/")?e==null?void 0:e.substring(1):e}});return((t=s==null?void 0:s.data)==null?void 0:t.code)===200&&(n=s==null?void 0:s.data)!=null&&n.result&&((a=s==null?void 0:s.data)==null?void 0:a.result.length)>0&&(r=(c=(o=s==null?void 0:s.data.result)==null?void 0:o[0])==null?void 0:c.id,E.value=r),r},K=u.ref([]),Le=u.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),qe=(e,r)=>{var s;e.checkedButtons=r?(s=e.renderButtons)==null?void 0:s.map(t=>t.path):[]},S=u.ref([]),_e=(e,r)=>{var s,t,n;r.checkedButtons=e,((s=r.checkedButtons)==null?void 0:s.length)===((t=r.renderButtons)==null?void 0:t.length)?S.value.push(r.path):(e==null?void 0:e.length)===0&&(S.value=(n=S.value)==null?void 0:n.filter(a=>a!==r.path))};u.watch(()=>S.value.length,()=>{var e;(e=x.value)==null||e.setCheckedKeys([...S.value])});u.watch(()=>A.show,e=>{e||(K.value=se(K.value))});const he=u.computed(()=>{var s;const e=(s=l.cloneDeep(be.value))==null?void 0:s.filter(t=>{var n,a;return((a=(n=t==null?void 0:t.key)==null?void 0:n.pageKey)==null?void 0:a.toUpperCase())!=="MENU"});return e==null?void 0:e.map(t=>{var o,c,h,i,y,p,v,G;const n=/button/i;let a=(h=(c=(o=t==null?void 0:t.value)==null?void 0:o.pageData)==null?void 0:c.compData)==null?void 0:h.filter(T=>n.test(T==null?void 0:T.key));return a=Array.from(new Set(a==null?void 0:a.flatMap(T=>T.contents.map(ge=>ge.label)))),{path:(y=(i=t==null?void 0:t.key)==null?void 0:i.pageKey)!=null&&y.startsWith("/")?(v=(p=t==null?void 0:t.key)==null?void 0:p.pageKey)==null?void 0:v.substring(1):(G=t==null?void 0:t.key)==null?void 0:G.pageKey,buttons:a}})}),Ue=u.ref([]),Ve=e=>{const s=[e==null?void 0:e.find(t=>(t==null?void 0:t.title)==="平台管理")].flatMap(t=>t==null?void 0:t.children);return s==null?void 0:s.map(t=>{var n,a;return{path:(n=t==null?void 0:t.path)!=null&&n.startsWith("/")?(a=t==null?void 0:t.path)==null?void 0:a.substring(1):t.path,buttons:["新增","查看","编辑","删除"]}})},H=(e,r)=>{var s;if(e.carryData){if(e.path==="系统管理/个人中心"){const t=["基本信息","上传头像","签名","修改密码"];return t==null?void 0:t.map(n=>{var a,o;return{title:n,path:(a=e==null?void 0:e.path)!=null&&a.startsWith("/")?((o=e==null?void 0:e.path)==null?void 0:o.substring(1))+"/"+n:e.path+"/"+n}})}return(s=r==null?void 0:r.buttons)==null?void 0:s.map(t=>{var n,a;return{title:t,path:(n=e==null?void 0:e.path)!=null&&n.startsWith("/")?((a=e==null?void 0:e.path)==null?void 0:a.substring(1))+"/"+t:e.path+"/"+t}})}return[]},ie=(e,r)=>{if(Array.isArray(e))return e==null?void 0:e.map(s=>{var a,o;const t=(a=s==null?void 0:s.path)!=null&&a.startsWith("/")?(o=s==null?void 0:s.path)==null?void 0:o.substring(1):s==null?void 0:s.path,n=r==null?void 0:r.find(c=>(c==null?void 0:c.path)===t);return s.children&&s.children.length>0?{...s,renderButtons:H(s,n),checkedButtons:[],children:ie(s.children,he.value)}:{...s,renderButtons:H(s,n),checkedButtons:[]}})},ze={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:m.value,name:""}]}]},Qe=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:ie,addPathToTree:M,authorizeDialog:A,buttonValue:Te,changedRow:I,clickRow:b,clickRowButton:Fe,clickSubmitAuthority:je,closeAuthorizeDialog:xe,compName:te,convertArrayToTree:j,convertIndexToLabel:_,customNodeClass:We,getActivePageStructureId:ue,getAuthorityKey:ne,getFirstArrayProperty:O,getLeafNodesRecursive:L,getPageDataAsync:Oe,groupByField:W,handleAddSysMenusButtons:Ve,handleItemDataChange:Ke,handleNodeBtnChange:_e,handleNodeCheckChange:qe,handleQueryChange:De,handleRowAuthorityRender:q,handleSubmitAsync:D,isPageDataExist:Ce,menuData:K,menusButtons:Le,pageData:m,pageDataFiltered:Pe,queryFormData:Be,structureButtons:he,structureId:E,submitTableAsyncByVerify:U,tempRolePageData:ze,tempSysMenus:Ue,treeRef:x},Symbol.toStringTag,{value:"Module"})),fe=X.useLoginState(l.pinia),{superAdminInfo:Ge,cryptoInfo:f}=l.storeToRefs(fe),Je=l.useMenuState(l.pinia),{activeMenuPath:g}=l.storeToRefs(Je),w="123456",He=F(l.pinia),{routerPageStructures:Xe}=l.storeToRefs(He),V=u.ref(0),Ye=u.ref([{label:"用户名称",value:"",name:"userName"}]),P=u.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),Ze=e=>{console.log("handleQueryChange",e)},z=u.ref([]),ye=u.ref(""),R=u.computed(()=>{var r,s,t,n,a;const e=(r=Xe.value)==null?void 0:r.find(o=>{var c;return((c=o==null?void 0:o.comp)==null?void 0:c.toUpperCase())==="TABLE"});return e?(ye.value=e.name,z.value=(n=(t=(s=e==null?void 0:e.compData)==null?void 0:s.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:t.contents)==null?void 0:n.filter(c=>(c==null?void 0:c.label)!=="操作"),(a=e==null?void 0:e.compData)==null?void 0:a.map(c=>{if((c==null?void 0:c.key)==="rowButton"){const h=[...c==null?void 0:c.contents,{label:"重置密码"}];return{...c,contents:h}}return c})):[]}),me=e=>{N(e.singleContent,e.buttonName,V.value)},$=u.ref(),et=e=>{console.log("onDoubleClick",e)},tt=(e,r)=>{e==="重置密码"&&de.ElMessageBox.confirm(`该操作将会重置【${r==null?void 0:r.account}】的密码,确认重置?`,"警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{$.value={...r,password:w},N($.value,e,V.value)}).catch(()=>{l.ElMessage.info("取消重置")})},pe=()=>{Q(g.value).then(e=>{var s;const r=Array.isArray(e)&&(e==null?void 0:e.filter(t=>(t==null?void 0:t.account)!==Ge.value.account));R.value=(s=R.value)==null?void 0:s.map(t=>t.key==="tableContents"?{...t,contents:r==null?void 0:r.map(n=>{var a;return{...n,password:C.decryptData(n==null?void 0:n.password,(a=f==null?void 0:f.value)==null?void 0:a.privateKey)}})}:t)})},B=async(e,r,s)=>{var t,n;try{const a=await e(r);return((t=a==null?void 0:a.data)==null?void 0:t.code)===200?(s!=="查询"&&await fe.setLogRecordAsync({type:s,data:r},g.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){l.ElMessage.error(a)}},N=(e,r,s)=>{var a,o,c,h,i,y;const t=l.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=_(t,z.value);C.isEncryptAvailable()&&n&&(!n.password&&P.value?n.password=C.encryptData(w,(a=f==null?void 0:f.value)==null?void 0:a.publicKey):n.password&&P.value&&(n.password=C.encryptData(n==null?void 0:n.password,(o=f==null?void 0:f.value)==null?void 0:o.publicKey))),r==="新增"?B(l.createInsofDataApi,{key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=g.value)!=null&&c.startsWith("/")?(h=g.value)==null?void 0:h.substring(1):g.value,tableId:s},value:{tableData:n}},r).then(p=>{var v;$.value={...e,newId:p,password:P.value?C.decryptData((e==null?void 0:e.password)??w,(v=f==null?void 0:f.value)==null?void 0:v.privateKey):e==null?void 0:e.password}}):r==="编辑"||r==="重置密码"?B(l.updateInsofDataApi,{id:e.id,key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(i=g.value)!=null&&i.startsWith("/")?(y=g.value)==null?void 0:y.substring(1):g.value,tableId:s},value:{tableData:n}},r).then(()=>{r==="重置密码"&&pe(),A.show=!1}):r==="删除"&&B(l.deleteInsofDataApi,{id:e.id},r).then(()=>{r&&l.ElMessage.success(r+"成功")})},Q=async e=>{const r=await B(l.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),s=r==null?void 0:r.map(t=>{var n,a;return{id:t.id,layer:(n=t.key)==null?void 0:n.layer,tableData:(a=t==null?void 0:t.value)==null?void 0:a.tableData}});return s==null?void 0:s.map(t=>{var n;if(!Array.isArray(t==null?void 0:t.tableData))return{...t.tableData,layer:(n=t.key)==null?void 0:n.layer,id:t.id}})},st={comp:"Group",name:"/系统管理/用户管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:R.value,name:""}]}]},rt=Object.freeze(Object.defineProperty({__proto__:null,changedRow:$,clickRowButton:tt,columns:z,compName:ye,getPageDataAsync:Q,handleItemDataChange:me,handleQueryChange:Ze,handleSubmitAsync:B,loginUserIsSuper:P,onDoubleClick:et,pageData:R,queryFormData:Ye,refreshUserTableData:pe,resetPassword:w,structureId:V,submitTableAsyncByVerify:N,tempUserPageData:st},Symbol.toStringTag,{value:"Module"}));exports.State=rt;exports.State$1=Qe;exports.addPathToTree=M;exports.convertArrayToTree=j;exports.getActivePageStructureId=ue;exports.getFirstArrayProperty=O;exports.getLeafNodesRecursive=L;exports.getPageDataAsync=Q;exports.groupByField=W;exports.handleRowAuthorityRender=q;exports.handleSubmitAsync=B;exports.resetPassword=w;exports.submitTableAsyncByVerify=N;exports.useAuthorityState=F;
|
|
1
|
+
"use strict";const u=require("vue"),l=require("./menu-CyErnOWr.cjs"),X=require("./login-ZGc0USt4.cjs"),ve=require("./modelComp-4_7EVAJl.cjs"),C=require("./crypto-CRbcEKIz.cjs"),de=require("./index-BEAaSlwn.cjs"),F=l.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Ae=l.useMenuState(l.pinia),{activeMenuPath:d}=l.storeToRefs(Ae),Y=X.useLoginState(l.pinia),{structureData:be}=l.storeToRefs(Y),ke=F(l.pinia),{routerPageStructures:Se}=l.storeToRefs(ke),Z=ve.useModelComp(l.pinia),Be=u.ref([{label:"角色名称",value:"",name:"roleName"}]),Te=u.ref([{label:"查询"},{label:"重置"}]),J=u.reactive({isFilter:!1,filterForm:{}}),Ce=u.ref(!1),De=e=>{J.isFilter=!0,J.filterForm=e},m=u.ref([]),ee=u.ref([]),te=u.ref(""),Pe=u.computed(()=>{var r,s,t,n,a;const e=(r=Se.value)==null?void 0:r.find(o=>{var c;return((c=o==null?void 0:o.comp)==null?void 0:c.toUpperCase())==="TABLE"});if(e){te.value=e.name,ee.value=(n=(t=(s=e==null?void 0:e.compData)==null?void 0:s.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:t.contents)==null?void 0:n.filter(c=>(c==null?void 0:c.label)!=="操作");const o=(a=e==null?void 0:e.compData)==null?void 0:a.map(c=>{if((c==null?void 0:c.key)==="rowButton"){let h=[];return P.value?h=[...c==null?void 0:c.contents,{label:"授权"}]:h=c==null?void 0:c.contents,{...c,contents:h}}return c});return ne(o),o}return[]}),Ke=e=>{U(e.singleContent,e.buttonName,E.value)},b=u.ref({}),x=u.ref(),D=async(e,r,s)=>{var t,n;try{const a=await e(r);return((t=a==null?void 0:a.data)==null?void 0:t.code)===200?(s!=="查询"&&await Y.setLogRecordAsync({type:s,data:r},d.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){l.ElMessage.error(a)}},we=(e,r)=>{const s=new Map(r.map(n=>[n.path,n.checkedButtons]));function t(n){var o,c;const a=(o=n==null?void 0:n.path)!=null&&o.startsWith("/")?(c=n==null?void 0:n.path)==null?void 0:c.substring(1):n==null?void 0:n.path;s.has(a)&&(n.checkedButtons=s.get(a)),n.children&&n.children.length>0&&n.children.forEach(t)}e.forEach(t)},se=e=>e==null?void 0:e.map(r=>{var t;const s={...r,checkedButtons:[]};return s.children&&((t=s.children)==null?void 0:t.length)>0&&(s.children=se(s.children)),s}),O=e=>{for(const r in e)if(Array.isArray(e[r]))return r;return""},re=e=>{const r=[];let s=0;for(;s<e.length;)if(typeof e[s]=="string"){const t={title:e[s]};s+1<e.length&&Array.isArray(e[s+1])?(t.children=re(e[s+1]),s+=2):s+=1,r.push(t)}return r},j=e=>{const r=[];let s=0;for(;s<(e==null?void 0:e.length);){const t={title:e==null?void 0:e[s]};s+1<(e==null?void 0:e.length)&&Array.isArray(e==null?void 0:e[s+1])?(t.children=re(e==null?void 0:e[s+1]),s+=2):s+=1,r.push(t)}return r},M=(e,r="",s=new Map)=>e==null?void 0:e.map(t=>{const n=r?`${r}/${t.title}`:t.title;if(s.has(n))return s.get(n);const a={...t,path:n};return t.children&&t.children.length>0&&(a.children=M(t.children,n,s)),s.set(n,a),a}),W=(e,r)=>e.reduce((s,t)=>{const n=t[r];return s[n]||(s[n]=[]),s[n].push(t),s},{}),L=e=>{const r=[];function s(t,n){!t.children||t.children.length===0?r.push({...t,parentPath:n||""}):t.children.forEach(a=>s(a,t.path||n))}return e.forEach(t=>s(t,"")),r},q=e=>Object.entries(e).map(([s,t])=>({path:s,checkedButtons:t==null?void 0:t.map(n=>n==null?void 0:n.path)})),Ie=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,Re=e=>{const r={},s=Array.isArray(e)?e==null?void 0:e.filter(t=>{var n;return!(Ie(t)&&((n=Object.keys(t))!=null&&n.includes("id")))}):null;return s&&(s==null||s.forEach((t,n)=>{if(n<=0)return;const a=`a${n}`;r[a]=t})),r},k=u.ref(""),ne=e=>{var n;const r=e==null?void 0:e.find(a=>(a==null?void 0:a.key)==="tableContents");if(!r)return"";const s=(n=r==null?void 0:r.contents)==null?void 0:n[0],t=Re(s);k.value=O(t)},$e=e=>{if(!Array.isArray(e))return!1;for(let r of e){if(typeof r!="object"||r===null||typeof r.path!="string"||!Array.isArray(r.checkedButtons))return!1;for(let s of r.checkedButtons)if(typeof s!="string")return!1}return!0},Me=e=>{const r=[];for(const s in e)e[s].forEach(n=>{var h,i;const a=(h=n.path)!=null&&h.startsWith("/")?(i=n.path)==null?void 0:i.substring(1):n.path,o=a==null?void 0:a.split("/");let c=r;o.forEach(y=>{let p=c.find(v=>v.title===y);p||(p={title:y,path:n.path,children:[]},c.push(p)),c=p.children})});return r},Ee=e=>{const r={};return e.forEach(s=>{const{path:t,checkedButtons:n}=s,a=t,o=n.map(c=>({title:c.split("/").pop()||"",path:c,parentPath:a}));r[a]=o}),r},ae=e=>{let r=[];for(const s of e){let t=[s.title];if(s.children&&Array.isArray(s.children)){let n=ae(s.children);n.length>0&&t.push(n)}r.push(t)}return r},Ne=e=>{const r=[];for(const s of e){if(!Array.isArray(s)||s.length!==2)continue;const[t,n]=s,a=ce(n),o=r.indexOf(t);o===-1?r.push(t,a):r[o+1]=oe(r[o+1],a)}return r},ce=e=>{const r=[];for(const s of e)if(Array.isArray(s)){if(s.length===1&&typeof s[0]=="string")r.push(s[0]);else if(s.length===2&&typeof s[0]=="string"){const[t,n]=s;r.push(t,ce(n))}}return r},oe=(e,r)=>{const s=[...e];let t=0;for(;t<r.length;){const n=r[t];if(typeof n=="string"){const a=s.indexOf(n);a===-1?s.push(n,r[t+1]):s[a+1]=oe(s[a+1],r[t+1]),t+=2}else s.push(n),t+=1}return s},Fe=async(e,r)=>{var s,t;if(b.value=l.cloneDeep(r),Z.setRefreshCurStructure(!1),(s=S.value)==null||s.splice(0),e==="授权"){if(!k.value){l.ElMessage.error("请正确定义角色权限");return}const n=$e(b.value[k.value]);let a;if(n)a=b.value[k.value];else{const c=j(b.value[k.value]),h=M(c),i=L(h),y=W(i,"parentPath");a=q(y)}if(!a||!Array.isArray(a)){l.ElMessage.error("权限数据处理出错了,请联系管理员");return}A.title=`【${r.a0}】授权`,A.show=!0,await u.nextTick();const o=a==null?void 0:a.map(c=>c==null?void 0:c.path);(t=x.value)==null||t.setCheckedKeys(o),we(K.value,a)}},xe=()=>{A.show=!1},I=u.ref(),Oe=async e=>{const r=await D(l.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),s=r==null?void 0:r.map(t=>{var n;return{id:t.id,tableData:(n=t==null?void 0:t.value)==null?void 0:n.tableData}});return s==null?void 0:s.map(t=>{var n;if(Array.isArray(t==null?void 0:t.tableData)){let a={id:t.id};return(n=t==null?void 0:t.tableData)==null||n.forEach((o,c)=>{a[`a${c}`]=o}),a}else return{...t.tableData,id:t.id}})},_=(e,r)=>{let s={};return r==null||r.forEach((t,n)=>{t.label&&e&&(s[t.label]=(e==null?void 0:e[`a${n}`])??null)}),s},U=(e,r,s)=>{var a,o,c,h;const t=l.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=_(t,ee.value);r==="新增"?D(l.createInsofDataApi,{key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(a=d.value)!=null&&a.startsWith("/")?(o=d.value)==null?void 0:o.substring(1):d.value,tableId:s},value:{tableData:n}},r).then(i=>{I.value={...e,newId:i}}):r==="编辑"?D(l.updateInsofDataApi,{id:e.id,key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=d.value)!=null&&c.startsWith("/")?(h=d.value)==null?void 0:h.substring(1):d.value,tableId:s},value:{tableData:n}},r).then(i=>{A.show=!1}):r==="删除"&&D(l.deleteInsofDataApi,{id:e.id},r).then(i=>{r&&i&&l.ElMessage.success(r+"成功")}),Z.setRefreshCurStructure(!0)},le=e=>{let r=[];return e==null||e.forEach(s=>{var t;if(s.checkedButtons&&((t=s.checkedButtons)==null?void 0:t.length)>0){const n={path:s.path,checkedButtons:s.checkedButtons};r=r.concat(n)}s.children&&(r=r.concat(le(s.children)))}),r},je=()=>{const e=le(K.value),r=Ee(e),s=Me(r),t=ae(s),n=Ne(t);I.value={...b.value,[k.value]:n},u.nextTick(()=>{U(I.value,"编辑",E.value)})},A=u.reactive({show:!1,title:"角色授权",width:"35%",draggable:!0}),We=({isPenultimate:e},r)=>{var s,t;return console.log("isPenultimate",e,r),((t=(s=r==null?void 0:r.data)==null?void 0:s.renderButtons)==null?void 0:t.length)>0?"is-penultimate":""},E=u.ref(0),ue=async e=>{var t,n,a,o,c;let r;const s=await l.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:e!=null&&e.startsWith("/")?e==null?void 0:e.substring(1):e}});return((t=s==null?void 0:s.data)==null?void 0:t.code)===200&&(n=s==null?void 0:s.data)!=null&&n.result&&((a=s==null?void 0:s.data)==null?void 0:a.result.length)>0&&(r=(c=(o=s==null?void 0:s.data.result)==null?void 0:o[0])==null?void 0:c.id,E.value=r),r},K=u.ref([]),Le=u.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),qe=(e,r)=>{var s;e.checkedButtons=r?(s=e.renderButtons)==null?void 0:s.map(t=>t.path):[]},S=u.ref([]),_e=(e,r)=>{var s,t,n;r.checkedButtons=e,((s=r.checkedButtons)==null?void 0:s.length)===((t=r.renderButtons)==null?void 0:t.length)?S.value.push(r.path):(e==null?void 0:e.length)===0&&(S.value=(n=S.value)==null?void 0:n.filter(a=>a!==r.path))};u.watch(()=>S.value.length,()=>{var e;(e=x.value)==null||e.setCheckedKeys([...S.value])});u.watch(()=>A.show,e=>{e||(K.value=se(K.value))});const he=u.computed(()=>{var s;const e=(s=l.cloneDeep(be.value))==null?void 0:s.filter(t=>{var n,a;return((a=(n=t==null?void 0:t.key)==null?void 0:n.pageKey)==null?void 0:a.toUpperCase())!=="MENU"});return e==null?void 0:e.map(t=>{var o,c,h,i,y,p,v,G;const n=/button/i;let a=(h=(c=(o=t==null?void 0:t.value)==null?void 0:o.pageData)==null?void 0:c.compData)==null?void 0:h.filter(T=>n.test(T==null?void 0:T.key));return a=Array.from(new Set(a==null?void 0:a.flatMap(T=>T.contents.map(ge=>ge.label)))),{path:(y=(i=t==null?void 0:t.key)==null?void 0:i.pageKey)!=null&&y.startsWith("/")?(v=(p=t==null?void 0:t.key)==null?void 0:p.pageKey)==null?void 0:v.substring(1):(G=t==null?void 0:t.key)==null?void 0:G.pageKey,buttons:a}})}),Ue=u.ref([]),Ve=e=>{const s=[e==null?void 0:e.find(t=>(t==null?void 0:t.title)==="平台管理")].flatMap(t=>t==null?void 0:t.children);return s==null?void 0:s.map(t=>{var n,a;return{path:(n=t==null?void 0:t.path)!=null&&n.startsWith("/")?(a=t==null?void 0:t.path)==null?void 0:a.substring(1):t.path,buttons:["新增","查看","编辑","删除"]}})},H=(e,r)=>{var s;if(e.carryData){if(e.path==="系统管理/个人中心"){const t=["基本信息","上传头像","签名","修改密码"];return t==null?void 0:t.map(n=>{var a,o;return{title:n,path:(a=e==null?void 0:e.path)!=null&&a.startsWith("/")?((o=e==null?void 0:e.path)==null?void 0:o.substring(1))+"/"+n:e.path+"/"+n}})}return(s=r==null?void 0:r.buttons)==null?void 0:s.map(t=>{var n,a;return{title:t,path:(n=e==null?void 0:e.path)!=null&&n.startsWith("/")?((a=e==null?void 0:e.path)==null?void 0:a.substring(1))+"/"+t:e.path+"/"+t}})}return[]},ie=(e,r)=>{if(Array.isArray(e))return e==null?void 0:e.map(s=>{var a,o;const t=(a=s==null?void 0:s.path)!=null&&a.startsWith("/")?(o=s==null?void 0:s.path)==null?void 0:o.substring(1):s==null?void 0:s.path,n=r==null?void 0:r.find(c=>(c==null?void 0:c.path)===t);return s.children&&s.children.length>0?{...s,renderButtons:H(s,n),checkedButtons:[],children:ie(s.children,he.value)}:{...s,renderButtons:H(s,n),checkedButtons:[]}})},ze={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:m.value,name:""}]}]},Qe=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:ie,addPathToTree:M,authorizeDialog:A,buttonValue:Te,changedRow:I,clickRow:b,clickRowButton:Fe,clickSubmitAuthority:je,closeAuthorizeDialog:xe,compName:te,convertArrayToTree:j,convertIndexToLabel:_,customNodeClass:We,getActivePageStructureId:ue,getAuthorityKey:ne,getFirstArrayProperty:O,getLeafNodesRecursive:L,getPageDataAsync:Oe,groupByField:W,handleAddSysMenusButtons:Ve,handleItemDataChange:Ke,handleNodeBtnChange:_e,handleNodeCheckChange:qe,handleQueryChange:De,handleRowAuthorityRender:q,handleSubmitAsync:D,isPageDataExist:Ce,menuData:K,menusButtons:Le,pageData:m,pageDataFiltered:Pe,queryFormData:Be,structureButtons:he,structureId:E,submitTableAsyncByVerify:U,tempRolePageData:ze,tempSysMenus:Ue,treeRef:x},Symbol.toStringTag,{value:"Module"})),fe=X.useLoginState(l.pinia),{superAdminInfo:Ge,cryptoInfo:f}=l.storeToRefs(fe),Je=l.useMenuState(l.pinia),{activeMenuPath:g}=l.storeToRefs(Je),w="123456",He=F(l.pinia),{routerPageStructures:Xe}=l.storeToRefs(He),V=u.ref(0),Ye=u.ref([{label:"用户名称",value:"",name:"userName"}]),P=u.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),Ze=e=>{console.log("handleQueryChange",e)},z=u.ref([]),ye=u.ref(""),R=u.computed(()=>{var r,s,t,n,a;const e=(r=Xe.value)==null?void 0:r.find(o=>{var c;return((c=o==null?void 0:o.comp)==null?void 0:c.toUpperCase())==="TABLE"});return e?(ye.value=e.name,z.value=(n=(t=(s=e==null?void 0:e.compData)==null?void 0:s.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:t.contents)==null?void 0:n.filter(c=>(c==null?void 0:c.label)!=="操作"),(a=e==null?void 0:e.compData)==null?void 0:a.map(c=>{if((c==null?void 0:c.key)==="rowButton"){const h=[...c==null?void 0:c.contents,{label:"重置密码"}];return{...c,contents:h}}return c})):[]}),me=e=>{N(e.singleContent,e.buttonName,V.value)},$=u.ref(),et=e=>{console.log("onDoubleClick",e)},tt=(e,r)=>{e==="重置密码"&&de.ElMessageBox.confirm(`该操作将会重置【${r==null?void 0:r.account}】的密码,确认重置?`,"警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{$.value={...r,password:w},N($.value,e,V.value)}).catch(()=>{l.ElMessage.info("取消重置")})},pe=()=>{Q(g.value).then(e=>{var s;const r=Array.isArray(e)&&(e==null?void 0:e.filter(t=>(t==null?void 0:t.account)!==Ge.value.account));R.value=(s=R.value)==null?void 0:s.map(t=>t.key==="tableContents"?{...t,contents:r==null?void 0:r.map(n=>{var a;return{...n,password:C.decryptData(n==null?void 0:n.password,(a=f==null?void 0:f.value)==null?void 0:a.privateKey)}})}:t)})},B=async(e,r,s)=>{var t,n;try{const a=await e(r);return((t=a==null?void 0:a.data)==null?void 0:t.code)===200?(s!=="查询"&&await fe.setLogRecordAsync({type:s,data:r},g.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){l.ElMessage.error(a)}},N=(e,r,s)=>{var a,o,c,h,i,y;const t=l.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=_(t,z.value);C.isEncryptAvailable()&&n&&(!n.password&&P.value?n.password=C.encryptData(w,(a=f==null?void 0:f.value)==null?void 0:a.publicKey):n.password&&P.value&&(n.password=C.encryptData(n==null?void 0:n.password,(o=f==null?void 0:f.value)==null?void 0:o.publicKey))),r==="新增"?B(l.createInsofDataApi,{key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=g.value)!=null&&c.startsWith("/")?(h=g.value)==null?void 0:h.substring(1):g.value,tableId:s},value:{tableData:n}},r).then(p=>{var v;$.value={...e,newId:p,password:P.value?C.decryptData((e==null?void 0:e.password)??w,(v=f==null?void 0:f.value)==null?void 0:v.privateKey):e==null?void 0:e.password}}):r==="编辑"||r==="重置密码"?B(l.updateInsofDataApi,{id:e.id,key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(i=g.value)!=null&&i.startsWith("/")?(y=g.value)==null?void 0:y.substring(1):g.value,tableId:s},value:{tableData:n}},r).then(()=>{r==="重置密码"&&pe(),A.show=!1}):r==="删除"&&B(l.deleteInsofDataApi,{id:e.id},r).then(()=>{r&&l.ElMessage.success(r+"成功")})},Q=async e=>{const r=await B(l.getInsofDataApi,{key:{systemKey:sessionStorage.getItem("systemKey"),type:"data",pageKey:e}},"查询"),s=r==null?void 0:r.map(t=>{var n,a;return{id:t.id,layer:(n=t.key)==null?void 0:n.layer,tableData:(a=t==null?void 0:t.value)==null?void 0:a.tableData}});return s==null?void 0:s.map(t=>{var n;if(!Array.isArray(t==null?void 0:t.tableData))return{...t.tableData,layer:(n=t.key)==null?void 0:n.layer,id:t.id}})},st={comp:"Group",name:"/系统管理/用户管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:R.value,name:""}]}]},rt=Object.freeze(Object.defineProperty({__proto__:null,changedRow:$,clickRowButton:tt,columns:z,compName:ye,getPageDataAsync:Q,handleItemDataChange:me,handleQueryChange:Ze,handleSubmitAsync:B,loginUserIsSuper:P,onDoubleClick:et,pageData:R,queryFormData:Ye,refreshUserTableData:pe,resetPassword:w,structureId:V,submitTableAsyncByVerify:N,tempUserPageData:st},Symbol.toStringTag,{value:"Module"}));exports.State=rt;exports.State$1=Qe;exports.addPathToTree=M;exports.convertArrayToTree=j;exports.getActivePageStructureId=ue;exports.getFirstArrayProperty=O;exports.getLeafNodesRecursive=L;exports.getPageDataAsync=Q;exports.groupByField=W;exports.handleRowAuthorityRender=q;exports.handleSubmitAsync=B;exports.resetPassword=w;exports.submitTableAsyncByVerify=N;exports.useAuthorityState=F;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as o, reactive as n, onMounted as r, createElementBlock as s, openBlock as m, createVNode as c } from "vue";
|
|
2
2
|
import "./index-BHtNKL1L.js";
|
|
3
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import { u as i, s as u } from "./menu-
|
|
5
|
-
import { s as p } from "./index-
|
|
6
|
-
import { S as l } from "./index-
|
|
7
|
-
import { i as d } from "./index-
|
|
3
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DVsoGKzS.js";
|
|
4
|
+
import { u as i, s as u } from "./menu-BzQW-fEY.js";
|
|
5
|
+
import { s as p } from "./index-Da0aT75u.js";
|
|
6
|
+
import { S as l } from "./index-DkCoZbhh.js";
|
|
7
|
+
import { i as d } from "./index-BbXTjZC6.js";
|
|
8
8
|
const M = /* @__PURE__ */ o({
|
|
9
9
|
__name: "index",
|
|
10
10
|
setup(f) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as u, computed as
|
|
2
|
-
import {
|
|
3
|
-
import { u as te } from "./login-
|
|
4
|
-
import { u as De } from "./modelComp-
|
|
1
|
+
import { ref as u, computed as N, reactive as J, nextTick as H, watch as X } from "vue";
|
|
2
|
+
import { bP as we, g as j, s as C, E as b, c as R, bM as Y, bK as Z, bN as m, p as A, u as ee } from "./menu-BzQW-fEY.js";
|
|
3
|
+
import { u as te } from "./login-CbKgBqdm.js";
|
|
4
|
+
import { u as De } from "./modelComp-U2iMeIQU.js";
|
|
5
5
|
import { d as se, i as Ie, e as V } from "./crypto-BRyGpjGR.js";
|
|
6
|
-
import { E as Ee } from "./index-
|
|
6
|
+
import { E as Ee } from "./index-DL6591by.js";
|
|
7
7
|
const re = we("authorityState", {
|
|
8
8
|
state: () => ({
|
|
9
9
|
routerPageStructures: []
|
|
@@ -13,7 +13,7 @@ const re = we("authorityState", {
|
|
|
13
13
|
this.routerPageStructures = e;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
}), Me = ee(A), { activeMenuPath: v } = C(Me), ne = te(A), { structureData:
|
|
16
|
+
}), Me = ee(A), { activeMenuPath: v } = C(Me), ne = te(A), { structureData: Ne } = C(ne), Re = re(A), { routerPageStructures: Oe } = C(Re), ae = De(A), je = u([
|
|
17
17
|
{
|
|
18
18
|
label: "角色名称",
|
|
19
19
|
value: "",
|
|
@@ -119,7 +119,7 @@ const re = we("authorityState", {
|
|
|
119
119
|
// // ],
|
|
120
120
|
// // ]
|
|
121
121
|
// }
|
|
122
|
-
]), oe = u([]), le = u(""), Le =
|
|
122
|
+
]), oe = u([]), le = u(""), Le = N(() => {
|
|
123
123
|
var r, s, t, n, a;
|
|
124
124
|
const e = (r = Oe.value) == null ? void 0 : r.find((o) => {
|
|
125
125
|
var c;
|
|
@@ -309,7 +309,7 @@ const re = we("authorityState", {
|
|
|
309
309
|
return s;
|
|
310
310
|
}, He = async (e, r) => {
|
|
311
311
|
var s, t;
|
|
312
|
-
if (k.value =
|
|
312
|
+
if (k.value = R(r), ae.setRefreshCurStructure(!1), (s = B.value) == null || s.splice(0), e === "授权") {
|
|
313
313
|
if (!S.value) {
|
|
314
314
|
b.error("请正确定义角色权限");
|
|
315
315
|
return;
|
|
@@ -366,7 +366,7 @@ const re = we("authorityState", {
|
|
|
366
366
|
}), s;
|
|
367
367
|
}, L = (e, r, s) => {
|
|
368
368
|
var a, o, c, l;
|
|
369
|
-
const t =
|
|
369
|
+
const t = R(e);
|
|
370
370
|
t != null && t.id && delete t.id;
|
|
371
371
|
const n = W(t, oe.value);
|
|
372
372
|
r === "新增" ? P(Y, {
|
|
@@ -470,9 +470,9 @@ X(() => B.value.length, () => {
|
|
|
470
470
|
X(() => d.show, (e) => {
|
|
471
471
|
e || (w.value = ue(w.value));
|
|
472
472
|
});
|
|
473
|
-
const Se =
|
|
473
|
+
const Se = N(() => {
|
|
474
474
|
var s;
|
|
475
|
-
const e = (s =
|
|
475
|
+
const e = (s = R(Ne.value)) == null ? void 0 : s.filter((t) => {
|
|
476
476
|
var n, a;
|
|
477
477
|
return ((a = (n = t == null ? void 0 : t.key) == null ? void 0 : n.pageKey) == null ? void 0 : a.toUpperCase()) !== "MENU";
|
|
478
478
|
});
|
|
@@ -597,12 +597,12 @@ const Se = R(() => {
|
|
|
597
597
|
value: "",
|
|
598
598
|
name: "userName"
|
|
599
599
|
}
|
|
600
|
-
]), T =
|
|
600
|
+
]), T = N(() => {
|
|
601
601
|
const e = sessionStorage.getItem("isSuperAdmin");
|
|
602
602
|
return e ? JSON.parse(e) : !1;
|
|
603
603
|
}), yt = (e) => {
|
|
604
604
|
console.log("handleQueryChange", e);
|
|
605
|
-
}, U = u([]), Ke = u(""), E =
|
|
605
|
+
}, U = u([]), Ke = u(""), E = N(() => {
|
|
606
606
|
var r, s, t, n, a;
|
|
607
607
|
const e = (r = ht.value) == null ? void 0 : r.find((o) => {
|
|
608
608
|
var c;
|
|
@@ -670,7 +670,7 @@ const Se = R(() => {
|
|
|
670
670
|
}
|
|
671
671
|
}, z = (e, r, s) => {
|
|
672
672
|
var a, o, c, l, h, y;
|
|
673
|
-
const t =
|
|
673
|
+
const t = R(e);
|
|
674
674
|
t != null && t.id && delete t.id;
|
|
675
675
|
const n = W(t, U.value);
|
|
676
676
|
Ie() && n && (!n.password && T.value ? n.password = V(I, (a = i == null ? void 0 : i.value) == null ? void 0 : a.publicKey) : n.password && T.value && (n.password = V(n == null ? void 0 : n.password, (o = i == null ? void 0 : i.value) == null ? void 0 : o.publicKey))), r === "新增" ? $(Y, {
|