import{n as a}from"./vueComponentNormalizer.9ef17bb1.js";/* empty css                                                               *//* empty css                                                                   */var l=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"search_input el-input el-input--small"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"el-input__inner",attrs:{type:"text",placeholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9"},domProps:{value:e.value},on:{input:function(n){n.target.composing||(e.value=n.target.value)}}}),t("i",{staticClass:"el-icon-search",attrs:{title:"\u641C\u7D22"}})])},o=[];const c={data:()=>({value:""}),watch:{"$attrs.value":{immediate:!0,handler(e){this.value=e}},value(e){this.$emit("input",e)}}},i={};var u=a(c,l,o,!1,d,null,null,null);function d(e){for(let r in i)this[r]=i[r]}const h=function(){return u.exports}();var p=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"search_tree_menu v-menu"},[t("h2",{staticClass:"v-title"},[e._v(e._s(e.title))]),t("SearchInput",{model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),t("div",{staticClass:"mt-12 t-right"},[e.$listeners.onCopy?t("el-button",{attrs:{type:"warning",circle:"",plain:"",icon:"el-icon-copy-document",size:"mini",title:"\u590D\u5236"},on:{click:e.handleCopy}}):e._e(),e.$listeners.onEdit?t("el-button",{attrs:{type:"primary",circle:"",plain:"",icon:"el-icon-edit",size:"mini",title:"\u7F16\u8F91"},on:{click:e.handleEdit}}):e._e(),e.$listeners.onCreate?t("el-button",{attrs:{type:"success",circle:"",plain:"",icon:"el-icon-plus",size:"mini",title:"\u521B\u5EFA"},on:{click:e.handleCreate}}):e._e(),e.$listeners.onDelete?t("el-button",{attrs:{type:"danger",circle:"",plain:"",icon:"el-icon-delete",size:"mini",title:"\u5220\u9664"},on:{click:e.handleDelete}}):e._e()],1),t("div",{staticClass:"tree_layout"},[t("ElTree",e._g(e._b({ref:"treeRef",attrs:{"default-expand-all":"","expand-on-click-node":!1,"highlight-current":"",props:{label:"name"},data:e.treeData,"node-key":e.treeNodeKey,"filter-node-method":e.filterNode}},"ElTree",e.$attrs,!1),e.$listeners))],1)],1)},_=[];const m={components:{SearchInput:h},props:{title:{type:String},treeNodeKey:{type:String,default:"id"},treeData:{type:Array,default:()=>[]},treeProps:{type:Object,default:()=>({})}},data:()=>({search:""}),watch:{search(e){this.$refs.treeRef.filter(e)}},methods:{filterNode(e,r){return e?r.name.includes(e):!0},setCurrentKey(e){return this.$refs.treeRef.setCurrentKey(e)},getCurrentNode(){return this.$refs.treeRef.getCurrentNode()},handleCreate(){this.$emit("onCreate",this.getCurrentNode())},handleEdit(){const e=this.getCurrentNode();if(!e)return this.$message.error("\u8BF7\u9009\u62E9\u8981\u4FEE\u6539\u7684\u6570\u636E");this.$emit("onEdit",e)},handleCopy(){const e=this.getCurrentNode();if(!e)return this.$message.error("\u8BF7\u9009\u62E9\u8981\u590D\u5236\u7684\u6570\u636E");this.$emit("onCopy",e)},handleDelete(){const e=this.getCurrentNode();if(!e)return this.$message.error("\u8BF7\u9009\u62E9\u8981\u5220\u9664\u7684\u6570\u636E");this.$emit("onDelete",e)}}},s={};var f=a(m,p,_,!1,v,"45c88ba2",null,null);function v(e){for(let r in s)this[r]=s[r]}const g=function(){return f.exports}();export{g as S};
