(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-cad759ac"],{
/***/"53f9":
/***/function(e,t,s){"use strict";
/* harmony import */s("f56d8");
/* harmony import */},
/***/"7aba":
/***/function(e,t,s){"use strict";
// ESM COMPAT FLAG
s.r(t);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/account/settings/UserAdd.vue?vue&type=template&id=7f331908&scoped=true
var a=s("5530"),r=(s("14d9"),s("d3b7"),s("93d6")),i=s("1d40"),n=s("8237"),o=s.n(n),c=s("2f62"),d={name:"UserAdd",i18n:s("89fe"),data:function(){return{
// cropper
RoleList:[],EditForm:this.$form.createForm(this),messageShowLoad:!1,preview:{},option:{img:"/avatar2.jpg",info:!0,size:1,outputType:"jpeg",canScale:!1,autoCrop:!0,
// 只有自动截图开启 宽度高度才生效
autoCropWidth:180,autoCropHeight:180,fixedBox:!0,
// 开启宽度和高度比例
fixed:!0,fixedNumber:[1,1]}}},created:function(){this.SystemRolesList()},computed:Object(a.a)({},Object(c.e)("setting",["isMobile","systemName"])),methods:{SystemRolesList:function(){var e=this;e.RoleList=[],this.messageShowLoad=!0,Object(i.E)().then((function(t){0==t.data.code&&(e.RoleList=t.data.list)})).finally((function(t){e.messageShowLoad=!1}))},AddUser:function(){var e=this,t=this;this.EditForm.validateFields((function(s){if(!s){var a={Username:e.EditForm.getFieldValue("UserName"),password:o()(e.EditForm.getFieldValue("NewPassword")),name:e.EditForm.getFieldValue("name"),phone:e.EditForm.getFieldValue("phone"),email:e.EditForm.getFieldValue("email"),job:e.EditForm.getFieldValue("job"),profile:e.EditForm.getFieldValue("profile"),role:e.EditForm.getFieldValue("Role")};t.messageShowLoad=!0,Object(r.a)(a).then((function(e){200==e.data.code?(t.$message.success(t.$t("account.settings.UserAdd.AddSuccess")),t.$router.push("/Setting/UserManager")):1009==e.data.code?t.$message.error(t.$t("account.settings.UserAdd.AddUserExist")):t.$message.error(t.$t("account.settings.UserAdd.AddFailed"))})).catch((function(e){t.messageShowLoad=!1,t.$message.error(t.$t("account.settings.UserAdd.AddFailed"))})).finally((function(e){t.messageShowLoad=!1}))}}))},handleConfirmBlur:function(e){var t=e.target.value;this.confirmDirty=this.confirmDirty||!!t},compareToFirstPassword:function(e,t,s){var a=this.EditForm;t&&t!==a.getFieldValue("NewPassword")?s(this.$t("account.settings.security.PasswordNotSame")):s()},validateToNextPassword:function(e,t,s){var a=this.EditForm;t&&this.confirmDirty&&a.validateFields(["ConfirmPassword"],{force:!0}),s()},Back:function(){this.$router.push("/Setting/UserManager")}}},u=(s("53f9"),s("2877")),l=Object(u.a)(d,(function(){var e=this,t=e._self._c;return t("a-spin",{staticStyle:{padding:"1px"},attrs:{spinning:e.messageShowLoad,tip:"Loading..."}},[t("div",{staticClass:"account-settings-info-view"},[t("a-row",{attrs:{gutter:16,type:"flex",justify:"center"}},[t("a-col",{attrs:{order:e.isMobile?2:1,md:24,lg:16}},[t("a-card",[t("a-form",{attrs:{form:e.EditForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("account.settings.basic.UserName")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["UserName",{rules:[{required:!0,message:e.$t("account.settings.basic.UserName-message")}]}],expression:"[\n                'UserName',\n                {\n                  rules: [{ required: true, message: $t('account.settings.basic.UserName-message') }],\n                },\n              ]"}],attrs:{placeholder:e.$t("account.settings.basic.name-message")}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.Role")}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["Role",{rules:[{required:!0,message:e.$t("account.settings.basic.Role"),whitespace:!0}]}],expression:"['Role', {rules: [{ required: true, message: $t('account.settings.basic.Role'), whitespace: true}]}]"}]},e._l(e.RoleList,(function(s){return t("a-select-option",{key:s.RoleId,attrs:{value:s.RoleId}},["Operator"==s.RoleId?t("span",[e._v(e._s(e.$t("account.settings.UserList.RoleOperator")))]):e._e(),"User"==s.RoleId?t("span",[e._v(e._s(e.$t("account.settings.UserList.RoleUser")))]):e._e()])})),1)],1),t("a-form-item",{attrs:{label:e.$t("account.settings.security.NewPassword")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["NewPassword",{rules:[{required:!0,message:e.$t("account.settings.security.NewPassword")},{min:8,message:e.$t("account.settings.security.password-description")},{validator:e.validateToNextPassword}]}],expression:"[\n        'NewPassword',\n        {\n          rules: [\n            {\n              required: true,\n              message: $t('account.settings.security.NewPassword'),\n            },\n            {\n              min: 8,\n              message: $t('account.settings.security.password-description'),\n            },\n            {\n              validator: validateToNextPassword,\n            },\n          ],\n        },\n      ]"}],attrs:{placeholder:e.$t("account.settings.security.NewPassword")}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.security.ConfirmNewPassword")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["ConfirmPassword",{rules:[{required:!0,message:e.$t("account.settings.security.ConfirmNewPassword-description")},{min:8,message:e.$t("account.settings.security.password-description")},{validator:e.compareToFirstPassword}]}],expression:"[\n        'ConfirmPassword',\n        {\n          rules: [\n            {\n              required: true,\n              message: $t('account.settings.security.ConfirmNewPassword-description'),\n            },\n            {\n              min: 8,\n              message: $t('account.settings.security.password-description'),\n            },\n            {\n              validator: compareToFirstPassword,\n            },\n          ],\n        },\n      ]"}],attrs:{type:"password",placeholder:e.$t("account.settings.security.ConfirmNewPassword")},on:{blur:e.handleConfirmBlur}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.name")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:e.$t("account.settings.basic.name-message")}]}],expression:"[\n                'name',\n                {\n                  rules: [{ required: true, message: $t('account.settings.basic.name-message') }],\n                },\n              ]"}],attrs:{placeholder:e.$t("account.settings.basic.name-message")}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.position")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["job",{rules:[{required:!0,message:e.$t("account.settings.basic.position-message")}]}],expression:"[\n                'job',\n                {\n                  rules: [{ required: true, message: $t('account.settings.basic.position-message') }],\n                },\n              ]"}],attrs:{placeholder:e.$t("account.settings.basic.position-message")}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.phone")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phone",{rules:[{required:!0,message:e.$t("account.settings.basic.phone-message")}]}],expression:"[\n                'phone',\n                {\n                  rules: [{ required: true, message: $t('account.settings.basic.phone-message') }],\n                },\n              ]"}],attrs:{placeholder:e.$t("account.settings.basic.phone-message")}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.email")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:e.$t("account.settings.basic.email-message")},{type:"email",message:e.$t("account.settings.basic.email-invalid")}]}],expression:"[\n                'email',\n                {\n                  rules: [\n                      { required: true, message: $t('account.settings.basic.email-message') },\n                      {\n                        type: 'email',\n                        message:  $t('account.settings.basic.email-invalid'),\n                      },\n\n                      ],\n                },\n              ]"}],attrs:{placeholder:"example@ism.com"}})],1),t("a-form-item",{attrs:{label:e.$t("account.settings.basic.profile")}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["profile",{rules:[{required:!0,message:e.$t("account.settings.basic.profile-message")}]}],expression:"[\n                'profile',\n                {\n                  rules: [{ required: true, message: $t('account.settings.basic.profile-message') }],\n                },\n              ]"}],attrs:{rows:"4",placeholder:e.$t("account.settings.basic.profile-message")}})],1),t("a-form-item",[t("a-button",{attrs:{type:"primary"},on:{click:e.AddUser}},[e._v(e._s(e.$t("account.settings.UserAdd.AddBtn")))]),t("a-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"default"},on:{click:e.Back}},[e._v(e._s(e.$t("dataModel.back")))])],1)],1)],1)],1)],1)],1)])}),[],!1,null,"7f331908",null)
/* harmony default export */;t.default=l.exports},
/***/f56d8:
/***/function(e,t,s){
// extracted by mini-css-extract-plugin
/***/}}]);