ss-component-new 1.1.706 → 1.1.708

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.
Files changed (40) hide show
  1. package/dist/{index--BKY6t09.js → index-B2ZJJoT9.js} +1 -1
  2. package/dist/{index-BNFlELdW.cjs → index-BNkTi_Un.cjs} +1 -1
  3. package/dist/{index-BX997DA0.js → index-BTiKUORz.js} +1 -1
  4. package/dist/{index-DXCBhoy9.cjs → index-BUkhaqd8.cjs} +1 -1
  5. package/dist/{index-CAk5h97W.js → index-Bz3Cezt5.js} +1 -1
  6. package/dist/{index-BqKCUIAh.js → index-C5iB-Jqa.js} +1 -1
  7. package/dist/{index-BcYG8wjE.cjs → index-CJX26tPy.cjs} +1 -1
  8. package/dist/{index-CFvDfrn7.cjs → index-CLNkIjl-.cjs} +1 -1
  9. package/dist/{index-Djy7tVKB.cjs → index-CRQxupO9.cjs} +1 -1
  10. package/dist/{index-BvHT4_-u.js → index-CZTZmXUb.js} +1 -1
  11. package/dist/{index-D0Y__qdd.js → index-CZcYAuy-.js} +1 -1
  12. package/dist/{index-C_0_jtSi.cjs → index-CdYqA8UG.cjs} +1 -1
  13. package/dist/{index-D6TpnpGO.cjs → index-ChoJA9-j.cjs} +40 -40
  14. package/dist/{index-BSNZVFKa.js → index-CuB10mRD.js} +2 -2
  15. package/dist/{index-C968jgil.js → index-D-tQ0jb6.js} +7 -7
  16. package/dist/{index-Cgxq0tAs.js → index-DAMRPbhU.js} +4 -4
  17. package/dist/{index-CDe8uAMr.js → index-DAXBDVD_.js} +1 -1
  18. package/dist/{index-5qBWrSZU.cjs → index-DGJWUlc0.cjs} +1 -1
  19. package/dist/{index-B9in1by_.js → index-Dc2D3OrH.js} +1 -1
  20. package/dist/{index-RRvgacXx.cjs → index-Dl7UsRXv.cjs} +1 -1
  21. package/dist/{index-DWGvYkk9.js → index-Dm9remQj.js} +6203 -6181
  22. package/dist/{index-SWU-wgRh.js → index-Dr7Fdc81.js} +1 -1
  23. package/dist/{index-BpxPo5VN.cjs → index-ISxzVDVL.cjs} +1 -1
  24. package/dist/{index-DlD9sRqq.cjs → index-cn2PPpBp.cjs} +1 -1
  25. package/dist/{index-ChbTmas3.cjs → index-d_ANkYaS.cjs} +1 -1
  26. package/dist/{index-CNmvvV-c.cjs → index-lVXpDd-x.cjs} +1 -1
  27. package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-DZhCOVL9.js → index.vue_vue_type_style_index_0_scoped_8606206c_lang-BiGhmLqK.js} +4 -4
  28. package/dist/{index.vue_vue_type_style_index_0_scoped_8606206c_lang-DO2vPyVK.cjs → index.vue_vue_type_style_index_0_scoped_8606206c_lang-DAqIbp0A.cjs} +1 -1
  29. package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-CwX4Xyil.cjs → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-Do7w7r05.cjs} +1 -1
  30. package/dist/{index.vue_vue_type_style_index_0_scoped_c81d0427_lang-0THhazyL.js → index.vue_vue_type_style_index_0_scoped_c81d0427_lang-qJpParw9.js} +1 -1
  31. package/dist/{main-CEEPDwK7.cjs → main-8orFqQ9f.cjs} +1 -1
  32. package/dist/{main-Dy0la9NS.js → main-ZNwRxRST.js} +2 -2
  33. package/dist/ss-component.cjs +1 -1
  34. package/dist/ss-component.css +1 -1
  35. package/dist/ss-component.js +4 -4
  36. package/dist/ss-component2.cjs +1 -1
  37. package/dist/ss-component2.js +7 -7
  38. package/dist/{threeModel-DPwvjltF.cjs → threeModel-B8u76uPb.cjs} +1 -1
  39. package/dist/{threeModel-DjgnMY8_.js → threeModel-Dx_dcQrK.js} +1 -1
  40. package/package.json +1 -1
@@ -3,7 +3,7 @@ import "./index-BHtNKL1L.js";
3
3
  import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BrQQ9PKj.js";
4
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-DWGvYkk9.js";
6
+ import { s as u } from "./index-Dm9remQj.js";
7
7
  import { S as l } from "./index-di1QdZZr.js";
8
8
  import { i as d } from "./index-CCxinvIS.js";
9
9
  const _ = { class: "role-wrapper" }, w = /* @__PURE__ */ o({
@@ -1,4 +1,4 @@
1
- import { _ as M } from "./index.vue_vue_type_style_index_0_scoped_c81d0427_lang-0THhazyL.js";
1
+ import { _ as M } from "./index.vue_vue_type_style_index_0_scoped_c81d0427_lang-qJpParw9.js";
2
2
  import { resolveComponent as a, createElementBlock as s, openBlock as l, Fragment as f, createVNode as n, withCtx as i, createElementVNode as r, createCommentVNode as D, normalizeStyle as b, toDisplayString as C, renderList as h, createTextVNode as u, createBlock as B, resolveDynamicComponent as w } from "vue";
3
3
  import { _ as I } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const V = ["title"], $ = {
@@ -1 +1 @@
1
- "use strict";const d=require("vue"),T=require("./menu-vml_xHJD.cjs"),pe=require("./index-D6TpnpGO.cjs"),fe=require("./index-B1XyxOHh.cjs"),y=require("./index-2p69g4HY.cjs"),ie=require("./login-CCz_BcJe.cjs"),E=T.useModelComp(T.pinia),m=pe.useUnit(T.pinia),I=T.useMenuState(T.pinia),{menus:ee,configMenu:x,activeMenuPath:_,cacheStructures:F}=T.storeToRefs(I),$=d.ref(!1),te=d.computed(()=>{var e,t;return[{key:"extraButton",contents:[]},{key:"rowButton",contents:[{label:"修改"}]},{key:"header",contents:[{label:"菜单名称",prop:"title",isFormColHidden:!1},{label:"菜单类型",prop:"menuType",formType:"select",options:[{label:"系统菜单",value:"集团"},{label:"公司",value:"公司"}],isTableColHidden:!1,isFormColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:(t=(e=T.cloneDeep(ee.value))==null?void 0:e.map(l=>({...l,menuType:"系统菜单"})))==null?void 0:t.filter(l=>l.title!=="系统管理"&&l.title!=="平台管理")}]}),j=d.ref([]),q=d.ref([{label:"新建"}]),de=d.computed(()=>[{key:"extraButton",contents:q.value},{key:"rowButton",contents:[{label:"修改"},{label:"删除"}]},{key:"header",contents:[{label:"操作类型",prop:"operateType",formType:"select",options:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标",prop:"operateIcon",formType:"inputPopover",value:""},{label:"操作触发事件",prop:"trigger",formType:"select",options:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"配置一:",prop:"dialogConfig",formType:"button",value:"弹窗内容",isTableColHidden:!0},{label:"配置二:",prop:"contentConfig",formType:"button",value:"模块内容",isTableColHidden:!0},{label:"继承配置:",prop:"allowInherit",formType:"radio",contents:[{label:"是",value:!0},{label:"否",value:!1}],value:!1,isTableColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:j.value}]),J=d.ref([]),k=d.ref({}),ge=d.ref({}),R=d.ref([{label:"菜单",prop:"path",isFormColHidden:!0,value:""},{label:"操作类型:",prop:"operateType",type:"select",contents:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标:",prop:"operateIcon",type:"inputPopover",value:""},{label:"操作触发事件:",prop:"trigger",type:"select",contents:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"生成的菜单图标:",prop:"menuIcon",type:"inputPopover",value:""},{label:"配置一:",prop:"dialogConfig",type:"button",value:"操作触发的弹窗结构"},{label:"配置二:",prop:"contentConfig",type:"button",value:"操作生成的模块结构",isFormColHidden:!1},{label:"",prop:"structureIds",type:"input",value:[],isFormColHidden:!0},{label:"继承配置:",prop:"allowInherit",type:"radio",contents:[{label:"是",value:!0},{label:"否",value:!1}],value:!0}]),O=e=>{var t;J.value=e?(t=R.value)==null?void 0:t.map(l=>l.prop==="dialogConfig"||l.prop==="contentConfig"||l.prop==="trigger"?l:{...l,value:e?e[l==null?void 0:l.prop]:""}):R.value},ve=d.ref([{label:"查询"},{label:"重置"}]),ye=async()=>{},le=e=>e.map(t=>t.childMenus&&t.childMenus.length>0?{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title,children:le(t.childMenus)}:{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title}),g=d.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),U=d.ref([]),C=d.ref({}),h=d.ref(null),ae=d.ref([]),oe=d.computed(()=>{var e;return(e=le(ee.value))==null?void 0:e.filter(t=>t.title!=="系统管理"&&t.title!=="平台管理")}),ne=async e=>{var l,u,n,c;const t=await y.getInsofDataApi({key:{type:"subStructure",systemKey:sessionStorage.getItem("systemKey"),pageKey:e,version:1}});if(((l=t==null?void 0:t.data)==null?void 0:l.code)===200&&(u=t.data)!=null&&u.result){const r=(c=(n=t.data)==null?void 0:n.result)==null?void 0:c.map(p=>{var f;return{id:p==null?void 0:p.id,...(f=p==null?void 0:p.value)==null?void 0:f.pageData}});ae.value=r,I.setCacheStructures({key:"contentConfig",data:r})}},be=async e=>{var t;$.value=!0,h.value={...e,rootNode:ie.findRootNodeByPath(oe.value,e.path)},I.setCacheStructures(null),(e==null?void 0:e.level)===0?q.value.splice(0):(q.value=[{label:"新建"}],U.value=(t=e==null?void 0:e.path)==null?void 0:t.split("/")),await I.setConfigMenu(null),await ne(e==null?void 0:e.path),await K(e)},he=e=>{switch(e){case"新建":return"create";case"修改":return"update";case"删除":return"delete"}},Ce=async(e,t)=>{var l,u;if(!h.value)return y.ElMessage.warning("请先选择菜单");if(g.type=he(e),U.value=[],E.setSubmitCurStructure(!1),m.setSelectTitle([]),C.value=T.cloneDeep(t),g.type!=="delete"){switch(g.type){case"create":O(null),await I.setConfigMenu(null);break;case"update":O(C.value),await I.setConfigMenu(C.value),console.log("clickRowButton",C.value);break}await d.nextTick(),g.title=`【${g.type==="create"?(l=h.value)==null?void 0:l.path:(u=C.value)==null?void 0:u.path}】菜单配置${e}`,g.show=!0}else await re(C.value,g.type)},ue=d.ref(!0),Ie=async e=>{var t;k.value=e,await I.setConfigMenu({...k.value,path:(t=h.value)==null?void 0:t.path}),ue.value=(e==null?void 0:e.operateType)!=="新增"};d.watch(()=>ue.value,async e=>{var t;await d.nextTick(),J.value=(t=R.value)==null?void 0:t.map(l=>l.prop==="dialogConfig"||l.prop==="contentConfig"||l.prop==="trigger"?l.prop==="contentConfig"?{...l,isFormColHidden:e}:l:{...l,value:k.value?k.value[l==null?void 0:l.prop]:""})},{immediate:!0,deep:!0});const ke=d.ref(null),Te=async(e,t)=>{var r,p,f,s,b;if(g.type==="create"){const a=(p=(r=F.value)==null?void 0:r.filter(i=>(i==null?void 0:i.key)===t))==null?void 0:p.flatMap(i=>i==null?void 0:i.data);E.setItemData(a),I.setCacheStructures({key:t,data:a})}if(console.log("getTriggerStructures1",e==null?void 0:e.structureIds,t),!(e!=null&&e.structureIds)||((f=e==null?void 0:e.structureIds)==null?void 0:f.length)===0)return;const l=(b=(s=e==null?void 0:e.structureIds)==null?void 0:s.filter(a=>(a==null?void 0:a.key)===t))==null?void 0:b.map(a=>a==null?void 0:a.id);let u=l==null?void 0:l.map(a=>{if(a)return y.getInsofDataApi({id:a})});const n=await Promise.all(u),c=n==null?void 0:n.every(a=>{var i;return((i=a==null?void 0:a.data)==null?void 0:i.code)===200});if(console.log("getTriggerStructures2",e==null?void 0:e.structureIds,t,n),c&&(n==null?void 0:n.length)>0){const a=n==null?void 0:n.map(i=>{var M,D,N,P,A,o,B;return{id:(N=(D=(M=i==null?void 0:i.data)==null?void 0:M.result)==null?void 0:D[0])==null?void 0:N.id,...(B=(o=(A=(P=i==null?void 0:i.data)==null?void 0:P.result)==null?void 0:A[0])==null?void 0:o.value)==null?void 0:B.pageData}});E.setItemData(a),I.setCacheStructures({key:t,data:a})}},Me=async e=>{var n,c,r,p,f;const t=e==="操作触发的弹窗结构"?"dialogConfig":"contentConfig";I.setButtonTriggerType(t),await Te(C.value,t);let l;(n=k.value)!=null&&n.subMenus&&((c=k.value)==null?void 0:c.subMenus.length)>0&&(l=(r=U.value)==null?void 0:r.map(s=>({value:s})),l.unshift({value:(p=C.value)==null?void 0:p.title}));let u;g.type==="create"?u={...k.value,path:(f=h.value)==null?void 0:f.path}:g.type==="update"&&(u=x.value),await I.setConfigMenu(u),m.setSelectTitle(l),E.setIsEdit("edit")},K=async e=>{var l,u,n,c,r,p;const t=await y.getInsofDataApi({key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+(e==null?void 0:e.path),tableId:""}});((l=t==null?void 0:t.data)==null?void 0:l.code)===200&&(u=t.data)!=null&&u.result&&(j.value=((c=(n=t.data)==null?void 0:n.result)==null?void 0:c.length)>0?(p=(r=t.data)==null?void 0:r.result)==null?void 0:p.map(f=>{var s;return{id:f==null?void 0:f.id,...(s=f==null?void 0:f.value)==null?void 0:s.tableData}}):[]),$.value=!1},H=async(e,t,l="contentConfig")=>{var u,n,c,r,p,f;try{let s,b;t==="create"?(s={key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+((u=h.value)==null?void 0:u.path),type:"structure",rootNodePath:(c=(n=h.value)==null?void 0:n.rootNode)==null?void 0:c.path,structureBelong:l,parentTable:"",version:1},value:{pageData:e}},b=y.createInsofDataApi):t==="update"?(s={id:e==null?void 0:e.id,value:{pageData:e}},b=y.updateInsofDataApi):t==="delete"&&(s={id:e},b=y.deleteInsofDataApi);const a=await b(s);if(((r=a==null?void 0:a.data)==null?void 0:r.code)!==200)throw y.ElMessage.error("保存响应失败"),new Error("保存响应失败");const i=t==="create"?(p=a==null?void 0:a.data)==null?void 0:p.result:e==null?void 0:e.id;return{status:((f=a==null?void 0:a.data)==null?void 0:f.code)===200,data:{id:i,key:l}}}catch{y.ElMessage.error("保存响应失败")}},Y=(e,t)=>{var f,s,b;const l=(f=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:f.map(a=>a==null?void 0:a.id),u=t.filter(a=>!(l!=null&&l.includes(a))),n=l==null?void 0:l.filter(a=>!t.includes(a));let c=null,r=null,p=null;return c=[...u,...n].filter(a=>a),r=(s=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:s.filter(a=>!(a!=null&&a.id)),p=(b=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:b.filter(a=>a==null?void 0:a.id).filter(a=>Object.keys(a).length>1),{deleteIds:c,createComps:r,updateComps:p}},Z=(e,t)=>{var u,n,c,r,p,f;let l=[];return((u=t==null?void 0:t.deleteIds)==null?void 0:u.length)>0&&((n=t==null?void 0:t.deleteIds)==null||n.forEach(s=>{l.push(H(s,"delete",e))})),((c=t==null?void 0:t.createComps)==null?void 0:c.length)>0&&((r=t==null?void 0:t.createComps)==null||r.forEach(s=>{l.push(H(s,"create",e))})),((p=t==null?void 0:t.updateComps)==null?void 0:p.length)>0&&((f=t==null?void 0:t.updateComps)==null||f.forEach(s=>{s!=null&&s.id&&l.push(H(s,"update",e))})),l},De=e=>{const t=new Map;return e.forEach(l=>{t.set(l.id,l)}),Array.from(t.values())},Se=async(e,t)=>{var l,u,n,c,r,p,f;try{const s=e==null?void 0:e.filter(o=>(o==null?void 0:o.key)==="contentConfig"),b=e==null?void 0:e.filter(o=>(o==null?void 0:o.key)==="dialogConfig");await d.nextTick();const a=(n=(u=(l=F.value)==null?void 0:l.filter(o=>(o==null?void 0:o.key)==="dialogConfig"))==null?void 0:u.flatMap(o=>o==null?void 0:o.data))==null?void 0:n.map(o=>o==null?void 0:o.id);let i=(p=(r=(c=F.value)==null?void 0:c.filter(o=>(o==null?void 0:o.key)==="contentConfig"))==null?void 0:r.flatMap(o=>o==null?void 0:o.data))==null?void 0:p.map(o=>o==null?void 0:o.id);i=[...i,...(f=ae.value)==null?void 0:f.map(o=>o==null?void 0:o.id)];const M=Y(b,a),D=Y(s,i),N=Z("dialogConfig",M),P=Z("contentConfig",D),A=[...N,...P];await Promise.all(A).then(o=>{var z,G,L,V,Q,W,X;if(!(o==null?void 0:o.every(v=>v.status)))return;let w=(z=o==null?void 0:o.flatMap(v=>v==null?void 0:v.data))==null?void 0:z.filter(v=>(v==null?void 0:v.id)!==null&&(v==null?void 0:v.id)!==void 0);if(((G=M==null?void 0:M.updateComps)==null?void 0:G.length)===0&&g.type==="update"){const v=(V=(L=C.value)==null?void 0:L.structureIds)==null?void 0:V.filter(S=>(S==null?void 0:S.key)==="dialogConfig");w=[...w,...v]}if(((Q=D==null?void 0:D.updateComps)==null?void 0:Q.length)===0&&g.type==="update"){const v=(X=(W=C.value)==null?void 0:W.structureIds)==null?void 0:X.filter(S=>(S==null?void 0:S.key)==="contentConfig");w=[...w,...v]}const ce=De(w);re({...t,isNotInitial:!0,structureIds:ce},g.type)}).catch(o=>{y.ElMessage.error(o)})}catch(s){throw y.ElMessage.error(s),new Error(s)}},re=async(e,t)=>{var n,c;let l,u;t==="create"?(l={key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+((n=h.value)==null?void 0:n.path),tableId:"",rootNodePath:e==null?void 0:e.rootNodePath},value:{tableData:e}},u=y.createInsofDataApi):t==="update"?(l={id:e==null?void 0:e.id,value:{tableData:e}},u=y.updateInsofDataApi):t==="delete"&&(l={ids:[e.id,...(c=e==null?void 0:e.structureIds)==null?void 0:c.map(r=>r.id)]},u=y.batchDeleteInsofDataApi),fe.handleSubmitAsync(u,l,t).then(r=>{t==="create"&&j.value.push({...e,id:r}),t&&r&&y.ElMessage.success("响应成功"),K(h.value)})},we=async()=>{var l,u,n,c,r;const e=JSON.parse(T.cloneDeep(JSON.stringify(F.value)));await d.nextTick();const t=g.type==="create"?{...x.value,rootNodePath:(u=(l=h.value)==null?void 0:l.rootNode)==null?void 0:u.path}:{...x.value,rootNodePath:(c=(n=h.value)==null?void 0:n.rootNode)==null?void 0:c.path,id:(r=C.value)==null?void 0:r.id};await Se(e,t),k.value={},g.show=!1,await K(h.value)},Ne=()=>{g.show=!1},se={comp:"Group",name:"/平台管理/菜单管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:te.value,name:""}]}]},Pe=Object.freeze(Object.defineProperty({__proto__:null,beforeDialogDestroy:Ne,buttonValue:ve,changeTrigger:Ie,changedRow:ge,clickNodeTrigger:be,clickRowButton:Ce,clickSubmitForm:we,clickTrigger:Me,dialogInfo:g,formatFormData:O,getInitialSubStructure:ne,getTableDataAsync:K,handleItemDataChange:ye,inputForm:k,menuPageData:de,operatingForm:ke,pageData:te,renderFormData:J,tableLoading:$,tempMenuPageData:se,treeData:oe},Symbol.toStringTag,{value:"Module"}));exports.State=Pe;exports.tempMenuPageData=se;
1
+ "use strict";const d=require("vue"),T=require("./menu-vml_xHJD.cjs"),pe=require("./index-ChoJA9-j.cjs"),fe=require("./index-B1XyxOHh.cjs"),y=require("./index-2p69g4HY.cjs"),ie=require("./login-CCz_BcJe.cjs"),E=T.useModelComp(T.pinia),m=pe.useUnit(T.pinia),I=T.useMenuState(T.pinia),{menus:ee,configMenu:x,activeMenuPath:_,cacheStructures:F}=T.storeToRefs(I),$=d.ref(!1),te=d.computed(()=>{var e,t;return[{key:"extraButton",contents:[]},{key:"rowButton",contents:[{label:"修改"}]},{key:"header",contents:[{label:"菜单名称",prop:"title",isFormColHidden:!1},{label:"菜单类型",prop:"menuType",formType:"select",options:[{label:"系统菜单",value:"集团"},{label:"公司",value:"公司"}],isTableColHidden:!1,isFormColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:(t=(e=T.cloneDeep(ee.value))==null?void 0:e.map(l=>({...l,menuType:"系统菜单"})))==null?void 0:t.filter(l=>l.title!=="系统管理"&&l.title!=="平台管理")}]}),j=d.ref([]),q=d.ref([{label:"新建"}]),de=d.computed(()=>[{key:"extraButton",contents:q.value},{key:"rowButton",contents:[{label:"修改"},{label:"删除"}]},{key:"header",contents:[{label:"操作类型",prop:"operateType",formType:"select",options:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标",prop:"operateIcon",formType:"inputPopover",value:""},{label:"操作触发事件",prop:"trigger",formType:"select",options:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"配置一:",prop:"dialogConfig",formType:"button",value:"弹窗内容",isTableColHidden:!0},{label:"配置二:",prop:"contentConfig",formType:"button",value:"模块内容",isTableColHidden:!0},{label:"继承配置:",prop:"allowInherit",formType:"radio",contents:[{label:"是",value:!0},{label:"否",value:!1}],value:!1,isTableColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:j.value}]),J=d.ref([]),k=d.ref({}),ge=d.ref({}),R=d.ref([{label:"菜单",prop:"path",isFormColHidden:!0,value:""},{label:"操作类型:",prop:"operateType",type:"select",contents:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标:",prop:"operateIcon",type:"inputPopover",value:""},{label:"操作触发事件:",prop:"trigger",type:"select",contents:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"生成的菜单图标:",prop:"menuIcon",type:"inputPopover",value:""},{label:"配置一:",prop:"dialogConfig",type:"button",value:"操作触发的弹窗结构"},{label:"配置二:",prop:"contentConfig",type:"button",value:"操作生成的模块结构",isFormColHidden:!1},{label:"",prop:"structureIds",type:"input",value:[],isFormColHidden:!0},{label:"继承配置:",prop:"allowInherit",type:"radio",contents:[{label:"是",value:!0},{label:"否",value:!1}],value:!0}]),O=e=>{var t;J.value=e?(t=R.value)==null?void 0:t.map(l=>l.prop==="dialogConfig"||l.prop==="contentConfig"||l.prop==="trigger"?l:{...l,value:e?e[l==null?void 0:l.prop]:""}):R.value},ve=d.ref([{label:"查询"},{label:"重置"}]),ye=async()=>{},le=e=>e.map(t=>t.childMenus&&t.childMenus.length>0?{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title,children:le(t.childMenus)}:{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title}),g=d.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),U=d.ref([]),C=d.ref({}),h=d.ref(null),ae=d.ref([]),oe=d.computed(()=>{var e;return(e=le(ee.value))==null?void 0:e.filter(t=>t.title!=="系统管理"&&t.title!=="平台管理")}),ne=async e=>{var l,u,n,c;const t=await y.getInsofDataApi({key:{type:"subStructure",systemKey:sessionStorage.getItem("systemKey"),pageKey:e,version:1}});if(((l=t==null?void 0:t.data)==null?void 0:l.code)===200&&(u=t.data)!=null&&u.result){const r=(c=(n=t.data)==null?void 0:n.result)==null?void 0:c.map(p=>{var f;return{id:p==null?void 0:p.id,...(f=p==null?void 0:p.value)==null?void 0:f.pageData}});ae.value=r,I.setCacheStructures({key:"contentConfig",data:r})}},be=async e=>{var t;$.value=!0,h.value={...e,rootNode:ie.findRootNodeByPath(oe.value,e.path)},I.setCacheStructures(null),(e==null?void 0:e.level)===0?q.value.splice(0):(q.value=[{label:"新建"}],U.value=(t=e==null?void 0:e.path)==null?void 0:t.split("/")),await I.setConfigMenu(null),await ne(e==null?void 0:e.path),await K(e)},he=e=>{switch(e){case"新建":return"create";case"修改":return"update";case"删除":return"delete"}},Ce=async(e,t)=>{var l,u;if(!h.value)return y.ElMessage.warning("请先选择菜单");if(g.type=he(e),U.value=[],E.setSubmitCurStructure(!1),m.setSelectTitle([]),C.value=T.cloneDeep(t),g.type!=="delete"){switch(g.type){case"create":O(null),await I.setConfigMenu(null);break;case"update":O(C.value),await I.setConfigMenu(C.value),console.log("clickRowButton",C.value);break}await d.nextTick(),g.title=`【${g.type==="create"?(l=h.value)==null?void 0:l.path:(u=C.value)==null?void 0:u.path}】菜单配置${e}`,g.show=!0}else await re(C.value,g.type)},ue=d.ref(!0),Ie=async e=>{var t;k.value=e,await I.setConfigMenu({...k.value,path:(t=h.value)==null?void 0:t.path}),ue.value=(e==null?void 0:e.operateType)!=="新增"};d.watch(()=>ue.value,async e=>{var t;await d.nextTick(),J.value=(t=R.value)==null?void 0:t.map(l=>l.prop==="dialogConfig"||l.prop==="contentConfig"||l.prop==="trigger"?l.prop==="contentConfig"?{...l,isFormColHidden:e}:l:{...l,value:k.value?k.value[l==null?void 0:l.prop]:""})},{immediate:!0,deep:!0});const ke=d.ref(null),Te=async(e,t)=>{var r,p,f,s,b;if(g.type==="create"){const a=(p=(r=F.value)==null?void 0:r.filter(i=>(i==null?void 0:i.key)===t))==null?void 0:p.flatMap(i=>i==null?void 0:i.data);E.setItemData(a),I.setCacheStructures({key:t,data:a})}if(console.log("getTriggerStructures1",e==null?void 0:e.structureIds,t),!(e!=null&&e.structureIds)||((f=e==null?void 0:e.structureIds)==null?void 0:f.length)===0)return;const l=(b=(s=e==null?void 0:e.structureIds)==null?void 0:s.filter(a=>(a==null?void 0:a.key)===t))==null?void 0:b.map(a=>a==null?void 0:a.id);let u=l==null?void 0:l.map(a=>{if(a)return y.getInsofDataApi({id:a})});const n=await Promise.all(u),c=n==null?void 0:n.every(a=>{var i;return((i=a==null?void 0:a.data)==null?void 0:i.code)===200});if(console.log("getTriggerStructures2",e==null?void 0:e.structureIds,t,n),c&&(n==null?void 0:n.length)>0){const a=n==null?void 0:n.map(i=>{var M,D,N,P,A,o,B;return{id:(N=(D=(M=i==null?void 0:i.data)==null?void 0:M.result)==null?void 0:D[0])==null?void 0:N.id,...(B=(o=(A=(P=i==null?void 0:i.data)==null?void 0:P.result)==null?void 0:A[0])==null?void 0:o.value)==null?void 0:B.pageData}});E.setItemData(a),I.setCacheStructures({key:t,data:a})}},Me=async e=>{var n,c,r,p,f;const t=e==="操作触发的弹窗结构"?"dialogConfig":"contentConfig";I.setButtonTriggerType(t),await Te(C.value,t);let l;(n=k.value)!=null&&n.subMenus&&((c=k.value)==null?void 0:c.subMenus.length)>0&&(l=(r=U.value)==null?void 0:r.map(s=>({value:s})),l.unshift({value:(p=C.value)==null?void 0:p.title}));let u;g.type==="create"?u={...k.value,path:(f=h.value)==null?void 0:f.path}:g.type==="update"&&(u=x.value),await I.setConfigMenu(u),m.setSelectTitle(l),E.setIsEdit("edit")},K=async e=>{var l,u,n,c,r,p;const t=await y.getInsofDataApi({key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+(e==null?void 0:e.path),tableId:""}});((l=t==null?void 0:t.data)==null?void 0:l.code)===200&&(u=t.data)!=null&&u.result&&(j.value=((c=(n=t.data)==null?void 0:n.result)==null?void 0:c.length)>0?(p=(r=t.data)==null?void 0:r.result)==null?void 0:p.map(f=>{var s;return{id:f==null?void 0:f.id,...(s=f==null?void 0:f.value)==null?void 0:s.tableData}}):[]),$.value=!1},H=async(e,t,l="contentConfig")=>{var u,n,c,r,p,f;try{let s,b;t==="create"?(s={key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+((u=h.value)==null?void 0:u.path),type:"structure",rootNodePath:(c=(n=h.value)==null?void 0:n.rootNode)==null?void 0:c.path,structureBelong:l,parentTable:"",version:1},value:{pageData:e}},b=y.createInsofDataApi):t==="update"?(s={id:e==null?void 0:e.id,value:{pageData:e}},b=y.updateInsofDataApi):t==="delete"&&(s={id:e},b=y.deleteInsofDataApi);const a=await b(s);if(((r=a==null?void 0:a.data)==null?void 0:r.code)!==200)throw y.ElMessage.error("保存响应失败"),new Error("保存响应失败");const i=t==="create"?(p=a==null?void 0:a.data)==null?void 0:p.result:e==null?void 0:e.id;return{status:((f=a==null?void 0:a.data)==null?void 0:f.code)===200,data:{id:i,key:l}}}catch{y.ElMessage.error("保存响应失败")}},Y=(e,t)=>{var f,s,b;const l=(f=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:f.map(a=>a==null?void 0:a.id),u=t.filter(a=>!(l!=null&&l.includes(a))),n=l==null?void 0:l.filter(a=>!t.includes(a));let c=null,r=null,p=null;return c=[...u,...n].filter(a=>a),r=(s=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:s.filter(a=>!(a!=null&&a.id)),p=(b=e==null?void 0:e.flatMap(a=>a==null?void 0:a.data))==null?void 0:b.filter(a=>a==null?void 0:a.id).filter(a=>Object.keys(a).length>1),{deleteIds:c,createComps:r,updateComps:p}},Z=(e,t)=>{var u,n,c,r,p,f;let l=[];return((u=t==null?void 0:t.deleteIds)==null?void 0:u.length)>0&&((n=t==null?void 0:t.deleteIds)==null||n.forEach(s=>{l.push(H(s,"delete",e))})),((c=t==null?void 0:t.createComps)==null?void 0:c.length)>0&&((r=t==null?void 0:t.createComps)==null||r.forEach(s=>{l.push(H(s,"create",e))})),((p=t==null?void 0:t.updateComps)==null?void 0:p.length)>0&&((f=t==null?void 0:t.updateComps)==null||f.forEach(s=>{s!=null&&s.id&&l.push(H(s,"update",e))})),l},De=e=>{const t=new Map;return e.forEach(l=>{t.set(l.id,l)}),Array.from(t.values())},Se=async(e,t)=>{var l,u,n,c,r,p,f;try{const s=e==null?void 0:e.filter(o=>(o==null?void 0:o.key)==="contentConfig"),b=e==null?void 0:e.filter(o=>(o==null?void 0:o.key)==="dialogConfig");await d.nextTick();const a=(n=(u=(l=F.value)==null?void 0:l.filter(o=>(o==null?void 0:o.key)==="dialogConfig"))==null?void 0:u.flatMap(o=>o==null?void 0:o.data))==null?void 0:n.map(o=>o==null?void 0:o.id);let i=(p=(r=(c=F.value)==null?void 0:c.filter(o=>(o==null?void 0:o.key)==="contentConfig"))==null?void 0:r.flatMap(o=>o==null?void 0:o.data))==null?void 0:p.map(o=>o==null?void 0:o.id);i=[...i,...(f=ae.value)==null?void 0:f.map(o=>o==null?void 0:o.id)];const M=Y(b,a),D=Y(s,i),N=Z("dialogConfig",M),P=Z("contentConfig",D),A=[...N,...P];await Promise.all(A).then(o=>{var z,G,L,V,Q,W,X;if(!(o==null?void 0:o.every(v=>v.status)))return;let w=(z=o==null?void 0:o.flatMap(v=>v==null?void 0:v.data))==null?void 0:z.filter(v=>(v==null?void 0:v.id)!==null&&(v==null?void 0:v.id)!==void 0);if(((G=M==null?void 0:M.updateComps)==null?void 0:G.length)===0&&g.type==="update"){const v=(V=(L=C.value)==null?void 0:L.structureIds)==null?void 0:V.filter(S=>(S==null?void 0:S.key)==="dialogConfig");w=[...w,...v]}if(((Q=D==null?void 0:D.updateComps)==null?void 0:Q.length)===0&&g.type==="update"){const v=(X=(W=C.value)==null?void 0:W.structureIds)==null?void 0:X.filter(S=>(S==null?void 0:S.key)==="contentConfig");w=[...w,...v]}const ce=De(w);re({...t,isNotInitial:!0,structureIds:ce},g.type)}).catch(o=>{y.ElMessage.error(o)})}catch(s){throw y.ElMessage.error(s),new Error(s)}},re=async(e,t)=>{var n,c;let l,u;t==="create"?(l={key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:_.value+"/"+((n=h.value)==null?void 0:n.path),tableId:"",rootNodePath:e==null?void 0:e.rootNodePath},value:{tableData:e}},u=y.createInsofDataApi):t==="update"?(l={id:e==null?void 0:e.id,value:{tableData:e}},u=y.updateInsofDataApi):t==="delete"&&(l={ids:[e.id,...(c=e==null?void 0:e.structureIds)==null?void 0:c.map(r=>r.id)]},u=y.batchDeleteInsofDataApi),fe.handleSubmitAsync(u,l,t).then(r=>{t==="create"&&j.value.push({...e,id:r}),t&&r&&y.ElMessage.success("响应成功"),K(h.value)})},we=async()=>{var l,u,n,c,r;const e=JSON.parse(T.cloneDeep(JSON.stringify(F.value)));await d.nextTick();const t=g.type==="create"?{...x.value,rootNodePath:(u=(l=h.value)==null?void 0:l.rootNode)==null?void 0:u.path}:{...x.value,rootNodePath:(c=(n=h.value)==null?void 0:n.rootNode)==null?void 0:c.path,id:(r=C.value)==null?void 0:r.id};await Se(e,t),k.value={},g.show=!1,await K(h.value)},Ne=()=>{g.show=!1},se={comp:"Group",name:"/平台管理/菜单管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:te.value,name:""}]}]},Pe=Object.freeze(Object.defineProperty({__proto__:null,beforeDialogDestroy:Ne,buttonValue:ve,changeTrigger:Ie,changedRow:ge,clickNodeTrigger:be,clickRowButton:Ce,clickSubmitForm:we,clickTrigger:Me,dialogInfo:g,formatFormData:O,getInitialSubStructure:ne,getTableDataAsync:K,handleItemDataChange:ye,inputForm:k,menuPageData:de,operatingForm:ke,pageData:te,renderFormData:J,tableLoading:$,tempMenuPageData:se,treeData:oe},Symbol.toStringTag,{value:"Module"}));exports.State=Pe;exports.tempMenuPageData=se;