1"use strict";(self.webpackChunkvue_element_admin=self.webpackChunkvue_element_admin||[]).push([[35088],{19964:function(t,e,i){var n=i(2543),r=i(339);e.A={data:function(){return{step:0,importData:{},file:null,importInfo:{}}},methods:{getImportInfo:function(){var t=this;if((0,n.isObject)(this.$refs.file.uploadFiles[0])){this.file=this.$refs.file.uploadFiles[0].raw;var e=new FormData;e.append("file",this.file),e.append("type",this.$route.meta.title),this.fetchImportCompression(e).then(function(){t.step++})}else this.$message.error(this.$t("imports.file_required"))},fetchImportCompression:function(t){var e=this;return(0,r.MB)("import/get-info-for-import",t).then(function(t){e.importInfo=t.data}).catch(function(t){t.data&&t.data.message&&e.$msgbox({type:"warning",message:e.$createElement("span",{style:"overflow-wrap: break-word;"},t.data.message),confirmButtonText:"OK",center:!0})})},optionText:function(t){return!0===t.required?t.name+' <span style="color: red">*</span>':t.name},disableOption:function(t){var e=this;return Object.keys(this.importData).map(function(t){return e.importData[t]}).indexOf(t)>=0},contains:function(t,e){for(var i=0;i<e.length;i++)if(-1===t.indexOf(e[i]))return!1;return!0},matching:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Object.entries(this.importInfo.table).filter(function(t){return!0===t[1].required}).map(function(t){return t[0]}),i=Object.values(this.importData);this.contains(i,e)?t&&this.step++:this.$message.error(this.$t("imports.elements_required"))},nextStep:function(){0===this.step?this.getImportInfo():1===this.step?this.matching():this.changeStep()}}}},35088:function(t,e,i){i.r(e),i.d(e,{default:function(){return o}});var n=i(19964),r=i(49208),s=i(339),a={name:"AddUsers",components:{HeaderImport:r.A},mixins:[n.A],data:function(){return{loading:!1,steps:["imports.file_upload","imports.matching"]}},methods:{changeStep:function(){1===this.step&&this.importing()},importing:function(){var t=this;this.loading=!0;var e=new FormData;e.append("file",this.file),e.append("type",this.$route.meta.title),e.append("import",JSON.stringify(this.importData)),(0,s.MB)("import",e).then(function(){t.$message.success(t.$t("imports.importCompleted")),t.$router.push({name:"ImportList"})}).catch(function(e){e.data&&e.data.errors&&("to_many_attempts"in e.data.errors&&t.$message.error(e.data.errors.to_many_attempts[0]),"file"in e.data.errors&&t.$message.error(e.data.errors.file[0]))}).finally(function(){t.loading=!1})},nextStep:function(){0===this.step?this.getImportInfo():(this.matching(!1),this.changeStep())}}},o=(0,i(14486).A)(a,function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-container"},[e("header-import",{attrs:{loading:t.loading,steps:t.steps,step:t.step},on:{"next-step":t.nextStep}}),t._v(" "),0===t.step?e("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{inline:""}},[e("el-form-item",[e("el-upload",{ref:"file",attrs:{limit:1,"auto-upload":!1,drag:"",accept:".csv,.xls,.xlsx",action:""}},[e("i",{staticClass:"el-icon-upload"}),t._v(" "),e("div",{staticClass:"el-upload__text"},[t._v("\n "+t._s(t.$t("imports.importFile"))+" "),e("em",[t._v(".csv/.xls/.xlsx")])])])],1)],1):t._e(),t._v(" "),1===t.step?e("el-form",{staticClass:"demo-ruleForm"},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.importInfo.import}},[e("el-table-column",{attrs:{label:t.$t("imports.header")},scopedSlots:t._u([{key:"default",fn:function(i){return[e("div",[t._v("\n "+t._s(i.row)+"\n ")])]}}],null,!1,4110388959)}),t._v(" "),e("el-table-column",{attrs:{label:t.$t("imports.column")},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-select",{attrs:{placeholder:t.$t("imports.comparison"),clearable:""},model:{value:t.importData[i.row],callback:function(e){t.$set(t.importData,i.row,e)},expression:"importData[scope.row]"}},t._l(t.importInfo.table,function(i,n){return e("el-option",{key:n,attrs:{disabled:t.disableOption(n),label:i.name,value:n},domProps:{innerHTML:t._s(t.optionText(i))}})}),1)]}}],null,!1,3017119883)})],1)],1):t._e()],1)},[],!1,null,"1535787a",null).exports}
1,49208:function(t,e,i){i.d(e,{A:function(){return r}});var n={name:"HeaderImport",props:{steps:{type:Array,required:!0},step:{type:Number,required:!0},loading:{type:Boolean,default:!1}},computed:{textNextBut:function(){return this.steps[this.step+1]||"buttons.complete"}}},r=(0,i(14486).A)(n,function(){var t=this,e=t._self._c;return e("div",[e("header-sticky",{attrs:{title:t.$t("route."+t.$route.meta.title)}},[e("template",{slot:"prepend"},[e("el-button",{attrs:{loading:t.loading,type:"success",plain:""},on:{click:function(e){return t.$emit("next-step")}}},[t._v("\n "+t._s(t.$t(t.textNextBut))+"\n "),e("i",{staticClass:"el-icon-arrow-right"})])],1)],2),t._v(" "),e("el-steps",{staticStyle:{"margin-bottom":"10px"},attrs:{active:t.step,"finish-status":"success"}},t._l(t.steps,function(i,n){return e("el-step",{key:n,attrs:{title:t.$t(i)}})}),1)],1)},[],!1,null,"7bfbe720",null).exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.