ss-component-new 1.1.138 → 1.1.151
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/{array-0IshmkQJ.cjs → array-C09NLiVl.cjs} +1 -1
- package/dist/{array-CIJ8dGq6.js → array-CqhTXR28.js} +7 -7
- package/dist/{cloneDeep-DSQ_igXr.cjs → cloneDeep-B6Av9vYT.cjs} +1 -1
- package/dist/{cloneDeep-C6YLa8ot.js → cloneDeep-Cm2ut66T.js} +1 -1
- package/dist/{index-YBnh4kpP.cjs → index-1TcDjOsz.cjs} +1 -1
- package/dist/{index-CKd6wtQl.js → index-BH36LQch.js} +1 -1
- package/dist/{index-BgEwgHeR.js → index-BHjs6gMr.js} +2 -2
- package/dist/{index-TZz_Myyq.js → index-BQK2DuaH.js} +9 -9
- package/dist/{index-B1C1v_Px.cjs → index-BUkyNn3m.cjs} +1 -1
- package/dist/{index-BJrnQHML.cjs → index-BZaGIyxe.cjs} +1 -1
- package/dist/{index-Ct6IzfTx.cjs → index-BaSc02sA.cjs} +2 -2
- package/dist/{index-5Glr7sEl.js → index-Bel0p329.js} +63 -63
- package/dist/{index-CCbUHfbR.cjs → index-BgY5srT7.cjs} +1 -1
- package/dist/{index-3X2JdNo3.js → index-BlNU-ya_.js} +5 -5
- package/dist/{index-Oe1ZKXjI.cjs → index-C1sMNKRi.cjs} +1 -1
- package/dist/{index-BCI7q3f5.js → index-C8mv9PET.js} +6 -6
- package/dist/{index-VRCCBuFY.cjs → index-CMue5Zek.cjs} +1 -1
- package/dist/{index-CEAr7g_x.js → index-C_Ek6N_z.js} +4 -4
- package/dist/{index-CKncyBT-.cjs → index-CcxZZo6K.cjs} +1 -1
- package/dist/{index-9LI1e9ga.cjs → index-Ch7zPabE.cjs} +1 -1
- package/dist/{index-BYjjDHvu.js → index-Ckrm7F4u.js} +1 -1
- package/dist/{index-CocT3ngV.cjs → index-CsK9LWak.cjs} +1 -1
- package/dist/{index-CQkg-hee.js → index-CtTbyHOu.js} +6 -6
- package/dist/{index-B3mpQLb3.cjs → index-Cxz9ADeg.cjs} +1 -1
- package/dist/{index-LtlDJOqV.cjs → index-Cy23PxmQ.cjs} +1 -1
- package/dist/{index-BLO1N_mc.js → index-D-6CVrZh.js} +1 -1
- package/dist/{index-DMju3RK4.cjs → index-D9hjyDNL.cjs} +1 -1
- package/dist/{index-DEcbAdpA.js → index-DORM2j0-.js} +6 -6
- package/dist/{index-9m8ZOeUK.cjs → index-DXQEaxeL.cjs} +1 -1
- package/dist/{index-C1RaRVSs.js → index-D_JFO4Ed.js} +7 -7
- package/dist/{index-C0SnH4hf.js → index-DcuEMWMM.js} +5 -5
- package/dist/{index-DQQnRSg0.cjs → index-DjlDuRvf.cjs} +1 -1
- package/dist/{index-Y34BMuQP.js → index-DoHr_nug.js} +563 -556
- package/dist/{index-B_9tujT0.js → index-DqOy9nnX.js} +4 -4
- package/dist/{index-BN2Hps6w.js → index-DyhHmlGD.js} +1 -1
- package/dist/{index-Czll01_l.js → index-GvkFEReE.js} +4 -4
- package/dist/{index-vw96Xii2.cjs → index-LX4uBOi3.cjs} +1 -1
- package/dist/{index-K3sFnD_E.js → index-Nb7mXZOf.js} +3 -3
- package/dist/{index-DBBXJzQJ.js → index-ODNyDte9.js} +5 -5
- package/dist/{index-BKClglfP.cjs → index-YajCTD4A.cjs} +1 -1
- package/dist/index-dm-zOhNm.cjs +1 -0
- package/dist/{index-B0cttYFm.cjs → index-wsyih2HQ.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-CGnBsRzb.cjs → index.vue_vue_type_script_setup_true_lang-ClNwGHXE.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-BumUFbn-.js → index.vue_vue_type_script_setup_true_lang-CuQ3xcyC.js} +2 -2
- package/dist/index.vue_vue_type_style_index_0_scoped_baf99455_lang-FY_pjpOg.js +478 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_baf99455_lang-W4auoQ9V.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-CGR-OZOc.js → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-BAlbShP-.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-BQkPy1iT.cjs → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-ClRL5aRq.cjs} +1 -1
- package/dist/{login-CnN_NEU_.js → login-DnBDEGHt.js} +2 -2
- package/dist/{login-BDuusNHG.cjs → login-aDjal4KC.cjs} +1 -1
- package/dist/{main-Ceoo-qQr.cjs → main-ChEDt98s.cjs} +1 -1
- package/dist/{main-ni3OdUUB.js → main-Do8E5J_V.js} +4 -4
- package/dist/{request-CJPeGqdv.cjs → request-BId7xEpo.cjs} +1 -1
- package/dist/{request-51putk3Q.js → request-RC5ET7Nr.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +6 -6
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/package.json +1 -1
- package/dist/index-DO49JF8z.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_baf99455_lang-0EhkIvBa.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_baf99455_lang-CFgYenw6.js +0 -460
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as y, p } from "./index-
|
|
2
|
-
import { u as D } from "./login-
|
|
1
|
+
import { g as y, p } from "./index-BH36LQch.js";
|
|
2
|
+
import { u as D } from "./login-DnBDEGHt.js";
|
|
3
3
|
import { u as K } from "./menu-XcYMZJLY.js";
|
|
4
|
-
import { E as g } from "./request-
|
|
4
|
+
import { E as g } from "./request-RC5ET7Nr.js";
|
|
5
5
|
const I = K(p), l = D(p), h = () => {
|
|
6
6
|
const S = y({
|
|
7
7
|
key: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as T, reactive as I, onMounted as R, watch as A, nextTick as M, resolveComponent as c, createElementBlock as C, openBlock as p, Fragment as D, createElementVNode as d, createVNode as s, withCtx as a, toDisplayString as h, renderList as N, createBlock as E, createTextVNode as g } from "vue";
|
|
2
|
-
import { s as F } from "./index-
|
|
3
|
-
import { s as K } from "./index-
|
|
4
|
-
import { S as y } from "./index-
|
|
2
|
+
import { s as F } from "./index-DoHr_nug.js";
|
|
3
|
+
import { s as K } from "./index-Bel0p329.js";
|
|
4
|
+
import { S as y } from "./index-GvkFEReE.js";
|
|
5
5
|
import { u as P, s as b } from "./menu-XcYMZJLY.js";
|
|
6
6
|
import { u as U } from "./modelComp-CP-waker.js";
|
|
7
7
|
import { useRoute as O } from "vue-router";
|
|
8
|
-
import { g as q } from "./index-
|
|
9
|
-
import { c as x } from "./cloneDeep-
|
|
8
|
+
import { g as q } from "./index-BH36LQch.js";
|
|
9
|
+
import { c as x } from "./cloneDeep-Cm2ut66T.js";
|
|
10
10
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const L = { class: "role-wrapper" }, Q = { class: "role-dialog-header" }, W = { class: "node-text" }, j = { class: "dialog-footer" }, H = /* @__PURE__ */ T({
|
|
12
12
|
__name: "index",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-ClRL5aRq.cjs"),e=require("vue"),c=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function l(n,i,a,p,_,M){const t=e.resolveComponent("DynamicIcon"),s=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(s,{menuList:n.renderMenuList,onClickMenu:n.clickMenu,onOpenMenu:n.openMenu,onCloseMenu:n.closeMenu,onChangeMenuStyle:n.changeMenuStyle,class:"menuList-wrap"},{title:e.withCtx(({menu:o})=>[e.createVNode(t,{name:o.icon??""},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(o.title??""),1)]),_:1},8,["menuList","onClickMenu","onOpenMenu","onCloseMenu","onChangeMenuStyle"])}const r=c._export_sfc(u._sfc_main,[["render",l],["__scopeId","data-v-bbb8ace9"]]);exports.default=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("vue"),$=require("./index-DjlDuRvf.cjs"),We=require("./index-BUkyNn3m.cjs"),L=require("./index-BaSc02sA.cjs"),D=require("./cloneDeep-B6Av9vYT.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),G=require("./menu-CxtX8L48.cjs"),Ge={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:Number,default:200}},setup(t){const c=t,e=n.ref(null),l=n.ref(!1),a=n.ref(null);return n.watch(()=>c==null?void 0:c.isVisible,()=>{l.value=c==null?void 0:c.isVisible},{deep:!0,immediate:!0}),n.watch(()=>a.value,()=>{n.nextTick(()=>{var r,m;(m=(r=e.value)==null?void 0:r.updatePopper)==null||m.call(r)})},{deep:!0,immediate:!0}),(r,m)=>{const y=n.resolveComponent("el-popover");return n.openBlock(),n.createBlock(y,{visible:l.value,placement:"bottom",title:c==null?void 0:c.title,width:c==null?void 0:c.width,ref_key:"popOverRef",ref:e},{reference:n.withCtx(()=>[n.createElementVNode("div",null,[n.renderSlot(r.$slots,"reference",{ref_key:"referenceRef",ref:a})])]),default:n.withCtx(()=>[n.createElementVNode("div",null,[n.renderSlot(r.$slots,"content")])]),_:3},8,["visible","title","width"])}}},J=n.ref(0),ee=t=>(J.value++,t==null?void 0:t.map(e=>Array.isArray(e)?ee(e):{label:(e==null?void 0:e.label)??"",prop:(e==null?void 0:e.label)==="操作"?"operate":(e==null?void 0:e.prop)??"a"+J.value,width:(e==null?void 0:e.label)==="操作"?"160":e!=null&&e.width?parseInt(e.width):"",fixed:(e==null?void 0:e.fixed)??void 0,sortable:(e==null?void 0:e.sortable)??!1,align:(e==null?void 0:e.align)??"center",showOverflowTooltip:(e==null?void 0:e.showOverflowTooltip)??!0,isNotDrag:(e==null?void 0:e.isNotDrag)??!1,isEditCol:(e==null?void 0:e.isEditCol)??!1,isOperate:(e==null?void 0:e.isOperate)??!1,id:(e==null?void 0:e.id)??J.value,type:(e==null?void 0:e.label)==="操作"?"operate":void 0,formType:(e==null?void 0:e.formType)??"",isHidden:e==null?void 0:e.isHidden,options:(e==null?void 0:e.options)??[],children:ee(e.children)??void 0})),Je=t=>{const c=[];function e(l){if(Array.isArray(l))for(const a of l)!a.children||a.children.length===0?c.push(a):e(a.children)}return e(t),c},Ee=t=>D.cloneDeep(t).map(e=>(Array.isArray(e)&&(e=e.map(l=>(Array.isArray(l)?l=ee(l):(l={label:(l==null?void 0:l.label)??"",prop:(l==null?void 0:l.label)==="操作"?"operate":(l==null?void 0:l.prop)??"a"+J.value,width:(l==null?void 0:l.label)==="操作"?"160":l!=null&&l.width?parseInt(l.width):"",fixed:(l==null?void 0:l.fixed)??void 0,sortable:(l==null?void 0:l.sortable)??!1,align:(l==null?void 0:l.align)??"center",showOverflowTooltip:(l==null?void 0:l.showOverflowTooltip)??!0,isNotDrag:(l==null?void 0:l.isNotDrag)??!1,isEditCol:(l==null?void 0:l.isEditCol)??!1,isOperate:(l==null?void 0:l.isOperate)??!1,id:(l==null?void 0:l.id)??J.value,type:(l==null?void 0:l.label)==="操作"?"operate":void 0,formType:(l==null?void 0:l.formType)??"",isHidden:l==null?void 0:l.isHidden,options:(l==null?void 0:l.options)??[],children:ee(l.children)},J.value++),l))),e)),Ne=t=>{function c(e,l=[]){if(!e||e.length===0)return[];let a=l;return e==null||e.forEach(r=>{var m;r!=null&&r.children&&((m=r.children)==null?void 0:m.length)>0?a=c(r==null?void 0:r.children,a):a.push(r)}),a}return c(t)},Qe={class:"extra-button-content"},Xe={key:0,class:"extra-header"},Ye=["onClick"],Ze={class:"extra-button-filter"},Ke={class:"form-content-value"},Le={__name:"header",props:{buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(t,{emit:c}){const e=c,l=t,a=n.ref(!1),r=n.ref([]),m=n.ref([{label:"取消"},{label:"确认"}]),y=T=>{e("buttonClick",T)},w=T=>{var F,N;r.value=(N=(F=Ne(D.cloneDeep(T)))==null?void 0:F.filter(g=>(g==null?void 0:g.label)!==""&&(g==null?void 0:g.label)!=="操作"))==null?void 0:N.map(g=>({label:(g==null?void 0:g.label)??"",value:"",name:(g==null?void 0:g.prop)??"",isFormColHidden:g==null?void 0:g.isTableColHidden}))},A=T=>{a.value=!1};return n.onMounted(()=>{w(l.columns)}),n.watch(()=>l.columns,()=>{w(l.columns)},{deep:!0,immediate:!0}),(T,F)=>{var g;const N=n.resolveComponent("el-tooltip");return n.openBlock(),n.createElementBlock("div",Qe,[l!=null&&l.buttons&&((g=l==null?void 0:l.buttons)==null?void 0:g.length)>0?(n.openBlock(),n.createElementBlock("div",Xe,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l==null?void 0:l.buttons,(_,H)=>(n.openBlock(),n.createElementBlock("div",{class:"extra-contents",key:H},[n.createElementVNode("div",{class:"extra-content",style:n.normalizeStyle({background:(_==null?void 0:_.background)??"var(--ssComponent-primary-color)",color:"var(--system-bg)"}),onClick:k=>y(_==null?void 0:_.label)},n.toDisplayString(_==null?void 0:_.label),13,Ye)]))),128))])):n.createCommentVNode("",!0),n.createElementVNode("div",Ze,[n.createVNode(Ge,{title:"筛选数据",width:500,isVisible:a.value},{reference:n.withCtx(()=>[n.createVNode(N,{content:"筛选",placement:"top-start"},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"button-style",onClick:F[0]||(F[0]=_=>a.value=!a.value)},[n.createVNode(n.unref(We.filter_default))])]),_:1})]),content:n.withCtx(()=>[n.createElementVNode("div",Ke,[(n.openBlock(),n.createBlock(L.ssForm,{rowContents:r.value,buttonValue:m.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:m.value,isStartJustify:!1,onOnButtonClick:A},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])])])}}},el=Be._export_sfc(Le,[["__scopeId","data-v-699600c9"]]),Oe=G.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(t){this.selectArray=t},setSelectString(t){this.selectString=t}}}),Ve=G.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(t){this.selectIndex=t},setSelectMenu(t){this.selectMenu=t},setSelectTitle(t){this.selectTitle=t}}}),Fe=(t,c)=>{let e=t,l=c;return Array.isArray(e)&&(e=e==null?void 0:e.map((a,r)=>{if(Array.isArray(a)){let m={};return a=a==null?void 0:a.forEach((y,w)=>{var A;(A=l==null?void 0:l[w])!=null&&A.prop?m[l[w].prop]=y:Array.isArray(y)&&(m.children=Fe(y,l))}),Object.assign(m,{id:r})}else return a})),e},Se=(t,c,e)=>{let l=t,a=c;return l=l==null?void 0:l.map((r,m)=>{var y,w;return!Array.isArray(r)||!((y=a==null?void 0:a[m])!=null&&y.label)&&!e||(r.unshift(((w=a==null?void 0:a[m])==null?void 0:w.label)??""),r.some(A=>Array.isArray(A))&&(r=r==null?void 0:r.map(A=>{var T;return Array.isArray(A)&&(A=Se(A,(T=a==null?void 0:a[m])==null?void 0:T.children,e)),A}))),r}),l},ll=(t,c,e)=>{if(c==="")return t==null?void 0:t.filter(l=>(l==null?void 0:l.id)!==e);{const l=c.split("-");return nl(t,l,e)}},nl=(t,c,e)=>{let l=t,a=c;return(a==null?void 0:a.length)===0?l=l==null?void 0:l.filter(r=>r.id!==e):l=l==null?void 0:l.map(r=>(r.id.toString()===(a==null?void 0:a[0])&&(a==null||a.shift(),r=Ie(r,a,e)),r)),l},Ie=(t,c,e)=>{var r,m;let l=t,a=c;return(a==null?void 0:a.length)===0?l.children=(r=l.children)==null?void 0:r.filter(y=>y.id!==e):l.children=(m=l.children)==null?void 0:m.map(y=>(y.id.toString()===(a==null?void 0:a[0])&&(a==null||a.shift(),y=Ie(y,a,e)),y)),l},al=(t,c,e)=>{if(c==="")return e;{const l=c.split("-");return ol(t,l,e)}},ol=(t,c,e)=>{let l=t,a=c;return(a==null?void 0:a.length)===0?l=e:l=l==null?void 0:l.map(r=>(r.id.toString()===(a==null?void 0:a[0])&&(a==null||a.shift(),r=He(r,a,e)),r)),l},He=(t,c,e)=>{var r;let l=t,a=c;return(a==null?void 0:a.length)===0?l.children=e:l.children=(r=l.children)==null?void 0:r.map(m=>(m.id.toString()===(a==null?void 0:a[0])&&(a==null||a.shift(),m=He(m,a,e)),m)),l},je=async(t,c,e="")=>{var T,F,N,g,_,H;const l=await $.getInsofDataApi({key:{pageKey:t,systemKey:c,parentTable:e}}),a=await $.getInsofDataApi({key:{pageKey:t,systemKey:c,type:"structureMethod"}}),r=(T=l.data.result)==null?void 0:T.map(k=>k.id),m=r==null?void 0:r.map(k=>$.getInsofDataApi({key:{pageKey:t,systemKey:c,tableId:k}})),y=await Promise.all(m),w=[];y==null||y.forEach(k=>{var I,R,O,M;const S=(I=k.data.result)==null?void 0:I.map(Y=>{const V=Y.value.tableData;return V.unshift({id:Y.id}),V}),W=(M=(O=(R=k.data.result)==null?void 0:R[0])==null?void 0:O.key)==null?void 0:M.tableId;w.push({key:W,contents:S})});const A=[];return(F=l.data.result)==null||F.forEach(k=>{var I,R;const S=k.value.pageData,W=D.cloneDeep(S.compData);if(W.push({key:"tableContents",contents:(I=w==null?void 0:w.find(O=>(O==null?void 0:O.key)===k.id))==null?void 0:I.contents}),S.compData=W,S.id=k.id,((R=k.key)==null?void 0:R.type)!=="method")A.push(S);else{let O;O={name:"",compData:[S],comp:"calculator"},A.push(O)}}),((g=(N=a.data.result)==null?void 0:N.map(k=>k.value.pageData))==null?void 0:g.filter(k=>Object.values(k).length>0).length)>0&&A.push({comp:"methodButton",name:"",compData:(H=(_=a.data.result)==null?void 0:_.map(k=>k.value.pageData))==null?void 0:H.filter(k=>Object.values(k).length>0)}),A},il=async t=>{await $.deleteInsofDataApi({id:t})},rl=async(t,c,e,l,a)=>{await $.createInsofDataApi({key:{type:t,pageKey:c,tableId:e,systemKey:l},value:{tableData:a}})},sl=async(t,c,e,l,a,r)=>{await $.updateInsofDataApi({key:{type:t,pageKey:c,tableId:e,systemKey:a},value:{tableData:r},id:l})},tl={class:"table-content"},cl=["onClick"],dl={class:"form-content"},ul={key:0,class:"dialog-footer"},fl={__name:"index",props:{itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}}},emits:["change","contentChange","onButtonClick","contentClick","pageChange"],setup(t,{emit:c}){const e=t,l=c,a=n.ref([]),r=G.useMenuState(),{activeMenuPath:m}=G.storeToRefs(r),y=n.ref([]),w=n.ref("");n.ref();const A=n.ref(!0),T=n.ref(0),F=n.ref(!1),N=n.ref(""),g=n.ref(!1),_=n.ref([]),H=n.ref(!1),k=n.ref([]),S=n.ref([]),W=n.ref(),I=n.ref(),R=Oe($.pinia),O=n.ref(),M=Ve($.pinia),{selectIndex:Y,selectMenu:V,selectTitle:le}=G.storeToRefs(M),{selectString:q}=G.storeToRefs(R),$e=n.ref(720),Re=()=>{g.value=!1},Me=async o=>{var C,h,p,s,b,x,Q;let f=await je(m.value,sessionStorage.getItem("systemKey"),o.id);if(f=f==null?void 0:f.filter(P=>P.comp!=="methodButton"),f&&f.length>0){const P=!Array.isArray(le.value)&&((C=le.value)==null?void 0:C.key)!=="main"?[]:le.value;P.push({key:V.value===""?(h=o==null?void 0:o.id)==null?void 0:h.toString():V.value+"-"+((p=o==null?void 0:o.id)==null?void 0:p.toString()),value:o[(s=Object.keys(o))==null?void 0:s.filter(X=>X!=="index"&&X!=="id")[0]]}),M.setSelectMenu(V.value===""?(b=o==null?void 0:o.id)==null?void 0:b.toString():V.value+"-"+((x=o==null?void 0:o.id)==null?void 0:x.toString())),M.setSelectTitle(P),M.setSelectIndex((Q=o==null?void 0:o.id)==null?void 0:Q.toString()),l("pageChange",f)}},ie=o=>{var C;const f=(C=D.cloneDeep(e.itemData))==null?void 0:C.map(h=>((h==null?void 0:h.key)==="tableContents"&&(h.contents=o),h));l("contentChange",{contents:f,index:e.index})},qe=(o,f,C)=>{l("contentClick",o,f,C,{id:e==null?void 0:e.index})};n.watch(()=>e.changedContent,()=>{var C,h;if(!e.changedContent)return;let o=(C=y.value)==null?void 0:C.map(p=>{var s;return p.id===((s=e.changedContent)==null?void 0:s.id)&&(p={...e.changedContent,id:e.changedContent.newId?e.changedContent.newId:e.changedContent.id},delete p.newId),p});const f=(h=e.itemData)==null?void 0:h.map(p=>((p==null?void 0:p.key)==="tableContents"&&(p.contents=o),p));y.value=o,console.log(133,e.changedContent,o),l("contentChange",{contents:f,index:e.index}),l("change",{content:o,index:e==null?void 0:e.index,buttonName:"",id:e==null?void 0:e.index})},{deep:!0,immediate:!0});const ne=(o,f)=>{var C;if(w.value="",H.value=!0,A.value=!0,l("onButtonClick",o,f),o==="删除"){y.value=(C=D.cloneDeep(y.value))==null?void 0:C.filter(p=>(p==null?void 0:p.id)!==(f==null?void 0:f.id));const h=ll(O.value,V.value,f==null?void 0:f.id);ie(h),l("change",{content:y.value,singleContent:f,index:e==null?void 0:e.index,type:"delete",buttonName:o})}else o==="新增"?(N.value="新增",ae(""),g.value=!0):o==="编辑"?(N.value="编辑",ae(f),g.value=!0):o==="查看"&&(N.value="查看",ae(f),H.value=!1,A.value=!1,g.value=!0)},ae=o=>{var h,p;const f=[];let C=[];for(let s in o)Array.isArray(o==null?void 0:o[s])&&C.push(s);(p=Ne((h=D.cloneDeep(a.value))==null?void 0:h.filter(s=>(s==null?void 0:s.label)!=="操作")))==null||p.forEach((s,b)=>{C.find(x=>x===(s==null?void 0:s.prop))||f.push({label:(s==null?void 0:s.label)??"",name:(s==null?void 0:s.prop)??"t"+b,type:!(s!=null&&s.formType)||(s==null?void 0:s.formType)===""?"Input":s==null?void 0:s.formType,value:(o==null?void 0:o[s==null?void 0:s.prop])??"",id:(s==null?void 0:s.id)??b,contents:(s==null?void 0:s.options)??[],width:1,isFormColHidden:s==null?void 0:s.isFormColHidden})}),o===""||!o||(w.value=o==null?void 0:o.id),S.value=f};n.onMounted(()=>{});const Pe=()=>{let o,f=D.cloneDeep(y.value);w.value===""?(T.value++,f.push(Object.assign(I.value,{id:T.value})),o=Object.assign(I.value,{id:T.value})):f=f==null?void 0:f.map(h=>((h==null?void 0:h.id)===w.value&&(h=Object.assign(h,I.value),o=h),h)),y.value=f;const C=al(O.value,V.value,f);ie(C),g.value=!1,l("change",{content:C,singleContent:o,index:e==null?void 0:e.index,buttonName:N.value})},ze=o=>{I.value=o};return n.watch(()=>[e.itemData,q.value,Y.value,V.value],()=>{var Q,P,X,re,se,te,ce,de,ue,fe,pe,he,ye,ge,be,me,Ce,ke,De,Ae,we,_e,Te;const o=(Q=D.cloneDeep(e.itemData))==null?void 0:Q.filter(d=>(d==null?void 0:d.key)==="header");(P=D.cloneDeep(e.itemData))==null||P.filter(d=>(d==null?void 0:d.key)==="tableIndexColumn")[0];const f=(X=D.cloneDeep(e.itemData))==null?void 0:X.find(d=>(d==null?void 0:d.key)==="page"),C=(re=D.cloneDeep(e.itemData))==null?void 0:re.find(d=>(d==null?void 0:d.key)==="rowButton"),h=(se=D.cloneDeep(e.itemData))==null?void 0:se.find(d=>(d==null?void 0:d.key)==="extraButton"),p=(te=D.cloneDeep(e.itemData))==null?void 0:te.filter(d=>(d==null?void 0:d.key)==="tableContents"),s=(ce=D.cloneDeep(e.itemData))==null?void 0:ce.filter(d=>(d==null?void 0:d.key)==="tableIndex");F.value=(f==null?void 0:f.contents)??!0;let b=[];q.value===""?b=o==null?void 0:o[0]:b=(o==null?void 0:o.find(d=>(d==null?void 0:d.selectLabel)==="("+q.value+")"))??(o==null?void 0:o.find(d=>!(d!=null&&d.selectLabel)));let x=[];if(q.value===""?x=s==null?void 0:s[0]:x=(s==null?void 0:s.find(d=>(d==null?void 0:d.selectLabel)==="("+q.value+")"))??(s==null?void 0:s.find(d=>!(d!=null&&d.selectLabel))),((de=b==null?void 0:b.contents)==null?void 0:de.length)>0){let d=[];if(b!=null&&b.contents.some(u=>Array.isArray(u)&&(u==null?void 0:u.find(i=>i.children))))V.value===""?d=(fe=(ue=Ee(D.cloneDeep(b==null?void 0:b.contents)))==null?void 0:ue[0])==null?void 0:fe.filter(u=>!Array.isArray(u)):(V.value.split("-"),d=(pe=Ee(D.cloneDeep(b==null?void 0:b.contents)))==null?void 0:pe[0]);else{const u=b!=null&&b.contents.some(i=>Array.isArray(i))?(he=b==null?void 0:b.contents)==null?void 0:he[0]:b==null?void 0:b.contents;u==null||u.forEach((i,E)=>{d.push({label:(i==null?void 0:i.label)??"",prop:(i==null?void 0:i.label)==="操作"?"operate":(i==null?void 0:i.prop)??"a"+E,width:(i==null?void 0:i.label)==="操作"?"160":i!=null&&i.width?parseInt(i.width):"",fixed:(i==null?void 0:i.fixed)??void 0,sortable:(i==null?void 0:i.sortable)??!1,align:(i==null?void 0:i.align)??"center",showOverflowTooltip:(i==null?void 0:i.showOverflowTooltip)??!0,isNotDrag:(i==null?void 0:i.isNotDrag)??!1,isEditCol:(i==null?void 0:i.isEditCol)??!1,isOperate:(i==null?void 0:i.isOperate)??!1,id:(i==null?void 0:i.id)??E,type:(i==null?void 0:i.label)==="操作"?"operate":void 0,formType:(i==null?void 0:i.formType)??"",isTableColHidden:i==null?void 0:i.isTableColHidden,isFormColHidden:i==null?void 0:i.isFormColHidden,options:(i==null?void 0:i.options)??[]})})}a.value=d;let j=(ge=(ye=Je(D.cloneDeep(a.value)))==null?void 0:ye.filter(u=>(u==null?void 0:u.type)!=="operate"))==null?void 0:ge.map((u,i)=>({prop:(u==null?void 0:u.prop)??"a"+i}));W.value=j;let v=[];q.value===""?v=p==null?void 0:p[0]:v=(p==null?void 0:p.find(u=>(u==null?void 0:u.selectLabel)==="("+q.value+")"))??(p==null?void 0:p.find(u=>!(u!=null&&u.selectLabel)));let z=Array.isArray((be=v==null?void 0:v.contents)==null?void 0:be[0])&&((me=v==null?void 0:v.contents)!=null&&me[0].every(u=>Array.isArray(u)))?(Ce=D.cloneDeep(v==null?void 0:v.contents))==null?void 0:Ce[0]:D.cloneDeep(v==null?void 0:v.contents);x!=null&&x.contents&&((ke=x==null?void 0:x.contents)==null?void 0:ke.length)!==0&&(z=(De=D.cloneDeep(z))==null?void 0:De.map((u,i)=>{if(!Array.isArray(u)){let E={};for(let U in u)U!=="id"&&U!=="index"&&(E[U]=u[U]);u=Object.values(E)}return u}));const Ue=!!((Ae=a.value)!=null&&Ae.find(u=>u.prop==="index"));z=Se(D.cloneDeep(z),x==null?void 0:x.contents,Ue);const Z=[];z==null||z.forEach((u,i)=>{var U;let E={};Array.isArray(u)?u==null||u.filter(B=>!B.id).forEach((B,K)=>{var xe,ve;(xe=j==null?void 0:j[K])!=null&&xe.prop&&!Array.isArray(B)?E[j[K].prop]=B:Array.isArray(B)&&(B.find(oe=>(oe==null?void 0:oe.key)==="tableContentName")&&((ve=j[K])!=null&&ve.prop)?E[j[K].prop]=B:E.children=Fe(B,j))}):E=u,Array.isArray(u)&&u.some(B=>B==null?void 0:B.id)?Z.push(Object.assign(E,{id:(U=u==null?void 0:u.find(B=>B.id))==null?void 0:U.id})):E.id?Z.push(E):Z.push(Object.assign(E,{id:i}))}),y.value=Z}else a.value=[],y.value=[];((we=C==null?void 0:C.contents)==null?void 0:we.length)>0?_.value=C==null?void 0:C.contents:_.value=[],((_e=h==null?void 0:h.contents)==null?void 0:_e.length)>0?k.value=h==null?void 0:h.contents:k.value=[],T.value=((Te=y==null?void 0:y.value)==null?void 0:Te.length)??0,O.value=y.value},{deep:!0,immediate:!0}),(o,f)=>{var C;return n.openBlock(),n.createElementBlock("div",tl,[(n.openBlock(),n.createBlock(L.ssTable,{columns:a.value,key:a.value,tableData:y.value,isShowPagination:F.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:Me,extraButton:k.value,onButtonClick:f[1]||(f[1]=h=>ne(h,"")),onContentClick:qe},n.createSlots({headerButton:n.withCtx(h=>[n.createVNode(el,{buttons:h.buttons,onButtonClick:f[0]||(f[0]=p=>ne(p,"")),columns:a.value},null,8,["buttons","columns"])]),_:2},[((C=_.value)==null?void 0:C.length)>0?{name:"actions",fn:n.withCtx(({item:h})=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,(p,s)=>(n.openBlock(),n.createElementBlock("div",{key:s},[n.createElementVNode("div",{style:n.normalizeStyle({color:p==null?void 0:p.textColor}),class:"extra-button-label",onClick:b=>ne(p==null?void 0:p.label,h)},n.toDisplayString(p==null?void 0:p.label),13,cl)]))),128))]),key:"0"}:void 0]),1032,["columns","tableData","isShowPagination","extraButton"])),n.createVNode(L.ssDialog,{title:N.value,visible:g.value,width:$e.value,onBeforeDestroy:Re},{default:n.withCtx(()=>[n.createElementVNode("div",dl,[n.createVNode(L.ssForm,{rowContents:S.value,isEnableWrap:!1,onChange:ze,isEdit:A.value},null,8,["rowContents","isEdit"])])]),footer:n.withCtx(()=>[H.value?(n.openBlock(),n.createElementBlock("div",ul,[n.createElementVNode("div",{onClick:f[2]||(f[2]=h=>g.value=!1),class:"cancel-button"},n.toDisplayString("取消")),n.createElementVNode("div",{class:"ok-button",onClick:Pe},n.toDisplayString("确认"))])):n.createCommentVNode("",!0)]),_:1},8,["title","visible","width"])])}}},pl=Be._export_sfc(fl,[["__scopeId","data-v-4958c395"]]);exports.addTableContents=rl;exports.deleteTableContents=il;exports.fixTableContents=sl;exports.getItemData=je;exports.ssTable=pl;exports.useFormToTableComp=Oe;exports.useUnit=Ve;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const u=require("vue"),x=require("./index-
|
|
1
|
+
"use strict";const u=require("vue"),x=require("./index-BUkyNn3m.cjs"),xe=require("./isNil-x28vo2CT.cjs"),ht=require("./request-BId7xEpo.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),De="ElUpload";class Ee extends Error{constructor(t,i,e,n){super(t),this.name="UploadAjaxError",this.status=i,this.method=e,this.url=n}}function Vt(a,t,i){let e;return i.response?e=`${i.response.error||i.response}`:i.responseText?e=`${i.responseText}`:e=`fail to ${t.method} ${a} ${i.status}`,new Ee(e,i.status,t.method,a)}function Ce(a){const t=a.responseText||a.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}const Me=a=>{typeof XMLHttpRequest>"u"&&x.throwError(De,"XMLHttpRequest is undefined");const t=new XMLHttpRequest,i=a.action;t.upload&&t.upload.addEventListener("progress",r=>{const o=r;o.percent=r.total>0?r.loaded/r.total*100:0,a.onProgress(o)});const e=new FormData;if(a.data)for(const[r,o]of Object.entries(a.data))x.isArray$1(o)&&o.length?e.append(r,...o):e.append(r,o);e.append(a.filename,a.file,a.file.name),t.addEventListener("error",()=>{a.onError(Vt(i,a,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return a.onError(Vt(i,a,t));a.onSuccess(Ce(t))}),t.open(a.method,i,!0),a.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const n=a.headers||{};if(n instanceof Headers)n.forEach((r,o)=>t.setRequestHeader(o,r));else for(const[r,o]of Object.entries(n))xe.isNil(o)||t.setRequestHeader(r,String(o));return t.send(e),t},Ne=["text","picture","picture-card"];let Te=1;const Oe=()=>Date.now()+Te++,Ie=x.buildProps({action:{type:String,default:"#"},headers:{type:x.definePropType(Object)},method:{type:String,default:"post"},data:{type:x.definePropType([Object,Function,Promise]),default:()=>ht.mutable({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:x.definePropType(Array),default:()=>ht.mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:Ne,default:"text"},httpRequest:{type:x.definePropType(Function),default:Me},disabled:Boolean,limit:Number});x.buildProps({...Ie,beforeUpload:{type:x.definePropType(Function),default:x.NOOP},beforeRemove:{type:x.definePropType(Function)},onRemove:{type:x.definePropType(Function),default:x.NOOP},onChange:{type:x.definePropType(Function),default:x.NOOP},onPreview:{type:x.definePropType(Function),default:x.NOOP},onSuccess:{type:x.definePropType(Function),default:x.NOOP},onProgress:{type:x.definePropType(Function),default:x.NOOP},onError:{type:x.definePropType(Function),default:x.NOOP},onExceed:{type:x.definePropType(Function),default:x.NOOP},crossorigin:{type:x.definePropType(String)}});/*!
|
|
2
2
|
* Cropper.js v1.6.2
|
|
3
3
|
* https://fengyuanchen.github.io/cropperjs
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),i=require("./index-wsyih2HQ.cjs"),g=require("./request-BId7xEpo.cjs"),v=e.defineComponent({__name:"index",props:{value:String,isEdit:{type:Boolean,default:!0}},emits:["submitImage"],setup(u,{emit:c}){const a={upload:"/api/sysFile/uploadAvatar",delete:"/api/sysFile/delete"},l=c,m=e.computed(()=>"http://139.196.154.85:20013"),d=async r=>{var s,o,n;try{const t=await i.uploadAvatarApi(a==null?void 0:a.upload,r);if(((s=t==null?void 0:t.data)==null?void 0:s.code)===200){const p=m.value+"/"+((n=(o=t.data)==null?void 0:o.result)==null?void 0:n.url);l("submitImage",p)}}catch(t){g.ElMessage.error(t)}};return(r,s)=>(e.openBlock(),e.createBlock(i.Avatar,{apiUrl:a,onSubmitImage:d,onDeleteImage:r.deleteImage},{avatarDefault:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1},8,["onDeleteImage"]))}});exports._sfc_main=v;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as p, computed as d, createBlock as g, openBlock as f, withCtx as v, createTextVNode as y, toDisplayString as I } from "vue";
|
|
2
|
-
import { A as _, u as A } from "./index-
|
|
3
|
-
import { E as b } from "./request-
|
|
2
|
+
import { A as _, u as A } from "./index-BHjs6gMr.js";
|
|
3
|
+
import { E as b } from "./request-RC5ET7Nr.js";
|
|
4
4
|
const D = /* @__PURE__ */ p({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { ref as re } from "vue";
|
|
2
|
+
import { c as C, g as N, u as F, d as ne, p as se } from "./index-BH36LQch.js";
|
|
3
|
+
import { s as ye, u as oe } from "./menu-XcYMZJLY.js";
|
|
4
|
+
import { u as ce } from "./login-DnBDEGHt.js";
|
|
5
|
+
import { d as Y } from "./array-CqhTXR28.js";
|
|
6
|
+
import { c as m } from "./cloneDeep-Cm2ut66T.js";
|
|
7
|
+
import { g as le } from "./crypto-BRyGpjGR.js";
|
|
8
|
+
re([]);
|
|
9
|
+
const B = (o) => {
|
|
10
|
+
var t, s, c, f;
|
|
11
|
+
const a = o;
|
|
12
|
+
let r = [];
|
|
13
|
+
a.compData = (t = a.compData) == null ? void 0 : t.filter((n) => (n == null ? void 0 : n.key) !== "tableContents" && (n == null ? void 0 : n.key) !== "tableIndex");
|
|
14
|
+
const e = (c = (s = m(a.compData)) == null ? void 0 : s.find((n) => (n == null ? void 0 : n.key) === "tableIndexColumn")) == null ? void 0 : c.contents;
|
|
15
|
+
return (f = m(a.compData)) == null || f.forEach((n) => {
|
|
16
|
+
if ((n == null ? void 0 : n.key) !== "tableIndexColumn" && (n == null ? void 0 : n.key) !== "header")
|
|
17
|
+
r.push(n);
|
|
18
|
+
else if ((n == null ? void 0 : n.key) === "header") {
|
|
19
|
+
let l = n.contents;
|
|
20
|
+
e && (l != null && l.every((y) => Array.isArray(y)) ? l == null || l[0].unshift({ label: e }) : l.unshift({ label: e })), r.push({
|
|
21
|
+
key: "header",
|
|
22
|
+
contents: l
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}), a.compData = r, a;
|
|
26
|
+
}, J = (o) => {
|
|
27
|
+
var s, c, f, n, l;
|
|
28
|
+
const a = (s = o.compData) == null ? void 0 : s.filter((y) => (y == null ? void 0 : y.key) === "tableContents" || (y == null ? void 0 : y.key) === "tableIndex"), r = (f = (c = a == null ? void 0 : a.find((y) => (y == null ? void 0 : y.key) === "tableIndex")) == null ? void 0 : c.contents) == null ? void 0 : f.map((y) => y.label), e = (n = a == null ? void 0 : a.find((y) => (y == null ? void 0 : y.key) === "tableContents")) == null ? void 0 : n.contents;
|
|
29
|
+
let t = [];
|
|
30
|
+
return (r == null ? void 0 : r.length) > 0 && (e != null && e.every((y) => Array.isArray(y))) ? t = r == null ? void 0 : r.map((y, g) => e[g] ? [y, ...e[g]] : [y]) : Array.isArray(e == null ? void 0 : e[0]) && ((l = e == null ? void 0 : e[0]) != null && l.every((y) => Array.isArray(y))) ? t = e == null ? void 0 : e[0] : Array.isArray(e == null ? void 0 : e[0]) ? t = e : t.push(e), t;
|
|
31
|
+
}, pe = (o) => {
|
|
32
|
+
const a = [];
|
|
33
|
+
function r(e) {
|
|
34
|
+
!e || e.length === 0 || (a.push(e == null ? void 0 : e.map((t) => ({ label: t.label }))), e == null || e.forEach((t) => {
|
|
35
|
+
t != null && t.children && (t == null ? void 0 : t.children.length) > 0 && r(t == null ? void 0 : t.children);
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
return r(o), a;
|
|
39
|
+
}, ie = (o) => {
|
|
40
|
+
const a = [];
|
|
41
|
+
function r(e, t = []) {
|
|
42
|
+
!e || e.length === 0 || (a.push({
|
|
43
|
+
key: t == null ? void 0 : t.filter((s) => !Array.isArray(s)),
|
|
44
|
+
value: e
|
|
45
|
+
}), e == null || e.forEach((s) => {
|
|
46
|
+
s != null && s.some((c) => Array.isArray(c)) && r(s.find((c) => Array.isArray(c)), s);
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
return r(o), a;
|
|
50
|
+
}, ue = (o) => {
|
|
51
|
+
const a = [];
|
|
52
|
+
function r(e) {
|
|
53
|
+
!e || e.length === 0 || (a.push(e == null ? void 0 : e.map((t) => t == null ? void 0 : t.filter((s) => !Array.isArray(s)))), e == null || e.forEach((t) => {
|
|
54
|
+
t != null && t.some((s) => Array.isArray(s)) && r(t.find((s) => Array.isArray(s)));
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
return r(o), a;
|
|
58
|
+
}, fe = (o) => {
|
|
59
|
+
const a = [];
|
|
60
|
+
function r(e) {
|
|
61
|
+
var t;
|
|
62
|
+
!e || e.length === 0 || (e != null && e.every((s) => !Array.isArray(s)) ? a.push(e) : (a.push((t = e == null ? void 0 : e.map((s) => s == null ? void 0 : s.filter((c) => !Array.isArray(c)))) == null ? void 0 : t[0]), e == null || e.forEach((s) => {
|
|
63
|
+
s != null && s.some((c) => Array.isArray(c)) && r(s.find((c) => Array.isArray(c)));
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
return r(o), a;
|
|
67
|
+
}, ge = (o, a) => {
|
|
68
|
+
let r;
|
|
69
|
+
function e(t, s, c = 1) {
|
|
70
|
+
var n;
|
|
71
|
+
if (!t || t.length === 0) return;
|
|
72
|
+
const f = (n = m(s)) == null ? void 0 : n.map((l) => l == null ? void 0 : l.filter((y) => !Array.isArray(y)));
|
|
73
|
+
return f != null && f.find((l) => Y(l, t == null ? void 0 : t.key)) ? (s == null || s.forEach((l) => {
|
|
74
|
+
!e(t, l.find((g) => Array.isArray(g))) && Y(l.filter((g) => !Array.isArray(g)), t == null ? void 0 : t.key) && (r = {
|
|
75
|
+
type: c,
|
|
76
|
+
contents: l.filter((g) => !Array.isArray(g))
|
|
77
|
+
});
|
|
78
|
+
}), !0) : !1;
|
|
79
|
+
}
|
|
80
|
+
return e(o, a, 0), r;
|
|
81
|
+
}, Z = (o, a) => {
|
|
82
|
+
function r(e, t) {
|
|
83
|
+
return !e || e.length === 0 || e == null ? void 0 : e.map((c, f) => {
|
|
84
|
+
var l, y;
|
|
85
|
+
let n = c;
|
|
86
|
+
return n.unshift((l = t == null ? void 0 : t[f]) == null ? void 0 : l.label), n.some((g) => Array.isArray(g)) && (n[n.length - 1] = r(n.find((g) => Array.isArray(g)), (y = t == null ? void 0 : t[f]) == null ? void 0 : y.children)), n;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return r(o, a);
|
|
90
|
+
}, Q = (o) => {
|
|
91
|
+
var r, e, t, s, c, f, n, l, y, g, h, D, k, u, K, E, x, S, V, A, M, T, d, O, j;
|
|
92
|
+
const a = o;
|
|
93
|
+
if ((o == null ? void 0 : o.comp) === "Table") {
|
|
94
|
+
if ((t = (e = (r = o.compData) == null ? void 0 : r.find((p) => (p == null ? void 0 : p.key) === "tableIndex")) == null ? void 0 : e.contents) != null && t.every((p) => !(p != null && p.children)) || !((s = o.compData) != null && s.find((p) => (p == null ? void 0 : p.key) === "tableIndex")))
|
|
95
|
+
return ((n = (f = (c = a.compData) == null ? void 0 : c.find((p) => (p == null ? void 0 : p.key) === "tableContents")) == null ? void 0 : f.contents) == null ? void 0 : n.length) === 1 && ((h = (g = (y = (l = a.compData) == null ? void 0 : l.find((p) => (p == null ? void 0 : p.key) === "tableContents")) == null ? void 0 : y.contents) == null ? void 0 : g[0]) != null && h.every((p) => Array.isArray(p))) ? (a.compData = (D = a.compData) == null ? void 0 : D.map((p) => {
|
|
96
|
+
var b;
|
|
97
|
+
return (p == null ? void 0 : p.key) === "tableContents" && (p.contents = (b = p.contents) == null ? void 0 : b[0]), p;
|
|
98
|
+
}), [a]) : [a];
|
|
99
|
+
{
|
|
100
|
+
let p = [];
|
|
101
|
+
const b = a.compData, z = (k = m(b)) == null ? void 0 : k.find((i) => (i == null ? void 0 : i.key) === "tableIndexColumn"), P = (u = m(b)) == null ? void 0 : u.find((i) => (i == null ? void 0 : i.key) === "extraButton"), G = (K = m(b)) == null ? void 0 : K.find((i) => (i == null ? void 0 : i.key) === "rowButton"), w = fe((x = (E = m(b)) == null ? void 0 : E.find((i) => (i == null ? void 0 : i.key) === "header")) == null ? void 0 : x.contents), U = (S = m(b)) == null ? void 0 : S.find((i) => (i == null ? void 0 : i.key) === "tableIndex"), ee = ue((A = (V = m(b)) == null ? void 0 : V.find((i) => (i == null ? void 0 : i.key) === "tableContents")) == null ? void 0 : A.contents), ae = Z((T = (M = m(b)) == null ? void 0 : M.find((i) => (i == null ? void 0 : i.key) === "tableContents")) == null ? void 0 : T.contents, U == null ? void 0 : U.contents), te = ie(Z((O = (d = m(b)) == null ? void 0 : d.find((i) => (i == null ? void 0 : i.key) === "tableContents")) == null ? void 0 : O.contents, U == null ? void 0 : U.contents));
|
|
102
|
+
if (U)
|
|
103
|
+
return (j = pe(U.contents)) == null || j.forEach((i, q) => {
|
|
104
|
+
var X;
|
|
105
|
+
let L = [];
|
|
106
|
+
L.push({
|
|
107
|
+
key: "tableIndex",
|
|
108
|
+
contents: i
|
|
109
|
+
}), L.push(z), L.push(P), L.push(G), L.push({
|
|
110
|
+
key: "tableContents",
|
|
111
|
+
contents: ee[q]
|
|
112
|
+
}), L.push({
|
|
113
|
+
key: "header",
|
|
114
|
+
contents: w != null && w[q] ? [w == null ? void 0 : w[q]] : [w == null ? void 0 : w[0]]
|
|
115
|
+
}), p.push({
|
|
116
|
+
comp: "Table",
|
|
117
|
+
compData: L,
|
|
118
|
+
name: "",
|
|
119
|
+
parentTableContents: ((X = ge(te[q], ae)) == null ? void 0 : X.contents) ?? ""
|
|
120
|
+
});
|
|
121
|
+
}), p;
|
|
122
|
+
}
|
|
123
|
+
} else
|
|
124
|
+
return [a];
|
|
125
|
+
}, _ = async (o) => {
|
|
126
|
+
let a = [];
|
|
127
|
+
o == null || o.forEach((r) => {
|
|
128
|
+
var e;
|
|
129
|
+
(e = r.compData) == null || e.forEach((t) => {
|
|
130
|
+
var s;
|
|
131
|
+
(s = t.contents) == null || s.forEach((c) => {
|
|
132
|
+
var f;
|
|
133
|
+
Array.isArray(c) ? c == null || c.forEach((n) => {
|
|
134
|
+
var l;
|
|
135
|
+
(l = Q(m(n))) == null || l.forEach(async (y) => {
|
|
136
|
+
var g, h, D, k;
|
|
137
|
+
if (n.comp === "Table") {
|
|
138
|
+
const u = await C({
|
|
139
|
+
key: {
|
|
140
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
141
|
+
pageKey: r.name,
|
|
142
|
+
type: "structure",
|
|
143
|
+
version: 1,
|
|
144
|
+
parentTable: (y == null ? void 0 : y.parentTableContents) ?? ""
|
|
145
|
+
},
|
|
146
|
+
value: {
|
|
147
|
+
pageData: {
|
|
148
|
+
comp: (g = B(m(y))) == null ? void 0 : g.comp,
|
|
149
|
+
compData: (h = B(m(y))) == null ? void 0 : h.compData,
|
|
150
|
+
name: (D = B(m(y))) == null ? void 0 : D.name
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}), K = u.data.result, E = (k = J(m(y))) == null ? void 0 : k.map(async (x) => {
|
|
154
|
+
var M;
|
|
155
|
+
const S = await C({
|
|
156
|
+
key: {
|
|
157
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
158
|
+
pageKey: r.name,
|
|
159
|
+
type: "data",
|
|
160
|
+
tableId: K
|
|
161
|
+
},
|
|
162
|
+
value: {
|
|
163
|
+
tableData: x
|
|
164
|
+
}
|
|
165
|
+
}), A = await ((M = (await N({
|
|
166
|
+
key: {
|
|
167
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
168
|
+
pageKey: r.name,
|
|
169
|
+
type: "structure",
|
|
170
|
+
parentTable: x
|
|
171
|
+
}
|
|
172
|
+
})).data.result) == null ? void 0 : M.map(async (T) => await F({
|
|
173
|
+
id: T.id,
|
|
174
|
+
key: {
|
|
175
|
+
systemKey: T.key.systemKey,
|
|
176
|
+
pageKey: T.key.pageKey,
|
|
177
|
+
type: T.key.type,
|
|
178
|
+
version: T.key.version,
|
|
179
|
+
parentTable: S.data.result
|
|
180
|
+
}
|
|
181
|
+
})));
|
|
182
|
+
return a.push(A), S;
|
|
183
|
+
});
|
|
184
|
+
a.push(u), a.push(E);
|
|
185
|
+
} else if ((y == null ? void 0 : y.key) === "extraButton") {
|
|
186
|
+
const u = await C({
|
|
187
|
+
key: {
|
|
188
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
189
|
+
pageKey: r.name,
|
|
190
|
+
type: "structureMethod",
|
|
191
|
+
version: 1
|
|
192
|
+
},
|
|
193
|
+
value: {
|
|
194
|
+
pageData: y.value
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
a.push(u);
|
|
198
|
+
} else {
|
|
199
|
+
const u = await C({
|
|
200
|
+
key: {
|
|
201
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
202
|
+
pageKey: r.name,
|
|
203
|
+
type: "structure",
|
|
204
|
+
version: 1,
|
|
205
|
+
parentTable: (y == null ? void 0 : y.parentTableContents) ?? ""
|
|
206
|
+
},
|
|
207
|
+
value: {
|
|
208
|
+
pageData: y
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
a.push(u);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}) : (f = Q(m(c))) == null || f.forEach(async (n) => {
|
|
215
|
+
var l, y, g, h;
|
|
216
|
+
if (c.comp === "Table") {
|
|
217
|
+
const D = await C({
|
|
218
|
+
key: {
|
|
219
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
220
|
+
pageKey: r.name,
|
|
221
|
+
type: "structure",
|
|
222
|
+
version: 1,
|
|
223
|
+
parentTable: (n == null ? void 0 : n.parentTableContents) ?? ""
|
|
224
|
+
},
|
|
225
|
+
value: {
|
|
226
|
+
pageData: {
|
|
227
|
+
comp: (l = B(m(n))) == null ? void 0 : l.comp,
|
|
228
|
+
compData: (y = B(m(n))) == null ? void 0 : y.compData,
|
|
229
|
+
name: (g = B(m(n))) == null ? void 0 : g.name
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}), k = D.data.result, u = (h = J(m(n))) == null ? void 0 : h.map(async (K) => {
|
|
233
|
+
var V;
|
|
234
|
+
const E = await C({
|
|
235
|
+
key: {
|
|
236
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
237
|
+
pageKey: r.name,
|
|
238
|
+
type: "data",
|
|
239
|
+
tableId: k
|
|
240
|
+
},
|
|
241
|
+
value: {
|
|
242
|
+
tableData: K
|
|
243
|
+
}
|
|
244
|
+
}), S = await ((V = (await N({
|
|
245
|
+
key: {
|
|
246
|
+
parentTable: K,
|
|
247
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
248
|
+
pageKey: r.name,
|
|
249
|
+
type: "structure"
|
|
250
|
+
}
|
|
251
|
+
})).data.result) == null ? void 0 : V.map(async (A) => await F({
|
|
252
|
+
id: A.id,
|
|
253
|
+
key: {
|
|
254
|
+
systemKey: A.key.systemKey,
|
|
255
|
+
pageKey: A.key.pageKey,
|
|
256
|
+
type: A.key.type,
|
|
257
|
+
version: A.key.version,
|
|
258
|
+
parentTable: E.data.result
|
|
259
|
+
}
|
|
260
|
+
})));
|
|
261
|
+
return a.push(S), E;
|
|
262
|
+
});
|
|
263
|
+
a.push(D), a.push(u);
|
|
264
|
+
} else if ((n == null ? void 0 : n.key) === "extraButton") {
|
|
265
|
+
const D = await C({
|
|
266
|
+
key: {
|
|
267
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
268
|
+
pageKey: r.name,
|
|
269
|
+
type: "structureMethod",
|
|
270
|
+
version: 1
|
|
271
|
+
},
|
|
272
|
+
value: {
|
|
273
|
+
pageData: n.value
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
a.push(D);
|
|
277
|
+
} else {
|
|
278
|
+
const D = await C({
|
|
279
|
+
key: {
|
|
280
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
281
|
+
pageKey: r.name,
|
|
282
|
+
type: "structure",
|
|
283
|
+
version: 1,
|
|
284
|
+
parentTable: (n == null ? void 0 : n.parentTableContents) ?? ""
|
|
285
|
+
},
|
|
286
|
+
value: {
|
|
287
|
+
pageData: n
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
a.push(D);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
}), await Promise.all(a);
|
|
296
|
+
}, $ = async (o) => {
|
|
297
|
+
let a = [];
|
|
298
|
+
o == null || o.forEach((r) => {
|
|
299
|
+
var e;
|
|
300
|
+
(e = r.compData) == null || e.forEach((t) => {
|
|
301
|
+
var s;
|
|
302
|
+
(s = t.contents) == null || s.forEach((c) => {
|
|
303
|
+
var n, l, y, g;
|
|
304
|
+
const f = (l = (n = c == null ? void 0 : c.compData) == null ? void 0 : n.find((h) => (h == null ? void 0 : h.key) === "extra")) == null ? void 0 : l.value;
|
|
305
|
+
(g = (y = c.compData) == null ? void 0 : y.filter((h) => (h == null ? void 0 : h.key) !== "extra")) == null || g.forEach((h) => {
|
|
306
|
+
var D;
|
|
307
|
+
(D = Q(m(h))) == null || D.forEach(async (k) => {
|
|
308
|
+
var u, K, E, x, S, V, A, M;
|
|
309
|
+
if (k.comp === "Table") {
|
|
310
|
+
const T = await C({
|
|
311
|
+
key: {
|
|
312
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
313
|
+
pageKey: r.name,
|
|
314
|
+
type: "method",
|
|
315
|
+
version: 1,
|
|
316
|
+
methodName: (E = (u = r.name) == null ? void 0 : u.split("/")) == null ? void 0 : E[((K = r.name) == null ? void 0 : K.split("/").length) - 1],
|
|
317
|
+
methodKey: (x = Object.values(f[0])) == null ? void 0 : x[0],
|
|
318
|
+
parentTable: (k == null ? void 0 : k.parentTableContents) ?? ""
|
|
319
|
+
},
|
|
320
|
+
value: {
|
|
321
|
+
pageData: {
|
|
322
|
+
comp: (S = B(m(k))) == null ? void 0 : S.comp,
|
|
323
|
+
compData: (V = B(m(k))) == null ? void 0 : V.compData,
|
|
324
|
+
name: (A = B(m(k))) == null ? void 0 : A.name
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}), d = T.data.result, O = (M = J(m(k))) == null ? void 0 : M.map(async (j) => {
|
|
328
|
+
var P, G;
|
|
329
|
+
const p = await C({
|
|
330
|
+
key: {
|
|
331
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
332
|
+
pageKey: r.name,
|
|
333
|
+
type: "methodData",
|
|
334
|
+
methodKey: (P = Object.values(f[0])) == null ? void 0 : P[0],
|
|
335
|
+
tableId: d
|
|
336
|
+
},
|
|
337
|
+
value: {
|
|
338
|
+
tableData: j
|
|
339
|
+
}
|
|
340
|
+
}), z = (G = (await N({
|
|
341
|
+
key: {
|
|
342
|
+
parentTable: j,
|
|
343
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
344
|
+
pageKey: r.name,
|
|
345
|
+
type: "method"
|
|
346
|
+
}
|
|
347
|
+
})).data.result) == null ? void 0 : G.map(async (w) => await F({
|
|
348
|
+
id: w.id,
|
|
349
|
+
key: {
|
|
350
|
+
systemKey: w.key.systemKey,
|
|
351
|
+
pageKey: w.key.pageKey,
|
|
352
|
+
type: w.key.type,
|
|
353
|
+
methodKey: w.key.methodKey,
|
|
354
|
+
parentTable: p.data.result
|
|
355
|
+
}
|
|
356
|
+
}));
|
|
357
|
+
return a.push(z), p;
|
|
358
|
+
});
|
|
359
|
+
a.push(T), a.push(O);
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}), await Promise.all(a);
|
|
366
|
+
}, he = ce(se), { isStructureExist: me } = ye(he), De = oe(), W = (o) => o == null ? void 0 : o.map((a) => (a.contents && (a.contents = a.contents.filter((r) => {
|
|
367
|
+
var e;
|
|
368
|
+
return ((e = r.comp) == null ? void 0 : e.toUpperCase()) !== "CALCULATOR";
|
|
369
|
+
})), a.compData && (a.compData = W(a.compData)), a)), I = (o) => o == null ? void 0 : o.map((a) => (a.contents && (a.contents = a.contents.filter((r) => {
|
|
370
|
+
var e;
|
|
371
|
+
return ((e = r.comp) == null ? void 0 : e.toUpperCase()) === "CALCULATOR";
|
|
372
|
+
})), a.compData && (a.compData = I(a.compData)), a)), R = (o) => {
|
|
373
|
+
const a = I(o);
|
|
374
|
+
let r = [];
|
|
375
|
+
return a == null || a.forEach((e) => {
|
|
376
|
+
var t;
|
|
377
|
+
(t = e.compData) != null && t.find((s) => {
|
|
378
|
+
var c;
|
|
379
|
+
return (c = s == null ? void 0 : s.contents) == null ? void 0 : c.find((f) => (f == null ? void 0 : f.comp) === "calculator");
|
|
380
|
+
}) && r.push(e);
|
|
381
|
+
}), r;
|
|
382
|
+
}, H = async (o) => {
|
|
383
|
+
var a, r, e, t;
|
|
384
|
+
try {
|
|
385
|
+
const s = await C({
|
|
386
|
+
key: {
|
|
387
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
388
|
+
pageKey: "menu",
|
|
389
|
+
type: "structure"
|
|
390
|
+
},
|
|
391
|
+
value: {
|
|
392
|
+
pageData: o
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
if (((a = s == null ? void 0 : s.data) == null ? void 0 : a.code) === 200) {
|
|
396
|
+
const c = (e = (r = o == null ? void 0 : o.compData) == null ? void 0 : r[0]) == null ? void 0 : e.contents;
|
|
397
|
+
De.setRawMenus(c ?? []);
|
|
398
|
+
}
|
|
399
|
+
return (t = s == null ? void 0 : s.data) == null ? void 0 : t.code;
|
|
400
|
+
} catch (s) {
|
|
401
|
+
return Promise.reject(s);
|
|
402
|
+
}
|
|
403
|
+
}, Ke = async () => {
|
|
404
|
+
var s, c, f, n, l, y;
|
|
405
|
+
const o = N({
|
|
406
|
+
key: {
|
|
407
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
408
|
+
pageKey: "menu"
|
|
409
|
+
}
|
|
410
|
+
}), a = N({
|
|
411
|
+
key: {
|
|
412
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
413
|
+
type: "structure"
|
|
414
|
+
}
|
|
415
|
+
}), r = await Promise.all([o, a]), e = r == null ? void 0 : r[0], t = r == null ? void 0 : r[1];
|
|
416
|
+
return {
|
|
417
|
+
menuExist: ((s = e == null ? void 0 : e.data) == null ? void 0 : s.result) && ((f = (c = e == null ? void 0 : e.data) == null ? void 0 : c.result) == null ? void 0 : f.length) > 0,
|
|
418
|
+
structureExist: ((n = t == null ? void 0 : t.data) == null ? void 0 : n.result) && ((y = (l = t == null ? void 0 : t.data) == null ? void 0 : l.result) == null ? void 0 : y.length) > 0
|
|
419
|
+
};
|
|
420
|
+
}, v = async () => {
|
|
421
|
+
var o;
|
|
422
|
+
try {
|
|
423
|
+
const a = le(), r = await C({
|
|
424
|
+
key: {
|
|
425
|
+
systemKey: sessionStorage.getItem("systemKey"),
|
|
426
|
+
pageKey: "secret",
|
|
427
|
+
type: "system"
|
|
428
|
+
},
|
|
429
|
+
value: {
|
|
430
|
+
cryptoInfo: {
|
|
431
|
+
publicKey: a.publicKey,
|
|
432
|
+
privateKey: a.privateKey
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
return ((o = r == null ? void 0 : r.data) == null ? void 0 : o.code) === 200;
|
|
437
|
+
} catch (a) {
|
|
438
|
+
throw a;
|
|
439
|
+
}
|
|
440
|
+
}, Se = async (o) => {
|
|
441
|
+
var t, s, c, f, n, l;
|
|
442
|
+
const a = m(o);
|
|
443
|
+
console.log("savePageDataAsync", o, me.value);
|
|
444
|
+
const { menuExist: r, structureExist: e } = await Ke();
|
|
445
|
+
if (console.log("promises", r, e), sessionStorage.getItem("systemKey") && !r && !e) {
|
|
446
|
+
const y = (t = W(a)) == null ? void 0 : t.filter((h) => {
|
|
447
|
+
var D;
|
|
448
|
+
return ((D = h == null ? void 0 : h.comp) == null ? void 0 : D.toUpperCase()) !== "MENU";
|
|
449
|
+
}), g = a == null ? void 0 : a.find((h) => h.comp === "Menu");
|
|
450
|
+
await H(g), v(), await _(y), await $((s = R(m(o))) == null ? void 0 : s.filter((h) => {
|
|
451
|
+
var D;
|
|
452
|
+
return ((D = h == null ? void 0 : h.comp) == null ? void 0 : D.toUpperCase()) !== "MENU";
|
|
453
|
+
}));
|
|
454
|
+
} else {
|
|
455
|
+
const g = (f = (c = (await N({
|
|
456
|
+
key: {
|
|
457
|
+
systemKey: sessionStorage.getItem("systemKey")
|
|
458
|
+
}
|
|
459
|
+
})).data.result) == null ? void 0 : c.filter((u) => {
|
|
460
|
+
var K;
|
|
461
|
+
return ((K = u == null ? void 0 : u.key) == null ? void 0 : K.layer) !== "superAdmin";
|
|
462
|
+
})) == null ? void 0 : f.map((u) => u.id), h = g == null ? void 0 : g.map(async (u) => await ne({
|
|
463
|
+
id: u
|
|
464
|
+
}));
|
|
465
|
+
await Promise.all(h);
|
|
466
|
+
const D = (n = W(a)) == null ? void 0 : n.filter((u) => {
|
|
467
|
+
var K;
|
|
468
|
+
return ((K = u == null ? void 0 : u.comp) == null ? void 0 : K.toUpperCase()) !== "MENU";
|
|
469
|
+
}), k = a == null ? void 0 : a.find((u) => u.comp === "Menu");
|
|
470
|
+
await H(k), v(), await _(D), await $((l = R(m(o))) == null ? void 0 : l.filter((u) => {
|
|
471
|
+
var K;
|
|
472
|
+
return ((K = u == null ? void 0 : u.comp) == null ? void 0 : K.toUpperCase()) !== "MENU";
|
|
473
|
+
}));
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
export {
|
|
477
|
+
Se as s
|
|
478
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const te=require("vue"),K=require("./index-DjlDuRvf.cjs"),R=require("./menu-CxtX8L48.cjs"),ne=require("./login-aDjal4KC.cjs"),Q=require("./array-C09NLiVl.cjs"),h=require("./cloneDeep-B6Av9vYT.cjs"),re=require("./crypto-CRbcEKIz.cjs");te.ref([]);const q=y=>{var t,s,c,f;const a=y;let n=[];a.compData=(t=a.compData)==null?void 0:t.filter(r=>(r==null?void 0:r.key)!=="tableContents"&&(r==null?void 0:r.key)!=="tableIndex");const e=(c=(s=h.cloneDeep(a.compData))==null?void 0:s.find(r=>(r==null?void 0:r.key)==="tableIndexColumn"))==null?void 0:c.contents;return(f=h.cloneDeep(a.compData))==null||f.forEach(r=>{if((r==null?void 0:r.key)!=="tableIndexColumn"&&(r==null?void 0:r.key)!=="header")n.push(r);else if((r==null?void 0:r.key)==="header"){let p=r.contents;e&&(p!=null&&p.every(o=>Array.isArray(o))?p==null||p[0].unshift({label:e}):p.unshift({label:e})),n.push({key:"header",contents:p})}}),a.compData=n,a},G=y=>{var s,c,f,r,p;const a=(s=y.compData)==null?void 0:s.filter(o=>(o==null?void 0:o.key)==="tableContents"||(o==null?void 0:o.key)==="tableIndex"),n=(f=(c=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableIndex"))==null?void 0:c.contents)==null?void 0:f.map(o=>o.label),e=(r=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableContents"))==null?void 0:r.contents;let t=[];return(n==null?void 0:n.length)>0&&(e!=null&&e.every(o=>Array.isArray(o)))?t=n==null?void 0:n.map((o,D)=>e[D]?[o,...e[D]]:[o]):Array.isArray(e==null?void 0:e[0])&&((p=e==null?void 0:e[0])!=null&&p.every(o=>Array.isArray(o)))?t=e==null?void 0:e[0]:Array.isArray(e==null?void 0:e[0])?t=e:t.push(e),t},se=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>({label:t.label}))),e==null||e.forEach(t=>{t!=null&&t.children&&(t==null?void 0:t.children.length)>0&&n(t==null?void 0:t.children)}))}return n(y),a},oe=y=>{const a=[];function n(e,t=[]){!e||e.length===0||(a.push({key:t==null?void 0:t.filter(s=>!Array.isArray(s)),value:e}),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)),s)}))}return n(y),a},ye=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>t==null?void 0:t.filter(s=>!Array.isArray(s)))),e==null||e.forEach(t=>{t!=null&&t.some(s=>Array.isArray(s))&&n(t.find(s=>Array.isArray(s)))}))}return n(y),a},ce=y=>{const a=[];function n(e){var t;!e||e.length===0||(e!=null&&e.every(s=>!Array.isArray(s))?a.push(e):(a.push((t=e==null?void 0:e.map(s=>s==null?void 0:s.filter(c=>!Array.isArray(c))))==null?void 0:t[0]),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)))})))}return n(y),a},pe=(y,a)=>{let n;function e(t,s,c=1){var r;if(!t||t.length===0)return;const f=(r=h.cloneDeep(s))==null?void 0:r.map(p=>p==null?void 0:p.filter(o=>!Array.isArray(o)));return f!=null&&f.find(p=>Q.equalArrays(p,t==null?void 0:t.key))?(s==null||s.forEach(p=>{!e(t,p.find(D=>Array.isArray(D)))&&Q.equalArrays(p.filter(D=>!Array.isArray(D)),t==null?void 0:t.key)&&(n={type:c,contents:p.filter(D=>!Array.isArray(D))})}),!0):!1}return e(y,a,0),n},W=(y,a)=>{function n(e,t){return!e||e.length===0||e==null?void 0:e.map((c,f)=>{var p,o;let r=c;return r.unshift((p=t==null?void 0:t[f])==null?void 0:p.label),r.some(D=>Array.isArray(D))&&(r[r.length-1]=n(r.find(D=>Array.isArray(D)),(o=t==null?void 0:t[f])==null?void 0:o.children)),r})}return n(y,a)},z=y=>{var n,e,t,s,c,f,r,p,o,D,g,A,k,u,m,E,x,S,V,b,M,T,d,L,I;const a=y;if((y==null?void 0:y.comp)==="Table"){if((t=(e=(n=y.compData)==null?void 0:n.find(l=>(l==null?void 0:l.key)==="tableIndex"))==null?void 0:e.contents)!=null&&t.every(l=>!(l!=null&&l.children))||!((s=y.compData)!=null&&s.find(l=>(l==null?void 0:l.key)==="tableIndex")))return((r=(f=(c=a.compData)==null?void 0:c.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:r.length)===1&&((g=(D=(o=(p=a.compData)==null?void 0:p.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:D[0])!=null&&g.every(l=>Array.isArray(l)))?(a.compData=(A=a.compData)==null?void 0:A.map(l=>{var C;return(l==null?void 0:l.key)==="tableContents"&&(l.contents=(C=l.contents)==null?void 0:C[0]),l}),[a]):[a];{let l=[];const C=a.compData,O=(k=h.cloneDeep(C))==null?void 0:k.find(i=>(i==null?void 0:i.key)==="tableIndexColumn"),N=(u=h.cloneDeep(C))==null?void 0:u.find(i=>(i==null?void 0:i.key)==="extraButton"),P=(m=h.cloneDeep(C))==null?void 0:m.find(i=>(i==null?void 0:i.key)==="rowButton"),w=ce((x=(E=h.cloneDeep(C))==null?void 0:E.find(i=>(i==null?void 0:i.key)==="header"))==null?void 0:x.contents),U=(S=h.cloneDeep(C))==null?void 0:S.find(i=>(i==null?void 0:i.key)==="tableIndex"),v=ye((b=(V=h.cloneDeep(C))==null?void 0:V.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:b.contents),ee=W((T=(M=h.cloneDeep(C))==null?void 0:M.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:T.contents,U==null?void 0:U.contents),ae=oe(W((L=(d=h.cloneDeep(C))==null?void 0:d.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:L.contents,U==null?void 0:U.contents));if(U)return(I=se(U.contents))==null||I.forEach((i,j)=>{var J;let B=[];B.push({key:"tableIndex",contents:i}),B.push(O),B.push(N),B.push(P),B.push({key:"tableContents",contents:v[j]}),B.push({key:"header",contents:w!=null&&w[j]?[w==null?void 0:w[j]]:[w==null?void 0:w[0]]}),l.push({comp:"Table",compData:B,name:"",parentTableContents:((J=pe(ae[j],ee))==null?void 0:J.contents)??""})}),l}}else return[a]},X=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var f;Array.isArray(c)?c==null||c.forEach(r=>{var p;(p=z(h.cloneDeep(r)))==null||p.forEach(async o=>{var D,g,A,k;if(r.comp==="Table"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:{comp:(D=q(h.cloneDeep(o)))==null?void 0:D.comp,compData:(g=q(h.cloneDeep(o)))==null?void 0:g.compData,name:(A=q(h.cloneDeep(o)))==null?void 0:A.name}}}),m=u.data.result,E=(k=G(h.cloneDeep(o)))==null?void 0:k.map(async x=>{var M;const S=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:m},value:{tableData:x}}),b=await((M=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",parentTable:x}})).data.result)==null?void 0:M.map(async T=>await K.updateInsofDataApi({id:T.id,key:{systemKey:T.key.systemKey,pageKey:T.key.pageKey,type:T.key.type,version:T.key.version,parentTable:S.data.result}})));return a.push(b),S});a.push(u),a.push(E)}else if((o==null?void 0:o.key)==="extraButton"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:o.value}});a.push(u)}else{const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:o}});a.push(u)}})}):(f=z(h.cloneDeep(c)))==null||f.forEach(async r=>{var p,o,D,g;if(c.comp==="Table"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:{comp:(p=q(h.cloneDeep(r)))==null?void 0:p.comp,compData:(o=q(h.cloneDeep(r)))==null?void 0:o.compData,name:(D=q(h.cloneDeep(r)))==null?void 0:D.name}}}),k=A.data.result,u=(g=G(h.cloneDeep(r)))==null?void 0:g.map(async m=>{var V;const E=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:k},value:{tableData:m}}),S=await((V=(await K.getInsofDataApi({key:{parentTable:m,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure"}})).data.result)==null?void 0:V.map(async b=>await K.updateInsofDataApi({id:b.id,key:{systemKey:b.key.systemKey,pageKey:b.key.pageKey,type:b.key.type,version:b.key.version,parentTable:E.data.result}})));return a.push(S),E});a.push(A),a.push(u)}else if((r==null?void 0:r.key)==="extraButton"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:r.value}});a.push(A)}else{const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:r}});a.push(A)}})})})}),await Promise.all(a)},Y=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var r,p,o,D;const f=(p=(r=c==null?void 0:c.compData)==null?void 0:r.find(g=>(g==null?void 0:g.key)==="extra"))==null?void 0:p.value;(D=(o=c.compData)==null?void 0:o.filter(g=>(g==null?void 0:g.key)!=="extra"))==null||D.forEach(g=>{var A;(A=z(h.cloneDeep(g)))==null||A.forEach(async k=>{var u,m,E,x,S,V,b,M;if(k.comp==="Table"){const T=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method",version:1,methodName:(E=(u=n.name)==null?void 0:u.split("/"))==null?void 0:E[((m=n.name)==null?void 0:m.split("/").length)-1],methodKey:(x=Object.values(f[0]))==null?void 0:x[0],parentTable:(k==null?void 0:k.parentTableContents)??""},value:{pageData:{comp:(S=q(h.cloneDeep(k)))==null?void 0:S.comp,compData:(V=q(h.cloneDeep(k)))==null?void 0:V.compData,name:(b=q(h.cloneDeep(k)))==null?void 0:b.name}}}),d=T.data.result,L=(M=G(h.cloneDeep(k)))==null?void 0:M.map(async I=>{var N,P;const l=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"methodData",methodKey:(N=Object.values(f[0]))==null?void 0:N[0],tableId:d},value:{tableData:I}}),O=(P=(await K.getInsofDataApi({key:{parentTable:I,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method"}})).data.result)==null?void 0:P.map(async w=>await K.updateInsofDataApi({id:w.id,key:{systemKey:w.key.systemKey,pageKey:w.key.pageKey,type:w.key.type,methodKey:w.key.methodKey,parentTable:l.data.result}}));return a.push(O),l});a.push(T),a.push(L)}})})})})}),await Promise.all(a)},le=ne.useLoginState(K.pinia),{isStructureExist:ie}=R.storeToRefs(le),ue=R.useMenuState(),F=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())!=="CALCULATOR"})),a.compData&&(a.compData=F(a.compData)),a)),H=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())==="CALCULATOR"})),a.compData&&(a.compData=H(a.compData)),a)),Z=y=>{const a=H(y);let n=[];return a==null||a.forEach(e=>{var t;(t=e.compData)!=null&&t.find(s=>{var c;return(c=s==null?void 0:s.contents)==null?void 0:c.find(f=>(f==null?void 0:f.comp)==="calculator")})&&n.push(e)}),n},_=async y=>{var a,n,e,t;try{const s=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu",type:"structure"},value:{pageData:y}});if(((a=s==null?void 0:s.data)==null?void 0:a.code)===200){const c=(e=(n=y==null?void 0:y.compData)==null?void 0:n[0])==null?void 0:e.contents;ue.setRawMenus(c??[])}return(t=s==null?void 0:s.data)==null?void 0:t.code}catch(s){return Promise.reject(s)}},fe=async()=>{var s,c,f,r,p,o;const y=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),a=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),n=await Promise.all([y,a]),e=n==null?void 0:n[0],t=n==null?void 0:n[1];return{menuExist:((s=e==null?void 0:e.data)==null?void 0:s.result)&&((f=(c=e==null?void 0:e.data)==null?void 0:c.result)==null?void 0:f.length)>0,structureExist:((r=t==null?void 0:t.data)==null?void 0:r.result)&&((o=(p=t==null?void 0:t.data)==null?void 0:p.result)==null?void 0:o.length)>0}},$=async()=>{var y;try{const a=re.generateKeyPair(),n=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"},value:{cryptoInfo:{publicKey:a.publicKey,privateKey:a.privateKey}}});return((y=n==null?void 0:n.data)==null?void 0:y.code)===200}catch(a){throw a}},De=async y=>{var t,s,c,f,r,p;const a=h.cloneDeep(y);console.log("savePageDataAsync",y,ie.value);const{menuExist:n,structureExist:e}=await fe();if(console.log("promises",n,e),sessionStorage.getItem("systemKey")&&!n&&!e){const o=(t=F(a))==null?void 0:t.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}),D=a==null?void 0:a.find(g=>g.comp==="Menu");await _(D),$(),await X(o),await Y((s=Z(h.cloneDeep(y)))==null?void 0:s.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}))}else{const D=(f=(c=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.filter(u=>{var m;return((m=u==null?void 0:u.key)==null?void 0:m.layer)!=="superAdmin"}))==null?void 0:f.map(u=>u.id),g=D==null?void 0:D.map(async u=>await K.deleteInsofDataApi({id:u}));await Promise.all(g);const A=(r=F(a))==null?void 0:r.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}),k=a==null?void 0:a.find(u=>u.comp==="Menu");await _(k),$(),await X(A),await Y((p=Z(h.cloneDeep(y)))==null?void 0:p.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}))}};exports.savePageDataAsync=De;
|