chunk-35cfdf82.a8fc2fe7.js 12 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-35cfdf82"],{"05fa":function(e,t,r){"use strict";r("e0a3")},3097:function(e,t,r){"use strict";r.r(t),r.d(t,"getList",(function(){return n})),r.d(t,"doEdit",(function(){return o})),r.d(t,"doAdd",(function(){return s})),r.d(t,"doDelete",(function(){return i})),r.d(t,"menuTree",(function(){return u}));var a=r("b775");function n(e){return Object(a["default"])({url:"/base/role",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/base/role/"+e.id,method:"put",data:e})}function s(e){return Object(a["default"])({url:"/base/role",method:"post",data:e})}function i(e){return Object(a["default"])({url:"/base/role/"+e,method:"delete"})}function u(e){return Object(a["default"])({url:"/base/menu-tree",method:"get",params:e})}},4763:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"500px"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{on:{click:e.close}},[e._v("取 消")]),"编辑"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(" 确 定 ")]):e._e(),"添加"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v(" 添 加 ")]):e._e()]},proxy:!0}])},[r("el-form",{ref:"form",attrs:{"label-width":"80px",model:e.form,rules:e.rules}},[r("el-form-item",{attrs:{label:"角色",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"排序",prop:"sort"}},[r("el-input",{attrs:{type:"number"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),r("el-form-item",{attrs:{label:"状态",prop:"status"}},[r("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[r("el-radio",{attrs:{label:1}},[e._v("正常")]),r("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1)},n=[],o=r("1da1"),s=r("53ca"),i=(r("96cf"),r("3097")),u={name:"DepartmentManagementEdit",data:function(){return{typeArray:[{type:0,type_text:"饮片"},{type:1,type_text:"颗粒"}],form:{parent_id:0,status:1,parent_name:"",sort:0},rules:{name:[{required:!0,trigger:"blur",message:"请输入角色"}],sort:[{required:!0,trigger:"blur",message:"请输入排序"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}]},title:"",dialogFormVisible:!1}},created:function(){},methods:{showEdit:function(e){e?(this.title="编辑",this.form=Object.assign({},e),null==this.form.parent_name&&(this.form.parent_name="顶级课程")):this.title="添加",console.log(Object(s["a"])(this.form.parent_id),"第一步编辑"),this.dialogFormVisible=!0},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=8;break}return t.next=3,Object(i["doEdit"])(e.form);case 3:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},add:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=8;break}return t.next=3,Object(i["doAdd"])(e.form);case 3:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},l=u,c=r("2877"),d=Object(c["a"])(l,a,n,!1,null,null,null);t["default"]=d.exports},e0a3:function(e,t,r){},ef17:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"role-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:12}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")])],1),a("vab-query-form-right-panel",{attrs:{span:12}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"请输入角色"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name","string"===typeof t?t.trim():t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:r("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{align:"center",label:"序号",sortable:"",type:"index",width:"80"}}),a("el-table-column",{attrs:{align:"center",label:"角色",prop:"name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"排序",prop:"sort","show-overflow-tooltip":"",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("div",{staticClass:"edit"},[e.authForm.id==r.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.cancelSort(r)}}}):e._e(),e.authForm.id!==r.id||0==e.editStatus?a("span",{staticClass:"sort-num"},[e._v(" "+e._s(r.sort)+" ")]):e._e(),e.authForm.id==r.id&&1==e.editStatus?a("el-input",{ref:"getFocus",staticClass:"input-sort",on:{input:e.inputSort},model:{value:r.sort,callback:function(t){e.$set(r,"sort",t)},expression:"row.sort"}}):e._e(),e.authForm.id!==r.id||0==e.editStatus?a("i",{staticClass:"el-icon-edit",on:{click:function(t){return e.changeSort(r)}}}):e._e(),e.authForm.id==r.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-check",on:{click:e.sureChange}}):e._e()],1)]}}])}),a("el-table-column",{attrs:{align:"center",label:"创建时间",prop:"created_at","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"状态",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[1==r.status?a("el-tag",[e._v("正常")]):e._e(),0==r.status?a("el-tag",{attrs:{type:"danger"}},[e._v("禁用")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"操作","show-overflow-tooltip":"",width:"170"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.authoriza(r)}}},[e._v("授权")]),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),a("el-button",{attrs:{disabled:1==r.is_delete,type:"text"},on:{click:function(t){return e.handleDelete(r)}}},[e._v(" 删除 ")])]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}}),a("edit",{ref:"edit",on:{"fetch-data":e.fetchData}}),a("el-dialog",{attrs:{title:"授权",visible:e.authorizaFormVisible,width:"500px"},on:{"update:visible":function(t){e.authorizaFormVisible=t},close:e.close},scopedSlots:e._u([{key:"footer",fn:function(){return[a("el-button",{on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.saveAuthoriz}},[e._v("确 定")])]},proxy:!0}])},[a("el-tree",{ref:"tree",attrs:{data:e.menuList,"default-checked-keys":e.nodeArr,"default-expand-all":"","node-key":"id",props:e.zh_defaultProps,"show-checkbox":!0},on:{check:e.checkNode}})],1)],1)},n=[],o=r("1da1"),s=(r("96cf"),r("99af"),r("4e82"),r("3097")),i=r("4763"),u={name:"RoleManagement",components:{Edit:i["default"]},data:function(){return{authorizaFormVisible:!1,list:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",total:0,selectRows:"",queryForm:{page:1,per_page:15},oldSort:0,editStatus:0,flag:!1,menuList:[],zh_defaultProps:{children:"children",label:function(e){return e.zh_title}},en_defaultProps:{children:"children",label:function(e){return e.en_title}},authForm:{id:"",menuIds:[]},nodeArr:[]}},created:function(){this.fetchData()},methods:{close:function(){this.authorizaFormVisible=!1,this.authForm.menuIds=[]},checkNode:function(e){console.log(e,"pppppppppppppp"),this.authForm.menus=this.$refs.tree.getCheckedKeys(),this.authForm.parent_menus=this.authForm.menus.concat(this.$refs.tree.getHalfCheckedKeys()),console.log(this.authForm.parent_menus,"this.authForm.parent_menus")},authoriza:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){var a,n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.authForm=e,r.next=3,Object(s["menuTree"])();case 3:a=r.sent,n=a.data,t.menuList=n,t.authForm=e,t.nodeArr=t.authForm.menus,t.authorizaFormVisible=!0;case 9:case"end":return r.stop()}}),r)})))()},saveAuthoriz:function(){this.authForm.parent_menus=this.authForm.menus.concat(this.$refs.tree.getHalfCheckedKeys()),console.log(this.authForm,"this.authForm"),this.auth_sureChange(this.authForm),this.authorizaFormVisible=!1},setSelectRows:function(e){this.selectRows=e},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDelete:function(e){var t=this;this.$baseConfirm("你确定要删除当前项吗",null,Object(o["a"])(regeneratorRuntime.mark((function r(){var a,n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(s["doDelete"])(e.id);case 2:return a=r.sent,n=a.message,t.$baseMessage(n,"success",!1,"vab-hey-message-success"),r.next=7,t.fetchData();case 7:case"end":return r.stop()}}),r)}))))},handleSizeChange:function(e){this.queryForm.per_page=e,this.fetchData()},handleCurrentChange:function(e){this.queryForm.page=e,this.fetchData()},queryData:function(){this.queryForm.page=1,this.fetchData()},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(s["getList"])(e.queryForm);case 3:r=t.sent,a=r.data,console.log(a,"角色列表"),e.list=a.list,n=a.meta,e.total=n.pagination.total,e.listLoading=!1;case 10:case"end":return t.stop()}}),t)})))()},auth_sureChange:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["doEdit"])(e.authForm);case 2:r=t.sent,a=r.message,e.$baseMessage(a,"success",!1,"vab-hey-message-success"),e.fetchData();case 6:case"end":return t.stop()}}),t)})))()},inputSort:function(e){console.log(e,"inputSort"),this.authForm.sort=e},cancelSort:function(){console.log("cancelSort"),this.editStatus=0,this.authForm.sort=this.oldSort},changeSort:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:console.log("changeSort"),t.editStatus=1,t.authForm=e,t.oldSort=e.sort,t.$nextTick((function(){t.$refs["getFocus"].focus()}));case 5:case"end":return r.stop()}}),r)})))()},sureChange:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("sureChange"),e.editStatus=0,e.oldSort===e.authForm.sort){t.next=11;break}return t.next=5,Object(s["doEdit"])(e.authForm);case 5:r=t.sent,a=r.message,e.$baseMessage(a,"success",!1,"vab-hey-message-success"),e.fetchData(),t.next=12;break;case 11:return t.abrupt("return");case 12:case"end":return t.stop()}}),t)})))()}}},l=u,c=(r("05fa"),r("2877")),d=Object(c["a"])(l,a,n,!1,null,"615af472",null);t["default"]=d.exports},f1f0:function(e,t,r){e.exports=r.p+"static/img/data_empty.475a2a1e.png"}}]);