(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0bf140e5"],{"0029":function(t,e,i){},"06c0":function(t,e,i){},"58c5":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"layout"},[e("div",{staticClass:"header"},[e("van-icon",{staticClass:"vanIcon",attrs:{name:"arrow-left"},on:{click:t.backtrack}}),e("span",[t._v("演习图文记录")])],1),e("div",{staticClass:"textContent",staticStyle:{"background-color":"#eee"}},[e("div",{staticClass:"sample"},[e("van-cell-group",[e("van-cell",{attrs:{title:"演习名称",value:this.$route.query.drillName}}),e("van-cell",{attrs:{title:"演习类型",value:this.$route.query.drillType}}),e("van-cell",{attrs:{title:"演习地点",value:this.$route.query.drillArea}})],1)],1),e("div",{staticClass:"sample"},[e("span",[t._v("上传演习过程图片")]),e("div",{staticClass:"photo"},[e("Photo",{attrs:{type:""},on:{getPhoto:t.getPhoto}})],1),e("van-field",{staticStyle:{"margin-top":"0.2rem","border-bottom":"0.01rem solid #ccc"},attrs:{clearable:"",label:"演习内容描述",placeholder:"请输入演习内容",rules:[{required:!0,message:"请输入演习内容"}],value:t.mark,maxlength:"100"},on:{input:t.getFieldValue}})],1)]),e("div",{staticClass:"foot"},[e("van-button",{attrs:{type:"info"},on:{click:t.doEnd}},[t._v("提 交")])],1)])},a=[],o=(i("14d9"),i("907a"),i("986a"),i("1d02"),i("3c5d"),i("6ce5"),i("2834"),i("4ea1"),i("669d"),i("109c"),i("b2c1"),i("b7ef"),i("c437")),n=i("c761"),l={name:"VueCli4VantIndex",data(){return{showPopover:!1,person:"请选择",fileList:[],mark:"",user:{}}},components:{Photo:o["a"]},mounted(){window.suplink.getUserInfo().then(t=>{"200"===t.code&&(this.user=t.data)})},methods:{backtrack(){this.$router.go(-1)},onSelect(t){console.log(t),this.person=t.text},getPhoto(t){this.fileList=t.fileList,this.loading=!0,this.chartUrl="";const e=[];t.fileList.forEach((t,i)=>{const s=new window.File([this.dataURLtoBlob(t.content)],`演习签名表图片${i}.jpg`,{type:"jpg"});console.log(s);var a=new FormData;a.append("file",s),a.append("moduleName","emergency"),e.push(Object(n["y"])(a))}),Promise.all(e).then(t=>{console.log(t),t.forEach((t,e)=>{this.chartUrl+=e?","+t.data.msg:t.data.msg}),console.log(this.chartUrl)})},doEnd(){void 0!==this.chartUrl?(console.log(this.mark),""!==this.mark?Object(n["t"])({created:this.user.username,planId:this.$route.query.planid,recordId:this.$route.query.recordId,remarks:this.mark,picUrl:this.chartUrl}).then(({data:t})=>{console.log(t),200===t.code?(this.$emit("cloneSpecific",!1),this.$notify({type:"success",message:"操作成功!"}),this.$router.go(-1)):this.$notify({type:"danger",message:t.msg})}):this.$notify({type:"danger",message:"请填写演习内容描述"})):this.$notify({type:"danger",message:"请上传图片"})},getFieldValue(t){this.mark=t},dataURLtoBlob(t){var e=t.split(",");const i=e[0].match(/:(.*?);/)[1],s=window.atob(e[1]);let a=s.length;const o=new Uint8Array(a);while(a--)o[a]=s.charCodeAt(a);return new Blob([o],{type:i})}}},r=l,c=(i("9736"),i("2877")),h=Object(c["a"])(r,s,a,!1,null,"a64c7aa2",null);e["default"]=h.exports},"72db":function(t,e,i){"use strict";i("06c0")},9736:function(t,e,i){"use strict";i("0029")},c437:function(t,e,i){"use strict";var s=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"photo"},[e("van-uploader",{attrs:{multiple:"",accept:"image/*","after-read":t.fileImage,"before-delete":t.deletes,"preview-size":"24vw","preview-full-image":!1},on:{"click-preview":t.preview},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1),e("van-image-preview",{attrs:{images:t.images},model:{value:t.showPic,callback:function(e){t.showPic=e},expression:"showPic"}})],1)},a=[],o=(i("68ef"),i("a71a"),i("9d70"),i("3743"),i("09fe"),i("4d75"),i("e3b3"),i("8270"),i("786d"),i("504b"),i("28a2"));i("14d9"),i("741a"),i("5ff5"),i("907a"),i("986a"),i("1d02"),i("3c5d"),i("6ce5"),i("2834"),i("4ea1"),i("669d"),i("109c"),i("b2c1"),i("b7ef");function n(t,e,i){return i.readAsDataURL(t),new Promise((function(s,a){i.onload=function(i){const a=new Image;a.src=i.target.result,a.onload=function(){const i=e.width,a=e.height,o=document.createElement("canvas"),n=o.getContext("2d");let l=null;o.setAttribute("width",i),o.setAttribute("height",a),n.drawImage(this,0,0,i,a),l=o.toDataURL(t.type,e.quality),s(l)}}}))}var l={props:{list:{type:Array,required:!0},index:{type:Number,required:!1}},name:"VueCli4VantIndex",data(){return{fileList:[],isEditor:!1,showPic:!1,images:[]}},components:{[o["a"].Component.name]:o["a"].Component},watch:{list(t,e){t&&(this.list=t,this.list.forEach(t=>{this.fileList.push({content:t})}),this.$emit("getPhoto",{fileList:this.fileList,index:this.index}))}},mounted(){console.log(this.list),this.fileList=[],this.list.forEach(t=>{this.fileList.push({content:t})})},methods:{preview(t,e){console.log(t,e),this.images=[],this.images.push(t.content),this.showPic=!0},getImages(t){const e=t.size/1024<200;return!!e||new Promise(e=>{compressAccurately(t,{size:2048,width:400}).then(i=>{const s=new File([i],t.name,{type:t.type});e(s)})})},fileImage(){const t={width:600,height:600,quality:.9};this.fileList.forEach(async(e,i)=>{if(e.file){const s=new FileReader;await n(e.file,t,s).then(t=>{this.fileList[i].content=t,i===this.fileList.length-1&&this.$emit("getPhoto",{fileList:this.fileList,index:this.index})})}})},deletes(){return this.$nextTick(async()=>{this.$emit("getPhoto",{fileList:this.fileList,index:this.index})}),!0},close(){this.isEditor=!1}}},r=l,c=(i("72db"),i("2877")),h=Object(c["a"])(r,s,a,!1,null,"1a4af3ba",null);e["a"]=h.exports}}]);