"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[389],{81520:(t,i,e)=>{e.d(i,{Z:()=>o});function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}const a={name:"ImgUpload",props:{value:{},num:{},width:{},height:{},whcut:{},type:{},http:{type:Boolean,default:!1},otherParams:{type:Object,default:function(){return{}}},uploadIng:{type:Number,default:0}},data:function(){return{actionUrl:$A.apiUrl("system/imgupload"),multiple:this.num>1,visible:!1,browseVisible:!1,isLoading:!1,browseList:[],browseListNext:[],imgVisible:"",defaultList:this.initItems(this.value),uploadList:[],maxNum:Math.min(Math.max($A.runNum(this.num),1),99),httpValue:"",httpType:"",maxSize:2048}},mounted:function(){var t=this;this.uploadList=this.$refs.upload.fileList,this.$emit("input",this.uploadList);var i=$A(this.$refs.browselistbox);i.scroll((function(){var e=i[0].scrollHeight;if(i[0].scrollTop+i.height()>=e&&t.browseListNext.length>0){var s=t.browseListNext;t.browseListNext=[],t.browsePictureFor(s)}}))},watch:{value:function(t){"string"!=typeof t?t!==this.$refs.upload.fileList&&(this.$refs.upload.fileList=this.initItems(t),this.uploadList=this.$refs.upload.fileList):this.$emit("input",this.initItems(t))},browseVisible:function(){this.httpType="",this.httpValue=""}},computed:{uploadHeaders:function(){return{fd:$A.getSessionStorageString("userWsFd"),token:this.userToken}},uploadParams:function(){var t={width:this.width,height:this.height,whcut:this.whcut};return Object.keys(this.otherParams).length>0?Object.assign(t,this.otherParams):t}},methods:{handleCallback:function(t){"callback"===this.type&&(!0===t?(this.$emit("on-callback",this.uploadList),this.$refs.upload.fileList=[],this.uploadList=this.$refs.upload.fileList):"object"===s(t)&&this.$emit("on-callback",[t])),this.browseVisible=!1},initItems:function(t){"string"==typeof t&&(t=[{url:t}]);var i=[];return $A.each(t,(function(t,e){"string"==typeof e&&(e={url:e}),e.url&&(e.active=!0,e.status="finished",void 0===e.path&&(e.path=e.url),void 0===e.thumb&&(e.thumb=e.url),i.push(e))})),i},handleView:function(t){this.visible=!0,this.imgVisible=t.url},handleRemove:function(t){var i=this.$refs.upload.fileList;this.$refs.upload.fileList.splice(i.indexOf(t),1),this.$emit("input",this.$refs.upload.fileList)},handleProgress:function(t,i){void 0===i._uploadIng&&(i._uploadIng=!0,this.$emit("update:uploadIng",this.uploadIng+1))},handleSuccess:function(t,i){this.$emit("update:uploadIng",this.uploadIng-1),1===t.ret?(i.url=t.data.url,i.path=t.data.path,i.thumb=t.data.thumb,this.handleCallback(i)):($A.noticeWarning({title:this.$L("上传失败"),desc:this.$L("文件 "+i.name+" 上传失败 "+t.msg)}),this.$refs.upload.fileList.pop()),this.$emit("input",this.$refs.upload.fileList)},handleError:function(){this.$emit("update:uploadIng",this.uploadIng-1)},handleFormatError:function(t){$A.noticeWarning({title:this.$L("文件格式不正确"),desc:this.$L("文件 "+t.name+" 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。")})},handleMaxSize:function(t){$A.noticeWarning({title:this.$L("超出文件大小限制"),desc:this.$L("文件 "+t.name+" 太大,不能超过:"+$A.bytesToSize(1024*this.maxSize))})},handleBeforeUpload:function(){var t=this.uploadList.length{e.r(i),e.d(i,{default:()=>a});const s={components:{ImgUpload:e(81520).Z},data:function(){return{loadIng:0,formData:{language:""},ruleData:{}}},mounted:function(){this.initData()},methods:{initData:function(){this.$set(this.formData,"language",this.getLanguage()),this.formData_bak=$A.cloneJSON(this.formData)},submitForm:function(){var t=this;this.$refs.formData.validate((function(i){i&&t.setLanguage(t.formData.language)}))},resetForm:function(){this.formData=$A.cloneJSON(this.formData_bak)}}};const a=(0,e(51900).Z)(s,(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"setting-item submit"},[e("Form",{ref:"formData",attrs:{model:t.formData,rules:t.ruleData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:t.$L("选择语言"),prop:"language"}},[e("Select",{attrs:{placeholder:t.$L("选项语言")},model:{value:t.formData.language,callback:function(i){t.$set(t.formData,"language",i)},expression:"formData.language"}},t._l(t.languageList,(function(i,s){return e("Option",{key:s,attrs:{value:s}},[t._v(t._s(i))])})),1)],1)],1),t._v(" "),e("div",{staticClass:"setting-footer"},[e("Button",{attrs:{loading:t.loadIng>0,type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$L("提交")))]),t._v(" "),e("Button",{staticStyle:{"margin-left":"8px"},attrs:{loading:t.loadIng>0},on:{click:t.resetForm}},[t._v(t._s(t.$L("重置")))])],1)],1)}),[],!1,null,null,null).exports}}]);