webpackJsonp([52],{vDY1:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("vMJZ"),s={name:"userGroup",data:function(){return{tableData:[],listLoading:!1,delVisible:!1,delParams:{id:""},idx:-1}},created:function(){this.fetchData(),eventBus.$on("updateGroupSuccess",this.fetchData)},computed:{data:function(){}},methods:{fetchData:function(){var t=this;this.listLoading=!0,a.a.groupList({}).then(function(e){t.listLoading=!1,t.tableData=e.data})},handleDelete:function(t,e){this.idx=t,this.delVisible=!0,this.delParams.id=e.id},deleteSubmit:function(){var t=this;a.a.groupDelete(this.delParams).then(function(e){1==e.code?(t.$message.success("删除成功"),t.delVisible=!1,t.tableData.splice(t.idx,1)):t.$message.error(e.msg)})},addGroup:function(){this.$router.push({name:"userGroupAdd"})},editUserGroup:function(t){this.$router.push({name:"userGroupEdit",query:{id:t}})},fieldsList:function(t){this.$router.push({name:"fieldsIndex",query:{cid:t,type:"user"}})}}},l={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"container"},[i("div",{staticClass:"handle-box text-right"},[i("el-button",{attrs:{type:"",size:"mini"},on:{click:function(e){t.addGroup()}}},[i("i",{staticClass:"fa fa-plus"}),t._v(" 新建")])],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.tableData}},[i("el-table-column",{attrs:{prop:"id",label:"#",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("small",[t._v(t._s(e.row.id))])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"name",label:"名称"}}),t._v(" "),i("el-table-column",{attrs:{prop:"memo",label:"描述"}}),t._v(" "),i("el-table-column",{attrs:{label:"操作",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"编辑",placement:"top"}},[i("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(i){t.editUserGroup(e.row.id)}}},[i("i",{staticClass:"fa fa-pencil"})])],1),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"扩展字段",placement:"top"}},[i("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(i){t.fieldsList(e.row.id)}}},[i("i",{staticClass:"fa fa-plug"})])],1),t._v(" "),0!==e.row.type?i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"删除",placement:"top"}},[i("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(i){t.handleDelete(e.$index,e.row)}}},[i("i",{staticClass:"fa fa-trash"})])],1):t._e()]}}])})],1),t._v(" "),i("el-dialog",{attrs:{title:"提示",visible:t.delVisible,width:"300px"},on:{"update:visible":function(e){t.delVisible=e}}},[i("div",{staticClass:"del-dialog-cnt"},[t._v("删除不可恢复，是否确定删除？")]),t._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.deleteSubmit}},[t._v("确 定")])],1)])],1)},staticRenderFns:[]},n=i("XAIM")(s,l,!1,null,null,null);e.default=n.exports}});