ss-component-new 1.1.658 → 1.1.660
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/{OrbitControls-wZBl7uX5.js → OrbitControls-B-1QXHn2.js} +1 -1
- package/dist/{OrbitControls-CUvjF1rf.cjs → OrbitControls-qgBH8pMS.cjs} +1 -1
- package/dist/{index-fhZ-JJZ8.cjs → index-41jEHzCk.cjs} +1 -1
- package/dist/{index-DnaushyD.cjs → index-B03Fml-h.cjs} +1 -1
- package/dist/{index-Fxs_qOj8.js → index-B08lBLQu.js} +1 -1
- package/dist/{index-CM6HSS02.cjs → index-B0WKlIz1.cjs} +1 -1
- package/dist/{index-C8oNErGw.js → index-B42y1MQK.js} +1 -1
- package/dist/{index-dCHm4bqT.cjs → index-B6u_mSOv.cjs} +1 -1
- package/dist/{index-DnGwDL1g.cjs → index-BCPgv4S-.cjs} +1 -1
- package/dist/{index-DHoqIUK7.js → index-BCr8OPD3.js} +17 -17
- package/dist/{index-Brhs8-ho.js → index-BVaQ6moE.js} +1194 -1194
- package/dist/{index-DR62D4oC.js → index-BZa5JoGt.js} +1 -1
- package/dist/{index-fSieD0VD.cjs → index-BbqFbb3k.cjs} +1 -1
- package/dist/{index-CmUH8ftb.js → index-BlfbIyGw.js} +1 -1
- package/dist/{index-C9V70RX-.js → index-BpeQUsLt.js} +4 -4
- package/dist/{index-G2hFPRl4.cjs → index-CG-YU5sQ.cjs} +1 -1
- package/dist/{index-CodlQQtD.js → index-CI0E5zw7.js} +1 -1
- package/dist/{index-CNoN_Z0U.js → index-CLhQCqyN.js} +3 -3
- package/dist/{index-pjqo-wKx.js → index-CdoY7GNx.js} +2 -2
- package/dist/{index-UE_pnzQo.cjs → index-CwtRK0Ww.cjs} +1 -1
- package/dist/index-D5nrm0ks.cjs +1 -0
- package/dist/{index-CdEW-44q.js → index-DJ2MIhlV.js} +4 -4
- package/dist/{index-DK4Pnepl.js → index-DJm5Xr18.js} +1 -1
- package/dist/{index-CyqhFAF6.cjs → index-DLu5ro9z.cjs} +1 -1
- package/dist/{index-C3911xbm.cjs → index-DTYVhIle.cjs} +1 -1
- package/dist/{index-CC9NeaeO.js → index-DUrDZG7w.js} +53 -53
- package/dist/{index-zs2vsQkw.js → index-Df4gAqR9.js} +1 -1
- package/dist/{index-CYc_nQjl.cjs → index-DtBMQWzL.cjs} +1 -1
- package/dist/{index-BdbMzzG9.cjs → index-IlPiIa0I.cjs} +1 -1
- package/dist/{index-CSj1FCx2.cjs → index-Vraze3Ua.cjs} +1 -1
- package/dist/{index-DB2u7BI2.cjs → index-se4WwfNt.cjs} +1 -1
- package/dist/{index-ItBFv241.js → index-t2TFOT_O.js} +2 -2
- package/dist/{index-BAPVtYNC.js → index-ujuD9_sZ.js} +1 -1
- package/dist/{index-JWowiMDG.cjs → index-vm5KnaB6.cjs} +167 -167
- package/dist/{index.vue_vue_type_style_index_0_scoped_264dc673_lang-CunArNny.cjs → index.vue_vue_type_style_index_0_scoped_2be0f146_lang-C2ebptTy.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_264dc673_lang-0YnLPSwu.js → index.vue_vue_type_style_index_0_scoped_2be0f146_lang-kLovEkfV.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_f6ebd097_lang-CNLvOlhH.cjs → index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-BOGUGZAP.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_f6ebd097_lang-BJ7HZIYs.js → index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-BgeNozpq.js} +3 -3
- package/dist/{main-CxXnyLym.js → main-DbOOHEho.js} +2 -2
- package/dist/{main-D_wAEXdn.cjs → main-DswURi6l.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-CcsboCSp.js → threeModel-D5XsaDkk.js} +2 -2
- package/dist/{threeModel-DBWCHeou.cjs → threeModel-sfjtIMOY.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-DhwVgmX4.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const g=require("vue"),d=require("./menu-ScIJ5kqr.cjs"),ce=require("./modelComp-CkSDfH0-.cjs"),pe=require("./index-JWowiMDG.cjs"),fe=require("./index-BE8DQhoN.cjs"),ie=require("./login-9FT8kgSz.cjs"),A=ce.useModelComp(d.pinia),Z=pe.useUnit(d.pinia),I=d.useMenuState(d.pinia),{menus:m,configMenu:H,activeMenuPath:O,cacheStructures:E}=d.storeToRefs(I),_=g.ref(!1),ee=g.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=d.cloneDeep(m.value))==null?void 0:e.map(l=>({...l,menuType:"系统菜单"})))==null?void 0:t.filter(l=>l.title!=="系统管理"&&l.title!=="平台管理")}]}),$=g.ref([]),x=g.ref([{label:"新建"}]),de=g.computed(()=>[{key:"extraButton",contents:x.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:$.value}]),j=g.ref([]),k=g.ref({}),ge=g.ref({}),q=g.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}]),R=e=>{var t;j.value=e?(t=q.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]:""}):q.value},ve=g.ref([{label:"查询"},{label:"重置"}]),ye=async()=>{},te=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:te(t.childMenus)}:{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title}),v=g.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),J=g.ref([]),C=g.ref({}),h=g.ref(null),le=g.ref([]),ae=g.computed(()=>{var e;return(e=te(m.value))==null?void 0:e.filter(t=>t.title!=="系统管理"&&t.title!=="平台管理")}),oe=async e=>{var l,u,n,c;const t=await d.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}});le.value=r,I.setCacheStructures({key:"contentConfig",data:r})}},be=async e=>{var t;_.value=!0,h.value={...e,rootNode:ie.findRootNodeByPath(ae.value,e.path)},I.setCacheStructures(null),(e==null?void 0:e.level)===0?x.value.splice(0):(x.value=[{label:"新建"}],J.value=(t=e==null?void 0:e.path)==null?void 0:t.split("/")),await I.setConfigMenu(null),await oe(e==null?void 0:e.path),await F(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 d.ElMessage.warning("请先选择菜单");if(v.type=he(e),J.value=[],A.setSubmitCurStructure(!1),Z.setSelectTitle([]),C.value=d.cloneDeep(t),v.type!=="delete"){switch(v.type){case"create":R(null),await I.setConfigMenu(null);break;case"update":R(C.value),await I.setConfigMenu(C.value),console.log("clickRowButton",C.value);break}await g.nextTick(),v.title=`【${v.type==="create"?(l=h.value)==null?void 0:l.path:(u=C.value)==null?void 0:u.path}】菜单配置${e}`,v.show=!0}else await ue(C.value,v.type)},ne=g.ref(!0),Ie=async e=>{var t;k.value=e,await I.setConfigMenu({...k.value,path:(t=h.value)==null?void 0:t.path}),ne.value=(e==null?void 0:e.operateType)!=="新增"};g.watch(()=>ne.value,async e=>{var t;await g.nextTick(),j.value=(t=q.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=g.ref(null),Te=async(e,t)=>{var r,p,f,s,b;if(v.type==="create"){const a=(p=(r=E.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);A.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 d.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 T,M,w,N,P,o,K;return{id:(w=(M=(T=i==null?void 0:i.data)==null?void 0:T.result)==null?void 0:M[0])==null?void 0:w.id,...(K=(o=(P=(N=i==null?void 0:i.data)==null?void 0:N.result)==null?void 0:P[0])==null?void 0:o.value)==null?void 0:K.pageData}});A.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=J.value)==null?void 0:r.map(s=>({value:s})),l.unshift({value:(p=C.value)==null?void 0:p.title}));let u;v.type==="create"?u={...k.value,path:(f=h.value)==null?void 0:f.path}:v.type==="update"&&(u=H.value),await I.setConfigMenu(u),Z.setSelectTitle(l),A.setIsEdit("edit")},F=async e=>{var l,u,n,c,r,p;const t=await d.getInsofDataApi({key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:O.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&&($.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},B=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:O.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=d.createInsofDataApi):t==="update"?(s={id:e==null?void 0:e.id,value:{pageData:e}},b=d.updateInsofDataApi):t==="delete"&&(s={id:e},b=d.deleteInsofDataApi);const a=await b(s);if(((r=a==null?void 0:a.data)==null?void 0:r.code)!==200)throw d.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{d.ElMessage.error("保存响应失败")}},X=(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}},Y=(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(B(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(B(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(B(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 g.nextTick();const a=(n=(u=(l=E.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=E.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=le.value)==null?void 0:f.map(o=>o==null?void 0:o.id)];const T=X(b,a),M=X(s,i),w=Y("dialogConfig",T),N=Y("contentConfig",M),P=[...w,...N];await Promise.all(P).then(o=>{var U,z,G,L,V,Q,W;if(!(o==null?void 0:o.every(y=>y.status)))return;let S=(U=o==null?void 0:o.flatMap(y=>y==null?void 0:y.data))==null?void 0:U.filter(y=>(y==null?void 0:y.id)!==null&&(y==null?void 0:y.id)!==void 0);if(((z=T==null?void 0:T.updateComps)==null?void 0:z.length)===0&&v.type==="update"){const y=(L=(G=C.value)==null?void 0:G.structureIds)==null?void 0:L.filter(D=>(D==null?void 0:D.key)==="dialogConfig");S=[...S,...y]}if(((V=M==null?void 0:M.updateComps)==null?void 0:V.length)===0&&v.type==="update"){const y=(W=(Q=C.value)==null?void 0:Q.structureIds)==null?void 0:W.filter(D=>(D==null?void 0:D.key)==="contentConfig");S=[...S,...y]}const se=De(S);ue({...t,isNotInitial:!0,structureIds:se},v.type)}).catch(o=>{d.ElMessage.error(o)})}catch(s){throw d.ElMessage.error(s),new Error(s)}},ue=async(e,t)=>{var n,c;let l,u;t==="create"?(l={key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:O.value+"/"+((n=h.value)==null?void 0:n.path),tableId:"",rootNodePath:e==null?void 0:e.rootNodePath},value:{tableData:e}},u=d.createInsofDataApi):t==="update"?(l={id:e==null?void 0:e.id,value:{tableData:e}},u=d.updateInsofDataApi):t==="delete"&&(l={ids:[e.id,...(c=e==null?void 0:e.structureIds)==null?void 0:c.map(r=>r.id)]},u=d.batchDeleteInsofDataApi),fe.handleSubmitAsync(u,l,t).then(r=>{t==="create"&&$.value.push({...e,id:r}),t&&r&&d.ElMessage.success("响应成功"),F(h.value)})},we=async()=>{var l,u,n,c,r;const e=JSON.parse(d.cloneDeep(JSON.stringify(E.value)));await g.nextTick();const t=v.type==="create"?{...H.value,rootNodePath:(u=(l=h.value)==null?void 0:l.rootNode)==null?void 0:u.path}:{...H.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={},v.show=!1,await F(h.value)},Ne=()=>{v.show=!1},re={comp:"Group",name:"/平台管理/菜单管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:ee.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:v,formatFormData:R,getInitialSubStructure:oe,getTableDataAsync:F,handleItemDataChange:ye,inputForm:k,menuPageData:de,operatingForm:ke,pageData:ee,renderFormData:j,tableLoading:_,tempMenuPageData:re,treeData:ae},Symbol.toStringTag,{value:"Module"}));exports.State=Pe;exports.tempMenuPageData=re;
|
|
1
|
+
"use strict";const g=require("vue"),d=require("./menu-ScIJ5kqr.cjs"),ce=require("./modelComp-CkSDfH0-.cjs"),pe=require("./index-vm5KnaB6.cjs"),fe=require("./index-BE8DQhoN.cjs"),ie=require("./login-9FT8kgSz.cjs"),A=ce.useModelComp(d.pinia),Z=pe.useUnit(d.pinia),I=d.useMenuState(d.pinia),{menus:m,configMenu:H,activeMenuPath:O,cacheStructures:E}=d.storeToRefs(I),_=g.ref(!1),ee=g.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=d.cloneDeep(m.value))==null?void 0:e.map(l=>({...l,menuType:"系统菜单"})))==null?void 0:t.filter(l=>l.title!=="系统管理"&&l.title!=="平台管理")}]}),$=g.ref([]),x=g.ref([{label:"新建"}]),de=g.computed(()=>[{key:"extraButton",contents:x.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:$.value}]),j=g.ref([]),k=g.ref({}),ge=g.ref({}),q=g.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}]),R=e=>{var t;j.value=e?(t=q.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]:""}):q.value},ve=g.ref([{label:"查询"},{label:"重置"}]),ye=async()=>{},te=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:te(t.childMenus)}:{...t,value:t==null?void 0:t.title,label:t==null?void 0:t.title}),v=g.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),J=g.ref([]),C=g.ref({}),h=g.ref(null),le=g.ref([]),ae=g.computed(()=>{var e;return(e=te(m.value))==null?void 0:e.filter(t=>t.title!=="系统管理"&&t.title!=="平台管理")}),oe=async e=>{var l,u,n,c;const t=await d.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}});le.value=r,I.setCacheStructures({key:"contentConfig",data:r})}},be=async e=>{var t;_.value=!0,h.value={...e,rootNode:ie.findRootNodeByPath(ae.value,e.path)},I.setCacheStructures(null),(e==null?void 0:e.level)===0?x.value.splice(0):(x.value=[{label:"新建"}],J.value=(t=e==null?void 0:e.path)==null?void 0:t.split("/")),await I.setConfigMenu(null),await oe(e==null?void 0:e.path),await F(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 d.ElMessage.warning("请先选择菜单");if(v.type=he(e),J.value=[],A.setSubmitCurStructure(!1),Z.setSelectTitle([]),C.value=d.cloneDeep(t),v.type!=="delete"){switch(v.type){case"create":R(null),await I.setConfigMenu(null);break;case"update":R(C.value),await I.setConfigMenu(C.value),console.log("clickRowButton",C.value);break}await g.nextTick(),v.title=`【${v.type==="create"?(l=h.value)==null?void 0:l.path:(u=C.value)==null?void 0:u.path}】菜单配置${e}`,v.show=!0}else await ue(C.value,v.type)},ne=g.ref(!0),Ie=async e=>{var t;k.value=e,await I.setConfigMenu({...k.value,path:(t=h.value)==null?void 0:t.path}),ne.value=(e==null?void 0:e.operateType)!=="新增"};g.watch(()=>ne.value,async e=>{var t;await g.nextTick(),j.value=(t=q.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=g.ref(null),Te=async(e,t)=>{var r,p,f,s,b;if(v.type==="create"){const a=(p=(r=E.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);A.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 d.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 T,M,w,N,P,o,K;return{id:(w=(M=(T=i==null?void 0:i.data)==null?void 0:T.result)==null?void 0:M[0])==null?void 0:w.id,...(K=(o=(P=(N=i==null?void 0:i.data)==null?void 0:N.result)==null?void 0:P[0])==null?void 0:o.value)==null?void 0:K.pageData}});A.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=J.value)==null?void 0:r.map(s=>({value:s})),l.unshift({value:(p=C.value)==null?void 0:p.title}));let u;v.type==="create"?u={...k.value,path:(f=h.value)==null?void 0:f.path}:v.type==="update"&&(u=H.value),await I.setConfigMenu(u),Z.setSelectTitle(l),A.setIsEdit("edit")},F=async e=>{var l,u,n,c,r,p;const t=await d.getInsofDataApi({key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:O.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&&($.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},B=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:O.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=d.createInsofDataApi):t==="update"?(s={id:e==null?void 0:e.id,value:{pageData:e}},b=d.updateInsofDataApi):t==="delete"&&(s={id:e},b=d.deleteInsofDataApi);const a=await b(s);if(((r=a==null?void 0:a.data)==null?void 0:r.code)!==200)throw d.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{d.ElMessage.error("保存响应失败")}},X=(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}},Y=(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(B(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(B(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(B(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 g.nextTick();const a=(n=(u=(l=E.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=E.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=le.value)==null?void 0:f.map(o=>o==null?void 0:o.id)];const T=X(b,a),M=X(s,i),w=Y("dialogConfig",T),N=Y("contentConfig",M),P=[...w,...N];await Promise.all(P).then(o=>{var U,z,G,L,V,Q,W;if(!(o==null?void 0:o.every(y=>y.status)))return;let S=(U=o==null?void 0:o.flatMap(y=>y==null?void 0:y.data))==null?void 0:U.filter(y=>(y==null?void 0:y.id)!==null&&(y==null?void 0:y.id)!==void 0);if(((z=T==null?void 0:T.updateComps)==null?void 0:z.length)===0&&v.type==="update"){const y=(L=(G=C.value)==null?void 0:G.structureIds)==null?void 0:L.filter(D=>(D==null?void 0:D.key)==="dialogConfig");S=[...S,...y]}if(((V=M==null?void 0:M.updateComps)==null?void 0:V.length)===0&&v.type==="update"){const y=(W=(Q=C.value)==null?void 0:Q.structureIds)==null?void 0:W.filter(D=>(D==null?void 0:D.key)==="contentConfig");S=[...S,...y]}const se=De(S);ue({...t,isNotInitial:!0,structureIds:se},v.type)}).catch(o=>{d.ElMessage.error(o)})}catch(s){throw d.ElMessage.error(s),new Error(s)}},ue=async(e,t)=>{var n,c;let l,u;t==="create"?(l={key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:O.value+"/"+((n=h.value)==null?void 0:n.path),tableId:"",rootNodePath:e==null?void 0:e.rootNodePath},value:{tableData:e}},u=d.createInsofDataApi):t==="update"?(l={id:e==null?void 0:e.id,value:{tableData:e}},u=d.updateInsofDataApi):t==="delete"&&(l={ids:[e.id,...(c=e==null?void 0:e.structureIds)==null?void 0:c.map(r=>r.id)]},u=d.batchDeleteInsofDataApi),fe.handleSubmitAsync(u,l,t).then(r=>{t==="create"&&$.value.push({...e,id:r}),t&&r&&d.ElMessage.success("响应成功"),F(h.value)})},we=async()=>{var l,u,n,c,r;const e=JSON.parse(d.cloneDeep(JSON.stringify(E.value)));await g.nextTick();const t=v.type==="create"?{...H.value,rootNodePath:(u=(l=h.value)==null?void 0:l.rootNode)==null?void 0:u.path}:{...H.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={},v.show=!1,await F(h.value)},Ne=()=>{v.show=!1},re={comp:"Group",name:"/平台管理/菜单管理",compData:[{key:"groupContents",contents:[{comp:"Table",compData:ee.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:v,formatFormData:R,getInitialSubStructure:oe,getTableDataAsync:F,handleItemDataChange:ye,inputForm:k,menuPageData:de,operatingForm:ke,pageData:ee,renderFormData:j,tableLoading:_,tempMenuPageData:re,treeData:ae},Symbol.toStringTag,{value:"Module"}));exports.State=Pe;exports.tempMenuPageData=re;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as M } from "./index.
|
|
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
|
|
1
|
+
import { _ as M } from "./index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-BgeNozpq.js";
|
|
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"], $ = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "menu-operate-icon"
|
|
7
|
-
}, L = { class: "menu-config-wrap" }, N = ["onClick"],
|
|
8
|
-
function
|
|
7
|
+
}, L = { class: "menu-config-wrap" }, N = ["onClick"], S = { class: "module-dialog-content" };
|
|
8
|
+
function E(t, d, F, O, R, T) {
|
|
9
9
|
const g = a("svg-icon"), k = a("el-popover"), v = a("ssMenu"), c = a("el-button"), y = a("ssDialog");
|
|
10
10
|
return l(), s(f, null, [
|
|
11
11
|
n(v, {
|
|
@@ -17,18 +17,18 @@ function S(t, d, E, F, O, R) {
|
|
|
17
17
|
onCloseMenu: t.closeMenu
|
|
18
18
|
}, {
|
|
19
19
|
title: i(({ menu: e }) => {
|
|
20
|
-
var p,
|
|
20
|
+
var p, _;
|
|
21
21
|
return [
|
|
22
22
|
n(g, {
|
|
23
|
-
name: e.icon ?? "default",
|
|
23
|
+
name: e.icon ?? (e == null ? void 0 : e.level) <= 1 ? "default" : "",
|
|
24
24
|
class: "menu-icon"
|
|
25
25
|
}, null, 8, ["name"]),
|
|
26
26
|
r("span", {
|
|
27
27
|
title: e.title,
|
|
28
28
|
class: "menu-title",
|
|
29
29
|
style: b({ marginRight: e != null && e.config && ((p = e == null ? void 0 : e.config) == null ? void 0 : p.length) > 0 ? "25px" : "1px" })
|
|
30
|
-
},
|
|
31
|
-
e != null && e.config && ((
|
|
30
|
+
}, C(e.title ?? ""), 13, V),
|
|
31
|
+
e != null && e.config && ((_ = e == null ? void 0 : e.config) == null ? void 0 : _.length) > 0 ? (l(), s("span", $, [
|
|
32
32
|
n(k, {
|
|
33
33
|
title: "",
|
|
34
34
|
placement: "bottom-start",
|
|
@@ -40,16 +40,16 @@ function S(t, d, E, F, O, R) {
|
|
|
40
40
|
]),
|
|
41
41
|
default: i(() => [
|
|
42
42
|
r("div", L, [
|
|
43
|
-
(l(!0), s(f, null,
|
|
43
|
+
(l(!0), s(f, null, h(e == null ? void 0 : e.config, (o) => (l(), s("div", {
|
|
44
44
|
class: "menu-config-item",
|
|
45
45
|
key: o.id,
|
|
46
|
-
onClick: (
|
|
46
|
+
onClick: (z) => t.clickMenuIcon(e, o)
|
|
47
47
|
}, [
|
|
48
48
|
n(g, {
|
|
49
49
|
name: o == null ? void 0 : o.operateIcon,
|
|
50
50
|
style: { width: "15px", height: "15px", "margin-right": "8px" }
|
|
51
51
|
}, null, 8, ["name"]),
|
|
52
|
-
r("span", null,
|
|
52
|
+
r("span", null, C(o == null ? void 0 : o.operateType), 1)
|
|
53
53
|
], 8, N))), 128))
|
|
54
54
|
])
|
|
55
55
|
]),
|
|
@@ -68,8 +68,8 @@ function S(t, d, E, F, O, R) {
|
|
|
68
68
|
onBeforeDestroy: t.beforeDialogDestroy
|
|
69
69
|
}, {
|
|
70
70
|
default: i(() => [
|
|
71
|
-
r("div",
|
|
72
|
-
(l(!0), s(f, null,
|
|
71
|
+
r("div", S, [
|
|
72
|
+
(l(!0), s(f, null, h(t.dialogRenderComps, (e) => (l(), s("div", {
|
|
73
73
|
key: e.id
|
|
74
74
|
}, [
|
|
75
75
|
(l(), B(w(t.getComponents((e == null ? void 0 : e.comp) ?? "Input")), {
|
|
@@ -89,7 +89,7 @@ function S(t, d, E, F, O, R) {
|
|
|
89
89
|
onClick: t.beforeDialogDestroy
|
|
90
90
|
}, {
|
|
91
91
|
default: i(() => d[0] || (d[0] = [
|
|
92
|
-
|
|
92
|
+
u("取消")
|
|
93
93
|
])),
|
|
94
94
|
_: 1,
|
|
95
95
|
__: [0]
|
|
@@ -99,7 +99,7 @@ function S(t, d, E, F, O, R) {
|
|
|
99
99
|
onClick: t.clickSubmitForm
|
|
100
100
|
}, {
|
|
101
101
|
default: i(() => d[1] || (d[1] = [
|
|
102
|
-
|
|
102
|
+
u(" 确认 ")
|
|
103
103
|
])),
|
|
104
104
|
_: 1,
|
|
105
105
|
__: [1]
|
|
@@ -110,7 +110,7 @@ function S(t, d, E, F, O, R) {
|
|
|
110
110
|
}, 8, ["title", "visible", "width", "onBeforeDestroy"])
|
|
111
111
|
], 64);
|
|
112
112
|
}
|
|
113
|
-
const
|
|
113
|
+
const G = /* @__PURE__ */ I(M, [["render", E], ["__scopeId", "data-v-d215f0b6"]]);
|
|
114
114
|
export {
|
|
115
|
-
|
|
115
|
+
G as default
|
|
116
116
|
};
|