import{_ as c}from"./index-cf27e902.js";import{n as l,i,a9 as u}from"./index-b54f5418.js";import"./three-dc46505d.js";var v=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{directives:[{name:"show",rawName:"v-show",value:t.config,expression:"config"}],staticClass:"constraintorModule-container"},[e("div",{staticClass:"eventSetting-title"},[e("vis-icon",{attrs:{code:"#iconjihetuxing"}}),e("de-controller-input",{attrs:{label:"名称"},model:{value:t.config.name,callback:function(n){t.$set(t.config,"name",n)},expression:"config.name"}})],1),e("el-popover",{attrs:{placement:"bottom",width:"200",trigger:"click"},model:{value:t.visible,callback:function(n){t.visible=n},expression:"visible"}},[e("el-cascader-panel",{attrs:{options:t.constraintorOptions},on:{change:t.change},model:{value:t.cascaderValue,callback:function(n){t.cascaderValue=n},expression:"cascaderValue"}}),e("el-button",{attrs:{slot:"reference",type:"primary",size:"mini"},slot:"reference"},[t._v(" 添加约束器 ")])],1),t._l(t.constraintorList,function(n){return e("div",{key:n.vid,staticClass:"constraintor-item"},[e(n.type,{tag:"components",attrs:{config:n}}),e("div",{staticClass:"operation-box"},[e("vis-icon",{attrs:{code:"#iconsanjiaojiantoushang"}}),e("vis-icon",{attrs:{code:"#iconsanjiaojiantouxia"}}),e("vis-icon",{attrs:{code:"#iconshanchu"},nativeOn:{click:function(_){return t.deleteConstraintor(n)}}})],1)],1)})],2)},d=[];const s=Object.assign({"./constraintorModule/NumberConstraintor.vue":()=>c(()=>import("./NumberConstraintor-c46109c1.js"),["assets/NumberConstraintor-c46109c1.js","assets/index-cf27e902.js","assets/index-b54f5418.js","assets/three-dc46505d.js","assets/index-f59973e2.css","assets/index-9ecf8d88.css"])}),r={};Object.keys(s).forEach(t=>{r[t.split("/").pop().replace(/.\/|\.vue$/g,"")]=s[t]});const f={components:r,data(){return{visible:!1,cascaderValue:[],constraintorOptions:[{label:"数值约束",value:i.NUMBERCONSTRAINTOR,merge:()=>({offset:{operate:"+",value:0}})},{label:"包围盒约束",value:i.BOUNDINGBOXCONSTRAINTOR,merge:()=>({})}]}},computed:{config(){return this.$store.getters["active/object"]},constraintorList(){return Object.values(this.$store.getters["constraintor/get"]).filter(t=>t.target===this.config.vid)}},methods:{change(t){if(!t[0])return;const o=this.constraintorOptions.find(n=>n.value=t[0]),e=u(t[0],{target:this.config.vid,...o.merge()});e.name=`${this.constraintorOptions.find(n=>n.value===t[0]).label}-${e.vid.slice(-2)}`,console.log(e),this.$store.commit("constraintor/add",e),this.cascaderValue=[],this.visible=!1},deleteConstraintor(t){this.$store.commit("constraintor/remove",t.vid)}}},a={};var p=l(f,v,d,!1,m,"30d83fd7",null,null);function m(t){for(let o in a)this[o]=a[o]}const O=function(){return p.exports}();export{O as default};
