(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0069cb2f"],{"43b5":function(e,t,i){},"598b":function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return p}));i("34ef"),i("6b54"),i("a481"),i("7f7f");var a=i("5530"),s=(i("ac6a"),i("fbf9")),r=i.n(s),o=i("547c"),l=i.n(o),n=i("0083"),d=i.n(n),m=i("21a6"),c=i("f2e2"),u="",p=function(e,t,s){var o=i("654f");d.a.getBinaryContent(e,(function(e,i){if(e)throw e;var n={centered:!0,fileType:"docx"},d=new Promise((function(e){var i=[];t.fileList.length>0?t.fileList.forEach((function(a){v(a.url,(function(a){i.push({src:a}),i.length===t.fileList.length&&e(i)}))})):e(i)}));d.then((function(d){n.getImage=function(e){return h(e)},n.getSize=function(){return[180,120]};var c=new o(n),u=new l.a(i),p=(new r.a).loadZip(u);p.attachModule(c);var v=Object(a["a"])(Object(a["a"])({},t),{},{images:d});p.setData(Object(a["a"])({},v));try{p.render()}catch(e){var f={message:e.message,name:e.name,stack:e.stack,properties:e.properties};throw console.log({error:f}),e}var g=p.getZip().generate({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"});Object(m["saveAs"])(g,s)}))}))};function h(t){var i=/^data:image\/(png|jpg|svg|svg\+xml);base64,/;if(!i.test(t))return!1;var a,s=t.replace(i,"");a="undefined"!==typeof window?window.atob(s):new e(s,"base64").toString("binary");for(var r=a.length,o=new Uint8Array(r),l=0;l0&&(t.cityCode=this.newRegion[this.newRegion.length-1]),""!==this.value2&&(t.start=this.value2[0],t.end=this.value2[1]),this.$request({url:"/supervision/select",method:"get",params:t}).then((function(t){if(0===t.code){var i=t.data.item;i.length>0?(e.tableData=i.map((function(e){return e.name=e.cityName+"大气污染防治督办单",e})),e.pageData.total=t.data.total):e.tableData=[]}}))},getRegionApi:function(){this.$store.state.regionCode=this.newRegion[this.newRegion.length-1],this.getSurveyData()},currentChange:function(e){this.pageData.current=e,this.getSurveyData()},showAddDialog:function(){this.index=0,this.dialogVisible=!0},getCityName:function(){0===this.index&&(this.addForm.cityName=this.$refs.cityNode.getCheckedNodes()[0].label),1===this.index&&(this.editForm.cityName=this.$refs.cityNode1.getCheckedNodes()[0].label)},fileChange:function(e,t){var i=["image/png","image/jpeg","image/jpg"],a=-1!==i.indexOf(e.raw.type),s=e.size/1024/1024<3;return a?s?(0===this.index&&this.addForm.files.push(e.raw),void(1===this.index&&this.editForm.files.push(e.raw))):(this.$message.error("上传图片大小不能超过 3MB!"),this.$refs.upload.clearFiles(),this.$refs.upload1.clearFiles(),this.addForm.files=null,void(this.editForm.files=null)):(this.$message.error("只能是图片!"),this.$refs.upload.clearFiles(),this.$refs.upload1.clearFiles(),this.addForm.files=null,void(this.editForm.files=null))},handleRemove:function(e,t){var i=this;t.length>0?(0===this.index&&(this.addForm.files=t.map((function(e){return e.raw}))),1===this.index&&(this.editForm.files=[],t.forEach((function(e){i.handleImgToBase64(e.url,(function(e){i.editForm.files.push(e)}))})))):(0===this.index&&(this.addForm.files=[]),1===this.index&&(this.editForm.files=[]))},handlePictureCardPreview:function(e){0===this.index?(this.dialogImageUrl=e.url,this.dialogVisibleImage=!0):(this.dialogImageUrl1=e.url,this.dialogVisibleImage1=!0)},okAdd:function(){var e=this;this.$refs.ruleForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;var i=new FormData;Object.keys(e.addForm).forEach((function(t){"cityCode"===t?i.append(t,e.addForm[t].pop()):"files"===t?e.addForm[t].length>0?e.addForm[t].forEach((function(e){i.append(t,e)})):i.append(t,e.addForm[t][0]):i.append(t,e.addForm[t])})),e.$request({url:"/supervision/add",method:"post",headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(t){0===t.code?(e.dialogVisible=!1,e.$message.success(t.message),e.getSurveyData(),e.dialogImageUrl="",e.$refs["ruleForm"].resetFields(),e.addForm.cityCode=[],e.addForm.cityName="",e.addForm.files=[],e.$refs.upload.clearFiles()):e.$message.warning(t.message)}))}))},editReport:function(e){var t=this;this.index=1,this.editReportFlag=!0;var i=(e.cityCode+"").substr(4,6),a=(e.cityCode+"").substr(2,6);if(this.editForm.cityCode="00"===i?"0000"===a?[Number(e.cityCode)]:[Number((e.cityCode+"").substr(0,2)+"0000"),Number(e.cityCode)]:[Number((e.cityCode+"").substr(0,2)+"0000"),Number((e.cityCode+"").substr(0,4)+"00"),Number(e.cityCode)],this.editForm.id=e.id,this.editForm.time=e.time,this.editForm.superviseeUnit=e.superviseeUnit,this.editForm.handler=e.handler,this.editForm.number=e.number,this.editForm.numberTimes=e.numberTimes,this.editForm.problemDesc=e.problemDesc,this.editForm.problemType=e.problemType,this.editForm.measures=e.measures,null!==e.images){var s=e.images.split(",");s.forEach((function(e){var i="".concat(l["a"].baseUrl,"/static/img/")+e;t.handleImgToBase64(i,(function(e){t.editForm.files.push(e)})),t.editForm.fileList.push({url:i})}))}else this.editForm.files=[],this.editForm.fileList=[];this.beforeEditForm=JSON.parse(JSON.stringify(this.editForm))},showReport:function(e){var t=this;if(this.showReportFlag=!0,this.showForm.time=e.time,this.showForm.cityName=e.cityName,this.showForm.superviseeUnit=e.superviseeUnit,this.showForm.number=e.number,this.showForm.handler=e.handler,this.showForm.problemDesc=e.problemDesc,this.showForm.problemType=e.problemType,this.showForm.measures=e.measures,this.showForm.numberTimes=e.numberTimes,console.log(l["a"]),null!==e.images){var i=e.images.split(",");i.forEach((function(e){var i="".concat(l["a"].baseUrl,"/static/img/")+e;t.showForm.fileList.push({url:i})}))}else this.showForm.fileList=[]},handleImgToBase64:function(e,t){var i=new Image;i.crossOrigin="*",i.src=e,i.onload=function(){var e=Object(r["b"])(i),a=Object(r["a"])(e,+new Date+".png");return t&&"function"===typeof t&&t(a),a}},editSave:function(){var e=this;this.$refs.editRuleForm.validate((function(t){if(t){var i=e.editForm.cityCode.pop(),a=e.beforeEditForm.cityCode.pop(),s={};s.id=e.editForm.id,s.cityCode=i===a?null:i,s.cityName=i===a?null:e.editForm.cityName,s.time=e.editForm.time===e.beforeEditForm.time?null:e.editForm.time,s.superviseeUnit=e.editForm.superviseeUnit===e.beforeEditForm.superviseeUnit?null:e.editForm.superviseeUnit,s.number=e.editForm.number===e.beforeEditForm.number?null:e.editForm.number,s.problemType=e.editForm.problemType===e.beforeEditForm.problemType?null:e.editForm.problemType,s.problemDesc=e.editForm.problemDesc===e.beforeEditForm.problemDesc?null:e.editForm.problemDesc,s.handler=e.editForm.handler===e.beforeEditForm.handler?null:e.editForm.handler,s.numberTimes=e.editForm.numberTimes===e.beforeEditForm.numberTimes?null:e.editForm.numberTimes,s.measures=e.editForm.measures===e.beforeEditForm.measures?null:e.editForm.measures,s.files=JSON.stringify(e.editForm.files)===JSON.stringify(e.beforeEditForm.files)?null:e.editForm.files;var r=new FormData;Object.keys(s).forEach((function(e){"files"===e?s[e].length>0?s[e].forEach((function(t){r.append(e,t)})):r.append(e,s[e][0]):r.append(e,s[e])})),e.$request({url:"/supervision/update",method:"post",headers:{"Content-Type":"multipart/form-data"},data:r}).then((function(t){0===t.code&&(e.$message.success(t.message),e.editReportFlag=!1,e.getSurveyData(),e.editForm={id:-1,cityCode:[],cityName:"",time:"",superviseeUnit:"",number:"",problemType:"",problemDesc:"",handler:"",numberTimes:"",measures:"",files:[],fileList:[]},e.index=0)}))}}))},cancelSave:function(){this.editReportFlag=!1,this.editForm.fileList=[],this.editForm.files=[],this.editForm.cityCode=[],this.index=0},handleClose:function(){1===this.index?(this.editReportFlag=!1,this.editForm.fileList=[],this.editForm.files=[],this.editForm.cityCode=[],this.index=0):(this.dialogVisible=!1,this.dialogImageUrl="",this.$refs["ruleForm"].resetFields(),this.addForm.cityCode=[],this.addForm.cityName="",this.addForm.files=[],this.$refs.upload.clearFiles())},handleClose1:function(){this.showForm.fileList=[],this.showReportFlag=!1},deleteReport:function(e){var t=this;this.$request({method:"get",url:"/supervision/delete",params:{supervisionId:e.id}}).then((function(e){0===e.code?(t.$message.success(e.message),t.getSurveyData()):t.$message.warning(e.message)}))},exportWord:function(){null===this.showForm.measures&&(this.showForm.measures=""),Object(o["a"])("/demo.docx",this.showForm,"".concat(this.showForm.cityName,"大气污染防治督办单(").concat(this.showForm.time,").docx"))}}},d=n,m=(i("e83c"),i("2877")),c=Object(m["a"])(d,a,s,!1,null,null,null);t["default"]=c.exports},e83c:function(e,t,i){"use strict";i("43b5")},f2e2:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return s}));i("34ef"),i("4917"),i("28a5");var a=function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);var a=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase(),s=t.toDataURL("image/jpeg"+a);return s},s=function(e,t){var i=e.split(","),a=i[0].match(/:(.*?);/)[1],s=atob(i[1]),r=s.length,o=new Uint8Array(r);while(r--)o[r]=s.charCodeAt(r);return new File([o],t,{type:a})}}}]);