1 |
- webpackJsonp([47],{PxyP:function(i,t){},thy1:function(i,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={render:function(){var i=this,t=i.$createElement,e=i._self._c||t;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:i.loading,expression:"loading"}],staticClass:"managementPage"},[e("div",{staticClass:"commonInfo operation_container"},[e("button",{staticClass:"addButton",on:{click:i.addPost}},[i._v("添加岗位")])]),i._v(" "),e("div",{staticClass:"table_div"},[e("table",[i._m(0),i._v(" "),e("tbody",i._l(i.infoList,function(t){return e("tr",{key:t.id,staticClass:"pointer"},[e("td",[e("span",[i._v(i._s(t.name?t.name:"-"))])]),i._v(" "),e("td",[e("span",[i._v(i._s(1==t.is_multiple?"是":"否"))])]),i._v(" "),e("td",[e("el-button",{staticClass:"modifybtn",attrs:{size:"mini"},on:{click:function(e){return i.editEvent(t)}}},[i._v("编 辑")])],1)])}),0)])]),i._v(" "),i.loading||0!=i.infoList.length?i._e():e("div",{staticClass:"noHaveDate"},[i._v("暂无数据")]),i._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:i.total>0,expression:"total>0"}],staticClass:"bottom"},[e("el-pagination",{attrs:{background:"","current-page":i.page,layout:"prev, pager, next","page-count":Number(i.pages)},on:{"current-change":i.handleCurrentChange}})],1),i._v(" "),e("el-dialog",{attrs:{title:(i.isEdit?"编辑":"添加")+"岗位",visible:i.dialogFlag,width:"500px","close-on-click-modal":!1,left:""},on:{"update:visible":function(t){i.dialogFlag=t}}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:i.loading,expression:"loading"}],staticClass:"dialogBox"},[e("div",{staticClass:"dialogitem"},[e("label",[i._v("岗位名称:")]),i._v(" "),e("el-input",{staticStyle:{width:"56%"},attrs:{placeholder:"请输入岗位名称",size:"small",clearable:""},model:{value:i.roomName,callback:function(t){i.roomName="string"==typeof t?t.trim():t},expression:"roomName"}})],1),i._v(" "),e("div",{staticClass:"dialogitem flex",staticStyle:{"align-items":"baseline"}},[e("label",[i._v("岗位权限:")]),i._v(" "),e("div",{staticStyle:{flex:"1","margin-left":"5px"}},[e("div",{staticClass:"gw_xz_div",class:i.gw_xz_active?"active":""},[i._v("选择岗位权限(可多选) "),e("i",{staticClass:"el-icon-arrow-down"}),i._v(" "),e("el-select",{staticClass:"gw_xz_input",attrs:{size:"mini",multiple:"","collapse-tags":"",placeholder:"请选择"},on:{blur:function(t){i.gw_xz_active=!1},focus:function(t){i.gw_xz_active=!0},change:i.selectChange},model:{value:i.groupModel,callback:function(t){i.groupModel=t},expression:"groupModel"}},i._l(i.groupList,function(i){return e("el-option",{key:i.id,attrs:{label:i.title,value:i.id}})}),1)],1),i._v(" "),i._l(i.positionPermissionGroupList,function(t){return e("el-tag",{key:t.id+"tag",staticStyle:{"margin-right":"10px","margin-top":"10px"},attrs:{size:"mini",closable:""},on:{close:function(e){return i.closeTag(t)}}},[i._v("\n "+i._s(t.title)+"\n ")])})],2)]),i._v(" "),e("div",{staticClass:"dialogitem",staticStyle:{"padding-left":"95px"}},[e("el-checkbox",{model:{value:i.is_multiple,callback:function(t){i.is_multiple=t},expression:"is_multiple"}},[i._v("是否能参与多场直播")])],1)]),i._v(" "),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"mini"},on:{click:function(t){i.dialogFlag=!1}}},[i._v("取 消")]),i._v(" "),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:i.roomEdit}},[i._v("提 交")])],1)])],1)},staticRenderFns:[function(){var i=this.$createElement,t=this._self._c||i;return t("thead",[t("tr",[t("th",[t("div",{staticClass:"th_title"},[this._v("岗位")])]),this._v(" "),t("th",[t("div",{staticClass:"th_title"},[this._v("是否能参与多场直播")])]),this._v(" "),t("th",{staticStyle:{"margin-right":"20px"}},[t("div",{staticClass:"th_title"},[this._v("\n 操作\n ")])])])])}]};var o=e("VU/8")({data:function(){return{total:0,page:1,pages:0,page_size:20,loading:!1,infoList:[],roomName:"",dialogFlag:!1,isEdit:!1,edit_id:"",is_multiple:!1,positionPermissionGroupList:[],groupList:[],gw_xz_active:!1,groupModel:[]}},created:function(){this.init(1)},methods:{addPost:function(){this.positionPermissionGroupList=[],this.groupModel=[],this.dialogFlag=!0,this.isEdit=!1,this.roomName="",this.edit_id="",this.is_multiple=!1},selectChange:function(){var i=this;this.positionPermissionGroupList=this.groupList.filter(function(t){return-1!=i.groupModel.indexOf(t.id)})},closeTag:function(i){this.positionPermissionGroupList=this.positionPermissionGroupList.filter(function(t){return t.id!=i.id}),this.groupModel=this.groupModel.filter(function(t){return t!=i.id})},editEvent:function(i){var t=this;this.edit_id=i.id,this.roomName=i.name,this.getGroupList(),this.$loading(this.$loadingConfig),this.$axios.get(this.URL.BASEURL+this.URL.permission_positionPermissionGroupList,{params:{position_id:i.id}}).then(function(e){e=e.data,t.$loading(t.$loadingConfig).close(),e&&0==e.errno?(t.positionPermissionGroupList=e.rst,t.groupModel=t.positionPermissionGroupList.map(function(i){return i.id}),t.dialogFlag=!0,t.isEdit=!0,t.is_multiple=1==i.is_multiple):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(i){t.$loading(t.$loadingConfig).close()})},roomEdit:function(){var i=this;if(""!=this.roomName&&this.roomName)if(this.groupModel&&0!=this.groupModel.length){var t=this.URL.permission_addPosition,e={name:this.roomName,is_multiple:this.is_multiple?1:0,permission_group_id_list:this.groupModel};this.isEdit&&(t=this.URL.permission_updatePosition,e.position_id=this.edit_id),this.$loading(this.$loadingConfig),this.$axios.post(this.URL.BASEURL+t,e).then(function(t){t=t.data,i.$loading(i.$loadingConfig).close(),t&&0==t.errno?(i.$message({message:i.isEdit?"编辑成功":"添加成功",type:"success"}),i.dialogFlag=!1,i.init(i.page)):4002!=t.errno&&i.$message({message:t.err,type:"warning"})}).catch(function(t){i.$loading(i.$loadingConfig).close()})}else this.$message({message:"请选择岗位权限",type:"warning"});else this.$message({message:"请输入岗位名称",type:"warning"})},deleteFlagEvent:function(i){var t=this;this.$confirm("确定要删除该岗位?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$loading(t.$loadingConfig),t.$axios.post(t.URL.BASEURL+t.URL.permission_deletePosition,{position_id:i.id}).then(function(i){i=i.data,t.$loading(t.$loadingConfig).close(),i&&0==i.errno?t.init(t.page):t.$message({message:i.err,type:"warning"})}).catch(function(){t.$loading(t.$loadingConfig).close()})}).catch(function(){})},init:function(i){var t=this;this.page=i||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.permission_positionList,{params:{page:this.page,page_size:this.page_size}}).then(function(i){i=i.data,t.loading=!1,i&&0==i.errno?(t.infoList=i.rst.data,t.total=i.rst.pageInfo.total,t.pages=i.rst.pageInfo.pages):4002!=i.errno&&t.$message({message:i.err,type:"warning"})}).catch(function(i){t.loading=!1})},handleCurrentChange:function(i){this.init(i)},getGroupList:function(){var i=this;this.$axios.get(this.URL.BASEURL+this.URL.positionEnablePermissionGroupList,{params:{position_id:this.edit_id}}).then(function(t){(t=t.data)&&0==t.errno?i.groupList=t.rst:4002!=t.errno&&i.$message({message:t.err,type:"warning"})}).catch(function(i){})}}},s,!1,function(i){e("PxyP")},"data-v-07c271ab",null);t.default=o.exports}});
|