ss-component-new 1.2.36 → 1.2.37
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/{MTLLoader-CkNQ5SUP.cjs → MTLLoader-Dihj5ymj.cjs} +1 -1
- package/dist/{MTLLoader-B4lJr_ku.js → MTLLoader-gxq5Kvds.js} +1 -1
- package/dist/{OrbitControls-CpTJa--7.cjs → OrbitControls-Ba8QWDQU.cjs} +1 -1
- package/dist/{OrbitControls-CwAfnF56.js → OrbitControls-BonUITsH.js} +1 -1
- package/dist/{animationData-CF6-_eBc.cjs → animationData-AAFCWE58.cjs} +1 -1
- package/dist/{animationData-ETdtTXwF.js → animationData-DOlVDTlo.js} +4 -4
- package/dist/{array-CbzJvO5y.cjs → array-Bvce3EAi.cjs} +1 -1
- package/dist/{array-BUiCaQsR.js → array-D7EDjc7l.js} +35 -35
- package/dist/config.js +2 -2
- package/dist/{dataUtil-DFkONpps.cjs → dataUtil-B98txAs6.cjs} +1 -1
- package/dist/{dataUtil-oabcbdyY.js → dataUtil-VNsK7cTO.js} +2 -2
- package/dist/{fileUtil-BezA0XEu.cjs → fileUtil-BeIaOSMH.cjs} +1 -1
- package/dist/{fileUtil-xUu_aleM.js → fileUtil-D7S_1Tde.js} +1 -1
- package/dist/{iconfont-Cj5twyUW.js → iconfont-Dnc_kFzN.js} +2 -2
- package/dist/{iconfont-Bc_5-mGm.cjs → iconfont-wtkqkYlV.cjs} +1 -1
- package/dist/{index-Cs1m0QHY.cjs → index-A2nYF-1f.cjs} +1 -1
- package/dist/{index-C-4KKbC7.js → index-B-xelo5W.js} +3 -3
- package/dist/{index-CkTqgfCV.js → index-B3sDwg_c.js} +1 -1
- package/dist/{index-LcSS6r-3.cjs → index-B8HWTwDz.cjs} +1 -1
- package/dist/{index-7jCqww1w.cjs → index-B8bUR1Ri.cjs} +1 -1
- package/dist/{index-B35gkDgD.js → index-BCLRJLSj.js} +1 -1
- package/dist/{index-CfKLvZ17.cjs → index-BJoRCnr3.cjs} +1 -1
- package/dist/{index-DKQfWQa7.js → index-BLTsYYci.js} +1 -1
- package/dist/{index-bFFymrtu.js → index-BMaVaPUc.js} +2 -2
- package/dist/{index-DK1sT-Gv.js → index-BPzUmT8-.js} +12 -12
- package/dist/{index-CnW0XyMI.cjs → index-BU5DWXf0.cjs} +1 -1
- package/dist/{index-B5KCSN4c.cjs → index-BbzUzdxF.cjs} +1 -1
- package/dist/{index-BnNI_rxz.js → index-BeawnQ97.js} +3 -3
- package/dist/{index-C_FC7JhD.js → index-BiNILQi8.js} +6 -6
- package/dist/{index-CvrlW6Kj.cjs → index-BiPzhKBB.cjs} +1 -1
- package/dist/{index-Bp59pdeu.js → index-BrvAeT7w.js} +10 -10
- package/dist/{index-BjLowWoy.js → index-BwoXi1LQ.js} +2 -2
- package/dist/index-C8qRkCgn.cjs +21 -0
- package/dist/{index-ixEWAWI8.js → index-CBpSEFvE.js} +4 -4
- package/dist/{index-BsQpRUkg.cjs → index-CCAXN_VF.cjs} +1 -1
- package/dist/{index-DBDeHECn.js → index-CExeGHij.js} +5410 -5111
- package/dist/{index-vDXPLbzt.cjs → index-CQNvplpY.cjs} +13 -13
- package/dist/{index-BntUSUuQ.cjs → index-CagsR3TK.cjs} +1 -1
- package/dist/{index-Bsj_M3tu.cjs → index-CeJI9fRM.cjs} +1 -1
- package/dist/{index-CUeHiWp_.js → index-ChfpFIIo.js} +52 -52
- package/dist/{index-GOk9tc6o.js → index-Cjn-Nipt.js} +2 -2
- package/dist/{index-BHkXSoxP.cjs → index-ClnJ1K8q.cjs} +1 -1
- package/dist/{index-DPLITXsJ.js → index-CqzA5JZV.js} +21 -21
- package/dist/{index-DbW_sD5N.cjs → index-Ct6AnOh0.cjs} +1 -1
- package/dist/{index-B3_Z46NG.cjs → index-Cv9MOPos.cjs} +1 -1
- package/dist/{index-BopRIRaa.js → index-D2FUUF0p.js} +3311 -3300
- package/dist/{index-bhZxftEb.js → index-D62RCkPJ.js} +6 -6
- package/dist/{index-CV-9wRXp.cjs → index-DATWIRSp.cjs} +1 -1
- package/dist/{index-RfA-XD5A.cjs → index-DBiP81co.cjs} +1 -1
- package/dist/{index-BahsZur-.cjs → index-DBpviAty.cjs} +1 -1
- package/dist/{index-CvI-Xndo.js → index-DHUPGceO.js} +1 -1
- package/dist/{index-CizvuDrT.cjs → index-DKnofcM3.cjs} +1 -1
- package/dist/{index-BA_mOmgl.js → index-DWR446SX.js} +40 -40
- package/dist/{index-CnasZ7DR.cjs → index-DXY5_0gS.cjs} +1 -1
- package/dist/{index-D4X5ZbsB.cjs → index-DcSxvtLy.cjs} +1 -1
- package/dist/{index-CcKVjgvm.js → index-DdWJf1s4.js} +2 -2
- package/dist/{index-DHOgfCKk.js → index-De7WEvrP.js} +6 -6
- package/dist/{index-Ci05kJVO.cjs → index-DeakNivq.cjs} +1 -1
- package/dist/{index-Bha2dAuG.cjs → index-DfdAKUNR.cjs} +1 -1
- package/dist/{index-w9_VhKWc.cjs → index-DpzDQdE3.cjs} +1 -1
- package/dist/{index-DynEv7dZ.cjs → index-Idro_h24.cjs} +1 -1
- package/dist/{index-CTIVfb14.js → index-K4IHDJhC.js} +3 -3
- package/dist/{index-BOfa3R-1.cjs → index-XPbPRVHs.cjs} +1 -1
- package/dist/{index-DalL4U6b.js → index-XWSpT0ba.js} +8 -8
- package/dist/{index-C8YYklCT.cjs → index-Z3NUprRN.cjs} +1 -1
- package/dist/{index-ExjSK4s1.cjs → index-a9MrfjsX.cjs} +1 -1
- package/dist/{index-CowSp0mU.js → index-d2eZUUOL.js} +4 -4
- package/dist/{index-BwL33eO2.js → index-dg2e5vzL.js} +2 -2
- package/dist/{index-CX9ZToOe.js → index-diSrIKAW.js} +303 -303
- package/dist/{index-BWDmAGYH.js → index-dz7-iyTs.js} +8 -8
- package/dist/{index-CWQAImyg.js → index-nvemkzcE.js} +2 -2
- package/dist/{index-h5XWazmL.cjs → index-osFjwxXn.cjs} +1 -1
- package/dist/{index-peUgec1X.js → index-rGGHn9oX.js} +1268 -1267
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BV1JZ-3O.js +38949 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DNHgx7h4.cjs +37 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CinJxfAX.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CTRnGkVw.js} +1649 -1644
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DNsyaAD5.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupRlL-E.cjs} +124 -124
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DTRpzofW.js → index.vue_vue_type_style_index_0_scoped_92477073_lang--woCJ_em.js} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DaxZVXAO.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-COe_Ck32.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_1_lang-6KO-EDQa.js +8293 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-BgqA98cE.cjs → index.vue_vue_type_style_index_1_lang-CKpfQuiD.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_1_lang-Cb4_k0AS.cjs +32 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-BX_Iweoa.js → index.vue_vue_type_style_index_1_lang-jt5oqPmv.js} +5 -5
- package/dist/{isString-D6Z6SOrb.cjs → isString--eJE54G5.cjs} +1 -1
- package/dist/{isString-DBnuELeA.js → isString-By6KKNvg.js} +1 -1
- package/dist/{main-BnGiV5RB.cjs → main-Brifss3R.cjs} +1 -1
- package/dist/{main-DHZFoZje.js → main-DENbrJLK.js} +5 -5
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/{threeModel-BkNMl4gC.js → threeModel-CpklGUZ5.js} +5 -5
- package/dist/{threeModel-BHsadPD8.cjs → threeModel-DxxkXyt5.cjs} +1 -1
- package/dist/{threePreview-BhHpGgi8.js → threePreview-BsPiIokT.js} +4 -4
- package/dist/{threePreview-q2XmhoL-.cjs → threePreview-Sh0ABsnX.cjs} +1 -1
- package/dist/{threeSceneView-D_2JHUdz.cjs → threeSceneView-DfiXbOBr.cjs} +1 -1
- package/dist/{threeSceneView-CDFoPU6x.js → threeSceneView-Dm3k49Mh.js} +87 -87
- package/dist/{threeSceneViewForCPMPIP-BBelwG21.js → threeSceneViewForCPMPIP-Czp3KJaA.js} +57 -57
- package/dist/{threeSceneViewForCPMPIP-DSIkOvjL.cjs → threeSceneViewForCPMPIP-XTc0zag-.cjs} +1 -1
- package/dist/{threeTrackPathView-CeCre9ru.js → threeTrackPathView-DaEDYBsf.js} +6 -6
- package/dist/{threeTrackPathView-CClVyd1p.cjs → threeTrackPathView-Dmp5NZVO.cjs} +1 -1
- package/dist/{threeViewerHost-B2ROtL1I.cjs → threeViewerHost-C07FM01K.cjs} +1 -1
- package/dist/{threeViewerHost-DLd9bynL.js → threeViewerHost-tA5hwts8.js} +14 -14
- package/dist/{urdfTree-vu4m_HnH.js → urdfTree-C5eDsIZV.js} +1 -1
- package/dist/{urdfTree-B2NsYdY-.cjs → urdfTree-CNAusPWp.cjs} +1 -1
- package/dist/{workpieceTreePanel-CXVtdZfX.js → workpieceTreePanel-BE_ayLjw.js} +5 -5
- package/dist/{workpieceTreePanel-Dif_gJAG.cjs → workpieceTreePanel-DMnR0vK-.cjs} +1 -1
- package/package.json +1 -1
- package/public/config.js +2 -2
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-DEBf-IBT.cjs +0 -21
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B8Lpp-LG.js +0 -38138
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-yBjOSB4T.cjs +0 -56
- package/dist/index.vue_vue_type_style_index_1_lang-CWCaf0OP.js +0 -8415
- package/dist/index.vue_vue_type_style_index_1_lang-Dhkn6DXN.cjs +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("vue"),m=require("./index-DEBf-IBT.cjs"),Wl=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DNsyaAD5.cjs"),Je=require("./index-vDXPLbzt.cjs"),fl=require("./threeViewerHost-B2ROtL1I.cjs"),te=require("./index.vue_vue_type_style_index_1_lang-Dhkn6DXN.cjs"),il=require("./xlsx-BPHygxEf.cjs");require("./index.vue_vue_type_style_index_1_lang-BgqA98cE.cjs");const $l=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xl=require("./index-Ci05kJVO.cjs");require("./index-CnW0XyMI.cjs");const ha=require("./isString-D6Z6SOrb.cjs"),Gl=O=>O.match(/\((.*)\)/)[1],ya={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(O){const le=O,X=l.ref(null),$=l.ref(!1),j=l.ref(null);return l.watch(()=>le==null?void 0:le.isVisible,()=>{$.value=le==null?void 0:le.isVisible},{deep:!0,immediate:!0}),l.watch(()=>j.value,()=>{l.nextTick(()=>{var s,ae;(ae=(s=X.value)==null?void 0:s.updatePopper)==null||ae.call(s)})},{deep:!0,immediate:!0}),(s,ae)=>{const ge=l.resolveComponent("el-popover");return l.openBlock(),l.createBlock(ge,{visible:$.value,title:le==null?void 0:le.title,placement:le==null?void 0:le.placement,width:le==null?void 0:le.width,ref_key:"popOverRef",ref:X},{reference:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:j})])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Cr={key:0,class:"extra-button-content"},xr={class:"table-operator-wrap"},Dr={class:"extra-button-filter"},Tr={class:"form-content-value"},Nr={key:0,class:"extra-header"},Er={class:"drop-menu",style:{width:"120px"}},Br={key:0},Ar={key:1},_r={key:1,class:"extra-button-content tabs-button-wrapper"},wr={class:"table-operator-wrap"},Ur={class:"extra-button-filter"},Or={class:"form-content-value"},Lr={key:0,class:"extra-header"},jr={class:"drop-menu",style:{width:"120px"}},Mr={key:0},$r={key:1},Vr={__name:"header",props:{pageLayout:{type:String,default:"vertical"},lockingPage:Boolean,level:{type:Number,default:1},compName:{type:String,default:"表格名称",required:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,filterValues:Array,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(O,{emit:le}){const X=le,$=O,j=l.ref(""),s=l.ref(!1),ae=l.ref([]),ge=l.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),me=[{label:"新增",icon:"Plus"},{label:"导入",icon:"import"},{label:"导出",icon:"export"}],he=ue=>{const ye=ue.raw;if(!ye)return;const oe=new FileReader;oe.onload=G=>{try{const W=new Uint8Array(G.target.result),Ne=il.readSync(W,{type:"array"}),Me=Ne.SheetNames[0],ne=Ne.Sheets[Me],Ue=il.utils.decode_range(ne["!ref"]).e.c+1,H=new Array(Ue).fill(""),b=[];for(const P in ne){if(P[0]==="!")continue;const{r:de,c:Z}=il.utils.decode_cell(P);let Ae=ne[P].v;if(ne[P].t==="n"&&Ae>0&&Ae<1e6&&(Ae=new Date((Ae-25569)*86400*1e3).toISOString().split("T")[0]),(Ae==null||Ae==="")&&(Ae=""),de===0)H[Z]=Ae;else{if(!b[de-1]){b[de-1]={};for(let Ge=0;Ge<Ue;Ge++)b[de-1][`col_${Ge}`]=""}b[de-1][`col_${Z}`]=Ae}}for(let P=0;P<Ue;P++)H[P]===void 0&&(H[P]="");const Se=b==null?void 0:b[0];if(!(Se!=null&&Se.hasOwnProperty("col_0")))return m.ElMessage.error("导入的数据列不匹配,请检查是否错位");X("getImportData",H,b)}catch(W){throw m.ElMessage.error(W.message),new Error(W.message)}},oe.readAsArrayBuffer(ye)},Ve=ue=>{var oe;const ye=(oe=ae.value)==null?void 0:oe.reduce((G,W,Ne)=>(Ne===0?G[W.label]=ue:G[W.label]=W==null?void 0:W.value,G),{});X("filter",ye,ue,!0)},We=ue=>{X("buttonClick",ue)},al=ue=>{var ye,oe;ae.value=(oe=(ye=te.getColumnChild(m.cloneDeep(ue)))==null?void 0:ye.filter(G=>(G==null?void 0:G.label)!==""&&(G==null?void 0:G.label)!=="操作"))==null?void 0:oe.map(G=>({label:(G==null?void 0:G.label)??"",value:"",name:(G==null?void 0:G.label)??"",isFormColHidden:G==null?void 0:G.isTableColHidden,width:2}))},fe=l.ref(!1),Ye=ue=>{var ye;if((ue==null?void 0:ue.buttonName)==="确认"&&(X("filter",ue==null?void 0:ue.content),fe.value=(ue==null?void 0:ue.content)&&Object.values(ue==null?void 0:ue.content).length>0),(ue==null?void 0:ue.buttonName)==="清空"){const oe=m.cloneDeep(ue==null?void 0:ue.content);for(const G in oe)oe[G]="";ae.value=(ye=ae.value)==null?void 0:ye.map(G=>({...G,value:""})),X("filter",oe),fe.value=!1}s.value=!1},Ze=()=>{var ye,oe;ae.value=(ye=ae.value)==null?void 0:ye.map(G=>({...G,value:""}));const ue=(oe=ae.value)==null?void 0:oe.reduce((G,W)=>(G[W.label]=W.value,G),{});X("filter",ue)};return l.onMounted(()=>{al($.columns)}),l.watch(()=>$.columns,()=>{al($.columns)},{deep:!0,immediate:!0}),(ue,ye)=>{var ne,we,Ue,H;const oe=l.resolveComponent("el-icon"),G=l.resolveComponent("svg-icon"),W=l.resolveComponent("el-input"),Ne=l.resolveComponent("el-button"),Me=l.resolveComponent("el-upload");return O.pageLayout==="vertical"?(l.openBlock(),l.createElementBlock("div",Cr,[l.createElementVNode("div",{class:l.normalizeClass(O.compName?"table-name-wrap":""),style:l.normalizeStyle({background:($==null?void 0:$.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:(($==null?void 0:$.level)-1)*12+"px",fontWeight:600-(($==null?void 0:$.level)-1)*100>=400?600-(($==null?void 0:$.level)-1)*100:400,fontSize:17-($==null?void 0:$.level)>=14?17-($==null?void 0:$.level)+"px":"14px"})},l.toDisplayString(O.compName),7),l.createElementVNode("div",xr,[l.createElementVNode("div",Dr,[l.createVNode(ya,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var b,Se,P,de;return[l.createVNode(W,{modelValue:j.value,"onUpdate:modelValue":ye[1]||(ye[1]=Z=>j.value=Z),style:{"min-width":"80px"},placeholder:fe.value?(P=(Se=(b=O.filterValues)==null?void 0:b.filter(Z=>Z))==null?void 0:Se.slice(0,3))==null?void 0:P.join("/"):"搜索","prefix-icon":l.unref(m.search_default),clearable:"",onInput:Ve,disabled:((de=ae.value)==null?void 0:de.length)===0},{suffix:l.withCtx(()=>{var Z,Ae;return[!j.value&&((Ae=(Z=O.filterValues)==null?void 0:Z.filter(Ge=>Ge))!=null&&Ae.join("/"))?(l.openBlock(),l.createBlock(oe,{key:0,style:{cursor:"pointer"},onClick:Ze},{default:l.withCtx(()=>[l.createVNode(l.unref(m.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:ye[0]||(ye[0]=Z=>s.value=!s.value)},[l.createVNode(G,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Tr,[(l.openBlock(),l.createBlock(Je.ssForm,{rowContents:ae.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ye},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((ne=O.buttons)==null?void 0:ne.length)>0?(l.openBlock(),l.createElementBlock("div",Nr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((we=O.buttons)==null?void 0:we.filter(b=>O.isDevMode||(b==null?void 0:b.label)!=="修改模板"),(b,Se)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:Se},[(b==null?void 0:b.type)==="upload"?(l.openBlock(),l.createBlock(Me,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!O.lockingPage},{default:l.withCtx(()=>[l.createVNode(Ne,{disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style"])]),_:2},1032,["disabled"])):l.createCommentVNode("",!0),(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Je._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Ne,{key:0,disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style"])):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",Er,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b==null?void 0:b.contents,P=>(l.openBlock(),l.createBlock(Ne,{key:P==null?void 0:P.label,disabled:!!O.lockingPage,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:de=>We(P==null?void 0:P.label)},{default:l.withCtx(()=>{var de,Z;return[l.createTextVNode(l.toDisplayString(P==null?void 0:P.label),1),(de=P==null?void 0:P.label)!=null&&de.includes("选中")?(l.openBlock(),l.createElementBlock("span",Br,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(Z=P==null?void 0:P.label)!=null&&Z.includes("全部")?(l.openBlock(),l.createElementBlock("span",Ar,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["disabled","onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),b!=null&&b.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ne,{key:2,id:"themeButton",disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"}),onClick:P=>We(b==null?void 0:b.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])])):(l.openBlock(),l.createElementBlock("div",_r,[l.createElementVNode("div",wr,[l.createElementVNode("div",Ur,[l.createVNode(ya,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var b,Se,P,de;return[l.createVNode(W,{modelValue:j.value,"onUpdate:modelValue":ye[3]||(ye[3]=Z=>j.value=Z),style:{"min-width":"80px"},placeholder:fe.value?(P=(Se=(b=O.filterValues)==null?void 0:b.filter(Z=>Z))==null?void 0:Se.slice(0,3))==null?void 0:P.join("/"):"搜索","prefix-icon":l.unref(m.search_default),clearable:"",onInput:Ve,disabled:((de=ae.value)==null?void 0:de.length)===0},{suffix:l.withCtx(()=>{var Z,Ae;return[!j.value&&((Ae=(Z=O.filterValues)==null?void 0:Z.filter(Ge=>Ge))!=null&&Ae.join("/"))?(l.openBlock(),l.createBlock(oe,{key:0,style:{cursor:"pointer"},onClick:Ze},{default:l.withCtx(()=>[l.createVNode(l.unref(m.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:ye[2]||(ye[2]=Z=>s.value=!s.value)},[l.createVNode(G,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Or,[(l.openBlock(),l.createBlock(Je.ssForm,{rowContents:ae.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ye},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((Ue=O.buttons)==null?void 0:Ue.length)>0?(l.openBlock(),l.createElementBlock("div",Lr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((H=O.buttons)==null?void 0:H.filter(b=>O.isDevMode||(b==null?void 0:b.label)!=="修改模板"),(b,Se)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:Se},[(b==null?void 0:b.type)==="upload"?(l.openBlock(),l.createBlock(Me,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:l.withCtx(()=>[l.createVNode(Ne,{style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1024)]),_:2},1024)):l.createCommentVNode("",!0),(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Je._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Ne,{key:0,style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1024)):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",jr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b==null?void 0:b.contents,P=>(l.openBlock(),l.createBlock(Ne,{key:P==null?void 0:P.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:de=>We(P==null?void 0:P.label)},{default:l.withCtx(()=>{var de,Z;return[l.createTextVNode(l.toDisplayString(P==null?void 0:P.label),1),(de=P==null?void 0:P.label)!=null&&de.includes("选中")?(l.openBlock(),l.createElementBlock("span",Mr,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(Z=P==null?void 0:P.label)!=null&&Z.includes("全部")?(l.openBlock(),l.createElementBlock("span",$r,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),b!=null&&b.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ne,{key:2,id:"themeButton",style:l.normalizeStyle({background:"transparent",color:(b==null?void 0:b.label)==="新增"?"var(--ssbutton-theme-bg)":"#666666"}),onClick:P=>We(b==null?void 0:b.label)},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])]))}}},Pr=$l._export_sfc(Vr,[["__scopeId","data-v-dc7dc670"]]),Fr=l.defineComponent({__name:"batch",props:{lockingPage:Boolean,buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(O,{emit:le}){const X=O,$=le,j=ae=>{$("buttonClick",ae)},s=ae=>{var ge;return ae!=null&&ae.includes("删除")?((ge=X.selectTableItems)==null?void 0:ge.length)>0?"warning-active-type":"warning-type":"default-type"};return(ae,ge)=>{const me=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(O.buttons,he=>(l.openBlock(),l.createBlock(me,{key:he==null?void 0:he.label,disabled:!!O.lockingPage,class:l.normalizeClass(s(he==null?void 0:he.label)),onClick:Ve=>j(he==null?void 0:he.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(he==null?void 0:he.label),1)]),_:2},1032,["disabled","class","onClick"]))),128))])}}}),Kr=$l._export_sfc(Fr,[["__scopeId","data-v-70b12973"]]),va=m.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(O){this.selectArray=O},setSelectString(O){this.selectString=O}}}),zr={class:"calculator-content"},qr={class:"calculator-child"},Rr={class:"calculator-child"},Jr=l.defineComponent({__name:"calculator",setup(O){const le=l.ref(),X=l.ref();return l.onMounted(()=>{le.value=[{type:"Upload",label:"输入",name:"input"}],X.value=[{type:"Upload",label:"输出",name:"output"}]}),($,j)=>(l.openBlock(),l.createElementBlock("div",zr,[l.createElementVNode("div",qr,[l.createVNode(Je.ssForm,{rowContents:le.value,isRowFlex:!0},null,8,["rowContents"])]),l.createElementVNode("div",Rr,[l.createVNode(Je.ssForm,{rowContents:X.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Wr=$l._export_sfc(Jr,[["__scopeId","data-v-73db0fe7"]]),ba=m.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(O){this.selectIndex=O},setSelectMenu(O){this.selectMenu=O},setSelectTitle(O){this.selectTitle=O}}}),Hl=(O,le)=>{let X=O,$=le;return Array.isArray(X)&&(X=X==null?void 0:X.map((j,s)=>{if(Array.isArray(j)){let ae={};return j=j==null?void 0:j.forEach((ge,me)=>{var he;(he=$==null?void 0:$[me])!=null&&he.prop?ae[$[me].prop]=ge:Array.isArray(ge)&&(ae.children=Hl(ge,$))}),Object.assign(ae,{id:s})}else return j})),X},ka=(O,le,X)=>{let $=O,j=le;return $=$==null?void 0:$.map((s,ae)=>{var ge,me;return!Array.isArray(s)||!((ge=j==null?void 0:j[ae])!=null&&ge.label)&&!X||(s.unshift(((me=j==null?void 0:j[ae])==null?void 0:me.label)??""),s.some(he=>Array.isArray(he))&&(s=s==null?void 0:s.map(he=>{var Ve;return Array.isArray(he)&&(he=ka(he,(Ve=j==null?void 0:j[ae])==null?void 0:Ve.children,X)),he}))),s}),$},Gr=(O,le,X)=>{if(le==="")return O==null?void 0:O.filter($=>($==null?void 0:$.id)!==X);{const $=le.split("-");return Hr(O,$,X)}},Hr=(O,le,X)=>{let $=O,j=le;return(j==null?void 0:j.length)===0?$=$==null?void 0:$.filter(s=>s.id!==X):$=$==null?void 0:$.map(s=>(s.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),s=ma(s,j,X)),s)),$},ma=(O,le,X)=>{var s,ae;let $=O,j=le;return(j==null?void 0:j.length)===0?$.children=(s=$.children)==null?void 0:s.filter(ge=>ge.id!==X):$.children=(ae=$.children)==null?void 0:ae.map(ge=>(ge.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),ge=ma(ge,j,X)),ge)),$},Qr=(O,le,X)=>{if(le==="")return X;{const $=le.split("-");return Xr(O,$,X)}},Xr=(O,le,X)=>{let $=O,j=le;return(j==null?void 0:j.length)===0?$=X:$=$==null?void 0:$.map(s=>(s.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),s=Sa(s,j,X)),s)),$},Sa=(O,le,X)=>{var s;let $=O,j=le;return(j==null?void 0:j.length)===0?$.children=X:$.children=(s=$.children)==null?void 0:s.map(ae=>(ae.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),ae=Sa(ae,j,X)),ae)),$},Ca=m.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(O){this.objUrl=O},setBlobUrls(O){this.blobUrls=O}}}),Ql=async(O,le)=>{var ae,ge,me,he,Ve,We,al,fe,Ye,Ze,ue,ye,oe,G,W,Ne,Me;let X=(ge=(ae=m.cloneDeep(O))==null?void 0:ae.optionUrl)==null?void 0:ge.menuSelect,$=[];X==null||X.forEach(ne=>{});let j="",s=await te.menuToParent(X);if(s==null||s.forEach(ne=>{var we,Ue,H,b;(ne==null?void 0:ne.name)===(((b=(H=(Ue=(we=m.cloneDeep(O))==null?void 0:we.optionUrl)==null?void 0:Ue.groupSelect)==null?void 0:H[0])==null?void 0:b.replaceAll("'",""))??"")&&(j=ne==null?void 0:ne.id)}),le){j=le;const ne=await m.getInsofDataApi({id:j}),we=(We=(Ve=(he=(me=ne==null?void 0:ne.data)==null?void 0:me.result)==null?void 0:he[0])==null?void 0:Ve.key)==null?void 0:We.pageKey;s=await te.getItemData(we,sessionStorage.getItem("systemKey"),"")}if(j!==""){let ne;le?ne=(al=s==null?void 0:s.find(H=>(H==null?void 0:H.id)===le))==null?void 0:al.compData:ne=(fe=s==null?void 0:s.find(H=>{var b,Se,P,de;return(H==null?void 0:H.name)===(((Se=(b=O==null?void 0:O.groupSelect)==null?void 0:b.split(":"))==null?void 0:Se[0])||((de=(P=O==null?void 0:O.optionUrl)==null?void 0:P.groupSelect)==null?void 0:de[0]))}))==null?void 0:fe.compData;let we=(Ze=(Ye=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:Ye.contents)==null?void 0:Ze.map(H=>H==null?void 0:H.label);(ye=(ue=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:ue.contents)!=null&&ye.every(H=>Array.isArray(H))&&(we=(W=te.getColumnChild((G=(oe=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:oe.contents)==null?void 0:G[0]))==null?void 0:W.map(H=>H==null?void 0:H.prop));let Ue=(Me=(Ne=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="tableContents"))==null?void 0:Ne.contents)==null?void 0:Me.map(H=>(H=H==null?void 0:H.filter(b=>!(b!=null&&b.id)),H));Ue==null||Ue.forEach(H=>{$.push(te.getValueToObjectValue(H,we))})}return $},Yr={class:"table-content"},Zr={class:"menu-config-wrap"},Ir=["onClick"],en={key:0,class:"viewport-wrap"},ln=["onClick"],an={title:"选择显示列信息"},rn={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},nn=["title"],on={class:"col-operate-wrap"},tn={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},sn={class:"pop-view"},un={class:"pop-wrapper"},cn={class:"file-list-pop"},dn=["title","onClick"],pn=["onClick"],fn=["onClick"],gn={class:"form-content"},hn={key:0,class:"dialog-footer"},yn={class:"dialog-footer"},vn={class:"form-content"},bn={__name:"index",props:{pageLayout:{type:String,default:"vertical"},level:{type:Number,default:1},compName:{type:String,default:"",required:!1},compNames:{type:Array,default:()=>[],required:!1},compItem:{type:Object,default:()=>{}},operatingForm:{type:Object,default:()=>{}},cacheNewData:{type:Object,default:()=>{}},config:Object,parentTableId:{type:Number,default:0},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,isDevMode:Boolean,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0},allowSelect:{type:Boolean,default:!1},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["getSliceContLength","clickMainKey","change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(O,{emit:le}){var ga;const X=l.ref([]),$=Ca(m.pinia),j=l.ref(null),s=O,ae=l.ref(s==null?void 0:s.allowSelect),ge=l.ref((ga=s==null?void 0:s.config)==null?void 0:ga.showIndex),me=l.ref(),he=l.ref([{label:"排序",value:"sortable",checked:!1},{label:"筛选",value:"filterable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{label:"编辑",value:"operable",checked:!1}]),Ve=te.useOriginalState(m.pinia);let We="$R";const{originalPath:al}=m.storeToRefs(Ve),fe=al.value,Ye=l.ref(!1),Ze=l.ref(!1),ue=l.ref(!1),ye=l.reactive({column:{},status:!1,text:"合计"}),oe=l.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),G=le,W=l.ref([]),Ne=l.reactive({prop:"",order:null}),Me=l.ref([]),ne=l.ref(!1),we=l.ref(!1),Ue=l.ref(null);fl.useThreeSystem();const H=l.ref([]),b=l.ref(!1),Se=l.ref(),P=te.useMenuState(),{importLoading:de,activeMenuPath:Z,contentLoading:Ae,linkMenuInfo:Ge}=m.storeToRefs(P),xa=te.useTableComp(m.pinia),xe=te.useModelComp(m.pinia),{extraContents:ve,cacheUpdatingData:gl,tableViewContents:hl,tableLoading:mn,pageMapState:rl,lockingPage:Dl}=m.storeToRefs(xe),Y=l.ref([]),Tl=l.ref([]),Nl=l.ref(new Map);l.ref(!1);const He=l.ref("");l.ref();const El=l.ref(!0),ul=l.ref(0),Xl=l.ref(!0),Pe=l.ref(""),Qe=l.ref(!1),Da=l.ref({label:"查看三维模型"}),Bl=l.ref(!1),Vl=l.ref(),$e=l.ref([]),nl=l.ref([]),Al=l.ref(!1),yl=l.ref([]),cl=l.ref([]),ol=l.ref([]),Ee=l.ref([]),Fe=l.ref(),Oe=l.ref(),Ta=va(m.pinia),_l=l.ref(),Pl=l.ref(0),wl=ba(m.pinia),{selectIndex:Na,selectMenu:Xe,selectTitle:Fl}=m.storeToRefs(wl),{selectString:tl}=m.storeToRefs(Ta),Ea=m.useLoginState(m.pinia),{loginUserInfo:Ce}=m.storeToRefs(Ea),Ba=l.ref(720),Ke=l.ref(!1),Ul=l.ref(!1),ze=l.ref([]),sl=l.ref(),vl=l.ref(!0),Yl=l.ref(!0),Ol=l.ref([]),Aa=l.inject("contentRef");l.provide("contentRef",Aa),l.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{oe.total=e}),l.watch(()=>hl.value,async()=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x,y;if(((i=hl.value)==null?void 0:i.length)===0||!((u=s==null?void 0:s.itemData)!=null&&u.find(T=>(T==null?void 0:T.key)==="columnPath"))||!((c=s==null?void 0:s.itemData)!=null&&c.find(T=>(T==null?void 0:T.key)==="pageColumn")))return;let e=(h=(q=(w=(S=(g=(d=s==null?void 0:s.itemData)==null?void 0:d.find(T=>(T==null?void 0:T.key)==="pageColumn"))==null?void 0:g.contents)==null?void 0:S.split("["))==null?void 0:w[1])==null?void 0:q.split("]"))==null?void 0:h[0],a=((R=(N=(U=(E=s==null?void 0:s.itemData)==null?void 0:E.find(T=>(T==null?void 0:T.key)==="pageColumn"))==null?void 0:U.contents)==null?void 0:N.split("["))==null?void 0:R[0])+((K=(z=hl.value)==null?void 0:z.find(T=>(T==null?void 0:T.key)===e))==null?void 0:K.value),n=((x=(o=s==null?void 0:s.itemData)==null?void 0:o.find(T=>(T==null?void 0:T.key)==="pageGroup"))==null?void 0:x.contents)??"",r=await te.getItemData(a,sessionStorage.getItem("systemKey"),""),t=(y=r==null?void 0:r.find(T=>(T==null?void 0:T.name)===(n===""?s==null?void 0:s.compName:n)))==null?void 0:y.compData;pa(t,s.allMapContents)},{deep:!0});const _a=async(e,a)=>{var n,r,t,i,u;try{const c=await m.getInsofDataApi({id:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index)});let d;((n=c==null?void 0:c.data)==null?void 0:n.code)===200&&(d=((t=(r=c==null?void 0:c.data)==null?void 0:r.result)==null?void 0:t[0])||null);const g={type:"data",pageKey:s!=null&&s.parentTableId?(i=d==null?void 0:d.key)==null?void 0:i.pageKey:Z.value,tableId:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index),systemKey:sessionStorage.getItem("systemKey")},S=a==null?void 0:a.map(h=>{const E=Object.keys(h),U={};return E.forEach((N,R)=>{U[e[R]]=h[N]}),U}),w=S==null?void 0:S.map(h=>({key:g,value:{tableData:h}})),q=await m.batchAddInsofDataApi({dataList:w});((u=q==null?void 0:q.data)==null?void 0:u.code)===200?(xe.setRefreshCurStructure(!0),m.ElMessage.success("导入数据成功")):m.ElMessage.error("导入数据响应失败")}catch(c){throw m.ElMessage.error("导入数据处理失败"),new Error(c)}},wa=async e=>{var a,n;if(e!=null&&e.includes(".txt")||e!=null&&e.includes(".cpt")||e!=null&&e.includes(".cyd")){const r=await m.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),t=new Blob([r.data],{type:"application/octet-stream;charset=UTF-8"});let i=URL.createObjectURL(t);Se.value=[{name:(n=e==null?void 0:e.split("/"))==null?void 0:n[((a=e==null?void 0:e.split("/"))==null?void 0:a.length)-1],blobUrl:i}],b.value=!0}};l.onBeforeUnmount(()=>{Yl.value=!1;let e=Pl.value;Pl.value=e+1});const Zl=l.computed(()=>{var r,t;const e=(oe.currentPage-1)*oe.pageSize,a=e+oe.pageSize,n=(r=W.value)==null?void 0:r.find(i=>{var u;return(i==null?void 0:i.sortable)&&((u=i==null?void 0:i.label)==null?void 0:u.includes("时间"))});return n&&(Ne.order="descending",Ne.prop=n==null?void 0:n.prop),G("getSliceContLength",oe),(t=Y.value)==null?void 0:t.slice(e,a)}),Ua=e=>{oe.currentPage=e,G("getSliceContLength",oe)},Oa=e=>{var a;oe.pageSize=e,e*oe.currentPage>((a=Y.value)==null?void 0:a.length)&&(oe.currentPage=1,oe.pageSize=10,m.ElMessage.warning("分页无效,返回第一页")),G("getSliceContLength",oe)},La=(e,a)=>{var u,c;const n=(c=(u=W.value)==null?void 0:u.map(d=>d==null?void 0:d.prop))==null?void 0:c.filter(d=>d!=="operate");let r;const t=(e==null?void 0:e.length)===(n==null?void 0:n.length);if(e!=null&&e.includes("序号"))return m.ElMessage.error("导入的数据不需要包含序号列");if(r=t?e:e.slice(0,n==null?void 0:n.length),!(r==null?void 0:r.every(d=>n==null?void 0:n.find(g=>d===g))))return m.ElMessage.error("导入的数据表头不匹配");_a(r,a)},ja=(e,a)=>{var n;xe.setRefreshCurStructure(!1),((n=W.value)==null?void 0:n.length)===0||La(e,a)},Ma=(e,a,n,r)=>{const t=[],i=[],u=g=>Object.keys(g).length;for(const g in e)if(e[g]!==void 0){const S=e[g],w=[];for(const[q,h]of Object.entries(S))w.push(h),i.length<u(S)&&i.push(q);t.push(w)}t.unshift(i);const c=il.utils.aoa_to_sheet(t),d=il.utils.book_new();il.utils.book_append_sheet(d,c,r),il.writeFileSync(d,`${a}.xlsx`),ze.value=[]},Ll=async(e,a,n,r=!1,t)=>{var i,u,c,d,g,S,w,q;try{xe.setRefreshCurStructure(!1);const h=await m.getInsofDataApi({id:s==null?void 0:s.index});if(((i=h==null?void 0:h.data)==null?void 0:i.code)===200){let E=(g=(d=(c=(u=h==null?void 0:h.data)==null?void 0:u.result)==null?void 0:c[0])==null?void 0:d.value)==null?void 0:g.pageData;r?E={...E,compData:(w=E==null?void 0:E.compData)==null?void 0:w.map(N=>{var R;return(N==null?void 0:N.key)==="header"?{...N,contents:(R=N==null?void 0:N.contents)==null?void 0:R.map(z=>({...z,[e]:n}))}:N})}:E={...E,compData:(S=E==null?void 0:E.compData)==null?void 0:S.map(N=>{var R,z;return(N==null?void 0:N.key)==="header"?{...N,contents:(R=N==null?void 0:N.contents)==null?void 0:R.map(K=>(K==null?void 0:K.prop)===(a==null?void 0:a.prop)?{...K,[e]:n}:K)}:(N==null?void 0:N.key)==="tableToForm"&&t?{...N,contents:(z=N==null?void 0:N.contents)==null?void 0:z.map(K=>(K==null?void 0:K.prop)===(a==null?void 0:a.prop)?{...K,[t]:n}:K)}:N})};const U=await m.updateInsofDataApi({id:s==null?void 0:s.index,value:{pageData:E}});((q=U==null?void 0:U.data)==null?void 0:q.code)===200?(m.ElMessage.success("编辑成功"),xe.setRefreshCurStructure(!0)):m.ElMessage.error("编辑响应失败")}}catch(h){m.ElMessage.error(h)}},$a=async(e,a)=>{await Ll("label",a,e)},Va=async(e,a)=>{await Ll("columnType",a,e,!1,"type")},Pa=()=>{gl.value?Ke.value=!1:fa()},Fa=e=>{ze.value=e},Ka=(e,a)=>{sl.value===a?vl.value=!1:vl.value=!0,sl.value=a==null?void 0:a.changeProp},bl=l.computed(()=>{var n,r,t;const e=(n=W.value)==null?void 0:n.some(i=>i==null?void 0:i.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",e?"inline-block":"none"),(t=(r=W.value)==null?void 0:r.filter(i=>(i==null?void 0:i.label)!=="操作"))==null?void 0:t.map(i=>({...i,filterable:!!(i!=null&&i.filterable),showSummary:!!(i!=null&&i.showSummary),operable:!!(i!=null&&i.operable)}))}),za=async(e,a,n)=>{const r=m.cloneDeep(W.value);await l.nextTick(),W.value=r==null?void 0:r.map(t=>(n==null?void 0:n.label)===(t==null?void 0:t.label)?{...t,[a]:e}:t),await Ll(a,n,e)},Kl=async(e,a)=>{await Ll(a,null,e,!0)},qa=()=>{Qe.value=!1},Ra=e=>{G("clickTrigger",e)},Il=async e=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K;const a=e==null?void 0:e.row,n=e==null?void 0:e.rowData,r=e==null?void 0:e.suffix;if((i=a==null?void 0:a.toString())!=null&&i.includes(".urdf")||e!=null&&e.isUrdf||r!=null&&r.includes(".urdf")){if(a.includes(",")){m.ElMessage.error("当前版本仅允许单个urdf预览!");return}yl.value=[a],we.value=!0,Ue.value={data:m.cloneDeep(n)},ne.value=!0;return}let t=[];if((u=a==null?void 0:a.toString())!=null&&u.includes(".stl")||(c=a==null?void 0:a.toString())!=null&&c.includes(".STL")||(d=a==null?void 0:a.toString())!=null&&d.includes(".obj")||(g=a==null?void 0:a.toString())!=null&&g.includes(".mtl")){yl.value=(S=a==null?void 0:a.toString())==null?void 0:S.split(","),we.value=!1,ne.value=!0;return}if((w=a==null?void 0:a.toString())!=null&&w.includes(".stl")||(q=a==null?void 0:a.toString())!=null&&q.includes(".STL")||(h=a==null?void 0:a.toString())!=null&&h.includes(".obj")||(E=a==null?void 0:a.toString())!=null&&E.includes(".mtl")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){let o,x=[],y={};if(Array.isArray(a)?o=a:o=a==null?void 0:a.split(","),o==null||o.forEach(T=>{T.includes(".mtl")?x.push(T):y.blob=y.blob?y.blob+","+T:T}),(x==null?void 0:x.length)>0&&(y.mtlBlobs=x),r&&(y.suffix=r),(N=(U=Object.values(y))==null?void 0:U[0])!=null&&N.includes("http:"))t.push(y);else{const T=new Blob([y.blob],{type:"application/octet-stream;charset=UTF-8"});let D=URL.createObjectURL(T),Q="";(R=a==null?void 0:a.split("/"))==null||R.forEach((L,ee)=>{var A;ee===((A=a==null?void 0:a.split("/"))==null?void 0:A.length)-1&&(Q=L)}),(z=y.blob)!=null&&z.includes(".stl")&&(Q=(Q==null?void 0:Q.replaceAll(">",""))+".urdf"),Se.value=[{name:Q,blobUrl:D}],b.value=!0}}else{const o=await m.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),x=new Blob([o.data],{type:"application/octet-stream;charset=UTF-8"});let y=URL.createObjectURL(x),T="";(K=a==null?void 0:a.split("/"))==null||K.forEach((D,Q)=>{var L;Q===((L=a==null?void 0:a.split("/"))==null?void 0:L.length)-1&&(T=D)}),Se.value=[{name:T,blobUrl:y}],b.value=!0}(t==null?void 0:t.length)>0&&$.setBlobUrls(t)},jl=e=>{var r,t,i,u;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const a=(u=(r=e==null?void 0:e.url)==null?void 0:r.split("."))==null?void 0:u[((i=(t=e==null?void 0:e.url)==null?void 0:t.split("."))==null?void 0:i.length)-1];return(e==null?void 0:e.name)+"."+a},Ja=async e=>{let a=null,n=null,r=null;if(e!=null&&e.downloadUrl){const i=await zl(),u=Je.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),c=await m.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{u.close()}),d=new Blob([c.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(d),n=e==null?void 0:e.name;const g=n==null?void 0:n.lastIndexOf(".");r=n==null?void 0:n.slice(g)}else{const i=await fl.downloadAvatarApi({url:e==null?void 0:e.url});!e.url.toUpperCase().includes(".OBJ")&&!e.url.toUpperCase().includes(".STL")&&!e.url.toUpperCase().includes(".MTL")&&!e.url.toUpperCase().includes(".URDF")?(a=URL.createObjectURL(i.data),n=jl(e)):a=e==null?void 0:e.url}if(r!=null&&r.includes(".urdf")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){const i={row:`${a}`,suffix:r};Il(i);return}const t={name:n,blobUrl:a};Se.value=[t],b.value=!0},Wa=async e=>{let a=null,n=null;if(e!=null&&e.downloadUrl){const i=await zl(),u=await m.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),c=new Blob([u.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(c),n=e==null?void 0:e.name}else{const i=await fl.downloadAvatarApi({url:e==null?void 0:e.url});a=URL.createObjectURL(i.data),n=jl(e)}const r={name:n,blobUrl:a},t=document.createElement("a");t.href=r.blobUrl,t.download=r.name,t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{document.body.removeChild(t)},100)},Ga=(e,a)=>{var n;if(Object.values(a).length!==0)return Object.values(a).find(r=>{var t,i,u;return((t=r==null?void 0:r.toString())==null?void 0:t.includes(".txt"))||((i=r==null?void 0:r.toString())==null?void 0:i.includes(".cpt"))||((u=r==null?void 0:r.toString())==null?void 0:u.includes(".obj"))})?[...e,Da.value]:(n=s==null?void 0:s.config)!=null&&n.allowMove?[...e,{label:"迁移"}]:e},Ha=(e,a={})=>[...e==null?void 0:e.values()].filter(n=>Object.keys(a).every(r=>{var u;const t=n[r],i=(u=a[r])==null?void 0:u.toLowerCase();return i&&t&&typeof t=="string"?t.toLowerCase().includes(i):!0})),ea=l.ref([]),Qa=async(e,a,n=!1)=>{var r;if(e){if(xe.setTableLoading(!0),ea.value=Object.values(e),e&&((r=Object.values(e))!=null&&r.every(t=>!t)))return Y.value=Tl.value;if(n){Y.value=[...Nl.value.values()].filter(t=>Object.values(t).some(i=>typeof i=="string"?i==null?void 0:i.toLowerCase().includes(a==null?void 0:a.toLowerCase()):!1));return}Y.value=Ha(Nl.value,e),xe.setTableLoading(!1)}},Xa=async e=>{var u,c,d,g,S,w,q,h,E,U,N,R,z,K,o;const a=await m.getInsofDataApi({keyLikes:{pageKey:`loading${((u=Ce.value)==null?void 0:u.account)||((c=Ce.value)==null?void 0:c.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),n=await m.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((d=Ce.value)==null?void 0:d.account)||((g=Ce.value)==null?void 0:g.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});let r=(w=(S=a==null?void 0:a.data)==null?void 0:S.result)==null?void 0:w.map(x=>x==null?void 0:x.id);const t=(h=(q=n==null?void 0:n.data)==null?void 0:q.result)==null?void 0:h.map(x=>x==null?void 0:x.id);r=[...m.cloneDeep(r),...t],(r==null?void 0:r.length)>0&&(r!=null&&r.every(x=>x!==null&&x))&&await m.batchDeleteInsofDataApi({ids:r});let i=await te.getItemData(Z.value,sessionStorage.getItem("systemKey"),e.id);if(i=i==null?void 0:i.filter(x=>x.comp!=="methodButton"),i&&i.length>0){const x=!Array.isArray(Fl.value)&&((E=Fl.value)==null?void 0:E.key)!=="main"?[]:Fl.value;x.push({key:Xe.value===""?(U=e==null?void 0:e.id)==null?void 0:U.toString():Xe.value+"-"+((N=e==null?void 0:e.id)==null?void 0:N.toString()),value:e[(R=Object.keys(e))==null?void 0:R.filter(y=>y!=="index"&&y!=="id")[0]]}),wl.setSelectMenu(Xe.value===""?(z=e==null?void 0:e.id)==null?void 0:z.toString():Xe.value+"-"+((K=e==null?void 0:e.id)==null?void 0:K.toString())),wl.setSelectTitle(x),wl.setSelectIndex((o=e==null?void 0:e.id)==null?void 0:o.toString()),G("pageChange",i)}},la=async(e,a,n,r)=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F;if(G("clickMainKey",n),(r==null?void 0:r.isExistChild)===!0){let p=(u=(i=W.value)==null?void 0:i.find(M=>(M==null?void 0:M.isMainKey)===!0))==null?void 0:u.prop,B=(c=r==null?void 0:r.rowContent)==null?void 0:c[p],k=(g=(d=r==null?void 0:r.columnType)==null?void 0:d.childPath)==null?void 0:g.split(fe),C=[];k==null||k.forEach((M,v)=>{(k==null?void 0:k.length)-1===v&&C.push(B),C.push(M)}),C=C.join(fe);let V=await te.getItemData(C,sessionStorage.getItem("systemKey"),""),I=await te.getItemData((S=r==null?void 0:r.columnType)==null?void 0:S.childPath,sessionStorage.getItem("systemKey"),"");if(!V||(V==null?void 0:V.length)===0){let M=[];I==null||I.forEach(J=>{var Te,be,_,f;let pe={type:"structure",pageKey:C,version:1,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(Te=Ce.value)==null?void 0:Te.id,parentPageKey:"",createUserLayer:((be=Ce.value)==null?void 0:be.dept)||((_=Ce.value)==null?void 0:_.部门名称)},se={pageData:{comp:J==null?void 0:J.comp,compData:(f=J==null?void 0:J.compData)==null?void 0:f.filter(ce=>(ce==null?void 0:ce.key)!=="tableContents"),name:J==null?void 0:J.name,isShow:J==null?void 0:J.isShow}};M.push({key:pe,value:se})}),(M==null?void 0:M.length)>0&&await m.batchAddInsofDataApi({dataList:M});let v=await te.getItemData(C,sessionStorage.getItem("systemKey"),"");Ol.value=v}else Ol.value=V;G("routeUrl",Ol.value,{isEdit:!0,routerUrl:C});return}if((r==null?void 0:r.data)==="查看"&&(e!=null&&e.every(p=>(p==null?void 0:p.url)&&(p==null?void 0:p.name)))){let p=m.cloneDeep(e);p=await((w=m.cloneDeep(p))==null?void 0:w.map(async k=>{var I,M,v,J;const C=await fl.downloadAvatarApi({url:k==null?void 0:k.url});let V=URL.createObjectURL(C.data);return{name:(k==null?void 0:k.name)+"."+((J=(I=k==null?void 0:k.url)==null?void 0:I.split("."))==null?void 0:J[((v=(M=k==null?void 0:k.url)==null?void 0:M.split("."))==null?void 0:v.length)-1]),blobUrl:V}}));let B=await Promise.all(p);Se.value=B,b.value=!0}const t=m.cloneDeep(W.value);if((r==null?void 0:r.isMainKey)===!0&&(t==null?void 0:t.length)>0){(q=t==null?void 0:t[0])==null||q.prop;let p=m.cloneDeep(Z).value+fe+(r==null?void 0:r.data),B=m.cloneDeep(Z).value,k=(E=(h=rl.value[p])==null?void 0:h.filter(M=>{var v,J;return((v=M==null?void 0:M.key)==null?void 0:v.type)==="structure"&&((J=M==null?void 0:M.key)==null?void 0:J.parentTable)===""}))==null?void 0:E.map(M=>{var v;return(v=M==null?void 0:M.value)==null?void 0:v.pageData}),C={};(U=W.value)==null||U.forEach(M=>{(M==null?void 0:M.label)!=="操作"&&(C[M.label]=n[M.prop]??n[M.label])});let V=(R=(N=s==null?void 0:s.itemData)==null?void 0:N.find(M=>(M==null?void 0:M.key)==="mainRouters"))==null?void 0:R.contents,I;if((V==null?void 0:V.length)>0){let M=p==null?void 0:p.split(fe)[((z=p==null?void 0:p.split(fe))==null?void 0:z.length)-1],v=V==null?void 0:V.find(J=>(J==null?void 0:J.key)===M);I=(v==null?void 0:v.routerContent)+fe+(v==null?void 0:v.key)}if((k==null?void 0:k.length)>0)await te.getItemData(p+fe+`updateLoading${((K=Ce.value)==null?void 0:K.account)||((o=Ce.value)==null?void 0:o.账号)}`,sessionStorage.getItem("systemKey"),"")||await te.loadingConstruct(p,p+fe+`updateLoading${((x=Ce.value)==null?void 0:x.account)||((y=Ce.value)==null?void 0:y.账号)}`,C,I),xe.setRouteToChildPath(B),P.setActiveMenuPath(p+fe+`updateLoading${((T=Ce.value)==null?void 0:T.account)||((D=Ce.value)==null?void 0:D.账号)}`);else{(Q=t==null?void 0:t[0])==null||Q.prop;let M=m.cloneDeep(Z).value+fe+(r==null?void 0:r.data),v=m.cloneDeep(Z).value;await te.getItemData(v+fe,sessionStorage.getItem("systemKey"),""),await te.loadingConstruct(v+fe,M,C),await te.loadingConstruct(M,M+fe+`updateLoading${((L=Ce.value)==null?void 0:L.account)||((ee=Ce.value)==null?void 0:ee.账号)}`,C,I),xe.setRouteToChildPath(v),P.setActiveMenuPath(M+fe+`updateLoading${((A=Ce.value)==null?void 0:A.account)||((F=Ce.value)==null?void 0:F.账号)}`)}}},Ya=()=>{b.value=!1},Za=e=>{G("rowClick",e)};l.watch(()=>s.changedContent,()=>{var n,r;if(!s.changedContent)return;let e=(n=Y.value)==null?void 0:n.map(t=>{var i;return t.id===((i=s.changedContent)==null?void 0:i.id)&&(t={...s.changedContent,id:s.changedContent.newId?s.changedContent.newId:s.changedContent.id},delete t.newId),t});const a=(r=s.itemData)==null?void 0:r.map(t=>((t==null?void 0:t.key)==="tableContents"&&(t.contents=e),t));Y.value=e,G("contentChange",{contents:a,index:s.index}),G("change",{content:e,index:s==null?void 0:s.index,buttonName:"",id:s==null?void 0:s.index})},{deep:!0,immediate:!0});const Ia=()=>{},er=async()=>{const e=Z.value,a=sessionStorage.getItem("systemKey"),n=await te.getItemData(e,a,""),r=(n==null?void 0:n.find(c=>(c==null?void 0:c.name)==="方法明细"))||(n==null?void 0:n[0]),t=(r==null?void 0:r.compData)||[],i=t==null?void 0:t.find(c=>{const d=c==null?void 0:c.key;return d==="formContent"||d==="tableContents"});return i==null?void 0:i.contents},zl=async()=>`Bearer ${m.Local.get("access-token")}`,lr=async(e,{token:a,inputData:n}={})=>await m.axios.post(e,n,{headers:{Authorization:a}}).catch(t=>(P.setImportLoading(!1),Promise.reject(t))),ar=e=>{const a=[],n=r=>{r&&typeof r=="object"&&!Array.isArray(r)?Object.values(r).forEach(n):a.push(r)};return n(e),a},rr=async(e,a,n)=>{var z,K,o,x,y,T,D,Q;P.setImportLoading(!0),xe.setFreshContent(!1);let r=await er().catch(L=>(P.setImportLoading(!1),Promise.reject(L)));r=r==null?void 0:r.filter(L=>{var ee;return((ee=L==null?void 0:L.find(A=>A==null?void 0:A.id))==null?void 0:ee.id)===(a==null?void 0:a.id)});let t=te.getEqualChild([(z=W.value)==null?void 0:z.filter(L=>(L==null?void 0:L.label)!=="操作")]);const i=(o=(K=te.tableToForm(r,t))==null?void 0:K[0])==null?void 0:o.find(L=>{const ee=L==null?void 0:L.key;return ee==="算法体"||ee==="方法体"}),u=i==null?void 0:i.value;if(!u){console.log("未搜索到isMain, 缺少算法执行接口"),P.setImportLoading(!1);return}const c=W.value?te.getEqualChild([W.value]):[],d=c.find(L=>{const ee=L==null?void 0:L.prop;return ee==="输入"||ee==="输入数据.输入1"||ee==="样本输入数据"}),g=d==null?void 0:d.prop;let S=a==null?void 0:a[g];const w=await zl().catch(L=>(P.setImportLoading(!1),Promise.reject(L))),q=await lr(u,{token:w,inputData:S}).catch(L=>(P.setImportLoading(!1),Promise.reject(L))),h=(x=q==null?void 0:q.data)==null?void 0:x.data,E=c.find(L=>(L==null?void 0:L.prop)==="输出数据.输出1"),U=E==null?void 0:E.prop;let N=[],R=[];if(((y=Object.values(h))==null?void 0:y.length)>0){let L=[];const ee=new FormData,A=(T=ar(h))==null?void 0:T.map(async p=>{var B,k;if(!Array.isArray(p)&&(p!=null&&p.includes("http"))){let C=await m.axios.get(p,{responseType:"blob"}),V=(k=p==null?void 0:p.split("/"))==null?void 0:k[((B=p==null?void 0:p.split("/"))==null?void 0:B.length)-1];ee.append("files",C.data,V)}else L.push(p)});if(await Promise.all(A),!te.isFormDataEmpty(ee)){let p=await fl.uploadAmountApi(ee),B=(Q=(D=p==null?void 0:p.data)==null?void 0:D.result)==null?void 0:Q.map(k=>{var C,V,I,M,v,J;return{name:(J=(v=(M=(C=k==null?void 0:k.url)==null?void 0:C.split("/"))==null?void 0:M[((I=(V=k==null?void 0:k.url)==null?void 0:V.split("/"))==null?void 0:I.length)-1])==null?void 0:v.split("."))==null?void 0:J[0],url:k==null?void 0:k.url}});L=[...L,...B]}let F={};for(let p in a)p!=="id"&&(F[p]=a[p]);F[U]=L,R.push({id:a==null?void 0:a.id,value:{tableData:F}})}(R==null?void 0:R.length)>0&&await m.batchUpdateInsofDataApi({dataList:R}),(N==null?void 0:N.length)>0&&await m.batchAddInsofDataApi({dataList:N}),Sl(!0),P.setImportLoading(!1),xe.setFreshContent(!0)},aa=(e,a)=>(e=e==null?void 0:e.map(n=>{var r,t;return n!=null&&n.children&&((r=n.children)!=null&&r.find(i=>i.id===(a==null?void 0:a.id))?n.children=(t=n.children)==null?void 0:t.filter(i=>(i==null?void 0:i.id)!==(a==null?void 0:a.id)):n.children=aa(n.children,a)),n}),e),De=l.reactive({title:"迁移至",show:!1,width:"20%",selectRow:null,from:s==null?void 0:s.index,to:null,contents:[],formRules:{groupName:[{required:!0,message:"输入不能为空",trigger:"blur"},{validator:(e,a,n)=>{a===(s==null?void 0:s.index)?n(new Error("选择源不能和目标源一致")):n()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),nr=()=>{De.show=!1},or=e=>{var a,n;if((e==null?void 0:e.buttonName)==="取消")return De.show=!1;De.to=e==null?void 0:e.content,!(!(s!=null&&s.index)||!((a=De.to)!=null&&a.groupName))&&(s==null?void 0:s.index)!==((n=De.to)==null?void 0:n.groupName)&&(G("change",{buttonName:"迁移",value:{from:De.from,to:De.to,data:De.selectRow}}),De.show=!1)},Ml=async(e,a,n)=>{var r,t,i,u,c,d,g,S,w,q,h,E,U,N,R;if(He.value="",Al.value=!0,El.value=!0,G("onButtonClick",e,a),e==="删除")te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var z,K;(z=Y.value)!=null&&z.find(o=>(o==null?void 0:o.id)===(a==null?void 0:a.id))?Y.value=(K=m.cloneDeep(Y.value))==null?void 0:K.filter(o=>(o==null?void 0:o.id)!==(a==null?void 0:a.id)):Y.value=aa(m.cloneDeep(Y.value),a),Gr(_l.value,Xe.value,a==null?void 0:a.id),xe.setTableLoading(s==null?void 0:s.index),G("change",{content:Y.value,singleContent:a,index:s==null?void 0:s.index,type:"delete",buttonName:e,column:W.value})});else if(e==="批量删除"){if(((r=ze.value)==null?void 0:r.length)===0)return m.ElMessage.warning("请先勾选操作的数据");te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var K,o;const z=(K=ze.value)==null?void 0:K.map(x=>x.id);Y.value=(o=m.cloneDeep(Y.value))==null?void 0:o.filter(x=>!(z!=null&&z.includes(x.id))),xe.setTableLoading(s==null?void 0:s.index),G("change",{content:Y.value,singleContent:null,selectItems:ze.value,index:s==null?void 0:s.index,type:"batchDelete",buttonName:e,column:W.value})})}else if(e==="复制新增"){Pe.value="新增";const z=m.cloneDeep(a),K=(t=W.value)==null?void 0:t.find(y=>y==null?void 0:y.isMainKey),o=K||((i=W.value)==null?void 0:i[0]),x=(u=ol.value)==null?void 0:u.find(y=>(y==null?void 0:y.label)==="新建");await na(!0,x,{data:z,firstCol:o})}else if(e==="新增")Pe.value="新增",ml(""),Qe.value=!0;else if(e==="编辑")Pe.value="编辑",ml(a),Qe.value=!0;else if(e==="查看")Pe.value="查看",ml(a),Al.value=!1,El.value=!1,Qe.value=!0;else if(e==="查看三维模型"){const z={};for(let o in a)o!=="id"&&(z[o]=a[o]);let K=(c=Object.values(z))==null?void 0:c[1];xa.setTableShowThree(K)}else if(((d=n==null?void 0:n.extra)==null?void 0:d.type)==="modelExample")Pe.value=e,Bl.value=!0;else if(e==="新建"){let z=rl.value,K=[];for(let D in z)D!=null&&D.includes(`loading${((g=Ce.value)==null?void 0:g.account)||((S=Ce.value)==null?void 0:S.账号)}`)&&(K=[...K,...D]);let o=[];for(let D in z)D!=null&&D.includes(`updateLoading${((w=Ce.value)==null?void 0:w.account)||((q=Ce.value)==null?void 0:q.账号)}`)&&(o=[...o,...D]);let x=K==null?void 0:K.map(D=>D==null?void 0:D.id);const y=o==null?void 0:o.map(D=>D==null?void 0:D.id);x=[...m.cloneDeep(x),...y],(x==null?void 0:x.length)>0&&(x!=null&&x.every(D=>D!==null&&D))&&await m.batchDeleteInsofDataApi({ids:x});const T=(h=ol.value)==null?void 0:h.find(D=>(D==null?void 0:D.label)==="新建");await na(!1,T)}else if(e==="修改模板"){let z=m.cloneDeep(Z).value;xe.setRouteToChildPath(z),P.setActiveMenuPath(z+fe)}else if(e==="执行")rr(e,a);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((E=ze.value)==null?void 0:E.length)===0)return m.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&((U=Y.value)==null?void 0:U.length)===0)return m.ElMessage.warning("暂无数据导出");const z=(R=(N=W.value)==null?void 0:N.map(o=>o==null?void 0:o.label))==null?void 0:R.filter(o=>o!=="操作"),K=e==="导出全部"?m.cloneDeep(Y.value):m.cloneDeep(ze.value);K==null||K.forEach(o=>{o==null||delete o.id}),Ma(K,s==null?void 0:s.compName,z,s==null?void 0:s.compName)}else e==="迁移"&&(De.selectRow=a,De.show=!0)},tr=async e=>{var n,r,t,i,u,c;const a=await m.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((n=a==null?void 0:a.data)==null?void 0:n.code)===200)return Array.isArray((r=a==null?void 0:a.data)==null?void 0:r.result)&&((i=(t=a==null?void 0:a.data)==null?void 0:t.result)==null?void 0:i.length)>0?(c=(u=a==null?void 0:a.data)==null?void 0:u.result)==null?void 0:c.map(d=>{var g;return{id:d==null?void 0:d.id,...(g=d==null?void 0:d.value)==null?void 0:g.pageData}}):[]},sr=async(e,a)=>{var n,r,t,i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x;try{let y,T;const D=(n=rl.value[Z.value+fe])==null?void 0:n.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="structureMethod"}),Q=(r=rl.value[Z.value+fe])==null?void 0:r.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="structure"}),L=D==null?void 0:D.find(k=>{var C,V;return((V=(C=k==null?void 0:k.value)==null?void 0:C.pageData)==null?void 0:V.method)==="保存"});if(!L)return;const ee=(c=(u=rl.value[(i=(t=L==null?void 0:L.value)==null?void 0:t.pageData)==null?void 0:i.path])==null?void 0:u.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="data"}))==null?void 0:c.find(k=>{var C,V,I,M;return((V=(C=k==null?void 0:k.value)==null?void 0:C.tableData)==null?void 0:V.算法名称)===((M=(I=L==null?void 0:L.value)==null?void 0:I.pageData)==null?void 0:M.method)});if(!ee)return;const A={buttonName:(g=(d=L==null?void 0:L.value)==null?void 0:d.pageData)==null?void 0:g.method,api:(w=(S=ee==null?void 0:ee.value)==null?void 0:S.tableData)==null?void 0:w.算法体,content:Q==null?void 0:Q.map(k=>{var C;return(C=k==null?void 0:k.value)==null?void 0:C.pageData}),extraContent:[],extraValues:(h=(q=L==null?void 0:L.value)==null?void 0:q.pageData)==null?void 0:h.data,methodName:(U=(E=L==null?void 0:L.value)==null?void 0:E.pageData)==null?void 0:U.path};if(!e)return;const F={...e,compData:(N=e==null?void 0:e.compData)==null?void 0:N.map(k=>{var C;return(k==null?void 0:k.key)==="formContent"?{...k,contents:(C=k==null?void 0:k.contents)==null?void 0:C.map(V=>(V==null?void 0:V.prop)===a?{...V,value:""}:V)}:k})},p={key:{pageKey:Z.value+fe,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:F}},B=await m.axios.post(A.api,p,{headers:{"Content-Type":"application/json"}});return((R=B==null?void 0:B.data)==null?void 0:R.code)===200&&(y=(K=(z=B==null?void 0:B.data)==null?void 0:z.result)==null?void 0:K.latestReportCode,T=(x=(o=B==null?void 0:B.data)==null?void 0:o.result)==null?void 0:x.status),{newMainKeyValue:y,newStatus:T}}catch(y){throw m.ElMessage.error(y),new Error(y)}},ra=(e,a,n,r)=>{var t;G("contentChange",{contents:(t=e==null?void 0:e.compData)==null?void 0:t.map(i=>{var u;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(u=i==null?void 0:i.contents)==null?void 0:u.map(c=>(c==null?void 0:c.key)===a?{...c,value:n}:kl.value&&(c==null?void 0:c.prop)===kl.prop?{...c,value:kl.value}:c)}:i}),index:e==null?void 0:e.id},r)},kl=l.reactive({prop:"状态",value:""}),ir=l.ref(["系统自动生成信息","审批意见"]),ur=async(e,a,n)=>{var d,g;let r=e==null?void 0:e[a==null?void 0:a.prop],t=1,i,u;const c=m.cloneDeep(Z).value+fe+r;if(c){kl.value="",i=(d=rl.value[c])==null?void 0:d.filter(q=>{var h;return((h=q==null?void 0:q.key)==null?void 0:h.type)==="structure"});const S=i==null?void 0:i.find(q=>{var h,E,U;return((U=(E=(h=q==null?void 0:q.value)==null?void 0:h.pageData)==null?void 0:E.comp)==null?void 0:U.toUpperCase())==="FORM"});u={...(g=S==null?void 0:S.value)==null?void 0:g.pageData,id:S==null?void 0:S.id};const w=await sr(u,a==null?void 0:a.prop);if(kl.value=w==null?void 0:w.newStatus,w!=null&&w.newMainKeyValue)return w==null?void 0:w.newMainKeyValue}if(Y.value.some(S=>(S==null?void 0:S[a==null?void 0:a.prop])===r)){const S=r;for(;Y.value.some(w=>(w==null?void 0:w[a==null?void 0:a.prop])===`${S}(${t})`);)t++;r=`${S}(${t})`}return r},na=async(e,a,n)=>{var u,c,d,g,S,w,q,h;let r,t;const i=await ur(n==null?void 0:n.data,n==null?void 0:n.firstCol);if(e?(r=m.cloneDeep(Z).value+fe+((g=n==null?void 0:n.data)==null?void 0:g[(d=n==null?void 0:n.firstCol)==null?void 0:d.prop]),t=m.cloneDeep(Z).value+fe+i):(r=m.cloneDeep(Z).value+fe,t=m.cloneDeep(r)+`loading${((u=Ce.value)==null?void 0:u.account)||((c=Ce.value)==null?void 0:c.账号)}`),a){const E=(w=(S=rl.value[t])==null?void 0:S.filter(U=>{var N;return((N=U==null?void 0:U.key)==null?void 0:N.parentTable)===""}))==null?void 0:w.map(U=>{var N;return{id:U==null?void 0:U.id,...(N=U==null?void 0:U.value)==null?void 0:N.pageData}});if((E==null?void 0:E.length)>0)if(e){const U=E==null?void 0:E.find(N=>{var R;return((R=N==null?void 0:N.comp)==null?void 0:R.toUpperCase())==="FORM"});U&&ra(U,(q=n==null?void 0:n.firstCol)==null?void 0:q.label,i,Z.value)}else xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t);else if(await te.loadingConstruct(r,t,null,null,e?ir.value:null),e){const U=await tr(t);if((U==null?void 0:U.length)>0){const N=U==null?void 0:U.find(R=>{var z;return((z=R==null?void 0:R.comp)==null?void 0:z.toUpperCase())==="FORM"});N&&ra(N,(h=n==null?void 0:n.firstCol)==null?void 0:h.label,i,Z.value)}}else xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t)}else e?(He.value="",Oe.value=n==null?void 0:n.data,Sl(!0,n==null?void 0:n.firstCol,i)):(xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t))},cr=()=>{ne.value=!1,yl.value=[],we.value=!1},ml=e=>{var u,c,d,g,S,w,q,h,E,U,N,R,z,K;const a=[];let n=[];for(let o in e)Array.isArray(e==null?void 0:e[o])&&n.push(o);Me.value=m.cloneDeep(W.value),(c=te.getColumnChild((u=m.cloneDeep(W.value))==null?void 0:u.filter(o=>(o==null?void 0:o.label)!=="操作")))==null||c.forEach((o,x)=>{var y;n.find(T=>T===(o==null?void 0:o.prop))||(o!=null&&o.formType&&((y=o==null?void 0:o.formType)==null?void 0:y.toUpperCase())==="SELECT"?a.push({label:(o==null?void 0:o.prop)||(o==null?void 0:o.label)||"",name:(o==null?void 0:o.prop)??"t"+x,prop:o==null?void 0:o.prop,type:!(o!=null&&o.formType)||(o==null?void 0:o.formType)===""?"Input":o==null?void 0:o.formType,value:(e==null?void 0:e[o==null?void 0:o.prop])??(o==null?void 0:o.value)??"",id:(o==null?void 0:o.id)??x,contents:(o==null?void 0:o.options)??[],width:1,isFormColHidden:o==null?void 0:o.isFormColHidden,disabled:o==null?void 0:o.disabled,optionUrl:{groupSelect:o==null?void 0:o.groupSelect,menuSelect:o==null?void 0:o.formMenuSelect,type:"Select",selectRelateType:o==null?void 0:o.selectRelateType,allSelectionContents:(o==null?void 0:o.allSelectionContents)??[],selectFilter:o==null?void 0:o.selectFilter}}):a.push({label:(o==null?void 0:o.prop)||(o==null?void 0:o.label)||"",prop:o==null?void 0:o.prop,name:(o==null?void 0:o.prop)??"t"+x,type:!(o!=null&&o.formType)||(o==null?void 0:o.formType)===""?"Input":o==null?void 0:o.formType,value:(e==null?void 0:e[o==null?void 0:o.prop])??(o==null?void 0:o.value)??"",id:(o==null?void 0:o.id)??x,contents:(o==null?void 0:o.options)??[],width:1,isFormColHidden:o==null?void 0:o.isFormColHidden,disabled:o==null?void 0:o.disabled}))}),e===""||!e||(He.value=(e==null?void 0:e.id)??"");let r=te.getColumnChild((d=m.cloneDeep(W.value))==null?void 0:d.filter(o=>(o==null?void 0:o.label)!=="操作"));$e.value&&((g=$e.value)==null?void 0:g.length)>0&&($e.value=(S=m.cloneDeep($e).value)==null?void 0:S.map(o=>{var y;let x=(o==null?void 0:o.prop)||((y=r==null?void 0:r.find(T=>(T==null?void 0:T.label)===(o==null?void 0:o.label)))==null?void 0:y.prop);return x&&(o.value=e[x]),o})),Ee.value=$e.value&&((w=$e.value)==null?void 0:w.length)>0?te.getTableFormToForm($e.value):a;let t=[],i=(q=s.itemData)==null?void 0:q.filter(o=>(o==null?void 0:o.key)==="filterAllType");if((i==null?void 0:i.length)>0&&(t=(i==null?void 0:i.map(x=>x==null?void 0:x.value)).flat()),(t==null?void 0:t.length)>0){let o=t==null?void 0:t.find(x=>{var y;return(y=x==null?void 0:x.content)==null?void 0:y.includes("@Select")});if(o!=null&&o.content){let x=(U=(E=(h=o==null?void 0:o.content)==null?void 0:h.replace(":",We))==null?void 0:E.split(We))==null?void 0:U[1];if(((N=x==null?void 0:x.trim())==null?void 0:N.toUpperCase())==="MANUAL"){let y=(z=(R=s.itemData)==null?void 0:R.find(T=>(T==null?void 0:T.key)==="contentTableId"))==null?void 0:z.contents;Ee.value=(K=Ee.value)==null?void 0:K.map((T,D)=>{var Q;return D===0&&(T.type="Select",(Q=T==null?void 0:T.optionUrl)!=null&&Q.menuId?(T.optionUrl.menuId=y,T.optionUrl.menuFilter=t):T.optionUrl={menuId:y,menuFilter:t}),T})}}}},dr=()=>{var a;const e=(a=j.value)==null?void 0:a.$el;e&&Wl.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:n=>{var u;const{oldIndex:r,newIndex:t}=n;if(r===t)return;const i=bl.value.splice(r,1)[0];bl.value.splice(t,0,i),W.value=(u=W.value)==null?void 0:u.slice().sort((c,d)=>{if(c.label==="操作")return 1;if(d.label==="操作")return-1;const g=bl.value.findIndex(w=>w.label===c.label),S=bl.value.findIndex(w=>w.label===d.label);return g-S})}})};l.onMounted(()=>{Vl.value=window.innerWidth-240*2});const pr=()=>{l.nextTick(()=>{dr()})},ql=(e,a)=>{var r;if(!e&&!(e!=null&&e.children))return{contents:e,currentSelectContents:void 0};let n;return e.children=(r=e.children)==null?void 0:r.map(t=>{var i,u;if((t==null?void 0:t.id)===He.value){let c={};for(let d in t){let g=(i=a==null?void 0:a.find(S=>(S==null?void 0:S.prop)===d))==null?void 0:i.label;g?c[d]=(u=Oe.value)==null?void 0:u[g]:c[d]=t[d]}t=Object.assign(c,Oe.value),n=t}else{let c=ql(t,a);t=c==null?void 0:c.contents,n=c==null?void 0:c.currentSelectContents}return t}),{contents:e,currentSelectContents:n}},oa=(e,a)=>{let n,r;return e!=null&&e.find(t=>(t==null?void 0:t.id)===He.value)?n=e==null?void 0:e.map(t=>{var i,u;if((t==null?void 0:t.id)===He.value){let c={};for(let d in t){let g=(i=a==null?void 0:a.find(S=>(S==null?void 0:S.prop)===d))==null?void 0:i.label;g?c[d]=(u=Oe.value)==null?void 0:u[g]:c[d]=t[d]}t=Object.assign(c,Oe.value),r=t}return t}):n=e==null?void 0:e.map(t=>{var i,u,c,d;if((t==null?void 0:t.id)===He.value){let g={};for(let S in t){let w=(i=a==null?void 0:a.find(q=>(q==null?void 0:q.prop)===S))==null?void 0:i.label;w?g[S]=(u=Oe.value)==null?void 0:u[w]:g[S]=t[S]}t=Object.assign(g,Oe.value),r=t}else t=(c=ql(t,a))==null?void 0:c.contents,r=(d=ql(t,a))==null?void 0:d.currentSelectContents;return t}),{newContents:n,currentSelectContents:r}},ta=(e,a,n)=>{var r,t;return e[a==null?void 0:a.prop]=n,typeof e.id=="number"&&(e.id=(r=e.id)==null?void 0:r.toString()),e.children&&((t=e.children)==null?void 0:t.length)>0&&(e.children=e.children.map(ta)),e},Rl=e=>{var n;const a=[];return a.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((n=e.children)==null||n.forEach(r=>{a.push(...Rl(r))})),(a==null?void 0:a.length)>0?a==null?void 0:a.map(r=>{const t={...r};return delete t.children,t}):[]},Sl=(e=!0,a,n)=>{var g,S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p;let r=te.getColumnChild((g=m.cloneDeep(W.value))==null?void 0:g.filter(B=>(B==null?void 0:B.label)!=="操作")),t,i=m.cloneDeep(Y.value);if(!Oe.value){Qe.value=!1;return}if(He.value===""){ul.value++;let B;a&&n?B={id:ul.value.toString(),[a==null?void 0:a.prop]:n,children:Oe.value.children}:B={id:ul.value.toString()},B!=null&&B.children&&(B={...B,children:(S=B.children)==null?void 0:S.map(k=>ta(k,a,n))}),i.push(Object.assign(Oe.value,B)),t=Object.assign(Oe.value,B)}else i=(w=oa(i,r))==null?void 0:w.newContents,t=(q=oa(i,r))==null?void 0:q.currentSelectContents;const u=(h=s.itemData)==null?void 0:h.filter(B=>(B==null?void 0:B.key)==="childTree")[0];if(((E=u==null?void 0:u.contents)==null?void 0:E.length)>0){Pe.value="编辑";const B=[];i==null||i.forEach((k,C)=>{var I;let V={};if(Array.isArray(k)){let M=[];k==null||k.filter(v=>!(v!=null&&v.id)).forEach((v,J)=>{var pe,se,Te,be,_,f,ce;if((se=(pe=Fe.value)==null?void 0:pe[J])!=null&&se.prop&&!Array.isArray(v)){let ie={};ie[Fe.value[J].column]=v,ve!=null&&ve.value&&((Te=ve==null?void 0:ve.value)==null?void 0:Te.length)>0&&((be=ve==null?void 0:ve.value)!=null&&be.find(re=>JSON.stringify(re==null?void 0:re[0])===JSON.stringify(ie)))&&(M=(_=ve==null?void 0:ve.value)==null?void 0:_.find(re=>JSON.stringify(re==null?void 0:re[0])===JSON.stringify(ie))),M&&M.length>0?V[Fe.value[J].prop]=M!=null&&M.find(re=>{var ke;return((ke=Object.keys(re))==null?void 0:ke[0])===Fe.value[J].column})?(f=M==null?void 0:M.find(re=>{var ke;return((ke=Object.keys(re))==null?void 0:ke[0])===Fe.value[J].column}))==null?void 0:f[Fe.value[J].column]:v:V[Fe.value[J].prop]=v}else Array.isArray(v)&&((ce=Fe.value[J])!=null&&ce.prop?V[Fe.value[J].prop]=v:V.children=Hl(v,Fe.value))})}else V=k;Array.isArray(k)&&k.some(M=>M==null?void 0:M.id)?B.push(Object.assign(V,{id:(I=k==null?void 0:k.find(M=>M.id))==null?void 0:I.id})):V.id?B.push(V):B.push(Object.assign(V,{id:C.toString()}))}),Y.value=da(B,u,W.value)}else Y.value=i;ua(Y.value),_l.value=Y.value;const c=Qr(_l.value,Xe.value,i);let d=[];if(gl.value?(d=(U=m.cloneDeep(gl).value.singleContent)==null?void 0:U.filter(B=>(B==null?void 0:B.id)!==(t==null?void 0:t.id)),d.push(t)):d=[t],Ke.value){const B={content:c,singleContent:((N=u==null?void 0:u.contents)==null?void 0:N.length)>0?d==null?void 0:d.flatMap(Rl):d,index:s==null?void 0:s.index,buttonName:"编辑",column:W.value,parentTableId:s==null?void 0:s.parentTableId};xe.setCacheUpdatingData(B)}if(e&&!((K=(z=(R=Ee.value)==null?void 0:R[0])==null?void 0:z.optionUrl)!=null&&K.menuId)){const B={content:c,singleContent:((o=u==null?void 0:u.contents)==null?void 0:o.length)>0?Rl(t):t,index:s==null?void 0:s.index,buttonName:Pe.value,column:W.value,parentTableId:s==null?void 0:s.parentTableId};xe.setTableLoading(s==null?void 0:s.index),Qe.value=!1,Oe.value=void 0,G("change",B)}if((T=(y=(x=Ee.value)==null?void 0:x[0])==null?void 0:y.optionUrl)!=null&&T.menuId){Qe.value=!1;let B=(D=s.itemData)==null?void 0:D.filter(k=>(k==null?void 0:k.key)==="filterAllType");if((B==null?void 0:B.length)>0){let C=(ee=(L=(Q=(B==null?void 0:B.map(V=>V==null?void 0:V.value)).flat().find(V=>{var I;return(I=V==null?void 0:V.content)==null?void 0:I.includes("@Num")}))==null?void 0:Q.content)==null?void 0:L.split(":"))==null?void 0:ee[1];C=parseInt(C),Y.value=(p=Y.value)==null?void 0:p.slice(((A=Y.value)==null?void 0:A.length)-C,(F=Y.value)==null?void 0:F.length)}}};l.onUnmounted(()=>{W.value=[],Y.value=[],Me.value=[],H.value=[],$e.value=[],nl.value=[],yl.value=[],cl.value=[],Ee.value=[],ze.value=[],j.value=null});const sa=async(e,a,n)=>{var g,S,w,q,h,E,U,N,R,z,K;sl.value=n==null?void 0:n.prop;const r=m.cloneDeep(s.itemData),t=r==null?void 0:r.map(o=>{var x;return(o==null?void 0:o.key)==="header"&&((x=o.contents)==null||x.map((y,T)=>{var D,Q,L,ee,A,F,p,B,k,C,V,I,M,v,J,pe,se,Te,be;return y.type=y!=null&&y.type?y.type:(ee=(L=(Q=(D=y==null?void 0:y.key)==null?void 0:D.split("$"))==null?void 0:Q[1])==null?void 0:L.split("("))!=null&&ee[0]?(F=(A=te.FormType)==null?void 0:A.find(_=>{var f,ce,ie,re;return(_==null?void 0:_.key)===((re=(ie=(ce=(f=y==null?void 0:y.key)==null?void 0:f.split("$"))==null?void 0:ce[1])==null?void 0:ie.split("("))==null?void 0:re[0])}))==null?void 0:F.value:"Input",y.options=y!=null&&y.options?y.options:((k=(B=(p=y==null?void 0:y.key)==null?void 0:p.split("$"))==null?void 0:B[1])==null?void 0:k.length)>0?(M=(I=Gl((V=(C=y==null?void 0:y.key)==null?void 0:C.split("$"))==null?void 0:V[1]))==null?void 0:I.split(","))==null?void 0:M.map(_=>({label:_,value:_})):[],(v=y==null?void 0:y.key)!=null&&v.includes("$")&&(y.key=(pe=(J=y==null?void 0:y.key)==null?void 0:J.split("$"))==null?void 0:pe[0]),y.value=(se=Object.values(a))==null?void 0:se[T],y.optionUrl=y!=null&&y.formMenuSelect&&((Te=y==null?void 0:y.formMenuSelect)==null?void 0:Te.length)>0?{groupSelect:(be=y==null?void 0:y.groupSelect)==null?void 0:be.split(/[::]/).map(_=>_.trim()),menuSelect:y==null?void 0:y.formMenuSelect,selectRelateType:"",type:(y==null?void 0:y.formType)??(y!=null&&y.groupSelect?"Select":"")}:null,y})),o});let i=m.cloneDeep(Ee.value),u=(S=(g=m.cloneDeep(t))==null?void 0:g.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:S.contents;i=i==null?void 0:i.map(o=>{var x;return o.value=(x=u==null?void 0:u.find((y,T)=>T===(o==null?void 0:o.id)))==null?void 0:x.value,o});let c="",d=(h=(q=(w=m.cloneDeep(t))==null?void 0:w.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:q.contents)==null?void 0:h.find((o,x)=>{var y,T,D;return(o==null?void 0:o.label)===sl.value||(x==null?void 0:x.toString())===((D=(T=(y=sl.value)==null?void 0:y.split("a"))==null?void 0:T[1])==null?void 0:D.toString())});if((N=(U=(E=m.cloneDeep(t))==null?void 0:E.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:U.contents)==null||N.forEach(o=>{var x,y,T,D,Q;c===""&&((T=(y=(x=o==null?void 0:o.optionUrl)==null?void 0:x.groupSelect)==null?void 0:y[1])!=null&&T.includes("["))&&(c=(Q=(D=o==null?void 0:o.optionUrl)==null?void 0:D.groupSelect)==null?void 0:Q[1])}),(R=d==null?void 0:d.optionUrl)!=null&&R.menuSelect){let o=await Ql(d),x;if(o==null||o.forEach(y=>{var T,D,Q,L,ee,A,F,p,B,k;c===((D=(T=d==null?void 0:d.optionUrl)==null?void 0:T.groupSelect)==null?void 0:D[1])&&((ee=(L=(Q=d==null?void 0:d.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:L[1])!=null&&ee.includes("["))&&((k=m.cloneDeep(y))==null?void 0:k[(B=(p=(F=(A=d==null?void 0:d.optionUrl)==null?void 0:A.groupSelect)==null?void 0:F[1])==null?void 0:p.replaceAll("[",""))==null?void 0:B.replaceAll("]","")])===(d==null?void 0:d.value)&&(x=y)}),x){let y=m.cloneDeep(i);y=y==null?void 0:y.map(D=>{var Q,L,ee,A,F,p,B,k,C,V,I;return(x!=null&&x[D==null?void 0:D.label]||x!=null&&x[(A=(ee=(L=(Q=D==null?void 0:D.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:L[1])==null?void 0:ee.replaceAll("[",""))==null?void 0:A.replaceAll("]","")])&&((B=(p=(F=D==null?void 0:D.optionUrl)==null?void 0:F.groupSelect)==null?void 0:p[1])!=null&&B.includes("["))&&(D.value=(x==null?void 0:x[D==null?void 0:D.label])||(x==null?void 0:x[(I=(V=(C=(k=D==null?void 0:D.optionUrl)==null?void 0:k.groupSelect)==null?void 0:C[1])==null?void 0:V.replaceAll("[",""))==null?void 0:I.replaceAll("]","")])),D}),Y.value=(z=m.cloneDeep(Y.value))==null?void 0:z.map(D=>{if((D==null?void 0:D.id)===(a==null?void 0:a.id)){const Q={};return y==null||y.forEach(L=>{Q[L.name]=L.value}),Q.id=D==null?void 0:D.id,Q}return D});let T=m.cloneDeep(y);T=T==null?void 0:T.map(D=>{var Q,L,ee,A;return(L=(Q=D==null?void 0:D.optionUrl)==null?void 0:Q.menuSelect)!=null&&L.some(F=>F==null?void 0:F.includes)&&(D.optionUrl.menuSelect=(A=(ee=D==null?void 0:D.optionUrl)==null?void 0:ee.menuSelect)==null?void 0:A.map(F=>{var p,B,k,C;if(F!=null&&F.includes("[")){let V=(B=(p=F==null?void 0:F.replaceAll("[","").replaceAll("]",""))==null?void 0:p.split(":"))==null?void 0:B[1];F=(C=(k=m.cloneDeep(y))==null?void 0:k.find(I=>(I==null?void 0:I.label)===V))==null?void 0:C.value}return F})),D}),Y.value=(K=m.cloneDeep(Y.value))==null?void 0:K.map(D=>{if((D==null?void 0:D.id)===(a==null?void 0:a.id)){const Q={};return T==null||T.forEach(L=>{Q[L.name]=L.value}),Q.id=D==null?void 0:D.id,Q}return D})}}},fr=async e=>{var S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee;if(!e)return;Oe.value=e;const a=m.cloneDeep(s.itemData);let n=a==null?void 0:a.map(A=>{var F;return(A==null?void 0:A.key)==="header"&&((F=A.contents)==null||F.map((p,B)=>{var k,C,V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re,ke,Be,qe;return p.type=p!=null&&p.type?p.type:(I=(V=(C=(k=p==null?void 0:p.key)==null?void 0:k.split("$"))==null?void 0:C[1])==null?void 0:V.split("("))!=null&&I[0]?(v=(M=te.FormType)==null?void 0:M.find(_e=>{var je,Ie,el,ll;return(_e==null?void 0:_e.key)===((ll=(el=(Ie=(je=p==null?void 0:p.key)==null?void 0:je.split("$"))==null?void 0:Ie[1])==null?void 0:el.split("("))==null?void 0:ll[0])}))==null?void 0:v.value:"Input",p.options=p!=null&&p.options?p.options:((se=(pe=(J=p==null?void 0:p.key)==null?void 0:J.split("$"))==null?void 0:pe[1])==null?void 0:se.length)>0?(f=(_=Gl((be=(Te=p==null?void 0:p.key)==null?void 0:Te.split("$"))==null?void 0:be[1]))==null?void 0:_.split(","))==null?void 0:f.map(_e=>({label:_e,value:_e})):[],(ce=p==null?void 0:p.key)!=null&&ce.includes("$")&&(p.key=(re=(ie=p==null?void 0:p.key)==null?void 0:ie.split("$"))==null?void 0:re[0]),p.value=(ke=Object.values(e))==null?void 0:ke[B],p.optionUrl=p!=null&&p.formMenuSelect&&((Be=p==null?void 0:p.formMenuSelect)==null?void 0:Be.length)>0?{groupSelect:(qe=p==null?void 0:p.groupSelect)==null?void 0:qe.split(/[::]/).map(_e=>_e.trim()),menuSelect:p==null?void 0:p.formMenuSelect,selectRelateType:"",type:(p==null?void 0:p.formType)??(p!=null&&p.groupSelect?"Select":"")}:null,p})),A}),r=Ee.value,t=(w=(S=m.cloneDeep(n))==null?void 0:S.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:w.contents;if(t=t==null?void 0:t.filter(A=>(A==null?void 0:A.label)!=="操作"),t.push({label:"操作",type:"operate"}),r=r==null?void 0:r.map(A=>{var F;return A.value=A.value??((F=t==null?void 0:t.find((p,B)=>(p==null?void 0:p.prop)===(A==null?void 0:A.name)))==null?void 0:F.value),A}),!vl.value)return;let i="",u=(E=(h=(q=m.cloneDeep(n))==null?void 0:q.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:h.contents)==null?void 0:E.find((A,F)=>{var p,B,k;return(A==null?void 0:A.label)===sl.value||(F==null?void 0:F.toString())===((k=(B=(p=sl.value)==null?void 0:p.split("a"))==null?void 0:B[1])==null?void 0:k.toString())}),c=(U=u==null?void 0:u.optionUrl)==null?void 0:U.menuSelect,d=!0;(z=(R=(N=m.cloneDeep(n))==null?void 0:N.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:R.contents)==null||z.forEach(A=>{var F,p,B,k,C,V;d&&((B=(p=(F=A==null?void 0:A.optionUrl)==null?void 0:F.groupSelect)==null?void 0:p[1])!=null&&B.includes("["))&&(i=(C=(k=A==null?void 0:A.optionUrl)==null?void 0:k.groupSelect)==null?void 0:C[1],JSON.stringify(c)===JSON.stringify((V=A==null?void 0:A.optionUrl)==null?void 0:V.menuSelect)&&(d=!1))});let g=m.cloneDeep(r);if(g=g==null?void 0:g.map(A=>{var F,p;return(A==null?void 0:A.type)==="Select"&&((p=(F=A==null?void 0:A.optionUrl)==null?void 0:F.allSelectionContents)==null?void 0:p.length)>0&&(A.optionUrl.contactValue=e),A.value=e==null?void 0:e[A==null?void 0:A.prop],A}),Ee.value=m.cloneDeep(g),(K=u==null?void 0:u.optionUrl)!=null&&K.menuSelect&&vl.value||(y=(x=(o=Ee.value)==null?void 0:o[0])==null?void 0:x.optionUrl)!=null&&y.menuId){let A=await Ql(u,(Q=(D=(T=Ee.value)==null?void 0:T[0])==null?void 0:D.optionUrl)==null?void 0:Q.menuId),F;if((L=u==null?void 0:u.optionUrl)==null||L.menuSelect,A==null||A.forEach(p=>{var B,k,C,V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re;i===((k=(B=u==null?void 0:u.optionUrl)==null?void 0:B.groupSelect)==null?void 0:k[1])&&((I=(V=(C=u==null?void 0:u.optionUrl)==null?void 0:C.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((se=m.cloneDeep(p))==null?void 0:se[(pe=(J=(v=(M=u==null?void 0:u.optionUrl)==null?void 0:M.groupSelect)==null?void 0:v[1])==null?void 0:J.replaceAll("[",""))==null?void 0:pe.replaceAll("]","")])===(u==null?void 0:u.value)&&(F=p),(_=(be=(Te=Ee.value)==null?void 0:Te[0])==null?void 0:be.optionUrl)!=null&&_.menuId&&p[(ce=(f=Ee.value)==null?void 0:f[0])==null?void 0:ce.prop]===e[(re=(ie=Ee.value)==null?void 0:ie[0])==null?void 0:re.prop]&&(F=p)}),F){let p=m.cloneDeep(r);p=p==null?void 0:p.map(C=>{var V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re,ke,Be,qe,_e;return(F!=null&&F[C==null?void 0:C.label]||F!=null&&F[(v=(M=(I=(V=C==null?void 0:C.optionUrl)==null?void 0:V.groupSelect)==null?void 0:I[1])==null?void 0:M.replaceAll("[",""))==null?void 0:v.replaceAll("]","")])&&((se=(pe=(J=C==null?void 0:C.optionUrl)==null?void 0:J.groupSelect)==null?void 0:pe[1])!=null&&se.includes("["))&&(C.value=(F==null?void 0:F[C==null?void 0:C.label])||(F==null?void 0:F[(f=(_=(be=(Te=C==null?void 0:C.optionUrl)==null?void 0:Te.groupSelect)==null?void 0:be[1])==null?void 0:_.replaceAll("[",""))==null?void 0:f.replaceAll("]","")])),(re=(ie=(ce=Ee.value)==null?void 0:ce[0])==null?void 0:ie.optionUrl)!=null&&re.menuId&&(C.value=(F==null?void 0:F[C==null?void 0:C.label])||(F==null?void 0:F[(_e=(qe=(Be=(ke=C==null?void 0:C.optionUrl)==null?void 0:ke.groupSelect)==null?void 0:Be[1])==null?void 0:qe.replaceAll("[",""))==null?void 0:_e.replaceAll("]","")])),C}),Ee.value=m.cloneDeep(p);let B=m.cloneDeep(p);B=B==null?void 0:B.map(C=>{var V,I,M,v,J,pe;return(I=(V=C==null?void 0:C.optionUrl)==null?void 0:V.menuSelect)!=null&&I.some(se=>se==null?void 0:se.includes("["))&&(C.optionUrl.oldMenuSelect=(v=(M=m.cloneDeep(C))==null?void 0:M.optionUrl)==null?void 0:v.menuSelect,C.optionUrl.menuSelect=(pe=(J=C==null?void 0:C.optionUrl)==null?void 0:J.menuSelect)==null?void 0:pe.map(se=>{var Te,be,_,f;if(se!=null&&se.includes("[")){let ce=(be=(Te=se==null?void 0:se.replaceAll("[","").replaceAll("]",""))==null?void 0:Te.split(":"))==null?void 0:be[1];se=(f=(_=m.cloneDeep(p))==null?void 0:_.find(ie=>(ie==null?void 0:ie.label)===ce))==null?void 0:f.value}return se})),C}),Ee.value=B;let k={};(ee=Ee.value)==null||ee.forEach(C=>{k[C.prop]=C==null?void 0:C.value}),Oe.value=k}}vl.value=!1},gr=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",hr=e=>{var i,u;const a=(u=(i=$e.value)==null?void 0:i.find(c=>(c==null?void 0:c.label)===(e==null?void 0:e.label)))==null?void 0:u.multiple,n=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(c=>{const d=c==null?void 0:c[n];a&&ha.isString(d)&&(c[n]=[d]),!a&&!ha.isString(d)&&(c[n]="")})},ia=(e,a)=>{var n;return a==null||a.forEach(r=>{e[r==null?void 0:r.prop]=r==null?void 0:r.value}),e.children&&((n=e.children)==null?void 0:n.length)>0&&(e.children=e.children.map(r=>ia(r,a))),e},Jl=e=>{var n,r,t,i,u,c;ml("");const a=(n=Ee.value)==null?void 0:n.reduce((d,g)=>(d[g.name]=g.value,d),{});if(((r=Object.keys(a))==null?void 0:r.length)>0){Oe.value=a,He.value="",ul.value=(t=Y.value)==null?void 0:t.length,cl.value=(i=ol.value)==null?void 0:i.filter(g=>(g==null?void 0:g.label)!=="新增");const d=(c=(u=Me.value)==null?void 0:u.filter(g=>(g==null?void 0:g.label)!=="操作"))==null?void 0:c.map(g=>{var w,q,h;const S=(q=(w=$e.value)==null?void 0:w.find(E=>(E==null?void 0:E.label)===(g==null?void 0:g.label)))==null?void 0:q.multiple;return hr(g),{...g,contents:(g==null?void 0:g.options)??[],optionUrl:g!=null&&g.formMenuSelect&&((h=g==null?void 0:g.formMenuSelect)==null?void 0:h.length)>0?{groupSelect:g==null?void 0:g.groupSelect,menuSelect:g==null?void 0:g.formMenuSelect,selectRelateType:"",type:g==null?void 0:g.formType,multiple:S}:null}});W.value=d==null?void 0:d.map(g=>ia(g,[{prop:"type",value:"edit"},{prop:"columnType",value:gr(g==null?void 0:g.formType)||(g==null?void 0:g.columnType)}])),e==="createClick"&&Sl(!1)}},dl={START:"开始时间",END:"结束时间",HOURS:"工时"},yr=(e,a)=>Number(Wl.dayjs(a).diff(Wl.dayjs(e),"day",!0).toFixed(1)),ua=e=>{var i;const a=s.itemData,n=(i=a==null?void 0:a.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:i.contents,r=new Map;return n==null||n.forEach((u,c)=>{const{label:d}=u;r.set(d,c)}),!r.has(dl.START)||!r.has(dl.END)||!r.has(dl.HOURS)?e:e==null?void 0:e.map(u=>{const c=u==null?void 0:u[dl.START],d=u==null?void 0:u[dl.END],g=yr(c,d);return c&&d&&(u[dl.HOURS]=`${g}天`),u})},ca=(e,a,n=0)=>{if(n>((a==null?void 0:a.length)??""))return e;const r=a==null?void 0:a[n],t=new Map;for(const u of e){const c=u[r];t.has(c)||t.set(c,[]),t.get(c)&&t.get(c).push(u)}const i=[];for(const[u,c]of t){const[d,...g]=c,S={...d};n+1===((a==null?void 0:a.length)??"")?S.children=c==null?void 0:c.map(w=>(w.level=m.cloneDeep(n)+1,w)).filter((w,q)=>q!==0):g.length>0&&(S.children=ca(g,a,n+1)),S.level=n,i.push(S)}return i},da=(e,a,n)=>{var t;if(!(a!=null&&a.contents)||((t=a==null?void 0:a.contents)==null?void 0:t.length)===0)return e;let r=[];return r=ca(e,a==null?void 0:a.contents,0),r},pa=(e,a)=>{var q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p,B,k,C,V,I,M;const n=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="header");e==null||e.filter(v=>(v==null?void 0:v.key)==="tableIndexColumn")[0];const r=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="childTree")[0];let t=a;const i=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="page"),u=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="rowButton"),c=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="extraButton"),d=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableContents"),g=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableIndex");$e.value=(h=(q=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableToForm"))==null?void 0:q[0])==null?void 0:h.contents,Xl.value=(i==null?void 0:i.contents)??!0;let S=[];tl.value===""?S=n==null?void 0:n[0]:S=(n==null?void 0:n.find(v=>(v==null?void 0:v.selectLabel)==="("+tl.value+")"))??(n==null?void 0:n.find(v=>!(v!=null&&v.selectLabel)));let w=[];if(tl.value===""?w=g==null?void 0:g[0]:w=(g==null?void 0:g.find(v=>(v==null?void 0:v.selectLabel)==="("+tl.value+")"))??(g==null?void 0:g.find(v=>!(v!=null&&v.selectLabel))),((E=S==null?void 0:S.contents)==null?void 0:E.length)>0){let v=[];if(S!=null&&S.contents.some(_=>Array.isArray(_)&&(_==null?void 0:_.find(f=>f.children))))Xe.value===""?v=(N=(U=te.getGradeColumns(S==null?void 0:S.contents))==null?void 0:U[0])==null?void 0:N.filter(_=>!Array.isArray(_)):(Xe.value.split("-"),v=(R=te.getGradeColumns(S==null?void 0:S.contents))==null?void 0:R[0]);else{let _=S!=null&&S.contents.some(f=>Array.isArray(f))?(z=S==null?void 0:S.contents)==null?void 0:z[0]:S==null?void 0:S.contents;_==null||_.forEach((f,ce)=>{var ke,Be,qe,_e;let ie="";(Be=(ke=Z.value)==null?void 0:ke.split("/"))==null||Be.forEach(je=>{var Ie,el,ll;if(je!==""){let pl=(ll=(el=(Ie=je==null?void 0:je.split(fe+"updateLoading"))==null?void 0:Ie[0])==null?void 0:el.split(fe+"loading"))==null?void 0:ll[0];ie=ie===""?ie+pl:ie+"/"+pl}}),ie=ie+fe+(f==null?void 0:f.directiveLabel);const re=(qe=$e.value)==null?void 0:qe.find(je=>(je==null?void 0:je.prop)===(f==null?void 0:f.prop));v.push({label:(f==null?void 0:f.label)??"",prop:(f==null?void 0:f.label)==="操作"?"operate":(f==null?void 0:f.prop)??"a"+ce,width:f!=null&&f.width?parseInt(f.width):"",fixed:(f==null?void 0:f.fixed)??void 0,sortable:(f==null?void 0:f.sortable)??!1,filterable:(f==null?void 0:f.filterable)??!1,operable:(f==null?void 0:f.operable)??!1,showSummary:(f==null?void 0:f.showSummary)??!1,align:(f==null?void 0:f.align)??"left",showOverflowTooltip:(f==null?void 0:f.showOverflowTooltip)??!0,isNotDrag:(f==null?void 0:f.isNotDrag)??!1,isEditCol:(f==null?void 0:f.isEditCol)??!1,isOperate:(f==null?void 0:f.isOperate)??!1,id:(f==null?void 0:f.id)??ce,type:(f==null?void 0:f.label)==="操作"?"operate":void 0,formType:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":""),isTableColHidden:f==null?void 0:f.isTableColHidden,isFormColHidden:f==null?void 0:f.isFormColHidden,disabled:f==null?void 0:f.disabled,options:(f==null?void 0:f.options)??[],value:(f==null?void 0:f.value)??"",formMenuSelect:(f==null?void 0:f.formMenuSelect)??[],isRoute:(f==null?void 0:f.isRoute)??!1,groupSelect:f!=null&&f.groupSelect?(_e=f==null?void 0:f.groupSelect)==null?void 0:_e.replaceAll('"',"").split(":"):[],isMainKey:(f==null?void 0:f.isMainKey)||(f==null?void 0:f.directiveLabel)&&!t[ie],columnType:(re==null?void 0:re.type)||(f==null?void 0:f.columnType)||"TEXTAREA",directiveLabel:f==null?void 0:f.directiveLabel,isExistChild:!!(f!=null&&f.directiveLabel&&t[ie]),childPath:ie,allSelectionContents:(f==null?void 0:f.allSelectionContents)??[],selectFilter:f==null?void 0:f.selectFilter})})}W.value=te.getNewColumnChild(v),H.value=te.getNewColumnChild(v),X.value=(K=W.value)==null?void 0:K.map(_=>_==null?void 0:_.label),Ze.value=(o=W.value)==null?void 0:o.every(_=>_==null?void 0:_.filterable),ue.value=(x=W.value)==null?void 0:x.every(_=>_==null?void 0:_.operable),Ye.value=(y=W.value)==null?void 0:y.every(_=>_==null?void 0:_.sortable);let J=(D=(T=te.getAllLeafNodes(W.value))==null?void 0:T.filter(_=>(_==null?void 0:_.type)!=="operate"))==null?void 0:D.map((_,f)=>({prop:(_==null?void 0:_.prop)??"a"+f,column:_.label}));Fe.value=J;let pe=[];tl.value===""?pe=d==null?void 0:d[0]:pe=(d==null?void 0:d.find(_=>(_==null?void 0:_.selectLabel)==="("+tl.value+")"))??(d==null?void 0:d.find(_=>!(_!=null&&_.selectLabel)));let se=Array.isArray((Q=pe==null?void 0:pe.contents)==null?void 0:Q[0])&&((L=pe==null?void 0:pe.contents)!=null&&L[0].every(_=>Array.isArray(_)))?(ee=pe==null?void 0:pe.contents)==null?void 0:ee[0]:pe==null?void 0:pe.contents;w!=null&&w.contents&&((A=w==null?void 0:w.contents)==null?void 0:A.length)!==0&&(se=(F=m.cloneDeep(se))==null?void 0:F.map((_,f)=>{if(!Array.isArray(_)){let ce={};for(let ie in _)ie!=="id"&&ie!=="index"&&(ce[ie]=_[ie]);_=Object.values(ce)}return _}));const Te=!!((p=W.value)!=null&&p.find(_=>_.prop==="index"));se=ka(se,w==null?void 0:w.contents,Te);const be=[];se==null||se.forEach((_,f)=>{var ie;let ce={};if(Array.isArray(_)){let re=[];_==null||_.filter(ke=>!(ke!=null&&ke.id)).forEach((ke,Be)=>{var qe,_e,je,Ie,el,ll;if((qe=J==null?void 0:J[Be])!=null&&qe.prop&&!Array.isArray(ke)){let pl={};pl[J[Be].column]=ke,ve!=null&&ve.value&&((_e=ve==null?void 0:ve.value)==null?void 0:_e.length)>0&&((je=ve==null?void 0:ve.value)!=null&&je.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(pl)))&&(re=(Ie=ve==null?void 0:ve.value)==null?void 0:Ie.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(pl))),re&&re.length>0?ce[J[Be].prop]=re!=null&&re.find(Re=>{var Cl;return((Cl=Object.keys(Re))==null?void 0:Cl[0])===J[Be].column})?(el=re==null?void 0:re.find(Re=>{var Cl;return((Cl=Object.keys(Re))==null?void 0:Cl[0])===J[Be].column}))==null?void 0:el[J[Be].column]:ke:ce[J[Be].prop]=ke}else Array.isArray(ke)&&((ll=J[Be])!=null&&ll.prop?ce[J[Be].prop]=ke:ce.children=Hl(ke,J))})}else ce=_;Array.isArray(_)&&_.some(re=>re==null?void 0:re.id)?be.push(Object.assign(ce,{id:(ie=_==null?void 0:_.find(re=>re.id))==null?void 0:ie.id})):ce.id?be.push(ce):be.push(Object.assign(ce,{id:f.toString()}))}),Y.value=da(be,r,W.value),Tl.value=be,(B=Tl.value)==null||B.forEach(_=>{var f;(f=Nl.value)==null||f.set(_.id,_)})}else W.value=[],Me.value=[],Y.value=[],Tl.value=[],Nl.value=new Map;((k=u==null?void 0:u.contents)==null?void 0:k.length)>0?nl.value=u==null?void 0:u.contents:nl.value=[],((C=c==null?void 0:c.contents)==null?void 0:C.length)>0?(cl.value=c==null?void 0:c.contents,ol.value=c==null?void 0:c.contents):(cl.value=[],ol.value=[]),ul.value=((V=Y==null?void 0:Y.value)==null?void 0:V.length)??0,ua(Y.value),_l.value=Y.value,Ke.value&&(W.value=(M=(I=Me.value)==null?void 0:I.filter(v=>(v==null?void 0:v.label)!=="操作"))==null?void 0:M.map(v=>{var J;return{...v,type:"edit",optionUrl:v!=null&&v.formMenuSelect&&((J=v==null?void 0:v.formMenuSelect)==null?void 0:J.length)>0?{groupSelect:v==null?void 0:v.groupSelect,menuSelect:v==null?void 0:v.formMenuSelect,selectRelateType:"",type:v==null?void 0:v.formType}:null}}),Jl())};l.watch(()=>[s.itemData,tl.value,Na.value,Xe.value,ve==null?void 0:ve.value],async()=>{var e,a,n,r,t,i;if((e=s==null?void 0:s.itemData)!=null&&e.find(u=>(u==null?void 0:u.key)==="columnPath")&&!((a=hl.value)!=null&&a.find(u=>{var c,d;return(u==null?void 0:u.key)===((d=(c=s==null?void 0:s.itemData)==null?void 0:c.find(g=>(g==null?void 0:g.key)==="columnPath"))==null?void 0:d.contents)}))){let u=hl.value,c={key:(r=(n=s==null?void 0:s.itemData)==null?void 0:n.find(d=>(d==null?void 0:d.key)==="columnPath"))==null?void 0:r.contents,value:(i=(t=s==null?void 0:s.itemData)==null?void 0:t.find(d=>(d==null?void 0:d.key)==="columnUsingPath"))==null?void 0:i.contents};u!=null&&u.find(d=>(d==null?void 0:d.key)===(c==null?void 0:c.key))?u=u==null?void 0:u.map(d=>((d==null?void 0:d.key)===(c==null?void 0:c.key)&&(d.value=c.value),d)):u.push(c),xe.setTableViewContents(u)}pa(s.itemData,s.allMapContents)},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.operatingForm,e=>{e!=null&&e.form&&(ml(e==null?void 0:e.form),Pe.value=e==null?void 0:e.dialogTitle,Al.value=!0,Qe.value=!0)},{immediate:!0,deep:!0});const fa=()=>{var e;(e=me.value)!=null&&e.includes("read")&&(Ke.value=!Ke.value)},vr=()=>{Ul.value=!Ul.value};l.watch(()=>{var e;return(e=s==null?void 0:s.config)==null?void 0:e.viewport},e=>{var a;me.value=e,(e==null?void 0:e.length)===0?Ke.value=!1:(e!=null&&e.includes("read")||(Ke.value=!0),e!=null&&e.includes("edit")||(Ke.value=!1)),ge.value=((a=s==null?void 0:s.config)==null?void 0:a.showIndex)||Ke.value},{immediate:!0}),l.watch(()=>Ke.value,e=>{var a;e?(Jl("viewChange"),xe.setCacheUpdatingData(null)):(cl.value=ol.value,W.value=H.value,gl.value&&(xe.setTableLoading(s==null?void 0:s.index),G("change",gl.value))),ae.value=e,ge.value=e||((a=s==null?void 0:s.config)==null?void 0:a.showIndex)},{immediate:!0}),l.watch(()=>{var e;return(e=Zl.value)==null?void 0:e.length},e=>{e===0&&(oe.currentPage=1)}),l.watch(()=>s==null?void 0:s.compNames,e=>{De.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:e||[],width:1}]},{immediate:!0}),l.ref(!1);const br=(e,a)=>{var n;Jl("createClick"),a===oe.pageSize&&(oe.currentPage=Math.ceil(((n=Y.value)==null?void 0:n.length)/oe.pageSize))},kr=(e,a,n)=>{var r;sa(n,e,a),Oe.value=m.cloneDeep(e),He.value=e==null?void 0:e.id,ul.value=(r=Y.value)==null?void 0:r.length,Pe.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",Sl(!1)},Le=e=>{var d,g,S,w,q,h,E,U,N,R;const{row:a,column:n,item:r,slotData:t}=e;let i=a!=null&&a[n==null?void 0:n.prop]||(a==null?void 0:a[n==null?void 0:n.prop])===0?((g=(d=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:d[0])==null?void 0:g.contents)??((a==null?void 0:a[n==null?void 0:n.prop])===0?"0":a==null?void 0:a[n==null?void 0:n.prop]):((w=(S=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:S[0])==null?void 0:w.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((h=(q=t==null?void 0:t[r==null?void 0:r.prop])==null?void 0:q[0])==null?void 0:h.contents)??(t==null?void 0:t[r==null?void 0:r.prop])??((N=(U=a==null?void 0:a[(E=r==null?void 0:r.child)==null?void 0:E.prop])==null?void 0:U[0])==null?void 0:N.contents)??(a==null?void 0:a[(R=r==null?void 0:r.child)==null?void 0:R.prop]),c=Array.isArray(i)&&!(i!=null&&i.every(z=>typeof z=="string"||typeof z=="number"))?"查看":i;return c=Array.isArray(c)?c.join(","):c,c},mr=e=>{var g,S,w,q,h,E,U,N,R,z;const{row:a,column:n,item:r,slotData:t}=e;let i=a!=null&&a[n==null?void 0:n.prop]?((S=(g=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:g[0])==null?void 0:S.contents)??(a==null?void 0:a[n==null?void 0:n.prop]):((q=(w=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:w[0])==null?void 0:q.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((E=(h=t==null?void 0:t[r==null?void 0:r.prop])==null?void 0:h[0])==null?void 0:E.contents)??(t==null?void 0:t[r==null?void 0:r.prop])??((R=(N=a==null?void 0:a[(U=r==null?void 0:r.child)==null?void 0:U.prop])==null?void 0:N[0])==null?void 0:R.contents)??(a==null?void 0:a[(z=r==null?void 0:r.child)==null?void 0:z.prop]);const c=Array.isArray(i)&&!(i!=null&&i.every(K=>typeof K=="string"||typeof K=="number")),d=Array.isArray(i)&&(i==null?void 0:i.find(K=>K==null?void 0:K.url));return c&&d},Sr=(e,a)=>e.find(n=>Object.values(n).some(r=>r===a));return l.watch(()=>Ge.value,async e=>{if(e){P.setContentLoading(!0),await l.nextTick();const a=Sr(Y.value,e==null?void 0:e.data);if(!a)return P.setContentLoading(!1);await la(e==null?void 0:e.data,null,a,{data:e==null?void 0:e.data,isMainKey:!0}),P.setContentLoading(!1)}},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.cacheNewData,e=>{var a;e&&(Array.isArray(e)||(e==null?void 0:e.compId)===(s==null?void 0:s.index)&&(Y.value=(a=Y.value)==null?void 0:a.map(n=>{var r;return(n==null?void 0:n.id)===((r=e==null?void 0:e.data)==null?void 0:r.id)?{...n,id:e==null?void 0:e.resId}:n})))},{immediate:!0,deep:!0}),(e,a)=>{var g,S,w,q;const n=l.resolveComponent("svg-icon"),r=l.resolveComponent("el-popover"),t=l.resolveComponent("el-switch"),i=l.resolveComponent("el-checkbox"),u=l.resolveComponent("el-checkbox-group"),c=l.resolveComponent("el-button"),d=l.resolveComponent("LookComponent");return l.openBlock(),l.createElementBlock("div",Yr,[Yl.value?(l.openBlock(),l.createBlock(Je.ssTable,{id:"excel-table",pageObj:oe,showIndex:ge.value,isTree:(g=O.compItem)==null?void 0:g.isTree,summaryInfo:ye,columns:W.value,defaultSort:Ne,isCardViewport:Ul.value,checkedColumns:X.value,key:Pl.value+JSON.stringify(W.value),tableData:Zl.value,isEditViewport:Ke.value,isShowPagination:Xl.value,isShowEdit:!1,isShowDelete:!1,allowSelect:ae.value,onDbClickRow:Xa,extraButton:cl.value,rowButton:nl.value,cacheExtraButtons:ol.value,isClearSelection:((S=ze.value)==null?void 0:S.length)===0,onDoCurrentChange:Ua,onDoSizeChange:Oa,onContentClick:la,onRowClick:Za,onSelectChange:Fa,onCellChange:kr,onChange:sa,onPreview:Il,onSubmitEditingTable:Pa,onHandleColEditChange:$a,onHandleColTypeChange:Va,onClickButton:Ml},l.createSlots({headerButton:l.withCtx(h=>{var E,U;return[O.showHeader?(l.openBlock(),l.createBlock(Pr,{key:0,pageLayout:O.pageLayout,lockingPage:l.unref(Dl)===l.unref(Z),filterValues:ea.value,selectNums:(E=ze.value)==null?void 0:E.length,dataNums:(U=Y.value)==null?void 0:U.length,compName:O.compName,isDevMode:O.isDevMode,buttons:h.buttons,onButtonClick:a[0]||(a[0]=N=>Ml(N,"",{})),columns:W.value,onFilter:Qa,onGetImportData:ja,level:O.level},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level"])):l.createCommentVNode("",!0)]}),viewport:l.withCtx(()=>{var h,E,U,N;return[((h=Y.value)==null?void 0:h.length)>0&&O.allowOperate?(l.openBlock(),l.createElementBlock("div",en,[(E=me.value)!=null&&E.includes("read")&&((U=me.value)!=null&&U.includes("edit"))&&((N=nl.value)!=null&&N.some(R=>(R==null?void 0:R.label)==="编辑"))&&!Ul.value&&l.unref(Dl)!==l.unref(Z)?(l.openBlock(),l.createElementBlock("span",{key:0,title:"编辑表格",onClick:fa},[l.createVNode(n,{name:"editTable",class:"view-icon"})])):l.createCommentVNode("",!0),l.createElementVNode("span",{title:"卡片视图",onClick:vr},[l.createVNode(n,{name:"cardViewport",class:"view-icon"})])])):l.createCommentVNode("",!0)]}),rowCreate:l.withCtx(({row:h,index:E})=>[l.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:U=>br(h,E)},[l.createVNode(n,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,ln)]),operateCol:l.withCtx(()=>[l.createVNode(r,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:pr},{reference:l.withCtx(()=>[l.createElementVNode("span",an,[l.createVNode(n,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:l.withCtx(()=>[l.createElementVNode("div",rn,[a[11]||(a[11]=l.createElementVNode("div",{class:"group-title"},"表格操作",-1)),l.createVNode(t,{"model-value":Ye.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:a[2]||(a[2]=h=>Kl(h,"sortable"))},null,8,["model-value"]),l.createVNode(t,{"model-value":Ze.value,"active-text":"筛选","inactive-text":"",style:{"margin-right":"8px"},onChange:a[3]||(a[3]=h=>Kl(h,"filterable"))},null,8,["model-value"]),l.createVNode(t,{"model-value":ue.value,"active-text":"编辑所有表头","inactive-text":"",onChange:a[4]||(a[4]=h=>Kl(h,"operable"))},null,8,["model-value"]),a[12]||(a[12]=l.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),l.createVNode(u,{modelValue:X.value,"onUpdate:modelValue":a[5]||(a[5]=h=>X.value=h),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:j},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(bl.value,h=>(l.openBlock(),l.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:h.label},[l.createVNode(i,{value:h.label,style:{width:"100%",marginRight:0}},{default:l.withCtx(()=>[l.createElementVNode("span",{title:h.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},l.toDisplayString(h.label),9,nn)]),_:2},1032,["value"]),l.createVNode(r,{title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:l.withCtx(()=>{var E;return[l.createElementVNode("div",on,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((E=Object.keys(h))==null?void 0:E.filter(U=>{var N;return(N=he.value)==null?void 0:N.find(R=>(R==null?void 0:R.value)===U)}),U=>{var N,R;return l.openBlock(),l.createElementBlock("div",{key:U},[l.createVNode(t,{"model-value":h==null?void 0:h[U],"active-text":(R=(N=he.value)==null?void 0:N.find(z=>(z==null?void 0:z.value)===U))==null?void 0:R.label,onChange:z=>za(z,U,h)},null,8,["model-value","active-text","onChange"])])}),128))])]}),_:2},1024),l.createElementVNode("span",tn,[l.createVNode(n,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:l.withCtx(h=>{var E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p,B;return[mr(h)?(l.openBlock(),l.createBlock(r,{key:0,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:l.withCtx(()=>[l.createElementVNode("span",sn,l.toDisplayString(Le(h)),1)]),default:l.withCtx(()=>{var k,C;return[l.createElementVNode("div",un,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((C=h==null?void 0:h.row)==null?void 0:C[(k=h==null?void 0:h.column)==null?void 0:k.prop],V=>(l.openBlock(),l.createElementBlock("div",cn,[l.createElementVNode("div",{class:"prop-url",title:jl(V),onClick:I=>Ja(V)},l.toDisplayString(jl(V)),9,dn),l.createElementVNode("div",{class:"prop-download",onClick:I=>Wa(V)}," 下载 ",8,pn)]))),256))])]}),_:2},1024)):(l.openBlock(),l.createElementBlock("div",{key:1,style:l.normalizeStyle({color:!Array.isArray(Le(h))&&((U=(E=Le(h))==null?void 0:E.toString())!=null&&U.includes(".txt")||(R=(N=Le(h))==null?void 0:N.toString())!=null&&R.includes(".cpt")||(K=(z=Le(h))==null?void 0:z.toString())!=null&&K.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(Le(h))&&((x=(o=Le(h))==null?void 0:o.toString())!=null&&x.includes(".txt")||(T=(y=Le(h))==null?void 0:y.toString())!=null&&T.includes(".cpt")||(Q=(D=Le(h))==null?void 0:D.toString())!=null&&Q.includes(".cyd"))?"underline":"",cursor:!Array.isArray(Le(h))&&((ee=(L=Le(h))==null?void 0:L.toString())!=null&&ee.includes(".txt")||(F=(A=Le(h))==null?void 0:A.toString())!=null&&F.includes(".cpt")||(B=(p=Le(h))==null?void 0:p.toString())!=null&&B.includes(".cyd"))?"pointer":"",marginLeft:(h==null?void 0:h.colIndex)===0?`${((h==null?void 0:h.level)??0)*20}px`:0}),onClick:k=>wa(Le(h))},l.toDisplayString(Le(h)===0?"0":Le(h)),13,fn))]}),_:2},[((w=nl.value)==null?void 0:w.length)>0&&l.unref(Dl)!==l.unref(Z)?{name:"actions",fn:l.withCtx(({item:h})=>[l.createVNode(r,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:l.withCtx(()=>[l.createElementVNode("div",Zr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ga(nl.value,h),(E,U)=>(l.openBlock(),l.createElementBlock("div",{class:"menu-config-item",key:U,onClick:N=>Ml(E==null?void 0:E.label,h,{extra:E})},[l.createElementVNode("div",{style:l.normalizeStyle({color:E==null?void 0:E.textColor}),class:"extra-button-label"},l.toDisplayString(E==null?void 0:E.label),5)],8,Ir))),128))])]),_:2},1024)]),key:"0"}:void 0,((q=Y.value)==null?void 0:q.length)>0?{name:"batchButton",fn:l.withCtx(h=>[l.withDirectives(l.createVNode(Kr,{lockingPage:l.unref(Dl)===l.unref(Z),buttons:h.buttons,selectTableItems:ze.value,onButtonClick:a[1]||(a[1]=E=>Ml(E,"",{}))},null,8,["lockingPage","buttons","selectTableItems"]),[[l.vShow,ae.value]]),l.withDirectives(l.createElementVNode("div",null,null,512),[[l.vShow,!ae.value]])]),key:"1"}:void 0]),1032,["pageObj","showIndex","isTree","summaryInfo","columns","defaultSort","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection"])):l.createCommentVNode("",!0),l.createVNode(xl.ssDialog,{title:Pe.value,visible:Qe.value,width:Ba.value,onBeforeDestroy:qa,style:{height:"74%"}},{default:l.withCtx(()=>[l.createElementVNode("div",gn,[l.createVNode(Je.ssForm,{rowContents:Ee.value,isEnableWrap:!1,showOperator:!1,onChange:fr,onClickTrigger:Ra,isEdit:El.value,onBlurChange:Ka},null,8,["rowContents","isEdit"])])]),footer:l.withCtx(()=>[Al.value?(l.openBlock(),l.createElementBlock("div",hn,[l.createVNode(c,{onClick:a[6]||(a[6]=h=>Qe.value=!1),id:"themeBorderButton"},{default:l.withCtx(()=>a[13]||(a[13]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[13]}),l.createVNode(c,{class:"ok-button",onClick:a[7]||(a[7]=h=>Sl(!0)),id:"themeButton"},{default:l.withCtx(()=>a[14]||(a[14]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[14]})])):l.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),l.createVNode(xl.ssDialog,{title:Pe.value,visible:Bl.value,width:Vl.value,onBeforeDestroy:a[9]||(a[9]=h=>Bl.value=!1)},{default:l.withCtx(()=>[l.createVNode(Wr)]),footer:l.withCtx(()=>[l.createElementVNode("div",yn,[l.createVNode(c,{onClick:a[8]||(a[8]=h=>Bl.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:l.withCtx(()=>a[15]||(a[15]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[15]}),l.createVNode(c,{class:"ok-button",onClick:Ia,id:"themeButton"},{default:l.withCtx(()=>a[16]||(a[16]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[16]})])]),_:1},8,["title","visible","width"]),b.value?(l.openBlock(),l.createBlock(Je.ssFilePreview,{key:1,fileDataList:Se.value,onDestroy:Ya},null,8,["fileDataList"])):l.createCommentVNode("",!0),ne.value?(l.openBlock(),l.createBlock(xl.ssDialog,{key:2,visible:ne.value,onBeforeDestroy:cr,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:l.withCtx(()=>[l.createVNode(fl.ThreeViewerHost,{"file-urls":yl.value,isThreeScene:we.value,isSelfWindow:!0,threeData:Ue.value},null,8,["file-urls","isThreeScene","threeData"])]),_:1},8,["visible"])):l.createCommentVNode("",!0),l.createVNode(xl.ssDialog,{visible:e.componentVisible,onBeforeDestroy:a[10]||(a[10]=h=>e.componentVisible=!1),width:Vl.value,style:{height:"70vh"}},{default:l.withCtx(()=>[l.createVNode(d,{dialogItem:Ol.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),l.createVNode(xl.ssDialog,{title:De.title,visible:De.show,width:De.width,onBeforeDestroy:nr},{default:l.withCtx(()=>[l.createElementVNode("div",vn,[l.createVNode(Je.ssForm,{rowContents:De==null?void 0:De.contents,formRules:De==null?void 0:De.formRules,showOperator:!1,buttonValue:De.buttonValue,isEdit:El.value,isStartJustify:!1,isEnableWrap:!1,onOnButtonClick:or},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},kn=$l._export_sfc(bn,[["__scopeId","data-v-87f94f9e"]]);exports.formGetOptions=Gl;exports.getSelectRow=Ql;exports.ssTable=kn;exports.useFormComp=Ca;exports.useFormToTableComp=va;exports.useUnit=ba;
|
|
1
|
+
"use strict";const l=require("vue"),m=require("./index-C8qRkCgn.cjs"),Wl=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DupRlL-E.cjs"),Je=require("./index-CQNvplpY.cjs"),fl=require("./threeViewerHost-C07FM01K.cjs"),te=require("./index.vue_vue_type_style_index_1_lang-Cb4_k0AS.cjs"),il=require("./xlsx-BPHygxEf.cjs");require("./index.vue_vue_type_style_index_1_lang-CKpfQuiD.cjs");const $l=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xl=require("./index-DeakNivq.cjs");require("./index-BU5DWXf0.cjs");const ha=require("./isString--eJE54G5.cjs"),Gl=O=>O.match(/\((.*)\)/)[1],ya={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(O){const le=O,X=l.ref(null),$=l.ref(!1),j=l.ref(null);return l.watch(()=>le==null?void 0:le.isVisible,()=>{$.value=le==null?void 0:le.isVisible},{deep:!0,immediate:!0}),l.watch(()=>j.value,()=>{l.nextTick(()=>{var s,ae;(ae=(s=X.value)==null?void 0:s.updatePopper)==null||ae.call(s)})},{deep:!0,immediate:!0}),(s,ae)=>{const ge=l.resolveComponent("el-popover");return l.openBlock(),l.createBlock(ge,{visible:$.value,title:le==null?void 0:le.title,placement:le==null?void 0:le.placement,width:le==null?void 0:le.width,ref_key:"popOverRef",ref:X},{reference:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"reference",{ref_key:"referenceRef",ref:j})])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(s.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Cr={key:0,class:"extra-button-content"},xr={class:"table-operator-wrap"},Dr={class:"extra-button-filter"},Tr={class:"form-content-value"},Nr={key:0,class:"extra-header"},Er={class:"drop-menu",style:{width:"120px"}},Br={key:0},Ar={key:1},_r={key:1,class:"extra-button-content tabs-button-wrapper"},wr={class:"table-operator-wrap"},Ur={class:"extra-button-filter"},Or={class:"form-content-value"},Lr={key:0,class:"extra-header"},jr={class:"drop-menu",style:{width:"120px"}},Mr={key:0},$r={key:1},Vr={__name:"header",props:{pageLayout:{type:String,default:"vertical"},lockingPage:Boolean,level:{type:Number,default:1},compName:{type:String,default:"表格名称",required:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,filterValues:Array,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(O,{emit:le}){const X=le,$=O,j=l.ref(""),s=l.ref(!1),ae=l.ref([]),ge=l.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),me=[{label:"新增",icon:"Plus"},{label:"导入",icon:"import"},{label:"导出",icon:"export"}],he=ue=>{const ye=ue.raw;if(!ye)return;const oe=new FileReader;oe.onload=G=>{try{const W=new Uint8Array(G.target.result),Ne=il.readSync(W,{type:"array"}),Me=Ne.SheetNames[0],ne=Ne.Sheets[Me],Ue=il.utils.decode_range(ne["!ref"]).e.c+1,H=new Array(Ue).fill(""),b=[];for(const P in ne){if(P[0]==="!")continue;const{r:de,c:Z}=il.utils.decode_cell(P);let Ae=ne[P].v;if(ne[P].t==="n"&&Ae>0&&Ae<1e6&&(Ae=new Date((Ae-25569)*86400*1e3).toISOString().split("T")[0]),(Ae==null||Ae==="")&&(Ae=""),de===0)H[Z]=Ae;else{if(!b[de-1]){b[de-1]={};for(let Ge=0;Ge<Ue;Ge++)b[de-1][`col_${Ge}`]=""}b[de-1][`col_${Z}`]=Ae}}for(let P=0;P<Ue;P++)H[P]===void 0&&(H[P]="");const Se=b==null?void 0:b[0];if(!(Se!=null&&Se.hasOwnProperty("col_0")))return m.ElMessage.error("导入的数据列不匹配,请检查是否错位");X("getImportData",H,b)}catch(W){throw m.ElMessage.error(W.message),new Error(W.message)}},oe.readAsArrayBuffer(ye)},Ve=ue=>{var oe;const ye=(oe=ae.value)==null?void 0:oe.reduce((G,W,Ne)=>(Ne===0?G[W.label]=ue:G[W.label]=W==null?void 0:W.value,G),{});X("filter",ye,ue,!0)},We=ue=>{X("buttonClick",ue)},al=ue=>{var ye,oe;ae.value=(oe=(ye=te.getColumnChild(m.cloneDeep(ue)))==null?void 0:ye.filter(G=>(G==null?void 0:G.label)!==""&&(G==null?void 0:G.label)!=="操作"))==null?void 0:oe.map(G=>({label:(G==null?void 0:G.label)??"",value:"",name:(G==null?void 0:G.label)??"",isFormColHidden:G==null?void 0:G.isTableColHidden,width:2}))},fe=l.ref(!1),Ye=ue=>{var ye;if((ue==null?void 0:ue.buttonName)==="确认"&&(X("filter",ue==null?void 0:ue.content),fe.value=(ue==null?void 0:ue.content)&&Object.values(ue==null?void 0:ue.content).length>0),(ue==null?void 0:ue.buttonName)==="清空"){const oe=m.cloneDeep(ue==null?void 0:ue.content);for(const G in oe)oe[G]="";ae.value=(ye=ae.value)==null?void 0:ye.map(G=>({...G,value:""})),X("filter",oe),fe.value=!1}s.value=!1},Ze=()=>{var ye,oe;ae.value=(ye=ae.value)==null?void 0:ye.map(G=>({...G,value:""}));const ue=(oe=ae.value)==null?void 0:oe.reduce((G,W)=>(G[W.label]=W.value,G),{});X("filter",ue)};return l.onMounted(()=>{al($.columns)}),l.watch(()=>$.columns,()=>{al($.columns)},{deep:!0,immediate:!0}),(ue,ye)=>{var ne,we,Ue,H;const oe=l.resolveComponent("el-icon"),G=l.resolveComponent("svg-icon"),W=l.resolveComponent("el-input"),Ne=l.resolveComponent("el-button"),Me=l.resolveComponent("el-upload");return O.pageLayout==="vertical"?(l.openBlock(),l.createElementBlock("div",Cr,[l.createElementVNode("div",{class:l.normalizeClass(O.compName?"table-name-wrap":""),style:l.normalizeStyle({background:($==null?void 0:$.level)>1?"transparent":"var(--ssgroup-background)",paddingLeft:(($==null?void 0:$.level)-1)*12+"px",fontWeight:600-(($==null?void 0:$.level)-1)*100>=400?600-(($==null?void 0:$.level)-1)*100:400,fontSize:17-($==null?void 0:$.level)>=14?17-($==null?void 0:$.level)+"px":"14px"})},l.toDisplayString(O.compName),7),l.createElementVNode("div",xr,[l.createElementVNode("div",Dr,[l.createVNode(ya,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var b,Se,P,de;return[l.createVNode(W,{modelValue:j.value,"onUpdate:modelValue":ye[1]||(ye[1]=Z=>j.value=Z),style:{"min-width":"80px"},placeholder:fe.value?(P=(Se=(b=O.filterValues)==null?void 0:b.filter(Z=>Z))==null?void 0:Se.slice(0,3))==null?void 0:P.join("/"):"搜索","prefix-icon":l.unref(m.search_default),clearable:"",onInput:Ve,disabled:((de=ae.value)==null?void 0:de.length)===0},{suffix:l.withCtx(()=>{var Z,Ae;return[!j.value&&((Ae=(Z=O.filterValues)==null?void 0:Z.filter(Ge=>Ge))!=null&&Ae.join("/"))?(l.openBlock(),l.createBlock(oe,{key:0,style:{cursor:"pointer"},onClick:Ze},{default:l.withCtx(()=>[l.createVNode(l.unref(m.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:ye[0]||(ye[0]=Z=>s.value=!s.value)},[l.createVNode(G,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Tr,[(l.openBlock(),l.createBlock(Je.ssForm,{rowContents:ae.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ye},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((ne=O.buttons)==null?void 0:ne.length)>0?(l.openBlock(),l.createElementBlock("div",Nr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((we=O.buttons)==null?void 0:we.filter(b=>O.isDevMode||(b==null?void 0:b.label)!=="修改模板"),(b,Se)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:Se},[(b==null?void 0:b.type)==="upload"?(l.openBlock(),l.createBlock(Me,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1,disabled:!!O.lockingPage},{default:l.withCtx(()=>[l.createVNode(Ne,{disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style"])]),_:2},1032,["disabled"])):l.createCommentVNode("",!0),(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Je._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Ne,{key:0,disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style"])):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",Er,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b==null?void 0:b.contents,P=>(l.openBlock(),l.createBlock(Ne,{key:P==null?void 0:P.label,disabled:!!O.lockingPage,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:de=>We(P==null?void 0:P.label)},{default:l.withCtx(()=>{var de,Z;return[l.createTextVNode(l.toDisplayString(P==null?void 0:P.label),1),(de=P==null?void 0:P.label)!=null&&de.includes("选中")?(l.openBlock(),l.createElementBlock("span",Br,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(Z=P==null?void 0:P.label)!=null&&Z.includes("全部")?(l.openBlock(),l.createElementBlock("span",Ar,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["disabled","onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),b!=null&&b.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ne,{key:2,id:"themeButton",disabled:!!O.lockingPage,style:l.normalizeStyle({background:(b==null?void 0:b.background)??"var(--ssbutton-theme-bg)",color:(b==null?void 0:b.color)??"var(--ssbutton-theme-color)"}),onClick:P=>We(b==null?void 0:b.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["disabled","style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])])):(l.openBlock(),l.createElementBlock("div",_r,[l.createElementVNode("div",wr,[l.createElementVNode("div",Ur,[l.createVNode(ya,{title:"",width:800,placement:"bottom-start",isVisible:s.value},{reference:l.withCtx(()=>{var b,Se,P,de;return[l.createVNode(W,{modelValue:j.value,"onUpdate:modelValue":ye[3]||(ye[3]=Z=>j.value=Z),style:{"min-width":"80px"},placeholder:fe.value?(P=(Se=(b=O.filterValues)==null?void 0:b.filter(Z=>Z))==null?void 0:Se.slice(0,3))==null?void 0:P.join("/"):"搜索","prefix-icon":l.unref(m.search_default),clearable:"",onInput:Ve,disabled:((de=ae.value)==null?void 0:de.length)===0},{suffix:l.withCtx(()=>{var Z,Ae;return[!j.value&&((Ae=(Z=O.filterValues)==null?void 0:Z.filter(Ge=>Ge))!=null&&Ae.join("/"))?(l.openBlock(),l.createBlock(oe,{key:0,style:{cursor:"pointer"},onClick:Ze},{default:l.withCtx(()=>[l.createVNode(l.unref(m.circle_close_default))]),_:1})):l.createCommentVNode("",!0)]}),append:l.withCtx(()=>[l.createElementVNode("span",{title:"条件查询",onClick:ye[2]||(ye[2]=Z=>s.value=!s.value)},[l.createVNode(G,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:l.withCtx(()=>[l.createElementVNode("div",Or,[(l.openBlock(),l.createBlock(Je.ssForm,{rowContents:ae.value,buttonValue:ge.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:ge.value,isStartJustify:!1,onOnButtonClick:Ye},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),O.buttons&&((Ue=O.buttons)==null?void 0:Ue.length)>0?(l.openBlock(),l.createElementBlock("div",Lr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((H=O.buttons)==null?void 0:H.filter(b=>O.isDevMode||(b==null?void 0:b.label)!=="修改模板"),(b,Se)=>(l.openBlock(),l.createElementBlock("div",{class:"extra-contents",key:Se},[(b==null?void 0:b.type)==="upload"?(l.openBlock(),l.createBlock(Me,{key:0,class:"upload-button-wrap","on-change":he,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:l.withCtx(()=>[l.createVNode(Ne,{style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1024)]),_:2},1024)):l.createCommentVNode("",!0),(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Je._sfc_main,{key:1},{dropTitle:l.withCtx(()=>[(b==null?void 0:b.type)==="popover"?(l.openBlock(),l.createBlock(Ne,{key:0,style:{background:"transparent",color:"#666666"}},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1024)):l.createCommentVNode("",!0)]),dropMenu:l.withCtx(()=>[l.createElementVNode("div",jr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b==null?void 0:b.contents,P=>(l.openBlock(),l.createBlock(Ne,{key:P==null?void 0:P.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:de=>We(P==null?void 0:P.label)},{default:l.withCtx(()=>{var de,Z;return[l.createTextVNode(l.toDisplayString(P==null?void 0:P.label),1),(de=P==null?void 0:P.label)!=null&&de.includes("选中")?(l.openBlock(),l.createElementBlock("span",Mr,"("+l.toDisplayString(O.selectNums)+")",1)):l.createCommentVNode("",!0),(Z=P==null?void 0:P.label)!=null&&Z.includes("全部")?(l.openBlock(),l.createElementBlock("span",$r,"("+l.toDisplayString(O.dataNums)+")",1)):l.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):l.createCommentVNode("",!0),b!=null&&b.type?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Ne,{key:2,id:"themeButton",style:l.normalizeStyle({background:"transparent",color:(b==null?void 0:b.label)==="新增"?"var(--ssbutton-theme-bg)":"#666666"}),onClick:P=>We(b==null?void 0:b.label)},{icon:l.withCtx(()=>{var P;return[l.createVNode(G,{name:(P=me==null?void 0:me.find(de=>(de==null?void 0:de.label)===(b==null?void 0:b.label)))==null?void 0:P.icon},null,8,["name"])]}),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(b==null?void 0:b.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):l.createCommentVNode("",!0)])]))}}},Pr=$l._export_sfc(Vr,[["__scopeId","data-v-dc7dc670"]]),Fr=l.defineComponent({__name:"batch",props:{lockingPage:Boolean,buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(O,{emit:le}){const X=O,$=le,j=ae=>{$("buttonClick",ae)},s=ae=>{var ge;return ae!=null&&ae.includes("删除")?((ge=X.selectTableItems)==null?void 0:ge.length)>0?"warning-active-type":"warning-type":"default-type"};return(ae,ge)=>{const me=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(O.buttons,he=>(l.openBlock(),l.createBlock(me,{key:he==null?void 0:he.label,disabled:!!O.lockingPage,class:l.normalizeClass(s(he==null?void 0:he.label)),onClick:Ve=>j(he==null?void 0:he.label)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(he==null?void 0:he.label),1)]),_:2},1032,["disabled","class","onClick"]))),128))])}}}),Kr=$l._export_sfc(Fr,[["__scopeId","data-v-70b12973"]]),va=m.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(O){this.selectArray=O},setSelectString(O){this.selectString=O}}}),zr={class:"calculator-content"},qr={class:"calculator-child"},Rr={class:"calculator-child"},Jr=l.defineComponent({__name:"calculator",setup(O){const le=l.ref(),X=l.ref();return l.onMounted(()=>{le.value=[{type:"Upload",label:"输入",name:"input"}],X.value=[{type:"Upload",label:"输出",name:"output"}]}),($,j)=>(l.openBlock(),l.createElementBlock("div",zr,[l.createElementVNode("div",qr,[l.createVNode(Je.ssForm,{rowContents:le.value,isRowFlex:!0},null,8,["rowContents"])]),l.createElementVNode("div",Rr,[l.createVNode(Je.ssForm,{rowContents:X.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Wr=$l._export_sfc(Jr,[["__scopeId","data-v-73db0fe7"]]),ba=m.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(O){this.selectIndex=O},setSelectMenu(O){this.selectMenu=O},setSelectTitle(O){this.selectTitle=O}}}),Hl=(O,le)=>{let X=O,$=le;return Array.isArray(X)&&(X=X==null?void 0:X.map((j,s)=>{if(Array.isArray(j)){let ae={};return j=j==null?void 0:j.forEach((ge,me)=>{var he;(he=$==null?void 0:$[me])!=null&&he.prop?ae[$[me].prop]=ge:Array.isArray(ge)&&(ae.children=Hl(ge,$))}),Object.assign(ae,{id:s})}else return j})),X},ka=(O,le,X)=>{let $=O,j=le;return $=$==null?void 0:$.map((s,ae)=>{var ge,me;return!Array.isArray(s)||!((ge=j==null?void 0:j[ae])!=null&&ge.label)&&!X||(s.unshift(((me=j==null?void 0:j[ae])==null?void 0:me.label)??""),s.some(he=>Array.isArray(he))&&(s=s==null?void 0:s.map(he=>{var Ve;return Array.isArray(he)&&(he=ka(he,(Ve=j==null?void 0:j[ae])==null?void 0:Ve.children,X)),he}))),s}),$},Gr=(O,le,X)=>{if(le==="")return O==null?void 0:O.filter($=>($==null?void 0:$.id)!==X);{const $=le.split("-");return Hr(O,$,X)}},Hr=(O,le,X)=>{let $=O,j=le;return(j==null?void 0:j.length)===0?$=$==null?void 0:$.filter(s=>s.id!==X):$=$==null?void 0:$.map(s=>(s.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),s=ma(s,j,X)),s)),$},ma=(O,le,X)=>{var s,ae;let $=O,j=le;return(j==null?void 0:j.length)===0?$.children=(s=$.children)==null?void 0:s.filter(ge=>ge.id!==X):$.children=(ae=$.children)==null?void 0:ae.map(ge=>(ge.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),ge=ma(ge,j,X)),ge)),$},Qr=(O,le,X)=>{if(le==="")return X;{const $=le.split("-");return Xr(O,$,X)}},Xr=(O,le,X)=>{let $=O,j=le;return(j==null?void 0:j.length)===0?$=X:$=$==null?void 0:$.map(s=>(s.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),s=Sa(s,j,X)),s)),$},Sa=(O,le,X)=>{var s;let $=O,j=le;return(j==null?void 0:j.length)===0?$.children=X:$.children=(s=$.children)==null?void 0:s.map(ae=>(ae.id.toString()===(j==null?void 0:j[0])&&(j==null||j.shift(),ae=Sa(ae,j,X)),ae)),$},Ca=m.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(O){this.objUrl=O},setBlobUrls(O){this.blobUrls=O}}}),Ql=async(O,le)=>{var ae,ge,me,he,Ve,We,al,fe,Ye,Ze,ue,ye,oe,G,W,Ne,Me;let X=(ge=(ae=m.cloneDeep(O))==null?void 0:ae.optionUrl)==null?void 0:ge.menuSelect,$=[];X==null||X.forEach(ne=>{});let j="",s=await te.menuToParent(X);if(s==null||s.forEach(ne=>{var we,Ue,H,b;(ne==null?void 0:ne.name)===(((b=(H=(Ue=(we=m.cloneDeep(O))==null?void 0:we.optionUrl)==null?void 0:Ue.groupSelect)==null?void 0:H[0])==null?void 0:b.replaceAll("'",""))??"")&&(j=ne==null?void 0:ne.id)}),le){j=le;const ne=await m.getInsofDataApi({id:j}),we=(We=(Ve=(he=(me=ne==null?void 0:ne.data)==null?void 0:me.result)==null?void 0:he[0])==null?void 0:Ve.key)==null?void 0:We.pageKey;s=await te.getItemData(we,sessionStorage.getItem("systemKey"),"")}if(j!==""){let ne;le?ne=(al=s==null?void 0:s.find(H=>(H==null?void 0:H.id)===le))==null?void 0:al.compData:ne=(fe=s==null?void 0:s.find(H=>{var b,Se,P,de;return(H==null?void 0:H.name)===(((Se=(b=O==null?void 0:O.groupSelect)==null?void 0:b.split(":"))==null?void 0:Se[0])||((de=(P=O==null?void 0:O.optionUrl)==null?void 0:P.groupSelect)==null?void 0:de[0]))}))==null?void 0:fe.compData;let we=(Ze=(Ye=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:Ye.contents)==null?void 0:Ze.map(H=>H==null?void 0:H.label);(ye=(ue=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:ue.contents)!=null&&ye.every(H=>Array.isArray(H))&&(we=(W=te.getColumnChild((G=(oe=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="header"))==null?void 0:oe.contents)==null?void 0:G[0]))==null?void 0:W.map(H=>H==null?void 0:H.prop));let Ue=(Me=(Ne=ne==null?void 0:ne.find(H=>(H==null?void 0:H.key)==="tableContents"))==null?void 0:Ne.contents)==null?void 0:Me.map(H=>(H=H==null?void 0:H.filter(b=>!(b!=null&&b.id)),H));Ue==null||Ue.forEach(H=>{$.push(te.getValueToObjectValue(H,we))})}return $},Yr={class:"table-content"},Zr={class:"menu-config-wrap"},Ir=["onClick"],en={key:0,class:"viewport-wrap"},ln=["onClick"],an={title:"选择显示列信息"},rn={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},nn=["title"],on={class:"col-operate-wrap"},tn={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},sn={class:"pop-view"},un={class:"pop-wrapper"},cn={class:"file-list-pop"},dn=["title","onClick"],pn=["onClick"],fn=["onClick"],gn={class:"form-content"},hn={key:0,class:"dialog-footer"},yn={class:"dialog-footer"},vn={class:"form-content"},bn={__name:"index",props:{pageLayout:{type:String,default:"vertical"},level:{type:Number,default:1},compName:{type:String,default:"",required:!1},compNames:{type:Array,default:()=>[],required:!1},compItem:{type:Object,default:()=>{}},operatingForm:{type:Object,default:()=>{}},cacheNewData:{type:Object,default:()=>{}},config:Object,parentTableId:{type:Number,default:0},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,isDevMode:Boolean,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0},allowSelect:{type:Boolean,default:!1},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["getSliceContLength","clickMainKey","change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(O,{emit:le}){var ga;const X=l.ref([]),$=Ca(m.pinia),j=l.ref(null),s=O,ae=l.ref(s==null?void 0:s.allowSelect),ge=l.ref((ga=s==null?void 0:s.config)==null?void 0:ga.showIndex),me=l.ref(),he=l.ref([{label:"排序",value:"sortable",checked:!1},{label:"筛选",value:"filterable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{label:"编辑",value:"operable",checked:!1}]),Ve=te.useOriginalState(m.pinia);let We="$R";const{originalPath:al}=m.storeToRefs(Ve),fe=al.value,Ye=l.ref(!1),Ze=l.ref(!1),ue=l.ref(!1),ye=l.reactive({column:{},status:!1,text:"合计"}),oe=l.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),G=le,W=l.ref([]),Ne=l.reactive({prop:"",order:null}),Me=l.ref([]),ne=l.ref(!1),we=l.ref(!1),Ue=l.ref(null);fl.useThreeSystem();const H=l.ref([]),b=l.ref(!1),Se=l.ref(),P=te.useMenuState(),{importLoading:de,activeMenuPath:Z,contentLoading:Ae,linkMenuInfo:Ge}=m.storeToRefs(P),xa=te.useTableComp(m.pinia),xe=te.useModelComp(m.pinia),{extraContents:ve,cacheUpdatingData:gl,tableViewContents:hl,tableLoading:mn,pageMapState:rl,lockingPage:Dl}=m.storeToRefs(xe),Y=l.ref([]),Tl=l.ref([]),Nl=l.ref(new Map);l.ref(!1);const He=l.ref("");l.ref();const El=l.ref(!0),ul=l.ref(0),Xl=l.ref(!0),Pe=l.ref(""),Qe=l.ref(!1),Da=l.ref({label:"查看三维模型"}),Bl=l.ref(!1),Vl=l.ref(),$e=l.ref([]),nl=l.ref([]),Al=l.ref(!1),yl=l.ref([]),cl=l.ref([]),ol=l.ref([]),Ee=l.ref([]),Fe=l.ref(),Oe=l.ref(),Ta=va(m.pinia),_l=l.ref(),Pl=l.ref(0),wl=ba(m.pinia),{selectIndex:Na,selectMenu:Xe,selectTitle:Fl}=m.storeToRefs(wl),{selectString:tl}=m.storeToRefs(Ta),Ea=m.useLoginState(m.pinia),{loginUserInfo:Ce}=m.storeToRefs(Ea),Ba=l.ref(720),Ke=l.ref(!1),Ul=l.ref(!1),ze=l.ref([]),sl=l.ref(),vl=l.ref(!0),Yl=l.ref(!0),Ol=l.ref([]),Aa=l.inject("contentRef");l.provide("contentRef",Aa),l.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{oe.total=e}),l.watch(()=>hl.value,async()=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x,y;if(((i=hl.value)==null?void 0:i.length)===0||!((u=s==null?void 0:s.itemData)!=null&&u.find(T=>(T==null?void 0:T.key)==="columnPath"))||!((c=s==null?void 0:s.itemData)!=null&&c.find(T=>(T==null?void 0:T.key)==="pageColumn")))return;let e=(h=(q=(w=(S=(g=(d=s==null?void 0:s.itemData)==null?void 0:d.find(T=>(T==null?void 0:T.key)==="pageColumn"))==null?void 0:g.contents)==null?void 0:S.split("["))==null?void 0:w[1])==null?void 0:q.split("]"))==null?void 0:h[0],a=((R=(N=(U=(E=s==null?void 0:s.itemData)==null?void 0:E.find(T=>(T==null?void 0:T.key)==="pageColumn"))==null?void 0:U.contents)==null?void 0:N.split("["))==null?void 0:R[0])+((K=(z=hl.value)==null?void 0:z.find(T=>(T==null?void 0:T.key)===e))==null?void 0:K.value),n=((x=(o=s==null?void 0:s.itemData)==null?void 0:o.find(T=>(T==null?void 0:T.key)==="pageGroup"))==null?void 0:x.contents)??"",r=await te.getItemData(a,sessionStorage.getItem("systemKey"),""),t=(y=r==null?void 0:r.find(T=>(T==null?void 0:T.name)===(n===""?s==null?void 0:s.compName:n)))==null?void 0:y.compData;pa(t,s.allMapContents)},{deep:!0});const _a=async(e,a)=>{var n,r,t,i,u;try{const c=await m.getInsofDataApi({id:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index)});let d;((n=c==null?void 0:c.data)==null?void 0:n.code)===200&&(d=((t=(r=c==null?void 0:c.data)==null?void 0:r.result)==null?void 0:t[0])||null);const g={type:"data",pageKey:s!=null&&s.parentTableId?(i=d==null?void 0:d.key)==null?void 0:i.pageKey:Z.value,tableId:(s==null?void 0:s.parentTableId)||(s==null?void 0:s.index),systemKey:sessionStorage.getItem("systemKey")},S=a==null?void 0:a.map(h=>{const E=Object.keys(h),U={};return E.forEach((N,R)=>{U[e[R]]=h[N]}),U}),w=S==null?void 0:S.map(h=>({key:g,value:{tableData:h}})),q=await m.batchAddInsofDataApi({dataList:w});((u=q==null?void 0:q.data)==null?void 0:u.code)===200?(xe.setRefreshCurStructure(!0),m.ElMessage.success("导入数据成功")):m.ElMessage.error("导入数据响应失败")}catch(c){throw m.ElMessage.error("导入数据处理失败"),new Error(c)}},wa=async e=>{var a,n;if(e!=null&&e.includes(".txt")||e!=null&&e.includes(".cpt")||e!=null&&e.includes(".cyd")){const r=await m.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),t=new Blob([r.data],{type:"application/octet-stream;charset=UTF-8"});let i=URL.createObjectURL(t);Se.value=[{name:(n=e==null?void 0:e.split("/"))==null?void 0:n[((a=e==null?void 0:e.split("/"))==null?void 0:a.length)-1],blobUrl:i}],b.value=!0}};l.onBeforeUnmount(()=>{Yl.value=!1;let e=Pl.value;Pl.value=e+1});const Zl=l.computed(()=>{var r,t;const e=(oe.currentPage-1)*oe.pageSize,a=e+oe.pageSize,n=(r=W.value)==null?void 0:r.find(i=>{var u;return(i==null?void 0:i.sortable)&&((u=i==null?void 0:i.label)==null?void 0:u.includes("时间"))});return n&&(Ne.order="descending",Ne.prop=n==null?void 0:n.prop),G("getSliceContLength",oe),(t=Y.value)==null?void 0:t.slice(e,a)}),Ua=e=>{oe.currentPage=e,G("getSliceContLength",oe)},Oa=e=>{var a;oe.pageSize=e,e*oe.currentPage>((a=Y.value)==null?void 0:a.length)&&(oe.currentPage=1,oe.pageSize=10,m.ElMessage.warning("分页无效,返回第一页")),G("getSliceContLength",oe)},La=(e,a)=>{var u,c;const n=(c=(u=W.value)==null?void 0:u.map(d=>d==null?void 0:d.prop))==null?void 0:c.filter(d=>d!=="operate");let r;const t=(e==null?void 0:e.length)===(n==null?void 0:n.length);if(e!=null&&e.includes("序号"))return m.ElMessage.error("导入的数据不需要包含序号列");if(r=t?e:e.slice(0,n==null?void 0:n.length),!(r==null?void 0:r.every(d=>n==null?void 0:n.find(g=>d===g))))return m.ElMessage.error("导入的数据表头不匹配");_a(r,a)},ja=(e,a)=>{var n;xe.setRefreshCurStructure(!1),((n=W.value)==null?void 0:n.length)===0||La(e,a)},Ma=(e,a,n,r)=>{const t=[],i=[],u=g=>Object.keys(g).length;for(const g in e)if(e[g]!==void 0){const S=e[g],w=[];for(const[q,h]of Object.entries(S))w.push(h),i.length<u(S)&&i.push(q);t.push(w)}t.unshift(i);const c=il.utils.aoa_to_sheet(t),d=il.utils.book_new();il.utils.book_append_sheet(d,c,r),il.writeFileSync(d,`${a}.xlsx`),ze.value=[]},Ll=async(e,a,n,r=!1,t)=>{var i,u,c,d,g,S,w,q;try{xe.setRefreshCurStructure(!1);const h=await m.getInsofDataApi({id:s==null?void 0:s.index});if(((i=h==null?void 0:h.data)==null?void 0:i.code)===200){let E=(g=(d=(c=(u=h==null?void 0:h.data)==null?void 0:u.result)==null?void 0:c[0])==null?void 0:d.value)==null?void 0:g.pageData;r?E={...E,compData:(w=E==null?void 0:E.compData)==null?void 0:w.map(N=>{var R;return(N==null?void 0:N.key)==="header"?{...N,contents:(R=N==null?void 0:N.contents)==null?void 0:R.map(z=>({...z,[e]:n}))}:N})}:E={...E,compData:(S=E==null?void 0:E.compData)==null?void 0:S.map(N=>{var R,z;return(N==null?void 0:N.key)==="header"?{...N,contents:(R=N==null?void 0:N.contents)==null?void 0:R.map(K=>(K==null?void 0:K.prop)===(a==null?void 0:a.prop)?{...K,[e]:n}:K)}:(N==null?void 0:N.key)==="tableToForm"&&t?{...N,contents:(z=N==null?void 0:N.contents)==null?void 0:z.map(K=>(K==null?void 0:K.prop)===(a==null?void 0:a.prop)?{...K,[t]:n}:K)}:N})};const U=await m.updateInsofDataApi({id:s==null?void 0:s.index,value:{pageData:E}});((q=U==null?void 0:U.data)==null?void 0:q.code)===200?(m.ElMessage.success("编辑成功"),xe.setRefreshCurStructure(!0)):m.ElMessage.error("编辑响应失败")}}catch(h){m.ElMessage.error(h)}},$a=async(e,a)=>{await Ll("label",a,e)},Va=async(e,a)=>{await Ll("columnType",a,e,!1,"type")},Pa=()=>{gl.value?Ke.value=!1:fa()},Fa=e=>{ze.value=e},Ka=(e,a)=>{sl.value===a?vl.value=!1:vl.value=!0,sl.value=a==null?void 0:a.changeProp},bl=l.computed(()=>{var n,r,t;const e=(n=W.value)==null?void 0:n.some(i=>i==null?void 0:i.filterable);return document.documentElement.style.setProperty("--ssTable-header-filter-display",e?"inline-block":"none"),(t=(r=W.value)==null?void 0:r.filter(i=>(i==null?void 0:i.label)!=="操作"))==null?void 0:t.map(i=>({...i,filterable:!!(i!=null&&i.filterable),showSummary:!!(i!=null&&i.showSummary),operable:!!(i!=null&&i.operable)}))}),za=async(e,a,n)=>{const r=m.cloneDeep(W.value);await l.nextTick(),W.value=r==null?void 0:r.map(t=>(n==null?void 0:n.label)===(t==null?void 0:t.label)?{...t,[a]:e}:t),await Ll(a,n,e)},Kl=async(e,a)=>{await Ll(a,null,e,!0)},qa=()=>{Qe.value=!1},Ra=e=>{G("clickTrigger",e)},Il=async e=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K;const a=e==null?void 0:e.row,n=e==null?void 0:e.rowData,r=e==null?void 0:e.suffix;if((i=a==null?void 0:a.toString())!=null&&i.includes(".urdf")||e!=null&&e.isUrdf||r!=null&&r.includes(".urdf")){if(a.includes(",")){m.ElMessage.error("当前版本仅允许单个urdf预览!");return}yl.value=[a],we.value=!0,Ue.value={data:m.cloneDeep(n)},ne.value=!0;return}let t=[];if((u=a==null?void 0:a.toString())!=null&&u.includes(".stl")||(c=a==null?void 0:a.toString())!=null&&c.includes(".STL")||(d=a==null?void 0:a.toString())!=null&&d.includes(".obj")||(g=a==null?void 0:a.toString())!=null&&g.includes(".mtl")){yl.value=(S=a==null?void 0:a.toString())==null?void 0:S.split(","),we.value=!1,ne.value=!0;return}if((w=a==null?void 0:a.toString())!=null&&w.includes(".stl")||(q=a==null?void 0:a.toString())!=null&&q.includes(".STL")||(h=a==null?void 0:a.toString())!=null&&h.includes(".obj")||(E=a==null?void 0:a.toString())!=null&&E.includes(".mtl")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){let o,x=[],y={};if(Array.isArray(a)?o=a:o=a==null?void 0:a.split(","),o==null||o.forEach(T=>{T.includes(".mtl")?x.push(T):y.blob=y.blob?y.blob+","+T:T}),(x==null?void 0:x.length)>0&&(y.mtlBlobs=x),r&&(y.suffix=r),(N=(U=Object.values(y))==null?void 0:U[0])!=null&&N.includes("http:"))t.push(y);else{const T=new Blob([y.blob],{type:"application/octet-stream;charset=UTF-8"});let D=URL.createObjectURL(T),Q="";(R=a==null?void 0:a.split("/"))==null||R.forEach((L,ee)=>{var A;ee===((A=a==null?void 0:a.split("/"))==null?void 0:A.length)-1&&(Q=L)}),(z=y.blob)!=null&&z.includes(".stl")&&(Q=(Q==null?void 0:Q.replaceAll(">",""))+".urdf"),Se.value=[{name:Q,blobUrl:D}],b.value=!0}}else{const o=await m.axios.get(a,{responseType:"blob",headers:{"Content-Type":"application/json"}}),x=new Blob([o.data],{type:"application/octet-stream;charset=UTF-8"});let y=URL.createObjectURL(x),T="";(K=a==null?void 0:a.split("/"))==null||K.forEach((D,Q)=>{var L;Q===((L=a==null?void 0:a.split("/"))==null?void 0:L.length)-1&&(T=D)}),Se.value=[{name:T,blobUrl:y}],b.value=!0}(t==null?void 0:t.length)>0&&$.setBlobUrls(t)},jl=e=>{var r,t,i,u;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const a=(u=(r=e==null?void 0:e.url)==null?void 0:r.split("."))==null?void 0:u[((i=(t=e==null?void 0:e.url)==null?void 0:t.split("."))==null?void 0:i.length)-1];return(e==null?void 0:e.name)+"."+a},Ja=async e=>{let a=null,n=null,r=null;if(e!=null&&e.downloadUrl){const i=await zl(),u=Je.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),c=await m.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}).finally(()=>{u.close()}),d=new Blob([c.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(d),n=e==null?void 0:e.name;const g=n==null?void 0:n.lastIndexOf(".");r=n==null?void 0:n.slice(g)}else{const i=await fl.downloadAvatarApi({url:e==null?void 0:e.url});!e.url.toUpperCase().includes(".OBJ")&&!e.url.toUpperCase().includes(".STL")&&!e.url.toUpperCase().includes(".MTL")&&!e.url.toUpperCase().includes(".URDF")?(a=URL.createObjectURL(i.data),n=jl(e)):a=e==null?void 0:e.url}if(r!=null&&r.includes(".urdf")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){const i={row:`${a}`,suffix:r};Il(i);return}const t={name:n,blobUrl:a};Se.value=[t],b.value=!0},Wa=async e=>{let a=null,n=null;if(e!=null&&e.downloadUrl){const i=await zl(),u=await m.axios.post(e==null?void 0:e.url,null,{responseType:"blob",headers:{Authorization:i,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}}),c=new Blob([u.data],{type:"application/octet-stream;charset=UTF-8"});a=URL.createObjectURL(c),n=e==null?void 0:e.name}else{const i=await fl.downloadAvatarApi({url:e==null?void 0:e.url});a=URL.createObjectURL(i.data),n=jl(e)}const r={name:n,blobUrl:a},t=document.createElement("a");t.href=r.blobUrl,t.download=r.name,t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{document.body.removeChild(t)},100)},Ga=(e,a)=>{var n;if(Object.values(a).length!==0)return Object.values(a).find(r=>{var t,i,u;return((t=r==null?void 0:r.toString())==null?void 0:t.includes(".txt"))||((i=r==null?void 0:r.toString())==null?void 0:i.includes(".cpt"))||((u=r==null?void 0:r.toString())==null?void 0:u.includes(".obj"))})?[...e,Da.value]:(n=s==null?void 0:s.config)!=null&&n.allowMove?[...e,{label:"迁移"}]:e},Ha=(e,a={})=>[...e==null?void 0:e.values()].filter(n=>Object.keys(a).every(r=>{var u;const t=n[r],i=(u=a[r])==null?void 0:u.toLowerCase();return i&&t&&typeof t=="string"?t.toLowerCase().includes(i):!0})),ea=l.ref([]),Qa=async(e,a,n=!1)=>{var r;if(e){if(xe.setTableLoading(!0),ea.value=Object.values(e),e&&((r=Object.values(e))!=null&&r.every(t=>!t)))return Y.value=Tl.value;if(n){Y.value=[...Nl.value.values()].filter(t=>Object.values(t).some(i=>typeof i=="string"?i==null?void 0:i.toLowerCase().includes(a==null?void 0:a.toLowerCase()):!1));return}Y.value=Ha(Nl.value,e),xe.setTableLoading(!1)}},Xa=async e=>{var u,c,d,g,S,w,q,h,E,U,N,R,z,K,o;const a=await m.getInsofDataApi({keyLikes:{pageKey:`loading${((u=Ce.value)==null?void 0:u.account)||((c=Ce.value)==null?void 0:c.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),n=await m.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((d=Ce.value)==null?void 0:d.account)||((g=Ce.value)==null?void 0:g.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});let r=(w=(S=a==null?void 0:a.data)==null?void 0:S.result)==null?void 0:w.map(x=>x==null?void 0:x.id);const t=(h=(q=n==null?void 0:n.data)==null?void 0:q.result)==null?void 0:h.map(x=>x==null?void 0:x.id);r=[...m.cloneDeep(r),...t],(r==null?void 0:r.length)>0&&(r!=null&&r.every(x=>x!==null&&x))&&await m.batchDeleteInsofDataApi({ids:r});let i=await te.getItemData(Z.value,sessionStorage.getItem("systemKey"),e.id);if(i=i==null?void 0:i.filter(x=>x.comp!=="methodButton"),i&&i.length>0){const x=!Array.isArray(Fl.value)&&((E=Fl.value)==null?void 0:E.key)!=="main"?[]:Fl.value;x.push({key:Xe.value===""?(U=e==null?void 0:e.id)==null?void 0:U.toString():Xe.value+"-"+((N=e==null?void 0:e.id)==null?void 0:N.toString()),value:e[(R=Object.keys(e))==null?void 0:R.filter(y=>y!=="index"&&y!=="id")[0]]}),wl.setSelectMenu(Xe.value===""?(z=e==null?void 0:e.id)==null?void 0:z.toString():Xe.value+"-"+((K=e==null?void 0:e.id)==null?void 0:K.toString())),wl.setSelectTitle(x),wl.setSelectIndex((o=e==null?void 0:e.id)==null?void 0:o.toString()),G("pageChange",i)}},la=async(e,a,n,r)=>{var i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F;if(G("clickMainKey",n),(r==null?void 0:r.isExistChild)===!0){let p=(u=(i=W.value)==null?void 0:i.find(M=>(M==null?void 0:M.isMainKey)===!0))==null?void 0:u.prop,B=(c=r==null?void 0:r.rowContent)==null?void 0:c[p],k=(g=(d=r==null?void 0:r.columnType)==null?void 0:d.childPath)==null?void 0:g.split(fe),C=[];k==null||k.forEach((M,v)=>{(k==null?void 0:k.length)-1===v&&C.push(B),C.push(M)}),C=C.join(fe);let V=await te.getItemData(C,sessionStorage.getItem("systemKey"),""),I=await te.getItemData((S=r==null?void 0:r.columnType)==null?void 0:S.childPath,sessionStorage.getItem("systemKey"),"");if(!V||(V==null?void 0:V.length)===0){let M=[];I==null||I.forEach(J=>{var Te,be,_,f;let pe={type:"structure",pageKey:C,version:1,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(Te=Ce.value)==null?void 0:Te.id,parentPageKey:"",createUserLayer:((be=Ce.value)==null?void 0:be.dept)||((_=Ce.value)==null?void 0:_.部门名称)},se={pageData:{comp:J==null?void 0:J.comp,compData:(f=J==null?void 0:J.compData)==null?void 0:f.filter(ce=>(ce==null?void 0:ce.key)!=="tableContents"),name:J==null?void 0:J.name,isShow:J==null?void 0:J.isShow}};M.push({key:pe,value:se})}),(M==null?void 0:M.length)>0&&await m.batchAddInsofDataApi({dataList:M});let v=await te.getItemData(C,sessionStorage.getItem("systemKey"),"");Ol.value=v}else Ol.value=V;G("routeUrl",Ol.value,{isEdit:!0,routerUrl:C});return}if((r==null?void 0:r.data)==="查看"&&(e!=null&&e.every(p=>(p==null?void 0:p.url)&&(p==null?void 0:p.name)))){let p=m.cloneDeep(e);p=await((w=m.cloneDeep(p))==null?void 0:w.map(async k=>{var I,M,v,J;const C=await fl.downloadAvatarApi({url:k==null?void 0:k.url});let V=URL.createObjectURL(C.data);return{name:(k==null?void 0:k.name)+"."+((J=(I=k==null?void 0:k.url)==null?void 0:I.split("."))==null?void 0:J[((v=(M=k==null?void 0:k.url)==null?void 0:M.split("."))==null?void 0:v.length)-1]),blobUrl:V}}));let B=await Promise.all(p);Se.value=B,b.value=!0}const t=m.cloneDeep(W.value);if((r==null?void 0:r.isMainKey)===!0&&(t==null?void 0:t.length)>0){(q=t==null?void 0:t[0])==null||q.prop;let p=m.cloneDeep(Z).value+fe+(r==null?void 0:r.data),B=m.cloneDeep(Z).value,k=(E=(h=rl.value[p])==null?void 0:h.filter(M=>{var v,J;return((v=M==null?void 0:M.key)==null?void 0:v.type)==="structure"&&((J=M==null?void 0:M.key)==null?void 0:J.parentTable)===""}))==null?void 0:E.map(M=>{var v;return(v=M==null?void 0:M.value)==null?void 0:v.pageData}),C={};(U=W.value)==null||U.forEach(M=>{(M==null?void 0:M.label)!=="操作"&&(C[M.label]=n[M.prop]??n[M.label])});let V=(R=(N=s==null?void 0:s.itemData)==null?void 0:N.find(M=>(M==null?void 0:M.key)==="mainRouters"))==null?void 0:R.contents,I;if((V==null?void 0:V.length)>0){let M=p==null?void 0:p.split(fe)[((z=p==null?void 0:p.split(fe))==null?void 0:z.length)-1],v=V==null?void 0:V.find(J=>(J==null?void 0:J.key)===M);I=(v==null?void 0:v.routerContent)+fe+(v==null?void 0:v.key)}if((k==null?void 0:k.length)>0)await te.getItemData(p+fe+`updateLoading${((K=Ce.value)==null?void 0:K.account)||((o=Ce.value)==null?void 0:o.账号)}`,sessionStorage.getItem("systemKey"),"")||await te.loadingConstruct(p,p+fe+`updateLoading${((x=Ce.value)==null?void 0:x.account)||((y=Ce.value)==null?void 0:y.账号)}`,C,I),xe.setRouteToChildPath(B),P.setActiveMenuPath(p+fe+`updateLoading${((T=Ce.value)==null?void 0:T.account)||((D=Ce.value)==null?void 0:D.账号)}`);else{(Q=t==null?void 0:t[0])==null||Q.prop;let M=m.cloneDeep(Z).value+fe+(r==null?void 0:r.data),v=m.cloneDeep(Z).value;await te.getItemData(v+fe,sessionStorage.getItem("systemKey"),""),await te.loadingConstruct(v+fe,M,C),await te.loadingConstruct(M,M+fe+`updateLoading${((L=Ce.value)==null?void 0:L.account)||((ee=Ce.value)==null?void 0:ee.账号)}`,C,I),xe.setRouteToChildPath(v),P.setActiveMenuPath(M+fe+`updateLoading${((A=Ce.value)==null?void 0:A.account)||((F=Ce.value)==null?void 0:F.账号)}`)}}},Ya=()=>{b.value=!1},Za=e=>{G("rowClick",e)};l.watch(()=>s.changedContent,()=>{var n,r;if(!s.changedContent)return;let e=(n=Y.value)==null?void 0:n.map(t=>{var i;return t.id===((i=s.changedContent)==null?void 0:i.id)&&(t={...s.changedContent,id:s.changedContent.newId?s.changedContent.newId:s.changedContent.id},delete t.newId),t});const a=(r=s.itemData)==null?void 0:r.map(t=>((t==null?void 0:t.key)==="tableContents"&&(t.contents=e),t));Y.value=e,G("contentChange",{contents:a,index:s.index}),G("change",{content:e,index:s==null?void 0:s.index,buttonName:"",id:s==null?void 0:s.index})},{deep:!0,immediate:!0});const Ia=()=>{},er=async()=>{const e=Z.value,a=sessionStorage.getItem("systemKey"),n=await te.getItemData(e,a,""),r=(n==null?void 0:n.find(c=>(c==null?void 0:c.name)==="方法明细"))||(n==null?void 0:n[0]),t=(r==null?void 0:r.compData)||[],i=t==null?void 0:t.find(c=>{const d=c==null?void 0:c.key;return d==="formContent"||d==="tableContents"});return i==null?void 0:i.contents},zl=async()=>`Bearer ${m.Local.get("access-token")}`,lr=async(e,{token:a,inputData:n}={})=>await m.axios.post(e,n,{headers:{Authorization:a}}).catch(t=>(P.setImportLoading(!1),Promise.reject(t))),ar=e=>{const a=[],n=r=>{r&&typeof r=="object"&&!Array.isArray(r)?Object.values(r).forEach(n):a.push(r)};return n(e),a},rr=async(e,a,n)=>{var z,K,o,x,y,T,D,Q;P.setImportLoading(!0),xe.setFreshContent(!1);let r=await er().catch(L=>(P.setImportLoading(!1),Promise.reject(L)));r=r==null?void 0:r.filter(L=>{var ee;return((ee=L==null?void 0:L.find(A=>A==null?void 0:A.id))==null?void 0:ee.id)===(a==null?void 0:a.id)});let t=te.getEqualChild([(z=W.value)==null?void 0:z.filter(L=>(L==null?void 0:L.label)!=="操作")]);const i=(o=(K=te.tableToForm(r,t))==null?void 0:K[0])==null?void 0:o.find(L=>{const ee=L==null?void 0:L.key;return ee==="算法体"||ee==="方法体"}),u=i==null?void 0:i.value;if(!u){console.log("未搜索到isMain, 缺少算法执行接口"),P.setImportLoading(!1);return}const c=W.value?te.getEqualChild([W.value]):[],d=c.find(L=>{const ee=L==null?void 0:L.prop;return ee==="输入"||ee==="输入数据.输入1"||ee==="样本输入数据"}),g=d==null?void 0:d.prop;let S=a==null?void 0:a[g];const w=await zl().catch(L=>(P.setImportLoading(!1),Promise.reject(L))),q=await lr(u,{token:w,inputData:S}).catch(L=>(P.setImportLoading(!1),Promise.reject(L))),h=(x=q==null?void 0:q.data)==null?void 0:x.data,E=c.find(L=>(L==null?void 0:L.prop)==="输出数据.输出1"),U=E==null?void 0:E.prop;let N=[],R=[];if(((y=Object.values(h))==null?void 0:y.length)>0){let L=[];const ee=new FormData,A=(T=ar(h))==null?void 0:T.map(async p=>{var B,k;if(!Array.isArray(p)&&(p!=null&&p.includes("http"))){let C=await m.axios.get(p,{responseType:"blob"}),V=(k=p==null?void 0:p.split("/"))==null?void 0:k[((B=p==null?void 0:p.split("/"))==null?void 0:B.length)-1];ee.append("files",C.data,V)}else L.push(p)});if(await Promise.all(A),!te.isFormDataEmpty(ee)){let p=await fl.uploadAmountApi(ee),B=(Q=(D=p==null?void 0:p.data)==null?void 0:D.result)==null?void 0:Q.map(k=>{var C,V,I,M,v,J;return{name:(J=(v=(M=(C=k==null?void 0:k.url)==null?void 0:C.split("/"))==null?void 0:M[((I=(V=k==null?void 0:k.url)==null?void 0:V.split("/"))==null?void 0:I.length)-1])==null?void 0:v.split("."))==null?void 0:J[0],url:k==null?void 0:k.url}});L=[...L,...B]}let F={};for(let p in a)p!=="id"&&(F[p]=a[p]);F[U]=L,R.push({id:a==null?void 0:a.id,value:{tableData:F}})}(R==null?void 0:R.length)>0&&await m.batchUpdateInsofDataApi({dataList:R}),(N==null?void 0:N.length)>0&&await m.batchAddInsofDataApi({dataList:N}),Sl(!0),P.setImportLoading(!1),xe.setFreshContent(!0)},aa=(e,a)=>(e=e==null?void 0:e.map(n=>{var r,t;return n!=null&&n.children&&((r=n.children)!=null&&r.find(i=>i.id===(a==null?void 0:a.id))?n.children=(t=n.children)==null?void 0:t.filter(i=>(i==null?void 0:i.id)!==(a==null?void 0:a.id)):n.children=aa(n.children,a)),n}),e),De=l.reactive({title:"迁移至",show:!1,width:"20%",selectRow:null,from:s==null?void 0:s.index,to:null,contents:[],formRules:{groupName:[{required:!0,message:"输入不能为空",trigger:"blur"},{validator:(e,a,n)=>{a===(s==null?void 0:s.index)?n(new Error("选择源不能和目标源一致")):n()}}]},buttonValue:[{label:"取消",background:"#999999",color:"var(--ssbutton-theme-color)"},{label:"确认",background:"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}]}),nr=()=>{De.show=!1},or=e=>{var a,n;if((e==null?void 0:e.buttonName)==="取消")return De.show=!1;De.to=e==null?void 0:e.content,!(!(s!=null&&s.index)||!((a=De.to)!=null&&a.groupName))&&(s==null?void 0:s.index)!==((n=De.to)==null?void 0:n.groupName)&&(G("change",{buttonName:"迁移",value:{from:De.from,to:De.to,data:De.selectRow}}),De.show=!1)},Ml=async(e,a,n)=>{var r,t,i,u,c,d,g,S,w,q,h,E,U,N,R;if(He.value="",Al.value=!0,El.value=!0,G("onButtonClick",e,a),e==="删除")te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var z,K;(z=Y.value)!=null&&z.find(o=>(o==null?void 0:o.id)===(a==null?void 0:a.id))?Y.value=(K=m.cloneDeep(Y.value))==null?void 0:K.filter(o=>(o==null?void 0:o.id)!==(a==null?void 0:a.id)):Y.value=aa(m.cloneDeep(Y.value),a),Gr(_l.value,Xe.value,a==null?void 0:a.id),xe.setTableLoading(s==null?void 0:s.index),G("change",{content:Y.value,singleContent:a,index:s==null?void 0:s.index,type:"delete",buttonName:e,column:W.value})});else if(e==="批量删除"){if(((r=ze.value)==null?void 0:r.length)===0)return m.ElMessage.warning("请先勾选操作的数据");te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var K,o;const z=(K=ze.value)==null?void 0:K.map(x=>x.id);Y.value=(o=m.cloneDeep(Y.value))==null?void 0:o.filter(x=>!(z!=null&&z.includes(x.id))),xe.setTableLoading(s==null?void 0:s.index),G("change",{content:Y.value,singleContent:null,selectItems:ze.value,index:s==null?void 0:s.index,type:"batchDelete",buttonName:e,column:W.value})})}else if(e==="复制新增"){Pe.value="新增";const z=m.cloneDeep(a),K=(t=W.value)==null?void 0:t.find(y=>y==null?void 0:y.isMainKey),o=K||((i=W.value)==null?void 0:i[0]),x=(u=ol.value)==null?void 0:u.find(y=>(y==null?void 0:y.label)==="新建");await na(!0,x,{data:z,firstCol:o})}else if(e==="新增")Pe.value="新增",ml(""),Qe.value=!0;else if(e==="编辑")Pe.value="编辑",ml(a),Qe.value=!0;else if(e==="查看")Pe.value="查看",ml(a),Al.value=!1,El.value=!1,Qe.value=!0;else if(e==="查看三维模型"){const z={};for(let o in a)o!=="id"&&(z[o]=a[o]);let K=(c=Object.values(z))==null?void 0:c[1];xa.setTableShowThree(K)}else if(((d=n==null?void 0:n.extra)==null?void 0:d.type)==="modelExample")Pe.value=e,Bl.value=!0;else if(e==="新建"){let z=rl.value,K=[];for(let D in z)D!=null&&D.includes(`loading${((g=Ce.value)==null?void 0:g.account)||((S=Ce.value)==null?void 0:S.账号)}`)&&(K=[...K,...D]);let o=[];for(let D in z)D!=null&&D.includes(`updateLoading${((w=Ce.value)==null?void 0:w.account)||((q=Ce.value)==null?void 0:q.账号)}`)&&(o=[...o,...D]);let x=K==null?void 0:K.map(D=>D==null?void 0:D.id);const y=o==null?void 0:o.map(D=>D==null?void 0:D.id);x=[...m.cloneDeep(x),...y],(x==null?void 0:x.length)>0&&(x!=null&&x.every(D=>D!==null&&D))&&await m.batchDeleteInsofDataApi({ids:x});const T=(h=ol.value)==null?void 0:h.find(D=>(D==null?void 0:D.label)==="新建");await na(!1,T)}else if(e==="修改模板"){let z=m.cloneDeep(Z).value;xe.setRouteToChildPath(z),P.setActiveMenuPath(z+fe)}else if(e==="执行")rr(e,a);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((E=ze.value)==null?void 0:E.length)===0)return m.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&((U=Y.value)==null?void 0:U.length)===0)return m.ElMessage.warning("暂无数据导出");const z=(R=(N=W.value)==null?void 0:N.map(o=>o==null?void 0:o.label))==null?void 0:R.filter(o=>o!=="操作"),K=e==="导出全部"?m.cloneDeep(Y.value):m.cloneDeep(ze.value);K==null||K.forEach(o=>{o==null||delete o.id}),Ma(K,s==null?void 0:s.compName,z,s==null?void 0:s.compName)}else e==="迁移"&&(De.selectRow=a,De.show=!0)},tr=async e=>{var n,r,t,i,u,c;const a=await m.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((n=a==null?void 0:a.data)==null?void 0:n.code)===200)return Array.isArray((r=a==null?void 0:a.data)==null?void 0:r.result)&&((i=(t=a==null?void 0:a.data)==null?void 0:t.result)==null?void 0:i.length)>0?(c=(u=a==null?void 0:a.data)==null?void 0:u.result)==null?void 0:c.map(d=>{var g;return{id:d==null?void 0:d.id,...(g=d==null?void 0:d.value)==null?void 0:g.pageData}}):[]},sr=async(e,a)=>{var n,r,t,i,u,c,d,g,S,w,q,h,E,U,N,R,z,K,o,x;try{let y,T;const D=(n=rl.value[Z.value+fe])==null?void 0:n.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="structureMethod"}),Q=(r=rl.value[Z.value+fe])==null?void 0:r.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="structure"}),L=D==null?void 0:D.find(k=>{var C,V;return((V=(C=k==null?void 0:k.value)==null?void 0:C.pageData)==null?void 0:V.method)==="保存"});if(!L)return;const ee=(c=(u=rl.value[(i=(t=L==null?void 0:L.value)==null?void 0:t.pageData)==null?void 0:i.path])==null?void 0:u.filter(k=>{var C;return((C=k==null?void 0:k.key)==null?void 0:C.type)==="data"}))==null?void 0:c.find(k=>{var C,V,I,M;return((V=(C=k==null?void 0:k.value)==null?void 0:C.tableData)==null?void 0:V.算法名称)===((M=(I=L==null?void 0:L.value)==null?void 0:I.pageData)==null?void 0:M.method)});if(!ee)return;const A={buttonName:(g=(d=L==null?void 0:L.value)==null?void 0:d.pageData)==null?void 0:g.method,api:(w=(S=ee==null?void 0:ee.value)==null?void 0:S.tableData)==null?void 0:w.算法体,content:Q==null?void 0:Q.map(k=>{var C;return(C=k==null?void 0:k.value)==null?void 0:C.pageData}),extraContent:[],extraValues:(h=(q=L==null?void 0:L.value)==null?void 0:q.pageData)==null?void 0:h.data,methodName:(U=(E=L==null?void 0:L.value)==null?void 0:E.pageData)==null?void 0:U.path};if(!e)return;const F={...e,compData:(N=e==null?void 0:e.compData)==null?void 0:N.map(k=>{var C;return(k==null?void 0:k.key)==="formContent"?{...k,contents:(C=k==null?void 0:k.contents)==null?void 0:C.map(V=>(V==null?void 0:V.prop)===a?{...V,value:""}:V)}:k})},p={key:{pageKey:Z.value+fe,parentTable:"",systemKey:sessionStorage.getItem("systemKey"),type:"structure"},value:{pageData:F}},B=await m.axios.post(A.api,p,{headers:{"Content-Type":"application/json"}});return((R=B==null?void 0:B.data)==null?void 0:R.code)===200&&(y=(K=(z=B==null?void 0:B.data)==null?void 0:z.result)==null?void 0:K.latestReportCode,T=(x=(o=B==null?void 0:B.data)==null?void 0:o.result)==null?void 0:x.status),{newMainKeyValue:y,newStatus:T}}catch(y){throw m.ElMessage.error(y),new Error(y)}},ra=(e,a,n,r)=>{var t;G("contentChange",{contents:(t=e==null?void 0:e.compData)==null?void 0:t.map(i=>{var u;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(u=i==null?void 0:i.contents)==null?void 0:u.map(c=>(c==null?void 0:c.key)===a?{...c,value:n}:kl.value&&(c==null?void 0:c.prop)===kl.prop?{...c,value:kl.value}:c)}:i}),index:e==null?void 0:e.id},r)},kl=l.reactive({prop:"状态",value:""}),ir=l.ref(["系统自动生成信息","审批意见"]),ur=async(e,a,n)=>{var d,g;let r=e==null?void 0:e[a==null?void 0:a.prop],t=1,i,u;const c=m.cloneDeep(Z).value+fe+r;if(c){kl.value="",i=(d=rl.value[c])==null?void 0:d.filter(q=>{var h;return((h=q==null?void 0:q.key)==null?void 0:h.type)==="structure"});const S=i==null?void 0:i.find(q=>{var h,E,U;return((U=(E=(h=q==null?void 0:q.value)==null?void 0:h.pageData)==null?void 0:E.comp)==null?void 0:U.toUpperCase())==="FORM"});u={...(g=S==null?void 0:S.value)==null?void 0:g.pageData,id:S==null?void 0:S.id};const w=await sr(u,a==null?void 0:a.prop);if(kl.value=w==null?void 0:w.newStatus,w!=null&&w.newMainKeyValue)return w==null?void 0:w.newMainKeyValue}if(Y.value.some(S=>(S==null?void 0:S[a==null?void 0:a.prop])===r)){const S=r;for(;Y.value.some(w=>(w==null?void 0:w[a==null?void 0:a.prop])===`${S}(${t})`);)t++;r=`${S}(${t})`}return r},na=async(e,a,n)=>{var u,c,d,g,S,w,q,h;let r,t;const i=await ur(n==null?void 0:n.data,n==null?void 0:n.firstCol);if(e?(r=m.cloneDeep(Z).value+fe+((g=n==null?void 0:n.data)==null?void 0:g[(d=n==null?void 0:n.firstCol)==null?void 0:d.prop]),t=m.cloneDeep(Z).value+fe+i):(r=m.cloneDeep(Z).value+fe,t=m.cloneDeep(r)+`loading${((u=Ce.value)==null?void 0:u.account)||((c=Ce.value)==null?void 0:c.账号)}`),a){const E=(w=(S=rl.value[t])==null?void 0:S.filter(U=>{var N;return((N=U==null?void 0:U.key)==null?void 0:N.parentTable)===""}))==null?void 0:w.map(U=>{var N;return{id:U==null?void 0:U.id,...(N=U==null?void 0:U.value)==null?void 0:N.pageData}});if((E==null?void 0:E.length)>0)if(e){const U=E==null?void 0:E.find(N=>{var R;return((R=N==null?void 0:N.comp)==null?void 0:R.toUpperCase())==="FORM"});U&&ra(U,(q=n==null?void 0:n.firstCol)==null?void 0:q.label,i,Z.value)}else xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t);else if(await te.loadingConstruct(r,t,null,null,e?ir.value:null),e){const U=await tr(t);if((U==null?void 0:U.length)>0){const N=U==null?void 0:U.find(R=>{var z;return((z=R==null?void 0:R.comp)==null?void 0:z.toUpperCase())==="FORM"});N&&ra(N,(h=n==null?void 0:n.firstCol)==null?void 0:h.label,i,Z.value)}}else xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t)}else e?(He.value="",Oe.value=n==null?void 0:n.data,Sl(!0,n==null?void 0:n.firstCol,i)):(xe.setRouteToChildPath(m.cloneDeep(Z).value),P.setActiveMenuPath(t))},cr=()=>{ne.value=!1,yl.value=[],we.value=!1},ml=e=>{var u,c,d,g,S,w,q,h,E,U,N,R,z,K;const a=[];let n=[];for(let o in e)Array.isArray(e==null?void 0:e[o])&&n.push(o);Me.value=m.cloneDeep(W.value),(c=te.getColumnChild((u=m.cloneDeep(W.value))==null?void 0:u.filter(o=>(o==null?void 0:o.label)!=="操作")))==null||c.forEach((o,x)=>{var y;n.find(T=>T===(o==null?void 0:o.prop))||(o!=null&&o.formType&&((y=o==null?void 0:o.formType)==null?void 0:y.toUpperCase())==="SELECT"?a.push({label:(o==null?void 0:o.prop)||(o==null?void 0:o.label)||"",name:(o==null?void 0:o.prop)??"t"+x,prop:o==null?void 0:o.prop,type:!(o!=null&&o.formType)||(o==null?void 0:o.formType)===""?"Input":o==null?void 0:o.formType,value:(e==null?void 0:e[o==null?void 0:o.prop])??(o==null?void 0:o.value)??"",id:(o==null?void 0:o.id)??x,contents:(o==null?void 0:o.options)??[],width:1,isFormColHidden:o==null?void 0:o.isFormColHidden,disabled:o==null?void 0:o.disabled,optionUrl:{groupSelect:o==null?void 0:o.groupSelect,menuSelect:o==null?void 0:o.formMenuSelect,type:"Select",selectRelateType:o==null?void 0:o.selectRelateType,allSelectionContents:(o==null?void 0:o.allSelectionContents)??[],selectFilter:o==null?void 0:o.selectFilter}}):a.push({label:(o==null?void 0:o.prop)||(o==null?void 0:o.label)||"",prop:o==null?void 0:o.prop,name:(o==null?void 0:o.prop)??"t"+x,type:!(o!=null&&o.formType)||(o==null?void 0:o.formType)===""?"Input":o==null?void 0:o.formType,value:(e==null?void 0:e[o==null?void 0:o.prop])??(o==null?void 0:o.value)??"",id:(o==null?void 0:o.id)??x,contents:(o==null?void 0:o.options)??[],width:1,isFormColHidden:o==null?void 0:o.isFormColHidden,disabled:o==null?void 0:o.disabled}))}),e===""||!e||(He.value=(e==null?void 0:e.id)??"");let r=te.getColumnChild((d=m.cloneDeep(W.value))==null?void 0:d.filter(o=>(o==null?void 0:o.label)!=="操作"));$e.value&&((g=$e.value)==null?void 0:g.length)>0&&($e.value=(S=m.cloneDeep($e).value)==null?void 0:S.map(o=>{var y;let x=(o==null?void 0:o.prop)||((y=r==null?void 0:r.find(T=>(T==null?void 0:T.label)===(o==null?void 0:o.label)))==null?void 0:y.prop);return x&&(o.value=e[x]),o})),Ee.value=$e.value&&((w=$e.value)==null?void 0:w.length)>0?te.getTableFormToForm($e.value):a;let t=[],i=(q=s.itemData)==null?void 0:q.filter(o=>(o==null?void 0:o.key)==="filterAllType");if((i==null?void 0:i.length)>0&&(t=(i==null?void 0:i.map(x=>x==null?void 0:x.value)).flat()),(t==null?void 0:t.length)>0){let o=t==null?void 0:t.find(x=>{var y;return(y=x==null?void 0:x.content)==null?void 0:y.includes("@Select")});if(o!=null&&o.content){let x=(U=(E=(h=o==null?void 0:o.content)==null?void 0:h.replace(":",We))==null?void 0:E.split(We))==null?void 0:U[1];if(((N=x==null?void 0:x.trim())==null?void 0:N.toUpperCase())==="MANUAL"){let y=(z=(R=s.itemData)==null?void 0:R.find(T=>(T==null?void 0:T.key)==="contentTableId"))==null?void 0:z.contents;Ee.value=(K=Ee.value)==null?void 0:K.map((T,D)=>{var Q;return D===0&&(T.type="Select",(Q=T==null?void 0:T.optionUrl)!=null&&Q.menuId?(T.optionUrl.menuId=y,T.optionUrl.menuFilter=t):T.optionUrl={menuId:y,menuFilter:t}),T})}}}},dr=()=>{var a;const e=(a=j.value)==null?void 0:a.$el;e&&Wl.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:n=>{var u;const{oldIndex:r,newIndex:t}=n;if(r===t)return;const i=bl.value.splice(r,1)[0];bl.value.splice(t,0,i),W.value=(u=W.value)==null?void 0:u.slice().sort((c,d)=>{if(c.label==="操作")return 1;if(d.label==="操作")return-1;const g=bl.value.findIndex(w=>w.label===c.label),S=bl.value.findIndex(w=>w.label===d.label);return g-S})}})};l.onMounted(()=>{Vl.value=window.innerWidth-240*2});const pr=()=>{l.nextTick(()=>{dr()})},ql=(e,a)=>{var r;if(!e&&!(e!=null&&e.children))return{contents:e,currentSelectContents:void 0};let n;return e.children=(r=e.children)==null?void 0:r.map(t=>{var i,u;if((t==null?void 0:t.id)===He.value){let c={};for(let d in t){let g=(i=a==null?void 0:a.find(S=>(S==null?void 0:S.prop)===d))==null?void 0:i.label;g?c[d]=(u=Oe.value)==null?void 0:u[g]:c[d]=t[d]}t=Object.assign(c,Oe.value),n=t}else{let c=ql(t,a);t=c==null?void 0:c.contents,n=c==null?void 0:c.currentSelectContents}return t}),{contents:e,currentSelectContents:n}},oa=(e,a)=>{let n,r;return e!=null&&e.find(t=>(t==null?void 0:t.id)===He.value)?n=e==null?void 0:e.map(t=>{var i,u;if((t==null?void 0:t.id)===He.value){let c={};for(let d in t){let g=(i=a==null?void 0:a.find(S=>(S==null?void 0:S.prop)===d))==null?void 0:i.label;g?c[d]=(u=Oe.value)==null?void 0:u[g]:c[d]=t[d]}t=Object.assign(c,Oe.value),r=t}return t}):n=e==null?void 0:e.map(t=>{var i,u,c,d;if((t==null?void 0:t.id)===He.value){let g={};for(let S in t){let w=(i=a==null?void 0:a.find(q=>(q==null?void 0:q.prop)===S))==null?void 0:i.label;w?g[S]=(u=Oe.value)==null?void 0:u[w]:g[S]=t[S]}t=Object.assign(g,Oe.value),r=t}else t=(c=ql(t,a))==null?void 0:c.contents,r=(d=ql(t,a))==null?void 0:d.currentSelectContents;return t}),{newContents:n,currentSelectContents:r}},ta=(e,a,n)=>{var r,t;return e[a==null?void 0:a.prop]=n,typeof e.id=="number"&&(e.id=(r=e.id)==null?void 0:r.toString()),e.children&&((t=e.children)==null?void 0:t.length)>0&&(e.children=e.children.map(ta)),e},Rl=e=>{var n;const a=[];return a.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((n=e.children)==null||n.forEach(r=>{a.push(...Rl(r))})),(a==null?void 0:a.length)>0?a==null?void 0:a.map(r=>{const t={...r};return delete t.children,t}):[]},Sl=(e=!0,a,n)=>{var g,S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p;let r=te.getColumnChild((g=m.cloneDeep(W.value))==null?void 0:g.filter(B=>(B==null?void 0:B.label)!=="操作")),t,i=m.cloneDeep(Y.value);if(!Oe.value){Qe.value=!1;return}if(He.value===""){ul.value++;let B;a&&n?B={id:ul.value.toString(),[a==null?void 0:a.prop]:n,children:Oe.value.children}:B={id:ul.value.toString()},B!=null&&B.children&&(B={...B,children:(S=B.children)==null?void 0:S.map(k=>ta(k,a,n))}),i.push(Object.assign(Oe.value,B)),t=Object.assign(Oe.value,B)}else i=(w=oa(i,r))==null?void 0:w.newContents,t=(q=oa(i,r))==null?void 0:q.currentSelectContents;const u=(h=s.itemData)==null?void 0:h.filter(B=>(B==null?void 0:B.key)==="childTree")[0];if(((E=u==null?void 0:u.contents)==null?void 0:E.length)>0){Pe.value="编辑";const B=[];i==null||i.forEach((k,C)=>{var I;let V={};if(Array.isArray(k)){let M=[];k==null||k.filter(v=>!(v!=null&&v.id)).forEach((v,J)=>{var pe,se,Te,be,_,f,ce;if((se=(pe=Fe.value)==null?void 0:pe[J])!=null&&se.prop&&!Array.isArray(v)){let ie={};ie[Fe.value[J].column]=v,ve!=null&&ve.value&&((Te=ve==null?void 0:ve.value)==null?void 0:Te.length)>0&&((be=ve==null?void 0:ve.value)!=null&&be.find(re=>JSON.stringify(re==null?void 0:re[0])===JSON.stringify(ie)))&&(M=(_=ve==null?void 0:ve.value)==null?void 0:_.find(re=>JSON.stringify(re==null?void 0:re[0])===JSON.stringify(ie))),M&&M.length>0?V[Fe.value[J].prop]=M!=null&&M.find(re=>{var ke;return((ke=Object.keys(re))==null?void 0:ke[0])===Fe.value[J].column})?(f=M==null?void 0:M.find(re=>{var ke;return((ke=Object.keys(re))==null?void 0:ke[0])===Fe.value[J].column}))==null?void 0:f[Fe.value[J].column]:v:V[Fe.value[J].prop]=v}else Array.isArray(v)&&((ce=Fe.value[J])!=null&&ce.prop?V[Fe.value[J].prop]=v:V.children=Hl(v,Fe.value))})}else V=k;Array.isArray(k)&&k.some(M=>M==null?void 0:M.id)?B.push(Object.assign(V,{id:(I=k==null?void 0:k.find(M=>M.id))==null?void 0:I.id})):V.id?B.push(V):B.push(Object.assign(V,{id:C.toString()}))}),Y.value=da(B,u,W.value)}else Y.value=i;ua(Y.value),_l.value=Y.value;const c=Qr(_l.value,Xe.value,i);let d=[];if(gl.value?(d=(U=m.cloneDeep(gl).value.singleContent)==null?void 0:U.filter(B=>(B==null?void 0:B.id)!==(t==null?void 0:t.id)),d.push(t)):d=[t],Ke.value){const B={content:c,singleContent:((N=u==null?void 0:u.contents)==null?void 0:N.length)>0?d==null?void 0:d.flatMap(Rl):d,index:s==null?void 0:s.index,buttonName:"编辑",column:W.value,parentTableId:s==null?void 0:s.parentTableId};xe.setCacheUpdatingData(B)}if(e&&!((K=(z=(R=Ee.value)==null?void 0:R[0])==null?void 0:z.optionUrl)!=null&&K.menuId)){const B={content:c,singleContent:((o=u==null?void 0:u.contents)==null?void 0:o.length)>0?Rl(t):t,index:s==null?void 0:s.index,buttonName:Pe.value,column:W.value,parentTableId:s==null?void 0:s.parentTableId};xe.setTableLoading(s==null?void 0:s.index),Qe.value=!1,Oe.value=void 0,G("change",B)}if((T=(y=(x=Ee.value)==null?void 0:x[0])==null?void 0:y.optionUrl)!=null&&T.menuId){Qe.value=!1;let B=(D=s.itemData)==null?void 0:D.filter(k=>(k==null?void 0:k.key)==="filterAllType");if((B==null?void 0:B.length)>0){let C=(ee=(L=(Q=(B==null?void 0:B.map(V=>V==null?void 0:V.value)).flat().find(V=>{var I;return(I=V==null?void 0:V.content)==null?void 0:I.includes("@Num")}))==null?void 0:Q.content)==null?void 0:L.split(":"))==null?void 0:ee[1];C=parseInt(C),Y.value=(p=Y.value)==null?void 0:p.slice(((A=Y.value)==null?void 0:A.length)-C,(F=Y.value)==null?void 0:F.length)}}};l.onUnmounted(()=>{W.value=[],Y.value=[],Me.value=[],H.value=[],$e.value=[],nl.value=[],yl.value=[],cl.value=[],Ee.value=[],ze.value=[],j.value=null});const sa=async(e,a,n)=>{var g,S,w,q,h,E,U,N,R,z,K;sl.value=n==null?void 0:n.prop;const r=m.cloneDeep(s.itemData),t=r==null?void 0:r.map(o=>{var x;return(o==null?void 0:o.key)==="header"&&((x=o.contents)==null||x.map((y,T)=>{var D,Q,L,ee,A,F,p,B,k,C,V,I,M,v,J,pe,se,Te,be;return y.type=y!=null&&y.type?y.type:(ee=(L=(Q=(D=y==null?void 0:y.key)==null?void 0:D.split("$"))==null?void 0:Q[1])==null?void 0:L.split("("))!=null&&ee[0]?(F=(A=te.FormType)==null?void 0:A.find(_=>{var f,ce,ie,re;return(_==null?void 0:_.key)===((re=(ie=(ce=(f=y==null?void 0:y.key)==null?void 0:f.split("$"))==null?void 0:ce[1])==null?void 0:ie.split("("))==null?void 0:re[0])}))==null?void 0:F.value:"Input",y.options=y!=null&&y.options?y.options:((k=(B=(p=y==null?void 0:y.key)==null?void 0:p.split("$"))==null?void 0:B[1])==null?void 0:k.length)>0?(M=(I=Gl((V=(C=y==null?void 0:y.key)==null?void 0:C.split("$"))==null?void 0:V[1]))==null?void 0:I.split(","))==null?void 0:M.map(_=>({label:_,value:_})):[],(v=y==null?void 0:y.key)!=null&&v.includes("$")&&(y.key=(pe=(J=y==null?void 0:y.key)==null?void 0:J.split("$"))==null?void 0:pe[0]),y.value=(se=Object.values(a))==null?void 0:se[T],y.optionUrl=y!=null&&y.formMenuSelect&&((Te=y==null?void 0:y.formMenuSelect)==null?void 0:Te.length)>0?{groupSelect:(be=y==null?void 0:y.groupSelect)==null?void 0:be.split(/[::]/).map(_=>_.trim()),menuSelect:y==null?void 0:y.formMenuSelect,selectRelateType:"",type:(y==null?void 0:y.formType)??(y!=null&&y.groupSelect?"Select":"")}:null,y})),o});let i=m.cloneDeep(Ee.value),u=(S=(g=m.cloneDeep(t))==null?void 0:g.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:S.contents;i=i==null?void 0:i.map(o=>{var x;return o.value=(x=u==null?void 0:u.find((y,T)=>T===(o==null?void 0:o.id)))==null?void 0:x.value,o});let c="",d=(h=(q=(w=m.cloneDeep(t))==null?void 0:w.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:q.contents)==null?void 0:h.find((o,x)=>{var y,T,D;return(o==null?void 0:o.label)===sl.value||(x==null?void 0:x.toString())===((D=(T=(y=sl.value)==null?void 0:y.split("a"))==null?void 0:T[1])==null?void 0:D.toString())});if((N=(U=(E=m.cloneDeep(t))==null?void 0:E.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:U.contents)==null||N.forEach(o=>{var x,y,T,D,Q;c===""&&((T=(y=(x=o==null?void 0:o.optionUrl)==null?void 0:x.groupSelect)==null?void 0:y[1])!=null&&T.includes("["))&&(c=(Q=(D=o==null?void 0:o.optionUrl)==null?void 0:D.groupSelect)==null?void 0:Q[1])}),(R=d==null?void 0:d.optionUrl)!=null&&R.menuSelect){let o=await Ql(d),x;if(o==null||o.forEach(y=>{var T,D,Q,L,ee,A,F,p,B,k;c===((D=(T=d==null?void 0:d.optionUrl)==null?void 0:T.groupSelect)==null?void 0:D[1])&&((ee=(L=(Q=d==null?void 0:d.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:L[1])!=null&&ee.includes("["))&&((k=m.cloneDeep(y))==null?void 0:k[(B=(p=(F=(A=d==null?void 0:d.optionUrl)==null?void 0:A.groupSelect)==null?void 0:F[1])==null?void 0:p.replaceAll("[",""))==null?void 0:B.replaceAll("]","")])===(d==null?void 0:d.value)&&(x=y)}),x){let y=m.cloneDeep(i);y=y==null?void 0:y.map(D=>{var Q,L,ee,A,F,p,B,k,C,V,I;return(x!=null&&x[D==null?void 0:D.label]||x!=null&&x[(A=(ee=(L=(Q=D==null?void 0:D.optionUrl)==null?void 0:Q.groupSelect)==null?void 0:L[1])==null?void 0:ee.replaceAll("[",""))==null?void 0:A.replaceAll("]","")])&&((B=(p=(F=D==null?void 0:D.optionUrl)==null?void 0:F.groupSelect)==null?void 0:p[1])!=null&&B.includes("["))&&(D.value=(x==null?void 0:x[D==null?void 0:D.label])||(x==null?void 0:x[(I=(V=(C=(k=D==null?void 0:D.optionUrl)==null?void 0:k.groupSelect)==null?void 0:C[1])==null?void 0:V.replaceAll("[",""))==null?void 0:I.replaceAll("]","")])),D}),Y.value=(z=m.cloneDeep(Y.value))==null?void 0:z.map(D=>{if((D==null?void 0:D.id)===(a==null?void 0:a.id)){const Q={};return y==null||y.forEach(L=>{Q[L.name]=L.value}),Q.id=D==null?void 0:D.id,Q}return D});let T=m.cloneDeep(y);T=T==null?void 0:T.map(D=>{var Q,L,ee,A;return(L=(Q=D==null?void 0:D.optionUrl)==null?void 0:Q.menuSelect)!=null&&L.some(F=>F==null?void 0:F.includes)&&(D.optionUrl.menuSelect=(A=(ee=D==null?void 0:D.optionUrl)==null?void 0:ee.menuSelect)==null?void 0:A.map(F=>{var p,B,k,C;if(F!=null&&F.includes("[")){let V=(B=(p=F==null?void 0:F.replaceAll("[","").replaceAll("]",""))==null?void 0:p.split(":"))==null?void 0:B[1];F=(C=(k=m.cloneDeep(y))==null?void 0:k.find(I=>(I==null?void 0:I.label)===V))==null?void 0:C.value}return F})),D}),Y.value=(K=m.cloneDeep(Y.value))==null?void 0:K.map(D=>{if((D==null?void 0:D.id)===(a==null?void 0:a.id)){const Q={};return T==null||T.forEach(L=>{Q[L.name]=L.value}),Q.id=D==null?void 0:D.id,Q}return D})}}},fr=async e=>{var S,w,q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee;if(!e)return;Oe.value=e;const a=m.cloneDeep(s.itemData);let n=a==null?void 0:a.map(A=>{var F;return(A==null?void 0:A.key)==="header"&&((F=A.contents)==null||F.map((p,B)=>{var k,C,V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re,ke,Be,qe;return p.type=p!=null&&p.type?p.type:(I=(V=(C=(k=p==null?void 0:p.key)==null?void 0:k.split("$"))==null?void 0:C[1])==null?void 0:V.split("("))!=null&&I[0]?(v=(M=te.FormType)==null?void 0:M.find(_e=>{var je,Ie,el,ll;return(_e==null?void 0:_e.key)===((ll=(el=(Ie=(je=p==null?void 0:p.key)==null?void 0:je.split("$"))==null?void 0:Ie[1])==null?void 0:el.split("("))==null?void 0:ll[0])}))==null?void 0:v.value:"Input",p.options=p!=null&&p.options?p.options:((se=(pe=(J=p==null?void 0:p.key)==null?void 0:J.split("$"))==null?void 0:pe[1])==null?void 0:se.length)>0?(f=(_=Gl((be=(Te=p==null?void 0:p.key)==null?void 0:Te.split("$"))==null?void 0:be[1]))==null?void 0:_.split(","))==null?void 0:f.map(_e=>({label:_e,value:_e})):[],(ce=p==null?void 0:p.key)!=null&&ce.includes("$")&&(p.key=(re=(ie=p==null?void 0:p.key)==null?void 0:ie.split("$"))==null?void 0:re[0]),p.value=(ke=Object.values(e))==null?void 0:ke[B],p.optionUrl=p!=null&&p.formMenuSelect&&((Be=p==null?void 0:p.formMenuSelect)==null?void 0:Be.length)>0?{groupSelect:(qe=p==null?void 0:p.groupSelect)==null?void 0:qe.split(/[::]/).map(_e=>_e.trim()),menuSelect:p==null?void 0:p.formMenuSelect,selectRelateType:"",type:(p==null?void 0:p.formType)??(p!=null&&p.groupSelect?"Select":"")}:null,p})),A}),r=Ee.value,t=(w=(S=m.cloneDeep(n))==null?void 0:S.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:w.contents;if(t=t==null?void 0:t.filter(A=>(A==null?void 0:A.label)!=="操作"),t.push({label:"操作",type:"operate"}),r=r==null?void 0:r.map(A=>{var F;return A.value=A.value??((F=t==null?void 0:t.find((p,B)=>(p==null?void 0:p.prop)===(A==null?void 0:A.name)))==null?void 0:F.value),A}),!vl.value)return;let i="",u=(E=(h=(q=m.cloneDeep(n))==null?void 0:q.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:h.contents)==null?void 0:E.find((A,F)=>{var p,B,k;return(A==null?void 0:A.label)===sl.value||(F==null?void 0:F.toString())===((k=(B=(p=sl.value)==null?void 0:p.split("a"))==null?void 0:B[1])==null?void 0:k.toString())}),c=(U=u==null?void 0:u.optionUrl)==null?void 0:U.menuSelect,d=!0;(z=(R=(N=m.cloneDeep(n))==null?void 0:N.find(A=>(A==null?void 0:A.key)==="header"))==null?void 0:R.contents)==null||z.forEach(A=>{var F,p,B,k,C,V;d&&((B=(p=(F=A==null?void 0:A.optionUrl)==null?void 0:F.groupSelect)==null?void 0:p[1])!=null&&B.includes("["))&&(i=(C=(k=A==null?void 0:A.optionUrl)==null?void 0:k.groupSelect)==null?void 0:C[1],JSON.stringify(c)===JSON.stringify((V=A==null?void 0:A.optionUrl)==null?void 0:V.menuSelect)&&(d=!1))});let g=m.cloneDeep(r);if(g=g==null?void 0:g.map(A=>{var F,p;return(A==null?void 0:A.type)==="Select"&&((p=(F=A==null?void 0:A.optionUrl)==null?void 0:F.allSelectionContents)==null?void 0:p.length)>0&&(A.optionUrl.contactValue=e),A.value=e==null?void 0:e[A==null?void 0:A.prop],A}),Ee.value=m.cloneDeep(g),(K=u==null?void 0:u.optionUrl)!=null&&K.menuSelect&&vl.value||(y=(x=(o=Ee.value)==null?void 0:o[0])==null?void 0:x.optionUrl)!=null&&y.menuId){let A=await Ql(u,(Q=(D=(T=Ee.value)==null?void 0:T[0])==null?void 0:D.optionUrl)==null?void 0:Q.menuId),F;if((L=u==null?void 0:u.optionUrl)==null||L.menuSelect,A==null||A.forEach(p=>{var B,k,C,V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re;i===((k=(B=u==null?void 0:u.optionUrl)==null?void 0:B.groupSelect)==null?void 0:k[1])&&((I=(V=(C=u==null?void 0:u.optionUrl)==null?void 0:C.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((se=m.cloneDeep(p))==null?void 0:se[(pe=(J=(v=(M=u==null?void 0:u.optionUrl)==null?void 0:M.groupSelect)==null?void 0:v[1])==null?void 0:J.replaceAll("[",""))==null?void 0:pe.replaceAll("]","")])===(u==null?void 0:u.value)&&(F=p),(_=(be=(Te=Ee.value)==null?void 0:Te[0])==null?void 0:be.optionUrl)!=null&&_.menuId&&p[(ce=(f=Ee.value)==null?void 0:f[0])==null?void 0:ce.prop]===e[(re=(ie=Ee.value)==null?void 0:ie[0])==null?void 0:re.prop]&&(F=p)}),F){let p=m.cloneDeep(r);p=p==null?void 0:p.map(C=>{var V,I,M,v,J,pe,se,Te,be,_,f,ce,ie,re,ke,Be,qe,_e;return(F!=null&&F[C==null?void 0:C.label]||F!=null&&F[(v=(M=(I=(V=C==null?void 0:C.optionUrl)==null?void 0:V.groupSelect)==null?void 0:I[1])==null?void 0:M.replaceAll("[",""))==null?void 0:v.replaceAll("]","")])&&((se=(pe=(J=C==null?void 0:C.optionUrl)==null?void 0:J.groupSelect)==null?void 0:pe[1])!=null&&se.includes("["))&&(C.value=(F==null?void 0:F[C==null?void 0:C.label])||(F==null?void 0:F[(f=(_=(be=(Te=C==null?void 0:C.optionUrl)==null?void 0:Te.groupSelect)==null?void 0:be[1])==null?void 0:_.replaceAll("[",""))==null?void 0:f.replaceAll("]","")])),(re=(ie=(ce=Ee.value)==null?void 0:ce[0])==null?void 0:ie.optionUrl)!=null&&re.menuId&&(C.value=(F==null?void 0:F[C==null?void 0:C.label])||(F==null?void 0:F[(_e=(qe=(Be=(ke=C==null?void 0:C.optionUrl)==null?void 0:ke.groupSelect)==null?void 0:Be[1])==null?void 0:qe.replaceAll("[",""))==null?void 0:_e.replaceAll("]","")])),C}),Ee.value=m.cloneDeep(p);let B=m.cloneDeep(p);B=B==null?void 0:B.map(C=>{var V,I,M,v,J,pe;return(I=(V=C==null?void 0:C.optionUrl)==null?void 0:V.menuSelect)!=null&&I.some(se=>se==null?void 0:se.includes("["))&&(C.optionUrl.oldMenuSelect=(v=(M=m.cloneDeep(C))==null?void 0:M.optionUrl)==null?void 0:v.menuSelect,C.optionUrl.menuSelect=(pe=(J=C==null?void 0:C.optionUrl)==null?void 0:J.menuSelect)==null?void 0:pe.map(se=>{var Te,be,_,f;if(se!=null&&se.includes("[")){let ce=(be=(Te=se==null?void 0:se.replaceAll("[","").replaceAll("]",""))==null?void 0:Te.split(":"))==null?void 0:be[1];se=(f=(_=m.cloneDeep(p))==null?void 0:_.find(ie=>(ie==null?void 0:ie.label)===ce))==null?void 0:f.value}return se})),C}),Ee.value=B;let k={};(ee=Ee.value)==null||ee.forEach(C=>{k[C.prop]=C==null?void 0:C.value}),Oe.value=k}}vl.value=!1},gr=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",hr=e=>{var i,u;const a=(u=(i=$e.value)==null?void 0:i.find(c=>(c==null?void 0:c.label)===(e==null?void 0:e.label)))==null?void 0:u.multiple,n=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(c=>{const d=c==null?void 0:c[n];a&&ha.isString(d)&&(c[n]=[d]),!a&&!ha.isString(d)&&(c[n]="")})},ia=(e,a)=>{var n;return a==null||a.forEach(r=>{e[r==null?void 0:r.prop]=r==null?void 0:r.value}),e.children&&((n=e.children)==null?void 0:n.length)>0&&(e.children=e.children.map(r=>ia(r,a))),e},Jl=e=>{var n,r,t,i,u,c;ml("");const a=(n=Ee.value)==null?void 0:n.reduce((d,g)=>(d[g.name]=g.value,d),{});if(((r=Object.keys(a))==null?void 0:r.length)>0){Oe.value=a,He.value="",ul.value=(t=Y.value)==null?void 0:t.length,cl.value=(i=ol.value)==null?void 0:i.filter(g=>(g==null?void 0:g.label)!=="新增");const d=(c=(u=Me.value)==null?void 0:u.filter(g=>(g==null?void 0:g.label)!=="操作"))==null?void 0:c.map(g=>{var w,q,h;const S=(q=(w=$e.value)==null?void 0:w.find(E=>(E==null?void 0:E.label)===(g==null?void 0:g.label)))==null?void 0:q.multiple;return hr(g),{...g,contents:(g==null?void 0:g.options)??[],optionUrl:g!=null&&g.formMenuSelect&&((h=g==null?void 0:g.formMenuSelect)==null?void 0:h.length)>0?{groupSelect:g==null?void 0:g.groupSelect,menuSelect:g==null?void 0:g.formMenuSelect,selectRelateType:"",type:g==null?void 0:g.formType,multiple:S}:null}});W.value=d==null?void 0:d.map(g=>ia(g,[{prop:"type",value:"edit"},{prop:"columnType",value:gr(g==null?void 0:g.formType)||(g==null?void 0:g.columnType)}])),e==="createClick"&&Sl(!1)}},dl={START:"开始时间",END:"结束时间",HOURS:"工时"},yr=(e,a)=>Number(Wl.dayjs(a).diff(Wl.dayjs(e),"day",!0).toFixed(1)),ua=e=>{var i;const a=s.itemData,n=(i=a==null?void 0:a.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:i.contents,r=new Map;return n==null||n.forEach((u,c)=>{const{label:d}=u;r.set(d,c)}),!r.has(dl.START)||!r.has(dl.END)||!r.has(dl.HOURS)?e:e==null?void 0:e.map(u=>{const c=u==null?void 0:u[dl.START],d=u==null?void 0:u[dl.END],g=yr(c,d);return c&&d&&(u[dl.HOURS]=`${g}天`),u})},ca=(e,a,n=0)=>{if(n>((a==null?void 0:a.length)??""))return e;const r=a==null?void 0:a[n],t=new Map;for(const u of e){const c=u[r];t.has(c)||t.set(c,[]),t.get(c)&&t.get(c).push(u)}const i=[];for(const[u,c]of t){const[d,...g]=c,S={...d};n+1===((a==null?void 0:a.length)??"")?S.children=c==null?void 0:c.map(w=>(w.level=m.cloneDeep(n)+1,w)).filter((w,q)=>q!==0):g.length>0&&(S.children=ca(g,a,n+1)),S.level=n,i.push(S)}return i},da=(e,a,n)=>{var t;if(!(a!=null&&a.contents)||((t=a==null?void 0:a.contents)==null?void 0:t.length)===0)return e;let r=[];return r=ca(e,a==null?void 0:a.contents,0),r},pa=(e,a)=>{var q,h,E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p,B,k,C,V,I,M;const n=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="header");e==null||e.filter(v=>(v==null?void 0:v.key)==="tableIndexColumn")[0];const r=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="childTree")[0];let t=a;const i=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="page"),u=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="rowButton"),c=e==null?void 0:e.find(v=>(v==null?void 0:v.key)==="extraButton"),d=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableContents"),g=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableIndex");$e.value=(h=(q=e==null?void 0:e.filter(v=>(v==null?void 0:v.key)==="tableToForm"))==null?void 0:q[0])==null?void 0:h.contents,Xl.value=(i==null?void 0:i.contents)??!0;let S=[];tl.value===""?S=n==null?void 0:n[0]:S=(n==null?void 0:n.find(v=>(v==null?void 0:v.selectLabel)==="("+tl.value+")"))??(n==null?void 0:n.find(v=>!(v!=null&&v.selectLabel)));let w=[];if(tl.value===""?w=g==null?void 0:g[0]:w=(g==null?void 0:g.find(v=>(v==null?void 0:v.selectLabel)==="("+tl.value+")"))??(g==null?void 0:g.find(v=>!(v!=null&&v.selectLabel))),((E=S==null?void 0:S.contents)==null?void 0:E.length)>0){let v=[];if(S!=null&&S.contents.some(_=>Array.isArray(_)&&(_==null?void 0:_.find(f=>f.children))))Xe.value===""?v=(N=(U=te.getGradeColumns(S==null?void 0:S.contents))==null?void 0:U[0])==null?void 0:N.filter(_=>!Array.isArray(_)):(Xe.value.split("-"),v=(R=te.getGradeColumns(S==null?void 0:S.contents))==null?void 0:R[0]);else{let _=S!=null&&S.contents.some(f=>Array.isArray(f))?(z=S==null?void 0:S.contents)==null?void 0:z[0]:S==null?void 0:S.contents;_==null||_.forEach((f,ce)=>{var ke,Be,qe,_e;let ie="";(Be=(ke=Z.value)==null?void 0:ke.split("/"))==null||Be.forEach(je=>{var Ie,el,ll;if(je!==""){let pl=(ll=(el=(Ie=je==null?void 0:je.split(fe+"updateLoading"))==null?void 0:Ie[0])==null?void 0:el.split(fe+"loading"))==null?void 0:ll[0];ie=ie===""?ie+pl:ie+"/"+pl}}),ie=ie+fe+(f==null?void 0:f.directiveLabel);const re=(qe=$e.value)==null?void 0:qe.find(je=>(je==null?void 0:je.prop)===(f==null?void 0:f.prop));v.push({label:(f==null?void 0:f.label)??"",prop:(f==null?void 0:f.label)==="操作"?"operate":(f==null?void 0:f.prop)??"a"+ce,width:f!=null&&f.width?parseInt(f.width):"",fixed:(f==null?void 0:f.fixed)??void 0,sortable:(f==null?void 0:f.sortable)??!1,filterable:(f==null?void 0:f.filterable)??!1,operable:(f==null?void 0:f.operable)??!1,showSummary:(f==null?void 0:f.showSummary)??!1,align:(f==null?void 0:f.align)??"left",showOverflowTooltip:(f==null?void 0:f.showOverflowTooltip)??!0,isNotDrag:(f==null?void 0:f.isNotDrag)??!1,isEditCol:(f==null?void 0:f.isEditCol)??!1,isOperate:(f==null?void 0:f.isOperate)??!1,id:(f==null?void 0:f.id)??ce,type:(f==null?void 0:f.label)==="操作"?"operate":void 0,formType:(f==null?void 0:f.formType)??(f!=null&&f.groupSelect?"Select":""),isTableColHidden:f==null?void 0:f.isTableColHidden,isFormColHidden:f==null?void 0:f.isFormColHidden,disabled:f==null?void 0:f.disabled,options:(f==null?void 0:f.options)??[],value:(f==null?void 0:f.value)??"",formMenuSelect:(f==null?void 0:f.formMenuSelect)??[],isRoute:(f==null?void 0:f.isRoute)??!1,groupSelect:f!=null&&f.groupSelect?(_e=f==null?void 0:f.groupSelect)==null?void 0:_e.replaceAll('"',"").split(":"):[],isMainKey:(f==null?void 0:f.isMainKey)||(f==null?void 0:f.directiveLabel)&&!t[ie],columnType:(re==null?void 0:re.type)||(f==null?void 0:f.columnType)||"TEXTAREA",directiveLabel:f==null?void 0:f.directiveLabel,isExistChild:!!(f!=null&&f.directiveLabel&&t[ie]),childPath:ie,allSelectionContents:(f==null?void 0:f.allSelectionContents)??[],selectFilter:f==null?void 0:f.selectFilter})})}W.value=te.getNewColumnChild(v),H.value=te.getNewColumnChild(v),X.value=(K=W.value)==null?void 0:K.map(_=>_==null?void 0:_.label),Ze.value=(o=W.value)==null?void 0:o.every(_=>_==null?void 0:_.filterable),ue.value=(x=W.value)==null?void 0:x.every(_=>_==null?void 0:_.operable),Ye.value=(y=W.value)==null?void 0:y.every(_=>_==null?void 0:_.sortable);let J=(D=(T=te.getAllLeafNodes(W.value))==null?void 0:T.filter(_=>(_==null?void 0:_.type)!=="operate"))==null?void 0:D.map((_,f)=>({prop:(_==null?void 0:_.prop)??"a"+f,column:_.label}));Fe.value=J;let pe=[];tl.value===""?pe=d==null?void 0:d[0]:pe=(d==null?void 0:d.find(_=>(_==null?void 0:_.selectLabel)==="("+tl.value+")"))??(d==null?void 0:d.find(_=>!(_!=null&&_.selectLabel)));let se=Array.isArray((Q=pe==null?void 0:pe.contents)==null?void 0:Q[0])&&((L=pe==null?void 0:pe.contents)!=null&&L[0].every(_=>Array.isArray(_)))?(ee=pe==null?void 0:pe.contents)==null?void 0:ee[0]:pe==null?void 0:pe.contents;w!=null&&w.contents&&((A=w==null?void 0:w.contents)==null?void 0:A.length)!==0&&(se=(F=m.cloneDeep(se))==null?void 0:F.map((_,f)=>{if(!Array.isArray(_)){let ce={};for(let ie in _)ie!=="id"&&ie!=="index"&&(ce[ie]=_[ie]);_=Object.values(ce)}return _}));const Te=!!((p=W.value)!=null&&p.find(_=>_.prop==="index"));se=ka(se,w==null?void 0:w.contents,Te);const be=[];se==null||se.forEach((_,f)=>{var ie;let ce={};if(Array.isArray(_)){let re=[];_==null||_.filter(ke=>!(ke!=null&&ke.id)).forEach((ke,Be)=>{var qe,_e,je,Ie,el,ll;if((qe=J==null?void 0:J[Be])!=null&&qe.prop&&!Array.isArray(ke)){let pl={};pl[J[Be].column]=ke,ve!=null&&ve.value&&((_e=ve==null?void 0:ve.value)==null?void 0:_e.length)>0&&((je=ve==null?void 0:ve.value)!=null&&je.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(pl)))&&(re=(Ie=ve==null?void 0:ve.value)==null?void 0:Ie.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(pl))),re&&re.length>0?ce[J[Be].prop]=re!=null&&re.find(Re=>{var Cl;return((Cl=Object.keys(Re))==null?void 0:Cl[0])===J[Be].column})?(el=re==null?void 0:re.find(Re=>{var Cl;return((Cl=Object.keys(Re))==null?void 0:Cl[0])===J[Be].column}))==null?void 0:el[J[Be].column]:ke:ce[J[Be].prop]=ke}else Array.isArray(ke)&&((ll=J[Be])!=null&&ll.prop?ce[J[Be].prop]=ke:ce.children=Hl(ke,J))})}else ce=_;Array.isArray(_)&&_.some(re=>re==null?void 0:re.id)?be.push(Object.assign(ce,{id:(ie=_==null?void 0:_.find(re=>re.id))==null?void 0:ie.id})):ce.id?be.push(ce):be.push(Object.assign(ce,{id:f.toString()}))}),Y.value=da(be,r,W.value),Tl.value=be,(B=Tl.value)==null||B.forEach(_=>{var f;(f=Nl.value)==null||f.set(_.id,_)})}else W.value=[],Me.value=[],Y.value=[],Tl.value=[],Nl.value=new Map;((k=u==null?void 0:u.contents)==null?void 0:k.length)>0?nl.value=u==null?void 0:u.contents:nl.value=[],((C=c==null?void 0:c.contents)==null?void 0:C.length)>0?(cl.value=c==null?void 0:c.contents,ol.value=c==null?void 0:c.contents):(cl.value=[],ol.value=[]),ul.value=((V=Y==null?void 0:Y.value)==null?void 0:V.length)??0,ua(Y.value),_l.value=Y.value,Ke.value&&(W.value=(M=(I=Me.value)==null?void 0:I.filter(v=>(v==null?void 0:v.label)!=="操作"))==null?void 0:M.map(v=>{var J;return{...v,type:"edit",optionUrl:v!=null&&v.formMenuSelect&&((J=v==null?void 0:v.formMenuSelect)==null?void 0:J.length)>0?{groupSelect:v==null?void 0:v.groupSelect,menuSelect:v==null?void 0:v.formMenuSelect,selectRelateType:"",type:v==null?void 0:v.formType}:null}}),Jl())};l.watch(()=>[s.itemData,tl.value,Na.value,Xe.value,ve==null?void 0:ve.value],async()=>{var e,a,n,r,t,i;if((e=s==null?void 0:s.itemData)!=null&&e.find(u=>(u==null?void 0:u.key)==="columnPath")&&!((a=hl.value)!=null&&a.find(u=>{var c,d;return(u==null?void 0:u.key)===((d=(c=s==null?void 0:s.itemData)==null?void 0:c.find(g=>(g==null?void 0:g.key)==="columnPath"))==null?void 0:d.contents)}))){let u=hl.value,c={key:(r=(n=s==null?void 0:s.itemData)==null?void 0:n.find(d=>(d==null?void 0:d.key)==="columnPath"))==null?void 0:r.contents,value:(i=(t=s==null?void 0:s.itemData)==null?void 0:t.find(d=>(d==null?void 0:d.key)==="columnUsingPath"))==null?void 0:i.contents};u!=null&&u.find(d=>(d==null?void 0:d.key)===(c==null?void 0:c.key))?u=u==null?void 0:u.map(d=>((d==null?void 0:d.key)===(c==null?void 0:c.key)&&(d.value=c.value),d)):u.push(c),xe.setTableViewContents(u)}pa(s.itemData,s.allMapContents)},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.operatingForm,e=>{e!=null&&e.form&&(ml(e==null?void 0:e.form),Pe.value=e==null?void 0:e.dialogTitle,Al.value=!0,Qe.value=!0)},{immediate:!0,deep:!0});const fa=()=>{var e;(e=me.value)!=null&&e.includes("read")&&(Ke.value=!Ke.value)},vr=()=>{Ul.value=!Ul.value};l.watch(()=>{var e;return(e=s==null?void 0:s.config)==null?void 0:e.viewport},e=>{var a;me.value=e,(e==null?void 0:e.length)===0?Ke.value=!1:(e!=null&&e.includes("read")||(Ke.value=!0),e!=null&&e.includes("edit")||(Ke.value=!1)),ge.value=((a=s==null?void 0:s.config)==null?void 0:a.showIndex)||Ke.value},{immediate:!0}),l.watch(()=>Ke.value,e=>{var a;e?(Jl("viewChange"),xe.setCacheUpdatingData(null)):(cl.value=ol.value,W.value=H.value,gl.value&&(xe.setTableLoading(s==null?void 0:s.index),G("change",gl.value))),ae.value=e,ge.value=e||((a=s==null?void 0:s.config)==null?void 0:a.showIndex)},{immediate:!0}),l.watch(()=>{var e;return(e=Zl.value)==null?void 0:e.length},e=>{e===0&&(oe.currentPage=1)}),l.watch(()=>s==null?void 0:s.compNames,e=>{De.contents=[{label:"列表名",prop:"groupName",name:"列表名",type:"select",value:"",id:0,contents:e||[],width:1}]},{immediate:!0}),l.ref(!1);const br=(e,a)=>{var n;Jl("createClick"),a===oe.pageSize&&(oe.currentPage=Math.ceil(((n=Y.value)==null?void 0:n.length)/oe.pageSize))},kr=(e,a,n)=>{var r;sa(n,e,a),Oe.value=m.cloneDeep(e),He.value=e==null?void 0:e.id,ul.value=(r=Y.value)==null?void 0:r.length,Pe.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",Sl(!1)},Le=e=>{var d,g,S,w,q,h,E,U,N,R;const{row:a,column:n,item:r,slotData:t}=e;let i=a!=null&&a[n==null?void 0:n.prop]||(a==null?void 0:a[n==null?void 0:n.prop])===0?((g=(d=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:d[0])==null?void 0:g.contents)??((a==null?void 0:a[n==null?void 0:n.prop])===0?"0":a==null?void 0:a[n==null?void 0:n.prop]):((w=(S=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:S[0])==null?void 0:w.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((h=(q=t==null?void 0:t[r==null?void 0:r.prop])==null?void 0:q[0])==null?void 0:h.contents)??(t==null?void 0:t[r==null?void 0:r.prop])??((N=(U=a==null?void 0:a[(E=r==null?void 0:r.child)==null?void 0:E.prop])==null?void 0:U[0])==null?void 0:N.contents)??(a==null?void 0:a[(R=r==null?void 0:r.child)==null?void 0:R.prop]),c=Array.isArray(i)&&!(i!=null&&i.every(z=>typeof z=="string"||typeof z=="number"))?"查看":i;return c=Array.isArray(c)?c.join(","):c,c},mr=e=>{var g,S,w,q,h,E,U,N,R,z;const{row:a,column:n,item:r,slotData:t}=e;let i=a!=null&&a[n==null?void 0:n.prop]?((S=(g=a==null?void 0:a[n==null?void 0:n.prop])==null?void 0:g[0])==null?void 0:S.contents)??(a==null?void 0:a[n==null?void 0:n.prop]):((q=(w=a==null?void 0:a[r==null?void 0:r.prop])==null?void 0:w[0])==null?void 0:q.contents)??(a==null?void 0:a[r==null?void 0:r.prop])??((E=(h=t==null?void 0:t[r==null?void 0:r.prop])==null?void 0:h[0])==null?void 0:E.contents)??(t==null?void 0:t[r==null?void 0:r.prop])??((R=(N=a==null?void 0:a[(U=r==null?void 0:r.child)==null?void 0:U.prop])==null?void 0:N[0])==null?void 0:R.contents)??(a==null?void 0:a[(z=r==null?void 0:r.child)==null?void 0:z.prop]);const c=Array.isArray(i)&&!(i!=null&&i.every(K=>typeof K=="string"||typeof K=="number")),d=Array.isArray(i)&&(i==null?void 0:i.find(K=>K==null?void 0:K.url));return c&&d},Sr=(e,a)=>e.find(n=>Object.values(n).some(r=>r===a));return l.watch(()=>Ge.value,async e=>{if(e){P.setContentLoading(!0),await l.nextTick();const a=Sr(Y.value,e==null?void 0:e.data);if(!a)return P.setContentLoading(!1);await la(e==null?void 0:e.data,null,a,{data:e==null?void 0:e.data,isMainKey:!0}),P.setContentLoading(!1)}},{deep:!0,immediate:!0}),l.watch(()=>s==null?void 0:s.cacheNewData,e=>{var a;e&&(Array.isArray(e)||(e==null?void 0:e.compId)===(s==null?void 0:s.index)&&(Y.value=(a=Y.value)==null?void 0:a.map(n=>{var r;return(n==null?void 0:n.id)===((r=e==null?void 0:e.data)==null?void 0:r.id)?{...n,id:e==null?void 0:e.resId}:n})))},{immediate:!0,deep:!0}),(e,a)=>{var g,S,w,q;const n=l.resolveComponent("svg-icon"),r=l.resolveComponent("el-popover"),t=l.resolveComponent("el-switch"),i=l.resolveComponent("el-checkbox"),u=l.resolveComponent("el-checkbox-group"),c=l.resolveComponent("el-button"),d=l.resolveComponent("LookComponent");return l.openBlock(),l.createElementBlock("div",Yr,[Yl.value?(l.openBlock(),l.createBlock(Je.ssTable,{id:"excel-table",pageObj:oe,showIndex:ge.value,isTree:(g=O.compItem)==null?void 0:g.isTree,summaryInfo:ye,columns:W.value,defaultSort:Ne,isCardViewport:Ul.value,checkedColumns:X.value,key:Pl.value+JSON.stringify(W.value),tableData:Zl.value,isEditViewport:Ke.value,isShowPagination:Xl.value,isShowEdit:!1,isShowDelete:!1,allowSelect:ae.value,onDbClickRow:Xa,extraButton:cl.value,rowButton:nl.value,cacheExtraButtons:ol.value,isClearSelection:((S=ze.value)==null?void 0:S.length)===0,onDoCurrentChange:Ua,onDoSizeChange:Oa,onContentClick:la,onRowClick:Za,onSelectChange:Fa,onCellChange:kr,onChange:sa,onPreview:Il,onSubmitEditingTable:Pa,onHandleColEditChange:$a,onHandleColTypeChange:Va,onClickButton:Ml},l.createSlots({headerButton:l.withCtx(h=>{var E,U;return[O.showHeader?(l.openBlock(),l.createBlock(Pr,{key:0,pageLayout:O.pageLayout,lockingPage:l.unref(Dl)===l.unref(Z),filterValues:ea.value,selectNums:(E=ze.value)==null?void 0:E.length,dataNums:(U=Y.value)==null?void 0:U.length,compName:O.compName,isDevMode:O.isDevMode,buttons:h.buttons,onButtonClick:a[0]||(a[0]=N=>Ml(N,"",{})),columns:W.value,onFilter:Qa,onGetImportData:ja,level:O.level},null,8,["pageLayout","lockingPage","filterValues","selectNums","dataNums","compName","isDevMode","buttons","columns","level"])):l.createCommentVNode("",!0)]}),viewport:l.withCtx(()=>{var h,E,U,N;return[((h=Y.value)==null?void 0:h.length)>0&&O.allowOperate?(l.openBlock(),l.createElementBlock("div",en,[(E=me.value)!=null&&E.includes("read")&&((U=me.value)!=null&&U.includes("edit"))&&((N=nl.value)!=null&&N.some(R=>(R==null?void 0:R.label)==="编辑"))&&!Ul.value&&l.unref(Dl)!==l.unref(Z)?(l.openBlock(),l.createElementBlock("span",{key:0,title:"编辑表格",onClick:fa},[l.createVNode(n,{name:"editTable",class:"view-icon"})])):l.createCommentVNode("",!0),l.createElementVNode("span",{title:"卡片视图",onClick:vr},[l.createVNode(n,{name:"cardViewport",class:"view-icon"})])])):l.createCommentVNode("",!0)]}),rowCreate:l.withCtx(({row:h,index:E})=>[l.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:U=>br(h,E)},[l.createVNode(n,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,ln)]),operateCol:l.withCtx(()=>[l.createVNode(r,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:pr},{reference:l.withCtx(()=>[l.createElementVNode("span",an,[l.createVNode(n,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:l.withCtx(()=>[l.createElementVNode("div",rn,[a[11]||(a[11]=l.createElementVNode("div",{class:"group-title"},"表格操作",-1)),l.createVNode(t,{"model-value":Ye.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:a[2]||(a[2]=h=>Kl(h,"sortable"))},null,8,["model-value"]),l.createVNode(t,{"model-value":Ze.value,"active-text":"筛选","inactive-text":"",style:{"margin-right":"8px"},onChange:a[3]||(a[3]=h=>Kl(h,"filterable"))},null,8,["model-value"]),l.createVNode(t,{"model-value":ue.value,"active-text":"编辑所有表头","inactive-text":"",onChange:a[4]||(a[4]=h=>Kl(h,"operable"))},null,8,["model-value"]),a[12]||(a[12]=l.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),l.createVNode(u,{modelValue:X.value,"onUpdate:modelValue":a[5]||(a[5]=h=>X.value=h),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:j},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(bl.value,h=>(l.openBlock(),l.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:h.label},[l.createVNode(i,{value:h.label,style:{width:"100%",marginRight:0}},{default:l.withCtx(()=>[l.createElementVNode("span",{title:h.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},l.toDisplayString(h.label),9,nn)]),_:2},1032,["value"]),l.createVNode(r,{title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:l.withCtx(()=>{var E;return[l.createElementVNode("div",on,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((E=Object.keys(h))==null?void 0:E.filter(U=>{var N;return(N=he.value)==null?void 0:N.find(R=>(R==null?void 0:R.value)===U)}),U=>{var N,R;return l.openBlock(),l.createElementBlock("div",{key:U},[l.createVNode(t,{"model-value":h==null?void 0:h[U],"active-text":(R=(N=he.value)==null?void 0:N.find(z=>(z==null?void 0:z.value)===U))==null?void 0:R.label,onChange:z=>za(z,U,h)},null,8,["model-value","active-text","onChange"])])}),128))])]}),_:2},1024),l.createElementVNode("span",tn,[l.createVNode(n,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:l.withCtx(h=>{var E,U,N,R,z,K,o,x,y,T,D,Q,L,ee,A,F,p,B;return[mr(h)?(l.openBlock(),l.createBlock(r,{key:0,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:l.withCtx(()=>[l.createElementVNode("span",sn,l.toDisplayString(Le(h)),1)]),default:l.withCtx(()=>{var k,C;return[l.createElementVNode("div",un,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((C=h==null?void 0:h.row)==null?void 0:C[(k=h==null?void 0:h.column)==null?void 0:k.prop],V=>(l.openBlock(),l.createElementBlock("div",cn,[l.createElementVNode("div",{class:"prop-url",title:jl(V),onClick:I=>Ja(V)},l.toDisplayString(jl(V)),9,dn),l.createElementVNode("div",{class:"prop-download",onClick:I=>Wa(V)}," 下载 ",8,pn)]))),256))])]}),_:2},1024)):(l.openBlock(),l.createElementBlock("div",{key:1,style:l.normalizeStyle({color:!Array.isArray(Le(h))&&((U=(E=Le(h))==null?void 0:E.toString())!=null&&U.includes(".txt")||(R=(N=Le(h))==null?void 0:N.toString())!=null&&R.includes(".cpt")||(K=(z=Le(h))==null?void 0:z.toString())!=null&&K.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(Le(h))&&((x=(o=Le(h))==null?void 0:o.toString())!=null&&x.includes(".txt")||(T=(y=Le(h))==null?void 0:y.toString())!=null&&T.includes(".cpt")||(Q=(D=Le(h))==null?void 0:D.toString())!=null&&Q.includes(".cyd"))?"underline":"",cursor:!Array.isArray(Le(h))&&((ee=(L=Le(h))==null?void 0:L.toString())!=null&&ee.includes(".txt")||(F=(A=Le(h))==null?void 0:A.toString())!=null&&F.includes(".cpt")||(B=(p=Le(h))==null?void 0:p.toString())!=null&&B.includes(".cyd"))?"pointer":"",marginLeft:(h==null?void 0:h.colIndex)===0?`${((h==null?void 0:h.level)??0)*20}px`:0}),onClick:k=>wa(Le(h))},l.toDisplayString(Le(h)===0?"0":Le(h)),13,fn))]}),_:2},[((w=nl.value)==null?void 0:w.length)>0&&l.unref(Dl)!==l.unref(Z)?{name:"actions",fn:l.withCtx(({item:h})=>[l.createVNode(r,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:l.withCtx(()=>[l.createVNode(n,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:l.withCtx(()=>[l.createElementVNode("div",Zr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ga(nl.value,h),(E,U)=>(l.openBlock(),l.createElementBlock("div",{class:"menu-config-item",key:U,onClick:N=>Ml(E==null?void 0:E.label,h,{extra:E})},[l.createElementVNode("div",{style:l.normalizeStyle({color:E==null?void 0:E.textColor}),class:"extra-button-label"},l.toDisplayString(E==null?void 0:E.label),5)],8,Ir))),128))])]),_:2},1024)]),key:"0"}:void 0,((q=Y.value)==null?void 0:q.length)>0?{name:"batchButton",fn:l.withCtx(h=>[l.withDirectives(l.createVNode(Kr,{lockingPage:l.unref(Dl)===l.unref(Z),buttons:h.buttons,selectTableItems:ze.value,onButtonClick:a[1]||(a[1]=E=>Ml(E,"",{}))},null,8,["lockingPage","buttons","selectTableItems"]),[[l.vShow,ae.value]]),l.withDirectives(l.createElementVNode("div",null,null,512),[[l.vShow,!ae.value]])]),key:"1"}:void 0]),1032,["pageObj","showIndex","isTree","summaryInfo","columns","defaultSort","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection"])):l.createCommentVNode("",!0),l.createVNode(xl.ssDialog,{title:Pe.value,visible:Qe.value,width:Ba.value,onBeforeDestroy:qa,style:{height:"74%"}},{default:l.withCtx(()=>[l.createElementVNode("div",gn,[l.createVNode(Je.ssForm,{rowContents:Ee.value,isEnableWrap:!1,showOperator:!1,onChange:fr,onClickTrigger:Ra,isEdit:El.value,onBlurChange:Ka},null,8,["rowContents","isEdit"])])]),footer:l.withCtx(()=>[Al.value?(l.openBlock(),l.createElementBlock("div",hn,[l.createVNode(c,{onClick:a[6]||(a[6]=h=>Qe.value=!1),id:"themeBorderButton"},{default:l.withCtx(()=>a[13]||(a[13]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[13]}),l.createVNode(c,{class:"ok-button",onClick:a[7]||(a[7]=h=>Sl(!0)),id:"themeButton"},{default:l.withCtx(()=>a[14]||(a[14]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[14]})])):l.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),l.createVNode(xl.ssDialog,{title:Pe.value,visible:Bl.value,width:Vl.value,onBeforeDestroy:a[9]||(a[9]=h=>Bl.value=!1)},{default:l.withCtx(()=>[l.createVNode(Wr)]),footer:l.withCtx(()=>[l.createElementVNode("div",yn,[l.createVNode(c,{onClick:a[8]||(a[8]=h=>Bl.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:l.withCtx(()=>a[15]||(a[15]=[l.createTextVNode(l.toDisplayString("取消"))])),_:1,__:[15]}),l.createVNode(c,{class:"ok-button",onClick:Ia,id:"themeButton"},{default:l.withCtx(()=>a[16]||(a[16]=[l.createTextVNode(l.toDisplayString("确认"))])),_:1,__:[16]})])]),_:1},8,["title","visible","width"]),b.value?(l.openBlock(),l.createBlock(Je.ssFilePreview,{key:1,fileDataList:Se.value,onDestroy:Ya},null,8,["fileDataList"])):l.createCommentVNode("",!0),ne.value?(l.openBlock(),l.createBlock(xl.ssDialog,{key:2,visible:ne.value,onBeforeDestroy:cr,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:l.withCtx(()=>[l.createVNode(fl.ThreeViewerHost,{"file-urls":yl.value,isThreeScene:we.value,isSelfWindow:!0,threeData:Ue.value},null,8,["file-urls","isThreeScene","threeData"])]),_:1},8,["visible"])):l.createCommentVNode("",!0),l.createVNode(xl.ssDialog,{visible:e.componentVisible,onBeforeDestroy:a[10]||(a[10]=h=>e.componentVisible=!1),width:Vl.value,style:{height:"70vh"}},{default:l.withCtx(()=>[l.createVNode(d,{dialogItem:Ol.value},null,8,["dialogItem"])]),_:1},8,["visible","width"]),l.createVNode(xl.ssDialog,{title:De.title,visible:De.show,width:De.width,onBeforeDestroy:nr},{default:l.withCtx(()=>[l.createElementVNode("div",vn,[l.createVNode(Je.ssForm,{rowContents:De==null?void 0:De.contents,formRules:De==null?void 0:De.formRules,showOperator:!1,buttonValue:De.buttonValue,isEdit:El.value,isStartJustify:!1,isEnableWrap:!1,onOnButtonClick:or},null,8,["rowContents","formRules","buttonValue","isEdit"])])]),_:1},8,["title","visible","width"])])}}},kn=$l._export_sfc(bn,[["__scopeId","data-v-87f94f9e"]]);exports.formGetOptions=Gl;exports.getSelectRow=Ql;exports.ssTable=kn;exports.useFormComp=Ca;exports.useFormToTableComp=va;exports.useUnit=ba;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as s, watch as d, defineComponent as
|
|
1
|
+
import { ref as s, watch as d, defineComponent as m, reactive as y, onMounted as i, createElementBlock as g, openBlock as D, createVNode as f } from "vue";
|
|
2
2
|
import "./index-BHtNKL1L.js";
|
|
3
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import {
|
|
5
|
-
import { g as v, s as c } from "./index-
|
|
6
|
-
import { s as
|
|
7
|
-
const
|
|
3
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CTRnGkVw.js";
|
|
4
|
+
import { as as h, ar as C, a as _, u as k, at as S } from "./index.vue_vue_type_style_index_1_lang-6KO-EDQa.js";
|
|
5
|
+
import { g as v, s as c } from "./index-CExeGHij.js";
|
|
6
|
+
import { s as T } from "./index-diSrIKAW.js";
|
|
7
|
+
const A = _(), { itemData: B } = c(A), u = s(0), I = s([
|
|
8
8
|
{
|
|
9
9
|
label: "机构名称",
|
|
10
10
|
value: "",
|
|
@@ -158,14 +158,14 @@ const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
158
158
|
queryFormData: I,
|
|
159
159
|
structureId: u,
|
|
160
160
|
tempDeptPageData: j
|
|
161
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
161
|
+
}, Symbol.toStringTag, { value: "Module" })), E = { class: "role-wrapper" }, G = /* @__PURE__ */ m({
|
|
162
162
|
__name: "index",
|
|
163
163
|
setup(e) {
|
|
164
|
-
const t =
|
|
164
|
+
const t = y({ ...O }), l = k(), { activeMenuPath: a } = c(l);
|
|
165
165
|
return i(async () => {
|
|
166
166
|
t.structureId = await S(a.value);
|
|
167
|
-
}), (o, n) => (D(), g("div",
|
|
168
|
-
f(
|
|
167
|
+
}), (o, n) => (D(), g("div", E, [
|
|
168
|
+
f(T, {
|
|
169
169
|
itemData: t.pageData,
|
|
170
170
|
onChange: t.handleItemDataChange
|
|
171
171
|
}, null, 8, ["itemData", "onChange"])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as b } from "./index.vue_vue_type_style_index_0_scoped_92477073_lang
|
|
2
|
-
import { s as K } from "./index.vue_vue_type_style_index_0_scoped_92477073_lang
|
|
1
|
+
import { _ as b } from "./index.vue_vue_type_style_index_0_scoped_92477073_lang--woCJ_em.js";
|
|
2
|
+
import { s as K } from "./index.vue_vue_type_style_index_0_scoped_92477073_lang--woCJ_em.js";
|
|
3
3
|
import { resolveComponent as r, createElementBlock as s, openBlock as n, Fragment as p, createVNode as l, createCommentVNode as k, withCtx as i, createElementVNode as d, normalizeStyle as w, toDisplayString as c, renderList as v, createTextVNode as _, createBlock as B, resolveDynamicComponent as I } from "vue";
|
|
4
4
|
import { _ as m } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const L = ["title"], V = {
|