ss-component-new 1.1.700 → 1.1.701
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/{index-CUeBezD8.js → index-4Zl8Xo3b.js} +1 -1
- package/dist/{index-Cb32xjFZ.js → index-5bmcHPsQ.js} +1 -1
- package/dist/{index-DjE5Ysww.cjs → index-81et_gzg.cjs} +1 -1
- package/dist/{index-BZkH2AYa.cjs → index-8oDF5A86.cjs} +1 -1
- package/dist/{index-CpVbq1-M.js → index-8yV5RCST.js} +3 -3
- package/dist/{index-Byg_ytVM.cjs → index-B4WbSopN.cjs} +1 -1
- package/dist/{index-C6F_Qv9_.js → index-BCsA6oPM.js} +1 -1
- package/dist/{index-BATTsE24.cjs → index-BDarEK15.cjs} +1 -1
- package/dist/index-BHg8omD9.cjs +4207 -0
- package/dist/{index-93C8iyFE.js → index-BNsJ-GaS.js} +3 -3
- package/dist/{index-BHQVIwyk.cjs → index-BOTozLBt.cjs} +1 -1
- package/dist/{index-DEq7wJY1.js → index-BR9Bkj8j.js} +2 -2
- package/dist/{index-D1XVwmSY.cjs → index-BX81_nVT.cjs} +1 -1
- package/dist/{index-2ulWVy3d.cjs → index-BhEOQCwM.cjs} +1 -1
- package/dist/{index-PQkyr0fX.cjs → index-BqbGv6eU.cjs} +1 -1
- package/dist/{index-DN2QwSUK.js → index-CFgChxxn.js} +1 -1
- package/dist/{index-DiQO9fWs.js → index-CKPCs0zZ.js} +1 -1
- package/dist/{index-BK_gZgTv.cjs → index-CNJadwO3.cjs} +1 -1
- package/dist/{index-CExnWkA_.js → index-CTaQ3_ar.js} +5 -5
- package/dist/{index-CoWciNYv.cjs → index-CcQgBIGQ.cjs} +1 -1
- package/dist/{index-CFKxyViV.cjs → index-Ccj4Ww0c.cjs} +1 -1
- package/dist/{index-CFhcz74Q.cjs → index-Cd2vau9T.cjs} +1 -1
- package/dist/{index-D6qD21Ix.js → index-CdT7SG2F.js} +2 -2
- package/dist/{index-8xlKMpoE.js → index-CqXufKHy.js} +4 -4
- package/dist/{index-CjWYNXJT.js → index-D3mUjxDs.js} +2 -2
- package/dist/{index-lidssfyt.cjs → index-D4pkAkYA.cjs} +1 -1
- package/dist/{index-DLjoqkdV.cjs → index-D7l7lfFr.cjs} +1 -1
- package/dist/{index-DoIEdw8s.js → index-DCnYFG4p.js} +1 -1
- package/dist/{index-CcqdORI3.js → index-DGPN90Ai.js} +3 -3
- package/dist/{index-hV6DKDhA.js → index-DGr2MB22.js} +1 -1
- package/dist/{index-3QcIIUEm.cjs → index-DPvx5uGk.cjs} +1 -1
- package/dist/{index-CxaglDTy.js → index-DRphgX2Y.js} +2 -2
- package/dist/{index-DXOWTqkQ.cjs → index-DYb_tPOe.cjs} +1 -1
- package/dist/{index-taLX3PyV.js → index-DYeJ0CiS.js} +3 -3
- package/dist/{index-DTS5HoBL.cjs → index-DjbZR91u.cjs} +1 -1
- package/dist/{index-BWEZHRoP.cjs → index-DlolcnUO.cjs} +1 -1
- package/dist/{index-CHpug0AB.js → index-Dqx8gOJj.js} +4 -4
- package/dist/{index-0HVaDday.js → index-Drk2lz_8.js} +6 -6
- package/dist/{index-Q1KFBEHT.cjs → index-EoGuP7oJ.cjs} +1 -1
- package/dist/{index-D7H4IUAy.js → index-JQ4iyj7d.js} +6245 -6243
- package/dist/{index-De0Htvy7.cjs → index-QBUhi9pM.cjs} +1 -1
- package/dist/{index-CKIdU8EK.js → index-i_g0u0HO.js} +11 -11
- package/dist/{index-B6mToQuG.cjs → index-qi0TPv2h.cjs} +1 -1
- package/dist/{index-tvN7VQd9.js → index-ztYKbPI5.js} +2 -2
- package/dist/{index.vue_vue_type_script_setup_true_lang-C5Da5wgR.cjs → index.vue_vue_type_script_setup_true_lang-5ODqcZKZ.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-BLoXxbh7.js → index.vue_vue_type_script_setup_true_lang-5j56eVHQ.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BoeHjHvL.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-GTWb_lSA.cjs} +75 -75
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-2BcDac2G.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-MnXEDK7z.js} +13174 -13170
- package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-CSBgd-nK.cjs → index.vue_vue_type_style_index_0_scoped_8606206c_lang-BUYIHNfE.cjs} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-BTJIrX9N.js → index.vue_vue_type_style_index_0_scoped_8606206c_lang-Juctm03O.js} +4057 -4045
- package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-aXLz0m42.js → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-BE5_4IYF.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-CChyQerd.cjs → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-J9LYcp1E.cjs} +1 -1
- package/dist/login--KAKf5hd.cjs +1 -0
- package/dist/login-BgJMdLxw.js +129 -0
- package/dist/{main-CyQ4UF_Y.js → main-BMtLjkxW.js} +2 -2
- package/dist/{main-DeQ7S8rk.cjs → main-Bl1MNCVY.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +8 -8
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +9 -9
- package/dist/{threeModel-D8WCN59B.cjs → threeModel-CjF5hB0y.cjs} +1 -1
- package/dist/{threeModel-eIUmTdU1.js → threeModel-DuXANNiw.js} +1 -1
- package/package.json +1 -1
- package/dist/index-BwFFWhXT.cjs +0 -4207
- package/dist/login-CA5LBy6E.js +0 -130
- package/dist/login-CViEGqhb.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,6 +1,6 @@
|
|
|
1
1
|
import { ref as n, watch as b } from "vue";
|
|
2
2
|
import { g as y } from "./index-BCZ59Y4K.js";
|
|
3
|
-
import { s as d, f as m } from "./index-
|
|
3
|
+
import { s as d, f as m } from "./index-BCsA6oPM.js";
|
|
4
4
|
import { u as g } from "./modelComp-BuMlc62t.js";
|
|
5
5
|
import { s as f } from "./menu-DznNubRA.js";
|
|
6
6
|
const D = g(), { itemData: i } = f(D), c = n(0), h = n([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as l, watch as b } from "vue";
|
|
2
2
|
import { g as y } from "./index-BCZ59Y4K.js";
|
|
3
|
-
import { s as m, f as d } from "./index-
|
|
3
|
+
import { s as m, f as d } from "./index-BCsA6oPM.js";
|
|
4
4
|
import { u as g } from "./modelComp-BuMlc62t.js";
|
|
5
5
|
import { s as f } from "./menu-DznNubRA.js";
|
|
6
6
|
const D = g(), { itemData: h } = f(D), c = l(0), i = l([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),g=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),g=require("./index-Ccj4Ww0c.cjs"),a=require("./menu-CfFgYmpV.cjs"),B=require("./modelComp-BR-oztFR.cjs");require("./array-CdPv8cht.cjs");const y=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),T=require("./index-C31XRLFj.cjs"),F=require("./index-QBUhi9pM.cjs"),O=require("./index-B3UVui7c.cjs"),R=require("./index-2p69g4HY.cjs"),b={class:"type-select"},L=["onClick"],U={class:"list-icon"},z={__name:"index",setup(V){const u=B.useModelComp(a.pinia),{itemData:r}=a.storeToRefs(u),C=_=>{const p=a.cloneDeep(r.value);p.push({comp:_.comp,name:_.name,compData:[]}),u.setItemData(p)};return(_,p)=>{const i=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g.slotContent),(f,v)=>(e.openBlock(),e.createElementBlock("div",{class:"type-list",key:v},[e.createElementVNode("div",{class:"list-content",onClick:k=>C(f)},[e.createElementVNode("div",U,[e.createVNode(i,{name:f.icon},null,8,["name"])]),e.createElementVNode("div",null,e.toDisplayString(f.name),1)],8,L)]))),128))])}}},H=y._export_sfc(z,[["__scopeId","data-v-1f87163f"]]),j={class:"fill-content"},A={class:"operate-content"},G={class:"collapse-title-content"},J={class:"collapse-title-item"},K={key:1},P=["onClick"],Q={class:"icon-content"},W={key:0,class:"edit-content"},X=["onClick"],Y={class:"comp-child"},Z={__name:"index",setup(V){const u=B.useModelComp(a.pinia),{itemData:r,originalData:C}=a.storeToRefs(u),_=e.ref([]);e.ref([]);const p=e.ref([]),i=e.ref([]),f=s=>{var n;let c=(n=a.cloneDeep(i.value))==null?void 0:n.map((t,o)=>(s===o&&(t.content=!0),t));i.value=c},v=s=>{var n;let c=(n=a.cloneDeep(i.value))==null?void 0:n.map((t,o)=>(s===o&&(t.content=!1),t));i.value=c,_.value=a.cloneDeep(r.value)},k=(s,c)=>{var h;let n=(h=a.cloneDeep(i.value))==null?void 0:h.map((l,m)=>(s===m&&(l.content=!1),l));i.value=n;const t=a.cloneDeep(r.value),o=t==null?void 0:t.filter((l,m)=>(m===s&&(l.name=c),l));u.setOriginalData(o),u.setItemData(o)};e.watch(()=>r.value,()=>{var s,c,n;!r.value||((s=r.value)==null?void 0:s.length)===0?_.value=[]:_.value=(c=a.cloneDeep(r.value))==null?void 0:c.filter(t=>(t==null?void 0:t.comp)!=="methodButton"),p.value=_.value,i.value=(n=a.cloneDeep(p.value))==null?void 0:n.map((t,o)=>({id:o,content:!1}))},{deep:!0,immediate:!0});const S=s=>g.getComponent(s),q=(s,c,n)=>{var o,h;if(!s)return;let t=a.cloneDeep(r.value);t=(o=t==null?void 0:t.map((l,m)=>(m===n&&(l.compData=s),l)))==null?void 0:o.filter(l=>(l==null?void 0:l.comp)!=="methodButton"),i.value=(h=a.cloneDeep(t))==null?void 0:h.map((l,m)=>({id:m,content:!1})),u.setOriginalData(t),u.setItemData(t)},M=s=>{O.ElMessageBox.confirm("是否确认要删除","",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{const c=a.cloneDeep(r.value),n=c==null?void 0:c.filter((t,o)=>o!==s);u.setOriginalData(n),u.setItemData(n),R.ElMessage({type:"success",message:"删除成功"})}).catch(()=>{})};return(s,c)=>{const n=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",j,[c[1]||(c[1]=e.createElementVNode("div",{class:"fill-operate"},e.toDisplayString("操作栏"),-1)),e.createElementVNode("div",A,[e.createVNode(T.default,{class:"collapse-content",collapseContents:_.value},{title:e.withCtx(({item:t,index:o})=>{var h,l,m,D,E,N,w,x,$,I;return[e.createElementVNode("div",G,[e.createElementVNode("div",J,[(l=(h=i.value)==null?void 0:h.find(d=>d.id===o))!=null&&l.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"collapse-title",style:e.normalizeStyle({marginRight:t.name&&t.name!==""?"8px":"0px"})},e.toDisplayString(t.name),5)),(D=(m=i.value)==null?void 0:m.find(d=>d.id===o))!=null&&D.content?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(F._sfc_main$2,{modelValue:t.name,"onUpdate:modelValue":d=>t.name=d,onClick:c[0]||(c[0]=e.withModifiers(()=>{},["stop"]))},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(N=(E=i.value)==null?void 0:E.find(d=>d.id===o))!=null&&N.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(d=>f(o),["stop"]),class:"icon-content"},[e.createVNode(n,{name:"Edit",style:{width:"16px",height:"16px"}})],8,P))]),e.createElementVNode("div",Q,[(x=(w=i.value)==null?void 0:w.find(d=>d.id===o))!=null&&x.content?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(n,{name:"Cancel",style:{width:"16px",height:"16px"},class:"icon-content",onClick:e.withModifiers(d=>v(o),["stop"])},null,8,["onClick"]),e.createVNode(n,{name:"Save",onClick:e.withModifiers(d=>k(o,t.name),["stop"]),style:{width:"16px",height:"16px",fill:"var(--ssComponent-primary-color)"},class:"icon-content"},null,8,["onClick"])])):e.createCommentVNode("",!0),(I=($=i.value)==null?void 0:$.find(d=>d.id===o))!=null&&I.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(d=>M(o),["stop"]),class:"icon-content"},[e.createVNode(n,{name:"Delete",style:{width:"16px",height:"16px"}})],8,X))])])]}),content:e.withCtx(({item:t,index:o})=>{var h,l;return[e.createElementVNode("div",Y,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(S(t.comp+"Operate")),{itemContents:t==null?void 0:t.compData,originalItemContents:(l=(h=p.value)==null?void 0:h.find((m,D)=>D===o))==null?void 0:l.compData,onChange:m=>q(m,t,o)},null,40,["itemContents","originalItemContents","onChange"]))])]}),_:1},8,["collapseContents"])])])}}},ee=y._export_sfc(Z,[["__scopeId","data-v-27bd1564"]]),te={key:0,class:"show-content"},oe={style:{display:"flex"}},ne={__name:"index",setup(V){const u=B.useModelComp(a.pinia),{itemData:r}=a.storeToRefs(u),C=e.ref([]);e.watch(()=>r.value,()=>{var p;!r.value||((p=r.value)==null?void 0:p.length)===0?C.value=[]:C.value=a.cloneDeep(r.value)},{deep:!0,immediate:!0});const _=p=>g.getComponent(p);return(p,i)=>{var f;return((f=C.value)==null?void 0:f.length)>0?(e.openBlock(),e.createElementBlock("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(v,k)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:k},[e.createElementVNode("div",oe,e.toDisplayString(v.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_(v.comp)),{itemData:v==null?void 0:v.compData,childItemData:v==null?void 0:v.itemChildData,key:k},null,8,["itemData","childItemData"]))]))),128))])):e.createCommentVNode("",!0)}}},le=y._export_sfc(ne,[["__scopeId","data-v-bfa22d29"]]);exports.modelFill=ee;exports.modelSelect=H;exports.modelShow=le;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("vue"),i=require("./index-2p69g4HY.cjs"),h=require("./menu-CfFgYmpV.cjs"),Y=require("./login-CViEGqhb.cjs"),de=require("./modelComp-BR-oztFR.cjs"),D=require("./crypto-CRbcEKIz.cjs"),Ae=require("./index-B3UVui7c.cjs"),F=h.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),be=h.useMenuState(h.pinia),{activeMenuPath:A}=h.storeToRefs(be),Z=Y.useLoginState(h.pinia),{structureData:ke}=h.storeToRefs(Z),Se=F(h.pinia),{routerPageStructures:Be}=h.storeToRefs(Se),m=de.useModelComp(h.pinia),Te=l.ref([{label:"角色名称",value:"",name:"roleName"}]),Ce=l.ref([{label:"查询"},{label:"重置"}]),H=l.reactive({isFilter:!1,filterForm:{}}),De=l.ref(!1),Pe=e=>{H.isFilter=!0,H.filterForm=e},ee=l.ref([]),te=l.ref([]),se=l.ref(""),Ke=l.computed(()=>{var r,s,t,n,a;const e=(r=Be.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 u=[];return K.value?u=[...c==null?void 0:c.contents,{label:"授权"}]:u=c==null?void 0:c.contents,{...c,contents:u}}return c});return ae(o),o}return[]}),$e=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}),q=(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},_=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)},Me=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},Ee=e=>{const r=[];for(const s in e)e[s].forEach(n=>{var u,f;const a=(u=n.path)!=null&&u.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},Ne=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},xe=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},Fe=async(e,r)=>{var s,t;if(k.value=h.cloneDeep(r),m.setRefreshCurStructure(!1),(s=B.value)==null||s.splice(0),e==="授权"){if(!S.value){i.ElMessage.error("请正确定义角色权限");return}const n=Me(k.value[S.value]);let a;if(n)a=k.value[S.value];else{const c=W(k.value[S.value]),u=E(c),f=L(u),p=q(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($.value,a)}},Oe=()=>{b.show=!1},I=l.ref(),je=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,u;const t=h.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=>{I.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("/")?(u=A.value)==null?void 0:u.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},We=()=>{const e=ue($.value),r=Ne(e),s=Ee(r),t=ce(s),n=xe(t);I.value={...k.value,[S.value]:n},l.nextTick(()=>{V(I.value,"编辑",N.value)})},b=l.reactive({show:!1,title:"角色授权",width:"50%",draggable:!0}),qe=({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},$=l.ref([]),Le=l.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),_e=(e,r)=>{var s;e.checkedButtons=r?(s=e.renderButtons)==null?void 0:s.map(t=>t.path):[]},B=l.ref([]),Ue=(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||($.value=re($.value))});const ie=l.computed(()=>{var s;const e=(s=h.cloneDeep(ke.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,u,f,p,g,d,J;const n=/button/i;let a=(u=(c=(o=t==null?void 0:t.value)==null?void 0:o.pageData)==null?void 0:c.compData)==null?void 0:u.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}})}),Ve=l.ref([]),ze=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:[]}})},Qe={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:ee.value,name:""}]}]},Ge=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:fe,addPathToTree:E,authorizeDialog:b,buttonValue:Ce,changedRow:I,clickRow:k,clickRowButton:Fe,clickSubmitAuthority:We,closeAuthorizeDialog:Oe,compName:se,convertArrayToTree:W,convertIndexToLabel:U,customNodeClass:qe,getActivePageStructureId:he,getAuthorityKey:ae,getFirstArrayProperty:j,getLeafNodesRecursive:L,getPageDataAsync:je,groupByField:q,handleAddSysMenusButtons:ze,handleItemDataChange:$e,handleNodeBtnChange:Ue,handleNodeCheckChange:_e,handleQueryChange:Pe,handleRowAuthorityRender:_,handleSubmitAsync:P,isPageDataExist:De,menuData:$,menusButtons:Le,pageData:ee,pageDataFiltered:Ke,queryFormData:Te,structureButtons:ie,structureId:N,submitTableAsyncByVerify:V,tempRolePageData:Qe,tempSysMenus:Ve,treeRef:O},Symbol.toStringTag,{value:"Module"})),ye=Y.useLoginState(h.pinia),{superAdminInfo:Je,cryptoInfo:y}=h.storeToRefs(ye),He=h.useMenuState(h.pinia),{activeMenuPath:v}=h.storeToRefs(He),w="123456",Xe=F(h.pinia),{routerPageStructures:Ye}=h.storeToRefs(Xe),z=l.ref(0),Ze=l.ref([{label:"用户名称",value:"",name:"userName"}]),K=l.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),me=e=>{console.log("handleQueryChange",e)},Q=l.ref([]),pe=l.ref(""),R=l.computed(()=>{var r,s,t,n,a;const e=(r=Ye.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 u=[...c==null?void 0:c.contents,{label:"重置密码"}];return{...c,contents:u}}return c})):[]}),et=e=>{x(e.singleContent,e.buttonName,z.value)},M=l.ref(),tt=e=>{console.log("onDoubleClick",e)},st=(e,r)=>{e==="重置密码"&&Ae.ElMessageBox.confirm(`该操作将会重置【${r==null?void 0:r.account}】的密码,确认重置?`,"警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{M.value={...r,password:w},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)!==Je.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: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,u,f,p;const t=h.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(w,(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("/")?(u=v.value)==null?void 0:u.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)??w,(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}})},rt={comp:"Group",name:"/系统管理/用户管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:R.value,name:""}]}]},nt=Object.freeze(Object.defineProperty({__proto__:null,changedRow:M,clickRowButton:st,columns:Q,compName:pe,getPageDataAsync:G,handleItemDataChange:et,handleQueryChange:me,handleSubmitAsync:T,loginUserIsSuper:K,onDoubleClick:tt,pageData:R,queryFormData:Ze,refreshUserTableData:ge,resetPassword:w,structureId:z,submitTableAsyncByVerify:x,tempUserPageData:rt},Symbol.toStringTag,{value:"Module"}));exports.State=nt;exports.State$1=Ge;exports.addPathToTree=E;exports.convertArrayToTree=W;exports.getActivePageStructureId=he;exports.getFirstArrayProperty=j;exports.getLeafNodesRecursive=L;exports.getPageDataAsync=G;exports.groupByField=q;exports.handleRowAuthorityRender=_;exports.handleSubmitAsync=T;exports.resetPassword=w;exports.submitTableAsyncByVerify=x;exports.useAuthorityState=F;
|
|
1
|
+
"use strict";const l=require("vue"),i=require("./index-2p69g4HY.cjs"),h=require("./menu-CfFgYmpV.cjs"),Y=require("./login--KAKf5hd.cjs"),de=require("./modelComp-BR-oztFR.cjs"),D=require("./crypto-CRbcEKIz.cjs"),Ae=require("./index-B3UVui7c.cjs"),F=h.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),be=h.useMenuState(h.pinia),{activeMenuPath:A}=h.storeToRefs(be),Z=Y.useLoginState(h.pinia),{structureData:ke}=h.storeToRefs(Z),Se=F(h.pinia),{routerPageStructures:Be}=h.storeToRefs(Se),m=de.useModelComp(h.pinia),Te=l.ref([{label:"角色名称",value:"",name:"roleName"}]),Ce=l.ref([{label:"查询"},{label:"重置"}]),H=l.reactive({isFilter:!1,filterForm:{}}),De=l.ref(!1),Pe=e=>{H.isFilter=!0,H.filterForm=e},ee=l.ref([]),te=l.ref([]),se=l.ref(""),Ke=l.computed(()=>{var r,s,t,n,a;const e=(r=Be.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 u=[];return K.value?u=[...c==null?void 0:c.contents,{label:"授权"}]:u=c==null?void 0:c.contents,{...c,contents:u}}return c});return ae(o),o}return[]}),$e=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}),q=(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},_=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)},Me=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},Ee=e=>{const r=[];for(const s in e)e[s].forEach(n=>{var u,f;const a=(u=n.path)!=null&&u.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},Ne=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},xe=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},Fe=async(e,r)=>{var s,t;if(k.value=h.cloneDeep(r),m.setRefreshCurStructure(!1),(s=B.value)==null||s.splice(0),e==="授权"){if(!S.value){i.ElMessage.error("请正确定义角色权限");return}const n=Me(k.value[S.value]);let a;if(n)a=k.value[S.value];else{const c=W(k.value[S.value]),u=E(c),f=L(u),p=q(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($.value,a)}},Oe=()=>{b.show=!1},I=l.ref(),je=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,u;const t=h.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=>{I.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("/")?(u=A.value)==null?void 0:u.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},We=()=>{const e=ue($.value),r=Ne(e),s=Ee(r),t=ce(s),n=xe(t);I.value={...k.value,[S.value]:n},l.nextTick(()=>{V(I.value,"编辑",N.value)})},b=l.reactive({show:!1,title:"角色授权",width:"50%",draggable:!0}),qe=({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},$=l.ref([]),Le=l.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]),_e=(e,r)=>{var s;e.checkedButtons=r?(s=e.renderButtons)==null?void 0:s.map(t=>t.path):[]},B=l.ref([]),Ue=(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||($.value=re($.value))});const ie=l.computed(()=>{var s;const e=(s=h.cloneDeep(ke.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,u,f,p,g,d,J;const n=/button/i;let a=(u=(c=(o=t==null?void 0:t.value)==null?void 0:o.pageData)==null?void 0:c.compData)==null?void 0:u.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}})}),Ve=l.ref([]),ze=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:[]}})},Qe={comp:"Group",name:"/系统管理/角色管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:ee.value,name:""}]}]},Ge=Object.freeze(Object.defineProperty({__proto__:null,addButtonsToTree:fe,addPathToTree:E,authorizeDialog:b,buttonValue:Ce,changedRow:I,clickRow:k,clickRowButton:Fe,clickSubmitAuthority:We,closeAuthorizeDialog:Oe,compName:se,convertArrayToTree:W,convertIndexToLabel:U,customNodeClass:qe,getActivePageStructureId:he,getAuthorityKey:ae,getFirstArrayProperty:j,getLeafNodesRecursive:L,getPageDataAsync:je,groupByField:q,handleAddSysMenusButtons:ze,handleItemDataChange:$e,handleNodeBtnChange:Ue,handleNodeCheckChange:_e,handleQueryChange:Pe,handleRowAuthorityRender:_,handleSubmitAsync:P,isPageDataExist:De,menuData:$,menusButtons:Le,pageData:ee,pageDataFiltered:Ke,queryFormData:Te,structureButtons:ie,structureId:N,submitTableAsyncByVerify:V,tempRolePageData:Qe,tempSysMenus:Ve,treeRef:O},Symbol.toStringTag,{value:"Module"})),ye=Y.useLoginState(h.pinia),{superAdminInfo:Je,cryptoInfo:y}=h.storeToRefs(ye),He=h.useMenuState(h.pinia),{activeMenuPath:v}=h.storeToRefs(He),w="123456",Xe=F(h.pinia),{routerPageStructures:Ye}=h.storeToRefs(Xe),z=l.ref(0),Ze=l.ref([{label:"用户名称",value:"",name:"userName"}]),K=l.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),me=e=>{console.log("handleQueryChange",e)},Q=l.ref([]),pe=l.ref(""),R=l.computed(()=>{var r,s,t,n,a;const e=(r=Ye.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 u=[...c==null?void 0:c.contents,{label:"重置密码"}];return{...c,contents:u}}return c})):[]}),et=e=>{x(e.singleContent,e.buttonName,z.value)},M=l.ref(),tt=e=>{console.log("onDoubleClick",e)},st=(e,r)=>{e==="重置密码"&&Ae.ElMessageBox.confirm(`该操作将会重置【${r==null?void 0:r.account}】的密码,确认重置?`,"警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{M.value={...r,password:w},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)!==Je.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: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,u,f,p;const t=h.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(w,(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("/")?(u=v.value)==null?void 0:u.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)??w,(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}})},rt={comp:"Group",name:"/系统管理/用户管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:R.value,name:""}]}]},nt=Object.freeze(Object.defineProperty({__proto__:null,changedRow:M,clickRowButton:st,columns:Q,compName:pe,getPageDataAsync:G,handleItemDataChange:et,handleQueryChange:me,handleSubmitAsync:T,loginUserIsSuper:K,onDoubleClick:tt,pageData:R,queryFormData:Ze,refreshUserTableData:ge,resetPassword:w,structureId:z,submitTableAsyncByVerify:x,tempUserPageData:rt},Symbol.toStringTag,{value:"Module"}));exports.State=nt;exports.State$1=Ge;exports.addPathToTree=E;exports.convertArrayToTree=W;exports.getActivePageStructureId=he;exports.getFirstArrayProperty=j;exports.getLeafNodesRecursive=L;exports.getPageDataAsync=G;exports.groupByField=q;exports.handleRowAuthorityRender=_;exports.handleSubmitAsync=T;exports.resetPassword=w;exports.submitTableAsyncByVerify=x;exports.useAuthorityState=F;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as C, reactive as k, ref as v, onMounted as D, nextTick as b, resolveComponent as i, resolveDirective as T, createElementBlock as u, openBlock as m, createVNode as t, withCtx as n, withDirectives as w, createElementVNode as p, createTextVNode as _ } from "vue";
|
|
2
|
-
import { S as x } from "./index-
|
|
3
|
-
import { s as B } from "./index-
|
|
4
|
-
import { s as F, e as y } from "./index-
|
|
2
|
+
import { S as x } from "./index-DYeJ0CiS.js";
|
|
3
|
+
import { s as B } from "./index-JQ4iyj7d.js";
|
|
4
|
+
import { s as F, e as y } from "./index-DRphgX2Y.js";
|
|
5
5
|
import { u as S, p as I, s as N } from "./menu-DznNubRA.js";
|
|
6
6
|
import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const E = { class: "menu-module" }, M = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./menu-CfFgYmpV.cjs"),_=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("./menu-CfFgYmpV.cjs"),_=require("./index-BHg8omD9.cjs"),r=require("./index-BrQVl4Zd.cjs"),C=require("./index-2p69g4HY.cjs"),g=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),v={class:"menu-content"},x=l.defineComponent({__name:"index",setup(q){const d=u.useMenuState(u.pinia),{menus:c}=u.storeToRefs(d),p=l.ref([]),f=async()=>{var o,t,n,a;const e=await C.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey")}});if(((o=e==null?void 0:e.data)==null?void 0:o.type)==="success"){let i=(n=(t=e==null?void 0:e.data)==null?void 0:t.result)==null?void 0:n.map(s=>s);return i=(a=u.cloneDeep(i))==null?void 0:a.map(s=>{var m;const b=Object.values((m=s==null?void 0:s.value)==null?void 0:m.tableData);return b.unshift({id:s==null?void 0:s.id}),b}),i}else return[]};l.onMounted(async()=>{var n;const e=await f(),t=[{key:"header",contents:[{label:"主菜单名称",formType:"Select",options:(n=u.cloneDeep(c.value))==null?void 0:n.map(a=>({label:a==null?void 0:a.title,value:a==null?void 0:a.title})),prop:"主菜单名称"},{label:"隐藏三维显示",formType:"Switch",value:!1,prop:"隐藏三维显示"},{label:"操作"}]},{key:"extraButton",contents:[{label:"新增"}]},{key:"rowButton",contents:[{label:"查看"},{label:"编辑"},{label:"删除"}]}];t.push({key:"tableContents",contents:e}),p.value=t});const y=e=>{(e==null?void 0:e.buttonName)==="新增"?r.addMenuContent(e==null?void 0:e.singleContent):(e==null?void 0:e.buttonName)==="删除"?r.deleteMenuContent(e==null?void 0:e.singleContent):(e==null?void 0:e.buttonName)==="编辑"&&r.fixMenuContent(e==null?void 0:e.singleContent)};return(e,o)=>(l.openBlock(),l.createElementBlock("div",v,[l.createVNode(_.ssTable,{itemData:p.value,class:"table-content",onChange:y},null,8,["itemData"])]))}}),h=g._export_sfc(x,[["__scopeId","data-v-26f5cadc"]]);exports.default=h;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as u, computed as R, reactive as J, nextTick as H, watch as X } from "vue";
|
|
2
2
|
import { g as j, E as b, bm as Y, bk as Z, bn as m } from "./index-BCZ59Y4K.js";
|
|
3
3
|
import { f as we, s as C, c as N, p as A, u as ee } from "./menu-DznNubRA.js";
|
|
4
|
-
import { u as te } from "./login-
|
|
4
|
+
import { u as te } from "./login-BgJMdLxw.js";
|
|
5
5
|
import { u as De } from "./modelComp-BuMlc62t.js";
|
|
6
6
|
import { d as se, i as Ie, e as V } from "./crypto-BRyGpjGR.js";
|
|
7
7
|
import { E as Ee } from "./index-COhyHXFv.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.vue_vue_type_script_setup_true_lang-5ODqcZKZ.cjs");exports.default=e._sfc_main;
|