ss-component-new 1.1.595 → 1.1.596

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 (63) hide show
  1. package/dist/{crypto-AruyYTHF.js → crypto-BRyGpjGR.js} +430 -503
  2. package/dist/{crypto-CyF3hwB4.cjs → crypto-CRbcEKIz.cjs} +11 -11
  3. package/dist/{index-CtKkkNVO.js → index-4me0w_d_.js} +1 -1
  4. package/dist/index-B-P2iW5F.cjs +1 -0
  5. package/dist/index-BFKRXrzQ.cjs +1 -0
  6. package/dist/{index--x1v2tVg.js → index-BIu-jTfc.js} +1 -1
  7. package/dist/index-BJi_ECqJ.cjs +1 -0
  8. package/dist/{index-kHf3YLFM.js → index-BOb-2bQ6.js} +1 -1
  9. package/dist/{index-OwBy9Gpy.js → index-BhIXAFkM.js} +4 -3
  10. package/dist/index-BiqWWf_i.cjs +1 -0
  11. package/dist/{index-ROm5ioP3.js → index-Bk3SowMg.js} +1 -1
  12. package/dist/{index-CaYc-fdU.cjs → index-BmX_GIIO.cjs} +1 -1
  13. package/dist/{index-QCZigjx6.js → index-Bq9zvPYq.js} +1 -1
  14. package/dist/{index-BNRTUsQy.js → index-BrR-UBrL.js} +2 -2
  15. package/dist/{index-CGjO9Rfc.js → index-BriwvEur.js} +1 -1
  16. package/dist/{index-DbfXZuSO.js → index-BurAdhpz.js} +2 -2
  17. package/dist/{index-DulzcrfM.js → index-C1KIIGh8.js} +2 -2
  18. package/dist/{index-BCEAEGRT.js → index-C7x-mC0R.js} +82 -81
  19. package/dist/{index-DnfA7Rxr.cjs → index-CB4s2Qtu.cjs} +1 -1
  20. package/dist/{index-BEhahmXR.cjs → index-CUnz8HhY.cjs} +1 -1
  21. package/dist/{index-pPqGNFo4.cjs → index-CwYjbsHf.cjs} +1 -1
  22. package/dist/index-DFdkXYtv.js +4373 -0
  23. package/dist/{index-BDyEsCzC.cjs → index-DHuIlYC1.cjs} +1 -1
  24. package/dist/index-DJc0EPc7.cjs +1 -0
  25. package/dist/{index-thv0_1C7.cjs → index-DSsJ2-ii.cjs} +1 -1
  26. package/dist/{index-Bn_QEmCm.cjs → index-DTKpspvK.cjs} +1 -1
  27. package/dist/index-DUjNOx49.cjs +1 -0
  28. package/dist/{index-DU7mec17.js → index-Db0lTu76.js} +1 -1
  29. package/dist/index-K05hKXiU.cjs +1 -0
  30. package/dist/{index-CoXYZaFu.cjs → index-P7MVl516.cjs} +1 -1
  31. package/dist/index-R71UAxtE.cjs +1 -0
  32. package/dist/{index-B_wxih7J.js → index-TRcS4V2m.js} +2 -2
  33. package/dist/{index-B8CqF9dV.js → index-Zt6huWXY.js} +4 -4
  34. package/dist/{index-kBwJORKQ.js → index-_h1qmm7b.js} +6 -6
  35. package/dist/{index-CAFMHjaK.js → index-bALhgSe4.js} +22 -21
  36. package/dist/index-n20urAJT.cjs +1 -0
  37. package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-DztskrHi.js → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-C4KOyCan.js} +2 -2
  38. package/dist/index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-CHdcwZZm.cjs +1 -0
  39. package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-DrVsYebD.js → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang--Ckdd4kI.js} +51 -51
  40. package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-CUaHvGT0.cjs → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-DNiiRDF0.cjs} +10 -10
  41. package/dist/login-BBvcYktp.cjs +1 -0
  42. package/dist/login-afGmER0u.js +129 -0
  43. package/dist/{main-Bv6-X84h.js → main-BdwwE9kL.js} +2 -2
  44. package/dist/{main-BcnpB9rQ.cjs → main-CBruCFMa.cjs} +1 -1
  45. package/dist/ss-component.cjs +1 -1
  46. package/dist/ss-component.css +1 -1
  47. package/dist/ss-component.js +3 -3
  48. package/dist/ss-component2.cjs +1 -1
  49. package/dist/ss-component2.js +8 -8
  50. package/package.json +1 -1
  51. package/dist/index-BA2jgTGT.cjs +0 -1
  52. package/dist/index-BYIt5bNH.cjs +0 -1
  53. package/dist/index-Boa9Jb6y.cjs +0 -1
  54. package/dist/index-CNZyrawL.cjs +0 -1
  55. package/dist/index-CWYl8R8Z.cjs +0 -1
  56. package/dist/index-DMcamypJ.cjs +0 -1
  57. package/dist/index-DiRp2gT0.cjs +0 -1
  58. package/dist/index-Dl_vrtf5.cjs +0 -1
  59. package/dist/index-hsD4_RoH.cjs +0 -1
  60. package/dist/index-jNlKGITs.js +0 -4369
  61. package/dist/index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-ooefAkbS.cjs +0 -1
  62. package/dist/menuIndex-BUbnVBfn.cjs +0 -1
  63. package/dist/menuIndex-w5mHOEmH.js +0 -60
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./menu-DYsWoy6Z.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;
@@ -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-Qw1eGtzq.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
+ };
@@ -1,8 +1,8 @@
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-QCZigjx6.js";
2
+ import { m as ie, a as me, b as de } from "./index-Bq9zvPYq.js";
3
3
  import { p as E, s as ee, c as k, u as ye } from "./menu-Qw1eGtzq.js";
4
4
  import { u as te } from "./modelComp-y7HaQuVQ.js";
5
- import { g as fe } from "./index-jNlKGITs.js";
5
+ import { g as fe } from "./index-DFdkXYtv.js";
6
6
  import { e as ge, a as he } from "./array-wJSGLzMi.js";
7
7
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const x = [
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-CaYc-fdU.cjs"),u=require("./menu-DYsWoy6Z.cjs"),G=require("./modelComp-8s0tWZDU.cjs"),Z=require("./index-BYIt5bNH.cjs"),K=require("./array-mnEYd91h.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-BmX_GIIO.cjs"),u=require("./menu-DYsWoy6Z.cjs"),G=require("./modelComp-8s0tWZDU.cjs"),Z=require("./index-B-P2iW5F.cjs"),K=require("./array-mnEYd91h.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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),p=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DXFzvQ4G.cjs");require("./menu-DYsWoy6Z.cjs");const s=require("./ss-component2.cjs"),o=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-BcnpB9rQ.cjs")));o.install=e=>{e.component("ssComponent",o)};const t=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DQm7DvqZ.cjs")).then(e=>e.index$1));t.install=e=>{e.component("ssTab",t)};const r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-thv0_1C7.cjs")));r.install=e=>{e.component("ssMenu",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CWYl8R8Z.cjs")));i.install=e=>{e.component("ssMenuComponent",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-RFCzxTjm.cjs")));c.install=e=>{e.component("ssCanvas",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-C31XRLFj.cjs")));l.install=e=>{e.component("ssFold",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Dr_FFxuS.cjs")));m.install=e=>{e.component("ssAvatar",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-DQIGp3UU.cjs")));u.install=e=>{e.component("ssThree",u)};const v=[o,t,r,i,c,l,m,u],d=e=>{v.forEach(a=>{e.use(a)}),e.use(s),e.config.globalProperties.$router=s};exports.SvgIcon=p.SvgIcon;exports.router=s;exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),p=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DXFzvQ4G.cjs");require("./menu-DYsWoy6Z.cjs");const s=require("./ss-component2.cjs"),o=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-CBruCFMa.cjs")));o.install=e=>{e.component("ssComponent",o)};const t=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DQm7DvqZ.cjs")).then(e=>e.index$1));t.install=e=>{e.component("ssTab",t)};const r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DSsJ2-ii.cjs")));r.install=e=>{e.component("ssMenu",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-R71UAxtE.cjs")));i.install=e=>{e.component("ssMenuComponent",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-RFCzxTjm.cjs")));c.install=e=>{e.component("ssCanvas",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-C31XRLFj.cjs")));l.install=e=>{e.component("ssFold",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Dr_FFxuS.cjs")));m.install=e=>{e.component("ssAvatar",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-DQIGp3UU.cjs")));u.install=e=>{e.component("ssThree",u)};const v=[o,t,r,i,c,l,m,u],d=e=>{v.forEach(a=>{e.use(a)}),e.use(s),e.config.globalProperties.$router=s};exports.SvgIcon=p.SvgIcon;exports.router=s;exports.default=d;