UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 5.35 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0f8eafa8"],{"266f":function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"a",(function(){return n})),i.d(e,"d",(function(){return o})),i.d(e,"e",(function(){return a})),i.d(e,"c",(function(){return u}));var s=i("b775");function r(t){return Object(s["b"])({url:"resource/group_list",method:"post",data:t})}function n(t){return Object(s["b"])({url:"resource/group_add",method:"post",data:t})}function o(t){return Object(s["b"])({url:"resource/group_batch_add_resource",method:"post",data:t})}function a(t){return Object(s["b"])({url:"resource/list",method:"post",data:t})}function u(t){return Object(s["b"])({url:"resource/group_resource_list",method:"post",data:t})}},2909:function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var s=i("6b75");function r(t){if(Array.isArray(t))return Object(s["a"])(t)}i("a4d3"),i("e01a"),i("d3b7"),i("d28b"),i("3ca3"),i("ddb0"),i("a630");function n(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}var o=i("06c5");function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){return r(t)||n(t)||Object(o["a"])(t)||a()}},dfa5:function(t,e,i){"use strict";i.r(e);var s=i("2909"),r=(i("99af"),i("4e82"),i("d81d"),i("b0c0"),i("c740"),i("a434"),i("2dd7")),n=i("266f"),o=i("5d9e");e["default"]={name:"CareteGroup",components:{AntModal:r["a"],AdvanceTable:o["a"]},props:{},data:function(){return{open:!1,delayTime:200,spinning:!1,formTitle:"",queryParam:{name:"",page:1,limit:10},loading:!1,multiple:!0,selectedRowKeys:[],selectedRows:[],labelCol:{span:6},wrapperCol:{span:18},FormlabelCol:{span:6},FormwrapperCol:{span:16},total_count:0,expandedRowKeys:[],columns:[],list:[],allSaveId:[],TabType:1,tableHeight:400}},created:function(){},methods:{openHandle:function(t){this.formTitle="view.system.resourcegroup.AddApIPermissions",this.initColumns(),this.TabType=1,this.quitFull(),this.open=!0,this.$set(this.queryParam,"page",1),this.getList(),this.res_group_id=t.res_group_id,this.getResourceAddList(this.res_group_id)},seeResourceAddList:function(t){this.formTitle="view.system.resourcegroup.ViewAddedList",this.initColumns(1),this.TabType=2,this.quitFull(),this.open=!0,this.queryParam.page=1,this.res_group_id=t.res_group_id,this.getResourceAddList(this.res_group_id,2)},initColumns:function(t){var e=JSON.parse(JSON.stringify([{title:this.$t("view.system.resourcegroup.title"),dataIndex:"title",width:"150px",scopedSlots:{customRender:"title"}},{title:this.$t("view.system.resourcegroup.Api"),dataIndex:"path",width:"150px",scopedSlots:{customRender:"path"}}]));if(t){var i={title:this.$t("view.system.resourcegroup.operation"),dataIndex:"operation",width:"140px",scopedSlots:{customRender:"operation"}};this.$set(this,"columns",[].concat(Object(s["a"])(e),[i]))}else this.$set(this,"columns",e)},cancel:function(){this.open=!1,this.$emit("cancel")},submitForm:function(t){var e=this,i=[];return i=t?JSON.parse(JSON.stringify(this.allSaveId)).sort():JSON.parse(JSON.stringify(this.selectedRowKeys)).sort(),i=this._.sortBy(i),Object(n["d"])({resource_ids:i,res_group_id:e.res_group_id}).then((function(i){return t||(e.$message.info("api权限保存成功"),e.open=!1,e.$emit("ok")),i}))},getResourceAddList:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this;if(t){var s=[];Object(n["c"])({res_group_id:t}).then((function(t){t?(i._.map(t,(function(t){s.push(t.resource_id)})),1===e?(i.$set(i,"selectedRowKeys",s),i.$set(i,"selectedRows",t)):(i.total_count=t.length,i.$set(i,"list",t),i.$set(i,"allSaveId",s))):1===e?(i.$set(i,"selectedRowKeys",[]),i.$set(i,"selectedRows",[])):(i.$set(i,"list",[]),i.$set(i,"allSaveId",[]),i.total_count=0)}))}},getList:function(){var t=this,e={page:t.queryParam.page,limit:t.queryParam.limit,cat:"admin"};this.queryParam.name&&(e.w=this.queryParam.name),Object(n["e"])(e).then((function(e){t.list=e.List,t.total_count=e.total_count}))},onSelectChange:function(t,e){this.selectedRowKeys=t,this.selectedRows=e,this.ids=this.selectedRows.map((function(t){return t.id})),this.userNames=this.selectedRows.map((function(t){return t.name})),this.single=1!==t.length,this.multiple=!t.length},changeSize:function(t,e){1===this.TabType?(this.queryParam.page=t,this.queryParam.limit=e,this.getList()):(this.queryParam.page=t,this.queryParam.limit=e)},onShowSizeChange:function(t,e){1===this.TabType?(this.queryParam.page=t,this.queryParam.limit=e,this.getList()):(this.queryParam.page=t,this.queryParam.limit=e)},quitFull:function(t){t?this.tableHeight="85%":1===this.TabType?this.tableHeight=400:this.tableHeight=480},handleQuery:function(){this.TabType&&(this.queryParam.page=1,this.getList())},handleDelete:function(t){var e=t.resource_id,i=this,s=this.allSaveId.indexOf(e),r=this._.findIndex(this.list,{resource_id:e});-1!==s&&-1!==r&&(i.allSaveId.splice(s,1),this.submitForm(1).then((function(){i.$message.info("api删除成功"),i.list.splice(r,1)})))},handleAllDelete:function(){var t=this._.difference(this.allSaveId,this.selectedRowKeys),e=this;this.$set(this,"allSaveId",t),this.submitForm(1).then((function(){e.$message.info("api删除成功"),e.getResourceAddList(e.res_group_id,2)}))}}}}}]);