ss-component-new 1.1.643 → 1.1.644

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 (90) hide show
  1. package/dist/{array-B_wsE8_t.cjs → array-Dbtz7Lsx.cjs} +1 -1
  2. package/dist/{array-B8lWuPWk.js → array-NXwPkThl.js} +1 -1
  3. package/dist/{crypto-v3jAna0Y.js → crypto-BRyGpjGR.js} +383 -510
  4. package/dist/{crypto-DNSUM6-T.cjs → crypto-CRbcEKIz.cjs} +11 -11
  5. package/dist/{index-Dv0m3N6o.js → index-B-e-RS40.js} +8676 -13690
  6. package/dist/{index-CstZeLoO.js → index-B5AuRSn8.js} +4 -4
  7. package/dist/{index-Wq7SUf3w.cjs → index-B5hSES3R.cjs} +1 -1
  8. package/dist/{index-Dc9ujwGk.js → index-BHB6W84v.js} +1 -1
  9. package/dist/{index-DkuHB0rR.js → index-BJJ0vtM2.js} +6 -6
  10. package/dist/{index-DnROsSAu.js → index-BP40TwDk.js} +1 -1
  11. package/dist/index-BWiGVums.js +791 -0
  12. package/dist/index-Bd5m6iJ8.cjs +1 -0
  13. package/dist/{index-BV7GMSHu.cjs → index-BdsY472L.cjs} +1 -1
  14. package/dist/{index-DamR6g_M.cjs → index-BeRx0t84.cjs} +1 -1
  15. package/dist/{index-S9mHFIiJ.js → index-BozQhsge.js} +6 -5
  16. package/dist/{index-C90tv0Xl.js → index-BrKQS8Y3.js} +10 -9
  17. package/dist/index-C2_wvhiv.cjs +1 -0
  18. package/dist/{index-TImrSuqA.js → index-C4WN0fXG.js} +7 -7
  19. package/dist/index-C77Yeu_E.js +4714 -0
  20. package/dist/index-C7Khgsnh.cjs +1 -0
  21. package/dist/index-CCAwiEiE.cjs +1 -0
  22. package/dist/{index-H7RfjeN4.cjs → index-CEMhVv6z.cjs} +1 -1
  23. package/dist/{index-Ce6cmWoK.js → index-CGBdaBEB.js} +1 -1
  24. package/dist/{index-DJq9wJbj.js → index-CJFIY9Tm.js} +6 -6
  25. package/dist/{index-j_-9sdsj.js → index-CUUHPSXL.js} +5 -5
  26. package/dist/{index-DZOOs3JX.js → index-Cb85-wnY.js} +5 -5
  27. package/dist/index-CnDYddiq.js +2511 -0
  28. package/dist/{index-B3Uwh6Xf.cjs → index-CyOe4WqM.cjs} +1 -1
  29. package/dist/{index-DaCmhrZN.js → index-D3K7gx2g.js} +5 -5
  30. package/dist/{index-CzRn17aQ.js → index-D3bky2oL.js} +3 -3
  31. package/dist/{index-yP9dxTXr.cjs → index-DFXFcYjP.cjs} +1 -1
  32. package/dist/{index-D9rKJ22p.js → index-DKMyrGwu.js} +25 -24
  33. package/dist/{index-Bjsc84L1.js → index-DUF5bljq.js} +220 -222
  34. package/dist/{index-CoO_L719.js → index-DUfwkFTo.js} +1 -1
  35. package/dist/{index-ugVCM2_1.cjs → index-DXpOifO9.cjs} +1 -1
  36. package/dist/{index-Cf8HSIB7.js → index-DY7ltLLQ.js} +9 -9
  37. package/dist/{index-BXkdOTkd.js → index-DYesVnNm.js} +6 -6
  38. package/dist/{index-BGU26U8N.cjs → index-DdBqSPVX.cjs} +1 -1
  39. package/dist/{index-DDZUeSoG.cjs → index-DeBPAGEt.cjs} +1 -1
  40. package/dist/index-Dh1X3car.cjs +1 -0
  41. package/dist/index-Dn4IDzs-.cjs +1 -0
  42. package/dist/index-DulOjide.cjs +1 -0
  43. package/dist/{index-CUE8dRo3.cjs → index-FCa5J2My.cjs} +1 -1
  44. package/dist/{index-j-6MQx0k.cjs → index-JEgbxSMc.cjs} +1 -1
  45. package/dist/index-ZCzNjeSn.cjs +7 -0
  46. package/dist/{index-CeD_uFzd.cjs → index-_BlT7Ow2.cjs} +1 -1
  47. package/dist/{index-B98K3NQ_.js → index-l5_kSbYo.js} +5 -5
  48. package/dist/{index-Cq5FEQ8T.cjs → index-lKLh-Qzi.cjs} +1 -1
  49. package/dist/{index-XoLdZvmA.cjs → index-mw3dzM6K.cjs} +1 -1
  50. package/dist/{index-B3z_K4tN.js → index-o_wacH9d.js} +6 -6
  51. package/dist/index-pbwJ9I4L.cjs +1 -0
  52. package/dist/index-s1DTCDEw.cjs +4207 -0
  53. package/dist/{index.vue_vue_type_script_setup_true_lang-DmZ8M3M2.js → index.vue_vue_type_script_setup_true_lang-DKitPTZF.js} +7 -7
  54. package/dist/{index.vue_vue_type_script_setup_true_lang-DPRs_TEM.cjs → index.vue_vue_type_script_setup_true_lang-DLjUVVle.cjs} +1 -1
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CLRx6Pr7.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C6RGbzCD.js} +7870 -7846
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-G9Ly6LrV.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-orvz-niQ.cjs} +103 -103
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Bx59UssX.js → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Dj9o7Xk-.js} +10567 -10202
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Cx257lrG.cjs → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-h2jTfgG6.cjs} +13 -13
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DnzbmtTR.js → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-CHHj0HIJ.js} +9 -10
  60. package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-CtNlfQzH.cjs +1 -0
  61. package/dist/login-BiEodQd9.js +129 -0
  62. package/dist/login-zGHoUey-.cjs +1 -0
  63. package/dist/{main-Bytk3eJi.cjs → main-7LUGj9Fq.cjs} +1 -1
  64. package/dist/{main-B3z7cAFc.js → main-Cdq2BrpJ.js} +5 -5
  65. package/dist/{menu-EkyEcRhA.js → menu-Cl42pSjw.js} +1173 -1172
  66. package/dist/{menu-CcabvNj6.cjs → menu-nedhfMQM.cjs} +10 -10
  67. package/dist/{modelComp-DocJQ-pY.js → modelComp-DWx0hNJL.js} +1 -1
  68. package/dist/{modelComp-MsmKaqKZ.cjs → modelComp-VVOVTdqN.cjs} +1 -1
  69. package/dist/obj/model.mtl +42 -0
  70. package/dist/obj/model.obj +26110 -0
  71. package/dist/ss-component.cjs +1 -1
  72. package/dist/ss-component.css +1 -1
  73. package/dist/ss-component.js +9 -9
  74. package/dist/ss-component2.cjs +1 -1
  75. package/dist/ss-component2.js +9 -9
  76. package/dist/{threeModel-DUi0i12h.cjs → threeModel-CXdHATZv.cjs} +1 -1
  77. package/dist/{threeModel-8fmYfsGI.js → threeModel-mpO7wfox.js} +62 -62
  78. package/package.json +1 -1
  79. package/public/obj/model.mtl +42 -0
  80. package/public/obj/model.obj +26110 -0
  81. package/dist/index-B1zrlvmA.cjs +0 -1
  82. package/dist/index-BJOfcIfK.cjs +0 -1
  83. package/dist/index-BdSJGJAj.cjs +0 -1
  84. package/dist/index-BgOWcpJo.cjs +0 -1
  85. package/dist/index-BgjQ12lw.cjs +0 -1
  86. package/dist/index-BtbXPos3.cjs +0 -1
  87. package/dist/index-C0YmHmRc.js +0 -3295
  88. package/dist/index-CHDQYj9k.cjs +0 -7
  89. package/dist/index-DYLTl0bA.cjs +0 -4207
  90. package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-BxhCfpJ1.cjs +0 -1
@@ -1,13 +1,13 @@
1
1
  import { defineAsyncComponent as te, computed as w, onMounted as N, resolveComponent as ne, createBlock as R, openBlock as O, withCtx as ae, resolveDynamicComponent as le, defineComponent as re, defineProps as oe, ref as h, watch as ue, reactive as se } from "vue";
2
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CLRx6Pr7.js";
3
- import { bQ as me, u as ie, p as ce, s as ve, g as pe } from "./menu-EkyEcRhA.js";
4
- import { s as ge } from "./index-Cf8HSIB7.js";
2
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C6RGbzCD.js";
3
+ import { bQ as me, u as ie, p as ce, s as ve, g as pe } from "./menu-Cl42pSjw.js";
4
+ import { s as ge } from "./index-DY7ltLLQ.js";
5
5
  import { useRouter as fe } from "vue-router";
6
- import { g as he } from "./index-Dv0m3N6o.js";
7
- import { u as be } from "./modelComp-DocJQ-pY.js";
8
- import { f as Fe } from "./crypto-v3jAna0Y.js";
9
- import { E as Ce } from "./index-C0YmHmRc.js";
10
- const T = te(() => import("./index-Cf8HSIB7.js").then((c) => c.l));
6
+ import { g as he } from "./index-C77Yeu_E.js";
7
+ import { u as be } from "./modelComp-DWx0hNJL.js";
8
+ import { f as Fe } from "./login-BiEodQd9.js";
9
+ import { E as Ce } from "./index-CnDYddiq.js";
10
+ const T = te(() => import("./index-DY7ltLLQ.js").then((c) => c.l));
11
11
  T.install = (c) => {
12
12
  c.component("ssMenu", T);
13
13
  };
@@ -361,9 +361,8 @@ const Me = {
361
361
  }), $ = (e) => {
362
362
  y.setRouteToChildPath(""), s.setMenuTriggerType("click"), s.setActiveMenuPath(e == null ? void 0 : e.path), s.setActiveAsideMenu(e), e.isRouter ? v.push(e.path) : v.push("/");
363
363
  }, J = async (e) => {
364
- s.setActiveMenuPath(e);
365
364
  const t = Fe(S.value, "path", e);
366
- s.setActiveAsideMenu(t), y.setRouteToChildPath(""), U.value === "click" ? z.value === 1 ? s.setActiveMenuPath(sessionStorage.getItem("pageKey")) : s.setActiveMenuPath(e) : s.setMenuTriggerType("click"), e != null && e.startsWith("/") ? v.push(e) : v.push("/"), z.value++;
365
+ s.setActiveAsideMenu(t), y.setRouteToChildPath(""), U.value === "click" ? z.value === 1 ? s.setActiveMenuPath(sessionStorage.getItem("pageKey")) : s.setActiveMenuPath(e) : (s.setMenuTriggerType("click"), s.setActiveMenuPath(e)), e != null && e.startsWith("/") ? v.push(e) : v.push("/"), z.value++;
367
366
  }, K = (e) => {
368
367
  s.setActiveMenuPath(e);
369
368
  }, D = (e) => {
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-orvz-niQ.cjs");const z=require("./menu-nedhfMQM.cjs"),te=require("./index-DdBqSPVX.cjs"),ae=require("vue-router"),re=require("./index-C2_wvhiv.cjs"),le=require("./modelComp-VVOVTdqN.cjs"),ue=require("./login-zGHoUey-.cjs"),oe=require("./index-ZCzNjeSn.cjs"),E=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DdBqSPVX.cjs")).then(v=>v.index));E.install=v=>{v.component("ssMenu",E)};const R={__name:"index",props:{name:String},setup(v){const i=v,y=t.computed(()=>z.ElIcons[i.name]);return t.onMounted(()=>{}),(D,g)=>{const A=t.resolveComponent("el-icon");return t.openBlock(),t.createBlock(A,null,{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(y.value)))]),_:1})}}},W=[{name:"--vertical-menu-bg",value:"transparent"},{name:"--vertical-submenu-hover-bg",value:"rgba(51, 86, 232, 0.6)"},{name:"--vertical-submenu-open-bg",value:"#3356E8"},{name:"--vertical-submenu-second-open-bg",value:"#D5DDFA"},{name:"--vertical-submenu-open-inline-bg",value:"#F6F6F6"},{name:"--vertical-submenu-last-inline-bg",value:"#ECEFFD"},{name:"--vertical-submenu-menuitem-color",value:"#051E37"},{name:"--vertical-submenu-menuitem-active-color",value:"#3356E8"},{name:"--vertical-submenu-color",value:"#051E37"},{name:"--vertical-submenu-active-color",value:"#ffffff"},{name:"--vertical-menuitem-hover-bg",value:"rgba(51, 86, 232, 0.6)"},{name:"--vertical-menuitem-active-bg",value:"#3356E8"},{name:"--vertical-menuitem-color",value:"#051E37"},{name:"--vertical-menuitem-active-color",value:"#ffffff"},{name:"--vertical-menuitem-fontSize",value:"1rem"},{name:"--vertical-menuitem-fontWeight",value:"400"},{name:"--vertical-menuitem-active-fontWeight",value:"400"},{name:"--vertical-menuitem-font",value:"var(--ssComponent-font-family);"},{name:"--vertical-menuitem-radius",value:"8px"},{name:"--vertical-menu-padding",value:"0.5rem"}],se=[{name:"--horizontal-menu-bg",value:"#051E37"},{name:"--horizontal-submenu-hover-bg",value:"rgba(51, 86, 232, 0.5)"},{name:"--horizontal-submenu-open-bg",value:"#3356E8"},{name:"--horizontal-submenu-open-inline-bg",value:"#3356E8"},{name:"--horizontal-menuitem-hover-bg",value:"rgba(51, 86, 232, 0.5)"},{name:"--horizontal-menuitem-active-bg",value:"#3356E8"},{name:"--horizontal-menuitem-color",value:"#FFFFFF"},{name:"--horizontal-menuitem-active-color",value:"#FFFFFF"},{name:"--horizontal-menuitem-fontSize",value:"1.25rem"},{name:"--horizontal-menuitem-fontWeight",value:"400"},{name:"--horizontal-menuitem-active-fontWeight",value:"600"},{name:"--horizontal-menuitem-font",value:"var(--ssComponent-font-family);"}],H=[{name:"--vertical-menu-bg",value:"transparent"},{name:"--vertical-submenu-hover-bg",value:"rgba(114, 176, 45, 0.6)"},{name:"--vertical-submenu-active-color",value:"#323333"},{name:"--vertical-submenu-open-bg",value:"#72B02D"},{name:"--vertical-submenu-second-open-bg",value:"#CEE3B8"},{name:"--vertical-submenu-open-inline-bg",value:"#F6F6F6"},{name:"--vertical-submenu-last-inline-bg",value:"#F2F7EB"},{name:"--vertical-submenu-color",value:"#323333"},{name:"--vertical-submenu-menuitem-color",value:"#323333"},{name:"--vertical-submenu-menuitem-active-color",value:"#72B02D"},{name:"--vertical-menuitem-hover-bg",value:"rgba(114, 176, 45, 0.6)"},{name:"--vertical-menuitem-active-bg",value:"#72B02D"},{name:"--vertical-menuitem-color",value:"#323333"},{name:"--vertical-menuitem-active-color",value:"#323333"},{name:"--vertical-menuitem-fontSize",value:"1rem"},{name:"--vertical-menuitem-fontWeight",value:"400"},{name:"--vertical-menuitem-active-fontWeight",value:"400"},{name:"--vertical-menuitem-font",value:"var(--ssComponent-font-family);"},{name:"--vertical-menuitem-radius",value:"8px"},{name:"--vertical-menu-padding",value:"0.5rem"}],O=[{name:"--horizontal-menu-bg",value:"#323333"},{name:"--horizontal-submenu-hover-bg",value:"rgba(114, 176, 45, 0.6)"},{name:"--horizontal-submenu-open-bg",value:"#72B02D"},{name:"--horizontal-submenu-open-inline-bg",value:"#1C4275"},{name:"--horizontal-menuitem-hover-bg",value:"rgba(114, 176, 45, 0.6)"},{name:"--horizontal-menuitem-active-bg",value:"#72B02D"},{name:"--horizontal-menuitem-color",value:"#FFFFFF"},{name:"--horizontal-menuitem-active-color",value:"#323333"},{name:"--horizontal-menuitem-fontSize",value:"1.25rem"},{name:"--horizontal-menuitem-fontWeight",value:"400"},{name:"--horizontal-menuitem-active-fontWeight",value:"600"},{name:"--horizontal-menuitem-font",value:"var(--ssComponent-font-family);"}],ie=[{name:"--ssbutton-theme-color",value:"#FFFFFF"},{name:"--ssbutton-theme-bg",value:"#3356E8"},{name:"--ssbutton-special-bg",value:"rgba(255,255,255,0.2)"},{name:"--ssgroup-background",value:"linear-gradient(to right, #D6DDFA, #ffffff)"},{name:"--ssComponent-theme-color",value:"#3356E8"},{name:"--ssComponent-theme-watermark",value:"url('/public/icons/img/watermark-blue.png')"}],me=[{name:"--ssbutton-theme-color",value:"#323333"},{name:"--ssbutton-theme-bg",value:"#72B02D"},{name:"--ssbutton-special-bg",value:"rgba(255, 255, 255, 0.2)"},{name:"--ssgroup-background",value:"linear-gradient(to right, #ddf6e0, #ffffff)"},{name:"--ssComponent-theme-color",value:"#72B02D"},{name:"--ssComponent-theme-watermark",value:"url('/public/icons/img/watermark.png')"}],ce=t.defineComponent({name:"menu",components:{ssMenu:E,DynamicIcon:R,ssDialog:te.ssDialog},setup(){const v=t.defineProps({mode:{type:String,default:"vertical"}}),i=z.useMenuState(),y=le.useModelComp(z.pinia),D=t.ref(0),g=ae.useRouter(),{asideMenus:A,menuTriggerType:V,platform:N}=z.storeToRefs(i),U=t.computed(()=>v==null?void 0:v.mode),B=t.computed(()=>{let e=[...A.value];if((e==null?void 0:e.length)===0)return g.push("/"),[];const n=G(e,L.value);return n.isFlag||(e=n==null?void 0:n.data),e}),$=e=>{y.setRouteToChildPath(""),i.setMenuTriggerType("click"),i.setActiveMenuPath(e==null?void 0:e.path),i.setActiveAsideMenu(e),e.isRouter?g.push(e.path):g.push("/")},J=async e=>{const n=ue.findNodeByPropInTree(B.value,"path",e);i.setActiveAsideMenu(n),y.setRouteToChildPath(""),V.value==="click"?D.value===1?i.setActiveMenuPath(sessionStorage.getItem("pageKey")):i.setActiveMenuPath(e):(i.setMenuTriggerType("click"),i.setActiveMenuPath(e)),e!=null&&e.startsWith("/")?g.push(e):g.push("/"),D.value++},K=e=>{i.setActiveMenuPath(e)},w=e=>{const n=document.documentElement;e==null||e.forEach(u=>{n.style.setProperty(u.name,u.value)})};t.onMounted(()=>{D.value=1});const L=t.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});t.watch(()=>N.value,e=>{e==="browser"?w(W):e==="client"&&(w(O),w(H))},{immediate:!0});const j=(e,n)=>{function u(o){o==null||o.forEach(a=>{var h,C;const s=(h=a==null?void 0:a.path)!=null&&h.startsWith("/")?(C=a==null?void 0:a.path)==null?void 0:C.substring(1):a==null?void 0:a.path;a.show=n==null?void 0:n.some(f=>f==null?void 0:f.includes(s)),a.children&&u(a.children)})}return u(e),e},G=(e,n)=>{if(Array.isArray(n)){const u=Array.from(new Set(n==null?void 0:n.map(o=>o.substring(0,o.lastIndexOf("/")))));return{data:j(e,u),isFlag:!1}}else return{isFlag:(n==null?void 0:n.toUpperCase())==="SUPERADMIN"}},c=t.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),Q=e=>re.getComponent(e),X=t.ref({}),T=t.ref([]),Y=async(e,n,u)=>{var C,f,x;if(!(e!=null&&e.structureIds)||((C=e==null?void 0:e.structureIds)==null?void 0:C.length)===0)return;const o=(x=(f=e==null?void 0:e.structureIds)==null?void 0:f.filter(r=>(r==null?void 0:r.key)==="dialogConfig"))==null?void 0:x.map(r=>r==null?void 0:r.id);let a=o==null?void 0:o.map(r=>z.getInsofDataApi({id:r}));const s=await Promise.all(a);if(s==null?void 0:s.every(r=>{var l;return((l=r==null?void 0:r.data)==null?void 0:l.code)===200})){const r=s==null?void 0:s.map(l=>{var F,M,m,d,k,P,q;return{id:(m=(M=(F=l==null?void 0:l.data)==null?void 0:F.result)==null?void 0:M[0])==null?void 0:m.id,...(q=(P=(k=(d=l==null?void 0:l.data)==null?void 0:d.result)==null?void 0:k[0])==null?void 0:P.value)==null?void 0:q.pageData}});n==="create"&&(T.value=r),n==="update"&&(T.value=r==null?void 0:r.map(l=>{var F,M;return((F=l==null?void 0:l.comp)==null?void 0:F.toUpperCase())==="FORM"?{...l,compData:(M=l==null?void 0:l.compData)==null?void 0:M.map(m=>{var d;return(m==null?void 0:m.key)==="formContent"?{...m,contents:(d=m==null?void 0:m.contents)==null?void 0:d.map(k=>({...k,value:u==null?void 0:u.title}))}:m})}:l}))}},b=t.ref({}),p=t.ref({}),Z=e=>{switch(e){case"新增":return"create";case"编辑":return"update";case"删除":return"delete"}},S=t.ref({}),_=e=>{i.setCacheInputMenu({type:c.type,data:e}),i.setIsRefreshMenus(!0)},I=async(e,n)=>{c.type=Z(n==null?void 0:n.operateType),await Y(n,c.type,e),p.value=e,S.value=n,(n==null?void 0:n.operateType)!=="删除"?(c.show=(n==null?void 0:n.trigger)==="openDialog",c.title=(n==null?void 0:n.operateType)+"菜单"):oe.ElMessageBox.confirm(`是否确认要删除【${e==null?void 0:e.title}】`,"",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{_(e)})},ee=()=>{c.show=!1},ne=e=>e==null?void 0:e.filter(n=>n.allowInherit);return{handleCompChange:e=>{var u,o;const n=(u=e==null?void 0:e.contents)==null?void 0:u.find(a=>a.key==="formContent");n&&(b.value=(o=n==null?void 0:n.contents)==null?void 0:o.reduce((a,s)=>(a[s.key]=s.value,a.prop=s.key,a),{}))},dialogForm:X,dialogRenderComps:T,getComponents:Q,clickSubmitForm:()=>{var u,o,a,s,h;let e;c.type==="create"&&(e=((u=p.value)==null?void 0:u.path)+"/"+b.value[(o=b.value)==null?void 0:o.prop]),c.type==="update"&&(e=(a=p.value)==null?void 0:a.path);const n={...p.value,config:ne((s=p.value)==null?void 0:s.config),children:[],childMenus:[],title:b.value[(h=b.value)==null?void 0:h.prop],path:e};console.log("clickSubmitForm",S.value,p.value,n),_(n),c.show=!1},dialogInfo:c,beforeDialogDestroy:ee,clickMenuIcon:I,mode:U,renderMenuList:B,clickMenu:$,openMenu:J,closeMenu:K,changeMenuStyle:w}}});exports._sfc_main=ce;exports._sfc_main$1=R;exports.browserHorizontalMenuClasses=se;exports.browserThemeConfig=ie;exports.browserVerticalMenuClasses=W;exports.clientHorizontalMenuClasses=O;exports.clientThemeConfig=me;exports.clientVerticalMenuClasses=H;exports.ssMenu=E;
@@ -0,0 +1,129 @@
1
+ import { c as S, bR as m, s as A, bO as I, E as K, g as b, u as D, p as E } from "./menu-Cl42pSjw.js";
2
+ function g(e, r, i, t = "children") {
3
+ var a;
4
+ for (const s of e) {
5
+ if (s[r] === i)
6
+ return s;
7
+ if (s[t] && ((a = s[t]) == null ? void 0 : a.length) > 0) {
8
+ const n = g(s[t], r, i);
9
+ if (n)
10
+ return n;
11
+ }
12
+ }
13
+ return null;
14
+ }
15
+ function M() {
16
+ const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), t = String(e.getDate()).padStart(2, "0"), a = String(e.getHours()).padStart(2, "0"), s = String(e.getMinutes()).padStart(2, "0"), n = String(e.getSeconds()).padStart(2, "0");
17
+ return `${r}-${i}-${t} ${a}:${s}:${n}`;
18
+ }
19
+ function L(e, r) {
20
+ const i = r.split("/");
21
+ let t = e, a = null;
22
+ for (let s of i) {
23
+ const n = t.find((u) => u.title === s);
24
+ if (!n)
25
+ return null;
26
+ a || (a = n), t = n.children ?? [];
27
+ }
28
+ return a;
29
+ }
30
+ const R = (e) => {
31
+ var i;
32
+ const r = e;
33
+ return r.children = (i = r.children) == null ? void 0 : i.map((t) => {
34
+ var a;
35
+ return (a = t == null ? void 0 : t.title) != null && a.children ? t == null ? void 0 : t.title : t;
36
+ }), r;
37
+ }, T = (e) => {
38
+ var r, i, t;
39
+ return Array.isArray(e == null ? void 0 : e.title) && ((r = e == null ? void 0 : e.title) == null ? void 0 : r.length) === ((t = (i = e == null ? void 0 : e.title) == null ? void 0 : i.filter((a) => a.title)) == null ? void 0 : t.length) ? e == null ? void 0 : e.title : Array.isArray(e == null ? void 0 : e.children) ? R(e) : e;
40
+ }, h = (e, r) => {
41
+ const i = r, t = [];
42
+ e == null || e.forEach((s) => {
43
+ Array.isArray(s) ? t.push({ children: h(s, []) }) : t.push({ title: s });
44
+ });
45
+ let a = t.reduce((s, n) => (Object.entries(n).forEach(([u, o]) => {
46
+ s[u] === void 0 ? o != null && o.title ? s[u] = [o] : s[u] = o : (Array.isArray(s[u]) || (s[u] = [{ title: s[u] }]), o != null && o.title || Array.isArray(o) ? s[u].push(o) : s[u].push({ title: o }));
47
+ }), s), {});
48
+ return a = T(S(a)), i.push(a), Array.isArray(i) && (i == null ? void 0 : i.length) > 1 ? i : i == null ? void 0 : i[0];
49
+ }, B = (e) => {
50
+ let r = [], i = [];
51
+ return e == null || e.forEach((t) => {
52
+ r = h(t, i);
53
+ }), r;
54
+ }, $ = D(E), { menus: w } = A($), O = m("loginState", {
55
+ state: () => ({
56
+ superAdminInfo: {},
57
+ cryptoInfo: {
58
+ publicKey: "",
59
+ privateKey: ""
60
+ },
61
+ loginUserInfo: {},
62
+ structureData: [],
63
+ isStructureExist: !1
64
+ }),
65
+ actions: {
66
+ setSuperAdminInfo(e) {
67
+ this.superAdminInfo = e;
68
+ },
69
+ setLoginUserInfo(e) {
70
+ this.loginUserInfo = e;
71
+ },
72
+ setStructureData(e) {
73
+ this.structureData = e;
74
+ },
75
+ setIsStructureExist(e) {
76
+ this.isStructureExist = e;
77
+ },
78
+ async getModelSecretAsync(e) {
79
+ var i, t, a, s, n, u, o, l, y, p, d, f, c;
80
+ const r = await b({
81
+ key: {
82
+ systemKey: e ? e.systemKey : sessionStorage.getItem("systemKey"),
83
+ pageKey: "secret",
84
+ type: "system"
85
+ }
86
+ });
87
+ return ((i = r == null ? void 0 : r.data) == null ? void 0 : i.code) === 200 && (t = r == null ? void 0 : r.data) != null && t.result && Array.isArray((a = r == null ? void 0 : r.data) == null ? void 0 : a.result) && ((n = (s = r == null ? void 0 : r.data) == null ? void 0 : s.result) == null ? void 0 : n.length) > 0 && (this.cryptoInfo.publicKey = (y = (l = (o = (u = r.data) == null ? void 0 : u.result[0]) == null ? void 0 : o.value) == null ? void 0 : l.cryptoInfo) == null ? void 0 : y.publicKey, this.cryptoInfo.privateKey = (c = (f = (d = (p = r.data) == null ? void 0 : p.result[0]) == null ? void 0 : d.value) == null ? void 0 : f.cryptoInfo) == null ? void 0 : c.privateKey), {
88
+ publicKey: this.cryptoInfo.publicKey,
89
+ privateKey: this.cryptoInfo.privateKey
90
+ };
91
+ },
92
+ async setLogRecordAsync(e, r, i = "operate") {
93
+ var t;
94
+ try {
95
+ const a = g(w.value, "path", r, "children");
96
+ if (!a) return;
97
+ const s = await I({
98
+ key: {
99
+ systemKey: sessionStorage.getItem("systemKey"),
100
+ pageKey: "/log",
101
+ type: "system",
102
+ logType: i
103
+ },
104
+ value: {
105
+ module: a ? a.title : r,
106
+ timeStamp: M(),
107
+ detail: { ...e }
108
+ }
109
+ });
110
+ return ((t = s == null ? void 0 : s.data) == null ? void 0 : t.code) === 200;
111
+ } catch (a) {
112
+ K.error(a);
113
+ }
114
+ }
115
+ },
116
+ persist: [
117
+ {
118
+ key: "loginState",
119
+ storage: localStorage,
120
+ pick: ["superAdminInfo"]
121
+ }
122
+ ]
123
+ });
124
+ export {
125
+ L as a,
126
+ B as c,
127
+ g as f,
128
+ O as u
129
+ };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./menu-nedhfMQM.cjs");function y(e,r,i,t="children"){var a;for(const s of e){if(s[r]===i)return s;if(s[t]&&((a=s[t])==null?void 0:a.length)>0){const u=y(s[t],r,i);if(u)return u}}return null}function A(){const e=new Date,r=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0");return`${r}-${i}-${t} ${a}:${s}:${u}`}function m(e,r){const i=r.split("/");let t=e,a=null;for(let s of i){const u=t.find(n=>n.title===s);if(!u)return null;a||(a=u),t=u.children??[]}return a}const I=e=>{var i;const r=e;return r.children=(i=r.children)==null?void 0:i.map(t=>{var a;return(a=t==null?void 0:t.title)!=null&&a.children?t==null?void 0:t.title:t}),r},K=e=>{var r,i,t;return Array.isArray(e==null?void 0:e.title)&&((r=e==null?void 0:e.title)==null?void 0:r.length)===((t=(i=e==null?void 0:e.title)==null?void 0:i.filter(a=>a.title))==null?void 0:t.length)?e==null?void 0:e.title:Array.isArray(e==null?void 0:e.children)?I(e):e},S=(e,r)=>{const i=r,t=[];e==null||e.forEach(s=>{Array.isArray(s)?t.push({children:S(s,[])}):t.push({title:s})});let a=t.reduce((s,u)=>(Object.entries(u).forEach(([n,o])=>{s[n]===void 0?o!=null&&o.title?s[n]=[o]:s[n]=o:(Array.isArray(s[n])||(s[n]=[{title:s[n]}]),o!=null&&o.title||Array.isArray(o)?s[n].push(o):s[n].push({title:o}))}),s),{});return a=K(l.cloneDeep(a)),i.push(a),Array.isArray(i)&&(i==null?void 0:i.length)>1?i:i==null?void 0:i[0]},D=e=>{let r=[],i=[];return e==null||e.forEach(t=>{r=S(t,i)}),r},T=l.useMenuState(l.pinia),{menus:b}=l.storeToRefs(T),E=l.defineStore("loginState",{state:()=>({superAdminInfo:{},cryptoInfo:{publicKey:"",privateKey:""},loginUserInfo:{},structureData:[],isStructureExist:!1}),actions:{setSuperAdminInfo(e){this.superAdminInfo=e},setLoginUserInfo(e){this.loginUserInfo=e},setStructureData(e){this.structureData=e},setIsStructureExist(e){this.isStructureExist=e},async getModelSecretAsync(e){var i,t,a,s,u,n,o,d,p,f,c,g,h;const r=await l.getInsofDataApi({key:{systemKey:e?e.systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"}});return((i=r==null?void 0:r.data)==null?void 0:i.code)===200&&(t=r==null?void 0:r.data)!=null&&t.result&&Array.isArray((a=r==null?void 0:r.data)==null?void 0:a.result)&&((u=(s=r==null?void 0:r.data)==null?void 0:s.result)==null?void 0:u.length)>0&&(this.cryptoInfo.publicKey=(p=(d=(o=(n=r.data)==null?void 0:n.result[0])==null?void 0:o.value)==null?void 0:d.cryptoInfo)==null?void 0:p.publicKey,this.cryptoInfo.privateKey=(h=(g=(c=(f=r.data)==null?void 0:f.result[0])==null?void 0:c.value)==null?void 0:g.cryptoInfo)==null?void 0:h.privateKey),{publicKey:this.cryptoInfo.publicKey,privateKey:this.cryptoInfo.privateKey}},async setLogRecordAsync(e,r,i="operate"){var t;try{const a=y(b.value,"path",r,"children");if(!a)return;const s=await l.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"/log",type:"system",logType:i},value:{module:a?a.title:r,timeStamp:A(),detail:{...e}}});return((t=s==null?void 0:s.data)==null?void 0:t.code)===200}catch(a){l.ElMessage.error(a)}}},persist:[{key:"loginState",storage:localStorage,pick:["superAdminInfo"]}]});exports.convertRawToTree=D;exports.findNodeByPropInTree=y;exports.findRootNodeByPath=m;exports.useLoginState=E;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-Cq5FEQ8T.cjs"),u=require("./menu-CcabvNj6.cjs"),G=require("./modelComp-MsmKaqKZ.cjs"),Z=require("./index-DYLTl0bA.cjs"),K=require("./array-B_wsE8_t.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],v={key:0,class:"show-content"},ee={class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(j,{emit:E}){const t=j,S=E,h=G.useModelComp(u.pinia),{itemData:p}=u.storeToRefs(h),_=e.ref([]),C=e.ref([]),T=c=>{S("change",{wholeValue:_.value,editValue:c})},x=c=>{const g=u.cloneDeep(_.value),b=g==null?void 0:g.map((d,B)=>(B===(c==null?void 0:c.index)&&(d.compData=c==null?void 0:c.contents),d));_.value=b};e.watch(()=>p.value,()=>{var c;!p.value||((c=p.value)==null?void 0:c.length)===0||(C.value=p.value,_.value=p.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var g;if(((g=t==null?void 0:t.jsonContents)==null?void 0:g.length)>0){h.setOriginalData(t==null?void 0:t.jsonContents),h.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=K.expandStringToJson(t==null?void 0:t.content);h.setOriginalData(c),h.setItemData(c)},{deep:!0,immediate:!0});const N=c=>Z.getComponent(c);return(c,g)=>{var b;return((b=C.value)==null?void 0:b.length)>0?(e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(d,B)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:B},[e.createElementVNode("div",ee,e.toDisplayString(d.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(d.comp)),{itemData:d==null?void 0:d.compData,childItemData:d==null?void 0:d.itemChildData,key:B,onChange:T,index:B,onContentChange:x},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ne=Q._export_sfc(te,[["__scopeId","data-v-1c04adc8"]]),oe={class:"add-model-content"},ae={key:0,class:"model-import-data"},le={class:"import-button"},re={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view ssComponent"},de={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(j,{emit:E}){const t=j,S=E,h=e.ref(""),p=e.ref([]),_=e.ref(0),C=G.useModelComp(u.pinia);u.useMenuState(u.pinia);const{itemData:T,originalData:x}=u.storeToRefs(C),N=e.ref(null),c=e.ref(0),g=e.ref(""),b=()=>{_.value=window.innerWidth},d=async l=>{var i;const a=(i=u.cloneDeep(l==null?void 0:l.wholeValue))==null?void 0:i.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(k=>((k==null?void 0:k.key)==="formContent"&&(k.contents=K.arrayToNumberArray(k==null?void 0:k.contents)),k))),o});S("change",{originalContents:x.value,currentContents:l==null?void 0:l.wholeValue,editContent:l==null?void 0:l.editValue,stringContent:B(u.cloneDeep(l==null?void 0:l.wholeValue)),arrayToContents:a})},B=l=>{var i;let a=[];return(i=u.cloneDeep(l))==null||i.forEach(o=>{var f,k;V!=null&&V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=V==null?void 0:V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(k=o==null?void 0:o.compData)==null||k.forEach(n=>{var I,F,$,J,A,q,M,R,L,z,W,H;if(s!=null&&s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))if(!((I=n==null?void 0:n.contents)!=null&&I.length))a.push(((F=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:F.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let m=($=n==null?void 0:n.contents)==null?void 0:$[0];if(!m)return;if(Object.keys(m).includes("label")&&Object.keys(m).includes("key")&&Object.keys(m).includes("width"))if(((A=(J=n.contents)==null?void 0:J.filter(y=>y.width!==1))==null?void 0:A.length)===0){const y=(q=u.cloneDeep(n==null?void 0:n.contents))==null?void 0:q.map(r=>({[r.label]:r.value}));a.push(((M=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:M.key)+"="+JSON.stringify(y)+"/r/n")}else{let y=[];(R=u.cloneDeep(n==null?void 0:n.contents))==null||R.reduce((r,D)=>{var P;return r[D.label]=D.key,((P=Object.keys(u.cloneDeep(r)))==null?void 0:P.length)>=D.width&&(y.push(u.cloneDeep(r)),r={}),r},{}),a.push(((L=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:L.key)+"="+JSON.stringify(y)+"/r/n")}else if(Object.keys(m).includes("label")){const y=(z=u.cloneDeep(n==null?void 0:n.contents))==null?void 0:z.map(r=>r.label);a.push(((W=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:W.key)+"="+JSON.stringify(y)+"/r/n")}else a.push(((H=s==null?void 0:s.find(y=>(y==null?void 0:y.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},w=e.ref([]),U=()=>{N.value.click()},X=l=>{const a=l.target.files[0];if(!a)return;const i=new FileReader;i.onload=o=>{try{h.value=o.target.result,w.value=Y(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},i.onerror=o=>{console.error("文件读取错误:",o)},i.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",b)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{h.value=t==null?void 0:t.content,p.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var l;((l=w.value)==null?void 0:l.length)!==0&&(C.setOriginalData(w.value),C.setItemData(w.value))},{deep:!0,immediate:!0});const Y=l=>{let a=l.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(i){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${i}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(l,a)=>{var i;return e.openBlock(),e.createElementBlock("div",oe,[((i=t==null?void 0:t.jsonContents)==null?void 0:i.length)===0?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:N,accept:".txt",onChange:X,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:U,class:"import-button-content"},"导入文件"),g.value?(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:h.value,onChange:d,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=Q._export_sfc(de,[["__scopeId","data-v-1dbc7677"]]);exports.default=me;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-lKLh-Qzi.cjs"),u=require("./menu-nedhfMQM.cjs"),G=require("./modelComp-VVOVTdqN.cjs"),Z=require("./index-C2_wvhiv.cjs"),K=require("./array-Dbtz7Lsx.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],v={key:0,class:"show-content"},ee={class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(j,{emit:E}){const t=j,S=E,h=G.useModelComp(u.pinia),{itemData:p}=u.storeToRefs(h),_=e.ref([]),C=e.ref([]),T=c=>{S("change",{wholeValue:_.value,editValue:c})},x=c=>{const g=u.cloneDeep(_.value),b=g==null?void 0:g.map((d,B)=>(B===(c==null?void 0:c.index)&&(d.compData=c==null?void 0:c.contents),d));_.value=b};e.watch(()=>p.value,()=>{var c;!p.value||((c=p.value)==null?void 0:c.length)===0||(C.value=p.value,_.value=p.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var g;if(((g=t==null?void 0:t.jsonContents)==null?void 0:g.length)>0){h.setOriginalData(t==null?void 0:t.jsonContents),h.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=K.expandStringToJson(t==null?void 0:t.content);h.setOriginalData(c),h.setItemData(c)},{deep:!0,immediate:!0});const N=c=>Z.getComponent(c);return(c,g)=>{var b;return((b=C.value)==null?void 0:b.length)>0?(e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(d,B)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:B},[e.createElementVNode("div",ee,e.toDisplayString(d.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(d.comp)),{itemData:d==null?void 0:d.compData,childItemData:d==null?void 0:d.itemChildData,key:B,onChange:T,index:B,onContentChange:x},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ne=Q._export_sfc(te,[["__scopeId","data-v-1c04adc8"]]),oe={class:"add-model-content"},ae={key:0,class:"model-import-data"},le={class:"import-button"},re={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view ssComponent"},de={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(j,{emit:E}){const t=j,S=E,h=e.ref(""),p=e.ref([]),_=e.ref(0),C=G.useModelComp(u.pinia);u.useMenuState(u.pinia);const{itemData:T,originalData:x}=u.storeToRefs(C),N=e.ref(null),c=e.ref(0),g=e.ref(""),b=()=>{_.value=window.innerWidth},d=async l=>{var i;const a=(i=u.cloneDeep(l==null?void 0:l.wholeValue))==null?void 0:i.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(k=>((k==null?void 0:k.key)==="formContent"&&(k.contents=K.arrayToNumberArray(k==null?void 0:k.contents)),k))),o});S("change",{originalContents:x.value,currentContents:l==null?void 0:l.wholeValue,editContent:l==null?void 0:l.editValue,stringContent:B(u.cloneDeep(l==null?void 0:l.wholeValue)),arrayToContents:a})},B=l=>{var i;let a=[];return(i=u.cloneDeep(l))==null||i.forEach(o=>{var f,k;V!=null&&V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=V==null?void 0:V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(k=o==null?void 0:o.compData)==null||k.forEach(n=>{var I,F,$,J,A,q,M,R,L,z,W,H;if(s!=null&&s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))if(!((I=n==null?void 0:n.contents)!=null&&I.length))a.push(((F=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:F.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let m=($=n==null?void 0:n.contents)==null?void 0:$[0];if(!m)return;if(Object.keys(m).includes("label")&&Object.keys(m).includes("key")&&Object.keys(m).includes("width"))if(((A=(J=n.contents)==null?void 0:J.filter(y=>y.width!==1))==null?void 0:A.length)===0){const y=(q=u.cloneDeep(n==null?void 0:n.contents))==null?void 0:q.map(r=>({[r.label]:r.value}));a.push(((M=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:M.key)+"="+JSON.stringify(y)+"/r/n")}else{let y=[];(R=u.cloneDeep(n==null?void 0:n.contents))==null||R.reduce((r,D)=>{var P;return r[D.label]=D.key,((P=Object.keys(u.cloneDeep(r)))==null?void 0:P.length)>=D.width&&(y.push(u.cloneDeep(r)),r={}),r},{}),a.push(((L=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:L.key)+"="+JSON.stringify(y)+"/r/n")}else if(Object.keys(m).includes("label")){const y=(z=u.cloneDeep(n==null?void 0:n.contents))==null?void 0:z.map(r=>r.label);a.push(((W=s==null?void 0:s.find(r=>(r==null?void 0:r.value)===(n==null?void 0:n.key)))==null?void 0:W.key)+"="+JSON.stringify(y)+"/r/n")}else a.push(((H=s==null?void 0:s.find(y=>(y==null?void 0:y.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},w=e.ref([]),U=()=>{N.value.click()},X=l=>{const a=l.target.files[0];if(!a)return;const i=new FileReader;i.onload=o=>{try{h.value=o.target.result,w.value=Y(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},i.onerror=o=>{console.error("文件读取错误:",o)},i.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",b)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{h.value=t==null?void 0:t.content,p.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var l;((l=w.value)==null?void 0:l.length)!==0&&(C.setOriginalData(w.value),C.setItemData(w.value))},{deep:!0,immediate:!0});const Y=l=>{let a=l.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(i){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${i}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(l,a)=>{var i;return e.openBlock(),e.createElementBlock("div",oe,[((i=t==null?void 0:t.jsonContents)==null?void 0:i.length)===0?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:N,accept:".txt",onChange:X,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:U,class:"import-button-content"},"导入文件"),g.value?(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:h.value,onChange:d,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=Q._export_sfc(de,[["__scopeId","data-v-1dbc7677"]]);exports.default=me;
@@ -1,9 +1,9 @@
1
1
  import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as f, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, createVNode as A } from "vue";
2
- import { m as ie, a as me, b as de } from "./index-DkuHB0rR.js";
3
- import { p as E, s as ee, c as k, u as ye } from "./menu-EkyEcRhA.js";
4
- import { u as te } from "./modelComp-DocJQ-pY.js";
5
- import { g as fe } from "./index-Dv0m3N6o.js";
6
- import { e as ge, a as he } from "./array-B8lWuPWk.js";
2
+ import { m as ie, a as me, b as de } from "./index-BJJ0vtM2.js";
3
+ import { p as E, s as ee, c as k, u as ye } from "./menu-Cl42pSjw.js";
4
+ import { u as te } from "./modelComp-DWx0hNJL.js";
5
+ import { g as fe } from "./index-C77Yeu_E.js";
6
+ import { e as ge, a as he } from "./array-NXwPkThl.js";
7
7
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const x = [
9
9
  {