ss-component-new 1.1.941 → 1.1.942
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/{animationData-sOrSYPEw.js → animationData-DfMxPGHk.js} +1 -1
- package/dist/{animationData-W92E44dA.cjs → animationData-tum65z7I.cjs} +1 -1
- package/dist/{index-DsTwfnbA.cjs → index--9-L_0WK.cjs} +1 -1
- package/dist/{index-CP4PL8XP.js → index-9UQxZFNT.js} +1 -1
- package/dist/{index-DBdP3_aq.js → index-B5c7pfAy.js} +4 -4
- package/dist/{index-DJBwl1mu.cjs → index-BZhLzmOI.cjs} +1 -1
- package/dist/{index-D5zLLpys.cjs → index-B_vBSg5I.cjs} +1 -1
- package/dist/{index-UWNOueQZ.js → index-Be4DYwjS.js} +2 -2
- package/dist/{index-BQf7up26.js → index-BtMf3kcU.js} +1 -1
- package/dist/{index-C7V_MW0B.js → index-Bu5nKXhB.js} +5 -5
- package/dist/{index-CfsuXJkL.js → index-C537MMhi.js} +2 -2
- package/dist/{index-EnQV9JKn.cjs → index-C6MceL6i.cjs} +1 -1
- package/dist/{index-BC9idM7U.cjs → index-C6Z_m60j.cjs} +1 -1
- package/dist/{index-C7_xf2sE.js → index-CBVt0eJx.js} +1 -1
- package/dist/{index-u3GpZ1_m.cjs → index-CE1id8xa.cjs} +1 -1
- package/dist/{index-B1BeXQHh.cjs → index-CN0JNJFz.cjs} +1 -1
- package/dist/{index-DxdHYRga.cjs → index-CXXF_t5P.cjs} +1 -1
- package/dist/{index-C6dXVVsO.js → index-CXnr_Nbq.js} +1 -1
- package/dist/{index-DdZWnc-o.js → index-Cb2BBys3.js} +1 -1
- package/dist/{index-WaiG_jnH.cjs → index-CeoH-_bz.cjs} +1 -1
- package/dist/{index-BxrUtjp9.cjs → index-CgHn69kx.cjs} +1 -1
- package/dist/{index-Nep8PzLq.cjs → index-CuEnsd7x.cjs} +1 -1
- package/dist/{index-C_FdEZsN.cjs → index-D2lGI0Ui.cjs} +1 -1
- package/dist/{index-BxWqzPx_.cjs → index-DDp4GGMy.cjs} +1 -1
- package/dist/{index-BxxNTatQ.cjs → index-DOeMZ9Mv.cjs} +1 -1
- package/dist/{index-DZ_WpX_6.js → index-DPWmZ1om.js} +1 -1
- package/dist/{index-DsDS9Nq_.js → index-DZpdWFCw.js} +1 -1
- package/dist/{index-HNKlGwxC.js → index-Ds_DSqU9.js} +2 -2
- package/dist/{index-DpzryD1L.js → index-E9BO4gjz.js} +4 -4
- package/dist/{index-BvXYYiPV.js → index-EA074xcT.js} +1 -1
- package/dist/{index-Df7b-tOZ.cjs → index-F5SbKqW4.cjs} +1 -1
- package/dist/{index-Bz5WfYyU.cjs → index-PO946557.cjs} +1 -1
- package/dist/{index-BZpiTdpI.js → index-WEyrdQxW.js} +3 -3
- package/dist/{index-BjEjkK6X.cjs → index-XBUmAm-7.cjs} +1 -1
- package/dist/{index-Dt4Cfbq8.js → index-ZH54LQ9_.js} +1 -1
- package/dist/{index-4tXM78Sn.js → index-gudE-bv7.js} +12 -12
- package/dist/{index-C3sKie9k.js → index-kFdun94I.js} +1 -1
- package/dist/{index-D4Z9N7MT.cjs → index-sd_1AHhD.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_6ecb5a6a_lang-BJZ648b6.js → index.vue_vue_type_style_index_0_scoped_6ecb5a6a_lang-BAwNT_sU.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_6ecb5a6a_lang-vPxyme_f.cjs → index.vue_vue_type_style_index_0_scoped_6ecb5a6a_lang-D3r3tHIk.cjs} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-xccUhber.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-B3SdJVxH.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CSJaxe0k.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-CaB0r5kb.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DRbMIZhP.js → index.vue_vue_type_style_index_1_lang-B2U6KwlH.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-gtMCud9L.cjs → index.vue_vue_type_style_index_1_lang-DzrkAaH7.cjs} +1 -1
- package/dist/{main-Duo0xXSW.cjs → main-Bxq9IQ_k.cjs} +1 -1
- package/dist/{main-CbpCc-Oa.js → main-CV76PF7A.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +6 -6
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeLatheView-TH_XnO1M.cjs → threeLatheView-CNGZGjsw.cjs} +1 -1
- package/dist/{threeLatheView-6joz4GRu.js → threeLatheView-pw6zs0Pz.js} +1 -1
- package/dist/{threeModel-BnqkV3U6.js → threeModel-Cq1oM6Me.js} +2 -2
- package/dist/{threeModel-DXmHJvJj.cjs → threeModel-Dmofx2jK.cjs} +1 -1
- package/dist/{threeSceneView-CvKvZum0.cjs → threeSceneView-B6V6cf9b.cjs} +1 -1
- package/dist/{threeSceneView-cYElHi_T.js → threeSceneView-B_Jh-153.js} +3 -3
- package/dist/{threeSceneViewForCPMPIP-BAXO6I7I.cjs → threeSceneViewForCPMPIP-00ICvnjf.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-CbcAP3cL.js → threeSceneViewForCPMPIP-CTn5vUqg.js} +1 -1
- package/dist/{threeViewerHost-U-7AvEzg.js → threeViewerHost-BHzbeLlL.js} +1 -1
- package/dist/{threeViewerHost-BmmwqV28.cjs → threeViewerHost-CcEI-qHT.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as C, j as x } from "./index.vue_vue_type_style_index_1_lang-CKG-47Pf.js";
|
|
2
2
|
import { r as K, u as S } from "./xlsx-ByPOQ6N_.js";
|
|
3
|
-
import { d as I } from "./threeViewerHost-
|
|
3
|
+
import { d as I } from "./threeViewerHost-BHzbeLlL.js";
|
|
4
4
|
import { c as P } from "./index-BQYjK74w.js";
|
|
5
5
|
function N(r) {
|
|
6
6
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const y=require("./index.vue_vue_type_style_index_1_lang-CllbOzlH.cjs"),T=require("./xlsx-BPHygxEf.cjs"),_=require("./threeViewerHost-
|
|
1
|
+
"use strict";const y=require("./index.vue_vue_type_style_index_1_lang-CllbOzlH.cjs"),T=require("./xlsx-BPHygxEf.cjs"),_=require("./threeViewerHost-CcEI-qHT.cjs"),U=require("./index-1z9RrjZc.cjs");function P(r){try{const c=new URL(r).pathname,i=c.substring(c.lastIndexOf("/")+1);return decodeURIComponent(i)}catch(c){return console.error("无法解析URL以提取文件名:",r,c),"未知文件名"}}function S(r){if(!r)return;const c=r.match(/filename\*\s*=\s*([^;]+)/i);if(c){let n=c[1].trim();n=n.replace(/^"(.*)"$/,"$1");const h=n.split("''");if(h.length===2){const m=h[0].toUpperCase(),f=h[1];try{if(m==="UTF-8")return decodeURIComponent(f)}catch{}return f}try{return decodeURIComponent(n)}catch{return n}}const i=r.match(/filename\s*=\s*("?)([^";]+)\1/i);if(i)return i[2].trim()}async function K(r){let c,i;if(/^https?:\/\//.test(r))try{const n=await fetch(r,{method:"GET",cache:"no-store"});if(!n.ok)throw new Error(`下载文件失败: ${n.statusText} (URL: ${r})`);c=await n.blob(),i=P(r)}catch(n){throw console.error("使用 fetch 下载文件时出错:",n),n}else try{const n=await _.downloadAvatarApi({url:r});if(n.status!==200)throw new Error(`下载失败: ${n.status}`);const h=n.headers["content-disposition"];i=S(h)||"无文件名",c=n.data}catch(n){throw console.error("通过 API 下载文件时出错:",n),n}return new File([c],i,{type:c.type})}function N(r){return new Promise((c,i)=>{const n=new FileReader;n.onload=h=>{var m;try{const f=(m=h.target)==null?void 0:m.result,u=T.readSync(f,{type:"array"}),F=u.Sheets[u.SheetNames[0]],E=T.utils.sheet_to_json(F);c(E)}catch(f){i(f)}},n.readAsArrayBuffer(r)})}const V=async()=>{const r="弯管仿真加工分析";let c={};const i=sessionStorage.getItem("systemKey"),n=await y.getItemData(`${r}/管件解析`,i,"");let h=["管长","外径"],m={};n==null||n.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{h.includes(a==null?void 0:a.key)&&(m[a.key]=a.value)}))}))});const f=m.管长,u=m.外径;console.log("管长",f,"外径",u,m);const F=f,E=u/2,d=await y.getItemData(`${r}/加工位姿生成`,i,"");let A=["夹持长度"],g={};d==null||d.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{A.includes(a==null?void 0:a.key)&&(g[a.key]=a.value)}))}))});const k=g.夹持长度;console.log("夹持长度",k,g);const $=Number(k),w={},b=await y.getItemData(`${r}/仿真动画生成`,i,"");b==null||b.forEach(e=>{var s,o,l,a,R,L;if((e==null?void 0:e.comp)==="Table"){let x=[],D=(l=(o=(s=e==null?void 0:e.compData)==null?void 0:s.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:o.contents)==null?void 0:l.map(t=>t==null?void 0:t.label),C=(L=(R=(a=e==null?void 0:e.compData)==null?void 0:a.find(t=>(t==null?void 0:t.key)==="tableContents"))==null?void 0:R.contents)==null?void 0:L.map(t=>(t=t==null?void 0:t.filter(p=>!(p!=null&&p.id)),t));C==null||C.forEach(t=>{x.push(y.getValueToObjectValue(t,D==null?void 0:D.filter(p=>p!=="操作")))}),w[e.name]=x,w[e.name+"Content"]=e}});const I=U.cloneDeep(w);return c={initialPipeLength:F,pipeRadius:E,clampLength:$,animationData:I},c},q=async()=>{const r="双弯管仿真加工分析";let c={};const i=sessionStorage.getItem("systemKey"),n=await y.getItemData(`${r}/管件解析`,i,"");let h=["管长","外径"],m={};n==null||n.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{h.includes(a==null?void 0:a.key)&&(m[a.key]=a.value)}))}))});const f=m.管长,u=m.外径;console.log("管长",f,"外径",u,m);const F=f,E=u/2,d=await y.getItemData(`${r}/加工工艺生成`,i,"");let A=["夹持位置"],g={};d==null||d.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{A.includes(a==null?void 0:a.key)&&(g[a.key]=a.value)}))}))});const k=g.夹持位置;console.log("夹持长度",k,g);const $=Number(k),w={},b=await y.getItemData(`${r}/仿真动画生成`,i,"");b==null||b.forEach(e=>{var s,o,l,a,R,L;if((e==null?void 0:e.comp)==="Table"){let x=[],D=(l=(o=(s=e==null?void 0:e.compData)==null?void 0:s.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:o.contents)==null?void 0:l.map(t=>t==null?void 0:t.label),C=(L=(R=(a=e==null?void 0:e.compData)==null?void 0:a.find(t=>(t==null?void 0:t.key)==="tableContents"))==null?void 0:R.contents)==null?void 0:L.map(t=>(t=t==null?void 0:t.filter(p=>!(p!=null&&p.id)),t));C==null||C.forEach(t=>{x.push(y.getValueToObjectValue(t,D==null?void 0:D.filter(p=>p!=="操作")))}),w[e.name]=x,w[e.name+"Content"]=e}});const I=U.cloneDeep(w);return c={initialPipeLength:F,pipeRadius:E,clampLength:$,animationData:I},c},B=async r=>await K(r),j=async r=>await N(r),X=async r=>{const c=await B(r);return await j(c)};exports.fetchDoubleRobotAnimationData=q;exports.fetchSingleRobotAnimationData=V;exports.initXYZBCList=X;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BZhLzmOI.cjs"),n=require("./index-lJyzIuco.cjs"),u=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),r=e.ref([]),i=e.computed(()=>[{key:"extraButton",contents:[{label:"清空",background:"#f56c6c",color:"#ffffff"}]},{key:"rowButton",contents:[]},{key:"header",contents:[{label:"模块名称",prop:"module",filterable:!0},{label:"操作类型",prop:"type",filterable:!0},{label:"账号",prop:"account",filterable:!0},{label:"姓名",prop:"userName",filterable:!0},{label:"时间",prop:"timeStamp",sortable:!0}]},{key:"tableContents",contents:r.value}]),p=Object.freeze(Object.defineProperty({__proto__:null,pageData:i,tableData:r},Symbol.toStringTag,{value:"Module"})),b={class:"log-wrap"},d=e.defineComponent({__name:"index",setup(_){const t=e.reactive({...p});e.onMounted(async()=>{t.tableData=await n.getLogTableDataAsync("operate")});const c=l=>{var a;n.clickButton(l,(a=t.tableData)==null?void 0:a.map(o=>o.id),o=>{o&&(t.tableData=[])})};return(l,a)=>(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(s.ssTable,{itemData:t.pageData,allowOperate:!1,allowSelect:!1,onOnButtonClick:c},null,8,["itemData"])]))}}),f=u._export_sfc(d,[["__scopeId","data-v-3d3b471d"]]);exports.default=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as n, computed as c, defineComponent as s, reactive as p, onMounted as i, createElementBlock as u, openBlock as f, createVNode as b } from "vue";
|
|
2
|
-
import { s as m } from "./index-
|
|
2
|
+
import { s as m } from "./index-E9BO4gjz.js";
|
|
3
3
|
import { g as d, c as _ } from "./index-bnyh33id.js";
|
|
4
4
|
import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const l = n([]), g = c(() => [
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { b as ri, a as ti, f as ci, g as di, c as Gs, i as Os, u as pi, s as fi } from "./index-
|
|
1
|
+
import { b as ri, a as ti, f as ci, g as di, c as Gs, i as Os, u as pi, s as fi } from "./index-E9BO4gjz.js";
|
|
2
2
|
import { computed as Ql, ref as W, watch as Il, onUnmounted as vi, resolveComponent as tl, createElementBlock as Be, openBlock as te, createVNode as q, createBlock as pl, createCommentVNode as Gl, withCtx as ve, createElementVNode as T, Fragment as gl, renderList as Al, toDisplayString as We, nextTick as ws, createTextVNode as Qe, unref as Xl, defineComponent as na, reactive as xa, resolveDynamicComponent as Da, renderSlot as is, createSlots as yi, mergeProps as hi, normalizeStyle as Ds, withModifiers as Aa, onMounted as cs, getCurrentInstance as mi } from "vue";
|
|
3
3
|
import { bu as gi, bv as bi, s as El, p as Sl, u as ds, c as s, g as Nl, E as bl, b as gs, f as Ga, bp as Ha, bo as rs, d as Ta, bw as bs, e as Hs, bx as ki, i as Js, bq as _i } from "./index-BQYjK74w.js";
|
|
4
|
-
import { d as Rl, a as Ss, e as qs, s as Vl, E as Xs, f as Ci, h as wi, b as Di, i as es } from "./index-
|
|
4
|
+
import { d as Rl, a as Ss, e as qs, s as Vl, E as Xs, f as Ci, h as wi, b as Di, i as es } from "./index-BtMf3kcU.js";
|
|
5
5
|
import { a as qa, u as Xa, k as ps, aq as Si, ar as Ys, ap as ks, i as xl, E as da, as as Ii, at as zl, au as Ea, av as ca, aw as wa, ax as hs, l as Ai, ay as xi, az as Ei, aA as Ti, aB as $i, aC as Bi, aD as Li, aE as Oi, aF as Ki } from "./index.vue_vue_type_style_index_1_lang-CKG-47Pf.js";
|
|
6
|
-
import { t as Fi } from "./threeViewerHost-
|
|
6
|
+
import { t as Fi } from "./threeViewerHost-BHzbeLlL.js";
|
|
7
7
|
import { S as Ui, e as ls } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CFhd0pad.js";
|
|
8
8
|
import { _ as Tl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
import { d as Qs, i as Ri } from "./isUndefined-Q9M0hk53.js";
|
|
10
10
|
import { _ as Ks } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
11
|
-
import { a as Pi, s as ji } from "./index-
|
|
11
|
+
import { a as Pi, s as ji } from "./index-C537MMhi.js";
|
|
12
12
|
import Zs from "./index-DiRBJiMW.js";
|
|
13
13
|
import { s as Mi } from "./index-C6_wGJV2.js";
|
|
14
14
|
var Ni = "[object Boolean]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),S=require("./index-1z9RrjZc.cjs"),jl=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C04VBW2K.cjs"),Be=require("./index-C_FdEZsN.cjs"),Tl=require("./threeViewerHost-BmmwqV28.cjs"),te=require("./index.vue_vue_type_style_index_1_lang-CllbOzlH.cjs"),al=require("./xlsx-BPHygxEf.cjs");require("./index.vue_vue_type_style_index_1_lang-gtMCud9L.cjs");const Cl=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");require("./STLLoader-Ck442nWz.cjs");require("./index-Chs0dEFu.cjs");var or="[object String]";function Kl(L){return typeof L=="string"||!S.isArray(L)&&S.isObjectLike(L)&&S.baseGetTag(L)==or}const $l=L=>L.match(/\((.*)\)/)[1],sr={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(L){const Q=L,q=a.ref(null),$=a.ref(!1),B=a.ref(null);return a.watch(()=>Q==null?void 0:Q.isVisible,()=>{$.value=Q==null?void 0:Q.isVisible},{deep:!0,immediate:!0}),a.watch(()=>B.value,()=>{a.nextTick(()=>{var h,re;(re=(h=q.value)==null?void 0:h.updatePopper)==null||re.call(h)})},{deep:!0,immediate:!0}),(h,re)=>{const he=a.resolveComponent("el-popover");return a.openBlock(),a.createBlock(he,{visible:$.value,title:Q==null?void 0:Q.title,placement:Q==null?void 0:Q.placement,width:Q==null?void 0:Q.width,ref_key:"popOverRef",ref:q},{reference:a.withCtx(()=>[a.createElementVNode("div",null,[a.renderSlot(h.$slots,"reference",{ref_key:"referenceRef",ref:B})])]),default:a.withCtx(()=>[a.createElementVNode("div",null,[a.renderSlot(h.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},ir={class:"extra-button-content"},ur={class:"table-operator-wrap"},tr={class:"extra-button-filter"},cr={key:0,class:"extra-header"},dr={class:"drop-menu",style:{width:"120px"}},pr={key:0},fr={key:1},hr={__name:"header",props:{compName:{type:String,default:"表格名称",required:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(L,{emit:Q}){const q=Q,$=L,B=a.ref(""),h=a.ref(!1),re=a.ref([]),he=a.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),Te=G=>{const P=G.raw;if(!P)return;const j=new FileReader;j.onload=se=>{try{const ye=new Uint8Array(se.target.result),Ce=al.readSync(ye,{type:"array"}),Ge=Ce.SheetNames[0],Me=Ce.Sheets[Ge],K=[],be=[];for(const ze in Me){if(ze[0]==="!")continue;const{r:ge,c:Al}=al.utils.decode_cell(ze),dl=Me[ze].v;ge===0?K[Al]=dl:(be[ge-1]||(be[ge-1]={}),be[ge-1][`col_${Al}`]=dl)}const ue=be==null?void 0:be[0];if(!(ue!=null&&ue.hasOwnProperty("col_0")))return S.ElMessage.error("导入的数据列不匹配,请检查是否错位");q("getImportData",K,be)}catch(ye){throw S.ElMessage.error(ye.message),new Error(ye.message)}},j.readAsArrayBuffer(P)},R=G=>{var j;const P=(j=re.value)==null?void 0:j.reduce((se,ye,Ce)=>(Ce===0?se[ye.label]=G:se[ye.label]=ye==null?void 0:ye.value,se),{});q("filter",P,G,!0)},Ne=G=>{q("buttonClick",G)},Pe=G=>{var P,j;re.value=(j=(P=te.getColumnChild(S.cloneDeep(G)))==null?void 0:P.filter(se=>(se==null?void 0:se.label)!==""&&(se==null?void 0:se.label)!=="操作"))==null?void 0:j.map(se=>({label:(se==null?void 0:se.label)??"",value:"",name:(se==null?void 0:se.label)??"",isFormColHidden:se==null?void 0:se.isTableColHidden,width:2}))},ve=a.ref(!1),Ve=G=>{var P;if((G==null?void 0:G.buttonName)==="确认"&&(q("filter",G==null?void 0:G.content),ve.value=(G==null?void 0:G.content)&&Object.values(G==null?void 0:G.content).length>0),(G==null?void 0:G.buttonName)==="清空"){const j=S.cloneDeep(G==null?void 0:G.content);for(const se in j)j[se]="";re.value=(P=re.value)==null?void 0:P.map(se=>({...se,value:""})),q("filter",j),ve.value=!1}h.value=!1};return a.onMounted(()=>{Pe($.columns)}),a.watch(()=>$.columns,()=>{Pe($.columns)},{deep:!0,immediate:!0}),(G,P)=>{var Ge,Me;const j=a.resolveComponent("svg-icon"),se=a.resolveComponent("el-input"),ye=a.resolveComponent("el-button"),Ce=a.resolveComponent("el-upload");return a.openBlock(),a.createElementBlock("div",ir,[a.createElementVNode("div",{class:a.normalizeClass(L.compName?"table-name-wrap":"")},a.toDisplayString(L.compName),3),a.createElementVNode("div",ur,[a.createElementVNode("div",tr,[a.createVNode(sr,{title:"",width:800,placement:"bottom-start",isVisible:h.value},{reference:a.withCtx(()=>{var K;return[a.createVNode(se,{modelValue:B.value,"onUpdate:modelValue":P[1]||(P[1]=be=>B.value=be),style:{"min-width":"80px"},placeholder:ve.value?"存在搜索条件...":"搜索","prefix-icon":a.unref(S.search_default),clearable:"",onInput:R,disabled:((K=re.value)==null?void 0:K.length)===0},{append:a.withCtx(()=>[a.createElementVNode("span",{title:"条件查询",onClick:P[0]||(P[0]=be=>h.value=!h.value)},[a.createVNode(j,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:a.withCtx(()=>[a.createElementVNode("div",{class:"form-content-value",onMouseleave:P[2]||(P[2]=K=>h.value=!1)},[(a.openBlock(),a.createBlock(Be.ssForm,{rowContents:re.value,buttonValue:he.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:he.value,isStartJustify:!1,onOnButtonClick:Ve},null,8,["rowContents","buttonValue"]))],32)]),_:1},8,["isVisible"])]),L.buttons&&((Ge=L.buttons)==null?void 0:Ge.length)>0?(a.openBlock(),a.createElementBlock("div",cr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Me=L.buttons)==null?void 0:Me.filter(K=>L.isDevMode||(K==null?void 0:K.label)!=="修改模板"),(K,be)=>(a.openBlock(),a.createElementBlock("div",{class:"extra-contents",key:be},[(K==null?void 0:K.type)==="upload"?(a.openBlock(),a.createBlock(Ce,{key:0,class:"upload-button-wrap","on-change":Te,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:a.withCtx(()=>[a.createVNode(ye,{style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"})},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style"])]),_:2},1024)):a.createCommentVNode("",!0),(K==null?void 0:K.type)==="popover"?(a.openBlock(),a.createBlock(Be._sfc_main,{key:1},{dropTitle:a.withCtx(()=>[(K==null?void 0:K.type)==="popover"?(a.openBlock(),a.createBlock(ye,{key:0,style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"})},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style"])):a.createCommentVNode("",!0)]),dropMenu:a.withCtx(()=>[a.createElementVNode("div",dr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K==null?void 0:K.contents,ue=>(a.openBlock(),a.createBlock(ye,{key:ue==null?void 0:ue.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:ze=>Ne(ue==null?void 0:ue.label)},{default:a.withCtx(()=>{var ze,ge;return[a.createTextVNode(a.toDisplayString(ue==null?void 0:ue.label),1),(ze=ue==null?void 0:ue.label)!=null&&ze.includes("选中")?(a.openBlock(),a.createElementBlock("span",pr,"("+a.toDisplayString(L.selectNums)+")",1)):a.createCommentVNode("",!0),(ge=ue==null?void 0:ue.label)!=null&&ge.includes("全部")?(a.openBlock(),a.createElementBlock("span",fr,"("+a.toDisplayString(L.dataNums)+")",1)):a.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):a.createCommentVNode("",!0),K!=null&&K.type?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(ye,{key:2,id:"themeButton",style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"}),onClick:ue=>Ne(K==null?void 0:K.label)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):a.createCommentVNode("",!0)])])}}},gr=Cl._export_sfc(hr,[["__scopeId","data-v-2032e071"]]),yr=a.defineComponent({__name:"batch",props:{buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(L,{emit:Q}){const q=L,$=Q,B=re=>{$("buttonClick",re)},h=re=>{var he;return re!=null&&re.includes("删除")?((he=q.selectTableItems)==null?void 0:he.length)>0?"warning-active-type":"warning-type":"default-type"};return(re,he)=>{const Te=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(L.buttons,R=>(a.openBlock(),a.createBlock(Te,{key:R==null?void 0:R.label,class:a.normalizeClass(h(R==null?void 0:R.label)),onClick:Ne=>B(R==null?void 0:R.label)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(R==null?void 0:R.label),1)]),_:2},1032,["class","onClick"]))),128))])}}}),vr=Cl._export_sfc(yr,[["__scopeId","data-v-1d3c11ad"]]),la=S.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(L){this.selectArray=L},setSelectString(L){this.selectString=L}}}),br={class:"calculator-content"},mr={class:"calculator-child"},kr={class:"calculator-child"},Sr=a.defineComponent({__name:"calculator",setup(L){const Q=a.ref(),q=a.ref();return a.onMounted(()=>{Q.value=[{type:"Upload",label:"输入",name:"input"}],q.value=[{type:"Upload",label:"输出",name:"output"}]}),($,B)=>(a.openBlock(),a.createElementBlock("div",br,[a.createElementVNode("div",mr,[a.createVNode(Be.ssForm,{rowContents:Q.value,isRowFlex:!0},null,8,["rowContents"])]),a.createElementVNode("div",kr,[a.createVNode(Be.ssForm,{rowContents:q.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Dr=Cl._export_sfc(Sr,[["__scopeId","data-v-73db0fe7"]]),aa=S.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(L){this.selectIndex=L},setSelectMenu(L){this.selectMenu=L},setSelectTitle(L){this.selectTitle=L}}}),Fl=(L,Q)=>{let q=L,$=Q;return Array.isArray(q)&&(q=q==null?void 0:q.map((B,h)=>{if(Array.isArray(B)){let re={};return B=B==null?void 0:B.forEach((he,Te)=>{var R;(R=$==null?void 0:$[Te])!=null&&R.prop?re[$[Te].prop]=he:Array.isArray(he)&&(re.children=Fl(he,$))}),Object.assign(re,{id:h})}else return B})),q},ra=(L,Q,q)=>{let $=L,B=Q;return $=$==null?void 0:$.map((h,re)=>{var he,Te;return!Array.isArray(h)||!((he=B==null?void 0:B[re])!=null&&he.label)&&!q||(h.unshift(((Te=B==null?void 0:B[re])==null?void 0:Te.label)??""),h.some(R=>Array.isArray(R))&&(h=h==null?void 0:h.map(R=>{var Ne;return Array.isArray(R)&&(R=ra(R,(Ne=B==null?void 0:B[re])==null?void 0:Ne.children,q)),R}))),h}),$},Tr=(L,Q,q)=>{if(Q==="")return L==null?void 0:L.filter($=>($==null?void 0:$.id)!==q);{const $=Q.split("-");return Cr(L,$,q)}},Cr=(L,Q,q)=>{let $=L,B=Q;return(B==null?void 0:B.length)===0?$=$==null?void 0:$.filter(h=>h.id!==q):$=$==null?void 0:$.map(h=>(h.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),h=na(h,B,q)),h)),$},na=(L,Q,q)=>{var h,re;let $=L,B=Q;return(B==null?void 0:B.length)===0?$.children=(h=$.children)==null?void 0:h.filter(he=>he.id!==q):$.children=(re=$.children)==null?void 0:re.map(he=>(he.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),he=na(he,B,q)),he)),$},Ar=(L,Q,q)=>{if(Q==="")return q;{const $=Q.split("-");return Er(L,$,q)}},Er=(L,Q,q)=>{let $=L,B=Q;return(B==null?void 0:B.length)===0?$=q:$=$==null?void 0:$.map(h=>(h.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),h=oa(h,B,q)),h)),$},oa=(L,Q,q)=>{var h;let $=L,B=Q;return(B==null?void 0:B.length)===0?$.children=q:$.children=(h=$.children)==null?void 0:h.map(re=>(re.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),re=oa(re,B,q)),re)),$},sa=S.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(L){this.tableIndex=L},setTableShowThree(L){this.tableShowThree=L}}}),ia=S.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(L){this.objUrl=L},setBlobUrls(L){this.blobUrls=L}}}),Pl=async L=>{var h,re,he,Te,R,Ne,Pe;let Q=(re=(h=S.cloneDeep(L))==null?void 0:h.optionUrl)==null?void 0:re.menuSelect,q=[];Q==null||Q.forEach(ve=>{});let $="";const B=await te.menuToParent(Q);if(B==null||B.forEach(ve=>{var Ve,G,P,j;(ve==null?void 0:ve.name)===(((j=(P=(G=(Ve=S.cloneDeep(L))==null?void 0:Ve.optionUrl)==null?void 0:G.groupSelect)==null?void 0:P[0])==null?void 0:j.replaceAll("'",""))??"")&&($=ve==null?void 0:ve.id)}),$!==""){const ve=(he=B==null?void 0:B.find(P=>{var j,se,ye,Ce;return(P==null?void 0:P.name)===(((se=(j=L==null?void 0:L.groupSelect)==null?void 0:j.split(":"))==null?void 0:se[0])||((Ce=(ye=L==null?void 0:L.optionUrl)==null?void 0:ye.groupSelect)==null?void 0:Ce[0]))}))==null?void 0:he.compData;let Ve=(R=(Te=ve==null?void 0:ve.find(P=>(P==null?void 0:P.key)==="header"))==null?void 0:Te.contents)==null?void 0:R.map(P=>P==null?void 0:P.label),G=(Pe=(Ne=ve==null?void 0:ve.find(P=>(P==null?void 0:P.key)==="tableContents"))==null?void 0:Ne.contents)==null?void 0:Pe.map(P=>(P=P==null?void 0:P.filter(j=>!(j!=null&&j.id)),P));G==null||G.forEach(P=>{q.push(te.getValueToObjectValue(P,Ve))})}return q},Nr={class:"table-content"},_r={class:"menu-config-wrap"},xr=["onClick"],Br={key:0,class:"viewport-wrap"},Ur=["onClick"],Or={title:"选择显示列信息"},wr={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},Lr=["title"],Mr={class:"col-operate-wrap"},jr={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},Kr={class:"pop-view"},$r={class:"pop-wrapper"},Fr={class:"file-list-pop"},Pr=["title","onClick"],Vr=["onClick"],zr=["onClick"],Jr={class:"form-content"},Rr={key:0,class:"dialog-footer"},qr={class:"dialog-footer"},Wr={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},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:!0},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(L,{emit:Q}){const q=a.ref([]),$=ia(S.pinia),B=a.ref(null),h=L,re=a.ref([{label:"排序",value:"sortable",checked:!1},{label:"筛选",value:"filterable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{label:"编辑",value:"operable",checked:!1}]),he=te.useOriginalState(S.pinia),{originalPath:Te}=S.storeToRefs(he),R=Te.value,Ne=a.ref(!1),Pe=a.ref(!1),ve=a.ref(!1),Ve=a.reactive({column:{},status:!1,text:"合计"}),G=a.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),P=Q,j=a.ref([]),se=a.ref([]),ye=a.ref(!1),Ce=a.ref(!1),Ge=a.ref(null),Me=a.ref([]),K=a.ref(!1),be=a.ref(),ue=te.useMenuState(),{importLoading:ze,activeMenuPath:ge,contentLoading:Al}=S.storeToRefs(ue),dl=sa(S.pinia),me=te.useModelComp(S.pinia),{extraContents:ne,cacheUpdatingData:rl,tableViewContents:nl,tableLoading:Hr,pageMapState:El}=S.storeToRefs(me),Y=a.ref([]),pl=a.ref([]),fl=a.ref(new Map);a.ref(!1);const Le=a.ref("");a.ref();const Nl=a.ref(!0),Ie=a.ref(0),Vl=a.ref(!0),Ue=a.ref(""),je=a.ref(!1),ua=a.ref({label:"查看三维模型"}),hl=a.ref(!1),_l=a.ref(),_e=a.ref([]),He=a.ref([]),gl=a.ref(!1),ol=a.ref([]),el=a.ref([]),Xe=a.ref([]),Je=a.ref([]),xe=a.ref(),Se=a.ref(),ta=la(S.pinia),yl=a.ref(),xl=a.ref(0),vl=aa(S.pinia),{selectIndex:ca,selectMenu:Ke,selectTitle:Bl}=S.storeToRefs(vl),{selectString:$e}=S.storeToRefs(ta),da=S.useLoginState(S.pinia),{loginUserInfo:ce}=S.storeToRefs(da),pa=a.ref(720),Qe=a.ref(!1),bl=a.ref(!1),Oe=a.ref([]),Ye=a.ref(),sl=a.ref(!0),zl=a.ref(!0),ml=a.ref([]),fa=a.inject("contentRef");a.provide("contentRef",fa),a.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{G.total=e}),a.watch(()=>nl.value,async()=>{var i,p,t,c,f,s,E,m,A,_,U,C,O,T,N,y,v,u;if(((i=nl.value)==null?void 0:i.length)===0||!((p=h==null?void 0:h.itemData)!=null&&p.find(k=>(k==null?void 0:k.key)==="columnPath"))||!((t=h==null?void 0:h.itemData)!=null&&t.find(k=>(k==null?void 0:k.key)==="pageColumn")))return;let e=(A=(m=(E=(s=(f=(c=h==null?void 0:h.itemData)==null?void 0:c.find(k=>(k==null?void 0:k.key)==="pageColumn"))==null?void 0:f.contents)==null?void 0:s.split("["))==null?void 0:E[1])==null?void 0:m.split("]"))==null?void 0:A[0],l=((O=(C=(U=(_=h==null?void 0:h.itemData)==null?void 0:_.find(k=>(k==null?void 0:k.key)==="pageColumn"))==null?void 0:U.contents)==null?void 0:C.split("["))==null?void 0:O[0])+((N=(T=nl.value)==null?void 0:T.find(k=>(k==null?void 0:k.key)===e))==null?void 0:N.value),n=((v=(y=h==null?void 0:h.itemData)==null?void 0:y.find(k=>(k==null?void 0:k.key)==="pageGroup"))==null?void 0:v.contents)??"",r=await te.getItemData(l,sessionStorage.getItem("systemKey"),""),o=(u=r==null?void 0:r.find(k=>(k==null?void 0:k.name)===(n===""?h==null?void 0:h.compName:n)))==null?void 0:u.compData;Il(o,h.allMapContents)},{deep:!0});const ha=async(e,l)=>{var n;try{console.log("generateTableWithImport",e,l,ge.value,h.index);const r={type:"data",pageKey:ge.value,tableId:h.index,systemKey:sessionStorage.getItem("systemKey")},o=l==null?void 0:l.map(t=>{const c=Object.keys(t),f={};return c.forEach((s,E)=>{f[e[E]]=t[s]}),f}),i=o==null?void 0:o.map(t=>({key:r,value:{tableData:t}})),p=await S.batchAddInsofDataApi({dataList:i});((n=p==null?void 0:p.data)==null?void 0:n.code)===200?(me.setRefreshCurStructure(!0),S.ElMessage.success("导入数据成功")):S.ElMessage.error("导入数据响应失败")}catch(r){throw S.ElMessage.error("导入数据处理失败"),new Error(r)}},ga=async e=>{var l,n;if(e!=null&&e.includes(".txt")||e!=null&&e.includes(".cpt")||e!=null&&e.includes(".cyd")){const r=await S.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),o=new Blob([r.data],{type:"application/octet-stream;charset=UTF-8"});let i=URL.createObjectURL(o);be.value=[{name:(n=e==null?void 0:e.split("/"))==null?void 0:n[((l=e==null?void 0:e.split("/"))==null?void 0:l.length)-1],blobUrl:i}],K.value=!0}};a.onBeforeUnmount(()=>{zl.value=!1;let e=xl.value;xl.value=e+1});const ya=a.computed(()=>{var n;const e=(G.currentPage-1)*G.pageSize,l=e+G.pageSize;return(n=Y.value)==null?void 0:n.slice(e,l)}),va=e=>{G.currentPage=e},ba=e=>{var l;G.pageSize=e,e*G.currentPage>((l=Y.value)==null?void 0:l.length)&&(G.currentPage=1,S.ElMessage.warning("分页无效,返回第一页"))},ma=(e,l)=>{var p,t;const n=(t=(p=j.value)==null?void 0:p.map(c=>c==null?void 0:c.prop))==null?void 0:t.filter(c=>c!=="operate");let r;const o=(e==null?void 0:e.length)===(n==null?void 0:n.length);if(e!=null&&e.includes("序号"))return S.ElMessage.error("导入的数据不需要包含序号列");if(r=o?e:e.slice(0,n==null?void 0:n.length),!(r==null?void 0:r.every(c=>n==null?void 0:n.find(f=>c===f))))return S.ElMessage.error("导入的数据表头不匹配");ha(r,l)},ka=(e,l)=>{var n;me.setRefreshCurStructure(!1),((n=j.value)==null?void 0:n.length)===0||ma(e,l)},Sa=(e,l,n,r)=>{const o=[],i=[],p=f=>Object.keys(f).length;for(const f in e)if(e[f]!==void 0){const s=e[f],E=[];for(const[m,A]of Object.entries(s))E.push(A),i.length<p(s)&&i.push(m);o.push(E)}o.unshift(i);const t=al.utils.aoa_to_sheet(o),c=al.utils.book_new();al.utils.book_append_sheet(c,t,r),al.writeFileSync(c,`${l}.xlsx`),Oe.value=[]},kl=async(e,l,n,r=!1,o)=>{var i,p,t,c,f,s,E,m;try{me.setRefreshCurStructure(!1);const A=await S.getInsofDataApi({id:h==null?void 0:h.index});if(((i=A==null?void 0:A.data)==null?void 0:i.code)===200){let _=(f=(c=(t=(p=A==null?void 0:A.data)==null?void 0:p.result)==null?void 0:t[0])==null?void 0:c.value)==null?void 0:f.pageData;r?_={..._,compData:(E=_==null?void 0:_.compData)==null?void 0:E.map(C=>{var O;return(C==null?void 0:C.key)==="header"?{...C,contents:(O=C==null?void 0:C.contents)==null?void 0:O.map(T=>({...T,[e]:n}))}:C})}:_={..._,compData:(s=_==null?void 0:_.compData)==null?void 0:s.map(C=>{var O,T;return(C==null?void 0:C.key)==="header"?{...C,contents:(O=C==null?void 0:C.contents)==null?void 0:O.map(N=>(N==null?void 0:N.prop)===(l==null?void 0:l.prop)?{...N,[e]:n}:N)}:(C==null?void 0:C.key)==="tableToForm"&&o?{...C,contents:(T=C==null?void 0:C.contents)==null?void 0:T.map(N=>(N==null?void 0:N.prop)===(l==null?void 0:l.prop)?{...N,[o]:n}:N)}:C})};const U=await S.updateInsofDataApi({id:h==null?void 0:h.index,value:{pageData:_}});((m=U==null?void 0:U.data)==null?void 0:m.code)===200?(S.ElMessage.success("编辑成功"),me.setRefreshCurStructure(!0)):S.ElMessage.error("编辑响应失败")}}catch(A){S.ElMessage.error(A)}},Da=async(e,l)=>{await kl("label",l,e)},Ta=async(e,l)=>{await kl("columnType",l,e,!1,"type")},Ca=()=>{rl.value?Qe.value=!1:ea()},Aa=e=>{Oe.value=e},Ea=(e,l)=>{Ye.value===l?sl.value=!1:sl.value=!0,Ye.value=l==null?void 0:l.changeProp},il=a.computed(()=>{var n,r,o;const e=(n=j.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"),(o=(r=j.value)==null?void 0:r.filter(i=>(i==null?void 0:i.label)!=="操作"))==null?void 0:o.map(i=>({...i,filterable:!!(i!=null&&i.filterable),showSummary:!!(i!=null&&i.showSummary),operable:!!(i!=null&&i.operable)}))}),Na=async(e,l,n)=>{const r=S.cloneDeep(j.value);await a.nextTick(),j.value=r==null?void 0:r.map(o=>(n==null?void 0:n.label)===(o==null?void 0:o.label)?{...o,[l]:e}:o),await kl(l,n,e)},Ul=async(e,l)=>{await kl(l,null,e,!0)},_a=()=>{je.value=!1},xa=e=>{P("clickTrigger",e)},Jl=async e=>{var i,p,t,c,f,s,E,m,A,_,U,C,O,T,N;const l=e==null?void 0:e.row,n=e==null?void 0:e.rowData,r=e==null?void 0:e.suffix;if((i=l==null?void 0:l.toString())!=null&&i.includes(".urdf")||e!=null&&e.isUrdf||r!=null&&r.includes(".urdf")){if(l.includes(",")){S.ElMessage.error("当前版本仅允许单个urdf预览!");return}ol.value=[l],Ce.value=!0,Ge.value={data:S.cloneDeep(n)},ye.value=!0;return}let o=[];if((p=l==null?void 0:l.toString())!=null&&p.includes(".stl")||(t=l==null?void 0:l.toString())!=null&&t.includes(".STL")||(c=l==null?void 0:l.toString())!=null&&c.includes(".obj")||(f=l==null?void 0:l.toString())!=null&&f.includes(".mtl")){ol.value=(s=l==null?void 0:l.toString())==null?void 0:s.split(","),Ce.value=!1,ye.value=!0;return}if((E=l==null?void 0:l.toString())!=null&&E.includes(".stl")||(m=l==null?void 0:l.toString())!=null&&m.includes(".STL")||(A=l==null?void 0:l.toString())!=null&&A.includes(".obj")||(_=l==null?void 0:l.toString())!=null&&_.includes(".mtl")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){let y,v=[],u={};if(Array.isArray(l)?y=l:y=l==null?void 0:l.split(","),y==null||y.forEach(k=>{k.includes(".mtl")?v.push(k):u.blob=u.blob?u.blob+","+k:k}),(v==null?void 0:v.length)>0&&(u.mtlBlobs=v),r&&(u.suffix=r),(C=(U=Object.values(u))==null?void 0:U[0])!=null&&C.includes("http:"))o.push(u);else{const k=new Blob([u.blob],{type:"application/octet-stream;charset=UTF-8"});let d=URL.createObjectURL(k),M="";(O=l==null?void 0:l.split("/"))==null||O.forEach((V,I)=>{var Z;I===((Z=l==null?void 0:l.split("/"))==null?void 0:Z.length)-1&&(M=V)}),(T=u.blob)!=null&&T.includes(".stl")&&(M=(M==null?void 0:M.replaceAll(">",""))+".urdf"),be.value=[{name:M,blobUrl:d}],K.value=!0}}else{const y=await S.axios.get(l,{responseType:"blob",headers:{"Content-Type":"application/json"}}),v=new Blob([y.data],{type:"application/octet-stream;charset=UTF-8"});let u=URL.createObjectURL(v),k="";(N=l==null?void 0:l.split("/"))==null||N.forEach((d,M)=>{var V;M===((V=l==null?void 0:l.split("/"))==null?void 0:V.length)-1&&(k=d)}),be.value=[{name:k,blobUrl:u}],K.value=!0}(o==null?void 0:o.length)>0&&$.setBlobUrls(o)},Sl=e=>{var r,o,i,p;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const l=(p=(r=e==null?void 0:e.url)==null?void 0:r.split("."))==null?void 0:p[((i=(o=e==null?void 0:e.url)==null?void 0:o.split("."))==null?void 0:i.length)-1];return(e==null?void 0:e.name)+"."+l},Ba=async e=>{let l=null,n=null,r=null;if(e!=null&&e.downloadUrl){const i=await Ol(),p=Be.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),t=await S.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(()=>{p.close()}),c=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});l=URL.createObjectURL(c),n=e==null?void 0:e.name;const f=n==null?void 0:n.lastIndexOf(".");r=n==null?void 0:n.slice(f)}else{const i=await Tl.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")?(l=URL.createObjectURL(i.data),n=Sl(e)):l=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:`${l}`,suffix:r};Jl(i);return}const o={name:n,blobUrl:l};be.value=[o],K.value=!0},Ua=async e=>{let l=null,n=null;if(e!=null&&e.downloadUrl){const i=await Ol(),p=await S.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"}}),t=new Blob([p.data],{type:"application/octet-stream;charset=UTF-8"});l=URL.createObjectURL(t),n=e==null?void 0:e.name}else{const i=await Tl.downloadAvatarApi({url:e==null?void 0:e.url});l=URL.createObjectURL(i.data),n=Sl(e)}const r={name:n,blobUrl:l},o=document.createElement("a");o.href=r.blobUrl,o.download=r.name,o.style.display="none",document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o)},100)},Oa=(e,l)=>{if(Object.values(l).length!==0)return Object.values(l).find(n=>{var r,o,i;return((r=n==null?void 0:n.toString())==null?void 0:r.includes(".txt"))||((o=n==null?void 0:n.toString())==null?void 0:o.includes(".cpt"))||((i=n==null?void 0:n.toString())==null?void 0:i.includes(".obj"))})?[...e,ua.value]:e},wa=e=>{var o;$e.value===""?e==null||e[0]:(e==null?void 0:e.find(i=>(i==null?void 0:i.selectLabel)==="("+$e.value+")"))??(e==null||e.find(i=>!(i!=null&&i.selectLabel)));let l=e;(o=j.value)!=null&&o.find(i=>i.prop==="index");let n=xe.value;const r=[];return l==null||l.forEach((i,p)=>{var c;let t={};if(Array.isArray(i)){let f=[];i==null||i.filter(s=>!(s!=null&&s.id)).forEach((s,E)=>{var m,A,_,U,C;if((m=n==null?void 0:n[E])!=null&&m.prop&&!Array.isArray(s)){let O={};O[n[E].column]=s,ne!=null&&ne.value&&((A=ne==null?void 0:ne.value)==null?void 0:A.length)>0&&((_=ne==null?void 0:ne.value)!=null&&_.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(O)))&&(f=(U=ne==null?void 0:ne.value)==null?void 0:U.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(O))),f&&f.length>0?t[n[E].prop]=f!=null&&f.find(T=>{var N;return((N=Object.keys(T))==null?void 0:N[0])===n[E].column})?(C=f==null?void 0:f.find(T=>{var N;return((N=Object.keys(T))==null?void 0:N[0])===n[E].column}))==null?void 0:C[n[E].column]:s:t[n[E].prop]=s}})}else t=i;Array.isArray(i)&&i.some(f=>f==null?void 0:f.id)?r.push(Object.assign(t,{id:(c=i==null?void 0:i.find(f=>f.id))==null?void 0:c.id})):t.id?r.push(t):r.push(Object.assign(t,{id:p}))}),r},La=(e,l={})=>[...e==null?void 0:e.values()].filter(n=>Object.keys(l).every(r=>{var p;const o=n[r],i=(p=l[r])==null?void 0:p.toLowerCase();return i&&o&&typeof o=="string"?o.toLowerCase().includes(i):!0})),Ma=async(e,l,n=!1)=>{var p,t,c,f,s,E,m,A,_,U,C;if(e&&((p=Object.values(e))!=null&&p.every(O=>!O)))return Y.value=pl.value;let r={};for(let O in e)e[O]!==""&&(r["tableData."+O]=e[O]);if(n){Y.value=[...fl.value.values()].filter(O=>Object.values(O).some(T=>typeof T=="string"?T==null?void 0:T.toLowerCase().includes(l==null?void 0:l.toLowerCase()):!1));return}let o;if(((t=Y.value)==null?void 0:t.length)>0&&typeof((f=(c=Y.value)==null?void 0:c[0])==null?void 0:f.id)=="string"){Y.value=La(fl.value,e);return}else o=await te.filterContents({type:"data",tableId:h==null?void 0:h.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:ge.value},r);if(((E=(s=o==null?void 0:o.data)==null?void 0:s.result)==null?void 0:E.length)===0)return Y.value=[];const i=(_=(A=(m=S.cloneDeep(o))==null?void 0:m.data)==null?void 0:A.result)==null?void 0:_.map(O=>{var N;let T=[];return T.push({id:O.id}),T.push((N=O==null?void 0:O.value)==null?void 0:N.tableData),T});Y.value=wa(te.getTableContents(i,(C=(U=S.cloneDeep(j.value))==null?void 0:U.map(O=>O.label))==null?void 0:C.filter(O=>O!=="操作")))},ja=async e=>{var p,t,c,f,s,E,m,A,_,U,C,O,T,N,y;const l=await S.getInsofDataApi({keyLikes:{pageKey:`loading${((p=ce.value)==null?void 0:p.account)||((t=ce.value)==null?void 0:t.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),n=await S.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((c=ce.value)==null?void 0:c.account)||((f=ce.value)==null?void 0:f.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});let r=(E=(s=l==null?void 0:l.data)==null?void 0:s.result)==null?void 0:E.map(v=>v==null?void 0:v.id);const o=(A=(m=n==null?void 0:n.data)==null?void 0:m.result)==null?void 0:A.map(v=>v==null?void 0:v.id);r=[...S.cloneDeep(r),...o],(r==null?void 0:r.length)>0&&(r!=null&&r.every(v=>v!==null&&v))&&await S.batchDeleteInsofDataApi({ids:r});let i=await te.getItemData(ge.value,sessionStorage.getItem("systemKey"),e.id);if(i=i==null?void 0:i.filter(v=>v.comp!=="methodButton"),i&&i.length>0){const v=!Array.isArray(Bl.value)&&((_=Bl.value)==null?void 0:_.key)!=="main"?[]:Bl.value;v.push({key:Ke.value===""?(U=e==null?void 0:e.id)==null?void 0:U.toString():Ke.value+"-"+((C=e==null?void 0:e.id)==null?void 0:C.toString()),value:e[(O=Object.keys(e))==null?void 0:O.filter(u=>u!=="index"&&u!=="id")[0]]}),vl.setSelectMenu(Ke.value===""?(T=e==null?void 0:e.id)==null?void 0:T.toString():Ke.value+"-"+((N=e==null?void 0:e.id)==null?void 0:N.toString())),vl.setSelectTitle(v),vl.setSelectIndex((y=e==null?void 0:e.id)==null?void 0:y.toString()),P("pageChange",i)}},Ka=async(e,l,n,r)=>{var f,s,E,m,A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x;const o=await S.getInsofDataApi({keyLikes:{pageKey:`loading${((f=ce.value)==null?void 0:f.account)||((s=ce.value)==null?void 0:s.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),i=await S.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((E=ce.value)==null?void 0:E.account)||((m=ce.value)==null?void 0:m.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});if((r==null?void 0:r.isExistChild)===!0){let F=(_=(A=j.value)==null?void 0:A.find(w=>(w==null?void 0:w.isMainKey)===!0))==null?void 0:_.prop,fe=(U=r==null?void 0:r.rowContent)==null?void 0:U[F],J=(O=(C=r==null?void 0:r.columnType)==null?void 0:C.childPath)==null?void 0:O.split(R),D=[];J==null||J.forEach((w,z)=>{(J==null?void 0:J.length)-1===z&&D.push(fe),D.push(w)}),D=D.join(R);let g=await te.getItemData(D,sessionStorage.getItem("systemKey"),""),ee=await te.getItemData((T=r==null?void 0:r.columnType)==null?void 0:T.childPath,sessionStorage.getItem("systemKey"),"");if(!g||(g==null?void 0:g.length)===0){let w=[];ee==null||ee.forEach(ae=>{var Re,Ee,qe,We;let Ae={type:"structure",pageKey:D,version:1,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(Re=ce.value)==null?void 0:Re.id,parentPageKey:"",createUserLayer:((Ee=ce.value)==null?void 0:Ee.dept)||((qe=ce.value)==null?void 0:qe.部门名称)},Ze={pageData:{comp:ae==null?void 0:ae.comp,compData:(We=ae==null?void 0:ae.compData)==null?void 0:We.filter(Fe=>(Fe==null?void 0:Fe.key)!=="tableContents"),name:ae==null?void 0:ae.name,isShow:ae==null?void 0:ae.isShow}};w.push({key:Ae,value:Ze})}),(w==null?void 0:w.length)>0&&await S.batchAddInsofDataApi({dataList:w});let z=await te.getItemData(D,sessionStorage.getItem("systemKey"),"");ml.value=z}else ml.value=g;P("routeUrl",ml.value,{isEdit:!0,routerUrl:D});return}let p=(y=(N=o==null?void 0:o.data)==null?void 0:N.result)==null?void 0:y.map(F=>F==null?void 0:F.id);const t=(u=(v=i==null?void 0:i.data)==null?void 0:v.result)==null?void 0:u.map(F=>F==null?void 0:F.id);if(p=[...S.cloneDeep(p),...t],(p==null?void 0:p.length)>0&&(p!=null&&p.every(F=>F!==null&&F))&&await S.batchDeleteInsofDataApi({ids:p}),(r==null?void 0:r.data)==="查看"&&(e!=null&&e.every(F=>(F==null?void 0:F.url)&&(F==null?void 0:F.name)))){let F=S.cloneDeep(e);F=await((k=S.cloneDeep(F))==null?void 0:k.map(async J=>{var ee,w,z,ae;const D=await Tl.downloadAvatarApi({url:J==null?void 0:J.url});let g=URL.createObjectURL(D.data);return{name:(J==null?void 0:J.name)+"."+((ae=(ee=J==null?void 0:J.url)==null?void 0:ee.split("."))==null?void 0:ae[((z=(w=J==null?void 0:J.url)==null?void 0:w.split("."))==null?void 0:z.length)-1]),blobUrl:g}}));let fe=await Promise.all(F);be.value=fe,K.value=!0}const c=S.cloneDeep(j.value);if((r==null?void 0:r.isMainKey)===!0&&(c==null?void 0:c.length)>0){(d=c==null?void 0:c[0])==null||d.prop;let F=S.cloneDeep(ge).value+R+(r==null?void 0:r.data),fe=S.cloneDeep(ge).value,J=(V=(M=El.value[F])==null?void 0:M.filter(w=>{var z,ae;return((z=w==null?void 0:w.key)==null?void 0:z.type)==="structure"&&((ae=w==null?void 0:w.key)==null?void 0:ae.parentTable)===""}))==null?void 0:V.map(w=>{var z;return(z=w==null?void 0:w.value)==null?void 0:z.pageData}),D={};(I=j.value)==null||I.forEach(w=>{(w==null?void 0:w.label)!=="操作"&&(D[w.label]=n[w.prop]??n[w.label])});let g=(H=(Z=h==null?void 0:h.itemData)==null?void 0:Z.find(w=>(w==null?void 0:w.key)==="mainRouters"))==null?void 0:H.contents,ee;if((g==null?void 0:g.length)>0){let w=F==null?void 0:F.split(R)[((oe=F==null?void 0:F.split(R))==null?void 0:oe.length)-1],z=g==null?void 0:g.find(ae=>(ae==null?void 0:ae.key)===w);ee=(z==null?void 0:z.routerContent)+R+(z==null?void 0:z.key)}if((J==null?void 0:J.length)>0)await te.loadingConstruct(F,F+R+`updateLoading${((W=ce.value)==null?void 0:W.account)||((le=ce.value)==null?void 0:le.账号)}`,D,ee),me.setRouteToChildPath(fe),ue.setActiveMenuPath(F+R+`updateLoading${((pe=ce.value)==null?void 0:pe.account)||((ie=ce.value)==null?void 0:ie.账号)}`);else{(de=c==null?void 0:c[0])==null||de.prop;let w=S.cloneDeep(ge).value+R+(r==null?void 0:r.data),z=S.cloneDeep(ge).value;await te.getItemData(z+R,sessionStorage.getItem("systemKey"),""),await te.loadingConstruct(z+R,w,D),await te.loadingConstruct(w,w+R+`updateLoading${((ke=ce.value)==null?void 0:ke.account)||((b=ce.value)==null?void 0:b.账号)}`,D,ee),me.setRouteToChildPath(z),ue.setActiveMenuPath(w+R+`updateLoading${((X=ce.value)==null?void 0:X.account)||((x=ce.value)==null?void 0:x.账号)}`)}}},$a=()=>{K.value=!1},Fa=e=>{P("rowClick",e)};a.watch(()=>h.changedContent,()=>{var n,r;if(!h.changedContent)return;let e=(n=Y.value)==null?void 0:n.map(o=>{var i;return o.id===((i=h.changedContent)==null?void 0:i.id)&&(o={...h.changedContent,id:h.changedContent.newId?h.changedContent.newId:h.changedContent.id},delete o.newId),o});const l=(r=h.itemData)==null?void 0:r.map(o=>((o==null?void 0:o.key)==="tableContents"&&(o.contents=e),o));Y.value=e,P("contentChange",{contents:l,index:h.index}),P("change",{content:e,index:h==null?void 0:h.index,buttonName:"",id:h==null?void 0:h.index})},{deep:!0,immediate:!0});const Pa=()=>{},Va=async()=>{const e=ge.value,l=sessionStorage.getItem("systemKey"),n=await te.getItemData(e,l,""),r=n==null?void 0:n.find(t=>(t==null?void 0:t.name)==="方法明细"),o=(r==null?void 0:r.compData)||[],i=o==null?void 0:o.find(t=>(t==null?void 0:t.key)==="formContent");return i==null?void 0:i.contents},Ol=async()=>`Bearer ${S.Local.get("access-token")}`,za=async(e,{token:l,inputData:n}={})=>await S.axios.post(e,n,{headers:{Authorization:l}}).catch(o=>(ue.setImportLoading(!1),Promise.reject(o))),Ja=e=>{var r;let l={};const n=[];return l.form={},(r=S.cloneDeep(e))==null||r.forEach((o,i)=>{var p,t,c,f,s,E,m,A,_,U,C,O,T,N;if((o==null?void 0:o.comp)==="Table"){(t=(p=o==null?void 0:o.compData)==null?void 0:p.find(k=>(k==null?void 0:k.key)==="header"))==null||t.contents;let y=(s=(f=(c=o==null?void 0:o.compData)==null?void 0:c.find(k=>(k==null?void 0:k.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:s.map(k=>k.slice(1));(U=(_=(A=(m=(E=o==null?void 0:o.compData)==null?void 0:E.find(k=>(k==null?void 0:k.key)==="header"))==null?void 0:m.contents)==null?void 0:A[0])==null?void 0:_[0])==null||U.label;let v=(O=(C=o==null?void 0:o.compData)==null?void 0:C.find(k=>(k==null?void 0:k.key)==="header"))==null?void 0:O.contents,u=[];y==null||y.forEach(k=>{let d=[];k==null||k.forEach((M,V)=>{var Z;let I={};((Z=v[V])==null?void 0:Z.label)!=="操作"&&(I[v[V].label]=M,d.push(I))}),u.push(d)}),l[o.name]=u}else{const y=(N=(T=o.compData)==null?void 0:T.find(v=>(v==null?void 0:v.key)==="formContent"))==null?void 0:N.contents;y==null||y.forEach(v=>{var u,k;if(v.prop!==""){let d=v==null?void 0:v.value;Array.isArray(d)?d=((u=d==null?void 0:d[0])==null?void 0:u.oldUrl)||"http://222.92.178.198:62001/"+((k=d==null?void 0:d[0])==null?void 0:k.url):d=d.toString(),v={key:(v==null?void 0:v.prop)??(v==null?void 0:v.label),value:d},n.push(v)}})}}),l.form=te.getFormContents(n),l},Ra=async(e,l,n)=>{var M,V,I,Z,H,oe,W,le,pe,ie,de,ke;ue.setImportLoading(!0);const r=await Va().catch(b=>(ue.setImportLoading(!1),Promise.reject(b))),o=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="算法体"),i=o==null?void 0:o.value;if(!i){console.log("未搜索到isMain, 缺少算法执行接口"),ue.setImportLoading(!1);return}const p=j.value||[],t=p.find(b=>(b==null?void 0:b.prop)==="输入"),c=t==null?void 0:t.prop;let f=l==null?void 0:l[c];const s=await Ol().catch(b=>(ue.setImportLoading(!1),Promise.reject(b)));let E=!1,m="";(M=j.value)==null||M.forEach(b=>{(b==null?void 0:b.prop)===c&&(E=!!(b!=null&&b.childPath),m=b==null?void 0:b.childPath)});let A="",_="";if(E){let b=(I=(V=j.value)==null?void 0:V.find(fe=>(fe==null?void 0:fe.isMainKey)===!0))==null?void 0:I.prop;_=l==null?void 0:l[b];let X=m==null?void 0:m.split(R),x=[];X==null||X.forEach((fe,J)=>{(X==null?void 0:X.length)-1===J&&x.push(_),x.push(fe)}),x=x.join(R),A=x;let F=await te.getItemData(x,sessionStorage.getItem("systemKey"),"");f=Ja(F)}const U=await za(i,{token:s,inputData:f}).catch(b=>(ue.setImportLoading(!1),Promise.reject(b))),C=(Z=U==null?void 0:U.data)==null?void 0:Z.data,O=r==null?void 0:r.find(b=>(b==null?void 0:b.prop)==="算法名称");O==null||O.value;const T=p.find(b=>(b==null?void 0:b.prop)==="输出"),N=T==null?void 0:T.directiveLabel;A=A==null?void 0:A.replaceAll(t==null?void 0:t.directiveLabel,N);const y=(H=S.cloneDeep(A))==null?void 0:H.replaceAll(R+_,"");let v=await te.getItemData(A,sessionStorage.getItem("systemKey"),""),u=await te.getItemData(y,sessionStorage.getItem("systemKey"),"");if(v){let b=[],X=[];v==null||v.forEach(x=>{var F,fe;if((x==null?void 0:x.comp)==="Table")(F=x==null?void 0:x.compData)==null||F.forEach(J=>{var D;(J==null?void 0:J.key)==="tableContents"&&((D=J==null?void 0:J.contents)==null||D.forEach(g=>{var ee,w;(ee=g==null?void 0:g[0])!=null&&ee.id&&b.push((w=g==null?void 0:g[0])==null?void 0:w.id)}))});else if((x==null?void 0:x.comp)==="Form"){x.compData=(fe=x==null?void 0:x.compData)==null?void 0:fe.map(D=>{var g;return(D==null?void 0:D.key)==="formContent"&&(D.contents=(g=D==null?void 0:D.contents)==null?void 0:g.map(ee=>{var w,z;return(w=C==null?void 0:C.form)!=null&&w[ee.prop]&&(ee.value=(z=C==null?void 0:C.form)==null?void 0:z[ee.prop]),ee})),D});let J={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:x==null?void 0:x.compData}};X.push({id:x==null?void 0:x.id,value:J})}}),(X==null?void 0:X.length)>0&&await S.batchUpdateInsofDataApi({dataList:X}),b=[...new Set(b)],(b==null?void 0:b.length)>0&&await S.batchDeleteInsofDataApi({ids:b})}else{let b=[];if(C!=null&&C.table){let X={type:"structure",systemKey:sessionStorage.getItem("systemKey"),pageKey:A,parentTable:"",createUserId:(oe=ce.value)==null?void 0:oe.id,createUserOrg:((W=ce.value)==null?void 0:W.dept)||((le=ce.value)==null?void 0:le.部门名称)};u==null||u.forEach(x=>{let fe={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:x==null?void 0:x.compData}};b.push({key:X,value:fe})})}if(C!=null&&C.form){let X={type:"structure",pageKey:A,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(pe=ce.value)==null?void 0:pe.id,parentPageKey:"",createUserLayer:((ie=ce.value)==null?void 0:ie.dept)||((de=ce.value)==null?void 0:de.部门名称)};u==null||u.forEach(x=>{var D;let F=(D=x==null?void 0:x.compData)==null?void 0:D.map(g=>{var ee;return(g==null?void 0:g.key)==="formContent"&&(g.contents=(ee=g.contents)==null?void 0:ee.map(w=>{var z,ae;return(z=C==null?void 0:C.form)!=null&&z[w.prop]&&(w.value=(ae=C==null?void 0:C.form)==null?void 0:ae[w.prop]),w})),g}),J={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:F}};b.push({key:X,value:J})})}(b==null?void 0:b.length)>0&&await S.batchAddInsofDataApi({dataList:b})}let k=await te.getItemData(A,sessionStorage.getItem("systemKey"),""),d=[];C!=null&&C.table&&((ke=C==null?void 0:C.table)==null||ke.forEach(b=>{var F,fe,J,D;let X={type:"data",pageKey:A,tableId:(F=k==null?void 0:k[0])==null?void 0:F.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(fe=ce.value)==null?void 0:fe.id,createUserOrg:((J=ce.value)==null?void 0:J.dept)||((D=ce.value)==null?void 0:D.部门名称)},x={tableData:b};d.push({key:X,value:x})})),(d==null?void 0:d.length)>0&&await S.batchAddInsofDataApi({dataList:d}),tl(!0),ue.setImportLoading(!1)},Rl=(e,l)=>(e=e==null?void 0:e.map(n=>{var r,o;return n!=null&&n.children&&((r=n.children)!=null&&r.find(i=>i.id===(l==null?void 0:l.id))?n.children=(o=n.children)==null?void 0:o.filter(i=>(i==null?void 0:i.id)!==(l==null?void 0:l.id)):n.children=Rl(n.children,l)),n}),e),Dl=async(e,l,n)=>{var r,o,i,p,t,c,f,s,E,m,A,_,U,C,O;if(Le.value="",gl.value=!0,Nl.value=!0,P("onButtonClick",e,l),e==="删除")te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var T,N;(T=Y.value)!=null&&T.find(y=>(y==null?void 0:y.id)===(l==null?void 0:l.id))?Y.value=(N=S.cloneDeep(Y.value))==null?void 0:N.filter(y=>(y==null?void 0:y.id)!==(l==null?void 0:l.id)):Y.value=Rl(S.cloneDeep(Y.value),l),Tr(yl.value,Ke.value,l==null?void 0:l.id),me.setTableLoading(h==null?void 0:h.index),P("change",{content:Y.value,singleContent:l,index:h==null?void 0:h.index,type:"delete",buttonName:e,column:j.value})});else if(e==="批量删除"){if(((r=Oe.value)==null?void 0:r.length)===0)return S.ElMessage.warning("请先勾选操作的数据");te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var N,y;const T=(N=Oe.value)==null?void 0:N.map(v=>v.id);Y.value=(y=S.cloneDeep(Y.value))==null?void 0:y.filter(v=>!(T!=null&&T.includes(v.id))),me.setTableLoading(h==null?void 0:h.index),P("change",{content:Y.value,singleContent:null,selectItems:Oe.value,index:h==null?void 0:h.index,type:"batchDelete",buttonName:e,column:j.value})})}else if(e==="复制新增"){Ue.value="新增";const T=S.cloneDeep(l),N=(o=j.value)==null?void 0:o.find(u=>u==null?void 0:u.isMainKey),y=N||((i=j.value)==null?void 0:i[0]),v=(p=Xe.value)==null?void 0:p.find(u=>(u==null?void 0:u.label)==="新建");await Wl(!0,v,{data:T,firstCol:y})}else if(e==="新增")Ue.value="新增",ul(""),je.value=!0;else if(e==="编辑")Ue.value="编辑",ul(l),je.value=!0;else if(e==="查看")Ue.value="查看",ul(l),gl.value=!1,Nl.value=!1,je.value=!0;else if(e==="查看三维模型"){const T={};for(let y in l)y!=="id"&&(T[y]=l[y]);let N=(t=Object.values(T))==null?void 0:t[1];dl.setTableShowThree(N)}else if(((c=n==null?void 0:n.extra)==null?void 0:c.type)==="modelExample")Ue.value=e,hl.value=!0;else if(e==="新建"){let T=El.value,N=[];for(let d in T)d!=null&&d.includes(`loading${((f=ce.value)==null?void 0:f.account)||((s=ce.value)==null?void 0:s.账号)}`)&&(N=[...N,...d]);let y=[];for(let d in T)d!=null&&d.includes(`updateLoading${((E=ce.value)==null?void 0:E.account)||((m=ce.value)==null?void 0:m.账号)}`)&&(y=[...y,...d]);let v=N==null?void 0:N.map(d=>d==null?void 0:d.id);const u=y==null?void 0:y.map(d=>d==null?void 0:d.id);v=[...S.cloneDeep(v),...u],(v==null?void 0:v.length)>0&&(v!=null&&v.every(d=>d!==null&&d))&&await S.batchDeleteInsofDataApi({ids:v});const k=(A=Xe.value)==null?void 0:A.find(d=>(d==null?void 0:d.label)==="新建");await Wl(!1,k)}else if(e==="修改模板"){let T=S.cloneDeep(ge).value;me.setRouteToChildPath(T),ue.setActiveMenuPath(T+R)}else if(e==="执行")Ra(e,l);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((_=Oe.value)==null?void 0:_.length)===0)return S.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&((U=Y.value)==null?void 0:U.length)===0)return S.ElMessage.warning("暂无数据导出");const T=(O=(C=j.value)==null?void 0:C.map(y=>y==null?void 0:y.label))==null?void 0:O.filter(y=>y!=="操作"),N=e==="导出全部"?S.cloneDeep(Y.value):S.cloneDeep(Oe.value);N==null||N.forEach(y=>{y==null||delete y.id}),Sa(N,h==null?void 0:h.compName,T,h==null?void 0:h.compName)}},qa=async e=>{var n,r,o,i,p,t;const l=await S.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((n=l==null?void 0:l.data)==null?void 0:n.code)===200)return Array.isArray((r=l==null?void 0:l.data)==null?void 0:r.result)&&((i=(o=l==null?void 0:l.data)==null?void 0:o.result)==null?void 0:i.length)>0?(t=(p=l==null?void 0:l.data)==null?void 0:p.result)==null?void 0:t.map(c=>{var f;return{id:c==null?void 0:c.id,...(f=c==null?void 0:c.value)==null?void 0:f.pageData}}):[]},ql=(e,l,n,r)=>{var o;P("contentChange",{contents:(o=e==null?void 0:e.compData)==null?void 0:o.map(i=>{var p;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(p=i==null?void 0:i.contents)==null?void 0:p.map(t=>(t==null?void 0:t.key)===l?{...t,value:n}:t)}:i}),index:e==null?void 0:e.id},r)},Wa=(e,l,n)=>{let r=e==null?void 0:e[l==null?void 0:l.prop],o=1;if(Y.value.some(i=>(i==null?void 0:i[l==null?void 0:l.prop])===r)){const i=r;for(;Y.value.some(p=>(p==null?void 0:p[l==null?void 0:l.prop])===`${i}(${o})`);)o++;r=`${i}(${o})`}return r},Wl=async(e,l,n)=>{var p,t,c,f,s,E,m,A;let r,o;const i=Wa(n==null?void 0:n.data,n==null?void 0:n.firstCol);if(e?(r=S.cloneDeep(ge).value+R+((f=n==null?void 0:n.data)==null?void 0:f[(c=n==null?void 0:n.firstCol)==null?void 0:c.prop]),o=S.cloneDeep(ge).value+R+i):(r=S.cloneDeep(ge).value+R,o=S.cloneDeep(r)+`loading${((p=ce.value)==null?void 0:p.account)||((t=ce.value)==null?void 0:t.账号)}`),l){const _=(E=(s=El.value[o])==null?void 0:s.filter(U=>{var C;return((C=U==null?void 0:U.key)==null?void 0:C.parentTable)===""}))==null?void 0:E.map(U=>{var C;return{id:U==null?void 0:U.id,...(C=U==null?void 0:U.value)==null?void 0:C.pageData}});if((_==null?void 0:_.length)>0)if(e){const U=_==null?void 0:_.find(C=>{var O;return((O=C==null?void 0:C.comp)==null?void 0:O.toUpperCase())==="FORM"});U&&ql(U,(m=n==null?void 0:n.firstCol)==null?void 0:m.label,i,ge.value)}else me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o);else if(await te.loadingConstruct(r,o,null,null),e){const U=await qa(o);if((U==null?void 0:U.length)>0){const C=U==null?void 0:U.find(O=>{var T;return((T=O==null?void 0:O.comp)==null?void 0:T.toUpperCase())==="FORM"});C&&ql(C,(A=n==null?void 0:n.firstCol)==null?void 0:A.label,i,ge.value)}}else me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o)}else e?(Le.value="",Se.value=n==null?void 0:n.data,tl(!0,n==null?void 0:n.firstCol,i)):(me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o))},Ga=()=>{ye.value=!1,ol.value=[],Ce.value=!1},ul=e=>{var o,i,p,t,c,f;const l=[];let n=[];for(let s in e)Array.isArray(e==null?void 0:e[s])&&n.push(s);se.value=S.cloneDeep(j.value),(i=te.getColumnChild((o=S.cloneDeep(j.value))==null?void 0:o.filter(s=>(s==null?void 0:s.label)!=="操作")))==null||i.forEach((s,E)=>{var m;n.find(A=>A===(s==null?void 0:s.prop))||(s!=null&&s.formType&&((m=s==null?void 0:s.formType)==null?void 0:m.toUpperCase())==="SELECT"?l.push({label:(s==null?void 0:s.label)??"",name:(s==null?void 0:s.prop)??"t"+E,prop:s==null?void 0:s.prop,type:!(s!=null&&s.formType)||(s==null?void 0:s.formType)===""?"Input":s==null?void 0:s.formType,value:(e==null?void 0:e[s==null?void 0:s.prop])??(s==null?void 0:s.value)??"",id:(s==null?void 0:s.id)??E,contents:(s==null?void 0:s.options)??[],width:1,isFormColHidden:s==null?void 0:s.isFormColHidden,disabled:s==null?void 0:s.disabled,optionUrl:{groupSelect:s==null?void 0:s.groupSelect,menuSelect:s==null?void 0:s.formMenuSelect,type:"Select",selectRelateType:s==null?void 0:s.selectRelateType}}):l.push({label:(s==null?void 0:s.label)??"",prop:s==null?void 0:s.prop,name:(s==null?void 0:s.prop)??"t"+E,type:!(s!=null&&s.formType)||(s==null?void 0:s.formType)===""?"Input":s==null?void 0:s.formType,value:(e==null?void 0:e[s==null?void 0:s.prop])??(s==null?void 0:s.value)??"",id:(s==null?void 0:s.id)??E,contents:(s==null?void 0:s.options)??[],width:1,isFormColHidden:s==null?void 0:s.isFormColHidden,disabled:s==null?void 0:s.disabled}))}),e===""||!e||(Le.value=(e==null?void 0:e.id)??"");let r=te.getColumnChild((p=S.cloneDeep(j.value))==null?void 0:p.filter(s=>(s==null?void 0:s.label)!=="操作"));_e.value&&((t=_e.value)==null?void 0:t.length)>0&&(_e.value=(c=S.cloneDeep(_e).value)==null?void 0:c.map(s=>{var m;let E=(m=r==null?void 0:r.find(A=>(A==null?void 0:A.label)===(s==null?void 0:s.label)))==null?void 0:m.prop;return E&&(s.value=e[E]),s})),Je.value=_e.value&&((f=_e.value)==null?void 0:f.length)>0?te.getTableFormToForm(_e.value):l},Ha=()=>{var l;const e=(l=B.value)==null?void 0:l.$el;e&&jl.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:n=>{var p;const{oldIndex:r,newIndex:o}=n;if(r===o)return;const i=il.value.splice(r,1)[0];il.value.splice(o,0,i),j.value=(p=j.value)==null?void 0:p.slice().sort((t,c)=>{if(t.label==="操作")return 1;if(c.label==="操作")return-1;const f=il.value.findIndex(E=>E.label===t.label),s=il.value.findIndex(E=>E.label===c.label);return f-s})}})};a.onMounted(()=>{_l.value=window.innerWidth-240*2});const Xa=()=>{a.nextTick(()=>{Ha()})},wl=(e,l)=>{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(o=>{var i,p;if((o==null?void 0:o.id)===Le.value){let t={};for(let c in o){let f=(i=l==null?void 0:l.find(s=>(s==null?void 0:s.prop)===c))==null?void 0:i.label;f?t[c]=(p=Se.value)==null?void 0:p[f]:t[c]=o[c]}o=Object.assign(t,Se.value),n=o}else{let t=wl(o,l);o=t==null?void 0:t.contents,n=t==null?void 0:t.currentSelectContents}return o}),{contents:e,currentSelectContents:n}},Gl=(e,l)=>{let n,r;return e!=null&&e.find(o=>(o==null?void 0:o.id)===Le.value)?n=e==null?void 0:e.map(o=>{var i,p;if((o==null?void 0:o.id)===Le.value){let t={};for(let c in o){let f=(i=l==null?void 0:l.find(s=>(s==null?void 0:s.prop)===c))==null?void 0:i.label;f?t[c]=(p=Se.value)==null?void 0:p[f]:t[c]=o[c]}o=Object.assign(t,Se.value),r=o}return o}):n=e==null?void 0:e.map(o=>{var i,p,t,c;if((o==null?void 0:o.id)===Le.value){let f={};for(let s in o){let E=(i=l==null?void 0:l.find(m=>(m==null?void 0:m.prop)===s))==null?void 0:i.label;E?f[s]=(p=Se.value)==null?void 0:p[E]:f[s]=o[s]}o=Object.assign(f,Se.value),r=o}else o=(t=wl(o,l))==null?void 0:t.contents,r=(c=wl(o,l))==null?void 0:c.currentSelectContents;return o}),{newContents:n,currentSelectContents:r}},Hl=(e,l,n)=>{var r,o;return e[l==null?void 0:l.prop]=n,typeof e.id=="number"&&(e.id=(r=e.id)==null?void 0:r.toString()),e.children&&((o=e.children)==null?void 0:o.length)>0&&(e.children=e.children.map(Hl)),e},Ll=e=>{var n;const l=[];return l.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((n=e.children)==null||n.forEach(r=>{l.push(...Ll(r))})),(l==null?void 0:l.length)>0?l==null?void 0:l.map(r=>{const o={...r};return delete o.children,o}):[]},tl=(e=!0,l,n)=>{var f,s,E,m,A,_,U,C,O;let r=te.getColumnChild((f=S.cloneDeep(j.value))==null?void 0:f.filter(T=>(T==null?void 0:T.label)!=="操作")),o,i=S.cloneDeep(Y.value);if(!Se.value){je.value=!1;return}if(Le.value===""){Ie.value++;let T;l&&n?T={id:Ie.value.toString(),[l==null?void 0:l.prop]:n,children:Se.value.children}:T={id:Ie.value.toString()},T!=null&&T.children&&(T={...T,children:(s=T.children)==null?void 0:s.map(N=>Hl(N,l,n))}),i.push(Object.assign(Se.value,T)),o=Object.assign(Se.value,T)}else i=(E=Gl(i,r))==null?void 0:E.newContents,o=(m=Gl(i,r))==null?void 0:m.currentSelectContents;const p=(A=h.itemData)==null?void 0:A.filter(T=>(T==null?void 0:T.key)==="childTree")[0];if(((_=p==null?void 0:p.contents)==null?void 0:_.length)>0){Ue.value="编辑";const T=[];i==null||i.forEach((N,y)=>{var u;let v={};if(Array.isArray(N)){let k=[];N==null||N.filter(d=>!(d!=null&&d.id)).forEach((d,M)=>{var V,I,Z,H,oe,W,le;if((I=(V=xe.value)==null?void 0:V[M])!=null&&I.prop&&!Array.isArray(d)){let pe={};pe[xe.value[M].column]=d,ne!=null&&ne.value&&((Z=ne==null?void 0:ne.value)==null?void 0:Z.length)>0&&((H=ne==null?void 0:ne.value)!=null&&H.find(ie=>JSON.stringify(ie==null?void 0:ie[0])===JSON.stringify(pe)))&&(k=(oe=ne==null?void 0:ne.value)==null?void 0:oe.find(ie=>JSON.stringify(ie==null?void 0:ie[0])===JSON.stringify(pe))),k&&k.length>0?v[xe.value[M].prop]=k!=null&&k.find(ie=>{var de;return((de=Object.keys(ie))==null?void 0:de[0])===xe.value[M].column})?(W=k==null?void 0:k.find(ie=>{var de;return((de=Object.keys(ie))==null?void 0:de[0])===xe.value[M].column}))==null?void 0:W[xe.value[M].column]:d:v[xe.value[M].prop]=d}else Array.isArray(d)&&((le=xe.value[M])!=null&&le.prop?v[xe.value[M].prop]=d:v.children=Fl(d,xe.value))})}else v=N;Array.isArray(N)&&N.some(k=>k==null?void 0:k.id)?T.push(Object.assign(v,{id:(u=N==null?void 0:N.find(k=>k.id))==null?void 0:u.id})):v.id?T.push(v):T.push(Object.assign(v,{id:y.toString()}))}),Y.value=Zl(T,p,j.value)}else Y.value=i;yl.value=Y.value;const t=Ar(yl.value,Ke.value,i);let c=[];if(rl.value?(c=(U=S.cloneDeep(rl).value.singleContent)==null?void 0:U.filter(T=>(T==null?void 0:T.id)!==(o==null?void 0:o.id)),c.push(o)):c=[o],Qe.value){const T={content:t,singleContent:((C=p==null?void 0:p.contents)==null?void 0:C.length)>0?c==null?void 0:c.flatMap(Ll):c,index:h==null?void 0:h.index,buttonName:"编辑",column:j.value,parentTableId:h==null?void 0:h.parentTableId};me.setCacheUpdatingData(T)}if(e){const T={content:t,singleContent:((O=p==null?void 0:p.contents)==null?void 0:O.length)>0?Ll(o):o,index:h==null?void 0:h.index,buttonName:Ue.value,column:j.value,parentTableId:h==null?void 0:h.parentTableId};me.setTableLoading(h==null?void 0:h.index),je.value=!1,Se.value=void 0,P("change",T)}};a.onUnmounted(()=>{j.value=[],Y.value=[],se.value=[],Me.value=[],_e.value=[],He.value=[],ol.value=[],el.value=[],Je.value=[],Oe.value=[],B.value=null});const Xl=async(e,l,n)=>{var f,s,E,m,A,_,U,C,O,T,N;Ye.value=n==null?void 0:n.prop;const r=S.cloneDeep(h.itemData),o=r==null?void 0:r.map(y=>{var v;return(y==null?void 0:y.key)==="header"&&((v=y.contents)==null||v.map((u,k)=>{var d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x,F,fe,J;return u.type=u!=null&&u.type?u.type:(I=(V=(M=(d=u==null?void 0:u.key)==null?void 0:d.split("$"))==null?void 0:M[1])==null?void 0:V.split("("))!=null&&I[0]?(H=(Z=te.FormType)==null?void 0:Z.find(D=>{var g,ee,w,z;return(D==null?void 0:D.key)===((z=(w=(ee=(g=u==null?void 0:u.key)==null?void 0:g.split("$"))==null?void 0:ee[1])==null?void 0:w.split("("))==null?void 0:z[0])}))==null?void 0:H.value:"Input",u.options=u!=null&&u.options?u.options:((le=(W=(oe=u==null?void 0:u.key)==null?void 0:oe.split("$"))==null?void 0:W[1])==null?void 0:le.length)>0?(ke=(de=$l((ie=(pe=u==null?void 0:u.key)==null?void 0:pe.split("$"))==null?void 0:ie[1]))==null?void 0:de.split(","))==null?void 0:ke.map(D=>({label:D,value:D})):[],(b=u==null?void 0:u.key)!=null&&b.includes("$")&&(u.key=(x=(X=u==null?void 0:u.key)==null?void 0:X.split("$"))==null?void 0:x[0]),u.value=(F=Object.values(l))==null?void 0:F[k],u.optionUrl=u!=null&&u.formMenuSelect&&((fe=u==null?void 0:u.formMenuSelect)==null?void 0:fe.length)>0?{groupSelect:(J=u==null?void 0:u.groupSelect)==null?void 0:J.split(/[::]/).map(D=>D.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),y});let i=S.cloneDeep(Je.value),p=(s=(f=S.cloneDeep(o))==null?void 0:f.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:s.contents;i=i==null?void 0:i.map(y=>{var v;return y.value=(v=p==null?void 0:p.find((u,k)=>k===(y==null?void 0:y.id)))==null?void 0:v.value,y});let t="",c=(A=(m=(E=S.cloneDeep(o))==null?void 0:E.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:m.contents)==null?void 0:A.find((y,v)=>{var u,k,d;return(y==null?void 0:y.label)===Ye.value||(v==null?void 0:v.toString())===((d=(k=(u=Ye.value)==null?void 0:u.split("a"))==null?void 0:k[1])==null?void 0:d.toString())});if((C=(U=(_=S.cloneDeep(o))==null?void 0:_.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:U.contents)==null||C.forEach(y=>{var v,u,k,d,M;t===""&&((k=(u=(v=y==null?void 0:y.optionUrl)==null?void 0:v.groupSelect)==null?void 0:u[1])!=null&&k.includes("["))&&(t=(M=(d=y==null?void 0:y.optionUrl)==null?void 0:d.groupSelect)==null?void 0:M[1])}),(O=c==null?void 0:c.optionUrl)!=null&&O.menuSelect){let y=await Pl(c),v;if(y==null||y.forEach(u=>{var k,d,M,V,I,Z,H,oe,W,le;t===((d=(k=c==null?void 0:c.optionUrl)==null?void 0:k.groupSelect)==null?void 0:d[1])&&((I=(V=(M=c==null?void 0:c.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((le=S.cloneDeep(u))==null?void 0:le[(W=(oe=(H=(Z=c==null?void 0:c.optionUrl)==null?void 0:Z.groupSelect)==null?void 0:H[1])==null?void 0:oe.replaceAll("[",""))==null?void 0:W.replaceAll("]","")])===(c==null?void 0:c.value)&&(v=u)}),v){let u=S.cloneDeep(i);u=u==null?void 0:u.map(d=>{var M,V,I,Z,H,oe,W,le,pe,ie,de;return(v!=null&&v[d==null?void 0:d.label]||v!=null&&v[(Z=(I=(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])==null?void 0:I.replaceAll("[",""))==null?void 0:Z.replaceAll("]","")])&&((W=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.groupSelect)==null?void 0:oe[1])!=null&&W.includes("["))&&(d.value=(v==null?void 0:v[d==null?void 0:d.label])||(v==null?void 0:v[(de=(ie=(pe=(le=d==null?void 0:d.optionUrl)==null?void 0:le.groupSelect)==null?void 0:pe[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:de.replaceAll("]","")])),d}),Y.value=(T=S.cloneDeep(Y.value))==null?void 0:T.map(d=>{if((d==null?void 0:d.id)===(l==null?void 0:l.id)){const M={};return u==null||u.forEach(V=>{M[V.name]=V.value}),M.id=d==null?void 0:d.id,M}return d});let k=S.cloneDeep(u);k=k==null?void 0:k.map(d=>{var M,V,I,Z;return(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.menuSelect)!=null&&V.some(H=>H==null?void 0:H.includes)&&(d.optionUrl.menuSelect=(Z=(I=d==null?void 0:d.optionUrl)==null?void 0:I.menuSelect)==null?void 0:Z.map(H=>{var oe,W,le,pe;if(H!=null&&H.includes("[")){let ie=(W=(oe=H==null?void 0:H.replaceAll("[","").replaceAll("]",""))==null?void 0:oe.split(":"))==null?void 0:W[1];H=(pe=(le=S.cloneDeep(u))==null?void 0:le.find(de=>(de==null?void 0:de.label)===ie))==null?void 0:pe.value}return H})),d}),Y.value=(N=S.cloneDeep(Y.value))==null?void 0:N.map(d=>{if((d==null?void 0:d.id)===(l==null?void 0:l.id)){const M={};return k==null||k.forEach(V=>{M[V.name]=V.value}),M.id=d==null?void 0:d.id,M}return d})}}},Qa=async e=>{var f,s,E,m,A,_,U,C,O,T,N;if(!e)return;Se.value=e;const l=S.cloneDeep(h.itemData);let n=l==null?void 0:l.map(y=>{var v;return(y==null?void 0:y.key)==="header"&&((v=y.contents)==null||v.map((u,k)=>{var d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x,F,fe,J;return u.type=u!=null&&u.type?u.type:(I=(V=(M=(d=u==null?void 0:u.key)==null?void 0:d.split("$"))==null?void 0:M[1])==null?void 0:V.split("("))!=null&&I[0]?(H=(Z=te.FormType)==null?void 0:Z.find(D=>{var g,ee,w,z;return(D==null?void 0:D.key)===((z=(w=(ee=(g=u==null?void 0:u.key)==null?void 0:g.split("$"))==null?void 0:ee[1])==null?void 0:w.split("("))==null?void 0:z[0])}))==null?void 0:H.value:"Input",u.options=u!=null&&u.options?u.options:((le=(W=(oe=u==null?void 0:u.key)==null?void 0:oe.split("$"))==null?void 0:W[1])==null?void 0:le.length)>0?(ke=(de=$l((ie=(pe=u==null?void 0:u.key)==null?void 0:pe.split("$"))==null?void 0:ie[1]))==null?void 0:de.split(","))==null?void 0:ke.map(D=>({label:D,value:D})):[],(b=u==null?void 0:u.key)!=null&&b.includes("$")&&(u.key=(x=(X=u==null?void 0:u.key)==null?void 0:X.split("$"))==null?void 0:x[0]),u.value=(F=Object.values(e))==null?void 0:F[k],u.optionUrl=u!=null&&u.formMenuSelect&&((fe=u==null?void 0:u.formMenuSelect)==null?void 0:fe.length)>0?{groupSelect:(J=u==null?void 0:u.groupSelect)==null?void 0:J.split(/[::]/).map(D=>D.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),y}),r=S.cloneDeep(Je.value),o=(s=(f=S.cloneDeep(n))==null?void 0:f.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:s.contents;if(r=r==null?void 0:r.map(y=>{var v;return y.value=(v=o==null?void 0:o.find((u,k)=>(u==null?void 0:u.prop)===(y==null?void 0:y.name)))==null?void 0:v.value,y}),!sl.value)return;let i="",p=(A=(m=(E=S.cloneDeep(n))==null?void 0:E.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:m.contents)==null?void 0:A.find((y,v)=>{var u,k,d;return(y==null?void 0:y.label)===Ye.value||(v==null?void 0:v.toString())===((d=(k=(u=Ye.value)==null?void 0:u.split("a"))==null?void 0:k[1])==null?void 0:d.toString())}),t=(_=p==null?void 0:p.optionUrl)==null?void 0:_.menuSelect,c=!0;if((O=(C=(U=S.cloneDeep(n))==null?void 0:U.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:C.contents)==null||O.forEach(y=>{var v,u,k,d,M,V;c&&((k=(u=(v=y==null?void 0:y.optionUrl)==null?void 0:v.groupSelect)==null?void 0:u[1])!=null&&k.includes("["))&&(i=(M=(d=y==null?void 0:y.optionUrl)==null?void 0:d.groupSelect)==null?void 0:M[1],JSON.stringify(t)===JSON.stringify((V=y==null?void 0:y.optionUrl)==null?void 0:V.menuSelect)&&(c=!1))}),(T=p==null?void 0:p.optionUrl)!=null&&T.menuSelect&&sl.value){let y=await Pl(p),v;if((N=p==null?void 0:p.optionUrl)==null||N.menuSelect,y==null||y.forEach(u=>{var k,d,M,V,I,Z,H,oe,W,le;i===((d=(k=p==null?void 0:p.optionUrl)==null?void 0:k.groupSelect)==null?void 0:d[1])&&((I=(V=(M=p==null?void 0:p.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((le=S.cloneDeep(u))==null?void 0:le[(W=(oe=(H=(Z=p==null?void 0:p.optionUrl)==null?void 0:Z.groupSelect)==null?void 0:H[1])==null?void 0:oe.replaceAll("[",""))==null?void 0:W.replaceAll("]","")])===(p==null?void 0:p.value)&&(v=u)}),v){let u=S.cloneDeep(r);u=u==null?void 0:u.map(d=>{var M,V,I,Z,H,oe,W,le,pe,ie,de;return(v!=null&&v[d==null?void 0:d.label]||v!=null&&v[(Z=(I=(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])==null?void 0:I.replaceAll("[",""))==null?void 0:Z.replaceAll("]","")])&&((W=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.groupSelect)==null?void 0:oe[1])!=null&&W.includes("["))&&(d.value=(v==null?void 0:v[d==null?void 0:d.label])||(v==null?void 0:v[(de=(ie=(pe=(le=d==null?void 0:d.optionUrl)==null?void 0:le.groupSelect)==null?void 0:pe[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:de.replaceAll("]","")])),d}),Je.value=S.cloneDeep(u);let k=S.cloneDeep(u);k=k==null?void 0:k.map(d=>{var M,V,I,Z,H,oe;return(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.menuSelect)!=null&&V.some(W=>W==null?void 0:W.includes("["))&&(d.optionUrl.oldMenuSelect=(Z=(I=S.cloneDeep(d))==null?void 0:I.optionUrl)==null?void 0:Z.menuSelect,d.optionUrl.menuSelect=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.menuSelect)==null?void 0:oe.map(W=>{var le,pe,ie,de;if(W!=null&&W.includes("[")){let ke=(pe=(le=W==null?void 0:W.replaceAll("[","").replaceAll("]",""))==null?void 0:le.split(":"))==null?void 0:pe[1];W=(de=(ie=S.cloneDeep(u))==null?void 0:ie.find(b=>(b==null?void 0:b.label)===ke))==null?void 0:de.value}return W})),d}),Je.value=k}}sl.value=!1},Ya=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",Za=e=>{var i,p;const l=(p=(i=_e.value)==null?void 0:i.find(t=>(t==null?void 0:t.label)===(e==null?void 0:e.label)))==null?void 0:p.multiple,n=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(t=>{const c=t==null?void 0:t[n];l&&Kl(c)&&(t[n]=[c]),!l&&!Kl(c)&&(t[n]="")})},Ql=(e,l)=>{var n;return l==null||l.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=>Ql(r,l))),e},Ml=e=>{var n,r,o,i,p,t;ul("");const l=(n=Je.value)==null?void 0:n.reduce((c,f)=>(c[f.name]=f.value,c),{});if(((r=Object.keys(l))==null?void 0:r.length)>0){Se.value=l,Le.value="",Ie.value=(o=Y.value)==null?void 0:o.length,el.value=(i=Xe.value)==null?void 0:i.filter(f=>(f==null?void 0:f.label)!=="新增");const c=(t=(p=se.value)==null?void 0:p.filter(f=>(f==null?void 0:f.label)!=="操作"))==null?void 0:t.map(f=>{var E,m,A;const s=(m=(E=_e.value)==null?void 0:E.find(_=>(_==null?void 0:_.label)===(f==null?void 0:f.label)))==null?void 0:m.multiple;return Za(f),{...f,contents:(f==null?void 0:f.options)??[],optionUrl:f!=null&&f.formMenuSelect&&((A=f==null?void 0:f.formMenuSelect)==null?void 0:A.length)>0?{groupSelect:f==null?void 0:f.groupSelect,menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:f==null?void 0:f.formType,multiple:s}:null}});j.value=c==null?void 0:c.map(f=>Ql(f,[{prop:"type",value:"edit"},{prop:"columnType",value:Ya(f==null?void 0:f.formType)||(f==null?void 0:f.columnType)}])),e==="createClick"&&tl(!1)}},Ia=(e,l)=>Number(jl.dayjs(l).diff(jl.dayjs(e),"day",!0).toFixed(1)),er=(e,l)=>{var p;const n=(p=e==null?void 0:e.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:p.contents,r={START:"开始时间",END:"结束时间",HOURS:"工时"},o=new Map;return n==null||n.forEach((t,c)=>{const{label:f}=t;o.set(f,c)}),!o.has(r.START)||!o.has(r.END)||!o.has(r.HOURS)?l:l==null?void 0:l.map(t=>{const c=t==null?void 0:t[r.START],f=t==null?void 0:t[r.END],s=Ia(c,f);return c&&f&&(t[r.HOURS]=`${s}天`),t})},Yl=(e,l,n=0)=>{if(n>((l==null?void 0:l.length)??""))return e;const r=l[n],o=new Map;for(const p of e){const t=p[r];o.has(t)||o.set(t,[]),o.get(t)&&o.get(t).push(p)}const i=[];for(const[p,t]of o){const[c,...f]=t,s={...c};n+1===((l==null?void 0:l.length)??"")?s.children=t==null?void 0:t.map(E=>(E.level=S.cloneDeep(n)+1,E)).filter((E,m)=>m!==0):f.length>0&&(s.children=Yl(f,l,n+1)),s.level=n,i.push(s)}return i},Zl=(e,l,n)=>{var o;if(((o=l==null?void 0:l.contents)==null?void 0:o.length)===0)return e;let r=[];return r=Yl(e,l==null?void 0:l.contents,0),r},Il=(e,l)=>{var m,A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke;const n=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="header");e==null||e.filter(b=>(b==null?void 0:b.key)==="tableIndexColumn")[0];const r=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="childTree")[0];let o=l;const i=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="page"),p=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="rowButton"),t=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="extraButton"),c=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableContents"),f=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableIndex");_e.value=(A=(m=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableToForm"))==null?void 0:m[0])==null?void 0:A.contents,Vl.value=(i==null?void 0:i.contents)??!0;let s=[];$e.value===""?s=n==null?void 0:n[0]:s=(n==null?void 0:n.find(b=>(b==null?void 0:b.selectLabel)==="("+$e.value+")"))??(n==null?void 0:n.find(b=>!(b!=null&&b.selectLabel)));let E=[];if($e.value===""?E=f==null?void 0:f[0]:E=(f==null?void 0:f.find(b=>(b==null?void 0:b.selectLabel)==="("+$e.value+")"))??(f==null?void 0:f.find(b=>!(b!=null&&b.selectLabel))),((_=s==null?void 0:s.contents)==null?void 0:_.length)>0){let b=[];if(s!=null&&s.contents.some(D=>Array.isArray(D)&&(D==null?void 0:D.find(g=>g.children))))Ke.value===""?b=(C=(U=te.getGradeColumns(s==null?void 0:s.contents))==null?void 0:U[0])==null?void 0:C.filter(D=>!Array.isArray(D)):(Ke.value.split("-"),b=(O=te.getGradeColumns(s==null?void 0:s.contents))==null?void 0:O[0]);else{let D=s!=null&&s.contents.some(g=>Array.isArray(g))?(T=s==null?void 0:s.contents)==null?void 0:T[0]:s==null?void 0:s.contents;D==null||D.forEach((g,ee)=>{var ae,Ae,Ze,Re;let w="";(Ae=(ae=ge.value)==null?void 0:ae.split("/"))==null||Ae.forEach(Ee=>{var qe,We,Fe;if(Ee!==""){let ll=(Fe=(We=(qe=Ee==null?void 0:Ee.split(R+"updateLoading"))==null?void 0:qe[0])==null?void 0:We.split(R+"loading"))==null?void 0:Fe[0];w=w===""?w+ll:w+"/"+ll}}),w=w+R+(g==null?void 0:g.directiveLabel);const z=(Ze=_e.value)==null?void 0:Ze.find(Ee=>(Ee==null?void 0:Ee.prop)===(g==null?void 0:g.prop));b.push({label:(g==null?void 0:g.label)??"",prop:(g==null?void 0:g.label)==="操作"?"operate":(g==null?void 0:g.prop)??"a"+ee,width:g!=null&&g.width?parseInt(g.width):"",fixed:(g==null?void 0:g.fixed)??void 0,sortable:(g==null?void 0:g.sortable)??!1,filterable:(g==null?void 0:g.filterable)??!1,operable:(g==null?void 0:g.operable)??!1,showSummary:(g==null?void 0:g.showSummary)??!1,align:(g==null?void 0:g.align)??"left",showOverflowTooltip:(g==null?void 0:g.showOverflowTooltip)??!0,isNotDrag:(g==null?void 0:g.isNotDrag)??!1,isEditCol:(g==null?void 0:g.isEditCol)??!1,isOperate:(g==null?void 0:g.isOperate)??!1,id:(g==null?void 0:g.id)??ee,type:(g==null?void 0:g.label)==="操作"?"operate":void 0,formType:(g==null?void 0:g.formType)??(g!=null&&g.groupSelect?"Select":""),isTableColHidden:g==null?void 0:g.isTableColHidden,isFormColHidden:g==null?void 0:g.isFormColHidden,disabled:g==null?void 0:g.disabled,options:(g==null?void 0:g.options)??[],value:(g==null?void 0:g.value)??"",formMenuSelect:(g==null?void 0:g.formMenuSelect)??[],isRoute:(g==null?void 0:g.isRoute)??!1,groupSelect:g!=null&&g.groupSelect?(Re=g==null?void 0:g.groupSelect)==null?void 0:Re.replaceAll('"',"").split(":"):[],isMainKey:(g==null?void 0:g.isMainKey)||(g==null?void 0:g.directiveLabel)&&!o[w],columnType:(z==null?void 0:z.type)||(g==null?void 0:g.columnType)||"TEXTAREA",directiveLabel:g==null?void 0:g.directiveLabel,isExistChild:!!(g!=null&&g.directiveLabel&&o[w]),childPath:w})})}j.value=b,Me.value=b,q.value=(N=j.value)==null?void 0:N.map(D=>D==null?void 0:D.label),Pe.value=(y=j.value)==null?void 0:y.every(D=>D==null?void 0:D.filterable),ve.value=(v=j.value)==null?void 0:v.every(D=>D==null?void 0:D.operable),Ne.value=(u=j.value)==null?void 0:u.every(D=>D==null?void 0:D.sortable);let X=(d=(k=te.getAllLeafNodes(j.value))==null?void 0:k.filter(D=>(D==null?void 0:D.type)!=="operate"))==null?void 0:d.map((D,g)=>({prop:(D==null?void 0:D.prop)??"a"+g,column:D.label}));xe.value=X;let x=[];$e.value===""?x=c==null?void 0:c[0]:x=(c==null?void 0:c.find(D=>(D==null?void 0:D.selectLabel)==="("+$e.value+")"))??(c==null?void 0:c.find(D=>!(D!=null&&D.selectLabel)));let F=Array.isArray((M=x==null?void 0:x.contents)==null?void 0:M[0])&&((V=x==null?void 0:x.contents)!=null&&V[0].every(D=>Array.isArray(D)))?(I=x==null?void 0:x.contents)==null?void 0:I[0]:x==null?void 0:x.contents;E!=null&&E.contents&&((Z=E==null?void 0:E.contents)==null?void 0:Z.length)!==0&&(F=(H=S.cloneDeep(F))==null?void 0:H.map((D,g)=>{if(!Array.isArray(D)){let ee={};for(let w in D)w!=="id"&&w!=="index"&&(ee[w]=D[w]);D=Object.values(ee)}return D}));const fe=!!((oe=j.value)!=null&&oe.find(D=>D.prop==="index"));F=ra(F,E==null?void 0:E.contents,fe);const J=[];F==null||F.forEach((D,g)=>{var w;let ee={};if(Array.isArray(D)){let z=[];D==null||D.filter(ae=>!(ae!=null&&ae.id)).forEach((ae,Ae)=>{var Ze,Re,Ee,qe,We,Fe;if((Ze=X==null?void 0:X[Ae])!=null&&Ze.prop&&!Array.isArray(ae)){let ll={};ll[X[Ae].column]=ae,ne!=null&&ne.value&&((Re=ne==null?void 0:ne.value)==null?void 0:Re.length)>0&&((Ee=ne==null?void 0:ne.value)!=null&&Ee.find(we=>JSON.stringify(we==null?void 0:we[0])===JSON.stringify(ll)))&&(z=(qe=ne==null?void 0:ne.value)==null?void 0:qe.find(we=>JSON.stringify(we==null?void 0:we[0])===JSON.stringify(ll))),z&&z.length>0?ee[X[Ae].prop]=z!=null&&z.find(we=>{var cl;return((cl=Object.keys(we))==null?void 0:cl[0])===X[Ae].column})?(We=z==null?void 0:z.find(we=>{var cl;return((cl=Object.keys(we))==null?void 0:cl[0])===X[Ae].column}))==null?void 0:We[X[Ae].column]:ae:ee[X[Ae].prop]=ae}else Array.isArray(ae)&&((Fe=X[Ae])!=null&&Fe.prop?ee[X[Ae].prop]=ae:ee.children=Fl(ae,X))})}else ee=D;Array.isArray(D)&&D.some(z=>z==null?void 0:z.id)?J.push(Object.assign(ee,{id:(w=D==null?void 0:D.find(z=>z.id))==null?void 0:w.id})):ee.id?J.push(ee):J.push(Object.assign(ee,{id:g.toString()}))}),er(e,J),Y.value=Zl(J,r,j.value),pl.value=J,(W=pl.value)==null||W.forEach(D=>{var g;(g=fl.value)==null||g.set(D.id,D)})}else j.value=[],se.value=[],Y.value=[],pl.value=[],fl.value=new Map;((le=p==null?void 0:p.contents)==null?void 0:le.length)>0?He.value=p==null?void 0:p.contents:He.value=[],((pe=t==null?void 0:t.contents)==null?void 0:pe.length)>0?(el.value=t==null?void 0:t.contents,Xe.value=t==null?void 0:t.contents):(el.value=[],Xe.value=[]),Ie.value=((ie=Y==null?void 0:Y.value)==null?void 0:ie.length)??0,yl.value=Y.value,Qe.value&&(j.value=(ke=(de=se.value)==null?void 0:de.filter(b=>(b==null?void 0:b.label)!=="操作"))==null?void 0:ke.map(b=>{var X;return{...b,type:"edit",optionUrl:b!=null&&b.formMenuSelect&&((X=b==null?void 0:b.formMenuSelect)==null?void 0:X.length)>0?{groupSelect:b==null?void 0:b.groupSelect,menuSelect:b==null?void 0:b.formMenuSelect,selectRelateType:"",type:b==null?void 0:b.formType}:null}}),Ml())};a.watch(()=>[h.itemData,$e.value,ca.value,Ke.value,ne==null?void 0:ne.value],async()=>{var e,l,n,r,o,i;if((e=h==null?void 0:h.itemData)!=null&&e.find(p=>(p==null?void 0:p.key)==="columnPath")&&!((l=nl.value)!=null&&l.find(p=>{var t,c;return(p==null?void 0:p.key)===((c=(t=h==null?void 0:h.itemData)==null?void 0:t.find(f=>(f==null?void 0:f.key)==="columnPath"))==null?void 0:c.contents)}))){let p=nl.value,t={key:(r=(n=h==null?void 0:h.itemData)==null?void 0:n.find(c=>(c==null?void 0:c.key)==="columnPath"))==null?void 0:r.contents,value:(i=(o=h==null?void 0:h.itemData)==null?void 0:o.find(c=>(c==null?void 0:c.key)==="columnUsingPath"))==null?void 0:i.contents};p!=null&&p.find(c=>(c==null?void 0:c.key)===(t==null?void 0:t.key))?p=p==null?void 0:p.map(c=>((c==null?void 0:c.key)===(t==null?void 0:t.key)&&(c.value=t.value),c)):p.push(t),me.setTableViewContents(p)}Il(h.itemData,h.allMapContents)},{deep:!0,immediate:!0}),a.watch(()=>h==null?void 0:h.operatingForm,e=>{e!=null&&e.form&&(ul(e==null?void 0:e.form),Ue.value=e==null?void 0:e.dialogTitle,gl.value=!0,je.value=!0)},{immediate:!0,deep:!0});const ea=()=>{Qe.value=!Qe.value},lr=()=>{bl.value=!bl.value};a.watch(()=>Qe.value,e=>{e?(Ml("viewChange"),me.setCacheUpdatingData(null)):(el.value=Xe.value,j.value=Me.value,rl.value&&(me.setTableLoading(h==null?void 0:h.index),P("change",rl.value)))},{immediate:!0}),a.ref(!1);const ar=(e,l)=>{var n;Ml("createClick"),l===G.pageSize&&(G.currentPage=Math.ceil(((n=Y.value)==null?void 0:n.length)/G.pageSize))},rr=(e,l,n)=>{var r;Xl(n,e,l),Se.value=S.cloneDeep(e),Le.value=e==null?void 0:e.id,Ie.value=(r=Y.value)==null?void 0:r.length,Ue.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",tl(!1)},De=e=>{var c,f,s,E,m,A,_,U,C,O;const{row:l,column:n,item:r,slotData:o}=e;let i=l!=null&&l[n==null?void 0:n.prop]?((f=(c=l==null?void 0:l[n==null?void 0:n.prop])==null?void 0:c[0])==null?void 0:f.contents)??(l==null?void 0:l[n==null?void 0:n.prop]):((E=(s=l==null?void 0:l[r==null?void 0:r.prop])==null?void 0:s[0])==null?void 0:E.contents)??(l==null?void 0:l[r==null?void 0:r.prop])??((A=(m=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:m[0])==null?void 0:A.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((C=(U=l==null?void 0:l[(_=r==null?void 0:r.child)==null?void 0:_.prop])==null?void 0:U[0])==null?void 0:C.contents)??(l==null?void 0:l[(O=r==null?void 0:r.child)==null?void 0:O.prop]),t=Array.isArray(i)&&!(i!=null&&i.every(T=>typeof T=="string"||typeof T=="number"))?"查看":i;return t=Array.isArray(t)?t.join(","):t,t},nr=e=>{var f,s,E,m,A,_,U,C,O,T;const{row:l,column:n,item:r,slotData:o}=e;let i=l!=null&&l[n==null?void 0:n.prop]?((s=(f=l==null?void 0:l[n==null?void 0:n.prop])==null?void 0:f[0])==null?void 0:s.contents)??(l==null?void 0:l[n==null?void 0:n.prop]):((m=(E=l==null?void 0:l[r==null?void 0:r.prop])==null?void 0:E[0])==null?void 0:m.contents)??(l==null?void 0:l[r==null?void 0:r.prop])??((_=(A=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:A[0])==null?void 0:_.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((O=(C=l==null?void 0:l[(U=r==null?void 0:r.child)==null?void 0:U.prop])==null?void 0:C[0])==null?void 0:O.contents)??(l==null?void 0:l[(T=r==null?void 0:r.child)==null?void 0:T.prop]);const t=Array.isArray(i)&&!(i!=null&&i.every(N=>typeof N=="string"||typeof N=="number")),c=Array.isArray(i)&&(i==null?void 0:i.find(N=>N==null?void 0:N.url));return t&&c};return(e,l)=>{var f,s,E;const n=a.resolveComponent("svg-icon"),r=a.resolveComponent("el-popover"),o=a.resolveComponent("el-switch"),i=a.resolveComponent("el-checkbox"),p=a.resolveComponent("el-checkbox-group"),t=a.resolveComponent("el-button"),c=a.resolveComponent("LookComponent");return a.openBlock(),a.createElementBlock("div",Nr,[zl.value?(a.openBlock(),a.createBlock(Be.ssTable,{id:"excel-table",pageObj:G,summaryInfo:Ve,columns:j.value,isCardViewport:bl.value,checkedColumns:q.value,key:xl.value+JSON.stringify(j.value),tableData:ya.value,isEditViewport:Qe.value,isShowPagination:Vl.value,isShowEdit:!1,isShowDelete:!1,allowSelect:L.allowSelect,onDbClickRow:ja,extraButton:el.value,rowButton:He.value,cacheExtraButtons:Xe.value,isClearSelection:((f=Oe.value)==null?void 0:f.length)===0,onDoCurrentChange:va,onDoSizeChange:ba,onContentClick:Ka,onRowClick:Fa,onSelectChange:Aa,onCellChange:rr,onChange:Xl,onPreview:Jl,onSubmitEditingTable:Ca,onHandleColEditChange:Da,onHandleColTypeChange:Ta,onClickButton:Dl},a.createSlots({headerButton:a.withCtx(m=>{var A,_;return[L.showHeader?(a.openBlock(),a.createBlock(gr,{key:0,selectNums:(A=Oe.value)==null?void 0:A.length,dataNums:(_=Y.value)==null?void 0:_.length,compName:L.compName,isDevMode:L.isDevMode,buttons:m.buttons,onButtonClick:l[0]||(l[0]=U=>Dl(U,"",{})),columns:j.value,onFilter:Ma,onGetImportData:ka},null,8,["selectNums","dataNums","compName","isDevMode","buttons","columns"])):a.createCommentVNode("",!0)]}),viewport:a.withCtx(()=>{var m,A;return[((m=Y.value)==null?void 0:m.length)>0&&L.allowOperate?(a.openBlock(),a.createElementBlock("div",Br,[(A=He.value)!=null&&A.some(_=>(_==null?void 0:_.label)==="编辑")&&!bl.value?(a.openBlock(),a.createElementBlock("span",{key:0,title:"编辑表格",onClick:ea},[a.createVNode(n,{name:"editTable",class:"view-icon"})])):a.createCommentVNode("",!0),a.createElementVNode("span",{title:"卡片视图",onClick:lr},[a.createVNode(n,{name:"cardViewport",class:"view-icon"})])])):a.createCommentVNode("",!0)]}),rowCreate:a.withCtx(({row:m,index:A})=>[a.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:_=>ar(m,A)},[a.createVNode(n,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,Ur)]),operateCol:a.withCtx(()=>[a.createVNode(r,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:Xa},{reference:a.withCtx(()=>[a.createElementVNode("span",Or,[a.createVNode(n,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:a.withCtx(()=>[a.createElementVNode("div",wr,[l[11]||(l[11]=a.createElementVNode("div",{class:"group-title"},"表格操作",-1)),a.createVNode(o,{"model-value":Ne.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:l[2]||(l[2]=m=>Ul(m,"sortable"))},null,8,["model-value"]),a.createVNode(o,{"model-value":Pe.value,"active-text":"筛选","inactive-text":"",style:{"margin-right":"8px"},onChange:l[3]||(l[3]=m=>Ul(m,"filterable"))},null,8,["model-value"]),a.createVNode(o,{"model-value":ve.value,"active-text":"编辑所有表头","inactive-text":"",onChange:l[4]||(l[4]=m=>Ul(m,"operable"))},null,8,["model-value"]),l[12]||(l[12]=a.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),a.createVNode(p,{modelValue:q.value,"onUpdate:modelValue":l[5]||(l[5]=m=>q.value=m),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:B},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(il.value,m=>(a.openBlock(),a.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:m.label},[a.createVNode(i,{value:m.label,style:{width:"100%",marginRight:0}},{default:a.withCtx(()=>[a.createElementVNode("span",{title:m.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},a.toDisplayString(m.label),9,Lr)]),_:2},1032,["value"]),a.createVNode(r,{title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:a.withCtx(()=>[a.createVNode(n,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:a.withCtx(()=>{var A;return[a.createElementVNode("div",Mr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((A=Object.keys(m))==null?void 0:A.filter(_=>{var U;return(U=re.value)==null?void 0:U.find(C=>(C==null?void 0:C.value)===_)}),_=>{var U,C;return a.openBlock(),a.createElementBlock("div",{key:_},[a.createVNode(o,{"model-value":m==null?void 0:m[_],"active-text":(C=(U=re.value)==null?void 0:U.find(O=>(O==null?void 0:O.value)===_))==null?void 0:C.label,onChange:O=>Na(O,_,m)},null,8,["model-value","active-text","onChange"])])}),128))])]}),_:2},1024),a.createElementVNode("span",jr,[a.createVNode(n,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:a.withCtx(m=>{var A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe;return[nr(m)?(a.openBlock(),a.createBlock(r,{key:0,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:a.withCtx(()=>[a.createElementVNode("span",Kr,a.toDisplayString(De(m)),1)]),default:a.withCtx(()=>{var W;return[a.createElementVNode("div",$r,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m==null?void 0:m.row[(W=m==null?void 0:m.column)==null?void 0:W.prop],le=>(a.openBlock(),a.createElementBlock("div",Fr,[a.createElementVNode("div",{class:"prop-url",title:Sl(le),onClick:pe=>Ba(le)},a.toDisplayString(Sl(le)),9,Pr),a.createElementVNode("div",{class:"prop-download",onClick:pe=>Ua(le)}," 下载 ",8,Vr)]))),256))])]}),_:2},1024)):(a.openBlock(),a.createElementBlock("div",{key:1,style:a.normalizeStyle({color:!Array.isArray(De(m))&&((_=(A=De(m))==null?void 0:A.toString())!=null&&_.includes(".txt")||(C=(U=De(m))==null?void 0:U.toString())!=null&&C.includes(".cpt")||(T=(O=De(m))==null?void 0:O.toString())!=null&&T.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(De(m))&&((y=(N=De(m))==null?void 0:N.toString())!=null&&y.includes(".txt")||(u=(v=De(m))==null?void 0:v.toString())!=null&&u.includes(".cpt")||(d=(k=De(m))==null?void 0:k.toString())!=null&&d.includes(".cyd"))?"underline":"",cursor:!Array.isArray(De(m))&&((V=(M=De(m))==null?void 0:M.toString())!=null&&V.includes(".txt")||(Z=(I=De(m))==null?void 0:I.toString())!=null&&Z.includes(".cpt")||(oe=(H=De(m))==null?void 0:H.toString())!=null&&oe.includes(".cyd"))?"pointer":"",marginLeft:(m==null?void 0:m.colIndex)===0?`${((m==null?void 0:m.level)??0)*20}px`:0}),onClick:W=>ga(De(m))},a.toDisplayString(De(m)),13,zr))]}),_:2},[((s=He.value)==null?void 0:s.length)>0?{name:"actions",fn:a.withCtx(({item:m})=>[a.createVNode(r,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:a.withCtx(()=>[a.createVNode(n,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:a.withCtx(()=>[a.createElementVNode("div",_r,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(Oa(He.value,m),(A,_)=>(a.openBlock(),a.createElementBlock("div",{class:"menu-config-item",key:_,onClick:U=>Dl(A==null?void 0:A.label,m,{extra:A})},[a.createElementVNode("div",{style:a.normalizeStyle({color:A==null?void 0:A.textColor}),class:"extra-button-label"},a.toDisplayString(A==null?void 0:A.label),5)],8,xr))),128))])]),_:2},1024)]),key:"0"}:void 0,((E=Y.value)==null?void 0:E.length)>0?{name:"batchButton",fn:a.withCtx(m=>[a.createVNode(vr,{buttons:m.buttons,selectTableItems:Oe.value,onButtonClick:l[1]||(l[1]=A=>Dl(A,"",{}))},null,8,["buttons","selectTableItems"])]),key:"1"}:void 0]),1032,["pageObj","summaryInfo","columns","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection"])):a.createCommentVNode("",!0),a.createVNode(Be.ssDialog,{title:Ue.value,visible:je.value,width:pa.value,onBeforeDestroy:_a},{default:a.withCtx(()=>[a.createElementVNode("div",Jr,[a.createVNode(Be.ssForm,{rowContents:Je.value,isEnableWrap:!1,showOperator:!1,onChange:Qa,onClickTrigger:xa,isEdit:Nl.value,onBlurChange:Ea},null,8,["rowContents","isEdit"])])]),footer:a.withCtx(()=>[gl.value?(a.openBlock(),a.createElementBlock("div",Rr,[a.createVNode(t,{onClick:l[6]||(l[6]=m=>je.value=!1),id:"themeBorderButton"},{default:a.withCtx(()=>l[13]||(l[13]=[a.createTextVNode(a.toDisplayString("取消"))])),_:1,__:[13]}),a.createVNode(t,{class:"ok-button",onClick:l[7]||(l[7]=m=>tl(!0)),id:"themeButton"},{default:a.withCtx(()=>l[14]||(l[14]=[a.createTextVNode(a.toDisplayString("确认"))])),_:1,__:[14]})])):a.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),a.createVNode(Be.ssDialog,{title:Ue.value,visible:hl.value,width:_l.value,onBeforeDestroy:l[9]||(l[9]=m=>hl.value=!1)},{default:a.withCtx(()=>[a.createVNode(Dr)]),footer:a.withCtx(()=>[a.createElementVNode("div",qr,[a.createVNode(t,{onClick:l[8]||(l[8]=m=>hl.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:a.withCtx(()=>l[15]||(l[15]=[a.createTextVNode(a.toDisplayString("取消"))])),_:1,__:[15]}),a.createVNode(t,{class:"ok-button",onClick:Pa,id:"themeButton"},{default:a.withCtx(()=>l[16]||(l[16]=[a.createTextVNode(a.toDisplayString("确认"))])),_:1,__:[16]})])]),_:1},8,["title","visible","width"]),K.value?(a.openBlock(),a.createBlock(Be.ssFilePreview,{key:1,fileDataList:be.value,onDestroy:$a},null,8,["fileDataList"])):a.createCommentVNode("",!0),ye.value?(a.openBlock(),a.createBlock(Be.ssDialog,{key:2,visible:ye.value,onBeforeDestroy:Ga,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:a.withCtx(()=>[a.createVNode(Tl.threeViewerHost,{"file-urls":ol.value,isThreeScene:Ce.value,isSelfWindow:!0,threeData:Ge.value},null,8,["file-urls","isThreeScene","threeData"])]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createVNode(Be.ssDialog,{visible:e.componentVisible,onBeforeDestroy:l[10]||(l[10]=m=>e.componentVisible=!1),width:_l.value,style:{height:"70vh"}},{default:a.withCtx(()=>[a.createVNode(c,{dialogItem:ml.value},null,8,["dialogItem"])]),_:1},8,["visible","width"])])}}},Gr=Cl._export_sfc(Wr,[["__scopeId","data-v-d67189eb"]]);exports.formGetOptions=$l;exports.getSelectRow=Pl;exports.isString=Kl;exports.ssTable=Gr;exports.useFormComp=ia;exports.useFormToTableComp=la;exports.useTableComp=sa;exports.useUnit=aa;
|
|
1
|
+
"use strict";const a=require("vue"),S=require("./index-1z9RrjZc.cjs"),jl=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C04VBW2K.cjs"),Be=require("./index-D2lGI0Ui.cjs"),Tl=require("./threeViewerHost-CcEI-qHT.cjs"),te=require("./index.vue_vue_type_style_index_1_lang-CllbOzlH.cjs"),al=require("./xlsx-BPHygxEf.cjs");require("./index.vue_vue_type_style_index_1_lang-DzrkAaH7.cjs");const Cl=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");require("./STLLoader-Ck442nWz.cjs");require("./index-Chs0dEFu.cjs");var or="[object String]";function Kl(L){return typeof L=="string"||!S.isArray(L)&&S.isObjectLike(L)&&S.baseGetTag(L)==or}const $l=L=>L.match(/\((.*)\)/)[1],sr={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(L){const Q=L,q=a.ref(null),$=a.ref(!1),B=a.ref(null);return a.watch(()=>Q==null?void 0:Q.isVisible,()=>{$.value=Q==null?void 0:Q.isVisible},{deep:!0,immediate:!0}),a.watch(()=>B.value,()=>{a.nextTick(()=>{var h,re;(re=(h=q.value)==null?void 0:h.updatePopper)==null||re.call(h)})},{deep:!0,immediate:!0}),(h,re)=>{const he=a.resolveComponent("el-popover");return a.openBlock(),a.createBlock(he,{visible:$.value,title:Q==null?void 0:Q.title,placement:Q==null?void 0:Q.placement,width:Q==null?void 0:Q.width,ref_key:"popOverRef",ref:q},{reference:a.withCtx(()=>[a.createElementVNode("div",null,[a.renderSlot(h.$slots,"reference",{ref_key:"referenceRef",ref:B})])]),default:a.withCtx(()=>[a.createElementVNode("div",null,[a.renderSlot(h.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},ir={class:"extra-button-content"},ur={class:"table-operator-wrap"},tr={class:"extra-button-filter"},cr={key:0,class:"extra-header"},dr={class:"drop-menu",style:{width:"120px"}},pr={key:0},fr={key:1},hr={__name:"header",props:{compName:{type:String,default:"表格名称",required:!1},isDevMode:Boolean,selectNums:Number,dataNums:Number,buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter","getImportData"],setup(L,{emit:Q}){const q=Q,$=L,B=a.ref(""),h=a.ref(!1),re=a.ref([]),he=a.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),Te=G=>{const P=G.raw;if(!P)return;const j=new FileReader;j.onload=se=>{try{const ye=new Uint8Array(se.target.result),Ce=al.readSync(ye,{type:"array"}),Ge=Ce.SheetNames[0],Me=Ce.Sheets[Ge],K=[],be=[];for(const ze in Me){if(ze[0]==="!")continue;const{r:ge,c:Al}=al.utils.decode_cell(ze),dl=Me[ze].v;ge===0?K[Al]=dl:(be[ge-1]||(be[ge-1]={}),be[ge-1][`col_${Al}`]=dl)}const ue=be==null?void 0:be[0];if(!(ue!=null&&ue.hasOwnProperty("col_0")))return S.ElMessage.error("导入的数据列不匹配,请检查是否错位");q("getImportData",K,be)}catch(ye){throw S.ElMessage.error(ye.message),new Error(ye.message)}},j.readAsArrayBuffer(P)},R=G=>{var j;const P=(j=re.value)==null?void 0:j.reduce((se,ye,Ce)=>(Ce===0?se[ye.label]=G:se[ye.label]=ye==null?void 0:ye.value,se),{});q("filter",P,G,!0)},Ne=G=>{q("buttonClick",G)},Pe=G=>{var P,j;re.value=(j=(P=te.getColumnChild(S.cloneDeep(G)))==null?void 0:P.filter(se=>(se==null?void 0:se.label)!==""&&(se==null?void 0:se.label)!=="操作"))==null?void 0:j.map(se=>({label:(se==null?void 0:se.label)??"",value:"",name:(se==null?void 0:se.label)??"",isFormColHidden:se==null?void 0:se.isTableColHidden,width:2}))},ve=a.ref(!1),Ve=G=>{var P;if((G==null?void 0:G.buttonName)==="确认"&&(q("filter",G==null?void 0:G.content),ve.value=(G==null?void 0:G.content)&&Object.values(G==null?void 0:G.content).length>0),(G==null?void 0:G.buttonName)==="清空"){const j=S.cloneDeep(G==null?void 0:G.content);for(const se in j)j[se]="";re.value=(P=re.value)==null?void 0:P.map(se=>({...se,value:""})),q("filter",j),ve.value=!1}h.value=!1};return a.onMounted(()=>{Pe($.columns)}),a.watch(()=>$.columns,()=>{Pe($.columns)},{deep:!0,immediate:!0}),(G,P)=>{var Ge,Me;const j=a.resolveComponent("svg-icon"),se=a.resolveComponent("el-input"),ye=a.resolveComponent("el-button"),Ce=a.resolveComponent("el-upload");return a.openBlock(),a.createElementBlock("div",ir,[a.createElementVNode("div",{class:a.normalizeClass(L.compName?"table-name-wrap":"")},a.toDisplayString(L.compName),3),a.createElementVNode("div",ur,[a.createElementVNode("div",tr,[a.createVNode(sr,{title:"",width:800,placement:"bottom-start",isVisible:h.value},{reference:a.withCtx(()=>{var K;return[a.createVNode(se,{modelValue:B.value,"onUpdate:modelValue":P[1]||(P[1]=be=>B.value=be),style:{"min-width":"80px"},placeholder:ve.value?"存在搜索条件...":"搜索","prefix-icon":a.unref(S.search_default),clearable:"",onInput:R,disabled:((K=re.value)==null?void 0:K.length)===0},{append:a.withCtx(()=>[a.createElementVNode("span",{title:"条件查询",onClick:P[0]||(P[0]=be=>h.value=!h.value)},[a.createVNode(j,{name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","placeholder","prefix-icon","disabled"])]}),content:a.withCtx(()=>[a.createElementVNode("div",{class:"form-content-value",onMouseleave:P[2]||(P[2]=K=>h.value=!1)},[(a.openBlock(),a.createBlock(Be.ssForm,{rowContents:re.value,buttonValue:he.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:he.value,isStartJustify:!1,onOnButtonClick:Ve},null,8,["rowContents","buttonValue"]))],32)]),_:1},8,["isVisible"])]),L.buttons&&((Ge=L.buttons)==null?void 0:Ge.length)>0?(a.openBlock(),a.createElementBlock("div",cr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((Me=L.buttons)==null?void 0:Me.filter(K=>L.isDevMode||(K==null?void 0:K.label)!=="修改模板"),(K,be)=>(a.openBlock(),a.createElementBlock("div",{class:"extra-contents",key:be},[(K==null?void 0:K.type)==="upload"?(a.openBlock(),a.createBlock(Ce,{key:0,class:"upload-button-wrap","on-change":Te,accept:".xlsx,.xls","auto-upload":!1,action:"#","show-file-list":!1},{default:a.withCtx(()=>[a.createVNode(ye,{style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"})},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style"])]),_:2},1024)):a.createCommentVNode("",!0),(K==null?void 0:K.type)==="popover"?(a.openBlock(),a.createBlock(Be._sfc_main,{key:1},{dropTitle:a.withCtx(()=>[(K==null?void 0:K.type)==="popover"?(a.openBlock(),a.createBlock(ye,{key:0,style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"})},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style"])):a.createCommentVNode("",!0)]),dropMenu:a.withCtx(()=>[a.createElementVNode("div",dr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K==null?void 0:K.contents,ue=>(a.openBlock(),a.createBlock(ye,{key:ue==null?void 0:ue.label,style:{width:"100%",margin:"0",border:"none",display:"flex","justify-content":"flex-start"},onClick:ze=>Ne(ue==null?void 0:ue.label)},{default:a.withCtx(()=>{var ze,ge;return[a.createTextVNode(a.toDisplayString(ue==null?void 0:ue.label),1),(ze=ue==null?void 0:ue.label)!=null&&ze.includes("选中")?(a.openBlock(),a.createElementBlock("span",pr,"("+a.toDisplayString(L.selectNums)+")",1)):a.createCommentVNode("",!0),(ge=ue==null?void 0:ue.label)!=null&&ge.includes("全部")?(a.openBlock(),a.createElementBlock("span",fr,"("+a.toDisplayString(L.dataNums)+")",1)):a.createCommentVNode("",!0)]}),_:2},1032,["onClick"]))),128))])]),_:2},1024)):a.createCommentVNode("",!0),K!=null&&K.type?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(ye,{key:2,id:"themeButton",style:a.normalizeStyle({background:(K==null?void 0:K.background)??"var(--ssbutton-theme-bg)",color:(K==null?void 0:K.color)??"var(--ssbutton-theme-color)"}),onClick:ue=>Ne(K==null?void 0:K.label)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(K==null?void 0:K.label),1)]),_:2},1032,["style","onClick"]))]))),128))])):a.createCommentVNode("",!0)])])}}},gr=Cl._export_sfc(hr,[["__scopeId","data-v-2032e071"]]),yr=a.defineComponent({__name:"batch",props:{buttons:{type:Array,default:()=>[]},selectTableItems:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(L,{emit:Q}){const q=L,$=Q,B=re=>{$("buttonClick",re)},h=re=>{var he;return re!=null&&re.includes("删除")?((he=q.selectTableItems)==null?void 0:he.length)>0?"warning-active-type":"warning-type":"default-type"};return(re,he)=>{const Te=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(L.buttons,R=>(a.openBlock(),a.createBlock(Te,{key:R==null?void 0:R.label,class:a.normalizeClass(h(R==null?void 0:R.label)),onClick:Ne=>B(R==null?void 0:R.label)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(R==null?void 0:R.label),1)]),_:2},1032,["class","onClick"]))),128))])}}}),vr=Cl._export_sfc(yr,[["__scopeId","data-v-1d3c11ad"]]),la=S.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(L){this.selectArray=L},setSelectString(L){this.selectString=L}}}),br={class:"calculator-content"},mr={class:"calculator-child"},kr={class:"calculator-child"},Sr=a.defineComponent({__name:"calculator",setup(L){const Q=a.ref(),q=a.ref();return a.onMounted(()=>{Q.value=[{type:"Upload",label:"输入",name:"input"}],q.value=[{type:"Upload",label:"输出",name:"output"}]}),($,B)=>(a.openBlock(),a.createElementBlock("div",br,[a.createElementVNode("div",mr,[a.createVNode(Be.ssForm,{rowContents:Q.value,isRowFlex:!0},null,8,["rowContents"])]),a.createElementVNode("div",kr,[a.createVNode(Be.ssForm,{rowContents:q.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),Dr=Cl._export_sfc(Sr,[["__scopeId","data-v-73db0fe7"]]),aa=S.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(L){this.selectIndex=L},setSelectMenu(L){this.selectMenu=L},setSelectTitle(L){this.selectTitle=L}}}),Fl=(L,Q)=>{let q=L,$=Q;return Array.isArray(q)&&(q=q==null?void 0:q.map((B,h)=>{if(Array.isArray(B)){let re={};return B=B==null?void 0:B.forEach((he,Te)=>{var R;(R=$==null?void 0:$[Te])!=null&&R.prop?re[$[Te].prop]=he:Array.isArray(he)&&(re.children=Fl(he,$))}),Object.assign(re,{id:h})}else return B})),q},ra=(L,Q,q)=>{let $=L,B=Q;return $=$==null?void 0:$.map((h,re)=>{var he,Te;return!Array.isArray(h)||!((he=B==null?void 0:B[re])!=null&&he.label)&&!q||(h.unshift(((Te=B==null?void 0:B[re])==null?void 0:Te.label)??""),h.some(R=>Array.isArray(R))&&(h=h==null?void 0:h.map(R=>{var Ne;return Array.isArray(R)&&(R=ra(R,(Ne=B==null?void 0:B[re])==null?void 0:Ne.children,q)),R}))),h}),$},Tr=(L,Q,q)=>{if(Q==="")return L==null?void 0:L.filter($=>($==null?void 0:$.id)!==q);{const $=Q.split("-");return Cr(L,$,q)}},Cr=(L,Q,q)=>{let $=L,B=Q;return(B==null?void 0:B.length)===0?$=$==null?void 0:$.filter(h=>h.id!==q):$=$==null?void 0:$.map(h=>(h.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),h=na(h,B,q)),h)),$},na=(L,Q,q)=>{var h,re;let $=L,B=Q;return(B==null?void 0:B.length)===0?$.children=(h=$.children)==null?void 0:h.filter(he=>he.id!==q):$.children=(re=$.children)==null?void 0:re.map(he=>(he.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),he=na(he,B,q)),he)),$},Ar=(L,Q,q)=>{if(Q==="")return q;{const $=Q.split("-");return Er(L,$,q)}},Er=(L,Q,q)=>{let $=L,B=Q;return(B==null?void 0:B.length)===0?$=q:$=$==null?void 0:$.map(h=>(h.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),h=oa(h,B,q)),h)),$},oa=(L,Q,q)=>{var h;let $=L,B=Q;return(B==null?void 0:B.length)===0?$.children=q:$.children=(h=$.children)==null?void 0:h.map(re=>(re.id.toString()===(B==null?void 0:B[0])&&(B==null||B.shift(),re=oa(re,B,q)),re)),$},sa=S.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(L){this.tableIndex=L},setTableShowThree(L){this.tableShowThree=L}}}),ia=S.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(L){this.objUrl=L},setBlobUrls(L){this.blobUrls=L}}}),Pl=async L=>{var h,re,he,Te,R,Ne,Pe;let Q=(re=(h=S.cloneDeep(L))==null?void 0:h.optionUrl)==null?void 0:re.menuSelect,q=[];Q==null||Q.forEach(ve=>{});let $="";const B=await te.menuToParent(Q);if(B==null||B.forEach(ve=>{var Ve,G,P,j;(ve==null?void 0:ve.name)===(((j=(P=(G=(Ve=S.cloneDeep(L))==null?void 0:Ve.optionUrl)==null?void 0:G.groupSelect)==null?void 0:P[0])==null?void 0:j.replaceAll("'",""))??"")&&($=ve==null?void 0:ve.id)}),$!==""){const ve=(he=B==null?void 0:B.find(P=>{var j,se,ye,Ce;return(P==null?void 0:P.name)===(((se=(j=L==null?void 0:L.groupSelect)==null?void 0:j.split(":"))==null?void 0:se[0])||((Ce=(ye=L==null?void 0:L.optionUrl)==null?void 0:ye.groupSelect)==null?void 0:Ce[0]))}))==null?void 0:he.compData;let Ve=(R=(Te=ve==null?void 0:ve.find(P=>(P==null?void 0:P.key)==="header"))==null?void 0:Te.contents)==null?void 0:R.map(P=>P==null?void 0:P.label),G=(Pe=(Ne=ve==null?void 0:ve.find(P=>(P==null?void 0:P.key)==="tableContents"))==null?void 0:Ne.contents)==null?void 0:Pe.map(P=>(P=P==null?void 0:P.filter(j=>!(j!=null&&j.id)),P));G==null||G.forEach(P=>{q.push(te.getValueToObjectValue(P,Ve))})}return q},Nr={class:"table-content"},_r={class:"menu-config-wrap"},xr=["onClick"],Br={key:0,class:"viewport-wrap"},Ur=["onClick"],Or={title:"选择显示列信息"},wr={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","min-height":"200px",width:"400px",overflow:"auto",position:"relative"}},Lr=["title"],Mr={class:"col-operate-wrap"},jr={title:"拖拽排序列",style:{cursor:"move",color:"grey",position:"absolute",right:"15px"}},Kr={class:"pop-view"},$r={class:"pop-wrapper"},Fr={class:"file-list-pop"},Pr=["title","onClick"],Vr=["onClick"],zr=["onClick"],Jr={class:"form-content"},Rr={key:0,class:"dialog-footer"},qr={class:"dialog-footer"},Wr={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},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:!0},allowOperate:{type:Boolean,default:!0},allMapContents:{type:Object,default:()=>{}}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick","routeUrl"],setup(L,{emit:Q}){const q=a.ref([]),$=ia(S.pinia),B=a.ref(null),h=L,re=a.ref([{label:"排序",value:"sortable",checked:!1},{label:"筛选",value:"filterable",checked:!1},{label:"合计",value:"showSummary",checked:!1},{label:"编辑",value:"operable",checked:!1}]),he=te.useOriginalState(S.pinia),{originalPath:Te}=S.storeToRefs(he),R=Te.value,Ne=a.ref(!1),Pe=a.ref(!1),ve=a.ref(!1),Ve=a.reactive({column:{},status:!1,text:"合计"}),G=a.reactive({currentPage:1,pageSize:10,total:0,pageSizes:[5,10,20,50,100]}),P=Q,j=a.ref([]),se=a.ref([]),ye=a.ref(!1),Ce=a.ref(!1),Ge=a.ref(null),Me=a.ref([]),K=a.ref(!1),be=a.ref(),ue=te.useMenuState(),{importLoading:ze,activeMenuPath:ge,contentLoading:Al}=S.storeToRefs(ue),dl=sa(S.pinia),me=te.useModelComp(S.pinia),{extraContents:ne,cacheUpdatingData:rl,tableViewContents:nl,tableLoading:Hr,pageMapState:El}=S.storeToRefs(me),Y=a.ref([]),pl=a.ref([]),fl=a.ref(new Map);a.ref(!1);const Le=a.ref("");a.ref();const Nl=a.ref(!0),Ie=a.ref(0),Vl=a.ref(!0),Ue=a.ref(""),je=a.ref(!1),ua=a.ref({label:"查看三维模型"}),hl=a.ref(!1),_l=a.ref(),_e=a.ref([]),He=a.ref([]),gl=a.ref(!1),ol=a.ref([]),el=a.ref([]),Xe=a.ref([]),Je=a.ref([]),xe=a.ref(),Se=a.ref(),ta=la(S.pinia),yl=a.ref(),xl=a.ref(0),vl=aa(S.pinia),{selectIndex:ca,selectMenu:Ke,selectTitle:Bl}=S.storeToRefs(vl),{selectString:$e}=S.storeToRefs(ta),da=S.useLoginState(S.pinia),{loginUserInfo:ce}=S.storeToRefs(da),pa=a.ref(720),Qe=a.ref(!1),bl=a.ref(!1),Oe=a.ref([]),Ye=a.ref(),sl=a.ref(!0),zl=a.ref(!0),ml=a.ref([]),fa=a.inject("contentRef");a.provide("contentRef",fa),a.watch(()=>{var e;return(e=Y.value)==null?void 0:e.length},e=>{G.total=e}),a.watch(()=>nl.value,async()=>{var i,p,t,c,f,s,E,m,A,_,U,C,O,T,N,y,v,u;if(((i=nl.value)==null?void 0:i.length)===0||!((p=h==null?void 0:h.itemData)!=null&&p.find(k=>(k==null?void 0:k.key)==="columnPath"))||!((t=h==null?void 0:h.itemData)!=null&&t.find(k=>(k==null?void 0:k.key)==="pageColumn")))return;let e=(A=(m=(E=(s=(f=(c=h==null?void 0:h.itemData)==null?void 0:c.find(k=>(k==null?void 0:k.key)==="pageColumn"))==null?void 0:f.contents)==null?void 0:s.split("["))==null?void 0:E[1])==null?void 0:m.split("]"))==null?void 0:A[0],l=((O=(C=(U=(_=h==null?void 0:h.itemData)==null?void 0:_.find(k=>(k==null?void 0:k.key)==="pageColumn"))==null?void 0:U.contents)==null?void 0:C.split("["))==null?void 0:O[0])+((N=(T=nl.value)==null?void 0:T.find(k=>(k==null?void 0:k.key)===e))==null?void 0:N.value),n=((v=(y=h==null?void 0:h.itemData)==null?void 0:y.find(k=>(k==null?void 0:k.key)==="pageGroup"))==null?void 0:v.contents)??"",r=await te.getItemData(l,sessionStorage.getItem("systemKey"),""),o=(u=r==null?void 0:r.find(k=>(k==null?void 0:k.name)===(n===""?h==null?void 0:h.compName:n)))==null?void 0:u.compData;Il(o,h.allMapContents)},{deep:!0});const ha=async(e,l)=>{var n;try{console.log("generateTableWithImport",e,l,ge.value,h.index);const r={type:"data",pageKey:ge.value,tableId:h.index,systemKey:sessionStorage.getItem("systemKey")},o=l==null?void 0:l.map(t=>{const c=Object.keys(t),f={};return c.forEach((s,E)=>{f[e[E]]=t[s]}),f}),i=o==null?void 0:o.map(t=>({key:r,value:{tableData:t}})),p=await S.batchAddInsofDataApi({dataList:i});((n=p==null?void 0:p.data)==null?void 0:n.code)===200?(me.setRefreshCurStructure(!0),S.ElMessage.success("导入数据成功")):S.ElMessage.error("导入数据响应失败")}catch(r){throw S.ElMessage.error("导入数据处理失败"),new Error(r)}},ga=async e=>{var l,n;if(e!=null&&e.includes(".txt")||e!=null&&e.includes(".cpt")||e!=null&&e.includes(".cyd")){const r=await S.axios.get(e,{responseType:"blob",headers:{"Content-Type":"application/json"}}),o=new Blob([r.data],{type:"application/octet-stream;charset=UTF-8"});let i=URL.createObjectURL(o);be.value=[{name:(n=e==null?void 0:e.split("/"))==null?void 0:n[((l=e==null?void 0:e.split("/"))==null?void 0:l.length)-1],blobUrl:i}],K.value=!0}};a.onBeforeUnmount(()=>{zl.value=!1;let e=xl.value;xl.value=e+1});const ya=a.computed(()=>{var n;const e=(G.currentPage-1)*G.pageSize,l=e+G.pageSize;return(n=Y.value)==null?void 0:n.slice(e,l)}),va=e=>{G.currentPage=e},ba=e=>{var l;G.pageSize=e,e*G.currentPage>((l=Y.value)==null?void 0:l.length)&&(G.currentPage=1,S.ElMessage.warning("分页无效,返回第一页"))},ma=(e,l)=>{var p,t;const n=(t=(p=j.value)==null?void 0:p.map(c=>c==null?void 0:c.prop))==null?void 0:t.filter(c=>c!=="operate");let r;const o=(e==null?void 0:e.length)===(n==null?void 0:n.length);if(e!=null&&e.includes("序号"))return S.ElMessage.error("导入的数据不需要包含序号列");if(r=o?e:e.slice(0,n==null?void 0:n.length),!(r==null?void 0:r.every(c=>n==null?void 0:n.find(f=>c===f))))return S.ElMessage.error("导入的数据表头不匹配");ha(r,l)},ka=(e,l)=>{var n;me.setRefreshCurStructure(!1),((n=j.value)==null?void 0:n.length)===0||ma(e,l)},Sa=(e,l,n,r)=>{const o=[],i=[],p=f=>Object.keys(f).length;for(const f in e)if(e[f]!==void 0){const s=e[f],E=[];for(const[m,A]of Object.entries(s))E.push(A),i.length<p(s)&&i.push(m);o.push(E)}o.unshift(i);const t=al.utils.aoa_to_sheet(o),c=al.utils.book_new();al.utils.book_append_sheet(c,t,r),al.writeFileSync(c,`${l}.xlsx`),Oe.value=[]},kl=async(e,l,n,r=!1,o)=>{var i,p,t,c,f,s,E,m;try{me.setRefreshCurStructure(!1);const A=await S.getInsofDataApi({id:h==null?void 0:h.index});if(((i=A==null?void 0:A.data)==null?void 0:i.code)===200){let _=(f=(c=(t=(p=A==null?void 0:A.data)==null?void 0:p.result)==null?void 0:t[0])==null?void 0:c.value)==null?void 0:f.pageData;r?_={..._,compData:(E=_==null?void 0:_.compData)==null?void 0:E.map(C=>{var O;return(C==null?void 0:C.key)==="header"?{...C,contents:(O=C==null?void 0:C.contents)==null?void 0:O.map(T=>({...T,[e]:n}))}:C})}:_={..._,compData:(s=_==null?void 0:_.compData)==null?void 0:s.map(C=>{var O,T;return(C==null?void 0:C.key)==="header"?{...C,contents:(O=C==null?void 0:C.contents)==null?void 0:O.map(N=>(N==null?void 0:N.prop)===(l==null?void 0:l.prop)?{...N,[e]:n}:N)}:(C==null?void 0:C.key)==="tableToForm"&&o?{...C,contents:(T=C==null?void 0:C.contents)==null?void 0:T.map(N=>(N==null?void 0:N.prop)===(l==null?void 0:l.prop)?{...N,[o]:n}:N)}:C})};const U=await S.updateInsofDataApi({id:h==null?void 0:h.index,value:{pageData:_}});((m=U==null?void 0:U.data)==null?void 0:m.code)===200?(S.ElMessage.success("编辑成功"),me.setRefreshCurStructure(!0)):S.ElMessage.error("编辑响应失败")}}catch(A){S.ElMessage.error(A)}},Da=async(e,l)=>{await kl("label",l,e)},Ta=async(e,l)=>{await kl("columnType",l,e,!1,"type")},Ca=()=>{rl.value?Qe.value=!1:ea()},Aa=e=>{Oe.value=e},Ea=(e,l)=>{Ye.value===l?sl.value=!1:sl.value=!0,Ye.value=l==null?void 0:l.changeProp},il=a.computed(()=>{var n,r,o;const e=(n=j.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"),(o=(r=j.value)==null?void 0:r.filter(i=>(i==null?void 0:i.label)!=="操作"))==null?void 0:o.map(i=>({...i,filterable:!!(i!=null&&i.filterable),showSummary:!!(i!=null&&i.showSummary),operable:!!(i!=null&&i.operable)}))}),Na=async(e,l,n)=>{const r=S.cloneDeep(j.value);await a.nextTick(),j.value=r==null?void 0:r.map(o=>(n==null?void 0:n.label)===(o==null?void 0:o.label)?{...o,[l]:e}:o),await kl(l,n,e)},Ul=async(e,l)=>{await kl(l,null,e,!0)},_a=()=>{je.value=!1},xa=e=>{P("clickTrigger",e)},Jl=async e=>{var i,p,t,c,f,s,E,m,A,_,U,C,O,T,N;const l=e==null?void 0:e.row,n=e==null?void 0:e.rowData,r=e==null?void 0:e.suffix;if((i=l==null?void 0:l.toString())!=null&&i.includes(".urdf")||e!=null&&e.isUrdf||r!=null&&r.includes(".urdf")){if(l.includes(",")){S.ElMessage.error("当前版本仅允许单个urdf预览!");return}ol.value=[l],Ce.value=!0,Ge.value={data:S.cloneDeep(n)},ye.value=!0;return}let o=[];if((p=l==null?void 0:l.toString())!=null&&p.includes(".stl")||(t=l==null?void 0:l.toString())!=null&&t.includes(".STL")||(c=l==null?void 0:l.toString())!=null&&c.includes(".obj")||(f=l==null?void 0:l.toString())!=null&&f.includes(".mtl")){ol.value=(s=l==null?void 0:l.toString())==null?void 0:s.split(","),Ce.value=!1,ye.value=!0;return}if((E=l==null?void 0:l.toString())!=null&&E.includes(".stl")||(m=l==null?void 0:l.toString())!=null&&m.includes(".STL")||(A=l==null?void 0:l.toString())!=null&&A.includes(".obj")||(_=l==null?void 0:l.toString())!=null&&_.includes(".mtl")||r!=null&&r.includes(".stl")||r!=null&&r.includes(".STL")||r!=null&&r.includes(".obj")||r!=null&&r.includes(".mtl")){let y,v=[],u={};if(Array.isArray(l)?y=l:y=l==null?void 0:l.split(","),y==null||y.forEach(k=>{k.includes(".mtl")?v.push(k):u.blob=u.blob?u.blob+","+k:k}),(v==null?void 0:v.length)>0&&(u.mtlBlobs=v),r&&(u.suffix=r),(C=(U=Object.values(u))==null?void 0:U[0])!=null&&C.includes("http:"))o.push(u);else{const k=new Blob([u.blob],{type:"application/octet-stream;charset=UTF-8"});let d=URL.createObjectURL(k),M="";(O=l==null?void 0:l.split("/"))==null||O.forEach((V,I)=>{var Z;I===((Z=l==null?void 0:l.split("/"))==null?void 0:Z.length)-1&&(M=V)}),(T=u.blob)!=null&&T.includes(".stl")&&(M=(M==null?void 0:M.replaceAll(">",""))+".urdf"),be.value=[{name:M,blobUrl:d}],K.value=!0}}else{const y=await S.axios.get(l,{responseType:"blob",headers:{"Content-Type":"application/json"}}),v=new Blob([y.data],{type:"application/octet-stream;charset=UTF-8"});let u=URL.createObjectURL(v),k="";(N=l==null?void 0:l.split("/"))==null||N.forEach((d,M)=>{var V;M===((V=l==null?void 0:l.split("/"))==null?void 0:V.length)-1&&(k=d)}),be.value=[{name:k,blobUrl:u}],K.value=!0}(o==null?void 0:o.length)>0&&$.setBlobUrls(o)},Sl=e=>{var r,o,i,p;if(e!=null&&e.downloadUrl)return e==null?void 0:e.name;const l=(p=(r=e==null?void 0:e.url)==null?void 0:r.split("."))==null?void 0:p[((i=(o=e==null?void 0:e.url)==null?void 0:o.split("."))==null?void 0:i.length)-1];return(e==null?void 0:e.name)+"."+l},Ba=async e=>{let l=null,n=null,r=null;if(e!=null&&e.downloadUrl){const i=await Ol(),p=Be.ElLoading.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.7)"}),t=await S.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(()=>{p.close()}),c=new Blob([t.data],{type:"application/octet-stream;charset=UTF-8"});l=URL.createObjectURL(c),n=e==null?void 0:e.name;const f=n==null?void 0:n.lastIndexOf(".");r=n==null?void 0:n.slice(f)}else{const i=await Tl.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")?(l=URL.createObjectURL(i.data),n=Sl(e)):l=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:`${l}`,suffix:r};Jl(i);return}const o={name:n,blobUrl:l};be.value=[o],K.value=!0},Ua=async e=>{let l=null,n=null;if(e!=null&&e.downloadUrl){const i=await Ol(),p=await S.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"}}),t=new Blob([p.data],{type:"application/octet-stream;charset=UTF-8"});l=URL.createObjectURL(t),n=e==null?void 0:e.name}else{const i=await Tl.downloadAvatarApi({url:e==null?void 0:e.url});l=URL.createObjectURL(i.data),n=Sl(e)}const r={name:n,blobUrl:l},o=document.createElement("a");o.href=r.blobUrl,o.download=r.name,o.style.display="none",document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o)},100)},Oa=(e,l)=>{if(Object.values(l).length!==0)return Object.values(l).find(n=>{var r,o,i;return((r=n==null?void 0:n.toString())==null?void 0:r.includes(".txt"))||((o=n==null?void 0:n.toString())==null?void 0:o.includes(".cpt"))||((i=n==null?void 0:n.toString())==null?void 0:i.includes(".obj"))})?[...e,ua.value]:e},wa=e=>{var o;$e.value===""?e==null||e[0]:(e==null?void 0:e.find(i=>(i==null?void 0:i.selectLabel)==="("+$e.value+")"))??(e==null||e.find(i=>!(i!=null&&i.selectLabel)));let l=e;(o=j.value)!=null&&o.find(i=>i.prop==="index");let n=xe.value;const r=[];return l==null||l.forEach((i,p)=>{var c;let t={};if(Array.isArray(i)){let f=[];i==null||i.filter(s=>!(s!=null&&s.id)).forEach((s,E)=>{var m,A,_,U,C;if((m=n==null?void 0:n[E])!=null&&m.prop&&!Array.isArray(s)){let O={};O[n[E].column]=s,ne!=null&&ne.value&&((A=ne==null?void 0:ne.value)==null?void 0:A.length)>0&&((_=ne==null?void 0:ne.value)!=null&&_.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(O)))&&(f=(U=ne==null?void 0:ne.value)==null?void 0:U.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(O))),f&&f.length>0?t[n[E].prop]=f!=null&&f.find(T=>{var N;return((N=Object.keys(T))==null?void 0:N[0])===n[E].column})?(C=f==null?void 0:f.find(T=>{var N;return((N=Object.keys(T))==null?void 0:N[0])===n[E].column}))==null?void 0:C[n[E].column]:s:t[n[E].prop]=s}})}else t=i;Array.isArray(i)&&i.some(f=>f==null?void 0:f.id)?r.push(Object.assign(t,{id:(c=i==null?void 0:i.find(f=>f.id))==null?void 0:c.id})):t.id?r.push(t):r.push(Object.assign(t,{id:p}))}),r},La=(e,l={})=>[...e==null?void 0:e.values()].filter(n=>Object.keys(l).every(r=>{var p;const o=n[r],i=(p=l[r])==null?void 0:p.toLowerCase();return i&&o&&typeof o=="string"?o.toLowerCase().includes(i):!0})),Ma=async(e,l,n=!1)=>{var p,t,c,f,s,E,m,A,_,U,C;if(e&&((p=Object.values(e))!=null&&p.every(O=>!O)))return Y.value=pl.value;let r={};for(let O in e)e[O]!==""&&(r["tableData."+O]=e[O]);if(n){Y.value=[...fl.value.values()].filter(O=>Object.values(O).some(T=>typeof T=="string"?T==null?void 0:T.toLowerCase().includes(l==null?void 0:l.toLowerCase()):!1));return}let o;if(((t=Y.value)==null?void 0:t.length)>0&&typeof((f=(c=Y.value)==null?void 0:c[0])==null?void 0:f.id)=="string"){Y.value=La(fl.value,e);return}else o=await te.filterContents({type:"data",tableId:h==null?void 0:h.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:ge.value},r);if(((E=(s=o==null?void 0:o.data)==null?void 0:s.result)==null?void 0:E.length)===0)return Y.value=[];const i=(_=(A=(m=S.cloneDeep(o))==null?void 0:m.data)==null?void 0:A.result)==null?void 0:_.map(O=>{var N;let T=[];return T.push({id:O.id}),T.push((N=O==null?void 0:O.value)==null?void 0:N.tableData),T});Y.value=wa(te.getTableContents(i,(C=(U=S.cloneDeep(j.value))==null?void 0:U.map(O=>O.label))==null?void 0:C.filter(O=>O!=="操作")))},ja=async e=>{var p,t,c,f,s,E,m,A,_,U,C,O,T,N,y;const l=await S.getInsofDataApi({keyLikes:{pageKey:`loading${((p=ce.value)==null?void 0:p.account)||((t=ce.value)==null?void 0:t.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),n=await S.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((c=ce.value)==null?void 0:c.account)||((f=ce.value)==null?void 0:f.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});let r=(E=(s=l==null?void 0:l.data)==null?void 0:s.result)==null?void 0:E.map(v=>v==null?void 0:v.id);const o=(A=(m=n==null?void 0:n.data)==null?void 0:m.result)==null?void 0:A.map(v=>v==null?void 0:v.id);r=[...S.cloneDeep(r),...o],(r==null?void 0:r.length)>0&&(r!=null&&r.every(v=>v!==null&&v))&&await S.batchDeleteInsofDataApi({ids:r});let i=await te.getItemData(ge.value,sessionStorage.getItem("systemKey"),e.id);if(i=i==null?void 0:i.filter(v=>v.comp!=="methodButton"),i&&i.length>0){const v=!Array.isArray(Bl.value)&&((_=Bl.value)==null?void 0:_.key)!=="main"?[]:Bl.value;v.push({key:Ke.value===""?(U=e==null?void 0:e.id)==null?void 0:U.toString():Ke.value+"-"+((C=e==null?void 0:e.id)==null?void 0:C.toString()),value:e[(O=Object.keys(e))==null?void 0:O.filter(u=>u!=="index"&&u!=="id")[0]]}),vl.setSelectMenu(Ke.value===""?(T=e==null?void 0:e.id)==null?void 0:T.toString():Ke.value+"-"+((N=e==null?void 0:e.id)==null?void 0:N.toString())),vl.setSelectTitle(v),vl.setSelectIndex((y=e==null?void 0:e.id)==null?void 0:y.toString()),P("pageChange",i)}},Ka=async(e,l,n,r)=>{var f,s,E,m,A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x;const o=await S.getInsofDataApi({keyLikes:{pageKey:`loading${((f=ce.value)==null?void 0:f.account)||((s=ce.value)==null?void 0:s.账号)}`,systemKey:sessionStorage.getItem("systemKey")}}),i=await S.getInsofDataApi({keyLikes:{pageKey:`updateLoading${((E=ce.value)==null?void 0:E.account)||((m=ce.value)==null?void 0:m.账号)}`,systemKey:sessionStorage.getItem("systemKey")}});if((r==null?void 0:r.isExistChild)===!0){let F=(_=(A=j.value)==null?void 0:A.find(w=>(w==null?void 0:w.isMainKey)===!0))==null?void 0:_.prop,fe=(U=r==null?void 0:r.rowContent)==null?void 0:U[F],J=(O=(C=r==null?void 0:r.columnType)==null?void 0:C.childPath)==null?void 0:O.split(R),D=[];J==null||J.forEach((w,z)=>{(J==null?void 0:J.length)-1===z&&D.push(fe),D.push(w)}),D=D.join(R);let g=await te.getItemData(D,sessionStorage.getItem("systemKey"),""),ee=await te.getItemData((T=r==null?void 0:r.columnType)==null?void 0:T.childPath,sessionStorage.getItem("systemKey"),"");if(!g||(g==null?void 0:g.length)===0){let w=[];ee==null||ee.forEach(ae=>{var Re,Ee,qe,We;let Ae={type:"structure",pageKey:D,version:1,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(Re=ce.value)==null?void 0:Re.id,parentPageKey:"",createUserLayer:((Ee=ce.value)==null?void 0:Ee.dept)||((qe=ce.value)==null?void 0:qe.部门名称)},Ze={pageData:{comp:ae==null?void 0:ae.comp,compData:(We=ae==null?void 0:ae.compData)==null?void 0:We.filter(Fe=>(Fe==null?void 0:Fe.key)!=="tableContents"),name:ae==null?void 0:ae.name,isShow:ae==null?void 0:ae.isShow}};w.push({key:Ae,value:Ze})}),(w==null?void 0:w.length)>0&&await S.batchAddInsofDataApi({dataList:w});let z=await te.getItemData(D,sessionStorage.getItem("systemKey"),"");ml.value=z}else ml.value=g;P("routeUrl",ml.value,{isEdit:!0,routerUrl:D});return}let p=(y=(N=o==null?void 0:o.data)==null?void 0:N.result)==null?void 0:y.map(F=>F==null?void 0:F.id);const t=(u=(v=i==null?void 0:i.data)==null?void 0:v.result)==null?void 0:u.map(F=>F==null?void 0:F.id);if(p=[...S.cloneDeep(p),...t],(p==null?void 0:p.length)>0&&(p!=null&&p.every(F=>F!==null&&F))&&await S.batchDeleteInsofDataApi({ids:p}),(r==null?void 0:r.data)==="查看"&&(e!=null&&e.every(F=>(F==null?void 0:F.url)&&(F==null?void 0:F.name)))){let F=S.cloneDeep(e);F=await((k=S.cloneDeep(F))==null?void 0:k.map(async J=>{var ee,w,z,ae;const D=await Tl.downloadAvatarApi({url:J==null?void 0:J.url});let g=URL.createObjectURL(D.data);return{name:(J==null?void 0:J.name)+"."+((ae=(ee=J==null?void 0:J.url)==null?void 0:ee.split("."))==null?void 0:ae[((z=(w=J==null?void 0:J.url)==null?void 0:w.split("."))==null?void 0:z.length)-1]),blobUrl:g}}));let fe=await Promise.all(F);be.value=fe,K.value=!0}const c=S.cloneDeep(j.value);if((r==null?void 0:r.isMainKey)===!0&&(c==null?void 0:c.length)>0){(d=c==null?void 0:c[0])==null||d.prop;let F=S.cloneDeep(ge).value+R+(r==null?void 0:r.data),fe=S.cloneDeep(ge).value,J=(V=(M=El.value[F])==null?void 0:M.filter(w=>{var z,ae;return((z=w==null?void 0:w.key)==null?void 0:z.type)==="structure"&&((ae=w==null?void 0:w.key)==null?void 0:ae.parentTable)===""}))==null?void 0:V.map(w=>{var z;return(z=w==null?void 0:w.value)==null?void 0:z.pageData}),D={};(I=j.value)==null||I.forEach(w=>{(w==null?void 0:w.label)!=="操作"&&(D[w.label]=n[w.prop]??n[w.label])});let g=(H=(Z=h==null?void 0:h.itemData)==null?void 0:Z.find(w=>(w==null?void 0:w.key)==="mainRouters"))==null?void 0:H.contents,ee;if((g==null?void 0:g.length)>0){let w=F==null?void 0:F.split(R)[((oe=F==null?void 0:F.split(R))==null?void 0:oe.length)-1],z=g==null?void 0:g.find(ae=>(ae==null?void 0:ae.key)===w);ee=(z==null?void 0:z.routerContent)+R+(z==null?void 0:z.key)}if((J==null?void 0:J.length)>0)await te.loadingConstruct(F,F+R+`updateLoading${((W=ce.value)==null?void 0:W.account)||((le=ce.value)==null?void 0:le.账号)}`,D,ee),me.setRouteToChildPath(fe),ue.setActiveMenuPath(F+R+`updateLoading${((pe=ce.value)==null?void 0:pe.account)||((ie=ce.value)==null?void 0:ie.账号)}`);else{(de=c==null?void 0:c[0])==null||de.prop;let w=S.cloneDeep(ge).value+R+(r==null?void 0:r.data),z=S.cloneDeep(ge).value;await te.getItemData(z+R,sessionStorage.getItem("systemKey"),""),await te.loadingConstruct(z+R,w,D),await te.loadingConstruct(w,w+R+`updateLoading${((ke=ce.value)==null?void 0:ke.account)||((b=ce.value)==null?void 0:b.账号)}`,D,ee),me.setRouteToChildPath(z),ue.setActiveMenuPath(w+R+`updateLoading${((X=ce.value)==null?void 0:X.account)||((x=ce.value)==null?void 0:x.账号)}`)}}},$a=()=>{K.value=!1},Fa=e=>{P("rowClick",e)};a.watch(()=>h.changedContent,()=>{var n,r;if(!h.changedContent)return;let e=(n=Y.value)==null?void 0:n.map(o=>{var i;return o.id===((i=h.changedContent)==null?void 0:i.id)&&(o={...h.changedContent,id:h.changedContent.newId?h.changedContent.newId:h.changedContent.id},delete o.newId),o});const l=(r=h.itemData)==null?void 0:r.map(o=>((o==null?void 0:o.key)==="tableContents"&&(o.contents=e),o));Y.value=e,P("contentChange",{contents:l,index:h.index}),P("change",{content:e,index:h==null?void 0:h.index,buttonName:"",id:h==null?void 0:h.index})},{deep:!0,immediate:!0});const Pa=()=>{},Va=async()=>{const e=ge.value,l=sessionStorage.getItem("systemKey"),n=await te.getItemData(e,l,""),r=n==null?void 0:n.find(t=>(t==null?void 0:t.name)==="方法明细"),o=(r==null?void 0:r.compData)||[],i=o==null?void 0:o.find(t=>(t==null?void 0:t.key)==="formContent");return i==null?void 0:i.contents},Ol=async()=>`Bearer ${S.Local.get("access-token")}`,za=async(e,{token:l,inputData:n}={})=>await S.axios.post(e,n,{headers:{Authorization:l}}).catch(o=>(ue.setImportLoading(!1),Promise.reject(o))),Ja=e=>{var r;let l={};const n=[];return l.form={},(r=S.cloneDeep(e))==null||r.forEach((o,i)=>{var p,t,c,f,s,E,m,A,_,U,C,O,T,N;if((o==null?void 0:o.comp)==="Table"){(t=(p=o==null?void 0:o.compData)==null?void 0:p.find(k=>(k==null?void 0:k.key)==="header"))==null||t.contents;let y=(s=(f=(c=o==null?void 0:o.compData)==null?void 0:c.find(k=>(k==null?void 0:k.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:s.map(k=>k.slice(1));(U=(_=(A=(m=(E=o==null?void 0:o.compData)==null?void 0:E.find(k=>(k==null?void 0:k.key)==="header"))==null?void 0:m.contents)==null?void 0:A[0])==null?void 0:_[0])==null||U.label;let v=(O=(C=o==null?void 0:o.compData)==null?void 0:C.find(k=>(k==null?void 0:k.key)==="header"))==null?void 0:O.contents,u=[];y==null||y.forEach(k=>{let d=[];k==null||k.forEach((M,V)=>{var Z;let I={};((Z=v[V])==null?void 0:Z.label)!=="操作"&&(I[v[V].label]=M,d.push(I))}),u.push(d)}),l[o.name]=u}else{const y=(N=(T=o.compData)==null?void 0:T.find(v=>(v==null?void 0:v.key)==="formContent"))==null?void 0:N.contents;y==null||y.forEach(v=>{var u,k;if(v.prop!==""){let d=v==null?void 0:v.value;Array.isArray(d)?d=((u=d==null?void 0:d[0])==null?void 0:u.oldUrl)||"http://222.92.178.198:62001/"+((k=d==null?void 0:d[0])==null?void 0:k.url):d=d.toString(),v={key:(v==null?void 0:v.prop)??(v==null?void 0:v.label),value:d},n.push(v)}})}}),l.form=te.getFormContents(n),l},Ra=async(e,l,n)=>{var M,V,I,Z,H,oe,W,le,pe,ie,de,ke;ue.setImportLoading(!0);const r=await Va().catch(b=>(ue.setImportLoading(!1),Promise.reject(b))),o=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="算法体"),i=o==null?void 0:o.value;if(!i){console.log("未搜索到isMain, 缺少算法执行接口"),ue.setImportLoading(!1);return}const p=j.value||[],t=p.find(b=>(b==null?void 0:b.prop)==="输入"),c=t==null?void 0:t.prop;let f=l==null?void 0:l[c];const s=await Ol().catch(b=>(ue.setImportLoading(!1),Promise.reject(b)));let E=!1,m="";(M=j.value)==null||M.forEach(b=>{(b==null?void 0:b.prop)===c&&(E=!!(b!=null&&b.childPath),m=b==null?void 0:b.childPath)});let A="",_="";if(E){let b=(I=(V=j.value)==null?void 0:V.find(fe=>(fe==null?void 0:fe.isMainKey)===!0))==null?void 0:I.prop;_=l==null?void 0:l[b];let X=m==null?void 0:m.split(R),x=[];X==null||X.forEach((fe,J)=>{(X==null?void 0:X.length)-1===J&&x.push(_),x.push(fe)}),x=x.join(R),A=x;let F=await te.getItemData(x,sessionStorage.getItem("systemKey"),"");f=Ja(F)}const U=await za(i,{token:s,inputData:f}).catch(b=>(ue.setImportLoading(!1),Promise.reject(b))),C=(Z=U==null?void 0:U.data)==null?void 0:Z.data,O=r==null?void 0:r.find(b=>(b==null?void 0:b.prop)==="算法名称");O==null||O.value;const T=p.find(b=>(b==null?void 0:b.prop)==="输出"),N=T==null?void 0:T.directiveLabel;A=A==null?void 0:A.replaceAll(t==null?void 0:t.directiveLabel,N);const y=(H=S.cloneDeep(A))==null?void 0:H.replaceAll(R+_,"");let v=await te.getItemData(A,sessionStorage.getItem("systemKey"),""),u=await te.getItemData(y,sessionStorage.getItem("systemKey"),"");if(v){let b=[],X=[];v==null||v.forEach(x=>{var F,fe;if((x==null?void 0:x.comp)==="Table")(F=x==null?void 0:x.compData)==null||F.forEach(J=>{var D;(J==null?void 0:J.key)==="tableContents"&&((D=J==null?void 0:J.contents)==null||D.forEach(g=>{var ee,w;(ee=g==null?void 0:g[0])!=null&&ee.id&&b.push((w=g==null?void 0:g[0])==null?void 0:w.id)}))});else if((x==null?void 0:x.comp)==="Form"){x.compData=(fe=x==null?void 0:x.compData)==null?void 0:fe.map(D=>{var g;return(D==null?void 0:D.key)==="formContent"&&(D.contents=(g=D==null?void 0:D.contents)==null?void 0:g.map(ee=>{var w,z;return(w=C==null?void 0:C.form)!=null&&w[ee.prop]&&(ee.value=(z=C==null?void 0:C.form)==null?void 0:z[ee.prop]),ee})),D});let J={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:x==null?void 0:x.compData}};X.push({id:x==null?void 0:x.id,value:J})}}),(X==null?void 0:X.length)>0&&await S.batchUpdateInsofDataApi({dataList:X}),b=[...new Set(b)],(b==null?void 0:b.length)>0&&await S.batchDeleteInsofDataApi({ids:b})}else{let b=[];if(C!=null&&C.table){let X={type:"structure",systemKey:sessionStorage.getItem("systemKey"),pageKey:A,parentTable:"",createUserId:(oe=ce.value)==null?void 0:oe.id,createUserOrg:((W=ce.value)==null?void 0:W.dept)||((le=ce.value)==null?void 0:le.部门名称)};u==null||u.forEach(x=>{let fe={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:x==null?void 0:x.compData}};b.push({key:X,value:fe})})}if(C!=null&&C.form){let X={type:"structure",pageKey:A,systemKey:sessionStorage.getItem("systemKey"),parentTable:"",createUserId:(pe=ce.value)==null?void 0:pe.id,parentPageKey:"",createUserLayer:((ie=ce.value)==null?void 0:ie.dept)||((de=ce.value)==null?void 0:de.部门名称)};u==null||u.forEach(x=>{var D;let F=(D=x==null?void 0:x.compData)==null?void 0:D.map(g=>{var ee;return(g==null?void 0:g.key)==="formContent"&&(g.contents=(ee=g.contents)==null?void 0:ee.map(w=>{var z,ae;return(z=C==null?void 0:C.form)!=null&&z[w.prop]&&(w.value=(ae=C==null?void 0:C.form)==null?void 0:ae[w.prop]),w})),g}),J={pageData:{comp:x==null?void 0:x.comp,name:x==null?void 0:x.name,isShow:x==null?void 0:x.isShow,compData:F}};b.push({key:X,value:J})})}(b==null?void 0:b.length)>0&&await S.batchAddInsofDataApi({dataList:b})}let k=await te.getItemData(A,sessionStorage.getItem("systemKey"),""),d=[];C!=null&&C.table&&((ke=C==null?void 0:C.table)==null||ke.forEach(b=>{var F,fe,J,D;let X={type:"data",pageKey:A,tableId:(F=k==null?void 0:k[0])==null?void 0:F.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(fe=ce.value)==null?void 0:fe.id,createUserOrg:((J=ce.value)==null?void 0:J.dept)||((D=ce.value)==null?void 0:D.部门名称)},x={tableData:b};d.push({key:X,value:x})})),(d==null?void 0:d.length)>0&&await S.batchAddInsofDataApi({dataList:d}),tl(!0),ue.setImportLoading(!1)},Rl=(e,l)=>(e=e==null?void 0:e.map(n=>{var r,o;return n!=null&&n.children&&((r=n.children)!=null&&r.find(i=>i.id===(l==null?void 0:l.id))?n.children=(o=n.children)==null?void 0:o.filter(i=>(i==null?void 0:i.id)!==(l==null?void 0:l.id)):n.children=Rl(n.children,l)),n}),e),Dl=async(e,l,n)=>{var r,o,i,p,t,c,f,s,E,m,A,_,U,C,O;if(Le.value="",gl.value=!0,Nl.value=!0,P("onButtonClick",e,l),e==="删除")te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var T,N;(T=Y.value)!=null&&T.find(y=>(y==null?void 0:y.id)===(l==null?void 0:l.id))?Y.value=(N=S.cloneDeep(Y.value))==null?void 0:N.filter(y=>(y==null?void 0:y.id)!==(l==null?void 0:l.id)):Y.value=Rl(S.cloneDeep(Y.value),l),Tr(yl.value,Ke.value,l==null?void 0:l.id),me.setTableLoading(h==null?void 0:h.index),P("change",{content:Y.value,singleContent:l,index:h==null?void 0:h.index,type:"delete",buttonName:e,column:j.value})});else if(e==="批量删除"){if(((r=Oe.value)==null?void 0:r.length)===0)return S.ElMessage.warning("请先勾选操作的数据");te.ElMessageBox.confirm("是否确认删除","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{var N,y;const T=(N=Oe.value)==null?void 0:N.map(v=>v.id);Y.value=(y=S.cloneDeep(Y.value))==null?void 0:y.filter(v=>!(T!=null&&T.includes(v.id))),me.setTableLoading(h==null?void 0:h.index),P("change",{content:Y.value,singleContent:null,selectItems:Oe.value,index:h==null?void 0:h.index,type:"batchDelete",buttonName:e,column:j.value})})}else if(e==="复制新增"){Ue.value="新增";const T=S.cloneDeep(l),N=(o=j.value)==null?void 0:o.find(u=>u==null?void 0:u.isMainKey),y=N||((i=j.value)==null?void 0:i[0]),v=(p=Xe.value)==null?void 0:p.find(u=>(u==null?void 0:u.label)==="新建");await Wl(!0,v,{data:T,firstCol:y})}else if(e==="新增")Ue.value="新增",ul(""),je.value=!0;else if(e==="编辑")Ue.value="编辑",ul(l),je.value=!0;else if(e==="查看")Ue.value="查看",ul(l),gl.value=!1,Nl.value=!1,je.value=!0;else if(e==="查看三维模型"){const T={};for(let y in l)y!=="id"&&(T[y]=l[y]);let N=(t=Object.values(T))==null?void 0:t[1];dl.setTableShowThree(N)}else if(((c=n==null?void 0:n.extra)==null?void 0:c.type)==="modelExample")Ue.value=e,hl.value=!0;else if(e==="新建"){let T=El.value,N=[];for(let d in T)d!=null&&d.includes(`loading${((f=ce.value)==null?void 0:f.account)||((s=ce.value)==null?void 0:s.账号)}`)&&(N=[...N,...d]);let y=[];for(let d in T)d!=null&&d.includes(`updateLoading${((E=ce.value)==null?void 0:E.account)||((m=ce.value)==null?void 0:m.账号)}`)&&(y=[...y,...d]);let v=N==null?void 0:N.map(d=>d==null?void 0:d.id);const u=y==null?void 0:y.map(d=>d==null?void 0:d.id);v=[...S.cloneDeep(v),...u],(v==null?void 0:v.length)>0&&(v!=null&&v.every(d=>d!==null&&d))&&await S.batchDeleteInsofDataApi({ids:v});const k=(A=Xe.value)==null?void 0:A.find(d=>(d==null?void 0:d.label)==="新建");await Wl(!1,k)}else if(e==="修改模板"){let T=S.cloneDeep(ge).value;me.setRouteToChildPath(T),ue.setActiveMenuPath(T+R)}else if(e==="执行")Ra(e,l);else if(e!=null&&e.includes("导出")){if(e==="导出选中"&&((_=Oe.value)==null?void 0:_.length)===0)return S.ElMessage.warning(`请先勾选${e}的数据`);if(e==="导出全部"&&((U=Y.value)==null?void 0:U.length)===0)return S.ElMessage.warning("暂无数据导出");const T=(O=(C=j.value)==null?void 0:C.map(y=>y==null?void 0:y.label))==null?void 0:O.filter(y=>y!=="操作"),N=e==="导出全部"?S.cloneDeep(Y.value):S.cloneDeep(Oe.value);N==null||N.forEach(y=>{y==null||delete y.id}),Sa(N,h==null?void 0:h.compName,T,h==null?void 0:h.compName)}},qa=async e=>{var n,r,o,i,p,t;const l=await S.getInsofDataApi({key:{pageKey:e,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((n=l==null?void 0:l.data)==null?void 0:n.code)===200)return Array.isArray((r=l==null?void 0:l.data)==null?void 0:r.result)&&((i=(o=l==null?void 0:l.data)==null?void 0:o.result)==null?void 0:i.length)>0?(t=(p=l==null?void 0:l.data)==null?void 0:p.result)==null?void 0:t.map(c=>{var f;return{id:c==null?void 0:c.id,...(f=c==null?void 0:c.value)==null?void 0:f.pageData}}):[]},ql=(e,l,n,r)=>{var o;P("contentChange",{contents:(o=e==null?void 0:e.compData)==null?void 0:o.map(i=>{var p;return(i==null?void 0:i.key)==="formContent"?{...i,contents:(p=i==null?void 0:i.contents)==null?void 0:p.map(t=>(t==null?void 0:t.key)===l?{...t,value:n}:t)}:i}),index:e==null?void 0:e.id},r)},Wa=(e,l,n)=>{let r=e==null?void 0:e[l==null?void 0:l.prop],o=1;if(Y.value.some(i=>(i==null?void 0:i[l==null?void 0:l.prop])===r)){const i=r;for(;Y.value.some(p=>(p==null?void 0:p[l==null?void 0:l.prop])===`${i}(${o})`);)o++;r=`${i}(${o})`}return r},Wl=async(e,l,n)=>{var p,t,c,f,s,E,m,A;let r,o;const i=Wa(n==null?void 0:n.data,n==null?void 0:n.firstCol);if(e?(r=S.cloneDeep(ge).value+R+((f=n==null?void 0:n.data)==null?void 0:f[(c=n==null?void 0:n.firstCol)==null?void 0:c.prop]),o=S.cloneDeep(ge).value+R+i):(r=S.cloneDeep(ge).value+R,o=S.cloneDeep(r)+`loading${((p=ce.value)==null?void 0:p.account)||((t=ce.value)==null?void 0:t.账号)}`),l){const _=(E=(s=El.value[o])==null?void 0:s.filter(U=>{var C;return((C=U==null?void 0:U.key)==null?void 0:C.parentTable)===""}))==null?void 0:E.map(U=>{var C;return{id:U==null?void 0:U.id,...(C=U==null?void 0:U.value)==null?void 0:C.pageData}});if((_==null?void 0:_.length)>0)if(e){const U=_==null?void 0:_.find(C=>{var O;return((O=C==null?void 0:C.comp)==null?void 0:O.toUpperCase())==="FORM"});U&&ql(U,(m=n==null?void 0:n.firstCol)==null?void 0:m.label,i,ge.value)}else me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o);else if(await te.loadingConstruct(r,o,null,null),e){const U=await qa(o);if((U==null?void 0:U.length)>0){const C=U==null?void 0:U.find(O=>{var T;return((T=O==null?void 0:O.comp)==null?void 0:T.toUpperCase())==="FORM"});C&&ql(C,(A=n==null?void 0:n.firstCol)==null?void 0:A.label,i,ge.value)}}else me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o)}else e?(Le.value="",Se.value=n==null?void 0:n.data,tl(!0,n==null?void 0:n.firstCol,i)):(me.setRouteToChildPath(S.cloneDeep(ge).value),ue.setActiveMenuPath(o))},Ga=()=>{ye.value=!1,ol.value=[],Ce.value=!1},ul=e=>{var o,i,p,t,c,f;const l=[];let n=[];for(let s in e)Array.isArray(e==null?void 0:e[s])&&n.push(s);se.value=S.cloneDeep(j.value),(i=te.getColumnChild((o=S.cloneDeep(j.value))==null?void 0:o.filter(s=>(s==null?void 0:s.label)!=="操作")))==null||i.forEach((s,E)=>{var m;n.find(A=>A===(s==null?void 0:s.prop))||(s!=null&&s.formType&&((m=s==null?void 0:s.formType)==null?void 0:m.toUpperCase())==="SELECT"?l.push({label:(s==null?void 0:s.label)??"",name:(s==null?void 0:s.prop)??"t"+E,prop:s==null?void 0:s.prop,type:!(s!=null&&s.formType)||(s==null?void 0:s.formType)===""?"Input":s==null?void 0:s.formType,value:(e==null?void 0:e[s==null?void 0:s.prop])??(s==null?void 0:s.value)??"",id:(s==null?void 0:s.id)??E,contents:(s==null?void 0:s.options)??[],width:1,isFormColHidden:s==null?void 0:s.isFormColHidden,disabled:s==null?void 0:s.disabled,optionUrl:{groupSelect:s==null?void 0:s.groupSelect,menuSelect:s==null?void 0:s.formMenuSelect,type:"Select",selectRelateType:s==null?void 0:s.selectRelateType}}):l.push({label:(s==null?void 0:s.label)??"",prop:s==null?void 0:s.prop,name:(s==null?void 0:s.prop)??"t"+E,type:!(s!=null&&s.formType)||(s==null?void 0:s.formType)===""?"Input":s==null?void 0:s.formType,value:(e==null?void 0:e[s==null?void 0:s.prop])??(s==null?void 0:s.value)??"",id:(s==null?void 0:s.id)??E,contents:(s==null?void 0:s.options)??[],width:1,isFormColHidden:s==null?void 0:s.isFormColHidden,disabled:s==null?void 0:s.disabled}))}),e===""||!e||(Le.value=(e==null?void 0:e.id)??"");let r=te.getColumnChild((p=S.cloneDeep(j.value))==null?void 0:p.filter(s=>(s==null?void 0:s.label)!=="操作"));_e.value&&((t=_e.value)==null?void 0:t.length)>0&&(_e.value=(c=S.cloneDeep(_e).value)==null?void 0:c.map(s=>{var m;let E=(m=r==null?void 0:r.find(A=>(A==null?void 0:A.label)===(s==null?void 0:s.label)))==null?void 0:m.prop;return E&&(s.value=e[E]),s})),Je.value=_e.value&&((f=_e.value)==null?void 0:f.length)>0?te.getTableFormToForm(_e.value):l},Ha=()=>{var l;const e=(l=B.value)==null?void 0:l.$el;e&&jl.Sortable.create(e,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:n=>{var p;const{oldIndex:r,newIndex:o}=n;if(r===o)return;const i=il.value.splice(r,1)[0];il.value.splice(o,0,i),j.value=(p=j.value)==null?void 0:p.slice().sort((t,c)=>{if(t.label==="操作")return 1;if(c.label==="操作")return-1;const f=il.value.findIndex(E=>E.label===t.label),s=il.value.findIndex(E=>E.label===c.label);return f-s})}})};a.onMounted(()=>{_l.value=window.innerWidth-240*2});const Xa=()=>{a.nextTick(()=>{Ha()})},wl=(e,l)=>{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(o=>{var i,p;if((o==null?void 0:o.id)===Le.value){let t={};for(let c in o){let f=(i=l==null?void 0:l.find(s=>(s==null?void 0:s.prop)===c))==null?void 0:i.label;f?t[c]=(p=Se.value)==null?void 0:p[f]:t[c]=o[c]}o=Object.assign(t,Se.value),n=o}else{let t=wl(o,l);o=t==null?void 0:t.contents,n=t==null?void 0:t.currentSelectContents}return o}),{contents:e,currentSelectContents:n}},Gl=(e,l)=>{let n,r;return e!=null&&e.find(o=>(o==null?void 0:o.id)===Le.value)?n=e==null?void 0:e.map(o=>{var i,p;if((o==null?void 0:o.id)===Le.value){let t={};for(let c in o){let f=(i=l==null?void 0:l.find(s=>(s==null?void 0:s.prop)===c))==null?void 0:i.label;f?t[c]=(p=Se.value)==null?void 0:p[f]:t[c]=o[c]}o=Object.assign(t,Se.value),r=o}return o}):n=e==null?void 0:e.map(o=>{var i,p,t,c;if((o==null?void 0:o.id)===Le.value){let f={};for(let s in o){let E=(i=l==null?void 0:l.find(m=>(m==null?void 0:m.prop)===s))==null?void 0:i.label;E?f[s]=(p=Se.value)==null?void 0:p[E]:f[s]=o[s]}o=Object.assign(f,Se.value),r=o}else o=(t=wl(o,l))==null?void 0:t.contents,r=(c=wl(o,l))==null?void 0:c.currentSelectContents;return o}),{newContents:n,currentSelectContents:r}},Hl=(e,l,n)=>{var r,o;return e[l==null?void 0:l.prop]=n,typeof e.id=="number"&&(e.id=(r=e.id)==null?void 0:r.toString()),e.children&&((o=e.children)==null?void 0:o.length)>0&&(e.children=e.children.map(Hl)),e},Ll=e=>{var n;const l=[];return l.push({...e}),e!=null&&e.children&&Array.isArray(e.children)&&((n=e.children)==null||n.forEach(r=>{l.push(...Ll(r))})),(l==null?void 0:l.length)>0?l==null?void 0:l.map(r=>{const o={...r};return delete o.children,o}):[]},tl=(e=!0,l,n)=>{var f,s,E,m,A,_,U,C,O;let r=te.getColumnChild((f=S.cloneDeep(j.value))==null?void 0:f.filter(T=>(T==null?void 0:T.label)!=="操作")),o,i=S.cloneDeep(Y.value);if(!Se.value){je.value=!1;return}if(Le.value===""){Ie.value++;let T;l&&n?T={id:Ie.value.toString(),[l==null?void 0:l.prop]:n,children:Se.value.children}:T={id:Ie.value.toString()},T!=null&&T.children&&(T={...T,children:(s=T.children)==null?void 0:s.map(N=>Hl(N,l,n))}),i.push(Object.assign(Se.value,T)),o=Object.assign(Se.value,T)}else i=(E=Gl(i,r))==null?void 0:E.newContents,o=(m=Gl(i,r))==null?void 0:m.currentSelectContents;const p=(A=h.itemData)==null?void 0:A.filter(T=>(T==null?void 0:T.key)==="childTree")[0];if(((_=p==null?void 0:p.contents)==null?void 0:_.length)>0){Ue.value="编辑";const T=[];i==null||i.forEach((N,y)=>{var u;let v={};if(Array.isArray(N)){let k=[];N==null||N.filter(d=>!(d!=null&&d.id)).forEach((d,M)=>{var V,I,Z,H,oe,W,le;if((I=(V=xe.value)==null?void 0:V[M])!=null&&I.prop&&!Array.isArray(d)){let pe={};pe[xe.value[M].column]=d,ne!=null&&ne.value&&((Z=ne==null?void 0:ne.value)==null?void 0:Z.length)>0&&((H=ne==null?void 0:ne.value)!=null&&H.find(ie=>JSON.stringify(ie==null?void 0:ie[0])===JSON.stringify(pe)))&&(k=(oe=ne==null?void 0:ne.value)==null?void 0:oe.find(ie=>JSON.stringify(ie==null?void 0:ie[0])===JSON.stringify(pe))),k&&k.length>0?v[xe.value[M].prop]=k!=null&&k.find(ie=>{var de;return((de=Object.keys(ie))==null?void 0:de[0])===xe.value[M].column})?(W=k==null?void 0:k.find(ie=>{var de;return((de=Object.keys(ie))==null?void 0:de[0])===xe.value[M].column}))==null?void 0:W[xe.value[M].column]:d:v[xe.value[M].prop]=d}else Array.isArray(d)&&((le=xe.value[M])!=null&&le.prop?v[xe.value[M].prop]=d:v.children=Fl(d,xe.value))})}else v=N;Array.isArray(N)&&N.some(k=>k==null?void 0:k.id)?T.push(Object.assign(v,{id:(u=N==null?void 0:N.find(k=>k.id))==null?void 0:u.id})):v.id?T.push(v):T.push(Object.assign(v,{id:y.toString()}))}),Y.value=Zl(T,p,j.value)}else Y.value=i;yl.value=Y.value;const t=Ar(yl.value,Ke.value,i);let c=[];if(rl.value?(c=(U=S.cloneDeep(rl).value.singleContent)==null?void 0:U.filter(T=>(T==null?void 0:T.id)!==(o==null?void 0:o.id)),c.push(o)):c=[o],Qe.value){const T={content:t,singleContent:((C=p==null?void 0:p.contents)==null?void 0:C.length)>0?c==null?void 0:c.flatMap(Ll):c,index:h==null?void 0:h.index,buttonName:"编辑",column:j.value,parentTableId:h==null?void 0:h.parentTableId};me.setCacheUpdatingData(T)}if(e){const T={content:t,singleContent:((O=p==null?void 0:p.contents)==null?void 0:O.length)>0?Ll(o):o,index:h==null?void 0:h.index,buttonName:Ue.value,column:j.value,parentTableId:h==null?void 0:h.parentTableId};me.setTableLoading(h==null?void 0:h.index),je.value=!1,Se.value=void 0,P("change",T)}};a.onUnmounted(()=>{j.value=[],Y.value=[],se.value=[],Me.value=[],_e.value=[],He.value=[],ol.value=[],el.value=[],Je.value=[],Oe.value=[],B.value=null});const Xl=async(e,l,n)=>{var f,s,E,m,A,_,U,C,O,T,N;Ye.value=n==null?void 0:n.prop;const r=S.cloneDeep(h.itemData),o=r==null?void 0:r.map(y=>{var v;return(y==null?void 0:y.key)==="header"&&((v=y.contents)==null||v.map((u,k)=>{var d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x,F,fe,J;return u.type=u!=null&&u.type?u.type:(I=(V=(M=(d=u==null?void 0:u.key)==null?void 0:d.split("$"))==null?void 0:M[1])==null?void 0:V.split("("))!=null&&I[0]?(H=(Z=te.FormType)==null?void 0:Z.find(D=>{var g,ee,w,z;return(D==null?void 0:D.key)===((z=(w=(ee=(g=u==null?void 0:u.key)==null?void 0:g.split("$"))==null?void 0:ee[1])==null?void 0:w.split("("))==null?void 0:z[0])}))==null?void 0:H.value:"Input",u.options=u!=null&&u.options?u.options:((le=(W=(oe=u==null?void 0:u.key)==null?void 0:oe.split("$"))==null?void 0:W[1])==null?void 0:le.length)>0?(ke=(de=$l((ie=(pe=u==null?void 0:u.key)==null?void 0:pe.split("$"))==null?void 0:ie[1]))==null?void 0:de.split(","))==null?void 0:ke.map(D=>({label:D,value:D})):[],(b=u==null?void 0:u.key)!=null&&b.includes("$")&&(u.key=(x=(X=u==null?void 0:u.key)==null?void 0:X.split("$"))==null?void 0:x[0]),u.value=(F=Object.values(l))==null?void 0:F[k],u.optionUrl=u!=null&&u.formMenuSelect&&((fe=u==null?void 0:u.formMenuSelect)==null?void 0:fe.length)>0?{groupSelect:(J=u==null?void 0:u.groupSelect)==null?void 0:J.split(/[::]/).map(D=>D.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),y});let i=S.cloneDeep(Je.value),p=(s=(f=S.cloneDeep(o))==null?void 0:f.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:s.contents;i=i==null?void 0:i.map(y=>{var v;return y.value=(v=p==null?void 0:p.find((u,k)=>k===(y==null?void 0:y.id)))==null?void 0:v.value,y});let t="",c=(A=(m=(E=S.cloneDeep(o))==null?void 0:E.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:m.contents)==null?void 0:A.find((y,v)=>{var u,k,d;return(y==null?void 0:y.label)===Ye.value||(v==null?void 0:v.toString())===((d=(k=(u=Ye.value)==null?void 0:u.split("a"))==null?void 0:k[1])==null?void 0:d.toString())});if((C=(U=(_=S.cloneDeep(o))==null?void 0:_.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:U.contents)==null||C.forEach(y=>{var v,u,k,d,M;t===""&&((k=(u=(v=y==null?void 0:y.optionUrl)==null?void 0:v.groupSelect)==null?void 0:u[1])!=null&&k.includes("["))&&(t=(M=(d=y==null?void 0:y.optionUrl)==null?void 0:d.groupSelect)==null?void 0:M[1])}),(O=c==null?void 0:c.optionUrl)!=null&&O.menuSelect){let y=await Pl(c),v;if(y==null||y.forEach(u=>{var k,d,M,V,I,Z,H,oe,W,le;t===((d=(k=c==null?void 0:c.optionUrl)==null?void 0:k.groupSelect)==null?void 0:d[1])&&((I=(V=(M=c==null?void 0:c.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((le=S.cloneDeep(u))==null?void 0:le[(W=(oe=(H=(Z=c==null?void 0:c.optionUrl)==null?void 0:Z.groupSelect)==null?void 0:H[1])==null?void 0:oe.replaceAll("[",""))==null?void 0:W.replaceAll("]","")])===(c==null?void 0:c.value)&&(v=u)}),v){let u=S.cloneDeep(i);u=u==null?void 0:u.map(d=>{var M,V,I,Z,H,oe,W,le,pe,ie,de;return(v!=null&&v[d==null?void 0:d.label]||v!=null&&v[(Z=(I=(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])==null?void 0:I.replaceAll("[",""))==null?void 0:Z.replaceAll("]","")])&&((W=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.groupSelect)==null?void 0:oe[1])!=null&&W.includes("["))&&(d.value=(v==null?void 0:v[d==null?void 0:d.label])||(v==null?void 0:v[(de=(ie=(pe=(le=d==null?void 0:d.optionUrl)==null?void 0:le.groupSelect)==null?void 0:pe[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:de.replaceAll("]","")])),d}),Y.value=(T=S.cloneDeep(Y.value))==null?void 0:T.map(d=>{if((d==null?void 0:d.id)===(l==null?void 0:l.id)){const M={};return u==null||u.forEach(V=>{M[V.name]=V.value}),M.id=d==null?void 0:d.id,M}return d});let k=S.cloneDeep(u);k=k==null?void 0:k.map(d=>{var M,V,I,Z;return(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.menuSelect)!=null&&V.some(H=>H==null?void 0:H.includes)&&(d.optionUrl.menuSelect=(Z=(I=d==null?void 0:d.optionUrl)==null?void 0:I.menuSelect)==null?void 0:Z.map(H=>{var oe,W,le,pe;if(H!=null&&H.includes("[")){let ie=(W=(oe=H==null?void 0:H.replaceAll("[","").replaceAll("]",""))==null?void 0:oe.split(":"))==null?void 0:W[1];H=(pe=(le=S.cloneDeep(u))==null?void 0:le.find(de=>(de==null?void 0:de.label)===ie))==null?void 0:pe.value}return H})),d}),Y.value=(N=S.cloneDeep(Y.value))==null?void 0:N.map(d=>{if((d==null?void 0:d.id)===(l==null?void 0:l.id)){const M={};return k==null||k.forEach(V=>{M[V.name]=V.value}),M.id=d==null?void 0:d.id,M}return d})}}},Qa=async e=>{var f,s,E,m,A,_,U,C,O,T,N;if(!e)return;Se.value=e;const l=S.cloneDeep(h.itemData);let n=l==null?void 0:l.map(y=>{var v;return(y==null?void 0:y.key)==="header"&&((v=y.contents)==null||v.map((u,k)=>{var d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke,b,X,x,F,fe,J;return u.type=u!=null&&u.type?u.type:(I=(V=(M=(d=u==null?void 0:u.key)==null?void 0:d.split("$"))==null?void 0:M[1])==null?void 0:V.split("("))!=null&&I[0]?(H=(Z=te.FormType)==null?void 0:Z.find(D=>{var g,ee,w,z;return(D==null?void 0:D.key)===((z=(w=(ee=(g=u==null?void 0:u.key)==null?void 0:g.split("$"))==null?void 0:ee[1])==null?void 0:w.split("("))==null?void 0:z[0])}))==null?void 0:H.value:"Input",u.options=u!=null&&u.options?u.options:((le=(W=(oe=u==null?void 0:u.key)==null?void 0:oe.split("$"))==null?void 0:W[1])==null?void 0:le.length)>0?(ke=(de=$l((ie=(pe=u==null?void 0:u.key)==null?void 0:pe.split("$"))==null?void 0:ie[1]))==null?void 0:de.split(","))==null?void 0:ke.map(D=>({label:D,value:D})):[],(b=u==null?void 0:u.key)!=null&&b.includes("$")&&(u.key=(x=(X=u==null?void 0:u.key)==null?void 0:X.split("$"))==null?void 0:x[0]),u.value=(F=Object.values(e))==null?void 0:F[k],u.optionUrl=u!=null&&u.formMenuSelect&&((fe=u==null?void 0:u.formMenuSelect)==null?void 0:fe.length)>0?{groupSelect:(J=u==null?void 0:u.groupSelect)==null?void 0:J.split(/[::]/).map(D=>D.trim()),menuSelect:u==null?void 0:u.formMenuSelect,selectRelateType:"",type:(u==null?void 0:u.formType)??(u!=null&&u.groupSelect?"Select":"")}:null,u})),y}),r=S.cloneDeep(Je.value),o=(s=(f=S.cloneDeep(n))==null?void 0:f.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:s.contents;if(r=r==null?void 0:r.map(y=>{var v;return y.value=(v=o==null?void 0:o.find((u,k)=>(u==null?void 0:u.prop)===(y==null?void 0:y.name)))==null?void 0:v.value,y}),!sl.value)return;let i="",p=(A=(m=(E=S.cloneDeep(n))==null?void 0:E.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:m.contents)==null?void 0:A.find((y,v)=>{var u,k,d;return(y==null?void 0:y.label)===Ye.value||(v==null?void 0:v.toString())===((d=(k=(u=Ye.value)==null?void 0:u.split("a"))==null?void 0:k[1])==null?void 0:d.toString())}),t=(_=p==null?void 0:p.optionUrl)==null?void 0:_.menuSelect,c=!0;if((O=(C=(U=S.cloneDeep(n))==null?void 0:U.find(y=>(y==null?void 0:y.key)==="header"))==null?void 0:C.contents)==null||O.forEach(y=>{var v,u,k,d,M,V;c&&((k=(u=(v=y==null?void 0:y.optionUrl)==null?void 0:v.groupSelect)==null?void 0:u[1])!=null&&k.includes("["))&&(i=(M=(d=y==null?void 0:y.optionUrl)==null?void 0:d.groupSelect)==null?void 0:M[1],JSON.stringify(t)===JSON.stringify((V=y==null?void 0:y.optionUrl)==null?void 0:V.menuSelect)&&(c=!1))}),(T=p==null?void 0:p.optionUrl)!=null&&T.menuSelect&&sl.value){let y=await Pl(p),v;if((N=p==null?void 0:p.optionUrl)==null||N.menuSelect,y==null||y.forEach(u=>{var k,d,M,V,I,Z,H,oe,W,le;i===((d=(k=p==null?void 0:p.optionUrl)==null?void 0:k.groupSelect)==null?void 0:d[1])&&((I=(V=(M=p==null?void 0:p.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])!=null&&I.includes("["))&&((le=S.cloneDeep(u))==null?void 0:le[(W=(oe=(H=(Z=p==null?void 0:p.optionUrl)==null?void 0:Z.groupSelect)==null?void 0:H[1])==null?void 0:oe.replaceAll("[",""))==null?void 0:W.replaceAll("]","")])===(p==null?void 0:p.value)&&(v=u)}),v){let u=S.cloneDeep(r);u=u==null?void 0:u.map(d=>{var M,V,I,Z,H,oe,W,le,pe,ie,de;return(v!=null&&v[d==null?void 0:d.label]||v!=null&&v[(Z=(I=(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.groupSelect)==null?void 0:V[1])==null?void 0:I.replaceAll("[",""))==null?void 0:Z.replaceAll("]","")])&&((W=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.groupSelect)==null?void 0:oe[1])!=null&&W.includes("["))&&(d.value=(v==null?void 0:v[d==null?void 0:d.label])||(v==null?void 0:v[(de=(ie=(pe=(le=d==null?void 0:d.optionUrl)==null?void 0:le.groupSelect)==null?void 0:pe[1])==null?void 0:ie.replaceAll("[",""))==null?void 0:de.replaceAll("]","")])),d}),Je.value=S.cloneDeep(u);let k=S.cloneDeep(u);k=k==null?void 0:k.map(d=>{var M,V,I,Z,H,oe;return(V=(M=d==null?void 0:d.optionUrl)==null?void 0:M.menuSelect)!=null&&V.some(W=>W==null?void 0:W.includes("["))&&(d.optionUrl.oldMenuSelect=(Z=(I=S.cloneDeep(d))==null?void 0:I.optionUrl)==null?void 0:Z.menuSelect,d.optionUrl.menuSelect=(oe=(H=d==null?void 0:d.optionUrl)==null?void 0:H.menuSelect)==null?void 0:oe.map(W=>{var le,pe,ie,de;if(W!=null&&W.includes("[")){let ke=(pe=(le=W==null?void 0:W.replaceAll("[","").replaceAll("]",""))==null?void 0:le.split(":"))==null?void 0:pe[1];W=(de=(ie=S.cloneDeep(u))==null?void 0:ie.find(b=>(b==null?void 0:b.label)===ke))==null?void 0:de.value}return W})),d}),Je.value=k}}sl.value=!1},Ya=e=>e?(e==null?void 0:e.toUpperCase())==="INPUT"?"TEXTAREA":e:"TEXTAREA",Za=e=>{var i,p;const l=(p=(i=_e.value)==null?void 0:i.find(t=>(t==null?void 0:t.label)===(e==null?void 0:e.label)))==null?void 0:p.multiple,n=e==null?void 0:e.prop;if((e==null?void 0:e.formType)!="Select")return;Y.value.forEach(t=>{const c=t==null?void 0:t[n];l&&Kl(c)&&(t[n]=[c]),!l&&!Kl(c)&&(t[n]="")})},Ql=(e,l)=>{var n;return l==null||l.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=>Ql(r,l))),e},Ml=e=>{var n,r,o,i,p,t;ul("");const l=(n=Je.value)==null?void 0:n.reduce((c,f)=>(c[f.name]=f.value,c),{});if(((r=Object.keys(l))==null?void 0:r.length)>0){Se.value=l,Le.value="",Ie.value=(o=Y.value)==null?void 0:o.length,el.value=(i=Xe.value)==null?void 0:i.filter(f=>(f==null?void 0:f.label)!=="新增");const c=(t=(p=se.value)==null?void 0:p.filter(f=>(f==null?void 0:f.label)!=="操作"))==null?void 0:t.map(f=>{var E,m,A;const s=(m=(E=_e.value)==null?void 0:E.find(_=>(_==null?void 0:_.label)===(f==null?void 0:f.label)))==null?void 0:m.multiple;return Za(f),{...f,contents:(f==null?void 0:f.options)??[],optionUrl:f!=null&&f.formMenuSelect&&((A=f==null?void 0:f.formMenuSelect)==null?void 0:A.length)>0?{groupSelect:f==null?void 0:f.groupSelect,menuSelect:f==null?void 0:f.formMenuSelect,selectRelateType:"",type:f==null?void 0:f.formType,multiple:s}:null}});j.value=c==null?void 0:c.map(f=>Ql(f,[{prop:"type",value:"edit"},{prop:"columnType",value:Ya(f==null?void 0:f.formType)||(f==null?void 0:f.columnType)}])),e==="createClick"&&tl(!1)}},Ia=(e,l)=>Number(jl.dayjs(l).diff(jl.dayjs(e),"day",!0).toFixed(1)),er=(e,l)=>{var p;const n=(p=e==null?void 0:e.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:p.contents,r={START:"开始时间",END:"结束时间",HOURS:"工时"},o=new Map;return n==null||n.forEach((t,c)=>{const{label:f}=t;o.set(f,c)}),!o.has(r.START)||!o.has(r.END)||!o.has(r.HOURS)?l:l==null?void 0:l.map(t=>{const c=t==null?void 0:t[r.START],f=t==null?void 0:t[r.END],s=Ia(c,f);return c&&f&&(t[r.HOURS]=`${s}天`),t})},Yl=(e,l,n=0)=>{if(n>((l==null?void 0:l.length)??""))return e;const r=l[n],o=new Map;for(const p of e){const t=p[r];o.has(t)||o.set(t,[]),o.get(t)&&o.get(t).push(p)}const i=[];for(const[p,t]of o){const[c,...f]=t,s={...c};n+1===((l==null?void 0:l.length)??"")?s.children=t==null?void 0:t.map(E=>(E.level=S.cloneDeep(n)+1,E)).filter((E,m)=>m!==0):f.length>0&&(s.children=Yl(f,l,n+1)),s.level=n,i.push(s)}return i},Zl=(e,l,n)=>{var o;if(((o=l==null?void 0:l.contents)==null?void 0:o.length)===0)return e;let r=[];return r=Yl(e,l==null?void 0:l.contents,0),r},Il=(e,l)=>{var m,A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe,W,le,pe,ie,de,ke;const n=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="header");e==null||e.filter(b=>(b==null?void 0:b.key)==="tableIndexColumn")[0];const r=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="childTree")[0];let o=l;const i=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="page"),p=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="rowButton"),t=e==null?void 0:e.find(b=>(b==null?void 0:b.key)==="extraButton"),c=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableContents"),f=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableIndex");_e.value=(A=(m=e==null?void 0:e.filter(b=>(b==null?void 0:b.key)==="tableToForm"))==null?void 0:m[0])==null?void 0:A.contents,Vl.value=(i==null?void 0:i.contents)??!0;let s=[];$e.value===""?s=n==null?void 0:n[0]:s=(n==null?void 0:n.find(b=>(b==null?void 0:b.selectLabel)==="("+$e.value+")"))??(n==null?void 0:n.find(b=>!(b!=null&&b.selectLabel)));let E=[];if($e.value===""?E=f==null?void 0:f[0]:E=(f==null?void 0:f.find(b=>(b==null?void 0:b.selectLabel)==="("+$e.value+")"))??(f==null?void 0:f.find(b=>!(b!=null&&b.selectLabel))),((_=s==null?void 0:s.contents)==null?void 0:_.length)>0){let b=[];if(s!=null&&s.contents.some(D=>Array.isArray(D)&&(D==null?void 0:D.find(g=>g.children))))Ke.value===""?b=(C=(U=te.getGradeColumns(s==null?void 0:s.contents))==null?void 0:U[0])==null?void 0:C.filter(D=>!Array.isArray(D)):(Ke.value.split("-"),b=(O=te.getGradeColumns(s==null?void 0:s.contents))==null?void 0:O[0]);else{let D=s!=null&&s.contents.some(g=>Array.isArray(g))?(T=s==null?void 0:s.contents)==null?void 0:T[0]:s==null?void 0:s.contents;D==null||D.forEach((g,ee)=>{var ae,Ae,Ze,Re;let w="";(Ae=(ae=ge.value)==null?void 0:ae.split("/"))==null||Ae.forEach(Ee=>{var qe,We,Fe;if(Ee!==""){let ll=(Fe=(We=(qe=Ee==null?void 0:Ee.split(R+"updateLoading"))==null?void 0:qe[0])==null?void 0:We.split(R+"loading"))==null?void 0:Fe[0];w=w===""?w+ll:w+"/"+ll}}),w=w+R+(g==null?void 0:g.directiveLabel);const z=(Ze=_e.value)==null?void 0:Ze.find(Ee=>(Ee==null?void 0:Ee.prop)===(g==null?void 0:g.prop));b.push({label:(g==null?void 0:g.label)??"",prop:(g==null?void 0:g.label)==="操作"?"operate":(g==null?void 0:g.prop)??"a"+ee,width:g!=null&&g.width?parseInt(g.width):"",fixed:(g==null?void 0:g.fixed)??void 0,sortable:(g==null?void 0:g.sortable)??!1,filterable:(g==null?void 0:g.filterable)??!1,operable:(g==null?void 0:g.operable)??!1,showSummary:(g==null?void 0:g.showSummary)??!1,align:(g==null?void 0:g.align)??"left",showOverflowTooltip:(g==null?void 0:g.showOverflowTooltip)??!0,isNotDrag:(g==null?void 0:g.isNotDrag)??!1,isEditCol:(g==null?void 0:g.isEditCol)??!1,isOperate:(g==null?void 0:g.isOperate)??!1,id:(g==null?void 0:g.id)??ee,type:(g==null?void 0:g.label)==="操作"?"operate":void 0,formType:(g==null?void 0:g.formType)??(g!=null&&g.groupSelect?"Select":""),isTableColHidden:g==null?void 0:g.isTableColHidden,isFormColHidden:g==null?void 0:g.isFormColHidden,disabled:g==null?void 0:g.disabled,options:(g==null?void 0:g.options)??[],value:(g==null?void 0:g.value)??"",formMenuSelect:(g==null?void 0:g.formMenuSelect)??[],isRoute:(g==null?void 0:g.isRoute)??!1,groupSelect:g!=null&&g.groupSelect?(Re=g==null?void 0:g.groupSelect)==null?void 0:Re.replaceAll('"',"").split(":"):[],isMainKey:(g==null?void 0:g.isMainKey)||(g==null?void 0:g.directiveLabel)&&!o[w],columnType:(z==null?void 0:z.type)||(g==null?void 0:g.columnType)||"TEXTAREA",directiveLabel:g==null?void 0:g.directiveLabel,isExistChild:!!(g!=null&&g.directiveLabel&&o[w]),childPath:w})})}j.value=b,Me.value=b,q.value=(N=j.value)==null?void 0:N.map(D=>D==null?void 0:D.label),Pe.value=(y=j.value)==null?void 0:y.every(D=>D==null?void 0:D.filterable),ve.value=(v=j.value)==null?void 0:v.every(D=>D==null?void 0:D.operable),Ne.value=(u=j.value)==null?void 0:u.every(D=>D==null?void 0:D.sortable);let X=(d=(k=te.getAllLeafNodes(j.value))==null?void 0:k.filter(D=>(D==null?void 0:D.type)!=="operate"))==null?void 0:d.map((D,g)=>({prop:(D==null?void 0:D.prop)??"a"+g,column:D.label}));xe.value=X;let x=[];$e.value===""?x=c==null?void 0:c[0]:x=(c==null?void 0:c.find(D=>(D==null?void 0:D.selectLabel)==="("+$e.value+")"))??(c==null?void 0:c.find(D=>!(D!=null&&D.selectLabel)));let F=Array.isArray((M=x==null?void 0:x.contents)==null?void 0:M[0])&&((V=x==null?void 0:x.contents)!=null&&V[0].every(D=>Array.isArray(D)))?(I=x==null?void 0:x.contents)==null?void 0:I[0]:x==null?void 0:x.contents;E!=null&&E.contents&&((Z=E==null?void 0:E.contents)==null?void 0:Z.length)!==0&&(F=(H=S.cloneDeep(F))==null?void 0:H.map((D,g)=>{if(!Array.isArray(D)){let ee={};for(let w in D)w!=="id"&&w!=="index"&&(ee[w]=D[w]);D=Object.values(ee)}return D}));const fe=!!((oe=j.value)!=null&&oe.find(D=>D.prop==="index"));F=ra(F,E==null?void 0:E.contents,fe);const J=[];F==null||F.forEach((D,g)=>{var w;let ee={};if(Array.isArray(D)){let z=[];D==null||D.filter(ae=>!(ae!=null&&ae.id)).forEach((ae,Ae)=>{var Ze,Re,Ee,qe,We,Fe;if((Ze=X==null?void 0:X[Ae])!=null&&Ze.prop&&!Array.isArray(ae)){let ll={};ll[X[Ae].column]=ae,ne!=null&&ne.value&&((Re=ne==null?void 0:ne.value)==null?void 0:Re.length)>0&&((Ee=ne==null?void 0:ne.value)!=null&&Ee.find(we=>JSON.stringify(we==null?void 0:we[0])===JSON.stringify(ll)))&&(z=(qe=ne==null?void 0:ne.value)==null?void 0:qe.find(we=>JSON.stringify(we==null?void 0:we[0])===JSON.stringify(ll))),z&&z.length>0?ee[X[Ae].prop]=z!=null&&z.find(we=>{var cl;return((cl=Object.keys(we))==null?void 0:cl[0])===X[Ae].column})?(We=z==null?void 0:z.find(we=>{var cl;return((cl=Object.keys(we))==null?void 0:cl[0])===X[Ae].column}))==null?void 0:We[X[Ae].column]:ae:ee[X[Ae].prop]=ae}else Array.isArray(ae)&&((Fe=X[Ae])!=null&&Fe.prop?ee[X[Ae].prop]=ae:ee.children=Fl(ae,X))})}else ee=D;Array.isArray(D)&&D.some(z=>z==null?void 0:z.id)?J.push(Object.assign(ee,{id:(w=D==null?void 0:D.find(z=>z.id))==null?void 0:w.id})):ee.id?J.push(ee):J.push(Object.assign(ee,{id:g.toString()}))}),er(e,J),Y.value=Zl(J,r,j.value),pl.value=J,(W=pl.value)==null||W.forEach(D=>{var g;(g=fl.value)==null||g.set(D.id,D)})}else j.value=[],se.value=[],Y.value=[],pl.value=[],fl.value=new Map;((le=p==null?void 0:p.contents)==null?void 0:le.length)>0?He.value=p==null?void 0:p.contents:He.value=[],((pe=t==null?void 0:t.contents)==null?void 0:pe.length)>0?(el.value=t==null?void 0:t.contents,Xe.value=t==null?void 0:t.contents):(el.value=[],Xe.value=[]),Ie.value=((ie=Y==null?void 0:Y.value)==null?void 0:ie.length)??0,yl.value=Y.value,Qe.value&&(j.value=(ke=(de=se.value)==null?void 0:de.filter(b=>(b==null?void 0:b.label)!=="操作"))==null?void 0:ke.map(b=>{var X;return{...b,type:"edit",optionUrl:b!=null&&b.formMenuSelect&&((X=b==null?void 0:b.formMenuSelect)==null?void 0:X.length)>0?{groupSelect:b==null?void 0:b.groupSelect,menuSelect:b==null?void 0:b.formMenuSelect,selectRelateType:"",type:b==null?void 0:b.formType}:null}}),Ml())};a.watch(()=>[h.itemData,$e.value,ca.value,Ke.value,ne==null?void 0:ne.value],async()=>{var e,l,n,r,o,i;if((e=h==null?void 0:h.itemData)!=null&&e.find(p=>(p==null?void 0:p.key)==="columnPath")&&!((l=nl.value)!=null&&l.find(p=>{var t,c;return(p==null?void 0:p.key)===((c=(t=h==null?void 0:h.itemData)==null?void 0:t.find(f=>(f==null?void 0:f.key)==="columnPath"))==null?void 0:c.contents)}))){let p=nl.value,t={key:(r=(n=h==null?void 0:h.itemData)==null?void 0:n.find(c=>(c==null?void 0:c.key)==="columnPath"))==null?void 0:r.contents,value:(i=(o=h==null?void 0:h.itemData)==null?void 0:o.find(c=>(c==null?void 0:c.key)==="columnUsingPath"))==null?void 0:i.contents};p!=null&&p.find(c=>(c==null?void 0:c.key)===(t==null?void 0:t.key))?p=p==null?void 0:p.map(c=>((c==null?void 0:c.key)===(t==null?void 0:t.key)&&(c.value=t.value),c)):p.push(t),me.setTableViewContents(p)}Il(h.itemData,h.allMapContents)},{deep:!0,immediate:!0}),a.watch(()=>h==null?void 0:h.operatingForm,e=>{e!=null&&e.form&&(ul(e==null?void 0:e.form),Ue.value=e==null?void 0:e.dialogTitle,gl.value=!0,je.value=!0)},{immediate:!0,deep:!0});const ea=()=>{Qe.value=!Qe.value},lr=()=>{bl.value=!bl.value};a.watch(()=>Qe.value,e=>{e?(Ml("viewChange"),me.setCacheUpdatingData(null)):(el.value=Xe.value,j.value=Me.value,rl.value&&(me.setTableLoading(h==null?void 0:h.index),P("change",rl.value)))},{immediate:!0}),a.ref(!1);const ar=(e,l)=>{var n;Ml("createClick"),l===G.pageSize&&(G.currentPage=Math.ceil(((n=Y.value)==null?void 0:n.length)/G.pageSize))},rr=(e,l,n)=>{var r;Xl(n,e,l),Se.value=S.cloneDeep(e),Le.value=e==null?void 0:e.id,Ie.value=(r=Y.value)==null?void 0:r.length,Ue.value=typeof(e==null?void 0:e.id)=="string"?"新增":"编辑",tl(!1)},De=e=>{var c,f,s,E,m,A,_,U,C,O;const{row:l,column:n,item:r,slotData:o}=e;let i=l!=null&&l[n==null?void 0:n.prop]?((f=(c=l==null?void 0:l[n==null?void 0:n.prop])==null?void 0:c[0])==null?void 0:f.contents)??(l==null?void 0:l[n==null?void 0:n.prop]):((E=(s=l==null?void 0:l[r==null?void 0:r.prop])==null?void 0:s[0])==null?void 0:E.contents)??(l==null?void 0:l[r==null?void 0:r.prop])??((A=(m=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:m[0])==null?void 0:A.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((C=(U=l==null?void 0:l[(_=r==null?void 0:r.child)==null?void 0:_.prop])==null?void 0:U[0])==null?void 0:C.contents)??(l==null?void 0:l[(O=r==null?void 0:r.child)==null?void 0:O.prop]),t=Array.isArray(i)&&!(i!=null&&i.every(T=>typeof T=="string"||typeof T=="number"))?"查看":i;return t=Array.isArray(t)?t.join(","):t,t},nr=e=>{var f,s,E,m,A,_,U,C,O,T;const{row:l,column:n,item:r,slotData:o}=e;let i=l!=null&&l[n==null?void 0:n.prop]?((s=(f=l==null?void 0:l[n==null?void 0:n.prop])==null?void 0:f[0])==null?void 0:s.contents)??(l==null?void 0:l[n==null?void 0:n.prop]):((m=(E=l==null?void 0:l[r==null?void 0:r.prop])==null?void 0:E[0])==null?void 0:m.contents)??(l==null?void 0:l[r==null?void 0:r.prop])??((_=(A=o==null?void 0:o[r==null?void 0:r.prop])==null?void 0:A[0])==null?void 0:_.contents)??(o==null?void 0:o[r==null?void 0:r.prop])??((O=(C=l==null?void 0:l[(U=r==null?void 0:r.child)==null?void 0:U.prop])==null?void 0:C[0])==null?void 0:O.contents)??(l==null?void 0:l[(T=r==null?void 0:r.child)==null?void 0:T.prop]);const t=Array.isArray(i)&&!(i!=null&&i.every(N=>typeof N=="string"||typeof N=="number")),c=Array.isArray(i)&&(i==null?void 0:i.find(N=>N==null?void 0:N.url));return t&&c};return(e,l)=>{var f,s,E;const n=a.resolveComponent("svg-icon"),r=a.resolveComponent("el-popover"),o=a.resolveComponent("el-switch"),i=a.resolveComponent("el-checkbox"),p=a.resolveComponent("el-checkbox-group"),t=a.resolveComponent("el-button"),c=a.resolveComponent("LookComponent");return a.openBlock(),a.createElementBlock("div",Nr,[zl.value?(a.openBlock(),a.createBlock(Be.ssTable,{id:"excel-table",pageObj:G,summaryInfo:Ve,columns:j.value,isCardViewport:bl.value,checkedColumns:q.value,key:xl.value+JSON.stringify(j.value),tableData:ya.value,isEditViewport:Qe.value,isShowPagination:Vl.value,isShowEdit:!1,isShowDelete:!1,allowSelect:L.allowSelect,onDbClickRow:ja,extraButton:el.value,rowButton:He.value,cacheExtraButtons:Xe.value,isClearSelection:((f=Oe.value)==null?void 0:f.length)===0,onDoCurrentChange:va,onDoSizeChange:ba,onContentClick:Ka,onRowClick:Fa,onSelectChange:Aa,onCellChange:rr,onChange:Xl,onPreview:Jl,onSubmitEditingTable:Ca,onHandleColEditChange:Da,onHandleColTypeChange:Ta,onClickButton:Dl},a.createSlots({headerButton:a.withCtx(m=>{var A,_;return[L.showHeader?(a.openBlock(),a.createBlock(gr,{key:0,selectNums:(A=Oe.value)==null?void 0:A.length,dataNums:(_=Y.value)==null?void 0:_.length,compName:L.compName,isDevMode:L.isDevMode,buttons:m.buttons,onButtonClick:l[0]||(l[0]=U=>Dl(U,"",{})),columns:j.value,onFilter:Ma,onGetImportData:ka},null,8,["selectNums","dataNums","compName","isDevMode","buttons","columns"])):a.createCommentVNode("",!0)]}),viewport:a.withCtx(()=>{var m,A;return[((m=Y.value)==null?void 0:m.length)>0&&L.allowOperate?(a.openBlock(),a.createElementBlock("div",Br,[(A=He.value)!=null&&A.some(_=>(_==null?void 0:_.label)==="编辑")&&!bl.value?(a.openBlock(),a.createElementBlock("span",{key:0,title:"编辑表格",onClick:ea},[a.createVNode(n,{name:"editTable",class:"view-icon"})])):a.createCommentVNode("",!0),a.createElementVNode("span",{title:"卡片视图",onClick:lr},[a.createVNode(n,{name:"cardViewport",class:"view-icon"})])])):a.createCommentVNode("",!0)]}),rowCreate:a.withCtx(({row:m,index:A})=>[a.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:_=>ar(m,A)},[a.createVNode(n,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,Ur)]),operateCol:a.withCtx(()=>[a.createVNode(r,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"hover",onShow:Xa},{reference:a.withCtx(()=>[a.createElementVNode("span",Or,[a.createVNode(n,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:a.withCtx(()=>[a.createElementVNode("div",wr,[l[11]||(l[11]=a.createElementVNode("div",{class:"group-title"},"表格操作",-1)),a.createVNode(o,{"model-value":Ne.value,"active-text":"排序","inactive-text":"",style:{"margin-right":"8px"},onChange:l[2]||(l[2]=m=>Ul(m,"sortable"))},null,8,["model-value"]),a.createVNode(o,{"model-value":Pe.value,"active-text":"筛选","inactive-text":"",style:{"margin-right":"8px"},onChange:l[3]||(l[3]=m=>Ul(m,"filterable"))},null,8,["model-value"]),a.createVNode(o,{"model-value":ve.value,"active-text":"编辑所有表头","inactive-text":"",onChange:l[4]||(l[4]=m=>Ul(m,"operable"))},null,8,["model-value"]),l[12]||(l[12]=a.createElementVNode("div",{class:"group-title"},"表格列操作",-1)),a.createVNode(p,{modelValue:q.value,"onUpdate:modelValue":l[5]||(l[5]=m=>q.value=m),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:B},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(il.value,m=>(a.openBlock(),a.createElementBlock("div",{style:{display:"flex","align-items":"center"},key:m.label},[a.createVNode(i,{value:m.label,style:{width:"100%",marginRight:0}},{default:a.withCtx(()=>[a.createElementVNode("span",{title:m.label,style:{display:"inline-block",width:"250px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},a.toDisplayString(m.label),9,Lr)]),_:2},1032,["value"]),a.createVNode(r,{title:"列操作",placement:"left",teleported:!1,trigger:"hover"},{reference:a.withCtx(()=>[a.createVNode(n,{name:"colOperate",style:{width:"15px",height:"15px",cursor:"pointer",color:"grey",position:"absolute",right:"40px"}})]),default:a.withCtx(()=>{var A;return[a.createElementVNode("div",Mr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList((A=Object.keys(m))==null?void 0:A.filter(_=>{var U;return(U=re.value)==null?void 0:U.find(C=>(C==null?void 0:C.value)===_)}),_=>{var U,C;return a.openBlock(),a.createElementBlock("div",{key:_},[a.createVNode(o,{"model-value":m==null?void 0:m[_],"active-text":(C=(U=re.value)==null?void 0:U.find(O=>(O==null?void 0:O.value)===_))==null?void 0:C.label,onChange:O=>Na(O,_,m)},null,8,["model-value","active-text","onChange"])])}),128))])]}),_:2},1024),a.createElementVNode("span",jr,[a.createVNode(n,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px"}})])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),content:a.withCtx(m=>{var A,_,U,C,O,T,N,y,v,u,k,d,M,V,I,Z,H,oe;return[nr(m)?(a.openBlock(),a.createBlock(r,{key:0,"popper-class":"file-popover",placement:"right",trigger:"hover",effect:"light",width:"auto"},{reference:a.withCtx(()=>[a.createElementVNode("span",Kr,a.toDisplayString(De(m)),1)]),default:a.withCtx(()=>{var W;return[a.createElementVNode("div",$r,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m==null?void 0:m.row[(W=m==null?void 0:m.column)==null?void 0:W.prop],le=>(a.openBlock(),a.createElementBlock("div",Fr,[a.createElementVNode("div",{class:"prop-url",title:Sl(le),onClick:pe=>Ba(le)},a.toDisplayString(Sl(le)),9,Pr),a.createElementVNode("div",{class:"prop-download",onClick:pe=>Ua(le)}," 下载 ",8,Vr)]))),256))])]}),_:2},1024)):(a.openBlock(),a.createElementBlock("div",{key:1,style:a.normalizeStyle({color:!Array.isArray(De(m))&&((_=(A=De(m))==null?void 0:A.toString())!=null&&_.includes(".txt")||(C=(U=De(m))==null?void 0:U.toString())!=null&&C.includes(".cpt")||(T=(O=De(m))==null?void 0:O.toString())!=null&&T.includes(".cyd"))?"var(--vertical-menuitem-active-bg)":"",textDecoration:!Array.isArray(De(m))&&((y=(N=De(m))==null?void 0:N.toString())!=null&&y.includes(".txt")||(u=(v=De(m))==null?void 0:v.toString())!=null&&u.includes(".cpt")||(d=(k=De(m))==null?void 0:k.toString())!=null&&d.includes(".cyd"))?"underline":"",cursor:!Array.isArray(De(m))&&((V=(M=De(m))==null?void 0:M.toString())!=null&&V.includes(".txt")||(Z=(I=De(m))==null?void 0:I.toString())!=null&&Z.includes(".cpt")||(oe=(H=De(m))==null?void 0:H.toString())!=null&&oe.includes(".cyd"))?"pointer":"",marginLeft:(m==null?void 0:m.colIndex)===0?`${((m==null?void 0:m.level)??0)*20}px`:0}),onClick:W=>ga(De(m))},a.toDisplayString(De(m)),13,zr))]}),_:2},[((s=He.value)==null?void 0:s.length)>0?{name:"actions",fn:a.withCtx(({item:m})=>[a.createVNode(r,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:a.withCtx(()=>[a.createVNode(n,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:a.withCtx(()=>[a.createElementVNode("div",_r,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(Oa(He.value,m),(A,_)=>(a.openBlock(),a.createElementBlock("div",{class:"menu-config-item",key:_,onClick:U=>Dl(A==null?void 0:A.label,m,{extra:A})},[a.createElementVNode("div",{style:a.normalizeStyle({color:A==null?void 0:A.textColor}),class:"extra-button-label"},a.toDisplayString(A==null?void 0:A.label),5)],8,xr))),128))])]),_:2},1024)]),key:"0"}:void 0,((E=Y.value)==null?void 0:E.length)>0?{name:"batchButton",fn:a.withCtx(m=>[a.createVNode(vr,{buttons:m.buttons,selectTableItems:Oe.value,onButtonClick:l[1]||(l[1]=A=>Dl(A,"",{}))},null,8,["buttons","selectTableItems"])]),key:"1"}:void 0]),1032,["pageObj","summaryInfo","columns","isCardViewport","checkedColumns","tableData","isEditViewport","isShowPagination","allowSelect","extraButton","rowButton","cacheExtraButtons","isClearSelection"])):a.createCommentVNode("",!0),a.createVNode(Be.ssDialog,{title:Ue.value,visible:je.value,width:pa.value,onBeforeDestroy:_a},{default:a.withCtx(()=>[a.createElementVNode("div",Jr,[a.createVNode(Be.ssForm,{rowContents:Je.value,isEnableWrap:!1,showOperator:!1,onChange:Qa,onClickTrigger:xa,isEdit:Nl.value,onBlurChange:Ea},null,8,["rowContents","isEdit"])])]),footer:a.withCtx(()=>[gl.value?(a.openBlock(),a.createElementBlock("div",Rr,[a.createVNode(t,{onClick:l[6]||(l[6]=m=>je.value=!1),id:"themeBorderButton"},{default:a.withCtx(()=>l[13]||(l[13]=[a.createTextVNode(a.toDisplayString("取消"))])),_:1,__:[13]}),a.createVNode(t,{class:"ok-button",onClick:l[7]||(l[7]=m=>tl(!0)),id:"themeButton"},{default:a.withCtx(()=>l[14]||(l[14]=[a.createTextVNode(a.toDisplayString("确认"))])),_:1,__:[14]})])):a.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),a.createVNode(Be.ssDialog,{title:Ue.value,visible:hl.value,width:_l.value,onBeforeDestroy:l[9]||(l[9]=m=>hl.value=!1)},{default:a.withCtx(()=>[a.createVNode(Dr)]),footer:a.withCtx(()=>[a.createElementVNode("div",qr,[a.createVNode(t,{onClick:l[8]||(l[8]=m=>hl.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:a.withCtx(()=>l[15]||(l[15]=[a.createTextVNode(a.toDisplayString("取消"))])),_:1,__:[15]}),a.createVNode(t,{class:"ok-button",onClick:Pa,id:"themeButton"},{default:a.withCtx(()=>l[16]||(l[16]=[a.createTextVNode(a.toDisplayString("确认"))])),_:1,__:[16]})])]),_:1},8,["title","visible","width"]),K.value?(a.openBlock(),a.createBlock(Be.ssFilePreview,{key:1,fileDataList:be.value,onDestroy:$a},null,8,["fileDataList"])):a.createCommentVNode("",!0),ye.value?(a.openBlock(),a.createBlock(Be.ssDialog,{key:2,visible:ye.value,onBeforeDestroy:Ga,style:{height:"80vh",width:"80vw"},"body-class":"three-dialog-body","footer-class":"three-dialog-footer"},{default:a.withCtx(()=>[a.createVNode(Tl.threeViewerHost,{"file-urls":ol.value,isThreeScene:Ce.value,isSelfWindow:!0,threeData:Ge.value},null,8,["file-urls","isThreeScene","threeData"])]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createVNode(Be.ssDialog,{visible:e.componentVisible,onBeforeDestroy:l[10]||(l[10]=m=>e.componentVisible=!1),width:_l.value,style:{height:"70vh"}},{default:a.withCtx(()=>[a.createVNode(c,{dialogItem:ml.value},null,8,["dialogItem"])]),_:1},8,["visible","width"])])}}},Gr=Cl._export_sfc(Wr,[["__scopeId","data-v-d4666209"]]);exports.formGetOptions=$l;exports.getSelectRow=Pl;exports.isString=Kl;exports.ssTable=Gr;exports.useFormComp=ia;exports.useFormToTableComp=la;exports.useTableComp=sa;exports.useUnit=aa;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index.vue_vue_type_style_index_0_scoped_92477073_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index.vue_vue_type_style_index_0_scoped_92477073_lang-CaB0r5kb.cjs"),e=require("vue"),u=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),k=["title"],f={key:0,class:"menu-operate-icon"},h={class:"menu-config-wrap"},_=["onClick"],v={class:"module-dialog-content"};function y(o,l,V,M,N,m){var s;const i=e.resolveComponent("svg-icon"),c=e.resolveComponent("el-popover"),p=e.resolveComponent("ssMenu"),r=e.resolveComponent("el-button"),g=e.resolveComponent("ssDialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{class:"vertical-menu",mode:o.mode,menuList:o.renderMenuList,isCollapse:o.isCollapse,onClickMenu:o.clickMenu,onOpenMenu:o.openMenu,onCloseMenu:o.closeMenu},{title:e.withCtx(({menu:t})=>{var a,d;return[e.createElementVNode("span",{title:t.title,class:"menu-title",style:e.normalizeStyle({marginRight:t!=null&&t.config&&((a=t==null?void 0:t.config)==null?void 0:a.length)>0?"25px":"1px"})},e.toDisplayString(t.title??""),13,k),t!=null&&t.config&&((d=t==null?void 0:t.config)==null?void 0:d.length)>0?(e.openBlock(),e.createElementBlock("span",f,[e.createVNode(c,{title:"",placement:"bottom-start",trigger:"click","popper-class":"menu-operate-popover"},{reference:e.withCtx(()=>[e.createVNode(i,{name:"config"})]),default:e.withCtx(()=>[e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t==null?void 0:t.config,n=>(e.openBlock(),e.createElementBlock("div",{class:"menu-config-item",key:n.id,onClick:w=>o.clickMenuIcon(t,n)},[e.createVNode(i,{name:n==null?void 0:n.operateIcon,style:{width:"15px",height:"15px","margin-right":"8px"}},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(n==null?void 0:n.operateType),1)],8,_))),128))])]),_:2},1024)])):e.createCommentVNode("",!0)]}),_:1},8,["mode","menuList","isCollapse","onClickMenu","onOpenMenu","onCloseMenu"]),((s=o.renderMenuList)==null?void 0:s.length)>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fold-icon",onClick:l[0]||(l[0]=(...t)=>o.handleMenuCollapse&&o.handleMenuCollapse(...t))},[e.createVNode(i,{name:o.isCollapse?"expand":"pack",style:{width:"15px",height:"15px"}},null,8,["name"])])):e.createCommentVNode("",!0),e.createVNode(g,{class:"module-dialog",title:o.dialogInfo.title,visible:o.dialogInfo.show,width:o.dialogInfo.width,onBeforeDestroy:o.beforeDialogDestroy},{default:e.withCtx(()=>[e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dialogRenderComps,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.getComponents((t==null?void 0:t.comp)??"Input")),{itemData:t==null?void 0:t.compData,key:t==null?void 0:t.id,content:(t==null?void 0:t.contents)??[],config:t==null?void 0:t.config,onContentChange:o.handleCompChange},null,40,["itemData","content","config","onContentChange"]))]))),128))])]),footer:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(r,{id:"themeBorderButton",onClick:o.beforeDialogDestroy},{default:e.withCtx(()=>l[1]||(l[1]=[e.createTextVNode("取消")])),_:1,__:[1]},8,["onClick"]),e.createVNode(r,{id:"themeButton",onClick:o.clickSubmitForm},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode(" 确认 ")])),_:1,__:[2]},8,["onClick"])])]),_:1},8,["title","visible","width","onBeforeDestroy"])],64)}const B=u._export_sfc(C._sfc_main,[["render",y],["__scopeId","data-v-92477073"]]);exports.default=B;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as C, reactive as k, onMounted as D, resolveComponent as B, resolveDirective as T, createElementBlock as y, openBlock as u, createElementVNode as t, withDirectives as g, createVNode as o, unref as n, toDisplayString as r, createBlock as A } from "vue";
|
|
2
2
|
import { S as I, t as x } from "./index-CwCq-PDq.js";
|
|
3
|
-
import { s as w, a as L } from "./index-
|
|
3
|
+
import { s as w, a as L } from "./index-C537MMhi.js";
|
|
4
4
|
import "./index-BHtNKL1L.js";
|
|
5
5
|
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CFhd0pad.js";
|
|
6
|
-
import { h as E } from "./index-
|
|
6
|
+
import { h as E } from "./index-BtMf3kcU.js";
|
|
7
7
|
import "./index.vue_vue_type_style_index_1_lang-CKG-47Pf.js";
|
|
8
8
|
import { u as N, s as U } from "./index-BQYjK74w.js";
|
|
9
9
|
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|