(window.webpackJsonpzcomps=window.webpackJsonpzcomps||[]).push([["chunk-1d94"],{ehN6:function(t,e,n){"use strict";n.r(e);var o=n("gDS+"),s=n.n(o),i=n("t2rG"),a=n.n(i),c=n("Vtdi"),d=n("ShcQ"),u={components:{draggable:a.a},data:function(){return{pdshForm:"pdshForm",compsList:[],activeIndex:-1,refresh:0,importButton:"pdshUploadBtn",emitName:"testMenu",disableVal:!0}},created:function(){this.init()},mounted:function(){var t=this,e=this;c.a.$on("get"+this.emitName,function(t,n){e.compsList.push({compName:t,compId:n}),e.saveMenuAndCompId(n,t)}),c.a.$on("parentMethodsRefresh",function(t){e.refresh=t}),c.a.$on("dragDisableChange",function(){t.disableVal=!1})},methods:{changeFun:function(t){if(t.hasOwnProperty("added")){var e=t.added.element;c.a.$emit("testMenuComp",e,this.emitName)}},mouseover:function(t){this.activeIndex=t},mouseout:function(){this.activeIndex=-1},editFun:function(t,e){c.a.$emit("updateForm",e,t+"Set")},delFun:function(t){var e=this,n=this.getPath(),o={table:"test",updates:{$pull:{compsList:{compId:t}}},attrs:{path:n},dbname:"test",not_token:!0};this.$confirm("此操作将永久删除该内容, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(d.h)(o).then(function(n){if("ok"===n.data.result)for(var o in e.compsList)if(e.compsList[o].compId===t){e.compsList.splice(o,1);break}})})},getPath:function(){var t=window.location.href,e=t.lastIndexOf("#/"),n=t.indexOf("?")>=0&&t.indexOf("?")>e?t.indexOf("?"):t.length;return t.substring(e+1,n)},saveMenuAndCompId:function(t,e){var n=this.getPath();0===this.compsList.length?this.menuAdd(n,t,e):this.menuCompIdAdd(n,t,e),this.disableVal=!0},menuAdd:function(t,e,n){var o={};o.path=t,o.compsList=[],o.compsList.push({compId:e,compName:n});var i=s()({attrs:o,dbname:"test",not_token:!0,table:"test"});Object(d.a)(i).then(function(t){})},menuCompIdAdd:function(t,e,n){var o={table:"test",updates:{$push:{compsList:{compId:e,compName:n}}},attrs:{path:t},dbname:"test",not_token:!0};Object(d.h)(o).then(function(t){})},init:function(){var t=this,e=this.getPath(),n=s()({attrs:{path:e},dbname:"test",not_token:!0,table:"test"});Object(d.g)(n).then(function(e){var n=e.data.data;n&&n.length>0&&(t.compsList=n[0].compsList)})}}},m=(n("ytxl"),n("KHd+")),p=Object(m.a)(u,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"test-menu"},[n(t.importButton,{tag:"component"}),t._v(" "),n("br"),t._v(" "),n("draggable",{staticClass:"dragArea11",staticStyle:{width:"1200px",height:"1200px"},attrs:{list:t.compsList,options:{group:"article",disabled:t.disableVal,sort:!1}},on:{change:t.changeFun}},t._l(t.compsList,function(e,o){return n("div",{key:o,class:{"component-cont":!0,active:o==t.activeIndex,btnStyle:"pdshButton"==e.compName},on:{mouseover:function(e){t.mouseover(o)},mouseout:function(e){t.mouseout()}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:o==t.activeIndex,expression:"index==activeIndex"}],staticClass:"icon-cont"},[n("i",{staticClass:"el-icon-edit icon",on:{click:function(n){t.editFun(e.compName,e.compId)}}}),t._v(" "),n("i",{staticClass:"el-icon-delete icon",on:{click:function(n){t.delFun(e.compId)}}})]),t._v(" "),n(e.compName,{tag:"component",attrs:{"comp-id":e.compId,refresh:t.refresh}})],1)}))],1)},[],!1,null,"a481d884",null);p.options.__file="pdsh-testMenu.vue",e.default=p.exports},u7xB:function(t,e,n){},ytxl:function(t,e,n){"use strict";var o=n("u7xB");n.n(o).a}}]);