(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-72582dd3"],{"0194":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[e._m(0),a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"租户名称",prop:"tenantName"}},[a("el-input",{attrs:{placeholder:"请输入租户名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.tenantName,callback:function(t){e.$set(e.queryParams,"tenantName",t)},expression:"queryParams.tenantName"}})],1),a("el-form-item",{attrs:{label:"管理员账号",prop:"userName"}},[a("el-input",{attrs:{placeholder:"请输入管理员账号",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.userName,callback:function(t){e.$set(e.queryParams,"userName",t)},expression:"queryParams.userName"}})],1),a("el-form-item",{attrs:{label:"手机号码",prop:"userPhone"}},[a("el-input",{attrs:{placeholder:"请输入手机号码",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.userPhone,callback:function(t){e.$set(e.queryParams,"userPhone",t)},expression:"queryParams.userPhone"}})],1),a("el-form-item",{attrs:{label:"租赁结束时间"}},[a("el-date-picker",{staticStyle:{width:"240px"},attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.daterangeTenantTime,callback:function(t){e.daterangeTenantTime=t},expression:"daterangeTenantTime"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:add"],expression:"['system:tenant:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:edit"],expression:"['system:tenant:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:remove"],expression:"['system:tenant:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:export"],expression:"['system:tenant:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.tenantList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{label:"租户编码",align:"center",prop:"id"}}),a("el-table-column",{attrs:{label:"租户名称",align:"center",prop:"tenantName"}}),a("el-table-column",{attrs:{label:"管理员账号",align:"center",prop:"userName"}}),a("el-table-column",{attrs:{label:"手机号码",align:"center",prop:"userPhone"}}),a("el-table-column",{attrs:{label:"邮箱地址",align:"center",prop:"userEmail"}}),a("el-table-column",{attrs:{label:"租户套餐",align:"center",prop:"tenantPackage",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",[e._v(e._s(e.getPackageName(t.row.tenantPackage)))])]}}])}),a("el-table-column",{attrs:{label:"租赁结束时间",align:"center",prop:"tenantTime",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.tenantTime,"{y}-{m}-{d}")))])]}}])}),a("el-table-column",{attrs:{label:"租户状态",align:"center",prop:"status"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.sys_tenant_status,value:t.row.status}})]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:edit"],expression:"['system:tenant:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("修改")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:tenant:remove"],expression:"['system:tenant:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"550px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"租户编码",prop:"id"}},[a("el-input",{attrs:{placeholder:"请输入租户编码",disabled:this.updateOrAdd},model:{value:e.form.id,callback:function(t){e.$set(e.form,"id",t)},expression:"form.id"}})],1),a("el-form-item",{attrs:{label:"租户名称",prop:"tenantName"}},[a("el-input",{attrs:{placeholder:"请输入租户名称",disabled:this.updateOrAdd},model:{value:e.form.tenantName,callback:function(t){e.$set(e.form,"tenantName",t)},expression:"form.tenantName"}})],1),a("el-form-item",{attrs:{label:"管理员账号",prop:"userName"}},[a("el-input",{attrs:{placeholder:"请输入管理员账号",disabled:this.updateOrAdd},model:{value:e.form.userName,callback:function(t){e.$set(e.form,"userName",t)},expression:"form.userName"}})],1),a("el-form-item",{attrs:{label:"手机号码",prop:"userPhone"}},[a("el-input",{attrs:{placeholder:"请输入手机号码"},model:{value:e.form.userPhone,callback:function(t){e.$set(e.form,"userPhone",t)},expression:"form.userPhone"}})],1),a("el-form-item",{attrs:{label:"邮箱地址",prop:"userEmail"}},[a("el-input",{attrs:{placeholder:"请输入邮箱地址"},model:{value:e.form.userEmail,callback:function(t){e.$set(e.form,"userEmail",t)},expression:"form.userEmail"}})],1),a("el-form-item",{attrs:{label:"租户套餐",prop:"tenantPackage"}},[a("el-select",{attrs:{placeholder:"请选择租户套餐",clearable:"",size:"small"},model:{value:e.form.tenantPackage,callback:function(t){e.$set(e.form,"tenantPackage",t)},expression:"form.tenantPackage"}},e._l(e.packageList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"租赁结束时间",prop:"tenantTime"}},[a("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd",placeholder:"请选择租赁结束时间"},model:{value:e.form.tenantTime,callback:function(t){e.$set(e.form,"tenantTime",t)},expression:"form.tenantTime"}})],1),a("el-form-item",{attrs:{label:"租户状态"}},[a("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},e._l(e.dict.type.sys_tenant_status,(function(t){return a("el-radio",{key:t.value,attrs:{label:parseInt(t.value)}},[e._v(e._s(t.label))])})),1)],1),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入内容"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tenanttip",staticStyle:{padding:"8px 16px","background-color":"#ecf8ff","border-radius":"4px","border-left":"5px solid #ef8708",margin:"20px 0"}},[a("p",{staticStyle:{"font-weight":"400",color:"#1f2f3d"}},[e._v("特别提醒,租户管理员初始密码采用邮件通知方式发放,保证安全性,请填写正确的邮箱!")])])}],s=a("b85c"),l=a("5530"),i=(a("d81d"),a("b0c0"),a("b775"));function o(e){return Object(i["a"])({url:"/system/tenant/list",method:"get",params:e})}function u(e){return Object(i["a"])({url:"/system/tenant/"+e,method:"get"})}function m(e){return Object(i["a"])({url:"/system/tenant",method:"post",data:e})}function c(e){return Object(i["a"])({url:"/system/tenant",method:"put",data:e})}function d(e){return Object(i["a"])({url:"/system/tenant/"+e,method:"delete"})}var p=a("0e3d"),f=a("2da1"),h={name:"Tenant",dicts:["sys_tenant_status"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,tenantList:[],title:"",open:!1,packageList:[],daterangeTenantTime:[],queryParams:{pageNum:1,pageSize:10,tenantName:null,userName:null,userPhone:null,tenantTime:null,status:null},form:{},updateOrAdd:!1,rules:{id:[{required:!0,message:"租户编码不能为空",trigger:"blur"},{pattern:/^[1-9]\d*$/,message:"租户编码只能为数字类型",trigger:"blur"}],tenantName:[{required:!0,message:"租户名称不能为空",trigger:"blur"}],userName:[{required:!0,message:"管理员账号不能为空",trigger:"blur"}],userPhone:[{required:!0,message:"手机号码不能为空",trigger:"blur"},{pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/,message:"请输入正确的手机号码",trigger:"blur"}],userEmail:[{required:!0,message:"邮箱地址不能为空",trigger:"blur"},{type:"email",message:"请输入正确的邮箱地址",trigger:["blur","change"]}],tenantPackage:[{required:!0,message:"租户套餐不能为空",trigger:"blur"}],tenantTime:[{required:!0,message:"租赁结束时间不能为空",trigger:"blur"}],status:[{required:!0,message:"租户状态不能为空",trigger:"blur"}]}}},created:function(){var e=this;this.getList(),Object(p["c"])().then((function(t){e.packageList=t.data}))},methods:{getList:function(){var e=this;this.loading=!0,this.queryParams.params={},null!=this.daterangeTenantTime&&""!=this.daterangeTenantTime&&(this.queryParams.params["beginTenantTime"]=this.daterangeTenantTime[0],this.queryParams.params["endTenantTime"]=this.daterangeTenantTime[1]),o(this.queryParams).then((function(t){e.tenantList=t.data,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,tenantName:null,userName:null,userPhone:null,userEmail:null,tenantPackage:null,tenantTime:null,status:0,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.daterangeTenantTime=[],this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){var e=this;this.reset(),this.open=!0,this.updateOrAdd=!1,this.title="新增租户",Object(p["c"])().then((function(t){e.packageList=t.data}))},handleUpdate:function(e){var t=this;this.reset(),Object(p["c"])().then((function(e){t.packageList=e.data})),this.updateOrAdd=!0;var a=e.id||this.ids;u(a).then((function(e){t.form=e.data,t.open=!0,t.title="修改租户"}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id&&e.updateOrAdd?c(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):m(e.form).then((function(t){e.$modal.msgSuccess("新增成功,密码已发送至邮箱"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$modal.confirm("是否确认删除当前租户数据项?").then((function(){return d(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("system/tenant/export",Object(l["a"])({},this.queryParams),"租户管理_".concat(Object(f["f"])((new Date).getTime(),"{y}-{m}-{d}"),".xlsx"))},getPackageName:function(e){var t,a="",n=Object(s["a"])(this.packageList);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.id===parseInt(e)&&(a=r.name)}}catch(l){n.e(l)}finally{n.f()}return a}}},g=h,b=a("2877"),y=Object(b["a"])(g,n,r,!1,null,null,null);t["default"]=y.exports},"0e3d":function(e,t,a){"use strict";a.d(t,"e",(function(){return r})),a.d(t,"d",(function(){return s})),a.d(t,"a",(function(){return l})),a.d(t,"f",(function(){return i})),a.d(t,"b",(function(){return o})),a.d(t,"c",(function(){return u}));var n=a("b775");function r(e){return Object(n["a"])({url:"/system/tenantpackage/list",method:"get",params:e})}function s(e){return Object(n["a"])({url:"/system/tenantpackage/"+e,method:"get"})}function l(e){return Object(n["a"])({url:"/system/tenantpackage",method:"post",data:e})}function i(e){return Object(n["a"])({url:"/system/tenantpackage",method:"put",data:e})}function o(e){return Object(n["a"])({url:"/system/tenantpackage/"+e,method:"delete"})}function u(){return Object(n["a"])({url:"/system/tenantpackage/get-simple-list",method:"get"})}}}]);