ss-component-new 1.3.445 → 1.3.447
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-N6lc4Br5.js → array-BamRuoOD.js} +2 -2
- package/dist/{array-B26XuS0b.cjs → array-btZYLqUK.cjs} +1 -1
- package/dist/{index-D0z8dy9n.js → index-B72-4yf7.js} +1 -1
- package/dist/{index-DU8CpKRf.js → index-BHTcqooS.js} +7 -7
- package/dist/{index-CPMaO9p7.cjs → index-BVDaFrR1.cjs} +10 -10
- package/dist/{index-D0e_qlck.js → index-BuKQQPdl.js} +2 -2
- package/dist/{index-B3acTv0R.js → index-C-z-Nlg9.js} +1 -1
- package/dist/{index-BVXoe8kB.cjs → index-C1FnwRUu.cjs} +1 -1
- package/dist/{index-Df2Ticej.cjs → index-C7RhO6sY.cjs} +1 -1
- package/dist/{index-CakAYeCc.js → index-CBXxToaR.js} +2 -2
- package/dist/{index-BkV08RrG.cjs → index-CCs8JfeG.cjs} +1 -1
- package/dist/{index-CBn_Sxx-.js → index-Cd0RwOH4.js} +2 -2
- package/dist/{index-CF8HtruB.cjs → index-CpwW2U4S.cjs} +1 -1
- package/dist/{index-BcUnmNF5.js → index-CzjnoeKD.js} +3 -3
- package/dist/{index-B0C_JfTz.cjs → index-D-j5ega_.cjs} +1 -1
- package/dist/{index-BdcM3AgH.cjs → index-D9epS32a.cjs} +1 -1
- package/dist/{index-Co4pwN6L.js → index-DFUcqAnm.js} +1 -1
- package/dist/{index-BIitwvo2.js → index-DI3TtkkA.js} +2191 -2186
- package/dist/{index-DAQkBDvd.cjs → index-DTKhT44W.cjs} +1 -1
- package/dist/{index-BlZJ8BR2.cjs → index-DdGEVAoz.cjs} +1 -1
- package/dist/{index-BPBzffO_.cjs → index-Dfo0qUQb.cjs} +1 -1
- package/dist/{index-MMgFaywW.js → index-Dg22_ZeG.js} +1 -1
- package/dist/{index-DAE5FhqV.cjs → index-DqxQx4BR.cjs} +1 -1
- package/dist/{index-Du9ewqL6.js → index-RWivHsXr.js} +1 -1
- package/dist/{index-BnNMFmBu.js → index-t1up3rVy.js} +1 -1
- package/dist/{index-3B7_j5gR.cjs → index-wA8Et9Q3.cjs} +1 -1
- package/dist/{main-B85RX9Vd.cjs → main-BMtNW6cb.cjs} +1 -1
- package/dist/{main-CsBHfJ6s.js → main-DW827WGq.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-CVWskoMT.js → threeModel-CJT7ouCQ.js} +1 -1
- package/dist/{threeModel-DkECy3_w.cjs → threeModel-vePnqmZ4.cjs} +1 -1
- package/dist/{threeSceneView-CXZcdFL6.cjs → threeSceneView-BWxf-cVH.cjs} +1 -1
- package/dist/{threeSceneView-so-PHf1-.js → threeSceneView-CGKt1WlS.js} +3 -3
- package/dist/{threeSceneViewForCPMPIP-YTdQQduY.js → threeSceneViewForCPMPIP-B5YgmLd-.js} +1 -1
- package/dist/{threeSceneViewForCPMPIP-CfGNYlv5.cjs → threeSceneViewForCPMPIP-ClxNNEo3.cjs} +1 -1
- package/dist/{threeViewerHost-B_0ydlRz.js → threeViewerHost-B5GraQL0.js} +1 -1
- package/dist/{threeViewerHost-Dme0JKp-.cjs → threeViewerHost-D0tSdUbT.cjs} +1 -1
- package/package.json +1 -1
|
@@ -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-BVDaFrR1.cjs"),n=require("./index-Cvn9j6Uk.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;
|
|
@@ -8,7 +8,7 @@ import { _ as Y0 } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js
|
|
|
8
8
|
import { m as Ki, B as $9, X as l8 } from "./index-CmJoUVma.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { s as J4 } from "./index-11kpzK0A.js";
|
|
11
|
-
import { T as Xi, a as j9 } from "./threeViewerHost-
|
|
11
|
+
import { T as Xi, a as j9 } from "./threeViewerHost-B5GraQL0.js";
|
|
12
12
|
import { A as W9 } from "./index-xrsX_7VG.js";
|
|
13
13
|
var U9 = "[object Date]";
|
|
14
14
|
function I9(n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./request-Dl8yi2iS.cjs"),N=require("./index-mqL-OFAs.cjs"),L=require("./index-Dom0zBom.cjs"),oe=require("./index-B-pflqKE.cjs");require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs");require("./index-CPMaO9p7.cjs");require("./index-BpPyaNFa.cjs");const b=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index-BTEY8ajW.cjs");require("./index-3B7_j5gR.cjs");const z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=require("./clone-7j6nCPRO.cjs"),je={class:"param-auth"},Ge={class:"body"},Qe={class:"node-content-wrapper"},He={class:"node-label-wrapper"},Je={class:"node-label"},We=e.defineComponent({__name:"index",props:{params:{},checkedParams:{}},setup($,{expose:E}){const c=$,y={value:"uniqueKey",label:"label",children:"children",class:f=>{}},{buildParamAuthTree:g}=N.useRole(),p=e.ref(),w=e.computed(()=>g(c.params)),i=e.computed(()=>c.checkedParams.map(f=>`${f.id}_${f.prop}`));return E({getCheckedParams:()=>{var d;return((d=p.value)==null?void 0:d.getCheckedNodes())||[]}}),(f,d)=>{const v=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",je,[d[0]||(d[0]=e.createElementVNode("div",{class:"header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",Ge,[e.createVNode(v,{ref_key:"paramTreeRef",ref:p,class:"param-tree",data:w.value,props:y,"node-key":"uniqueKey","show-checkbox":"","default-expanded-keys":i.value,"default-checked-keys":i.value,height:"100%"},{default:e.withCtx(({node:u,data:P})=>[e.createElementVNode("div",Qe,[e.createElementVNode("div",He,[e.createElementVNode("div",Je,e.toDisplayString(u.label),1)])])]),_:1},8,["data","default-expanded-keys","default-checked-keys"])]),d[1]||(d[1]=e.createElementVNode("div",{class:"footer"},[e.createElementVNode("div",{class:"footer-left"}),e.createElementVNode("div",{class:"footer-right"})],-1))])}}}),Xe=z._export_sfc(We,[["__scopeId","data-v-b7ce5c18"]]),Ye={class:"param-wrapper"},Ze={class:"param-body"},et={class:"role-form-wrapper"},tt={class:"edit-footer"},ot={class:"footer-right"},at=e.defineComponent({__name:"index",props:{params:{},checkedParams:{}},emits:["updateParams"],setup($,{expose:E,emit:c}){const y=c,g=e.ref(),p=e.ref(!1),w=()=>{p.value=!0},i=()=>{p.value=!1},_=()=>{i()},f=()=>{const v=d();y("updateParams",v),i()},d=()=>{var u;return((u=g.value)==null?void 0:u.getCheckedParams())||[]};return E({openEditDialog:w}),(v,u)=>(e.openBlock(),e.createBlock(oe.ssDialog,{class:"param-edit-dialog",visible:p.value,title:"参数权限",onBeforeDestroy:i,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"role-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[u[0]||(u[0]=e.createElementVNode("div",{class:"param-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createVNode(Xe,{ref_key:"paramAuthTree",ref:g,params:v.params,"checked-params":v.checkedParams},null,8,["params","checked-params"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",tt,[u[1]||(u[1]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",ot,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:_,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:f,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"]))}}),lt=z._export_sfc(at,[["__scopeId","data-v-875ed466"]]),rt={class:"scope-management-wrapper"},nt={class:"scope-management-body"},st={class:"scope-form-wrapper"},it={class:"edit-footer"},ct={class:"footer-right"},dt=e.defineComponent({__name:"index",emits:["confirm"],setup($,{expose:E,emit:c}){const y=c,{initDepartmentScope:g}=L.useDataPermission(),p=e.ref(),w=e.reactive({departmentScope:[{required:!0,message:"请输入角色名称",trigger:"change"}]}),i=e.ref(g()),_=e.ref(!1),f=()=>{_.value=!0},d=()=>{_.value=!1},v=async h=>{i.value=te.clone(h),f()},u=()=>{i.value=g(),d()},P=async()=>{var h,m;await((m=(h=p.value)==null?void 0:h.validate)==null?void 0:m.call(h)),y("confirm",te.clone(i.value)),u()};return E({handleEdit:v}),(h,m)=>{const U=e.resolveComponent("el-radio"),M=e.resolveComponent("el-radio-group"),K=e.resolveComponent("el-form-item"),j=e.resolveComponent("el-col"),G=e.resolveComponent("el-row"),Q=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(oe.ssDialog,{class:"scope-edit-dialog",visible:_.value,title:"数据权限",onBeforeDestroy:d,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"scope-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",rt,[m[1]||(m[1]=e.createElementVNode("div",{class:"scope-management-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",nt,[e.createElementVNode("div",st,[e.createVNode(Q,{class:"scope-edit-form",ref_key:"scopeFormRef",ref:p,model:i.value,rules:w},{default:e.withCtx(()=>[e.createVNode(G,{gutter:20},{default:e.withCtx(()=>[e.createVNode(j,{span:24},{default:e.withCtx(()=>[e.createVNode(K,{prop:"departmentScope",label:"部门权限范围","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(M,{modelValue:i.value.departmentScope,"onUpdate:modelValue":m[0]||(m[0]=C=>i.value.departmentScope=C)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L.departmentScopeOptions),C=>(e.openBlock(),e.createBlock(U,{key:C.value,value:C.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",it,[m[2]||(m[2]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",ct,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:u,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:P,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"])}}}),ut=z._export_sfc(dt,[["__scopeId","data-v-40d37c72"]]),pt={class:"role-management"},mt={class:"header"},_t={class:"header-left"},ft={class:"query-wrapper"},vt={class:"header-right"},Vt={class:"body"},gt={class:"role-table-wrapper"},ht={class:"operate-list"},Ct=["onClick"],Nt={class:"pagination-wrapper"},yt={class:"role-management-wrapper"},wt={class:"role-management-body"},kt={class:"role-form-wrapper"},Et={class:"auth-tree-wrapper"},xt={class:"node-content-wrapper"},bt={class:"node-label-wrapper"},Tt={class:"node-label"},Pt={key:0,class:"status-tag"},Bt={key:1,class:"status-tag"},Dt={key:2,class:"status-tag"},St={key:3,class:"status-tag"},Lt={class:"edit-footer"},$t={class:"footer-right"},It=e.defineComponent({__name:"index",setup($){const E={value:"id",label:"label",children:"children"},c=L.useMenuState(L.pinia),{initDepartmentScope:y,recAndInitNodeDataPermission:g}=L.useDataPermission(),{initRoleItem:p,queryInfo:w,resetQuery:i,pageInfo:_,setPageNum:f,setPageSize:d,initGetByPage:v,initCreate:u,initUpdate:P,initDelete:h,propertyAuthTree:m,initPropertyAuthTree:U,getStatusLabelByValue:M,getStatusTagByValue:K,getFeatureStatusLabelByValue:j,getFeatureStatusTagByValue:G,initRoleConfig:Q,hasRoleEditAuth:C,isTableFeature:fe,initImport:ve,initExport:Ve,exportTemplate:ge}=N.useRole(),ae=e.ref([]),he=async()=>{const o=await v(),{roleData:t=[]}=o;return t},B=async()=>{ae.value=await he()},Ce=o=>{f(o),B()},Ne=o=>{d(o),B()},ye=async()=>{i(),c.setImportLoading(!0),await B().finally(()=>{c.setImportLoading(!1)})},T=async()=>{await B(),await Q()};e.onMounted(()=>{T()});const le=e.ref(),we=e.reactive({name:[{required:!0,message:"请输入角色名称",trigger:"blur"}]}),I=e.ref(),q=e.ref(""),n=e.ref(p());e.watch(q,o=>{I.value.filter(o)});const ke=(o,t)=>o?t.label.includes(o):!0,re=e.ref([]),R=e.ref(),Ee=(o,t)=>{var a;o.stopPropagation(),re.value=t.params||[],(a=R==null?void 0:R.value)==null||a.openEditDialog()},xe=o=>{var s;const t=(s=o==null?void 0:o[0])==null?void 0:s.id,a=n.value.params.filter(V=>V.id!==t);n.value.params=[...a,...o]},H=e.ref(!1),be=()=>{H.value=!0},ne=()=>{q.value="",H.value=!1},se=async o=>{if(!C.value)return;const t=[];o&&t.push(o.role_id),await U(t);let a={};o!=null&&o.role_id||(a={checkAll:!0,tree:m.value}),n.value=p(o,a),be()},ie=()=>{n.value=p(),ne()},Te=async()=>{var a,s,V;await((s=(a=le.value)==null?void 0:a.validate)==null?void 0:s.call(a));let o=((V=I.value)==null?void 0:V.getCheckedNodes())||[];o=o.filter(k=>k.isPropertyLeaf),o=o.map(k=>{const{departmentScope:X}=k.dataPermission||{};return{...k,department_scope:X}}),n.value.main_ids=o;const{role_id:t}=n.value;t?await De():await Be(),ie()},Pe=async o=>{if(!C.value)return;const{status:t}=o;N.statusConstants.ENABLE.value===t?o.status=N.statusConstants.DISABLED.value:o.status=N.statusConstants.ENABLE.value,await P(o),await T()},Be=async()=>{await u(n.value),await T()},De=async()=>{await P(n.value),await T()},Se=async o=>{await h(o),await T()},Le=async(o,t)=>{if(!C.value)return;const{value:a}=o,s=t.row;if(a==="edit"){se(s);return}if(a==="delete"){await Se(s);return}},$e=async(o,t)=>{o.stopPropagation();const{status:a}=t;N.featureStatusConstants.EDITABLE.value===a?t.status=N.featureStatusConstants.DISABLED.value:t.status=N.featureStatusConstants.EDITABLE.value},J=o=>{var a;return(((a=I.value)==null?void 0:a.getCheckedKeys(!0))||[]).includes(o.id)},ce=e.ref(),A=e.ref(),W=e.ref(y()),de=(o,t)=>{var a;o.stopPropagation(),A.value=t,t.isPropertyLeaf&&(W.value=te.clone(t.dataPermission)),t.isProperty||(W.value=y("")),(a=ce.value)==null||a.handleEdit(W.value)},Ie=o=>{const{isProperty:t,isPropertyLeaf:a}=A.value;if(a){A.value.dataPermission=o;return}if(!t){g(A.value,o);return}},qe=async()=>{await Re()},Re=async()=>{const o=document.createElement("input");o.type="file",o.accept=".xlsx",o.onchange=async t=>{var V;const s=(V=t.target.files)==null?void 0:V[0];if(s)try{c.setImportLoading(!0),await ve(s),await T(),c.setImportLoading(!1)}catch{c.setImportLoading(!1)}},o.click()},Ae=async()=>{c.setImportLoading(!0),await Ve().finally(()=>{c.setImportLoading(!1)})},Fe=async()=>{ge()};return(o,t)=>{var ue,pe,me,_e;const a=e.resolveComponent("el-input"),s=e.resolveComponent("el-button"),V=e.resolveComponent("el-icon"),k=e.resolveComponent("el-dropdown-item"),X=e.resolveComponent("el-dropdown-menu"),Oe=e.resolveComponent("el-dropdown"),D=e.resolveComponent("el-table-column"),S=e.resolveComponent("el-tag"),ze=e.resolveComponent("el-table"),Ue=e.resolveComponent("el-pagination"),F=e.resolveComponent("el-form-item"),O=e.resolveComponent("el-col"),Y=e.resolveComponent("el-row"),Me=e.resolveComponent("el-tree"),Ke=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("div",_t,[e.createElementVNode("div",ft,[e.createVNode(a,{modelValue:e.unref(w).name,"onUpdate:modelValue":t[0]||(t[0]=l=>e.unref(w).name=l),style:{width:"240px"},placeholder:"请输入名称"},null,8,["modelValue"]),e.createVNode(s,{type:"primary",onClick:B},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode("查询")])),_:1,__:[6]}),e.createVNode(s,{type:"primary",plain:"",onClick:ye},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode("重置")])),_:1,__:[7]})])]),e.createElementVNode("div",vt,[e.createVNode(s,{type:"primary",onClick:qe},{default:e.withCtx(()=>[t[8]||(t[8]=e.createTextVNode(" 导入 ")),e.createVNode(V,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.upload_default))]),_:1})]),_:1,__:[8]}),e.createVNode(Oe,null,{dropdown:e.withCtx(()=>[e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(k,{onClick:Fe},{default:e.withCtx(()=>t[10]||(t[10]=[e.createTextVNode("导出模板")])),_:1,__:[10]}),e.createVNode(k,{onClick:Ae},{default:e.withCtx(()=>t[11]||(t[11]=[e.createTextVNode("导出数据")])),_:1,__:[11]})]),_:1})]),default:e.withCtx(()=>[e.createVNode(s,{type:"primary"},{default:e.withCtx(()=>[t[9]||(t[9]=e.createTextVNode(" 导出 ")),e.createVNode(V,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.arrow_down_default))]),_:1})]),_:1,__:[9]})]),_:1}),e.createVNode(b._sfc_main,{emptyColor:!0,onClickTrigger:t[1]||(t[1]=l=>se()),modelValue:"创建角色",buttonType:"primary"})])]),e.createElementVNode("div",Vt,[e.createElementVNode("div",gt,[e.createVNode(ze,{class:"role-table",data:ae.value,"empty-text":""},{default:e.withCtx(()=>[e.createVNode(D,{prop:"name",label:"名称",align:"center"}),e.createVNode(D,{prop:"code",label:"编码",align:"center"}),e.createVNode(D,{prop:"remark",label:"备注",align:"center"}),e.createVNode(D,{prop:"status",label:"状态",align:"center"},{default:e.withCtx(l=>[e.createVNode(S,{class:"status-tag",type:e.unref(K)(l.row.status),title:"点击切换",onClick:r=>Pe(l.row)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)(l.row.status)),1)]),_:2},1032,["type","onClick"])]),_:1}),e.createVNode(D,{label:"操作",align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N.operateList),r=>(e.openBlock(),e.createElementBlock("div",{class:"operate-item",key:r.value,onClick:e.withModifiers(Z=>Le(r,l),["stop"])},e.toDisplayString(r.label),9,Ct))),128))])]),_:1})]),_:1},8,["data"])]),e.createElementVNode("div",Nt,[t[12]||(t[12]=e.createElementVNode("div",null,null,-1)),e.createVNode(Ue,{onSizeChange:Ne,onCurrentChange:Ce,"current-page":(ue=e.unref(_))==null?void 0:ue.pageNum,"page-sizes":(pe=e.unref(_))==null?void 0:pe.pageSizes,"page-size":((me=e.unref(_))==null?void 0:me.pageSize)??10,layout:"total, sizes, prev, pager, next, jumper",total:((_e=e.unref(_))==null?void 0:_e.total)??0},null,8,["current-page","page-sizes","page-size","total"])])]),t[13]||(t[13]=e.createElementVNode("div",{class:"footer"},[e.createElementVNode("div",{class:"footer-left"}),e.createElementVNode("div",{class:"footer-right"})],-1))]),e.createVNode(oe.ssDialog,{class:"role-edit-dialog",visible:H.value,title:"角色信息",onBeforeDestroy:ne,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"role-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",yt,[t[17]||(t[17]=e.createElementVNode("div",{class:"role-management-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",wt,[e.createElementVNode("div",kt,[e.createVNode(Ke,{class:"role-edit-form",ref_key:"roleFormRef",ref:le,model:n.value,rules:we},{default:e.withCtx(()=>[e.createVNode(Y,{gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{prop:"name",label:"角色名称","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.name,"onUpdate:modelValue":t[2]||(t[2]=l=>n.value.name=l),"aria-label":"角色名称",placeholder:"角色名称"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{label:"角色编码","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.code,"onUpdate:modelValue":t[3]||(t[3]=l=>n.value.code=l),"aria-label":"角色编码",placeholder:"角色编码"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(Y,{gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{label:"备注","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.remark,"onUpdate:modelValue":t[4]||(t[4]=l=>n.value.remark=l),"aria-label":"备注",placeholder:"备注"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(Y,{class:"auth-tree-row",gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:24},{default:e.withCtx(()=>[e.createVNode(F,{label:"特性权限","label-position":"top"},{default:e.withCtx(()=>[e.createElementVNode("div",Et,[e.createVNode(a,{modelValue:q.value,"onUpdate:modelValue":t[5]||(t[5]=l=>q.value=l)},{prefix:e.withCtx(()=>[e.createVNode(V,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.search_default))]),_:1})]),_:1},8,["modelValue"]),e.createVNode(Me,{ref_key:"propertyTreeRef",ref:I,class:"auth-tree",data:e.unref(m),props:E,"node-key":"id","show-checkbox":"","default-expanded-keys":n.value.checked_ids,"default-checked-keys":n.value.checked_ids,"filter-node-method":ke},{default:e.withCtx(({node:l,data:r})=>{var Z;return[e.createElementVNode("div",xt,[e.createElementVNode("div",bt,[e.createElementVNode("div",Tt,e.toDisplayString(l.label),1)]),r.isPropertyLeaf&&J(r)?(e.openBlock(),e.createElementBlock("div",Pt,[e.createVNode(S,{class:"status-tag",type:e.unref(G)(r.status),title:"点击切换",onClick:x=>$e(x,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(j)(r.status)),1)]),_:2},1032,["type","onClick"])])):e.createCommentVNode("",!0),r.isProperty&&J(r)&&((Z=r.params)==null?void 0:Z.length)>0?(e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(S,{class:"status-tag",type:"success",onClick:x=>Ee(x,r)},{default:e.withCtx(()=>t[14]||(t[14]=[e.createTextVNode(" 参数设置 ")])),_:2,__:[14]},1032,["onClick"])])):e.createCommentVNode("",!0),r.isPropertyLeaf&&J(r)&&e.unref(fe)(r)?(e.openBlock(),e.createElementBlock("div",Dt,[e.createVNode(S,{class:"status-tag",type:"warning",onClick:x=>de(x,r)},{default:e.withCtx(()=>t[15]||(t[15]=[e.createTextVNode(" 数据权限 ")])),_:2,__:[15]},1032,["onClick"])])):e.createCommentVNode("",!0),l.level==1&&l.checked&&!r.isProperty?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(S,{class:"status-tag",type:"warning",onClick:x=>de(x,r)},{default:e.withCtx(()=>t[16]||(t[16]=[e.createTextVNode(" 数据权限重置 ")])),_:2,__:[16]},1032,["onClick"])])):e.createCommentVNode("",!0)])]}),_:1},8,["data","default-expanded-keys","default-checked-keys"])])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",Lt,[t[18]||(t[18]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",$t,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:ie,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:Te,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"]),e.createVNode(lt,{ref_key:"paramAuthDialog",ref:R,params:re.value,"checked-params":n.value.params,onUpdateParams:xe},null,8,["params","checked-params"]),e.createVNode(ut,{ref_key:"scopeDialog",ref:ce,onConfirm:Ie},null,512)],64)}}}),qt=z._export_sfc(It,[["__scopeId","data-v-5da1e93d"]]);exports.default=qt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./request-Dl8yi2iS.cjs"),N=require("./index-mqL-OFAs.cjs"),L=require("./index-Dom0zBom.cjs"),oe=require("./index-B-pflqKE.cjs");require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs");require("./index-BVDaFrR1.cjs");require("./index-BpPyaNFa.cjs");const b=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index-BTEY8ajW.cjs");require("./index-wA8Et9Q3.cjs");const z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=require("./clone-7j6nCPRO.cjs"),je={class:"param-auth"},Ge={class:"body"},Qe={class:"node-content-wrapper"},He={class:"node-label-wrapper"},Je={class:"node-label"},We=e.defineComponent({__name:"index",props:{params:{},checkedParams:{}},setup($,{expose:E}){const c=$,y={value:"uniqueKey",label:"label",children:"children",class:f=>{}},{buildParamAuthTree:g}=N.useRole(),p=e.ref(),w=e.computed(()=>g(c.params)),i=e.computed(()=>c.checkedParams.map(f=>`${f.id}_${f.prop}`));return E({getCheckedParams:()=>{var d;return((d=p.value)==null?void 0:d.getCheckedNodes())||[]}}),(f,d)=>{const v=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",je,[d[0]||(d[0]=e.createElementVNode("div",{class:"header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",Ge,[e.createVNode(v,{ref_key:"paramTreeRef",ref:p,class:"param-tree",data:w.value,props:y,"node-key":"uniqueKey","show-checkbox":"","default-expanded-keys":i.value,"default-checked-keys":i.value,height:"100%"},{default:e.withCtx(({node:u,data:P})=>[e.createElementVNode("div",Qe,[e.createElementVNode("div",He,[e.createElementVNode("div",Je,e.toDisplayString(u.label),1)])])]),_:1},8,["data","default-expanded-keys","default-checked-keys"])]),d[1]||(d[1]=e.createElementVNode("div",{class:"footer"},[e.createElementVNode("div",{class:"footer-left"}),e.createElementVNode("div",{class:"footer-right"})],-1))])}}}),Xe=z._export_sfc(We,[["__scopeId","data-v-b7ce5c18"]]),Ye={class:"param-wrapper"},Ze={class:"param-body"},et={class:"role-form-wrapper"},tt={class:"edit-footer"},ot={class:"footer-right"},at=e.defineComponent({__name:"index",props:{params:{},checkedParams:{}},emits:["updateParams"],setup($,{expose:E,emit:c}){const y=c,g=e.ref(),p=e.ref(!1),w=()=>{p.value=!0},i=()=>{p.value=!1},_=()=>{i()},f=()=>{const v=d();y("updateParams",v),i()},d=()=>{var u;return((u=g.value)==null?void 0:u.getCheckedParams())||[]};return E({openEditDialog:w}),(v,u)=>(e.openBlock(),e.createBlock(oe.ssDialog,{class:"param-edit-dialog",visible:p.value,title:"参数权限",onBeforeDestroy:i,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"role-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[u[0]||(u[0]=e.createElementVNode("div",{class:"param-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createVNode(Xe,{ref_key:"paramAuthTree",ref:g,params:v.params,"checked-params":v.checkedParams},null,8,["params","checked-params"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",tt,[u[1]||(u[1]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",ot,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:_,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:f,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"]))}}),lt=z._export_sfc(at,[["__scopeId","data-v-875ed466"]]),rt={class:"scope-management-wrapper"},nt={class:"scope-management-body"},st={class:"scope-form-wrapper"},it={class:"edit-footer"},ct={class:"footer-right"},dt=e.defineComponent({__name:"index",emits:["confirm"],setup($,{expose:E,emit:c}){const y=c,{initDepartmentScope:g}=L.useDataPermission(),p=e.ref(),w=e.reactive({departmentScope:[{required:!0,message:"请输入角色名称",trigger:"change"}]}),i=e.ref(g()),_=e.ref(!1),f=()=>{_.value=!0},d=()=>{_.value=!1},v=async h=>{i.value=te.clone(h),f()},u=()=>{i.value=g(),d()},P=async()=>{var h,m;await((m=(h=p.value)==null?void 0:h.validate)==null?void 0:m.call(h)),y("confirm",te.clone(i.value)),u()};return E({handleEdit:v}),(h,m)=>{const U=e.resolveComponent("el-radio"),M=e.resolveComponent("el-radio-group"),K=e.resolveComponent("el-form-item"),j=e.resolveComponent("el-col"),G=e.resolveComponent("el-row"),Q=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(oe.ssDialog,{class:"scope-edit-dialog",visible:_.value,title:"数据权限",onBeforeDestroy:d,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"scope-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",rt,[m[1]||(m[1]=e.createElementVNode("div",{class:"scope-management-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",nt,[e.createElementVNode("div",st,[e.createVNode(Q,{class:"scope-edit-form",ref_key:"scopeFormRef",ref:p,model:i.value,rules:w},{default:e.withCtx(()=>[e.createVNode(G,{gutter:20},{default:e.withCtx(()=>[e.createVNode(j,{span:24},{default:e.withCtx(()=>[e.createVNode(K,{prop:"departmentScope",label:"部门权限范围","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(M,{modelValue:i.value.departmentScope,"onUpdate:modelValue":m[0]||(m[0]=C=>i.value.departmentScope=C)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L.departmentScopeOptions),C=>(e.openBlock(),e.createBlock(U,{key:C.value,value:C.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",it,[m[2]||(m[2]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",ct,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:u,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:P,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"])}}}),ut=z._export_sfc(dt,[["__scopeId","data-v-40d37c72"]]),pt={class:"role-management"},mt={class:"header"},_t={class:"header-left"},ft={class:"query-wrapper"},vt={class:"header-right"},Vt={class:"body"},gt={class:"role-table-wrapper"},ht={class:"operate-list"},Ct=["onClick"],Nt={class:"pagination-wrapper"},yt={class:"role-management-wrapper"},wt={class:"role-management-body"},kt={class:"role-form-wrapper"},Et={class:"auth-tree-wrapper"},xt={class:"node-content-wrapper"},bt={class:"node-label-wrapper"},Tt={class:"node-label"},Pt={key:0,class:"status-tag"},Bt={key:1,class:"status-tag"},Dt={key:2,class:"status-tag"},St={key:3,class:"status-tag"},Lt={class:"edit-footer"},$t={class:"footer-right"},It=e.defineComponent({__name:"index",setup($){const E={value:"id",label:"label",children:"children"},c=L.useMenuState(L.pinia),{initDepartmentScope:y,recAndInitNodeDataPermission:g}=L.useDataPermission(),{initRoleItem:p,queryInfo:w,resetQuery:i,pageInfo:_,setPageNum:f,setPageSize:d,initGetByPage:v,initCreate:u,initUpdate:P,initDelete:h,propertyAuthTree:m,initPropertyAuthTree:U,getStatusLabelByValue:M,getStatusTagByValue:K,getFeatureStatusLabelByValue:j,getFeatureStatusTagByValue:G,initRoleConfig:Q,hasRoleEditAuth:C,isTableFeature:fe,initImport:ve,initExport:Ve,exportTemplate:ge}=N.useRole(),ae=e.ref([]),he=async()=>{const o=await v(),{roleData:t=[]}=o;return t},B=async()=>{ae.value=await he()},Ce=o=>{f(o),B()},Ne=o=>{d(o),B()},ye=async()=>{i(),c.setImportLoading(!0),await B().finally(()=>{c.setImportLoading(!1)})},T=async()=>{await B(),await Q()};e.onMounted(()=>{T()});const le=e.ref(),we=e.reactive({name:[{required:!0,message:"请输入角色名称",trigger:"blur"}]}),I=e.ref(),q=e.ref(""),n=e.ref(p());e.watch(q,o=>{I.value.filter(o)});const ke=(o,t)=>o?t.label.includes(o):!0,re=e.ref([]),R=e.ref(),Ee=(o,t)=>{var a;o.stopPropagation(),re.value=t.params||[],(a=R==null?void 0:R.value)==null||a.openEditDialog()},xe=o=>{var s;const t=(s=o==null?void 0:o[0])==null?void 0:s.id,a=n.value.params.filter(V=>V.id!==t);n.value.params=[...a,...o]},H=e.ref(!1),be=()=>{H.value=!0},ne=()=>{q.value="",H.value=!1},se=async o=>{if(!C.value)return;const t=[];o&&t.push(o.role_id),await U(t);let a={};o!=null&&o.role_id||(a={checkAll:!0,tree:m.value}),n.value=p(o,a),be()},ie=()=>{n.value=p(),ne()},Te=async()=>{var a,s,V;await((s=(a=le.value)==null?void 0:a.validate)==null?void 0:s.call(a));let o=((V=I.value)==null?void 0:V.getCheckedNodes())||[];o=o.filter(k=>k.isPropertyLeaf),o=o.map(k=>{const{departmentScope:X}=k.dataPermission||{};return{...k,department_scope:X}}),n.value.main_ids=o;const{role_id:t}=n.value;t?await De():await Be(),ie()},Pe=async o=>{if(!C.value)return;const{status:t}=o;N.statusConstants.ENABLE.value===t?o.status=N.statusConstants.DISABLED.value:o.status=N.statusConstants.ENABLE.value,await P(o),await T()},Be=async()=>{await u(n.value),await T()},De=async()=>{await P(n.value),await T()},Se=async o=>{await h(o),await T()},Le=async(o,t)=>{if(!C.value)return;const{value:a}=o,s=t.row;if(a==="edit"){se(s);return}if(a==="delete"){await Se(s);return}},$e=async(o,t)=>{o.stopPropagation();const{status:a}=t;N.featureStatusConstants.EDITABLE.value===a?t.status=N.featureStatusConstants.DISABLED.value:t.status=N.featureStatusConstants.EDITABLE.value},J=o=>{var a;return(((a=I.value)==null?void 0:a.getCheckedKeys(!0))||[]).includes(o.id)},ce=e.ref(),A=e.ref(),W=e.ref(y()),de=(o,t)=>{var a;o.stopPropagation(),A.value=t,t.isPropertyLeaf&&(W.value=te.clone(t.dataPermission)),t.isProperty||(W.value=y("")),(a=ce.value)==null||a.handleEdit(W.value)},Ie=o=>{const{isProperty:t,isPropertyLeaf:a}=A.value;if(a){A.value.dataPermission=o;return}if(!t){g(A.value,o);return}},qe=async()=>{await Re()},Re=async()=>{const o=document.createElement("input");o.type="file",o.accept=".xlsx",o.onchange=async t=>{var V;const s=(V=t.target.files)==null?void 0:V[0];if(s)try{c.setImportLoading(!0),await ve(s),await T(),c.setImportLoading(!1)}catch{c.setImportLoading(!1)}},o.click()},Ae=async()=>{c.setImportLoading(!0),await Ve().finally(()=>{c.setImportLoading(!1)})},Fe=async()=>{ge()};return(o,t)=>{var ue,pe,me,_e;const a=e.resolveComponent("el-input"),s=e.resolveComponent("el-button"),V=e.resolveComponent("el-icon"),k=e.resolveComponent("el-dropdown-item"),X=e.resolveComponent("el-dropdown-menu"),Oe=e.resolveComponent("el-dropdown"),D=e.resolveComponent("el-table-column"),S=e.resolveComponent("el-tag"),ze=e.resolveComponent("el-table"),Ue=e.resolveComponent("el-pagination"),F=e.resolveComponent("el-form-item"),O=e.resolveComponent("el-col"),Y=e.resolveComponent("el-row"),Me=e.resolveComponent("el-tree"),Ke=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("div",_t,[e.createElementVNode("div",ft,[e.createVNode(a,{modelValue:e.unref(w).name,"onUpdate:modelValue":t[0]||(t[0]=l=>e.unref(w).name=l),style:{width:"240px"},placeholder:"请输入名称"},null,8,["modelValue"]),e.createVNode(s,{type:"primary",onClick:B},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode("查询")])),_:1,__:[6]}),e.createVNode(s,{type:"primary",plain:"",onClick:ye},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode("重置")])),_:1,__:[7]})])]),e.createElementVNode("div",vt,[e.createVNode(s,{type:"primary",onClick:qe},{default:e.withCtx(()=>[t[8]||(t[8]=e.createTextVNode(" 导入 ")),e.createVNode(V,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.upload_default))]),_:1})]),_:1,__:[8]}),e.createVNode(Oe,null,{dropdown:e.withCtx(()=>[e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(k,{onClick:Fe},{default:e.withCtx(()=>t[10]||(t[10]=[e.createTextVNode("导出模板")])),_:1,__:[10]}),e.createVNode(k,{onClick:Ae},{default:e.withCtx(()=>t[11]||(t[11]=[e.createTextVNode("导出数据")])),_:1,__:[11]})]),_:1})]),default:e.withCtx(()=>[e.createVNode(s,{type:"primary"},{default:e.withCtx(()=>[t[9]||(t[9]=e.createTextVNode(" 导出 ")),e.createVNode(V,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.arrow_down_default))]),_:1})]),_:1,__:[9]})]),_:1}),e.createVNode(b._sfc_main,{emptyColor:!0,onClickTrigger:t[1]||(t[1]=l=>se()),modelValue:"创建角色",buttonType:"primary"})])]),e.createElementVNode("div",Vt,[e.createElementVNode("div",gt,[e.createVNode(ze,{class:"role-table",data:ae.value,"empty-text":""},{default:e.withCtx(()=>[e.createVNode(D,{prop:"name",label:"名称",align:"center"}),e.createVNode(D,{prop:"code",label:"编码",align:"center"}),e.createVNode(D,{prop:"remark",label:"备注",align:"center"}),e.createVNode(D,{prop:"status",label:"状态",align:"center"},{default:e.withCtx(l=>[e.createVNode(S,{class:"status-tag",type:e.unref(K)(l.row.status),title:"点击切换",onClick:r=>Pe(l.row)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)(l.row.status)),1)]),_:2},1032,["type","onClick"])]),_:1}),e.createVNode(D,{label:"操作",align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N.operateList),r=>(e.openBlock(),e.createElementBlock("div",{class:"operate-item",key:r.value,onClick:e.withModifiers(Z=>Le(r,l),["stop"])},e.toDisplayString(r.label),9,Ct))),128))])]),_:1})]),_:1},8,["data"])]),e.createElementVNode("div",Nt,[t[12]||(t[12]=e.createElementVNode("div",null,null,-1)),e.createVNode(Ue,{onSizeChange:Ne,onCurrentChange:Ce,"current-page":(ue=e.unref(_))==null?void 0:ue.pageNum,"page-sizes":(pe=e.unref(_))==null?void 0:pe.pageSizes,"page-size":((me=e.unref(_))==null?void 0:me.pageSize)??10,layout:"total, sizes, prev, pager, next, jumper",total:((_e=e.unref(_))==null?void 0:_e.total)??0},null,8,["current-page","page-sizes","page-size","total"])])]),t[13]||(t[13]=e.createElementVNode("div",{class:"footer"},[e.createElementVNode("div",{class:"footer-left"}),e.createElementVNode("div",{class:"footer-right"})],-1))]),e.createVNode(oe.ssDialog,{class:"role-edit-dialog",visible:H.value,title:"角色信息",onBeforeDestroy:ne,showClose:!0,closeOnClickModal:!1,closeOnPressEscape:!1,modalClass:"role-edit-modal",alignCenter:!0,appendToBody:!1},{default:e.withCtx(()=>[e.createElementVNode("div",yt,[t[17]||(t[17]=e.createElementVNode("div",{class:"role-management-header"},[e.createElementVNode("div",{class:"header-left"}),e.createElementVNode("div",{class:"header-right"})],-1)),e.createElementVNode("div",wt,[e.createElementVNode("div",kt,[e.createVNode(Ke,{class:"role-edit-form",ref_key:"roleFormRef",ref:le,model:n.value,rules:we},{default:e.withCtx(()=>[e.createVNode(Y,{gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{prop:"name",label:"角色名称","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.name,"onUpdate:modelValue":t[2]||(t[2]=l=>n.value.name=l),"aria-label":"角色名称",placeholder:"角色名称"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{label:"角色编码","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.code,"onUpdate:modelValue":t[3]||(t[3]=l=>n.value.code=l),"aria-label":"角色编码",placeholder:"角色编码"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(Y,{gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:12},{default:e.withCtx(()=>[e.createVNode(F,{label:"备注","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:n.value.remark,"onUpdate:modelValue":t[4]||(t[4]=l=>n.value.remark=l),"aria-label":"备注",placeholder:"备注"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(Y,{class:"auth-tree-row",gutter:20},{default:e.withCtx(()=>[e.createVNode(O,{span:24},{default:e.withCtx(()=>[e.createVNode(F,{label:"特性权限","label-position":"top"},{default:e.withCtx(()=>[e.createElementVNode("div",Et,[e.createVNode(a,{modelValue:q.value,"onUpdate:modelValue":t[5]||(t[5]=l=>q.value=l)},{prefix:e.withCtx(()=>[e.createVNode(V,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.search_default))]),_:1})]),_:1},8,["modelValue"]),e.createVNode(Me,{ref_key:"propertyTreeRef",ref:I,class:"auth-tree",data:e.unref(m),props:E,"node-key":"id","show-checkbox":"","default-expanded-keys":n.value.checked_ids,"default-checked-keys":n.value.checked_ids,"filter-node-method":ke},{default:e.withCtx(({node:l,data:r})=>{var Z;return[e.createElementVNode("div",xt,[e.createElementVNode("div",bt,[e.createElementVNode("div",Tt,e.toDisplayString(l.label),1)]),r.isPropertyLeaf&&J(r)?(e.openBlock(),e.createElementBlock("div",Pt,[e.createVNode(S,{class:"status-tag",type:e.unref(G)(r.status),title:"点击切换",onClick:x=>$e(x,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(j)(r.status)),1)]),_:2},1032,["type","onClick"])])):e.createCommentVNode("",!0),r.isProperty&&J(r)&&((Z=r.params)==null?void 0:Z.length)>0?(e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(S,{class:"status-tag",type:"success",onClick:x=>Ee(x,r)},{default:e.withCtx(()=>t[14]||(t[14]=[e.createTextVNode(" 参数设置 ")])),_:2,__:[14]},1032,["onClick"])])):e.createCommentVNode("",!0),r.isPropertyLeaf&&J(r)&&e.unref(fe)(r)?(e.openBlock(),e.createElementBlock("div",Dt,[e.createVNode(S,{class:"status-tag",type:"warning",onClick:x=>de(x,r)},{default:e.withCtx(()=>t[15]||(t[15]=[e.createTextVNode(" 数据权限 ")])),_:2,__:[15]},1032,["onClick"])])):e.createCommentVNode("",!0),l.level==1&&l.checked&&!r.isProperty?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(S,{class:"status-tag",type:"warning",onClick:x=>de(x,r)},{default:e.withCtx(()=>t[16]||(t[16]=[e.createTextVNode(" 数据权限重置 ")])),_:2,__:[16]},1032,["onClick"])])):e.createCommentVNode("",!0)])]}),_:1},8,["data","default-expanded-keys","default-checked-keys"])])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])]),footer:e.withCtx(()=>[e.createElementVNode("div",Lt,[t[18]||(t[18]=e.createElementVNode("div",{class:"footer-left"},null,-1)),e.createElementVNode("div",$t,[e.createVNode(b._sfc_main,{class:"cancel",emptyColor:!0,onClickTrigger:ie,modelValue:"取消",buttonType:"info"}),e.createVNode(b._sfc_main,{class:"confirm",emptyColor:!0,onClickTrigger:Te,modelValue:"确定",buttonType:"primary"})])])]),_:1},8,["visible"]),e.createVNode(lt,{ref_key:"paramAuthDialog",ref:R,params:re.value,"checked-params":n.value.params,onUpdateParams:xe},null,8,["params","checked-params"]),e.createVNode(ut,{ref_key:"scopeDialog",ref:ce,onConfirm:Ie},null,512)],64)}}}),qt=z._export_sfc(It,[["__scopeId","data-v-5da1e93d"]]);exports.default=qt;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as l, defineComponent as m, createElementBlock as f, openBlock as p, createElementVNode as e, createVNode as u, unref as t } from "vue";
|
|
2
|
-
import { W as C } from "./index-
|
|
2
|
+
import { W as C } from "./index-DI3TtkkA.js";
|
|
3
3
|
import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const b = () => {
|
|
5
5
|
const i = l("日志管理"), o = l(), a = l([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as y, ref as C, onMounted as _, createElementBlock as c, openBlock as g, createVNode as v } from "vue";
|
|
2
2
|
import { u as h, p as k, s as x, c as m } from "./index-D6RGTlCo.js";
|
|
3
|
-
import { W as M } from "./index-
|
|
3
|
+
import { W as M } from "./index-DI3TtkkA.js";
|
|
4
4
|
import { a as D, d as T, f as S } from "./index-BmZwVwZC.js";
|
|
5
5
|
import { g as w } from "./index-DUq4XELr.js";
|
|
6
6
|
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("./request-Dl8yi2iS.cjs"),_=require("./index-Dom0zBom.cjs"),N=require("./index-DmwxzDGW.cjs"),M=require("./JSEncrypt-IYbV4kRj.cjs"),Q=require("./index-BTEY8ajW.cjs"),X=require("./index-BkZKlNn0.cjs"),T=require("./index-BlZJ8BR2.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=require("./index-BpPyaNFa.cjs");function Y(r,s){const t=new M.JSEncrypt;return t.setPublicKey(s),t.encrypt(r)||""}function Z(r,s){const t=new M.JSEncrypt;return t.setPrivateKey(s),t.decrypt(r)||""}const V=_.useLoginState(_.pinia),{loginUserInfo:p,cryptoInfo:x}=_.storeToRefs(V),ee=_.useMenuState(_.pinia),{activeMenuPath:A}=_.storeToRefs(ee),L=e.ref(0),K=e.computed(()=>{var r,s,t,o,l,u,a,f,b,m,y;return[{label:"",name:"账号",prop:"账号",value:((r=p.value)==null?void 0:r.account)||(((s=p.value)==null?void 0:s.账号)??"未知")},{label:"",name:"角色名称",prop:"角色名称",value:((t=p.value)==null?void 0:t.layer)==="superAdmin"?"超级管理员":(o=p.value)==null?void 0:o.角色名称},{label:"",name:"部门名称",prop:"部门名称",value:((l=p.value)==null?void 0:l.部门名称)??"未知"},{label:"",name:"状态",prop:"状态",value:((u=p.value)==null?void 0:u.layer)==="superAdmin"?"启用":((a=p.value)==null?void 0:a.状态)??"未知"},{label:"",prop:"头像",isFormColHidden:!0,value:((f=p.value)==null?void 0:f.layer)==="superAdmin"?"启用":((b=p.value)==null?void 0:b.状态)??"未知"},{label:"",prop:"签名",isFormColHidden:!0,value:((m=p.value)==null?void 0:m.layer)==="superAdmin"?"启用":((y=p.value)==null?void 0:y.状态)??"未知"}]}),te=()=>{},q=e.ref(!1),E=e.reactive({dialogTitle:"电子签名",dialogWidth:"30",dialogShow:!1,url:""}),D=e.ref([{label:"签字版",icon:C.edit_pen_default,type:"button",disabled:!1},{label:"电子签名",icon:C.edit_default,type:"button",disabled:!1},{label:"上传手写签名",icon:C.upload_filled_default,type:"buttonUpload",disabled:!1}]),P=e.ref(!1),$=e.ref(!1),z=e.ref(!1),O=e.computed(()=>{var o,l,u;const r=sessionStorage.getItem("authority"),s=JSON.parse(r||""),t=(o=A.value)!=null&&o.startsWith("/")?(l=A.value)==null?void 0:l.substring(1):A.value;return Array.isArray(s)?(z.value=!(s!=null&&s.includes(`${t}/上传头像`)),(u=D.value)==null?void 0:u.map(a=>({...a,disabled:!(s!=null&&s.includes(`${t}/签名`))}))):typeof s=="string"&&(s==null?void 0:s.toUpperCase())==="SUPERADMIN"?D.value:[]}),ae=e.computed(()=>[{key:"signConfig",contents:E},{key:"signTypeList",contents:O.value}]),re=r=>{E.dialogShow=r.label==="电子签名"},W=()=>{E.dialogShow=!1},j=async r=>{var t,o,l,u,a,f,b,m,y;const s=await N.getInsofDataApi({id:r});if(((t=s==null?void 0:s.data)==null?void 0:t.code)===200&&s.data.result&&Array.isArray(s.data.result)&&s.data.result.length>0){const d={...(u=(l=(o=s.data.result)==null?void 0:o[0])==null?void 0:l.value)==null?void 0:u.tableData,id:(f=(a=s.data.result)==null?void 0:a[0])==null?void 0:f.id,layer:(y=(m=(b=s.data.result)==null?void 0:b[0])==null?void 0:m.key)==null?void 0:y.layer};V.setLoginUserInfo(d)}},H=async(r,s)=>{var o,l,u;const t=_.cloneDeep(r);t==null||delete t.id;try{const a=await N.updateInsofDataApi({id:(o=p.value)==null?void 0:o.id,value:{tableData:t}});((l=a==null?void 0:a.data)==null?void 0:l.code)===200&&(W(),C.ElMessage.success("修改成功"),await j((u=p.value)==null?void 0:u.id),await V.setLogRecordAsync({type:s,data:r},A.value))}catch{C.ElMessage.error("修改响应失败")}finally{q.value=!1,P.value=!1,$.value=!1}},se=async(r,s)=>{var l;const t=r==="avatarUrl"?"头像":"签名",o={...p.value,status:((l=p.value)==null?void 0:l.status)??"启用",[t]:s};P.value=r==="avatarUrl",$.value=r==="signature",await H(o,"图片修改")},I=e.reactive({baseCols:[],otherCols:[]}),J=e.ref([]),G=e.ref(),ne=(r,s,t)=>{var u,a,f,b,m,y;let o;const l=s;((a=(u=p.value)==null?void 0:u.layer)==null?void 0:a.toUpperCase())!=="SUPERADMIN"?o=(f=p.value)!=null&&f.password?Z((b=p.value)==null?void 0:b.password,(m=x==null?void 0:x.value)==null?void 0:m.privateKey):Q.resetPassword:o=(y=p.value)==null?void 0:y.password,o===l?t():t(new Error("输入的密码与原密码不匹配,请重新输入"))},oe=(r,s,t)=>{s?t():t(new Error("请输入密码"))},le=(r,s,t)=>{var o;s!==((o=G.value)==null?void 0:o.newtPass)?t(new Error("两次输入的密码不一致")):t()},ue=async()=>{var s,t,o,l,u,a,f,b,m,y;const r=await N.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:"系统管理/用户管理"}});if(((s=r==null?void 0:r.data)==null?void 0:s.code)===200&&r.data.result&&((t=r.data.result)==null?void 0:t.length)>0){const d=(f=(a=(u=(l=(o=r.data.result)==null?void 0:o[0])==null?void 0:l.value)==null?void 0:u.pageData)==null?void 0:a.compData)==null?void 0:f.find(n=>(n==null?void 0:n.key)==="header"),w=(b=K.value)==null?void 0:b.map(n=>n==null?void 0:n.prop);I.baseCols=d&&((m=d.contents)==null?void 0:m.map(n=>({...n,isFormColHidden:(w==null?void 0:w.includes(n==null?void 0:n.prop))||(n==null?void 0:n.label)==="操作"})));const S=(y=d.contents)==null?void 0:y.find(n=>(n==null?void 0:n.prop)==="password"),i=[{...S,label:"当前密码",prop:"currentPass",validator:ne},{...S,label:"新密码",prop:"newtPass",validator:oe},{...S,label:"确认密码",prop:"confirmNewPass",validator:le}];I.otherCols=i,de(p.value)}},ie=r=>{G.value=r},ce=async({content:r,buttonName:s})=>{var o,l,u,a,f;let t;s==="确定"&&(t={...p.value,status:((o=p.value)==null?void 0:o.status)??"启用",password:((u=(l=p.value)==null?void 0:l.layer)==null?void 0:u.toUpperCase())==="SUPERADMIN"?r==null?void 0:r.confirmNewPass:Y(r==null?void 0:r.confirmNewPass,(a=x.value)==null?void 0:a.publicKey)}),s==="保存基本信息"&&(t={...p.value,...r,status:((f=p.value)==null?void 0:f.status)??"启用"}),q.value=!0,await H(t,s)},F=()=>{var o,l;const r={base:[{label:"保存基本信息"}],other:[{label:"重置",background:"#b7b8b8"},{label:"确定"}]},s=sessionStorage.getItem("authority"),t=JSON.parse(s||"");if(Array.isArray(t)){const u=(o=A.value)!=null&&o.startsWith("/")?(l=A.value)==null?void 0:l.substring(1):A.value,a=t!=null&&t.includes(`${u}/基本信息`)?r==null?void 0:r.base:[],f=t!=null&&t.includes(`${u}/修改密码`)?r==null?void 0:r.other:[];return{base:a,other:f}}else return typeof t=="string"&&(t==null?void 0:t.toUpperCase())==="SUPERADMIN"?r:null},de=r=>{var s,t,o,l,u;J.value=[{value:"基础信息",label:"基础信息",children:[{type:"form",content:{rowContents:(s=I.baseCols)==null?void 0:s.map(a=>({...a,width:2,type:a==null?void 0:a.formType,name:a==null?void 0:a.prop,prop:a==null?void 0:a.prop,contents:a==null?void 0:a.options,value:r[a==null?void 0:a.prop]})),formRules:{userName:[{required:!0,message:"输入不能为空",trigger:"blur"}],birthDay:[{required:!0,message:"输入不能为空",trigger:"blur"}],phone:[{required:!0,message:"输入不能为空",trigger:"blur"}]},buttonValue:(t=F())==null?void 0:t.base,isEnableWrap:!1,isButtonRow:!1},value:""}]},{value:"修改密码",label:"修改密码",children:[{type:"form",content:{rowContents:(o=I.otherCols)==null?void 0:o.map(a=>({...a,width:1,type:a==null?void 0:a.formType,name:a==null?void 0:a.prop,contents:a==null?void 0:a.options})),formRules:(l=I.otherCols)==null?void 0:l.reduce((a,f)=>(a[f.prop]=[{required:!0,message:"输入有误",trigger:"change"},{validator:(b,m,y)=>f.validator(b,m,y),trigger:"blur"}],a),{}),buttonValue:(u=F())==null?void 0:u.other,isEnableWrap:!1},value:""}]}]},pe=Object.freeze(Object.defineProperty({__proto__:null,avatarLoading:P,beforeSignDestroy:W,changeFormTrigger:ie,clickFormButton:te,clickSignButton:re,clickTabButton:ce,getUserTableHeadersAsync:ue,itemData:ae,loading:q,refreshLoginUserInfoAsync:j,rowContents:K,signPadInfo:E,signTypes:O,signatureLoading:$,submitImageAsync:se,tabKey:L,tabsContents:J,tempSignTypes:D,uploadDisabled:z},Symbol.toStringTag,{value:"Module"})),fe={class:"avatar-model-wrap"},ge={key:0},ve=e.defineComponent({__name:"index",props:{disabled:{type:Boolean,default:!1},avatarUrl:{type:String,default:""},size:{type:[String,Number],default:"large"},userInfo:{type:Object,default:{}},clickStop:{type:Boolean,default:!0}},emits:["submitImage","deleteImage"],setup(r,{emit:s}){const t=r,o=s,l=e.computed(()=>"http://222.92.178.198:62001"),u=e.ref(""),a=e.ref(""),f=e.ref();e.watch(()=>{var d;return(d=t.userInfo)==null?void 0:d.头像},d=>{a.value=d?l.value+"/"+d:""},{immediate:!0});const b=async()=>{if(!(t!=null&&t.disabled))try{const d=await _.platformDownloadFile({url:u.value});if(d.status!==200)throw new Error(`HTTP error! status: ${d.status}`);const w=new Blob([d.data],{type:d.headers["content-type"]});f.value=w}catch(d){throw new Error(d)}},m=async d=>{var w,S,i,n,h;try{const g=await T.uploadFile(d);((w=g==null?void 0:g.data)==null?void 0:w.code)===200&&(a.value=l.value+"/"+((i=(S=g.data)==null?void 0:S.result)==null?void 0:i.url),u.value=(h=(n=g.data)==null?void 0:n.result)==null?void 0:h.url,o("submitImage",u.value))}catch(g){C.ElMessage.error(g)}},y=async()=>{try{if(!a.value)return}catch(d){C.ElMessage.error(d)}};return(d,w)=>{var S,i;return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(X.Avatar,{avatarUrl:a.value??"",avatarBlob:f.value,size:r.size,onClickAvatar:b,onSubmitImage:m,onDeleteImage:y,clickStop:t==null?void 0:t.clickStop},{avatarDefault:e.withCtx(()=>{var n,h,g,v;return[e.createTextVNode(e.toDisplayString(((h=(n=r.userInfo)==null?void 0:n.account)==null?void 0:h.charAt(0))||((v=(g=r.userInfo)==null?void 0:g.姓名)==null?void 0:v.charAt(0))||""),1)]}),_:1},8,["avatarUrl","avatarBlob","size","clickStop"]),r.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(((S=r.userInfo)==null?void 0:S.account)||((i=r.userInfo)==null?void 0:i.账号)||"未知"),1))])}}}),ye=R._export_sfc(ve,[["__scopeId","data-v-1a1f2575"]]),be=e.defineComponent({__name:"index",props:{itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},userInfo:{type:Object,default:{}}},emits:["clickSignButton","clickSubmitSign","beforeDestroy"],setup(r,{emit:s}){const t=r,o=e.ref({}),l=e.ref([]),u=s,a=i=>{o.value.dialogShow=(i==null?void 0:i.label)==="电子签名",u("clickSignButton",i)},f=()=>{o.value.dialogShow=!1,u("beforeDestroy")},b=e.computed(()=>"http://222.92.178.198:62001"),m=i=>{var c;const n=i.split(","),h=(c=n==null?void 0:n[0])==null?void 0:c.match(/:(.*?);/)[1],g=atob(n[1]);let v=g.length;const k=new Uint8Array(v);for(;v--;)k[v]=g.charCodeAt(v);return new Blob([k],{type:h})},y=async i=>{var n,h,g;try{const v=await T.uploadFile(i);((n=v==null?void 0:v.data)==null?void 0:n.code)===200&&u("clickSubmitSign",(g=(h=v.data)==null?void 0:h.result)==null?void 0:g.url)}catch(v){C.ElMessage.error(v)}},d=e.ref(""),w=i=>{d.value=i,o.value.dialogShow=!1;const n=new FormData,h=m(i);n.append("file",h,"image.png"),y(n)},S=i=>{const n=new FormData;n.append("file",i==null?void 0:i.file),y(n)};return e.watch(()=>t==null?void 0:t.itemData,i=>{var h,g,v,k;d.value="",(h=o.value)!=null&&h.dialogShow&&(o.value.dialogShow=!1);const n=(g=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signConfig"))==null?void 0:g.contents;n&&Object.keys(n).forEach(c=>{(n[c]===void 0||n[c]===null||n[c]==="")&&delete n[c]}),o.value=(v=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signConfig"))==null?void 0:v.contents,l.value=(k=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signTypeList"))==null?void 0:k.contents},{immediate:!0}),(i,n)=>{const h=e.resolveComponent("el-empty"),g=e.resolveComponent("el-image"),v=e.resolveComponent("el-button"),k=e.resolveComponent("el-upload");return e.openBlock(),e.createBlock(T.Signature,{signPadInfo:o.value,onBeforeDestroy:f,onClickSubmitSign:w},{signatureRender:e.withCtx(()=>{var c,B;return[e.createElementVNode("div",{class:"signature-render",style:e.normalizeStyle({width:`${(c=o.value)==null?void 0:c.signPadWidth}%`})},[e.createVNode(g,{src:d.value?d.value:b.value+"/"+((B=r.userInfo)==null?void 0:B.签名),fit:"contain"},{error:e.withCtx(()=>[e.createVNode(h,{"image-size":60,description:" "},{image:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:"emptyImg"})]),_:1})]),_:1},8,["src"])],4)]}),signatureTypes:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>{var B;return e.openBlock(),e.createElementBlock("div",{key:c.label,class:"signature-button"},[(B=c.label)!=null&&B.includes("上传")?(e.openBlock(),e.createBlock(k,{key:0,ref_for:!0,ref:"uploadRef","http-request":S,"show-file-list":!1},{trigger:e.withCtx(()=>[e.createVNode(v,{disabled:c.disabled,id:"themeButton"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),icon:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:c.icon??""},null,8,["name"])]),_:2},1032,["disabled"])]),_:2},1536)):(e.openBlock(),e.createBlock(v,{key:1,id:"themeButton",disabled:c.disabled,onClick:he=>a(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),icon:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:c.icon??""},null,8,["name"])]),_:2},1032,["disabled","onClick"]))])}),128))]),_:1},8,["signPadInfo"])}}}),me=R._export_sfc(be,[["__scopeId","data-v-ce5a2314"]]);exports.State=pe;exports.ssAvatar=ye;exports.ssSignature=me;exports.tabKey=L;
|
|
1
|
+
"use strict";const e=require("vue"),C=require("./request-Dl8yi2iS.cjs"),_=require("./index-Dom0zBom.cjs"),N=require("./index-DmwxzDGW.cjs"),M=require("./JSEncrypt-IYbV4kRj.cjs"),Q=require("./index-BTEY8ajW.cjs"),X=require("./index-BkZKlNn0.cjs"),T=require("./index-DdGEVAoz.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=require("./index-BpPyaNFa.cjs");function Y(r,s){const t=new M.JSEncrypt;return t.setPublicKey(s),t.encrypt(r)||""}function Z(r,s){const t=new M.JSEncrypt;return t.setPrivateKey(s),t.decrypt(r)||""}const V=_.useLoginState(_.pinia),{loginUserInfo:p,cryptoInfo:x}=_.storeToRefs(V),ee=_.useMenuState(_.pinia),{activeMenuPath:A}=_.storeToRefs(ee),L=e.ref(0),K=e.computed(()=>{var r,s,t,o,l,u,a,f,b,m,y;return[{label:"",name:"账号",prop:"账号",value:((r=p.value)==null?void 0:r.account)||(((s=p.value)==null?void 0:s.账号)??"未知")},{label:"",name:"角色名称",prop:"角色名称",value:((t=p.value)==null?void 0:t.layer)==="superAdmin"?"超级管理员":(o=p.value)==null?void 0:o.角色名称},{label:"",name:"部门名称",prop:"部门名称",value:((l=p.value)==null?void 0:l.部门名称)??"未知"},{label:"",name:"状态",prop:"状态",value:((u=p.value)==null?void 0:u.layer)==="superAdmin"?"启用":((a=p.value)==null?void 0:a.状态)??"未知"},{label:"",prop:"头像",isFormColHidden:!0,value:((f=p.value)==null?void 0:f.layer)==="superAdmin"?"启用":((b=p.value)==null?void 0:b.状态)??"未知"},{label:"",prop:"签名",isFormColHidden:!0,value:((m=p.value)==null?void 0:m.layer)==="superAdmin"?"启用":((y=p.value)==null?void 0:y.状态)??"未知"}]}),te=()=>{},q=e.ref(!1),E=e.reactive({dialogTitle:"电子签名",dialogWidth:"30",dialogShow:!1,url:""}),D=e.ref([{label:"签字版",icon:C.edit_pen_default,type:"button",disabled:!1},{label:"电子签名",icon:C.edit_default,type:"button",disabled:!1},{label:"上传手写签名",icon:C.upload_filled_default,type:"buttonUpload",disabled:!1}]),P=e.ref(!1),$=e.ref(!1),z=e.ref(!1),O=e.computed(()=>{var o,l,u;const r=sessionStorage.getItem("authority"),s=JSON.parse(r||""),t=(o=A.value)!=null&&o.startsWith("/")?(l=A.value)==null?void 0:l.substring(1):A.value;return Array.isArray(s)?(z.value=!(s!=null&&s.includes(`${t}/上传头像`)),(u=D.value)==null?void 0:u.map(a=>({...a,disabled:!(s!=null&&s.includes(`${t}/签名`))}))):typeof s=="string"&&(s==null?void 0:s.toUpperCase())==="SUPERADMIN"?D.value:[]}),ae=e.computed(()=>[{key:"signConfig",contents:E},{key:"signTypeList",contents:O.value}]),re=r=>{E.dialogShow=r.label==="电子签名"},W=()=>{E.dialogShow=!1},j=async r=>{var t,o,l,u,a,f,b,m,y;const s=await N.getInsofDataApi({id:r});if(((t=s==null?void 0:s.data)==null?void 0:t.code)===200&&s.data.result&&Array.isArray(s.data.result)&&s.data.result.length>0){const d={...(u=(l=(o=s.data.result)==null?void 0:o[0])==null?void 0:l.value)==null?void 0:u.tableData,id:(f=(a=s.data.result)==null?void 0:a[0])==null?void 0:f.id,layer:(y=(m=(b=s.data.result)==null?void 0:b[0])==null?void 0:m.key)==null?void 0:y.layer};V.setLoginUserInfo(d)}},H=async(r,s)=>{var o,l,u;const t=_.cloneDeep(r);t==null||delete t.id;try{const a=await N.updateInsofDataApi({id:(o=p.value)==null?void 0:o.id,value:{tableData:t}});((l=a==null?void 0:a.data)==null?void 0:l.code)===200&&(W(),C.ElMessage.success("修改成功"),await j((u=p.value)==null?void 0:u.id),await V.setLogRecordAsync({type:s,data:r},A.value))}catch{C.ElMessage.error("修改响应失败")}finally{q.value=!1,P.value=!1,$.value=!1}},se=async(r,s)=>{var l;const t=r==="avatarUrl"?"头像":"签名",o={...p.value,status:((l=p.value)==null?void 0:l.status)??"启用",[t]:s};P.value=r==="avatarUrl",$.value=r==="signature",await H(o,"图片修改")},I=e.reactive({baseCols:[],otherCols:[]}),J=e.ref([]),G=e.ref(),ne=(r,s,t)=>{var u,a,f,b,m,y;let o;const l=s;((a=(u=p.value)==null?void 0:u.layer)==null?void 0:a.toUpperCase())!=="SUPERADMIN"?o=(f=p.value)!=null&&f.password?Z((b=p.value)==null?void 0:b.password,(m=x==null?void 0:x.value)==null?void 0:m.privateKey):Q.resetPassword:o=(y=p.value)==null?void 0:y.password,o===l?t():t(new Error("输入的密码与原密码不匹配,请重新输入"))},oe=(r,s,t)=>{s?t():t(new Error("请输入密码"))},le=(r,s,t)=>{var o;s!==((o=G.value)==null?void 0:o.newtPass)?t(new Error("两次输入的密码不一致")):t()},ue=async()=>{var s,t,o,l,u,a,f,b,m,y;const r=await N.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure",pageKey:"系统管理/用户管理"}});if(((s=r==null?void 0:r.data)==null?void 0:s.code)===200&&r.data.result&&((t=r.data.result)==null?void 0:t.length)>0){const d=(f=(a=(u=(l=(o=r.data.result)==null?void 0:o[0])==null?void 0:l.value)==null?void 0:u.pageData)==null?void 0:a.compData)==null?void 0:f.find(n=>(n==null?void 0:n.key)==="header"),w=(b=K.value)==null?void 0:b.map(n=>n==null?void 0:n.prop);I.baseCols=d&&((m=d.contents)==null?void 0:m.map(n=>({...n,isFormColHidden:(w==null?void 0:w.includes(n==null?void 0:n.prop))||(n==null?void 0:n.label)==="操作"})));const S=(y=d.contents)==null?void 0:y.find(n=>(n==null?void 0:n.prop)==="password"),i=[{...S,label:"当前密码",prop:"currentPass",validator:ne},{...S,label:"新密码",prop:"newtPass",validator:oe},{...S,label:"确认密码",prop:"confirmNewPass",validator:le}];I.otherCols=i,de(p.value)}},ie=r=>{G.value=r},ce=async({content:r,buttonName:s})=>{var o,l,u,a,f;let t;s==="确定"&&(t={...p.value,status:((o=p.value)==null?void 0:o.status)??"启用",password:((u=(l=p.value)==null?void 0:l.layer)==null?void 0:u.toUpperCase())==="SUPERADMIN"?r==null?void 0:r.confirmNewPass:Y(r==null?void 0:r.confirmNewPass,(a=x.value)==null?void 0:a.publicKey)}),s==="保存基本信息"&&(t={...p.value,...r,status:((f=p.value)==null?void 0:f.status)??"启用"}),q.value=!0,await H(t,s)},F=()=>{var o,l;const r={base:[{label:"保存基本信息"}],other:[{label:"重置",background:"#b7b8b8"},{label:"确定"}]},s=sessionStorage.getItem("authority"),t=JSON.parse(s||"");if(Array.isArray(t)){const u=(o=A.value)!=null&&o.startsWith("/")?(l=A.value)==null?void 0:l.substring(1):A.value,a=t!=null&&t.includes(`${u}/基本信息`)?r==null?void 0:r.base:[],f=t!=null&&t.includes(`${u}/修改密码`)?r==null?void 0:r.other:[];return{base:a,other:f}}else return typeof t=="string"&&(t==null?void 0:t.toUpperCase())==="SUPERADMIN"?r:null},de=r=>{var s,t,o,l,u;J.value=[{value:"基础信息",label:"基础信息",children:[{type:"form",content:{rowContents:(s=I.baseCols)==null?void 0:s.map(a=>({...a,width:2,type:a==null?void 0:a.formType,name:a==null?void 0:a.prop,prop:a==null?void 0:a.prop,contents:a==null?void 0:a.options,value:r[a==null?void 0:a.prop]})),formRules:{userName:[{required:!0,message:"输入不能为空",trigger:"blur"}],birthDay:[{required:!0,message:"输入不能为空",trigger:"blur"}],phone:[{required:!0,message:"输入不能为空",trigger:"blur"}]},buttonValue:(t=F())==null?void 0:t.base,isEnableWrap:!1,isButtonRow:!1},value:""}]},{value:"修改密码",label:"修改密码",children:[{type:"form",content:{rowContents:(o=I.otherCols)==null?void 0:o.map(a=>({...a,width:1,type:a==null?void 0:a.formType,name:a==null?void 0:a.prop,contents:a==null?void 0:a.options})),formRules:(l=I.otherCols)==null?void 0:l.reduce((a,f)=>(a[f.prop]=[{required:!0,message:"输入有误",trigger:"change"},{validator:(b,m,y)=>f.validator(b,m,y),trigger:"blur"}],a),{}),buttonValue:(u=F())==null?void 0:u.other,isEnableWrap:!1},value:""}]}]},pe=Object.freeze(Object.defineProperty({__proto__:null,avatarLoading:P,beforeSignDestroy:W,changeFormTrigger:ie,clickFormButton:te,clickSignButton:re,clickTabButton:ce,getUserTableHeadersAsync:ue,itemData:ae,loading:q,refreshLoginUserInfoAsync:j,rowContents:K,signPadInfo:E,signTypes:O,signatureLoading:$,submitImageAsync:se,tabKey:L,tabsContents:J,tempSignTypes:D,uploadDisabled:z},Symbol.toStringTag,{value:"Module"})),fe={class:"avatar-model-wrap"},ge={key:0},ve=e.defineComponent({__name:"index",props:{disabled:{type:Boolean,default:!1},avatarUrl:{type:String,default:""},size:{type:[String,Number],default:"large"},userInfo:{type:Object,default:{}},clickStop:{type:Boolean,default:!0}},emits:["submitImage","deleteImage"],setup(r,{emit:s}){const t=r,o=s,l=e.computed(()=>"http://222.92.178.198:62001"),u=e.ref(""),a=e.ref(""),f=e.ref();e.watch(()=>{var d;return(d=t.userInfo)==null?void 0:d.头像},d=>{a.value=d?l.value+"/"+d:""},{immediate:!0});const b=async()=>{if(!(t!=null&&t.disabled))try{const d=await _.platformDownloadFile({url:u.value});if(d.status!==200)throw new Error(`HTTP error! status: ${d.status}`);const w=new Blob([d.data],{type:d.headers["content-type"]});f.value=w}catch(d){throw new Error(d)}},m=async d=>{var w,S,i,n,h;try{const g=await T.uploadFile(d);((w=g==null?void 0:g.data)==null?void 0:w.code)===200&&(a.value=l.value+"/"+((i=(S=g.data)==null?void 0:S.result)==null?void 0:i.url),u.value=(h=(n=g.data)==null?void 0:n.result)==null?void 0:h.url,o("submitImage",u.value))}catch(g){C.ElMessage.error(g)}},y=async()=>{try{if(!a.value)return}catch(d){C.ElMessage.error(d)}};return(d,w)=>{var S,i;return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(X.Avatar,{avatarUrl:a.value??"",avatarBlob:f.value,size:r.size,onClickAvatar:b,onSubmitImage:m,onDeleteImage:y,clickStop:t==null?void 0:t.clickStop},{avatarDefault:e.withCtx(()=>{var n,h,g,v;return[e.createTextVNode(e.toDisplayString(((h=(n=r.userInfo)==null?void 0:n.account)==null?void 0:h.charAt(0))||((v=(g=r.userInfo)==null?void 0:g.姓名)==null?void 0:v.charAt(0))||""),1)]}),_:1},8,["avatarUrl","avatarBlob","size","clickStop"]),r.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(((S=r.userInfo)==null?void 0:S.account)||((i=r.userInfo)==null?void 0:i.账号)||"未知"),1))])}}}),ye=R._export_sfc(ve,[["__scopeId","data-v-1a1f2575"]]),be=e.defineComponent({__name:"index",props:{itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},userInfo:{type:Object,default:{}}},emits:["clickSignButton","clickSubmitSign","beforeDestroy"],setup(r,{emit:s}){const t=r,o=e.ref({}),l=e.ref([]),u=s,a=i=>{o.value.dialogShow=(i==null?void 0:i.label)==="电子签名",u("clickSignButton",i)},f=()=>{o.value.dialogShow=!1,u("beforeDestroy")},b=e.computed(()=>"http://222.92.178.198:62001"),m=i=>{var c;const n=i.split(","),h=(c=n==null?void 0:n[0])==null?void 0:c.match(/:(.*?);/)[1],g=atob(n[1]);let v=g.length;const k=new Uint8Array(v);for(;v--;)k[v]=g.charCodeAt(v);return new Blob([k],{type:h})},y=async i=>{var n,h,g;try{const v=await T.uploadFile(i);((n=v==null?void 0:v.data)==null?void 0:n.code)===200&&u("clickSubmitSign",(g=(h=v.data)==null?void 0:h.result)==null?void 0:g.url)}catch(v){C.ElMessage.error(v)}},d=e.ref(""),w=i=>{d.value=i,o.value.dialogShow=!1;const n=new FormData,h=m(i);n.append("file",h,"image.png"),y(n)},S=i=>{const n=new FormData;n.append("file",i==null?void 0:i.file),y(n)};return e.watch(()=>t==null?void 0:t.itemData,i=>{var h,g,v,k;d.value="",(h=o.value)!=null&&h.dialogShow&&(o.value.dialogShow=!1);const n=(g=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signConfig"))==null?void 0:g.contents;n&&Object.keys(n).forEach(c=>{(n[c]===void 0||n[c]===null||n[c]==="")&&delete n[c]}),o.value=(v=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signConfig"))==null?void 0:v.contents,l.value=(k=i==null?void 0:i.find(c=>(c==null?void 0:c.key)==="signTypeList"))==null?void 0:k.contents},{immediate:!0}),(i,n)=>{const h=e.resolveComponent("el-empty"),g=e.resolveComponent("el-image"),v=e.resolveComponent("el-button"),k=e.resolveComponent("el-upload");return e.openBlock(),e.createBlock(T.Signature,{signPadInfo:o.value,onBeforeDestroy:f,onClickSubmitSign:w},{signatureRender:e.withCtx(()=>{var c,B;return[e.createElementVNode("div",{class:"signature-render",style:e.normalizeStyle({width:`${(c=o.value)==null?void 0:c.signPadWidth}%`})},[e.createVNode(g,{src:d.value?d.value:b.value+"/"+((B=r.userInfo)==null?void 0:B.签名),fit:"contain"},{error:e.withCtx(()=>[e.createVNode(h,{"image-size":60,description:" "},{image:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:"emptyImg"})]),_:1})]),_:1},8,["src"])],4)]}),signatureTypes:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>{var B;return e.openBlock(),e.createElementBlock("div",{key:c.label,class:"signature-button"},[(B=c.label)!=null&&B.includes("上传")?(e.openBlock(),e.createBlock(k,{key:0,ref_for:!0,ref:"uploadRef","http-request":S,"show-file-list":!1},{trigger:e.withCtx(()=>[e.createVNode(v,{disabled:c.disabled,id:"themeButton"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),icon:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:c.icon??""},null,8,["name"])]),_:2},1032,["disabled"])]),_:2},1536)):(e.openBlock(),e.createBlock(v,{key:1,id:"themeButton",disabled:c.disabled,onClick:he=>a(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),icon:e.withCtx(()=>[e.createVNode(U.SvgIcon,{name:c.icon??""},null,8,["name"])]),_:2},1032,["disabled","onClick"]))])}),128))]),_:1},8,["signPadInfo"])}}}),me=R._export_sfc(be,[["__scopeId","data-v-ce5a2314"]]);exports.State=pe;exports.ssAvatar=ye;exports.ssSignature=me;exports.tabKey=L;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),G=require("./array-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),G=require("./array-btZYLqUK.cjs"),r=require("./index-Dom0zBom.cjs"),ne=require("./index-BVDaFrR1.cjs"),T=require("./index-BTEY8ajW.cjs"),v=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],A=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}];n.ref(0);n.ref(0);n.ref(1);const le=s=>{let d;s.replaceAll(" ",`\r
|
|
2
2
|
`).replaceAll(`
|
|
3
3
|
`,`\r
|
|
4
4
|
`).includes(`\r
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as U, watch as v, createElementBlock as E, createCommentVNode as q, openBlock as I, Fragment as de, renderList as fe, createElementVNode as S, createBlock as se, toDisplayString as oe, resolveDynamicComponent as ye, onMounted as he, onUnmounted as ke, createVNode as te } from "vue";
|
|
2
|
-
import { m as ge, a as _e, b as Ce, c as be } from "./array-
|
|
2
|
+
import { m as ge, a as _e, b as Ce, c as be } from "./array-BamRuoOD.js";
|
|
3
3
|
import { c, a as ce, p as re, s as ue, u as Oe } from "./index-D6RGTlCo.js";
|
|
4
|
-
import { g as Ae } from "./index-
|
|
4
|
+
import { g as Ae } from "./index-DI3TtkkA.js";
|
|
5
5
|
import { v as H, a as K } from "./index-CmJoUVma.js";
|
|
6
6
|
import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const B = [
|
package/dist/ss-component.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue");require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs");const C=require("./index-BpPyaNFa.cjs"),v=require("./index-Dom0zBom.cjs");require("./index-BTEY8ajW.cjs");require("./request-Dl8yi2iS.cjs");;/* empty css */const s=require("./ss-component2.cjs"),t=require("./index-DKh4EyHV.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue");require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs");const C=require("./index-BpPyaNFa.cjs"),v=require("./index-Dom0zBom.cjs");require("./index-BTEY8ajW.cjs");require("./request-Dl8yi2iS.cjs");;/* empty css */const s=require("./ss-component2.cjs"),t=require("./index-DKh4EyHV.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-BMtNW6cb.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DdGEVAoz.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-D-j5ega_.cjs")).then(e=>e.index));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-B4Cm0GS_.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-D_VYSFMf.cjs")));m.install=e=>{e.component("ssCanvas",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BVaHwt5f.cjs")));u.install=e=>{e.component("ssFold",u)};const a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BkZKlNn0.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-vePnqmZ4.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-D0tSdUbT.cjs")).then(e=>e.threeViewerHost));f.install=e=>{e.component("threeViewerHost",f)};const p=v.useMenuState(),q=[r,i,c,l,m,u,a,h,f],P=e=>{q.forEach(o=>{e.use(o)}),e.use(s),e.config.globalProperties.$router=s},g=e=>{switch(e){case"browser":return t.browserThemeConfig;case"client":return t.clientThemeConfig;case"three":return t.threeThemeConfig}},y=e=>{const o=document.documentElement;e==null||e.forEach(d=>{o.style.setProperty(d.name,d.value)})},A=e=>{p.setPlatform(e);const o=g(e);y(o)},T={getPlatform:p.getPlatform,setPlatform:p.setPlatform,initPlatform:A};exports.SvgIcon=C.SvgIcon;exports.router=s;exports.default=P;exports.platformApi=T;
|
package/dist/ss-component.js
CHANGED
|
@@ -7,15 +7,15 @@ import "./request-XJsZ4h2T.js";
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
import u from "./ss-component2.js";
|
|
9
9
|
import { t as g, c as T, b as P } from "./index-ChNfRlIP.js";
|
|
10
|
-
const n = o(() => import("./main-
|
|
10
|
+
const n = o(() => import("./main-DW827WGq.js"));
|
|
11
11
|
n.install = (t) => {
|
|
12
12
|
t.component("ssComponent", n);
|
|
13
13
|
};
|
|
14
|
-
const s = o(() => import("./index-
|
|
14
|
+
const s = o(() => import("./index-Dg22_ZeG.js").then((t) => t.q));
|
|
15
15
|
s.install = (t) => {
|
|
16
16
|
t.component("ssTab", s);
|
|
17
17
|
};
|
|
18
|
-
const r = o(() => import("./index-
|
|
18
|
+
const r = o(() => import("./index-CzjnoeKD.js").then((t) => t.i));
|
|
19
19
|
r.install = (t) => {
|
|
20
20
|
t.component("ssMenu", r);
|
|
21
21
|
};
|
|
@@ -35,11 +35,11 @@ const a = o(() => import("./index-xrsX_7VG.js").then((t) => t.i));
|
|
|
35
35
|
a.install = (t) => {
|
|
36
36
|
t.component("ssAvatar", a);
|
|
37
37
|
};
|
|
38
|
-
const l = o(() => import("./threeModel-
|
|
38
|
+
const l = o(() => import("./threeModel-CJT7ouCQ.js"));
|
|
39
39
|
l.install = (t) => {
|
|
40
40
|
t.component("ssThree", l);
|
|
41
41
|
};
|
|
42
|
-
const p = o(() => import("./threeViewerHost-
|
|
42
|
+
const p = o(() => import("./threeViewerHost-B5GraQL0.js").then((t) => t.t));
|
|
43
43
|
p.install = (t) => {
|
|
44
44
|
t.component("threeViewerHost", p);
|
|
45
45
|
};
|
package/dist/ss-component2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-aYsnw0xY.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CBKu-nLA.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-aYsnw0xY.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CBKu-nLA.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-C1FnwRUu.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-CpwW2U4S.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-D9epS32a.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-CCs8JfeG.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-C7RhO6sY.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-Dfo0qUQb.cjs"))},{path:"角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-DqxQx4BR.cjs"))},{path:"部门管理",name:"Department",component:async()=>Promise.resolve().then(()=>require("./index-DSQTv7ZT.cjs"))},{path:"职位管理",name:"Position",component:async()=>Promise.resolve().then(()=>require("./index-BwcMTycx.cjs"))},{path:"个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BVXSPL5O.cjs"))},{path:"log",name:"log",component:async()=>Promise.resolve().then(()=>require("./index-DTKhT44W.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
|
package/dist/ss-component2.js
CHANGED
|
@@ -13,7 +13,7 @@ const a = [
|
|
|
13
13
|
{
|
|
14
14
|
path: "/",
|
|
15
15
|
name: "Model",
|
|
16
|
-
component: async () => import("./index-
|
|
16
|
+
component: async () => import("./index-BHTcqooS.js"),
|
|
17
17
|
// component: async ()=>import('@/components/views/model/component/main.vue'),
|
|
18
18
|
// component: async ()=>import('@/components/views/canvas/index.vue'),
|
|
19
19
|
// component: async ()=>import('@/components/views/test/index.vue'),
|
|
@@ -31,17 +31,17 @@ const a = [
|
|
|
31
31
|
{
|
|
32
32
|
path: "平台管理/菜单管理",
|
|
33
33
|
name: "Menu",
|
|
34
|
-
component: async () => import("./index-
|
|
34
|
+
component: async () => import("./index-Cd0RwOH4.js")
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
path: "平台管理/主菜单管理",
|
|
38
38
|
name: "MainMenu",
|
|
39
|
-
component: async () => import("./index-
|
|
39
|
+
component: async () => import("./index-t1up3rVy.js")
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
path: "系统管理/个人中心",
|
|
43
43
|
name: "PersonalCenter",
|
|
44
|
-
component: async () => import("./index-
|
|
44
|
+
component: async () => import("./index-CBXxToaR.js")
|
|
45
45
|
},
|
|
46
46
|
// {
|
|
47
47
|
// path: '系统管理/职位管理',
|
|
@@ -66,17 +66,17 @@ const a = [
|
|
|
66
66
|
{
|
|
67
67
|
path: "系统维护/登录日志",
|
|
68
68
|
name: "LoginLog",
|
|
69
|
-
component: async () => import("./index-
|
|
69
|
+
component: async () => import("./index-B72-4yf7.js")
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
path: "系统维护/操作日志",
|
|
73
73
|
name: "OperateLog",
|
|
74
|
-
component: async () => import("./index-
|
|
74
|
+
component: async () => import("./index-DFUcqAnm.js")
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
path: "角色管理",
|
|
78
78
|
name: "Role",
|
|
79
|
-
component: async () => import("./index-
|
|
79
|
+
component: async () => import("./index-BuKQQPdl.js")
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
path: "部门管理",
|
|
@@ -96,7 +96,7 @@ const a = [
|
|
|
96
96
|
{
|
|
97
97
|
path: "log",
|
|
98
98
|
name: "log",
|
|
99
|
-
component: async () => import("./index-
|
|
99
|
+
component: async () => import("./index-RWivHsXr.js")
|
|
100
100
|
}
|
|
101
101
|
// {
|
|
102
102
|
// path: 'priority',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
|
|
2
2
|
import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, b as Qe, A as et, c as tt, M as Re, X as nt, G as at, e as Me, f as ot, h as De, i as st, D as ke, H as lt, j as Ve, k as Oe, l as Ue, m as ze, E as _e, n as de, o as it, p as rt, T as ct } from "./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-BPcdPEE5.js";
|
|
3
3
|
import { O as ut } from "./OrbitControls-DnETMpm3.js";
|
|
4
|
-
import { W as dt, X as pt } from "./index-
|
|
4
|
+
import { W as dt, X as pt } from "./index-DI3TtkkA.js";
|
|
5
5
|
import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
import { c as Ge } from "./index-D6RGTlCo.js";
|
|
7
7
|
import { E as Ie } from "./request-XJsZ4h2T.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs"),fe=require("./OrbitControls-DeBaEHUj.cjs"),pe=require("./index-CPMaO9p7.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./index-Dom0zBom.cjs"),de=require("./request-Dl8yi2iS.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=null,c=null,b=null;const D=1e3/30;let S=0;const E=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),h=new fe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),f(),C()},t=(m,l)=>{c&&(g.remove(c),c.dispose()),b&&(g.remove(b),b.geometry.dispose(),b.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});b=new n.Mesh(B,O),b.position.copy(l),b.position.z-=.01,b.receiveShadow=!0,g.add(b)},p=()=>{if(E.value.length===0)return;const m=new n.Box3;let l=!1;if(E.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);g.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),g.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},C=()=>{P=requestAnimationFrame(C),h&&h.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:E,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!h||E.value.length===0)return;const l=new n.Box3;let _=!1;if(E.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;E.value.forEach(l=>{g.remove(l),A(l)});const m=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==b&&m.push(l)}),m.forEach(l=>{g.remove(l),A(l)}),E.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),b&&(b.geometry.dispose(),b.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,b=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=b*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},E=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/h,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(E)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;g.value.forEach(G=>{f.expandByObject(G)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),b=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+b*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,E())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(C,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],P=new n.Box3,c=new n.Vector3;const b=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(E(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},E=()=>{g.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(b(),g.value.length>0&&F()):(d.value="none",E(),r())},updateClippingPlanes:S,clearClippingPlanes:E,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=me.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(pe.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},be={class:"joint-range"},Ee={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ce=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),b=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),E=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ce/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;b.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=me.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return de.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(de.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,b.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),ue=new n.Matrix4;return ue.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(ue),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,E.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=E.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ce,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ce&&(r.value=0,E.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),E.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},re=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{re(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",be," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Ee,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-bcf4fa92"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},b=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),E=e.computed(()=>u!=null&&u.model?b(u.model):[]);return e.watch(E,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-3150a90b"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const P=e.ref(null),c=e.ref(!1),b=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),E=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=pe.useModelLoader(A,y,c,b,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},re=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{E.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),h=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),g({addModelsFromUrls:re,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:E.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:E.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>E.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,E.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(b.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-eb64b36c"]]);exports.default=rt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs"),fe=require("./OrbitControls-DeBaEHUj.cjs"),pe=require("./index-BVDaFrR1.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./index-Dom0zBom.cjs"),de=require("./request-Dl8yi2iS.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=null,c=null,b=null;const D=1e3/30;let S=0;const E=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),h=new fe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),f(),C()},t=(m,l)=>{c&&(g.remove(c),c.dispose()),b&&(g.remove(b),b.geometry.dispose(),b.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});b=new n.Mesh(B,O),b.position.copy(l),b.position.z-=.01,b.receiveShadow=!0,g.add(b)},p=()=>{if(E.value.length===0)return;const m=new n.Box3;let l=!1;if(E.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);g.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),g.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},C=()=>{P=requestAnimationFrame(C),h&&h.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:E,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!h||E.value.length===0)return;const l=new n.Box3;let _=!1;if(E.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;E.value.forEach(l=>{g.remove(l),A(l)});const m=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==b&&m.push(l)}),m.forEach(l=>{g.remove(l),A(l)}),E.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),b&&(b.geometry.dispose(),b.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,b=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=b*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},E=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/h,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(E)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;g.value.forEach(G=>{f.expandByObject(G)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),b=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+b*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,E())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(C,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],P=new n.Box3,c=new n.Vector3;const b=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(E(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},E=()=>{g.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(b(),g.value.length>0&&F()):(d.value="none",E(),r())},updateClippingPlanes:S,clearClippingPlanes:E,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=me.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(pe.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},Ce={class:"joint-name"},be={class:"joint-range"},Ee={class:"joint-type"},_e={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},ae=.001,Re=1e3,ce=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),b=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),E=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ce/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;b.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=me.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return de.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(de.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,b.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),ue=new n.Matrix4;return ue.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(ue),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,E.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=E.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ce,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ce&&(r.value=0,E.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:_,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),E.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},re=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{re(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",be," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Ee,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-bcf4fa92"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},b=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),E=e.computed(()=>u!=null&&u.model?b(u.model):[]);return e.watch(E,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-3150a90b"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const P=e.ref(null),c=e.ref(!1),b=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),E=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=pe.useModelLoader(A,y,c,b,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},re=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{E.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),h=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),g({addModelsFromUrls:re,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:E.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:E.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>E.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,E.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(b.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-eb64b36c"]]);exports.default=rt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-D0tSdUbT.cjs"),pe=require("./iconfont-BWb856Sc.cjs"),fe=require("./workpieceTreePanel-psliSrxN.cjs"),Te=require("./index-Dom0zBom.cjs"),B=require("./request-Dl8yi2iS.cjs");;/* empty css */const s=require("./index.vue_vue_type_style_index_0_scoped_6b92e250_lang-DTWSzwUy.cjs");require("./index-BVDaFrR1.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),me=require("./index-BTEY8ajW.cjs");require("./index-wA8Et9Q3.cjs");require("./index-mqL-OFAs.cjs");const he=require("./animationData-DnRszQps.cjs"),ie=require("./urdfTree-Cl-Ete0V.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=require("./index-B-pflqKE.cjs"),R=require("./svgIcon-CDPAgQbj.cjs"),G=.001,W=s.MathUtils.degToRad,_e=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Se(V=.005,v=64){const p=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(p,v,V,16,!1),m=_e;return new s.Mesh(n,m)}const ke=V=>V.reduce((v,p)=>{let n=0;const m=p.Y??0,b=p.C??0,r=p.R??0;return m>0&&(n+=m),b>0&&r>0&&(n+=r*W(b)),v+n},0),Me=V=>{const v=[],p=V.Y??0,n=V.B??0,m=V.C??0,b=V.R??0,r={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!p&&!m)return v;if(v.push(r.pos.clone()),n!==0){const g=new s.Matrix4().makeRotationAxis(r.localY,W(n));r.localX.applyMatrix4(g),r.localZ.applyMatrix4(g)}if(p>0&&(r.pos.add(r.localY.clone().multiplyScalar(p*G)),v.push(r.pos.clone())),m>0&&b>0){const g=W(m),f=b*G,w=r.pos.clone().add(r.localX.clone().multiplyScalar(-f)),a=Math.max(16,Math.ceil(m/5));for(let y=1;y<=a;y++){const d=g*y/a,_=new s.Matrix4().makeRotationAxis(r.localZ,d),u=r.localX.clone().multiplyScalar(f).applyMatrix4(_),k=w.clone().add(u);v.push(k)}}return v};function Pe(V,v){const p=new s.Group;p.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let m=0,b=1;for(let r=0;r<V.length;r++){const g=V[r],f=g.Y??0,w=g.B??0,a=g.C??0,y=g.R??0;if(w!==0){const d=new s.Matrix4().makeRotationAxis(n.localY,W(w));n.localX.applyMatrix4(d),n.localZ.applyMatrix4(d)}if(f>0){const d=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(f*G));const _=n.pos.clone(),c=Re(d,_,v*G);c.userData={segmentType:"straight",segmentIndex:m,frameIndex:r,length:f,frame:{Y:f,B:w,C:a,R:y}},c.name=`直段_${m}`,p.add(c);const u=d.clone();De(p,b,u,v*G),m++}if(a>0&&y>0){const d=W(a),_=y*G,c=[];c.push(n.pos.clone());const u=n.pos.clone().add(n.localX.clone().multiplyScalar(-_)),k=Math.max(16,Math.ceil(a/5));for(let h=1;h<=k;h++){const M=d*h/k,A=new s.Matrix4().makeRotationAxis(n.localZ,M),L=n.localX.clone().multiplyScalar(_).applyMatrix4(A),X=u.clone().add(L);c.push(X)}const E=Be(c,v*G);E.userData={segmentType:"bend",segmentIndex:m,frameIndex:r,angle:a,radius:y,centerPoint:u.toArray(),frame:{Y:f,B:w,C:a,R:y}},E.name=`弯段_${m}`,p.add(E),Math.floor(c.length/2),c[0],n.pos=c[c.length-1].clone();const S=new s.Matrix4().makeRotationAxis(n.localZ,d);n.localY.applyMatrix4(S),n.localX.applyMatrix4(S),m++,b++}}return p}function De(V,v,p,n){const m=new s.Vector3(0,n*2,n*5),b=p.clone().add(m),r=[p,b],g=new s.BufferGeometry().setFromPoints(r),f=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),w=new s.Line(g,f);w.computeLineDistances(),V.add(w);const a=document.createElement("canvas"),y=a.getContext("2d");a.width=128,a.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(v.toString(),64,64);const d=new s.CanvasTexture(a),_=new s.SpriteMaterial({map:d,transparent:!0,depthTest:!1,depthWrite:!1}),c=new s.Sprite(_),u=n*3;c.scale.set(u,u,1),c.position.copy(b),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Re(V,v,p){const n=new s.LineCurve3(V,v),m=new s.TubeGeometry(n,2,p,18,!1);return new s.Mesh(m,_e)}function Be(V,v){const p=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(p,Math.max(16,V.length*2),v,18,!1);return new s.Mesh(n,_e)}function Ce(V,v,p,n,m,b=0){let r=v.slice(0,m+1);const g=v[m+1];if(g&&b>0){const c={...g,B:(g.B??0)*b,C:(g.C??0)*b};r.push(c)}const f=ke(r),w=Math.max(0,p-f),a=[];a.push(new s.Vector3(0,0,0));const y=new s.Vector3(0,w*G,0);w>0&&a.push(y);let d={pos:y.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const _=[];for(let c=r.length-1;c>=0;c--){const u=r[c],k=Me(u);if(k.length>0){const E=k.map(A=>{const $=A.clone(),L=new s.Matrix4;return L.makeBasis(d.localX,d.localY,d.localZ),$.applyMatrix4(L),$.add(d.pos)});_.push(E);const S=E[E.length-1];d.pos=S.clone();const h=u.B??0,M=u.C??0;if(h!==0){const A=new s.Matrix4().makeRotationAxis(d.localY,W(h));d.localX.applyMatrix4(A),d.localZ.applyMatrix4(A)}if(M>0){const A=W(M),$=new s.Matrix4().makeRotationAxis(d.localZ,A);d.localY.applyMatrix4($),d.localX.applyMatrix4($)}}}for(const c of _)c.length>1&&a.push(...c.slice(1));a.length<2&&a.push(new s.Vector3(0,.001,0));try{const c=new s.CatmullRomCurve3(a,!1,"catmullrom",.01),u=new s.TubeGeometry(c,Math.max(2,a.length*4),n*G,18,!1);V.geometry.dispose(),V.geometry=u}catch(c){console.error("管件更新失败",c)}}function Ne(V,v,p,n=0){let m=V.slice(0,p+1);const b=V[p+1];if(b&&n>0){const d={...b,B:(b.B??0)*n,C:(b.C??0)*n};m.push(d)}const r=ke(m),g=Math.max(0,v-r),f=[];f.push(new s.Vector3(0,0,0));const w=new s.Vector3(0,g*G,0);g>0&&f.push(w);let a={pos:w.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const y=[];for(let d=m.length-1;d>=0;d--){const _=m[d],c=Me(_);if(c.length>0){const u=c.map(h=>{const M=h.clone(),A=new s.Matrix4;return A.makeBasis(a.localX,a.localY,a.localZ),M.applyMatrix4(A),M.add(a.pos)});y.push(u);const k=u[u.length-1];a.pos=k.clone();const E=_.B??0,S=_.C??0;if(E!==0){const h=new s.Matrix4().makeRotationAxis(a.localY,W(E));a.localX.applyMatrix4(h),a.localZ.applyMatrix4(h)}if(S>0){const h=W(S),M=new s.Matrix4().makeRotationAxis(a.localZ,h);a.localY.applyMatrix4(M),a.localX.applyMatrix4(M)}}}for(const d of y)d.length>1&&f.push(...d.slice(1));return f.length<2&&f.push(new s.Vector3(0,.001,0)),f}function xe(V,v,p,n,m,b,r,g=0,f=0){const w=m-f,a=Ne(n,w,r,g);let d=Ne(p,f,r,g);d.forEach(c=>c.y=-c.y),d.reverse();const _=[...d,...a];try{const c=new s.CatmullRomCurve3(_,!1,"catmullrom",.01),u=new s.TubeGeometry(c,Math.max(2,_.length*4),b*G,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=u}catch(c){console.error("管件更新失败",c)}}const Ae={class:"panel-content"},$e={class:"action-bar"},Fe={class:"animation-controls"},ze={class:"control-row"},Ye={class:"control-row"},Le={class:"frame-info"},Ue={class:"control-row"},Ie={class:"progress-bar"},je={class:"dialog-footer"},Ge=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(V,{expose:v}){const p=V,n=e.ref(),m=e.ref();e.watch(()=>p.threeData,t=>{const l=t==null?void 0:t.data;m.value=l==null?void 0:l.type},{immediate:!0});const b=async()=>{let t={};m.value===ne.robotMode.SINGLE&&(t=await he.fetchSingleRobotAnimationData()),m.value===ne.robotMode.DOUBLE&&(t=await he.fetchDoubleRobotAnimationData());const{initialPipeLength:l=0,pipeRadius:o=0,clampLength:i=0,animationData:x}=t;S.value=l,h.value=o,M.value=i,n.value=x;const N=Te.cloneDeep(n.value),J=re(Y.value),q=(N==null?void 0:N["输出(动画数据)"])||[];r.value=q.length?q:[J]},r=e.ref([]),g=e.ref(!1),f=e.ref(""),w=e.ref(!1),a=e.ref(0),y=e.ref(0),d=e.ref(1e3);let _=!1;const c=e.ref(null),u=e.shallowRef(null),k=e.shallowRef(null),E=e.shallowRef(null),S=e.ref(0),h=e.ref(12.5),M=e.ref(30),A=e.ref([]),$=e.ref(null),L=e.computed(()=>p.model?ie.getNonFixedJoints(p.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...X.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),ae=()=>r.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),K=()=>{const t=[],l=[];return r.value.forEach(o=>{const{Y1:i,B1:x,C1:N,R1:J,Y2:q,B2:oe,C2:de,R2:D}=o;t.push({Y:parseFloat(i)||0,B:parseFloat(x)||0,C:parseFloat(N)||0,R:parseFloat(J)||0}),l.push({Y:parseFloat(q)||0,B:parseFloat(oe)||0,C:parseFloat(de)||0,R:parseFloat(D)||0})}),{posPipeYbcr:t,negPipeYbcr:l}},T=(t=0,l=0)=>{if(u.value&&k.value){const o=K();xe(u.value,k.value,o.posPipeYbcr,o.negPipeYbcr,S.value,h.value,t,l,M.value)}else if(u.value){const o=ae();Ce(u.value,o,S.value,h.value,t,l)}},C=t=>{if(t<0||t>=r.value.length){console.error(`帧索引 ${t} 超出范围`);return}const l=r.value[t];if(console.log(`应用第 ${t} 帧数据 ${l}`),a.value=t,c.value){const o={};L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value.setJointAngles(o)}T(t,0)},U=async()=>{if(r.value.length===0){B.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,r.value.length-1===a.value&&(a.value=0);try{for(let t=a.value+1;t<r.value.length&&!_;t++){a.value=t;const l=r.value[t],o={};c.value&&L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value?await c.value.animateToState(o,d.value,i=>{y.value=(t+i)/r.value.length*100,T(t-1,i)}):(await new Promise(i=>setTimeout(i,d.value)),y.value=(t+1)/r.value.length*100)}_||B.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),B.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,B.ElMessage.info("动画已停止")},I=()=>{a.value=0},z=()=>{if(u.value&&k.value){const t=K();xe(u.value,k.value,t.posPipeYbcr,t.negPipeYbcr,S.value,h.value,-1,0,M.value)}else if(u.value){const t=ae();Ce(u.value,t,S.value,h.value,-1,0)}},Z=()=>{c.value&&c.value.resetToZero(),z(),I(),B.ElMessage.success("机器人和管件已重置")},O=t=>`第 ${t+1} 帧`,j=t=>{w.value&&F(),C(t)},Q=()=>{w.value&&F(),!(a.value+1>=r.value.length)&&C(a.value+1)},P=()=>{w.value&&F(),a.value!==0&&C(a.value-1)},H=()=>{E.value&&(E.value.visible=!0),u.value&&u.value.parent&&u.value.parent.remove(u.value),E.value=null,u.value=null,k.value=null},re=t=>t==null?void 0:t.reduce((l,o)=>(l[o]="0",l),{});e.watch(Y,(t,l)=>{if(JSON.stringify(t)!==JSON.stringify(l))if(t.length>0){const o=re(t);r.value=[o]}else r.value=[]},{immediate:!0});const ee=e.ref(0),ue=t=>{ee.value=t},ge=(t,l)=>{if(!t||!l)return;const o=ie.getTargetJoint(t,l),i=Se();i.visible=!1,o==null||o.add(i)},Ve=t=>{c.value=new fe.URDFRobotController(t),A.value=ie.getAllLinkName(t),$.value="Pipe_Joint"},te=()=>{c.value=null,A.value=[],$.value=null},se=t=>{Ve(t),ge(t,$.value),ue(ee.value+1),Z()};e.watch(()=>p.model,t=>{if(H(),t){se(t);return}te()},{immediate:!0});const ve=t=>{var o,i;const l=new s.Mesh(t.geometry.clone(),t.material);return l.name="managed_pipe_clone",(i=(o=t==null?void 0:t.parent)==null?void 0:o.add)==null||i.call(o,l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),l};e.watch([$,M,S,ee],([t,l])=>{if(H(),p.model&&t){const o=ie.getMeshFromJoint(p.model,t);if(console.log(o,"meshToReplace"),o&&o.parent){E.value=o,o.visible=!1;const i=ve(o);if(m.value===ne.robotMode.SINGLE&&(i.position.y-=l*.001),u.value=i,m.value===ne.robotMode.DOUBLE){const x=ve(o);k.value=x}T(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const be=async()=>{if(Y.value.length===0){B.ElMessage.warning("没有可导出的表头");return}const t=Y.value.join(" ");try{await navigator.clipboard.writeText(t),B.ElMessage.success("表头已成功复制到剪贴板!")}catch(l){console.error("复制失败:",l),B.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},we=()=>{if(!f.value.trim()){B.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
|