ss-component-new 1.1.701 → 1.1.703
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-Tj9n22LW.js → array-D1rENrtC.js} +1 -1
- package/dist/{array-CdPv8cht.cjs → array-DiC30wYM.cjs} +1 -1
- package/dist/{index-Dqx8gOJj.js → index-4lXoydeV.js} +5 -5
- package/dist/index-B1XyxOHh.cjs +1 -0
- package/dist/index-B8RmOsrs.cjs +4207 -0
- package/dist/{index-D3mUjxDs.js → index-B9dgbtyu.js} +3 -3
- package/dist/{index-EoGuP7oJ.cjs → index-BCVS5I6t.cjs} +1 -1
- package/dist/{index-BNsJ-GaS.js → index-BD0Fd1Gu.js} +6 -6
- package/dist/{index-JQ4iyj7d.js → index-BcS7m1h7.js} +4757 -4756
- package/dist/index-BenV67ug.cjs +1 -0
- package/dist/{index-DYeJ0CiS.js → index-C5vB4m1o.js} +6 -7
- package/dist/{index-CFgChxxn.js → index-CAoCSEXG.js} +2 -2
- package/dist/{index-BCsA6oPM.js → index-CCxinvIS.js} +7 -8
- package/dist/{index-BR9Bkj8j.js → index-CPgpapT3.js} +14 -15
- package/dist/{index-COhyHXFv.js → index-CRKPHTGu.js} +1 -1
- package/dist/{index-DPvx5uGk.cjs → index-CbJf1gLk.cjs} +1 -1
- package/dist/{index-CqXufKHy.js → index-CdvMlfI6.js} +5 -5
- package/dist/{index-BOTozLBt.cjs → index-CgYGGrUm.cjs} +1 -1
- package/dist/{index-BhEOQCwM.cjs → index-Coxoz81K.cjs} +1 -1
- package/dist/{index-D4pkAkYA.cjs → index-CtD5MZGc.cjs} +1 -1
- package/dist/{index-qi0TPv2h.cjs → index-CyGdablV.cjs} +1 -1
- package/dist/{index-DRphgX2Y.js → index-D-vVUgYZ.js} +3264 -3256
- package/dist/{index-BDarEK15.cjs → index-D1fd5HJJ.cjs} +1 -1
- package/dist/{index-DGr2MB22.js → index-D4SGh0aM.js} +1 -1
- package/dist/{index-CKPCs0zZ.js → index-D5rX-NgJ.js} +6 -6
- package/dist/index-D6xSLp3Q.cjs +1 -0
- package/dist/{index-CdT7SG2F.js → index-D9MJxwwE.js} +2 -2
- package/dist/{index-CTaQ3_ar.js → index-DEr59wgo.js} +1526 -1533
- package/dist/{index-B3UVui7c.cjs → index-DOs-6Cx7.cjs} +1 -1
- package/dist/{index-DCnYFG4p.js → index-DSNNd0ZH.js} +1 -1
- package/dist/index-DT_toiH0.cjs +1 -0
- package/dist/{index-DYb_tPOe.cjs → index-DW-s6joK.cjs} +1 -1
- package/dist/{index-D7l7lfFr.cjs → index-DZIiL17E.cjs} +1 -1
- package/dist/{index-DGPN90Ai.js → index-DonFB7za.js} +4 -4
- package/dist/{index-5bmcHPsQ.js → index-DqIn00H8.js} +10 -11
- package/dist/{index-B4WbSopN.cjs → index-DsM9FbqX.cjs} +1 -1
- package/dist/{index-Drk2lz_8.js → index-DuFZTere.js} +8 -8
- package/dist/{index-BqbGv6eU.cjs → index-DvCalNQr.cjs} +1 -1
- package/dist/index-Dvnap-N_.cjs +1 -0
- package/dist/{index-i_g0u0HO.js → index-DygV4-Lr.js} +18 -19
- package/dist/index-FMQkDtuO.cjs +15 -0
- package/dist/index-Nn47GzGZ.cjs +1 -0
- package/dist/index-d6F6YF10.cjs +1 -0
- package/dist/{index-4Zl8Xo3b.js → index-di1QdZZr.js} +6 -7
- package/dist/{index-8yV5RCST.js → index-lHJNFOXM.js} +4 -4
- package/dist/{index-Cd2vau9T.cjs → index-sH_FoGx7.cjs} +1 -1
- package/dist/{index-CcQgBIGQ.cjs → index-uBNHwycW.cjs} +1 -1
- package/dist/{index-ztYKbPI5.js → index-xzWjZmO1.js} +3 -3
- package/dist/{index.vue_vue_type_script_setup_true_lang-5j56eVHQ.js → index.vue_vue_type_script_setup_true_lang-CsnYhrp-.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-5ODqcZKZ.cjs → index.vue_vue_type_script_setup_true_lang-oueibXbB.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-MnXEDK7z.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BrQQ9PKj.js} +5310 -5308
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-GTWb_lSA.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dc6lRgBQ.cjs} +10 -10
- package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-Juctm03O.js → index.vue_vue_type_style_index_0_scoped_8606206c_lang-CKEwY0TT.js} +101 -102
- package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-BUYIHNfE.cjs → index.vue_vue_type_style_index_0_scoped_8606206c_lang-CtX13tbI.cjs} +11 -11
- package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-BE5_4IYF.js → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-BeLv71ji.js} +88 -87
- package/dist/index.vue_vue_type_style_index_0_scoped_c81d0427_lang-DmX_Wdo7.cjs +1 -0
- package/dist/{login--KAKf5hd.cjs → login-CCz_BcJe.cjs} +1 -1
- package/dist/{login-BgJMdLxw.js → login-h0Hl0hFq.js} +7 -7
- package/dist/{main-BMtLjkxW.js → main-CtYzMxa4.js} +29 -30
- package/dist/main-OuMryrys.cjs +1 -0
- package/dist/{menu-DznNubRA.js → menu-BRpPhHno.js} +434 -380
- package/dist/{menu-CfFgYmpV.cjs → menu-vml_xHJD.cjs} +5 -5
- 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-DuXANNiw.js → threeModel-CCq6fzWa.js} +6 -6
- package/dist/threeModel-DDg-EseS.cjs +1 -0
- package/package.json +1 -1
- package/dist/index-81et_gzg.cjs +0 -1
- package/dist/index-8oDF5A86.cjs +0 -1
- package/dist/index-BHg8omD9.cjs +0 -4207
- package/dist/index-BX81_nVT.cjs +0 -1
- package/dist/index-CNJadwO3.cjs +0 -1
- package/dist/index-Ccj4Ww0c.cjs +0 -1
- package/dist/index-DjbZR91u.cjs +0 -1
- package/dist/index-DlolcnUO.cjs +0 -1
- package/dist/index-QBUhi9pM.cjs +0 -15
- package/dist/index.vue_vue_type_style_index_0_scoped_c81d0427_lang-J9LYcp1E.cjs +0 -1
- package/dist/main-Bl1MNCVY.cjs +0 -1
- package/dist/modelComp-BR-oztFR.cjs +0 -1
- package/dist/modelComp-BuMlc62t.js +0 -54
- package/dist/threeModel-CjF5hB0y.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const N=require("vue"),c=require("./menu-
|
|
1
|
+
"use strict";const N=require("vue"),c=require("./menu-vml_xHJD.cjs"),D=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"},{key:"MenuName",value:"Menu"},{key:"GroupName",value:"Group"},{key:"SystemKey",value:"System"}],b=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"FormFlex",value:"formWrap"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"TableLineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"},{key:"Menus",value:"menuContents"},{key:"GroupContents",value:"groupContents"}];N.ref(0);const I=l=>{var t,r;if(Array.isArray(Object.keys(l))&&((t=Object.keys(l))==null?void 0:t.length)>0){let e=[];return(r=Object.entries(l))==null||r.forEach(([s,n])=>{var f,$;let a=[];if(a.push(s),((f=Object.keys(n))==null?void 0:f.length)>0){let y=[];($=I(n))==null||$.forEach(T=>{y.push(T)}),y==null||y.forEach(T=>{a.push(T)})}e.push(a)}),e}},R=(l,t)=>{var e;let r=t;return Array.isArray(Object.keys(l))&&((e=Object.entries(l))==null||e.forEach(([s,n])=>{let a=[s];if(typeof n=="object"&&n!==null){let f=I(n);f==null||f.forEach($=>{a.push($)})}r.push(a)})),r},X=l=>{const t={};return l.forEach(e=>{const s=e.split("/");let n=t;s.forEach(a=>{n[a]||(n[a]={}),n=n[a]})}),R(t,[])},Y=l=>X(l);N.ref(0);N.ref(1);const q=l=>{let t;l.replaceAll(" ",`\r
|
|
2
2
|
`).includes(`\r
|
|
3
3
|
`)?t=l.replaceAll(" ",`\r
|
|
4
4
|
`).split(`\r
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as o, reactive as r, onMounted as n, 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 {
|
|
3
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BrQQ9PKj.js";
|
|
4
|
+
import { a as i, s as p } from "./menu-BRpPhHno.js";
|
|
5
5
|
import "./index-BCZ59Y4K.js";
|
|
6
|
-
import { s as u } from "./index-
|
|
7
|
-
import { S as l } from "./index-
|
|
8
|
-
import { i as d } from "./index-
|
|
6
|
+
import { s as u } from "./index-BcS7m1h7.js";
|
|
7
|
+
import { S as l } from "./index-di1QdZZr.js";
|
|
8
|
+
import { i as d } from "./index-CCxinvIS.js";
|
|
9
9
|
const _ = { class: "role-wrapper" }, w = /* @__PURE__ */ o({
|
|
10
10
|
__name: "index",
|
|
11
11
|
setup(f) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("vue"),i=require("./index-2p69g4HY.cjs"),u=require("./menu-vml_xHJD.cjs"),Y=require("./login-CCz_BcJe.cjs"),D=require("./crypto-CRbcEKIz.cjs"),de=require("./index-DOs-6Cx7.cjs"),F=u.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Ae=u.useMenuState(u.pinia),{activeMenuPath:A}=u.storeToRefs(Ae),Z=Y.useLoginState(u.pinia),{structureData:be}=u.storeToRefs(Z),ke=F(u.pinia),{routerPageStructures:Se}=u.storeToRefs(ke),m=u.useModelComp(u.pinia),Be=l.ref([{label:"角色名称",value:"",name:"roleName"}]),Te=l.ref([{label:"查询"},{label:"重置"}]),H=l.reactive({isFilter:!1,filterForm:{}}),Ce=l.ref(!1),De=e=>{H.isFilter=!0,H.filterForm=e},ee=l.ref([]),te=l.ref([]),se=l.ref(""),Pe=l.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){se.value=e.name,te.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 K.value?h=[...c==null?void 0:c.contents,{label:"授权"}]:h=c==null?void 0:c.contents,{...c,contents:h}}return c});return ae(o),o}return[]}),Ke=e=>{V(e.singleContent,e.buttonName,N.value)},k=l.ref({}),O=l.ref(),P=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 Z.setLogRecordAsync({type:s,data:r},A.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){i.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)},re=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=re(s.children)),s}),j=e=>{for(const r in e)if(Array.isArray(e[r]))return r;return""},ne=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=ne(e[s+1]),s+=2):s+=1,r.push(t)}return r},W=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=ne(e==null?void 0:e[s+1]),s+=2):s+=1,r.push(t)}return r},E=(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=E(t.children,n,s)),s.set(n,a),a}),L=(e,r)=>e.reduce((s,t)=>{const n=t[r];return s[n]||(s[n]=[]),s[n].push(t),s},{}),q=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},_=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},S=l.ref(""),ae=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);S.value=j(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,f;const a=(h=n.path)!=null&&h.startsWith("/")?(f=n.path)==null?void 0:f.substring(1):n.path,o=a==null?void 0:a.split("/");let c=r;o.forEach(p=>{let g=c.find(d=>d.title===p);g||(g={title:p,path:n.path,children:[]},c.push(g)),c=g.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},ce=e=>{let r=[];for(const s of e){let t=[s.title];if(s.children&&Array.isArray(s.children)){let n=ce(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=oe(n),o=r.indexOf(t);o===-1?r.push(t,a):r[o+1]=le(r[o+1],a)}return r},oe=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,oe(n))}}return r},le=(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]=le(s[a+1],r[t+1]),t+=2}else s.push(n),t+=1}return s},xe=async(e,r)=>{var s,t;if(k.value=u.cloneDeep(r),m.setRefreshCurStructure(!1),(s=B.value)==null||s.splice(0),e==="授权"){if(!S.value){i.ElMessage.error("请正确定义角色权限");return}const n=$e(k.value[S.value]);let a;if(n)a=k.value[S.value];else{const c=W(k.value[S.value]),h=E(c),f=q(h),p=L(f,"parentPath");a=_(p)}if(!a||!Array.isArray(a)){i.ElMessage.error("权限数据处理出错了,请联系管理员");return}b.title=`【${r.a0}】授权`,b.show=!0,await l.nextTick();const o=a==null?void 0:a.map(c=>c==null?void 0:c.path);(t=O.value)==null||t.setCheckedKeys(o),we(w.value,a)}},Fe=()=>{b.show=!1},R=l.ref(),Oe=async e=>{const r=await P(i.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}})},U=(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},V=(e,r,s)=>{var a,o,c,h;const t=u.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=U(t,te.value);r==="新增"?P(i.createInsofDataApi,{key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(a=A.value)!=null&&a.startsWith("/")?(o=A.value)==null?void 0:o.substring(1):A.value,tableId:s},value:{tableData:n}},r).then(f=>{R.value={...e,newId:f}}):r==="编辑"?P(i.updateInsofDataApi,{id:e.id,key:{type:"data",systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=A.value)!=null&&c.startsWith("/")?(h=A.value)==null?void 0:h.substring(1):A.value,tableId:s},value:{tableData:n}},r).then(f=>{b.show=!1}):r==="删除"&&P(i.deleteInsofDataApi,{id:e.id},r).then(f=>{r&&f&&i.ElMessage.success(r+"成功")}),m.setRefreshCurStructure(!0)},ue=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(ue(s.children)))}),r},je=()=>{const e=ue(w.value),r=Ee(e),s=Me(r),t=ce(s),n=Ne(t);R.value={...k.value,[S.value]:n},l.nextTick(()=>{V(R.value,"编辑",N.value)})},b=l.reactive({show:!1,title:"角色授权",width:"50%",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":""},N=l.ref(0),he=async e=>{var t,n,a,o,c;let r;const s=await i.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,N.value=r),r},w=l.ref([]),Le=l.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),qe=(e,r)=>{var s;e.checkedButtons=r?(s=e.renderButtons)==null?void 0:s.map(t=>t.path):[]},B=l.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)?B.value.push(r.path):(e==null?void 0:e.length)===0&&(B.value=(n=B.value)==null?void 0:n.filter(a=>a!==r.path))};l.watch(()=>B.value.length,()=>{var e;(e=O.value)==null||e.setCheckedKeys([...B.value])});l.watch(()=>b.show,e=>{e||(w.value=re(w.value))});const ie=l.computed(()=>{var s;const e=(s=u.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,f,p,g,d,J;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(C=>n.test(C==null?void 0:C.key));return a=Array.from(new Set(a==null?void 0:a.flatMap(C=>C.contents.map(ve=>ve.label)))),{path:(p=(f=t==null?void 0:t.key)==null?void 0:f.pageKey)!=null&&p.startsWith("/")?(d=(g=t==null?void 0:t.key)==null?void 0:g.pageKey)==null?void 0:d.substring(1):(J=t==null?void 0:t.key)==null?void 0:J.pageKey,buttons:a}})}),Ue=l.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:["新增","查看","编辑","删除"]}})},X=(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[]},fe=(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:X(s,n),checkedButtons:[],children:fe(s.children,ie.value)}:{...s,renderButtons:X(s,n),checkedButtons:[]}})},ze={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:ee.value,name:""}]}]},Qe=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:fe,addPathToTree:E,authorizeDialog:b,buttonValue:Te,changedRow:R,clickRow:k,clickRowButton:xe,clickSubmitAuthority:je,closeAuthorizeDialog:Fe,compName:se,convertArrayToTree:W,convertIndexToLabel:U,customNodeClass:We,getActivePageStructureId:he,getAuthorityKey:ae,getFirstArrayProperty:j,getLeafNodesRecursive:q,getPageDataAsync:Oe,groupByField:L,handleAddSysMenusButtons:Ve,handleItemDataChange:Ke,handleNodeBtnChange:_e,handleNodeCheckChange:qe,handleQueryChange:De,handleRowAuthorityRender:_,handleSubmitAsync:P,isPageDataExist:Ce,menuData:w,menusButtons:Le,pageData:ee,pageDataFiltered:Pe,queryFormData:Be,structureButtons:ie,structureId:N,submitTableAsyncByVerify:V,tempRolePageData:ze,tempSysMenus:Ue,treeRef:O},Symbol.toStringTag,{value:"Module"})),ye=Y.useLoginState(u.pinia),{superAdminInfo:Ge,cryptoInfo:y}=u.storeToRefs(ye),Je=u.useMenuState(u.pinia),{activeMenuPath:v}=u.storeToRefs(Je),I="123456",He=F(u.pinia),{routerPageStructures:Xe}=u.storeToRefs(He),z=l.ref(0),Ye=l.ref([{label:"用户名称",value:"",name:"userName"}]),K=l.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),Ze=e=>{console.log("handleQueryChange",e)},Q=l.ref([]),pe=l.ref(""),$=l.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?(pe.value=e.name,Q.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=>{x(e.singleContent,e.buttonName,z.value)},M=l.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(()=>{M.value={...r,password:I},x(M.value,e,z.value)}).catch(()=>{i.ElMessage.info("取消重置")})},ge=()=>{G(v.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));$.value=(s=$.value)==null?void 0:s.map(t=>t.key==="tableContents"?{...t,contents:r==null?void 0:r.map(n=>{var a;return{...n,password:D.decryptData(n==null?void 0:n.password,(a=y==null?void 0:y.value)==null?void 0:a.privateKey)}})}:t)})},T=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 ye.setLogRecordAsync({type:s,data:r},v.value),a.data.result||((n=a==null?void 0:a.data)==null?void 0:n.code)===200):null}catch(a){i.ElMessage.error(a)}},x=(e,r,s)=>{var a,o,c,h,f,p;const t=u.cloneDeep(e);t!=null&&t.id&&delete t.id;const n=U(t,Q.value);D.isEncryptAvailable()&&n&&(!n.password&&K.value?n.password=D.encryptData(I,(a=y==null?void 0:y.value)==null?void 0:a.publicKey):n.password&&K.value&&(n.password=D.encryptData(n==null?void 0:n.password,(o=y==null?void 0:y.value)==null?void 0:o.publicKey))),r==="新增"?T(i.createInsofDataApi,{key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(c=v.value)!=null&&c.startsWith("/")?(h=v.value)==null?void 0:h.substring(1):v.value,tableId:s},value:{tableData:n}},r).then(g=>{var d;M.value={...e,newId:g,password:K.value?D.decryptData((e==null?void 0:e.password)??I,(d=y==null?void 0:y.value)==null?void 0:d.privateKey):e==null?void 0:e.password}}):r==="编辑"||r==="重置密码"?T(i.updateInsofDataApi,{id:e.id,key:{type:"data",layer:n==null?void 0:n.layer,systemKey:sessionStorage.getItem("systemKey"),pageKey:(f=v.value)!=null&&f.startsWith("/")?(p=v.value)==null?void 0:p.substring(1):v.value,tableId:s},value:{tableData:n}},r).then(()=>{r==="重置密码"&&ge(),b.show=!1}):r==="删除"&&T(i.deleteInsofDataApi,{id:e.id},r).then(()=>{r&&i.ElMessage.success(r+"成功")})},G=async e=>{const r=await T(i.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:$.value,name:""}]}]},rt=Object.freeze(Object.defineProperty({__proto__:null,changedRow:M,clickRowButton:tt,columns:Q,compName:pe,getPageDataAsync:G,handleItemDataChange:me,handleQueryChange:Ze,handleSubmitAsync:T,loginUserIsSuper:K,onDoubleClick:et,pageData:$,queryFormData:Ye,refreshUserTableData:ge,resetPassword:I,structureId:z,submitTableAsyncByVerify:x,tempUserPageData:st},Symbol.toStringTag,{value:"Module"}));exports.State=rt;exports.State$1=Qe;exports.addPathToTree=E;exports.convertArrayToTree=W;exports.getActivePageStructureId=he;exports.getFirstArrayProperty=j;exports.getLeafNodesRecursive=q;exports.getPageDataAsync=G;exports.groupByField=L;exports.handleRowAuthorityRender=_;exports.handleSubmitAsync=T;exports.resetPassword=I;exports.submitTableAsyncByVerify=x;exports.useAuthorityState=F;
|