(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["view-attributeConfigDetail-vue"],{"0390":function(t,e,i){"use strict";var a=i("02f4")(!0);t.exports=function(t,e,i){return e+(i?a(t,e).length:1)}},"03ec":function(t,e,i){"use strict";i.r(e);i("7f7f");var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrapper wrapper-content animated fadeInRight surveyDetailPage"},[e("el-form",{ref:"detailInfo",staticClass:"demo-dynamic form-horizontal detailPage",attrs:{model:t.detailInfo,"label-width":"0px"}},[e("div",{staticClass:"ibox-content m-b-sm border-bottom"},[e("div",{staticClass:"row form-horizontal"},[e("div",{staticClass:"form-group margin-0"},[e("label",{staticClass:"col-sm-2 control-label"},[t._v("\n            Config Key\n          ")]),e("div",{staticClass:"col-sm-5",staticStyle:{padding:"0"}},[e("el-form-item",{attrs:{prop:"configKey",rules:{required:!0,message:t.$t("message.required"),trigger:"blur"}}},[e("el-input",{attrs:{disabled:!!t.$route.query.id,"show-word-limit":""},model:{value:t.detailInfo.configKey,callback:function(e){t.$set(t.detailInfo,"configKey",e)},expression:"detailInfo.configKey"}})],1)],1)]),e("div",{staticClass:"form-group margin-0"},[e("label",{staticClass:"col-sm-2 control-label"},[t._v("\n            Config Type\n          ")]),e("div",{staticClass:"col-sm-5",staticStyle:{padding:"0"}},[e("el-form-item",{attrs:{prop:"configType",rules:{required:!0,message:t.$t("message.required"),trigger:"change"}}},[e("el-select",{attrs:{disabled:!!t.$route.query.id,filterable:""},model:{value:t.detailInfo.configType,callback:function(e){t.$set(t.detailInfo,"configType",e)},expression:"detailInfo.configType"}},t._l(t.typeObj,(function(t){return e("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1)],1)]),e("div",{staticClass:"form-group margin-0"},[e("label",{staticClass:"col-sm-2 control-label"},[t._v("\n            Default Toggle\n          ")]),e("div",{staticClass:"col-sm-5",staticStyle:{"padding-top":"7px"}},[e("el-switch",{model:{value:t.detailInfo.defaultToggle,callback:function(e){t.$set(t.detailInfo,"defaultToggle",e)},expression:"detailInfo.defaultToggle"}})],1)]),e("div",{staticClass:"form-group margin-0"},[e("label",{staticClass:"col-sm-2 control-label"},[t._v("\n            Disable\n          ")]),e("div",{staticClass:"col-sm-5",staticStyle:{"padding-top":"7px"}},[e("el-switch",{model:{value:t.detailInfo.disable,callback:function(e){t.$set(t.detailInfo,"disable",e)},expression:"detailInfo.disable"}})],1)])])]),e("el-tabs",{attrs:{type:"border-card"}},t._l(t.$store.state.userInfo.language,(function(i,a){return e("el-tab-pane",{attrs:{label:i.name}},[e("div",{staticClass:"panel-body"},[e("div",{staticClass:"ibox-content"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"col-sm-2 control-label"},[t._v("\n                "+t._s(t.$t("message.Name"))+"\n              ")]),e("div",{staticClass:"col-sm-10"},[e("el-form-item",{attrs:{prop:"langMap."+a+".configName",rules:{required:!0,message:t.$t("message.required"),trigger:"blur"}}},[e("el-input",{attrs:{"show-word-limit":"",maxlength:50},model:{value:t.getObject(t.detailInfo.langMap,i.id).configName,callback:function(e){t.$set(t.getObject(t.detailInfo.langMap,i.id),"configName",e)},expression:"getObject(detailInfo.langMap, langItem.id).configName"}})],1)],1)]),e("div",{staticClass:"hr-line-dashed"}),e("div",{staticClass:"form-group"},[e("div",{staticClass:"col-sm-12"},[e("div",{staticClass:"pull-right"},[t.checkPermission("ATTRIBUTE_CONFIG_UPDATE")&&t.$route.query.id||t.checkPermission("ATTRIBUTE_CONFIG_CREATE")&&!t.$route.query.id?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.checkEvent()}}},[t._v(t._s(t.$t("message.Save")))]):t._e(),e("el-button",{on:{click:function(e){return t.showWarning()}}},[t._v(t._s(t.$t("message.Cancel")))])],1)])])])])])})),1)],1)],1)},n=[],r=(i("96cf"),i("3b8d")),s=i("db49"),o=(i("b76a"),i("94d7"),{mixins:[s["a"].globalMixin],data:function(){return{detailInfo:{configKey:"",configType:"",disable:!1,defaultToggle:!1,langMap:[]},typeObj:["Path"]}},computed:{_language:function(){return this.$store.state.userInfo.langCode},_projectid:function(){return this.$store.state.projectId}},watch:{_projectid:function(){this.$router.push({path:"/main/attributeConfigList"})},_language:function(){this.setObj()},detailInfo:{handler:function(){this.$store.state.edit=!0},deep:!0}},created:function(){for(var t=[],e=0;e<this.$store.state.userInfo.language.length;e++)t.push({languageId:this.$store.state.userInfo.language[e].id,configName:""});this.$set(this.detailInfo,"langMap",t),this.setObj()},mounted:function(){this.init()},methods:{setObj:function(){},init:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,i,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.$route.query.id,i=this,!e){t.next=17;break}return a=this.getAuthObj(),a.apiUrl=this.apiConfig.attributeConfigDetail+"/"+e,t.next=7,this.$store.dispatch("apiEvent",a);case 7:if(n=t.sent,n!=this.TOKEN_EXPIRED){t.next=11;break}return this.timeoutEvent(),t.abrupt("return");case 11:if(n){t.next=13;break}return t.abrupt("return");case 13:this.$set(this,"detailInfo",n.data.payload),setTimeout((function(){i.$store.state.edit=!1})),t.next=18;break;case 17:setTimeout((function(){i.$store.state.edit=!1}));case 18:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),showWarning:function(t){t||this.$router.push({path:"/main/attributeConfigList"})},checkEvent:function(){var t=this;this.$refs["detailInfo"].validate((function(e){if(!e)return t.$message({message:t.$i18n.t("message.fillRequired"),type:"warning"}),!1;t.submit()}))},submit:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,i,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(a in e=this.getAuthObj(),this.detailInfo)n=JSON.stringify(this.detailInfo[a]),e[a]=JSON.parse(n);if(!this.$route.query.id){t.next=10;break}return e.id=this.$route.query.id,e.apiUrl=this.apiConfig.attributeConfigUpdate,t.next=7,this.$store.dispatch("apiPutEvent",e);case 7:i=t.sent,t.next=14;break;case 10:return e.apiUrl=this.apiConfig.attributeConfigCreate,t.next=13,this.$store.dispatch("apiEvent",e);case 13:i=t.sent;case 14:if(i!=this.TOKEN_EXPIRED){t.next=17;break}return this.timeoutEvent(),t.abrupt("return");case 17:if(i){t.next=19;break}return t.abrupt("return");case 19:0===i.data.code&&(this.$store.state.edit=!1,this.$router.go(-1));case 20:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}}),l=o,c=i("2877"),u=Object(c["a"])(l,a,n,!1,null,null,null);e["default"]=u.exports},"94d7":function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"input-group img-group"},[e("div",{staticClass:"text-center dropzone logo"},[e("input",{ref:"file",staticClass:"upload-file img-file-m",attrs:{type:"file",accept:"image/*"},on:{change:function(e){return t.handleFileUpload()}}}),e("input",{staticClass:"upload-file img-file-m",staticStyle:{"z-index":"0"},attrs:{name:"logo0"}}),t.showImageUrl?t._e():e("div",{staticClass:"addImage",staticStyle:{width:"100%","padding-top":"25px",color:"#fff"}},[t._m(0),e("p",{staticClass:"text-primary m-t-sm font14 suggestFont"},[t._t("sizeHint")],2)]),t.showImageUrl?e("div",{staticClass:"editImage"},[e("div",{staticClass:"mask-bg"}),e("img",{class:{originalImage:t.originalImage},attrs:{src:t.$store.state.userInfo.config.imageUrl+t.showImageUrl}}),e("div",{staticClass:"icon-center"},[e("span",{staticClass:"edit-icon"},[e("i",{staticClass:"el-icon-edit pointer"}),t.downloadImage?e("i",{staticClass:"el-icon-download pointer",staticStyle:{"padding-left":"15px"},on:{click:function(e){return t.downloadImageEvent(t.$store.state.userInfo.config.imageUrl+t.showImageUrl)}}}):t._e(),t.clear?e("i",{staticClass:"el-icon-delete pointer",on:{click:t.clearEvent}}):t._e()]),e("p",{staticClass:"font14 font-white editFont"},[t._v(t._s(t.$props.modifyLabel))]),e("p",{staticClass:"text-primary font-white m-t-sm font14 suggestFont"},[t._t("sizeHint")],2)])]):t._e()])]),t.haveSizeError?t._t("sizeError",(function(){return[t._v(t._s(t.$t("message.Image size error")))]})):t._e(),t.haveDimensionError?t._t("dimensionError",(function(){return[t._v(t._s(t.$t("message.Dimension Error")))]})):t._e(),t.haveUploadError?t._t("UploadError",(function(){return[t._v("Upload Failed!")]})):t._e()],2)},n=[function(){var t=this,e=t._self._c;return e("a",{staticClass:"addImageIcon btn btn-primary btn-circle"},[e("i",{staticClass:"el-icon-upload2"})])}],r=(i("a481"),i("96cf"),i("3b8d")),s=(i("c5f6"),i("bc3a")),o=i.n(s),l=(i("c0d6"),{name:"file-upload",components:{},data:function(){return{haveSizeError:!1,haveDimensionError:!1,haveUploadError:!1}},props:{fileUploadUrl:String,value:String,modifyLabel:{type:String,default:"Modify"},sizeHints:{type:String,default:""},filewidth:{type:Number,default:0},fileheight:{type:Number,default:0},limit:{type:Number,default:0},type:String,accesstoken:String,callback:null,item:{},downloadImage:!1,originalImage:!1,clear:!1},computed:{showImageUrl:function(){return this.$props.value},showSizeHint:function(){return this.$props.sizeHint?this.$props.sizeHints:"".concat(this.$props.filewidth," x ").concat(this.$props.fileheight,", Max ").concat(this.$props.limit," MB.")}},methods:{_checkFilesize:function(t){var e=t.size;return e<=1e3*this.$props.limit*1e3},_checkImagesize:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){var i,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(0!==this.$props.filewidth||0!==this.$props.fileheight){t.next=2;break}return t.abrupt("return",!1);case 2:if(!e){t.next=12;break}return t.next=5,new Promise((function(t,i){var a=new Image;a.onload=function(){window.URL.revokeObjectURL(a.src),t({height:a.height,width:a.width})},a.onerror=i,a.src=window.URL.createObjectURL(e)}));case 5:if(i=t.sent,a=i.width,n=i.height,a===this.$props.filewidth&&n===this.$props.fileheight){t.next=11;break}return t.abrupt("return",!1);case 11:return t.abrupt("return",!0);case 12:return t.abrupt("return",!1);case 13:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),downloadImageEvent:function(t){window.open(t)},handleFileUpload:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=this,this.haveSizeError=!1,this.haveDimensionError=!1,this.haveUploadError=!1,this.file=this.$refs.file.files[0],i=new FileReader,i.readAsDataURL(this.file),i.onload=function(t){var i=this,a=t.target.result.replace("image/jpeg","image/jpg"),n={};e.accesstoken?n.accessToken=e.accesstoken:n.accessToken=e.$store.state.userInfo.accessToken,n.tokenType=e.$store.state.userInfo.tokenType,n.lang="en_US",n.image=a,n.type=e.type;var r=n.tokenType+" "+n.accessToken;delete n["tokenType"],delete n["accessToken"],o.a.post(e.fileUploadUrl,n,{headers:{"Content-Type":"application/json",Authorization:"".concat(r)}}).then((function(t){0===t.data.code&&(e.$emit("input",t.data.payload.fileName),i.callback&&e.callback(t.data.payload,e.item)),e.$refs.file.value=""})).catch((function(){e.$refs.file.value="",e.haveUploadError=!0}))};case 8:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),clearEvent:function(){this.$emit("input",""),this.callback&&this.callback({},this.item)}},mounted:function(){},created:function(){}}),c=l,u=i("2877"),d=Object(u["a"])(c,a,n,!1,null,null,null);e["a"]=d.exports},a481:function(t,e,i){"use strict";var a=i("cb7c"),n=i("4bf8"),r=i("9def"),s=i("4588"),o=i("0390"),l=i("5f1b"),c=Math.max,u=Math.min,d=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g,g=function(t){return void 0===t?t:String(t)};i("214f")("replace",2,(function(t,e,i,h){return[function(a,n){var r=t(this),s=void 0==a?void 0:a[e];return void 0!==s?s.call(a,r,n):i.call(String(r),a,n)},function(t,e){var n=h(i,t,this,e);if(n.done)return n.value;var d=a(t),f=String(this),p="function"===typeof e;p||(e=String(e));var v=d.global;if(v){var b=d.unicode;d.lastIndex=0}var $=[];while(1){var y=l(d,f);if(null===y)break;if($.push(y),!v)break;var w=String(y[0]);""===w&&(d.lastIndex=o(f,r(d.lastIndex),b))}for(var I="",C=0,k=0;k<$.length;k++){y=$[k];for(var _=String(y[0]),x=c(u(s(y.index),f.length),0),E=[],T=1;T<y.length;T++)E.push(g(y[T]));var U=y.groups;if(p){var S=[_].concat(E,x,f);void 0!==U&&S.push(U);var j=String(e.apply(void 0,S))}else j=m(_,f,x,E,U,e);x>=C&&(I+=f.slice(C,x)+j,C=x+_.length)}return I+f.slice(C)}];function m(t,e,a,r,s,o){var l=a+t.length,c=r.length,u=p;return void 0!==s&&(s=n(s),u=f),i.call(o,u,(function(i,n){var o;switch(n.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,a);case"'":return e.slice(l);case"<":o=s[n.slice(1,-1)];break;default:var u=+n;if(0===u)return i;if(u>c){var f=d(u/10);return 0===f?i:f<=c?void 0===r[f-1]?n.charAt(1):r[f-1]+n.charAt(1):i}o=r[u-1]}return void 0===o?"":o}))}}))}}]);
//# sourceMappingURL=view-attributeConfigDetail-vue.526191f4.js.map