mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
2 lines
6.4 KiB
JavaScript
Vendored
2 lines
6.4 KiB
JavaScript
Vendored
"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[931],{8406:function(e,t,a){a.r(t),a.d(t,{default:function(){return m}});var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pageBox"},[t("el-card",[t("div",{staticClass:"opaBox"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(t){e.dialogVisible=!0}}},[e._v("新增")])],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableList,border:""}},[t("el-table-column",{attrs:{prop:"id",label:"ID"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名"}}),t("el-table-column",{attrs:{label:"角色"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.roles&&t.row.roles[0].name))]}}])}),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"primary",icon:"el-icon-edit"},on:{click:function(t){return e.openEdit(a.row)}}},[e._v("编辑")])]}}])})],1),t("div",{staticClass:"page-pagination"},[t("el-pagination",{attrs:{"current-page":e.current_page,"page-sizes":[15,50,100],"page-size":e.per_page,layout:"total, sizes, prev, pager, next, jumper",total:e.Paginationdata.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),t("el-dialog",{attrs:{title:"编辑",visible:e.editVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(t){e.editVisible=t}}},[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"ID"}},[t("el-input",{model:{value:e.edit_from.id,callback:function(t){e.$set(e.edit_from,"id",t)},expression:"edit_from.id"}})],1),t("el-form-item",{attrs:{label:"姓名"}},[t("el-input",{model:{value:e.edit_from.name,callback:function(t){e.$set(e.edit_from,"name",t)},expression:"edit_from.name"}})],1),t("el-form-item",{attrs:{label:"邮箱"}},[t("el-input",{model:{value:e.edit_from.email,callback:function(t){e.$set(e.edit_from,"email",t)},expression:"edit_from.email"}})],1),t("el-form-item",{attrs:{label:"角色"}},[t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.edit_from.role_name,callback:function(t){e.$set(e.edit_from,"role_name",t)},expression:"edit_from.role_name"}},e._l(e.roleOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.name}})})),1)],1),t("el-form-item",{attrs:{label:"密码"}},[t("el-input",{model:{value:e.edit_from.password,callback:function(t){e.$set(e.edit_from,"password",t)},expression:"edit_from.password"}})],1),t("el-form-item",{attrs:{label:"密码确认"}},[t("el-input",{model:{value:e.edit_from.password_confirmation,callback:function(t){e.$set(e.edit_from,"password_confirmation",t)},expression:"edit_from.password_confirmation"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.editVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onEdit()}}},[e._v("确认")])],1)],1),t("el-dialog",{attrs:{title:"新增用户",visible:e.dialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"姓名"}},[t("el-input",{model:{value:e.from.name,callback:function(t){e.$set(e.from,"name",t)},expression:"from.name"}})],1),t("el-form-item",{attrs:{label:"密码"}},[t("el-input",{model:{value:e.from.password,callback:function(t){e.$set(e.from,"password",t)},expression:"from.password"}})],1),t("el-form-item",{attrs:{label:"确认密码"}},[t("el-input",{model:{value:e.from.password_confirmation,callback:function(t){e.$set(e.from,"password_confirmation",t)},expression:"from.password_confirmation"}})],1),t("el-form-item",{attrs:{label:"角色"}},[[t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.from.role_name,callback:function(t){e.$set(e.from,"role_name",t)},expression:"from.role_name"}},e._l(e.roleOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.name}})})),1)]],2)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit()}}},[e._v("确认")])],1)],1)],1)},o=[],l=a(2900),r={data(){return{id:"",dialogVisible:!1,editVisible:!1,loading:!0,tableList:[],from:{name:"",password:"",password_confirmation:"",role_name:""},edit_from:{created_at:"",deleted_at:null,email:"",id:"",name:"",password:"",password_confirmation:"",role_name:""},Paginationdata:{},current_page:1,per_page:15,roleOptions:[]}},mounted(){this.getList(),this.getrole()},methods:{getrole(){(0,l.Uy)().then((e=>{this.roleOptions=e.data.data}))},getList(){let e={page:this.current_page,per_page:this.per_page};(0,l.Lh)(e).then((e=>{this.tableList=e.data.data,this.Paginationdata=e.data.meta})),this.loading=!1},onSubmit(){let e=this.from;(0,l.RF)(e).then((e=>{this.tableList=[...this.tableList,e.data.data],this.dialogVisible=!1,this.getList(),this.from={},this.$message({message:"账号添加成功!",type:"success"})}))},openEdit(e){let t=e.id;this.id=e.id,(0,l.f7)(t).then((e=>{this.edit_from=e.data.data,this.edit_from.role_name=e.data.data.roles?e.data.data.roles[0].name:"",this.editVisible=!0}))},onEdit(){(0,l.AX)(this.id,this.edit_from).then((e=>{this.tableList=[...this.tableList,e.data.data],this.editVisible=!1,this.getList(),this.$message({message:"账号修改成功!",type:"success"})})),this.editVisible=!1},handleSizeChange(e){this.per_page=e,this.getList()},handleCurrentChange(e){this.current_page=e,this.getList()}}},n=r,s=a(1001),d=(0,s.Z)(n,i,o,!1,null,"23e43282",null),m=d.exports},2900:function(e,t,a){a.d(t,{A0:function(){return m},AX:function(){return s},Lh:function(){return l},RF:function(){return r},Uy:function(){return o},f7:function(){return n},nO:function(){return d}});var i=a(8430);function o(){return(0,i.Z)({url:"/api/roles",method:"get"})}function l(e){return(0,i.Z)({url:"/api/users",method:"get",params:e})}function r(e){return(0,i.Z)({url:"/api/users",method:"post",data:e})}function n(e){return(0,i.Z)({url:`/api/users/${e}`,method:"get"})}function s(e,t){return(0,i.Z)({url:`/api/users/${e}`,method:"patch",data:t})}function d(e){return(0,i.Z)({url:"/api/website_message",method:"get",params:e})}function m(e,t){return(0,i.Z)({url:`/api/website_message/${e}`,method:"patch",data:t})}}}]);
|
|
//# sourceMappingURL=931.c12ad990.js.map
|