webpackJsonp([22],{PvO8:function(e,t){},SJ7l:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("Dd8w"),n=i.n(s),a=i("lRwf"),o=i.n(a),r=i("zL8q"),c=i("2CGT");o.a.component(r.CollapseTransition.name,r.CollapseTransition);var l={name:"group-list",data:function(){return{lists:[],addGroupDialog:!1,expendTxt:"展开",groupName:"",title:"新增分组名称",currentIndex:-1,active:!1}},computed:{expendClass:function(){return"展开"!=this.expendTxt?"is-caret":""}},methods:{handleChangeIndex:function(e,t){this.active=!1,this.currentIndex=e,this.$emit("second-list",t)},editGroupName:function(e){this.operatorName(e)&&(e.edit=!0)},deleteGroupName:function(e){var t=this;this.operatorName(e)&&this.$confirm("是否删除分组名称？","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.excludeName(e)}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},excludeName:function(e){var t=this,i={requestProject:"gic-member-tag-web",memberTagGroupClassifyId:e.memberTagGroupClassifyId};Object(c.k)(i).then(function(e){1==e.errorCode&&(t.getMemberGroupList(),t.$message({type:"success",message:"删除成功!"}))})},modifyName:function(e){var t=this;if(e.classifyName){var i={requestProject:"gic-member-tag-web",classifyName:e.classifyName,memberTagGroupClassifyId:e.memberTagGroupClassifyId};Object(c.m)(i).then(function(i){1==i.errorCode&&(e.edit=!1,t.getMemberGroupList(),t.$message({type:"success",message:"修改成功",duration:2e3}))})}else this.$message({message:"分组名称不能为空！",type:"warning",duration:2e3})},operatorName:function(e){return"0"!=e.memberTagGroupClassifyId||(this.$message({message:e.classifyName+"的不能操作",type:"warning",duration:2e3}),!1)},handleGroupDialog:function(){var e=this;if(this.groupName){var t={requestProject:"gic-member-tag-web",classifyName:this.groupName};Object(c.m)(t).then(function(t){1==t.errorCode&&(e.getMemberGroupList(),e.addGroupDialog=!1,e.$message({type:"success",message:"添加成功"}))})}else this.$message({type:"warning",message:"分组名称不能为空"})},getMemberGroupList:function(){var e=this;Object(c.l)({requestProject:"gic-member-tag-web"}).then(function(t){1===t.errorCode&&(e.lists=t.result.map(function(e){return n()({},e,{edit:!1})}))})},handleExpend:function(){this.expendTxt="展开"===this.expendTxt?"收起":"展开"},getRecommendList:function(){this.active=!0,this.currentIndex=-1,this.$emit("getRecommend")}},beforeMount:function(){this.getMemberGroupList()}},u={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"group-list"},[i("div",{staticClass:"member-group"},[i("i",{staticClass:"icon-list el-icon-caret-top icon-transform",class:e.expendClass,on:{click:e.handleExpend}}),e._v("\n    我的会员分组\n    "),i("i",{staticClass:"el-icon-plus icon-right icon-list",on:{click:function(t){e.addGroupDialog=!0}}})]),e._v(" "),i("el-collapseTransition",[i("ul",{directives:[{name:"show",rawName:"v-show",value:"展开"==e.expendTxt,expression:"expendTxt == '展开'"}],staticClass:"lists"},e._l(e.lists,function(t,s){return i("li",{key:s,staticClass:"member-list",class:{"active-li":s==e.currentIndex},on:{click:function(i){return e.handleChangeIndex(s,t)}}},[i("span",{directives:[{name:"show",rawName:"v-show",value:!t.edit,expression:"!list.edit"}]},[e._v(e._s(t.classifyName))]),e._v(" "),i("el-input",{directives:[{name:"show",rawName:"v-show",value:t.edit,expression:"list.edit"}],staticStyle:{width:"100px"},attrs:{size:"mini"},nativeOn:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.modifyName(t)}},model:{value:t.classifyName,callback:function(i){e.$set(t,"classifyName",i)},expression:"list.classifyName"}}),e._v(" "),i("div",{staticClass:"oper-area"},[i("i",{staticClass:"el-icon-edit icon-list icon-list-oper",on:{click:function(i){return e.editGroupName(t)}}}),e._v(" "),i("i",{staticClass:"icon-list el-icon-circle-close icon-list-oper",on:{click:function(i){return e.deleteGroupName(t)}}})])],1)}),0)]),e._v(" "),i("div",{staticClass:"recommend-list",class:{"recommend-active":e.active},on:{click:e.getRecommendList}},[e._v("\n    推荐会员分组\n  ")]),e._v(" "),i("el-dialog",{attrs:{title:e.title,visible:e.addGroupDialog,width:"320px",top:"30vh","close-on-click-modal":!1},on:{"update:visible":function(t){e.addGroupDialog=t}}},[i("div",[e._v("\n      分组名称：\n      "),i("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入分组名称",maxlength:10,clearable:""},model:{value:e.groupName,callback:function(t){e.groupName=t},expression:"groupName"}})],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.addGroupDialog=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.handleGroupDialog}},[e._v("确 定")])],1)])],1)},staticRenderFns:[]};var m=i("VU/8")(l,u,!1,function(e){i("PvO8")},"data-v-432f18b8",null);t.default=m.exports}});